Skip to content

Commit 246be7d

Browse files
Pierre Morelfrankjaa
authored andcommitted
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: 19fd83a ("KVM: s390: vsie: allow CRYCB FORMAT-1") Fixes: 56019f9 ("KVM: s390: vsie: Allow CRYCB FORMAT-2") Signed-off-by: Pierre Morel <pmorel@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/kvm/20230511094719.9691-1-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
1 parent e325ba2 commit 246be7d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arch/s390/kvm/vsie.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ static int setup_apcb00(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
177177
sizeof(struct kvm_s390_apcb0)))
178178
return -EFAULT;
179179

180-
bitmap_and(apcb_s, apcb_s, apcb_h, sizeof(struct kvm_s390_apcb0));
180+
bitmap_and(apcb_s, apcb_s, apcb_h,
181+
BITS_PER_BYTE * sizeof(struct kvm_s390_apcb0));
181182

182183
return 0;
183184
}
@@ -203,7 +204,8 @@ static int setup_apcb11(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
203204
sizeof(struct kvm_s390_apcb1)))
204205
return -EFAULT;
205206

206-
bitmap_and(apcb_s, apcb_s, apcb_h, sizeof(struct kvm_s390_apcb1));
207+
bitmap_and(apcb_s, apcb_s, apcb_h,
208+
BITS_PER_BYTE * sizeof(struct kvm_s390_apcb1));
207209

208210
return 0;
209211
}

0 commit comments

Comments
 (0)