diff options
author | Pierre Morel <pmorel@linux.ibm.com> | 2023-05-10 17:42:58 +0200 |
---|---|---|
committer | Janosch Frank <frankja@linux.ibm.com> | 2023-06-16 11:08:09 +0200 |
commit | 246be7d2720ea9a795b576067ecc5e5c7a1e7848 (patch) | |
tree | 292a9bb4f44c51c2ae88650759e2c68c53bc5748 /arch | |
parent | e325ba2271849e25017743496bcec8d3a83cacb3 (diff) | |
download | linux-stable-246be7d2720ea9a795b576067ecc5e5c7a1e7848.tar.gz linux-stable-246be7d2720ea9a795b576067ecc5e5c7a1e7848.tar.bz2 linux-stable-246be7d2720ea9a795b576067ecc5e5c7a1e7848.zip |
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")
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kvm/vsie.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 8d6b765abf29..0333ee482eb8 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -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; } |