]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/ppc/mmu_hash64: Fix incorrect shift value in amr calculation
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 13 Jan 2017 06:28:23 +0000 (17:28 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 1 Feb 2017 22:30:07 +0000 (09:30 +1100)
We are calculating the authority mask register key value wrong.

The pte entry contains the key value with the two upper bits and the three
lower bits stored separately. We should use these two portions to get a 5
bit value, not or them together which will only give us a 3 bit value.

Fix this.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/mmu-hash64.h

index ab5d347a53ebc834b999cfccebc0820cd85ebfff..7a0b7fca41d69da1b4e3007d973ea073cef03d6c 100644 (file)
@@ -85,7 +85,7 @@ void ppc_hash64_update_rmls(CPUPPCState *env);
 #define HPTE64_R_C              0x0000000000000080ULL
 #define HPTE64_R_R              0x0000000000000100ULL
 #define HPTE64_R_KEY_LO         0x0000000000000e00ULL
-#define HPTE64_R_KEY(x)         ((((x) & HPTE64_R_KEY_HI) >> 60) | \
+#define HPTE64_R_KEY(x)         ((((x) & HPTE64_R_KEY_HI) >> 57) | \
                                  (((x) & HPTE64_R_KEY_LO) >> 9))
 
 #define HPTE64_V_1TB_SEG        0x4000000000000000ULL