Skip to contentSkip to conversation

KVM: s390: vsie: fix the length of APCB bitmap

PATCH In review Pierre Morel 2 participants 3 messages May 11, 2023 – May 12, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover KVM: s390: vsie: fix the length of APCB bitmap

bit_and() uses the count of bits as the woking length. Fix the previous implementation and effectively use the right bitmap size.

VSIE With AP has been after the patching succesfuly tested in VSIE with Harald's AP test zcryptping.

Fixes 19fd83a64718 ("KVM: s390: vsie: allow CRYCB FORMAT-1")
Fixes 56019f9aca22 ("KVM: s390: vsie: Allow CRYCB FORMAT-2")

Pierre Morel (1):
KVM: s390: vsie: fix the length of APCB bitmap

 arch/s390/kvm/vsie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 KVM: s390: vsie: fix the length of APCB bitmap

bit_and() uses the count of bits as the woking length. Fix the previous implementation and effectively use the right bitmap size.

Fixes 19fd83a64718 ("KVM: s390: vsie: allow CRYCB FORMAT-1")
Fixes 56019f9aca22 ("KVM: s390: vsie: Allow CRYCB FORMAT-2")
---
 arch/s390/kvm/vsie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/s390/kvm/vsie.c +4 -2
index 8d6b765abf29..0333ee482eb8 100644
@@ -177,7 +177,8 @@ static int setup_apcb00(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
 			    sizeof(struct kvm_s390_apcb0)))
 		return -EFAULT;
 
-	bitmap_and(apcb_s, apcb_s, apcb_h, sizeof(struct kvm_s390_apcb0));
+	bitmap_and(apcb_s, apcb_s, apcb_h,
+		   BITS_PER_BYTE * sizeof(struct kvm_s390_apcb0));
 
 	return 0;
 }
@@ -203,7 +204,8 @@ static int setup_apcb11(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
 			    sizeof(struct kvm_s390_apcb1)))
 		return -EFAULT;
 
-	bitmap_and(apcb_s, apcb_s, apcb_h, sizeof(struct kvm_s390_apcb1));
+	bitmap_and(apcb_s, apcb_s, apcb_h,
+		   BITS_PER_BYTE * sizeof(struct kvm_s390_apcb1));
 
 	return 0;
 }
Signature · 1 line
2.31.1
maintainer Reviewed-by on v1 1/1
#2 lore raw
Quoted 8 lines · Pierre Morel

bit_and() uses the count of bits as the woking length. Fix the previous implementation and effectively use the right bitmap size.

Fixes 19fd83a64718 ("KVM: s390: vsie: allow CRYCB FORMAT-1")
Fixes 56019f9aca22 ("KVM: s390: vsie: Allow CRYCB FORMAT-2")

Please push this to devel