Skip to contentSkip to conversation

powerpc/kvm: is MAS6_SAS a mask or boolean?

PATCH In review Roel Kluin 3 participants 3 messages May 15, 2009 – May 19, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 powerpc/kvm: is MAS6_SAS a mask or boolean?

MAS6_SAS is not a boolean.

---
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.

arch/powerpc/kvm/e500_tlb.c +1 -1
index 0e773fc..5b0b198 100644
@@ -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;
#1 lore raw
Quoted 16 lines · Roel Kluin

MAS6_SAS is not a boolean.

---
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.

arch/powerpc/kvm/e500_tlb.c +0 -0
index 0e773fc..5b0b198 100644

arch/powerpc/kvm/e500_tlb.c int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb) · line 504

Quoted 8 lines
arch/powerpc/kvm/e500_tlb.c +1 -1
@@ -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.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
Acked-by on v1 1/1
#2 lore raw
In reply to Roel Kluin
Quoted 30 lines

-----Original Message-----
From: Hollis Blanchard [mailto:[email protected]]
Sent: Saturday, May 16, 2009 2:59 AM
To: Roel Kluin
Cc: [email protected]; Andrew Morton; Liu Yu-B13201
Subject: Re: [PATCH] powerpc/kvm: is MAS6_SAS a mask or boolean?

Quoted 7 lines · Roel Kluin

MAS6_SAS is not a boolean.

---
MAS6_SAS is defined at arch/powerpc/include/asm/mmu-book3e.h:89:
#define MAS6_SAS 0x00000001

Review

Quoted 5 lines

This looks like it's a mask rather than a boolean.

Is my patch below correct? please review.

(quoted diff) +0 -0

b/arch/powerpc/kvm/e500_tlb.c

arch/powerpc/kvm/e500_tlb.c int kvmppc_e500_emul_tlbsx(struct

Quoted 4 lines

index 0e773fc..5b0b198 100644

arch/powerpc/kvm/e500_tlb.c +0 -0
@@ -498,7 +498,7 @@ int kvmppc_e500_emul_tlbsx(struct 

kvm_vcpu *vcpu, int rb)

arch/powerpc/kvm/e500_tlb.c int kvmppc_e500_emul_tlbsx(struct · line 498

Quoted 1 line
arch/powerpc/kvm/e500_tlb.c +0 -0
 		vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | 

MAS0_ESEL(victim)

Quoted 12 lines

arch/powerpc/kvm/e500_tlb.c int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb) · line 504

Quoted 7 lines
arch/powerpc/kvm/e500_tlb.c +1 -1
 			| 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.

Yes. It's correct.
Looks like this won't conflict with my current work. Thanks.