summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-03-09 11:50:42 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-03-09 11:50:42 +0100
commitab92f30875a7ec3e84644a5494febd8901e66742 (patch)
tree5254eb36b20b0d1c584c15d0bf3d6a5a9c1bb451 /virt/kvm/arm/vgic.c
parentbb9eadf0c35f2e7eb5ca6468f46ebb7473b85537 (diff)
parentb40c4892d175874d118860c8282a85ee7b64bcbb (diff)
downloadop-kernel-dev-ab92f30875a7ec3e84644a5494febd8901e66742.zip
op-kernel-dev-ab92f30875a7ec3e84644a5494febd8901e66742.tar.gz
Merge tag 'kvm-arm-for-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/ARM updates for 4.6 - VHE support so that we can run the kernel at EL2 on ARMv8.1 systems - PMU support for guests - 32bit world switch rewritten in C - Various optimizations to the vgic save/restore code Conflicts: include/uapi/linux/kvm.h
Diffstat (limited to 'virt/kvm/arm/vgic.c')
-rw-r--r--virt/kvm/arm/vgic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 043032c..00429b3 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -1875,8 +1875,8 @@ void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
static int vgic_vcpu_init_maps(struct kvm_vcpu *vcpu, int nr_irqs)
{
struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
-
- int sz = (nr_irqs - VGIC_NR_PRIVATE_IRQS) / 8;
+ int nr_longs = BITS_TO_LONGS(nr_irqs - VGIC_NR_PRIVATE_IRQS);
+ int sz = nr_longs * sizeof(unsigned long);
vgic_cpu->pending_shared = kzalloc(sz, GFP_KERNEL);
vgic_cpu->active_shared = kzalloc(sz, GFP_KERNEL);
vgic_cpu->pend_act_shared = kzalloc(sz, GFP_KERNEL);
OpenPOWER on IntegriCloud