diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-06-21 09:51:06 -0300 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-07-09 10:38:18 +1000 |
commit | db20cc2c563bfa259f7574a064190cf6456861f6 (patch) | |
tree | 87914e0c6a54580c926ed24bb0b62f6c3874df75 /target/ppc/mmu_helper.c | |
parent | 7381c5d11fe9a03ad3bf2e5700e96acc5cafe218 (diff) | |
download | qemu-db20cc2c563bfa259f7574a064190cf6456861f6.zip qemu-db20cc2c563bfa259f7574a064190cf6456861f6.tar.gz qemu-db20cc2c563bfa259f7574a064190cf6456861f6.tar.bz2 |
target/ppc: Remove PowerPCCPUClass.handle_mmu_fault
Instead, use a switch on env->mmu_model. This avoids some
replicated information in cpu setup.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210621125115.67717-2-bruno.larsen@eldorado.org.br>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/mmu_helper.c')
-rw-r--r-- | target/ppc/mmu_helper.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 1ecb36e..c4b1c93 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -2947,14 +2947,30 @@ bool ppc_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, bool probe, uintptr_t retaddr) { PowerPCCPU *cpu = POWERPC_CPU(cs); - PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); CPUPPCState *env = &cpu->env; int ret; - if (pcc->handle_mmu_fault) { - ret = pcc->handle_mmu_fault(cpu, addr, access_type, mmu_idx); - } else { + switch (env->mmu_model) { +#if defined(TARGET_PPC64) + case POWERPC_MMU_64B: + case POWERPC_MMU_2_03: + case POWERPC_MMU_2_06: + case POWERPC_MMU_2_07: + ret = ppc_hash64_handle_mmu_fault(cpu, addr, access_type, mmu_idx); + break; + case POWERPC_MMU_3_00: + ret = ppc64_v3_handle_mmu_fault(cpu, addr, access_type, mmu_idx); + break; +#endif + + case POWERPC_MMU_32B: + case POWERPC_MMU_601: + ret = ppc_hash32_handle_mmu_fault(cpu, addr, access_type, mmu_idx); + break; + + default: ret = cpu_ppc_handle_mmu_fault(env, addr, access_type, mmu_idx); + break; } if (unlikely(ret != 0)) { if (probe) { |