diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2014-03-18 11:34:18 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-03-25 08:27:11 -0400 |
commit | 609433fbed4f25e11e8b058ab7e9478b212879a9 (patch) | |
tree | cbb26db5ab1189321d559674d55311a5bba9535d /arch/s390 | |
parent | f6c137ff00a478ae619deea8650829dd2f8e71b9 (diff) |
KVM: s390: fix calculation of idle_mask array size
We need BITS_TO_LONGS, not sizeof(long) to calculate
the correct size.
idle_mask is a bitmask, each bit representing the state
of a cpu. The desired outcome is an array of unsigned long
fields that can fit KVM_MAX_VCPUS bits. We should not use
sizeof(long) which returnes the size in bytes, but BITS_TO_LONGS
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/kvm_host.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 734d302ba389..c36cd35e03f3 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -213,8 +213,7 @@ struct kvm_s390_float_interrupt { | |||
213 | struct list_head list; | 213 | struct list_head list; |
214 | atomic_t active; | 214 | atomic_t active; |
215 | int next_rr_cpu; | 215 | int next_rr_cpu; |
216 | unsigned long idle_mask[(KVM_MAX_VCPUS + sizeof(long) - 1) | 216 | unsigned long idle_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)]; |
217 | / sizeof(long)]; | ||
218 | unsigned int irq_count; | 217 | unsigned int irq_count; |
219 | }; | 218 | }; |
220 | 219 | ||