From: Hollis Blanchard Date: Fri, 15 May 2009 18:58:43 +0000 Subject: Re: [PATCH] powerpc/kvm: is MAS6_SAS a mask or boolean? Message-Id: <1242413923.1414.10.camel@slate.austin.ibm.com> List-Id: References: <4A0DB8FD.3070604@gmail.com> In-Reply-To: <4A0DB8FD.3070604@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Fri, 2009-05-15 at 20:48 +0200, Roel Kluin wrote: > MAS6_SAS is not a boolean. > > Signed-off-by: Roel Kluin > --- > MAS6_SAS is defined at arch/powerpc/include/asm/mmu-book3e.h:89: > #define MAS6_SAS 0x00000001 > > This looks like it's a mask rather than a boolean. > > Is my patch below correct? please review. > > diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c > index 0e773fc..5b0b198 100644 > --- a/arch/powerpc/kvm/e500_tlb.c > +++ b/arch/powerpc/kvm/e500_tlb.c > @@ -498,7 +498,7 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb) > vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim) > | MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]); > vcpu_e500->mas1 = (vcpu_e500->mas6 & MAS6_SPID0) > - | (vcpu_e500->mas6 & (MAS6_SAS ? MAS1_TS : 0)) > + | (vcpu_e500->mas6 & MAS6_SAS ? MAS1_TS : 0) > | (vcpu_e500->mas4 & MAS4_TSIZED(~0)); > vcpu_e500->mas2 &= MAS2_EPN; > vcpu_e500->mas2 |= vcpu_e500->mas4 & MAS2_ATTRIB_MASK; This patch looks correct to me. I'll let Liu Yu (CCed) approve it though; it's his code and he has other outstanding patches in this area. -- Hollis Blanchard IBM Linux Technology Center