[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.2 41/43] tcg: Add helper_unaligned_mmu for user-only sigbus
From: |
Richard Henderson |
Subject: |
[PATCH for-6.2 41/43] tcg: Add helper_unaligned_mmu for user-only sigbus |
Date: |
Wed, 28 Jul 2021 14:46:45 -1000 |
To be called from tcg generated code on hosts that support
unaligned accesses natively, in response to an access that
is supposed to be aligned.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg-ldst.h | 5 +++++
accel/tcg/user-exec.c | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/include/tcg/tcg-ldst.h b/include/tcg/tcg-ldst.h
index 8c86365611..a934bed042 100644
--- a/include/tcg/tcg-ldst.h
+++ b/include/tcg/tcg-ldst.h
@@ -70,5 +70,10 @@ void helper_be_stl_mmu(CPUArchState *env, target_ulong addr,
uint32_t val,
void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
MemOpIdx oi, uintptr_t retaddr);
+#else
+
+void QEMU_NORETURN helper_unaligned_mmu(CPUArchState *env, target_ulong addr,
+ uint32_t type, uintptr_t ra);
+
#endif /* CONFIG_SOFTMMU */
#endif /* TCG_LDST_H */
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index e8a82dd43f..5cbae7a7cc 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -27,6 +27,7 @@
#include "exec/helper-proto.h"
#include "qemu/atomic128.h"
#include "trace/trace-root.h"
+#include "tcg/tcg-ldst.h"
#undef EAX
#undef ECX
@@ -866,9 +867,9 @@ static void validate_memop(MemOpIdx oi, MemOp expected)
#endif
}
-static void cpu_unaligned_access(CPUState *cpu, vaddr addr,
- MMUAccessType access_type,
- int mmu_idx, uintptr_t ra)
+static void QEMU_NORETURN
+cpu_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type,
+ int mmu_idx, uintptr_t ra)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
@@ -876,6 +877,12 @@ static void cpu_unaligned_access(CPUState *cpu, vaddr addr,
g_assert_not_reached();
}
+void helper_unaligned_mmu(CPUArchState *env, target_ulong addr,
+ uint32_t access_type, uintptr_t ra)
+{
+ cpu_unaligned_access(env_cpu(env), addr, access_type, MMU_USER_IDX, ra);
+}
+
static void *cpu_mmu_lookup(CPUArchState *env, target_ulong addr,
MemOpIdx oi, uintptr_t ra, MMUAccessType type)
{
--
2.25.1
- Re: [PATCH for-6.2 34/43] target/mips: Use cpu_*_data_ra for msa load/store, (continued)
- [PATCH for-6.2 36/43] target/s390x: Use cpu_*_mmu instead of helper_*_mmu, Richard Henderson, 2021/07/28
- [PATCH for-6.2 38/43] target/arm: Use cpu_*_mmu instead of helper_*_mmu, Richard Henderson, 2021/07/28
- [PATCH for-6.2 39/43] tcg: Move helper_*_mmu decls to tcg/tcg-ldst.h, Richard Henderson, 2021/07/28
- [PATCH for-6.2 35/43] target/mips: Use 8-byte memory ops for msa load/store, Richard Henderson, 2021/07/28
- [PATCH for-6.2 37/43] target/sparc: Use cpu_*_mmu instead of helper_*_mmu, Richard Henderson, 2021/07/28
- [PATCH for-6.2 40/43] linux-user/alpha: Remove TARGET_ALIGNED_ONLY, Richard Henderson, 2021/07/28
- [PATCH for-6.2 41/43] tcg: Add helper_unaligned_mmu for user-only sigbus,
Richard Henderson <=
- [PATCH for-6.2 43/43] tests/tcg/multiarch: Add sigbus.c, Richard Henderson, 2021/07/28
- [PATCH for-6.2 42/43] tcg/i386: Support raising sigbus for user-only, Richard Henderson, 2021/07/28
- Re: [PATCH for-6.2 00/43] Unaligned accesses for user-only, Philippe Mathieu-Daudé, 2021/07/29