diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2014-02-20 18:52:17 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-03-05 03:07:02 +0100 |
commit | f3c75d42adbba553eaf218a832d4fbea32c8f7b8 (patch) | |
tree | 632fbedc382ce1a97ee5cc21a55dd61f8a5a4c7d /hw/ppc/spapr.c | |
parent | 3707cd62db79ba965a211b9e2bb808792ae7343a (diff) | |
download | qemu-f3c75d42adbba553eaf218a832d4fbea32c8f7b8.zip qemu-f3c75d42adbba553eaf218a832d4fbea32c8f7b8.tar.gz qemu-f3c75d42adbba553eaf218a832d4fbea32c8f7b8.tar.bz2 |
target-ppc: Fix htab_mask calculation
Correctly update the htab_mask using the return value of
KVM_PPC_ALLOCATE_HTAB ioctl. Also we don't update sdr1
on GET_SREGS for HV. We check for external htab and if
found true, we don't need to update sdr1
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[ fixed pte group offset computation in ppc_hash64_htab_lookup() that
caused TCG to fail, Greg Kurz <gkurz@linux.vnet.ibm.com> ]
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r-- | hw/ppc/spapr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0989ed6..8ac4d8a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -749,7 +749,13 @@ static void spapr_cpu_reset(void *opaque) env->external_htab = (void *)1; } env->htab_base = -1; - env->htab_mask = HTAB_SIZE(spapr) - 1; + /* + * htab_mask is the mask used to normalize hash value to PTEG index. + * htab_shift is log2 of hash table size. + * We have 8 hpte per group, and each hpte is 16 bytes. + * ie have 128 bytes per hpte entry. + */ + env->htab_mask = (1ULL << ((spapr)->htab_shift - 7)) - 1; env->spr[SPR_SDR1] = (target_ulong)(uintptr_t)spapr->htab | (spapr->htab_shift - 18); } |