diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-30 15:25:09 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-30 15:25:09 -0400 |
commit | a5a5aef451430dbd48f5bf32029b8b98b690074d (patch) | |
tree | 02525913943b280d0e0ee26a950b92f9b0dc6eb0 /virt/kvm | |
parent | 41c22f626254b9dc0376928cae009e73d1b6a49a (diff) | |
parent | 30c2117085bc4e05d091cee6eba79f069b41a9cd (diff) |
Merge tag 'kvm-arm-for-3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master
First round of KVM/ARM Fixes for 3.15
Includes vgic fixes, a possible kernel corruption bug due to
misalignment of pages and disabling of KVM in KConfig on big-endian
systems, because the last one breaks the build.
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/arm/vgic.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 47b29834a6b6..56ff9bebb577 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -548,11 +548,10 @@ static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu, | |||
548 | u32 val; | 548 | u32 val; |
549 | u32 *reg; | 549 | u32 *reg; |
550 | 550 | ||
551 | offset >>= 1; | ||
552 | reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg, | 551 | reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg, |
553 | vcpu->vcpu_id, offset); | 552 | vcpu->vcpu_id, offset >> 1); |
554 | 553 | ||
555 | if (offset & 2) | 554 | if (offset & 4) |
556 | val = *reg >> 16; | 555 | val = *reg >> 16; |
557 | else | 556 | else |
558 | val = *reg & 0xffff; | 557 | val = *reg & 0xffff; |
@@ -561,13 +560,13 @@ static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu, | |||
561 | vgic_reg_access(mmio, &val, offset, | 560 | vgic_reg_access(mmio, &val, offset, |
562 | ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); | 561 | ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); |
563 | if (mmio->is_write) { | 562 | if (mmio->is_write) { |
564 | if (offset < 4) { | 563 | if (offset < 8) { |
565 | *reg = ~0U; /* Force PPIs/SGIs to 1 */ | 564 | *reg = ~0U; /* Force PPIs/SGIs to 1 */ |
566 | return false; | 565 | return false; |
567 | } | 566 | } |
568 | 567 | ||
569 | val = vgic_cfg_compress(val); | 568 | val = vgic_cfg_compress(val); |
570 | if (offset & 2) { | 569 | if (offset & 4) { |
571 | *reg &= 0xffff; | 570 | *reg &= 0xffff; |
572 | *reg |= val << 16; | 571 | *reg |= val << 16; |
573 | } else { | 572 | } else { |
@@ -916,6 +915,7 @@ static void vgic_dispatch_sgi(struct kvm_vcpu *vcpu, u32 reg) | |||
916 | case 0: | 915 | case 0: |
917 | if (!target_cpus) | 916 | if (!target_cpus) |
918 | return; | 917 | return; |
918 | break; | ||
919 | 919 | ||
920 | case 1: | 920 | case 1: |
921 | target_cpus = ((1 << nrcpus) - 1) & ~(1 << vcpu_id) & 0xff; | 921 | target_cpus = ((1 << nrcpus) - 1) & ~(1 << vcpu_id) & 0xff; |
@@ -1667,10 +1667,11 @@ static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr, | |||
1667 | if (addr + size < addr) | 1667 | if (addr + size < addr) |
1668 | return -EINVAL; | 1668 | return -EINVAL; |
1669 | 1669 | ||
1670 | *ioaddr = addr; | ||
1670 | ret = vgic_ioaddr_overlap(kvm); | 1671 | ret = vgic_ioaddr_overlap(kvm); |
1671 | if (ret) | 1672 | if (ret) |
1672 | return ret; | 1673 | *ioaddr = VGIC_ADDR_UNDEF; |
1673 | *ioaddr = addr; | 1674 | |
1674 | return ret; | 1675 | return ret; |
1675 | } | 1676 | } |
1676 | 1677 | ||