KVM: s390: vsie: fix the length of APCB bitmap
[ Upstream commit246be7d272
] bit_and() uses the count of bits as the woking length. Fix the previous implementation and effectively use the right bitmap size. Fixes:19fd83a647
("KVM: s390: vsie: allow CRYCB FORMAT-1") Fixes:56019f9aca
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e716693f02
commit
c78ad1060c
|
@ -169,7 +169,8 @@ static int setup_apcb00(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
|
||||||
sizeof(struct kvm_s390_apcb0)))
|
sizeof(struct kvm_s390_apcb0)))
|
||||||
return -EFAULT;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +192,8 @@ static int setup_apcb11(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
|
||||||
sizeof(struct kvm_s390_apcb1)))
|
sizeof(struct kvm_s390_apcb1)))
|
||||||
return -EFAULT;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue