mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-tcg-20240202-2' of https://gitlab.com/rth7680/qemu into staging
tests/tcg: Fix multiarch/gdbstub/prot-none.py hw/core: Convert cpu_mmu_index to a CPUClass hook tcg/loongarch64: Set vector registers call clobbered target/sparc: floating-point cleanup linux-user/aarch64: Add padding before __kernel_rt_sigreturn # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmW95WkdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/p+Qf/eVmh5q0pZqcur7ft # 8FO0wlIz55OfhaA9MIpH7LEIHRKY37Ybebw2K6SPnx4FmPhLkaj4KXPPjT2nzdXw # J2nQM+TOyxOd18GG8P80qFQ1a72dj8VSIRVAl9T46KuPXS5B7luArImfBlUk/GwV # Qr/XkOPwVTp05E/ccMJ8PMlcVZw9osHVLqsaFVbsUv/FylTmstzA9c5Gw7/FTfkG # T2rk+7go+F4IXs/9uQuuFMOpQOZngXE621hnro+qle7j9oarEUVJloAgVn06o59O # fUjuoKO0aMCr2iQqNJTH7Dnqp5OIzzxUoXiNTOj0EimwWfAcUKthoFO2LGcy1/ew # wWNR/Q== # =e3J3 # -----END PGP SIGNATURE----- # gpg: Signature made Sat 03 Feb 2024 07:04:09 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * tag 'pull-tcg-20240202-2' of https://gitlab.com/rth7680/qemu: (58 commits) linux-user/aarch64: Add padding before __kernel_rt_sigreturn target/sparc: Remove FSR_FTT_NMASK, FSR_FTT_CEXC_NMASK target/sparc: Split fcc out of env->fsr target/sparc: Remove cpu_fsr target/sparc: Split cexc and ftt from env->fsr target/sparc: Merge check_ieee_exceptions with FPop helpers target/sparc: Clear cexc and ftt in do_check_ieee_exceptions target/sparc: Split ver from env->fsr target/sparc: Introduce cpu_get_fsr, cpu_put_fsr target/sparc: Remove qt0, qt1 temporaries target/sparc: Use i128 for Fdmulq target/sparc: Use i128 for FdTOq, FxTOq target/sparc: Use i128 for FsTOq, FiTOq target/sparc: Use i128 for FCMPq, FCMPEq target/sparc: Use i128 for FqTOd, FqTOx target/sparc: Use i128 for FqTOs, FqTOi target/sparc: Use i128 for FADDq, FSUBq, FMULq, FDIVq target/sparc: Use i128 for FSQRTq target/sparc: Inline FNEG, FABS target/sparc: Introduce gen_{load,store}_fpr_Q ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+13
-9
@@ -1601,7 +1601,7 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, vaddr addr,
|
||||
void *p;
|
||||
|
||||
(void)probe_access_internal(env_cpu(env), addr, 1, MMU_INST_FETCH,
|
||||
cpu_mmu_index(env, true), false,
|
||||
cpu_mmu_index(env_cpu(env), true), false,
|
||||
&p, &full, 0, false);
|
||||
if (p == NULL) {
|
||||
return -1;
|
||||
@@ -2959,26 +2959,30 @@ static void do_st16_mmu(CPUState *cpu, vaddr addr, Int128 val,
|
||||
|
||||
uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
MemOpIdx oi = make_memop_idx(MO_UB, cpu_mmu_index(env, true));
|
||||
return do_ld1_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_UB, cpu_mmu_index(cs, true));
|
||||
return do_ld1_mmu(cs, addr, oi, 0, MMU_INST_FETCH);
|
||||
}
|
||||
|
||||
uint32_t cpu_lduw_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUW, cpu_mmu_index(env, true));
|
||||
return do_ld2_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUW, cpu_mmu_index(cs, true));
|
||||
return do_ld2_mmu(cs, addr, oi, 0, MMU_INST_FETCH);
|
||||
}
|
||||
|
||||
uint32_t cpu_ldl_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUL, cpu_mmu_index(env, true));
|
||||
return do_ld4_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUL, cpu_mmu_index(cs, true));
|
||||
return do_ld4_mmu(cs, addr, oi, 0, MMU_INST_FETCH);
|
||||
}
|
||||
|
||||
uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(env, true));
|
||||
return do_ld8_mmu(env_cpu(env), addr, oi, 0, MMU_INST_FETCH);
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(cs, true));
|
||||
return do_ld8_mmu(cs, addr, oi, 0, MMU_INST_FETCH);
|
||||
}
|
||||
|
||||
uint8_t cpu_ldb_code_mmu(CPUArchState *env, abi_ptr addr,
|
||||
|
||||
+28
-14
@@ -354,7 +354,8 @@ void cpu_stq_le_mmuidx_ra(CPUArchState *env, abi_ptr addr, uint64_t val,
|
||||
|
||||
uint32_t cpu_ldub_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldub_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_ldub_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
int cpu_ldsb_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
@@ -364,7 +365,8 @@ int cpu_ldsb_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
|
||||
uint32_t cpu_lduw_be_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_lduw_be_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_lduw_be_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
int cpu_ldsw_be_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
@@ -374,17 +376,20 @@ int cpu_ldsw_be_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
|
||||
uint32_t cpu_ldl_be_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldl_be_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_ldl_be_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
uint64_t cpu_ldq_be_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldq_be_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_ldq_be_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
uint32_t cpu_lduw_le_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_lduw_le_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_lduw_le_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
int cpu_ldsw_le_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
@@ -394,54 +399,63 @@ int cpu_ldsw_le_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
|
||||
uint32_t cpu_ldl_le_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldl_le_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_ldl_le_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
uint64_t cpu_ldq_le_data_ra(CPUArchState *env, abi_ptr addr, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldq_le_mmuidx_ra(env, addr, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
return cpu_ldq_le_mmuidx_ra(env, addr, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stb_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stb_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stb_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stw_be_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stw_be_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stw_be_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stl_be_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stl_be_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stl_be_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stq_be_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint64_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stq_be_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stq_be_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stw_le_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stw_le_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stw_le_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stl_le_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stl_le_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stl_le_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
void cpu_stq_le_data_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint64_t val, uintptr_t ra)
|
||||
{
|
||||
cpu_stq_le_mmuidx_ra(env, addr, val, cpu_mmu_index(env, false), ra);
|
||||
int mmu_index = cpu_mmu_index(env_cpu(env), false);
|
||||
cpu_stq_le_mmuidx_ra(env, addr, val, mmu_index, ra);
|
||||
}
|
||||
|
||||
/*--------------------------*/
|
||||
|
||||
@@ -311,6 +311,10 @@ CPUArchState *cpu_copy(CPUArchState *env);
|
||||
#define TLB_MMIO (1 << (TARGET_PAGE_BITS_MIN - 2))
|
||||
#define TLB_WATCHPOINT 0
|
||||
|
||||
static inline int cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
{
|
||||
return MMU_USER_IDX;
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "exec/hwaddr.h"
|
||||
#endif
|
||||
#include "hw/core/cpu.h"
|
||||
#include "tcg/debug-assert.h"
|
||||
|
||||
#define EXCP_INTERRUPT 0x10000 /* async interruption */
|
||||
#define EXCP_HLT 0x10001 /* hlt instruction reached */
|
||||
@@ -262,4 +263,24 @@ static inline CPUState *env_cpu(CPUArchState *env)
|
||||
return (void *)env - sizeof(CPUState);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
/**
|
||||
* cpu_mmu_index:
|
||||
* @env: The cpu environment
|
||||
* @ifetch: True for code access, false for data access.
|
||||
*
|
||||
* Return the core mmu index for the current translation regime.
|
||||
* This function is used by generic TCG code paths.
|
||||
*
|
||||
* The user-only version of this function is inline in cpu-all.h,
|
||||
* where it always returns MMU_USER_IDX.
|
||||
*/
|
||||
static inline int cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
{
|
||||
int ret = cs->cc->mmu_index(cs, ifetch);
|
||||
tcg_debug_assert(ret >= 0 && ret < NB_MMU_MODES);
|
||||
return ret;
|
||||
}
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
#endif /* CPU_COMMON_H */
|
||||
|
||||
@@ -103,6 +103,8 @@ struct SysemuCPUOps;
|
||||
* @parse_features: Callback to parse command line arguments.
|
||||
* @reset_dump_flags: #CPUDumpFlags to use for reset logging.
|
||||
* @has_work: Callback for checking if there is work to do.
|
||||
* @mmu_index: Callback for choosing softmmu mmu index;
|
||||
* may be used internally by memory_rw_debug without TCG.
|
||||
* @memory_rw_debug: Callback for GDB memory access.
|
||||
* @dump_state: Callback for dumping state.
|
||||
* @query_cpu_fast:
|
||||
@@ -150,6 +152,7 @@ struct CPUClass {
|
||||
void (*parse_features)(const char *typename, char *str, Error **errp);
|
||||
|
||||
bool (*has_work)(CPUState *cpu);
|
||||
int (*mmu_index)(CPUState *cpu, bool ifetch);
|
||||
int (*memory_rw_debug)(CPUState *cpu, vaddr addr,
|
||||
uint8_t *buf, int len, bool is_write);
|
||||
void (*dump_state)(CPUState *cpu, FILE *, int flags);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -63,7 +63,11 @@ vdso_syscall __kernel_clock_getres, __NR_clock_getres
|
||||
* For now, elide the unwind info for __kernel_rt_sigreturn and rely on
|
||||
* the libgcc fallback routine as we have always done. This requires
|
||||
* that the code sequence used be exact.
|
||||
*
|
||||
* Add a nop as a spacer to ensure that unwind does not pick up the
|
||||
* unwind info from the preceding syscall.
|
||||
*/
|
||||
nop
|
||||
__kernel_rt_sigreturn:
|
||||
/* No BTI C insn here -- we arrive via RET. */
|
||||
mov x8, #__NR_rt_sigreturn
|
||||
|
||||
@@ -293,7 +293,7 @@ void cpu_loop (CPUSPARCState *env)
|
||||
case TT_FP_EXCP:
|
||||
{
|
||||
int code = TARGET_FPE_FLTUNK;
|
||||
target_ulong fsr = env->fsr;
|
||||
target_ulong fsr = cpu_get_fsr(env);
|
||||
|
||||
if ((fsr & FSR_FTT_MASK) == FSR_FTT_IEEE_EXCP) {
|
||||
if (fsr & FSR_NVC) {
|
||||
|
||||
@@ -199,20 +199,21 @@ static void save_fpu(struct target_siginfo_fpu *fpu, CPUSPARCState *env)
|
||||
for (i = 0; i < 32; ++i) {
|
||||
__put_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
|
||||
}
|
||||
__put_user(env->fsr, &fpu->si_fsr);
|
||||
__put_user(cpu_get_fsr(env), &fpu->si_fsr);
|
||||
__put_user(env->gsr, &fpu->si_gsr);
|
||||
__put_user(env->fprs, &fpu->si_fprs);
|
||||
#else
|
||||
for (i = 0; i < 16; ++i) {
|
||||
__put_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
|
||||
}
|
||||
__put_user(env->fsr, &fpu->si_fsr);
|
||||
__put_user(cpu_get_fsr(env), &fpu->si_fsr);
|
||||
__put_user(0, &fpu->si_fpqdepth);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void restore_fpu(struct target_siginfo_fpu *fpu, CPUSPARCState *env)
|
||||
{
|
||||
target_ulong fsr;
|
||||
int i;
|
||||
|
||||
#ifdef TARGET_SPARC64
|
||||
@@ -230,15 +231,16 @@ static void restore_fpu(struct target_siginfo_fpu *fpu, CPUSPARCState *env)
|
||||
__get_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
|
||||
}
|
||||
}
|
||||
__get_user(env->fsr, &fpu->si_fsr);
|
||||
__get_user(env->gsr, &fpu->si_gsr);
|
||||
env->fprs |= fprs;
|
||||
#else
|
||||
for (i = 0; i < 16; ++i) {
|
||||
__get_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
|
||||
}
|
||||
__get_user(env->fsr, &fpu->si_fsr);
|
||||
#endif
|
||||
|
||||
__get_user(fsr, &fpu->si_fsr);
|
||||
cpu_put_fsr(env, fsr);
|
||||
}
|
||||
|
||||
#ifdef TARGET_ARCH_HAS_SETUP_FRAME
|
||||
@@ -662,6 +664,7 @@ void sparc64_set_context(CPUSPARCState *env)
|
||||
__get_user(fenab, &(fpup->mcfpu_enab));
|
||||
if (fenab) {
|
||||
abi_ulong fprs;
|
||||
abi_ulong fsr;
|
||||
|
||||
/*
|
||||
* We use the FPRS from the guest only in deciding whether
|
||||
@@ -690,7 +693,8 @@ void sparc64_set_context(CPUSPARCState *env)
|
||||
__get_user(env->fpr[i].ll, &(fpup->mcfpu_fregs.dregs[i]));
|
||||
}
|
||||
}
|
||||
__get_user(env->fsr, &(fpup->mcfpu_fsr));
|
||||
__get_user(fsr, &(fpup->mcfpu_fsr));
|
||||
cpu_put_fsr(env, fsr);
|
||||
__get_user(env->gsr, &(fpup->mcfpu_gsr));
|
||||
}
|
||||
unlock_user_struct(ucp, ucp_addr, 0);
|
||||
|
||||
@@ -26,7 +26,7 @@ void *uaccess_lock_user(CPUArchState *env, target_ulong addr,
|
||||
|
||||
ssize_t uaccess_strlen_user(CPUArchState *env, target_ulong addr)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = cpu_mmu_index(env_cpu(env), false);
|
||||
size_t len = 0;
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -64,6 +64,11 @@ static bool alpha_cpu_has_work(CPUState *cs)
|
||||
| CPU_INTERRUPT_MCHK);
|
||||
}
|
||||
|
||||
static int alpha_cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
{
|
||||
return alpha_env_mmu_index(cpu_env(cs));
|
||||
}
|
||||
|
||||
static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
info->mach = bfd_mach_alpha_ev6;
|
||||
@@ -230,6 +235,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = alpha_cpu_class_by_name;
|
||||
cc->has_work = alpha_cpu_has_work;
|
||||
cc->mmu_index = alpha_cpu_mmu_index;
|
||||
cc->dump_state = alpha_cpu_dump_state;
|
||||
cc->set_pc = alpha_cpu_set_pc;
|
||||
cc->get_pc = alpha_cpu_get_pc;
|
||||
|
||||
+1
-1
@@ -389,7 +389,7 @@ enum {
|
||||
|
||||
#define TB_FLAG_UNALIGN (1u << 1)
|
||||
|
||||
static inline int cpu_mmu_index(CPUAlphaState *env, bool ifetch)
|
||||
static inline int alpha_env_mmu_index(CPUAlphaState *env)
|
||||
{
|
||||
int ret = env->flags & ENV_FLAG_PS_USER ? MMU_USER_IDX : MMU_KERNEL_IDX;
|
||||
if (env->flags & ENV_FLAG_PAL_MODE) {
|
||||
|
||||
@@ -2875,7 +2875,7 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
|
||||
int64_t bound;
|
||||
|
||||
ctx->tbflags = ctx->base.tb->flags;
|
||||
ctx->mem_idx = cpu_mmu_index(env, false);
|
||||
ctx->mem_idx = alpha_env_mmu_index(env);
|
||||
ctx->implver = env->implver;
|
||||
ctx->amask = env->amask;
|
||||
|
||||
|
||||
@@ -133,6 +133,11 @@ static bool arm_cpu_has_work(CPUState *cs)
|
||||
| CPU_INTERRUPT_EXITTB);
|
||||
}
|
||||
|
||||
static int arm_cpu_mmu_index(CPUState *cs, bool ifetch)
|
||||
{
|
||||
return arm_env_mmu_index(cpu_env(cs));
|
||||
}
|
||||
|
||||
void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,
|
||||
void *opaque)
|
||||
{
|
||||
@@ -2501,6 +2506,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = arm_cpu_class_by_name;
|
||||
cc->has_work = arm_cpu_has_work;
|
||||
cc->mmu_index = arm_cpu_mmu_index;
|
||||
cc->dump_state = arm_cpu_dump_state;
|
||||
cc->set_pc = arm_cpu_set_pc;
|
||||
cc->get_pc = arm_cpu_get_pc;
|
||||
|
||||
@@ -3240,19 +3240,6 @@ FIELD(TBFLAG_A64, NV2_MEM_BE, 36, 1)
|
||||
#define EX_TBFLAG_M32(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_M32, WHICH)
|
||||
#define EX_TBFLAG_AM32(IN, WHICH) FIELD_EX32(IN.flags2, TBFLAG_AM32, WHICH)
|
||||
|
||||
/**
|
||||
* cpu_mmu_index:
|
||||
* @env: The cpu environment
|
||||
* @ifetch: True for code access, false for data access.
|
||||
*
|
||||
* Return the core mmu index for the current translation regime.
|
||||
* This function is used by generic TCG code paths.
|
||||
*/
|
||||
static inline int cpu_mmu_index(CPUARMState *env, bool ifetch)
|
||||
{
|
||||
return EX_TBFLAG_ANY(env->hflags, MMUIDX);
|
||||
}
|
||||
|
||||
/**
|
||||
* sve_vq
|
||||
* @env: the cpu context
|
||||
|
||||
+1
-1
@@ -7841,7 +7841,7 @@ static void dccvap_writefn(CPUARMState *env, const ARMCPRegInfo *opaque,
|
||||
uint64_t vaddr_in = (uint64_t) value;
|
||||
uint64_t vaddr = vaddr_in & ~(dline_size - 1);
|
||||
void *haddr;
|
||||
int mem_idx = cpu_mmu_index(env, false);
|
||||
int mem_idx = arm_env_mmu_index(env);
|
||||
|
||||
/* This won't be crossing page boundaries */
|
||||
haddr = probe_read(env, vaddr, dline_size, mem_idx, GETPC());
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
#define BANK_HYP 6
|
||||
#define BANK_MON 7
|
||||
|
||||
static inline int arm_env_mmu_index(CPUARMState *env)
|
||||
{
|
||||
return EX_TBFLAG_ANY(env->hflags, MMUIDX);
|
||||
}
|
||||
|
||||
static inline bool excp_is_internal(int excp)
|
||||
{
|
||||
/* Return true if this exception number represents a QEMU-internal
|
||||
|
||||
@@ -856,7 +856,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
|
||||
tbii = EX_TBFLAG_A64(env->hflags, TBII);
|
||||
if ((tbii >> extract64(new_pc, 55, 1)) & 1) {
|
||||
/* TBI is enabled. */
|
||||
int core_mmu_idx = cpu_mmu_index(env, false);
|
||||
int core_mmu_idx = arm_env_mmu_index(env);
|
||||
if (regime_has_2_ranges(core_to_aa64_mmu_idx(core_mmu_idx))) {
|
||||
new_pc = sextract64(new_pc, 0, 56);
|
||||
} else {
|
||||
@@ -925,7 +925,7 @@ void HELPER(dc_zva)(CPUARMState *env, uint64_t vaddr_in)
|
||||
*/
|
||||
int blocklen = 4 << env_archcpu(env)->dcz_blocksize;
|
||||
uint64_t vaddr = vaddr_in & ~(blocklen - 1);
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
void *mem;
|
||||
|
||||
/*
|
||||
|
||||
@@ -291,7 +291,7 @@ static int load_tag1(uint64_t ptr, uint8_t *mem)
|
||||
|
||||
uint64_t HELPER(ldg)(CPUARMState *env, uint64_t ptr, uint64_t xt)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uint8_t *mem;
|
||||
int rtag = 0;
|
||||
|
||||
@@ -311,7 +311,7 @@ static void check_tag_aligned(CPUARMState *env, uint64_t ptr, uintptr_t ra)
|
||||
{
|
||||
if (unlikely(!QEMU_IS_ALIGNED(ptr, TAG_GRANULE))) {
|
||||
arm_cpu_do_unaligned_access(env_cpu(env), ptr, MMU_DATA_STORE,
|
||||
cpu_mmu_index(env, false), ra);
|
||||
arm_env_mmu_index(env), ra);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
@@ -344,7 +344,7 @@ typedef void stg_store1(uint64_t, uint8_t *, int);
|
||||
static inline void do_stg(CPUARMState *env, uint64_t ptr, uint64_t xt,
|
||||
uintptr_t ra, stg_store1 store1)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uint8_t *mem;
|
||||
|
||||
check_tag_aligned(env, ptr, ra);
|
||||
@@ -371,7 +371,7 @@ void HELPER(stg_parallel)(CPUARMState *env, uint64_t ptr, uint64_t xt)
|
||||
|
||||
void HELPER(stg_stub)(CPUARMState *env, uint64_t ptr)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uintptr_t ra = GETPC();
|
||||
|
||||
check_tag_aligned(env, ptr, ra);
|
||||
@@ -381,7 +381,7 @@ void HELPER(stg_stub)(CPUARMState *env, uint64_t ptr)
|
||||
static inline void do_st2g(CPUARMState *env, uint64_t ptr, uint64_t xt,
|
||||
uintptr_t ra, stg_store1 store1)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
int tag = allocation_tag_from_addr(xt);
|
||||
uint8_t *mem1, *mem2;
|
||||
|
||||
@@ -429,7 +429,7 @@ void HELPER(st2g_parallel)(CPUARMState *env, uint64_t ptr, uint64_t xt)
|
||||
|
||||
void HELPER(st2g_stub)(CPUARMState *env, uint64_t ptr)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uintptr_t ra = GETPC();
|
||||
int in_page = -(ptr | TARGET_PAGE_MASK);
|
||||
|
||||
@@ -445,7 +445,7 @@ void HELPER(st2g_stub)(CPUARMState *env, uint64_t ptr)
|
||||
|
||||
uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uintptr_t ra = GETPC();
|
||||
int gm_bs = env_archcpu(env)->gm_blocksize;
|
||||
int gm_bs_bytes = 4 << gm_bs;
|
||||
@@ -505,7 +505,7 @@ uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr)
|
||||
|
||||
void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
|
||||
{
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
uintptr_t ra = GETPC();
|
||||
int gm_bs = env_archcpu(env)->gm_blocksize;
|
||||
int gm_bs_bytes = 4 << gm_bs;
|
||||
@@ -555,7 +555,7 @@ void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
|
||||
void HELPER(stzgm_tags)(CPUARMState *env, uint64_t ptr, uint64_t val)
|
||||
{
|
||||
uintptr_t ra = GETPC();
|
||||
int mmu_idx = cpu_mmu_index(env, false);
|
||||
int mmu_idx = arm_env_mmu_index(env);
|
||||
int log2_dcz_bytes, log2_tag_bytes;
|
||||
intptr_t dcz_bytes, tag_bytes;
|
||||
uint8_t *mem;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user