]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: PPC: BOOK3S: HV: Update compute_tlbie_rb to handle 16MB base page
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 29 Jun 2014 11:17:30 +0000 (16:47 +0530)
committerAlexander Graf <agraf@suse.de>
Mon, 28 Jul 2014 14:09:17 +0000 (16:09 +0200)
When calculating the lower bits of AVA field, use the shift
count based on the base page size. Also add the missing segment
size and remove stale comment.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/kvm/book3s_hv.c

index e504f8845c42cbb8ca4249085c18848177b3a250..07cf9df823ce08afc3c1cd1743fc36ab5aa1ecd3 100644 (file)
@@ -147,6 +147,8 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
         */
        /* This covers 14..54 bits of va*/
        rb = (v & ~0x7fUL) << 16;               /* AVA field */
+
+       rb |= v >> (62 - 8);                    /*  B field */
        /*
         * AVA in v had cleared lower 23 bits. We need to derive
         * that from pteg index
@@ -177,10 +179,10 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
        {
                int aval_shift;
                /*
-                * remaining 7bits of AVA/LP fields
+                * remaining bits of AVA/LP fields
                 * Also contain the rr bits of LP
                 */
-               rb |= (va_low & 0x7f) << 16;
+               rb |= (va_low << mmu_psize_defs[b_psize].shift) & 0x7ff000;
                /*
                 * Now clear not needed LP bits based on actual psize
                 */
index c470d55cffe15fab30a4afe5293c7554fb462ab4..27cced9c7249e32ef0660fd14d9ace591e11eba6 100644 (file)
@@ -2064,12 +2064,6 @@ static void kvmppc_add_seg_page_size(struct kvm_ppc_one_seg_page_size **sps,
        (*sps)->page_shift = def->shift;
        (*sps)->slb_enc = def->sllp;
        (*sps)->enc[0].page_shift = def->shift;
-       /*
-        * Only return base page encoding. We don't want to return
-        * all the supporting pte_enc, because our H_ENTER doesn't
-        * support MPSS yet. Once they do, we can start passing all
-        * support pte_enc here
-        */
        (*sps)->enc[0].pte_enc = def->penc[linux_psize];
        /*
         * Add 16MB MPSS support if host supports it