mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 22:15:07 +00:00
target-sparc: use direct address translation in hyperprivileged mode
Please note that QEMU doesn't impelement Real->Physical address translation. The "Real Address" is always the "Physical Address". Backports commit 84f8f5876628963e67f66edde8a71208c4274ac8 from qemu
This commit is contained in:
parent
f07be0ac3f
commit
3a5a9dd6cd
|
@ -226,7 +226,7 @@ enum {
|
||||||
#if !defined(TARGET_SPARC64)
|
#if !defined(TARGET_SPARC64)
|
||||||
#define NB_MMU_MODES 3
|
#define NB_MMU_MODES 3
|
||||||
#else
|
#else
|
||||||
#define NB_MMU_MODES 7
|
#define NB_MMU_MODES 6
|
||||||
typedef struct trap_state {
|
typedef struct trap_state {
|
||||||
uint64_t tpc;
|
uint64_t tpc;
|
||||||
uint64_t tnpc;
|
uint64_t tnpc;
|
||||||
|
@ -676,8 +676,7 @@ static inline CPUSPARCState *cpu_init(struct uc_struct *uc, const char *cpu_mode
|
||||||
#define MMU_KERNEL_IDX 2
|
#define MMU_KERNEL_IDX 2
|
||||||
#define MMU_KERNEL_SECONDARY_IDX 3
|
#define MMU_KERNEL_SECONDARY_IDX 3
|
||||||
#define MMU_NUCLEUS_IDX 4
|
#define MMU_NUCLEUS_IDX 4
|
||||||
#define MMU_HYPV_IDX 5
|
#define MMU_PHYS_IDX 5
|
||||||
#define MMU_PHYS_IDX 6
|
|
||||||
#else
|
#else
|
||||||
#define MMU_USER_IDX 0
|
#define MMU_USER_IDX 0
|
||||||
#define MMU_KERNEL_IDX 1
|
#define MMU_KERNEL_IDX 1
|
||||||
|
@ -723,7 +722,7 @@ static inline int cpu_mmu_index(CPUSPARCState *env, bool ifetch)
|
||||||
: (env->lsu & DMMU_E) == 0) {
|
: (env->lsu & DMMU_E) == 0) {
|
||||||
return MMU_PHYS_IDX;
|
return MMU_PHYS_IDX;
|
||||||
} else if (cpu_hypervisor_mode(env)) {
|
} else if (cpu_hypervisor_mode(env)) {
|
||||||
return MMU_HYPV_IDX;
|
return MMU_PHYS_IDX;
|
||||||
} else if (env->tl > 0) {
|
} else if (env->tl > 0) {
|
||||||
return MMU_NUCLEUS_IDX;
|
return MMU_NUCLEUS_IDX;
|
||||||
} else if (cpu_supervisor_mode(env)) {
|
} else if (cpu_supervisor_mode(env)) {
|
||||||
|
|
|
@ -2293,7 +2293,7 @@ static DisasASI get_asi(DisasContext *dc, int insn, TCGMemOp memop)
|
||||||
case ASI_NUCLEUS_QUAD_LDD:
|
case ASI_NUCLEUS_QUAD_LDD:
|
||||||
case ASI_NUCLEUS_QUAD_LDD_L:
|
case ASI_NUCLEUS_QUAD_LDD_L:
|
||||||
if (hypervisor(dc)) {
|
if (hypervisor(dc)) {
|
||||||
mem_idx = MMU_HYPV_IDX;
|
mem_idx = MMU_PHYS_IDX;
|
||||||
} else {
|
} else {
|
||||||
mem_idx = MMU_NUCLEUS_IDX;
|
mem_idx = MMU_NUCLEUS_IDX;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue