diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2011-04-01 15:15:16 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2011-04-01 18:34:55 +0200 |
commit | fda6a0ecc61926ea1af6a85ab47a4ae47a6fe0a7 (patch) | |
tree | 47a41e879de6ad0f48505c2418ff3a84b4b59db0 /target-ppc/cpu.h | |
parent | bb593904c18e22ea0671dfa1b02e24982f2bf0ea (diff) | |
download | qemu-fda6a0ecc61926ea1af6a85ab47a4ae47a6fe0a7.zip qemu-fda6a0ecc61926ea1af6a85ab47a4ae47a6fe0a7.tar.gz qemu-fda6a0ecc61926ea1af6a85ab47a4ae47a6fe0a7.tar.bz2 |
Use "hash" more consistently in ppc mmu code
Currently, get_segment() has a variable called hash. However it doesn't
(quite) get the hash value for the ppc hashed page table. Instead it
gets the hash shifted - effectively the offset of the hash bucket within
the hash page table.
As well, as being different to the normal use of plain "hash" in the
architecture documentation, this usage necessitates some awkward 32/64
dependent masks and shifts which clutter up the path in get_segment().
This patch alters the code to use raw hash values through get_segment()
including storing raw hashes instead of pte group offsets in the ctx
structure. This cleans up the path noticeably.
This does necessitate 32/64 dependent shifts when the hash values are
taken out of the ctx structure and used, but those paths already have
32/64 bit variants so this is less awkward than it was in get_segment().
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/cpu.h')
-rw-r--r-- | target-ppc/cpu.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index ead4566..cee1057 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -367,6 +367,9 @@ union ppc_tlb_t { #define SDR_64_HTABSIZE 0x000000000000001FULL #endif /* defined(TARGET_PPC64 */ +#define HASH_PTE_SIZE_32 8 +#define HASH_PTE_SIZE_64 16 + typedef struct ppc_slb_t ppc_slb_t; struct ppc_slb_t { uint64_t esid; @@ -744,7 +747,7 @@ struct mmu_ctx_t { target_phys_addr_t raddr; /* Real address */ target_phys_addr_t eaddr; /* Effective address */ int prot; /* Protection bits */ - target_phys_addr_t pg_addr[2]; /* PTE tables base addresses */ + target_phys_addr_t hash[2]; /* Pagetable hash values */ target_ulong ptem; /* Virtual segment ID | API */ int key; /* Access key */ int nx; /* Non-execute area */ |