[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 31/32] mmu-hash64: Don't use full ppc_hash64_translate
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 31/32] mmu-hash64: Don't use full ppc_hash64_translate() path for get_phys_page_debug() |
Date: |
Fri, 15 Feb 2013 19:01:21 +1100 |
Currently the mmu-hash64 version of get_phys_page_debug() uses the same
ppc64_hash64_translate() function to do the translation logic as the normal
mm fault handler code.
That sounds like a good idea, but has some complications. The debug path
doesn't need, or even want some parts of the full translation path, like
pte permissions checking. Furthermore, the pte flags update included in
the normal path means that the debug call is not quite side effect free.
This patch, therefore, reimplements get_phys_page_debug as the minimal
required subset of the full translation path.
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/mmu-hash64.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
index 848440c..3f68933 100644
--- a/target-ppc/mmu-hash64.c
+++ b/target-ppc/mmu-hash64.c
@@ -454,13 +454,26 @@ static int ppc_hash64_translate(CPUPPCState *env, struct
mmu_ctx_hash64 *ctx,
hwaddr ppc_hash64_get_phys_page_debug(CPUPPCState *env, target_ulong addr)
{
- struct mmu_ctx_hash64 ctx;
+ ppc_slb_t *slb;
+ hwaddr pte_offset;
+ ppc_hash_pte64_t pte;
+
+ if (msr_dr == 0) {
+ /* In real mode the top 4 effective address bits are ignored */
+ return addr & 0x0FFFFFFFFFFFFFFFULL;
+ }
- if (unlikely(ppc_hash64_translate(env, &ctx, addr, 0) != 0)) {
+ slb = slb_lookup(env, addr);
+ if (!slb) {
+ return -1;
+ }
+
+ pte_offset = ppc_hash64_htab_lookup(env, slb, addr, &pte);
+ if (pte_offset == -1) {
return -1;
}
- return ctx.raddr & TARGET_PAGE_MASK;
+ return ppc_hash64_pte_real_address(slb, pte, addr) & TARGET_PAGE_MASK;
}
int ppc_hash64_handle_mmu_fault(CPUPPCState *env, target_ulong address, int
rwx,
--
1.7.10.4
- [Qemu-ppc] [PATCH 24/32] mmu-hash64: Make find_pte64 do more of the job of finding a pte, (continued)
- [Qemu-ppc] [PATCH 24/32] mmu-hash64: Make find_pte64 do more of the job of finding a pte, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 27/32] mmu-hash64: Don't update PTE flags when permission is denied, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 03/32] target-ppc: Move SLB handling into a mmu-hash64.c, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 26/32] mmu-hash64: Clean up ppc_hash64_htab_lookup(), David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 23/32] mmu-hash64: Separate PTEG searching from permissions checking, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 22/32] mmu-hash64: Separate VA matching from permission checking in pte64_check(), David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 30/32] mmu-hash64: Correctly mask RPN from hash PTE, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 25/32] mmu-hash64: Remove permission checking from find_pte64(), David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 28/32] mmu-hash64: Clean up PTE permission checking, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 29/32] mmu-hash64: Clean up PTE flags update, David Gibson, 2013/02/15
- [Qemu-ppc] [PATCH 31/32] mmu-hash64: Don't use full ppc_hash64_translate() path for get_phys_page_debug(),
David Gibson <=
- [Qemu-ppc] [PATCH 32/32] mmu-hash64: Merge translate and fault handling functions, David Gibson, 2013/02/15
- Re: [Qemu-ppc] [0/32] RFC: 64-bit hash mmu implementation clean up, Alexander Graf, 2013/02/23