[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/29] linux-user/arm: Remove bogus SVC 0xf0002 handling
From: |
Peter Maydell |
Subject: |
[PULL 08/29] linux-user/arm: Remove bogus SVC 0xf0002 handling |
Date: |
Thu, 21 May 2020 20:15:49 +0100 |
We incorrectly treat SVC 0xf0002 as a cacheflush request (which is a
NOP for QEMU). This is the wrong syscall number, because in the
svc-immediate OABI syscall numbers are all offset by the
ARM_SYSCALL_BASE value and so the correct insn is SVC 0x9f0002.
(This is handled further down in the code with the other Arm-specific
syscalls like NR_breakpoint.)
When this code was initially added in commit 6f1f31c069b20611 in
2004, ARM_NR_cacheflush was defined as (ARM_SYSCALL_BASE + 0xf0000 + 2)
so the value in the comparison took account of the extra 0x900000
offset. In commit fbb4a2e371f2fa7 in 2008, the ARM_SYSCALL_BASE
was removed from the definition of ARM_NR_cacheflush and handling
for this group of syscalls was added below the point where we subtract
ARM_SYSCALL_BASE from the SVC immediate value. However that commit
forgot to remove the now-obsolete earlier handling code.
Remove the spurious ARM_NR_cacheflush condition.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Message-id: address@hidden
---
linux-user/arm/cpu_loop.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c
index 82d0dd3c312..025887d6b86 100644
--- a/linux-user/arm/cpu_loop.c
+++ b/linux-user/arm/cpu_loop.c
@@ -308,9 +308,7 @@ void cpu_loop(CPUARMState *env)
n = insn & 0xffffff;
}
- if (n == ARM_NR_cacheflush) {
- /* nop */
- } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) {
+ if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) {
/* linux syscall */
if (env->thumb || n == 0) {
n = env->regs[7];
--
2.20.1
- [PULL 00/29] target-arm queue, Peter Maydell, 2020/05/21
- [PULL 01/29] tests/acceptance: Add a test for the canon-a1100 machine, Peter Maydell, 2020/05/21
- [PULL 02/29] docs/system: Add 'Arm' to the Integrator/CP document title, Peter Maydell, 2020/05/21
- [PULL 03/29] docs/system: Sort Arm board index into alphabetical order, Peter Maydell, 2020/05/21
- [PULL 04/29] docs/system: Document Arm Versatile Express boards, Peter Maydell, 2020/05/21
- [PULL 05/29] docs/system: Document the various MPS2 models, Peter Maydell, 2020/05/21
- [PULL 06/29] docs/system: Document Musca boards, Peter Maydell, 2020/05/21
- [PULL 07/29] linux-user/arm: BKPT should cause SIGTRAP, not be a syscall, Peter Maydell, 2020/05/21
- [PULL 08/29] linux-user/arm: Remove bogus SVC 0xf0002 handling,
Peter Maydell <=
- [PULL 09/29] linux-user/arm: Handle invalid arm-specific syscalls correctly, Peter Maydell, 2020/05/21
- [PULL 10/29] linux-user/arm: Fix identification of syscall numbers, Peter Maydell, 2020/05/21
- [PULL 11/29] target/arm: Remove unused GEN_NEON_INTEGER_OP macro, Peter Maydell, 2020/05/21
- [PULL 12/29] hw: Move i.MX watchdog driver to hw/watchdog, Peter Maydell, 2020/05/21
- [PULL 13/29] hw/watchdog: Implement full i.MX watchdog support, Peter Maydell, 2020/05/21
- [PULL 14/29] hw/arm/fsl-imx25: Wire up watchdog, Peter Maydell, 2020/05/21
- [PULL 15/29] hw/arm/fsl-imx31: Wire up watchdog, Peter Maydell, 2020/05/21
- [PULL 16/29] hw/arm/fsl-imx6: Connect watchdog interrupts, Peter Maydell, 2020/05/21
- [PULL 17/29] hw/arm/fsl-imx6ul: Connect watchdog interrupts, Peter Maydell, 2020/05/21
- [PULL 18/29] hw/arm/fsl-imx7: Instantiate various unimplemented devices, Peter Maydell, 2020/05/21