[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/55] target/alpha: fix tlb_fill trap_arg2 value for instruction
From: |
Michael Roth |
Subject: |
[PATCH 04/55] target/alpha: fix tlb_fill trap_arg2 value for instruction fetch |
Date: |
Tue, 5 Nov 2019 14:51:52 -0600 |
From: Aurelien Jarno <address@hidden>
Commit e41c94529740cc26 ("target/alpha: Convert to CPUClass::tlb_fill")
slightly changed the way the trap_arg2 value is computed in case of TLB
fill. The type of the variable used in the ternary operator has been
changed from an int to an enum. This causes the -1 value to not be
sign-extended to 64-bit in case of an instruction fetch. The trap_arg2
ends up with 0xffffffff instead of 0xffffffffffffffff. Fix that by
changing the -1 into -1LL.
This fixes the execution of user space processes in qemu-system-alpha.
Fixes: e41c94529740cc26
Cc: address@hidden
Signed-off-by: Aurelien Jarno <address@hidden>
[rth: Test MMU_DATA_LOAD and MMU_DATA_STORE instead of implying them.]
Signed-off-by: Richard Henderson <address@hidden>
(cherry picked from commit cb1de55a83eaca9ee32be9c959dca99e11f2fea8)
Signed-off-by: Michael Roth <address@hidden>
---
target/alpha/helper.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 93b8e788b1..d0cc623192 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -283,7 +283,9 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,
cs->exception_index = EXCP_MMFAULT;
env->trap_arg0 = addr;
env->trap_arg1 = fail;
- env->trap_arg2 = (access_type == MMU_INST_FETCH ? -1 : access_type);
+ env->trap_arg2 = (access_type == MMU_DATA_LOAD ? 0ull :
+ access_type == MMU_DATA_STORE ? 1ull :
+ /* access_type == MMU_INST_FETCH */ -1ull);
cpu_loop_exit_restore(cs, retaddr);
}
--
2.17.1
- [PATCH 50/55] util/hbitmap: strict hbitmap_reset, (continued)
- [PATCH 50/55] util/hbitmap: strict hbitmap_reset, Michael Roth, 2019/11/05
- [PATCH 05/55] pc: Don't make die-id mandatory unless necessary, Michael Roth, 2019/11/05
- [PATCH 51/55] hbitmap: handle set/reset with zero length, Michael Roth, 2019/11/05
- [PATCH 52/55] target/arm: Allow reading flags from FPSCR for M-profile, Michael Roth, 2019/11/05
- [PATCH 55/55] virtio-blk: Cancel the pending BH when the dataplane is reset, Michael Roth, 2019/11/05
- [PATCH 21/55] qcow2: Fix the calculation of the maximum L2 cache size, Michael Roth, 2019/11/05
- [PATCH 44/55] iotests: Test large write request to qcow2 file, Michael Roth, 2019/11/05
- [PATCH 48/55] virtio-net: prevent offloads reset on migration, Michael Roth, 2019/11/05
- [PATCH 06/55] xen-bus: Fix backend state transition on device reset, Michael Roth, 2019/11/05
- [PATCH 08/55] block/file-posix: Reduce xfsctl() use, Michael Roth, 2019/11/05
- [PATCH 04/55] target/alpha: fix tlb_fill trap_arg2 value for instruction fetch,
Michael Roth <=
- [PATCH 43/55] qcow2: Limit total allocation range to INT_MAX, Michael Roth, 2019/11/05
- [PATCH 07/55] xen-bus: check whether the frontend is active during device reset..., Michael Roth, 2019/11/05
- [PATCH 53/55] target/xtensa: regenerate and re-import test_mmuhifi_c3 core, Michael Roth, 2019/11/05
- [PATCH 25/55] curl: Check completion in curl_multi_do(), Michael Roth, 2019/11/05
- [PATCH 13/55] iotests: add testing shim for script-style python tests, Michael Roth, 2019/11/05
- [PATCH 49/55] COLO-compare: Fix incorrect `if` logic, Michael Roth, 2019/11/05
- [PATCH 41/55] vhost-user: save features if the char dev is closed, Michael Roth, 2019/11/05
- [PATCH 40/55] iotests: Test internal snapshots with -blockdev, Michael Roth, 2019/11/05
- [PATCH 54/55] scsi: lsi: exit infinite loop while executing script (CVE-2019-12068), Michael Roth, 2019/11/05
- [PATCH 37/55] roms/Makefile.edk2: don't pull in submodules when building from tarball, Michael Roth, 2019/11/05