diff options
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic-v2.c | 16 | ||||
-rw-r--r-- | virt/kvm/arm/vgic.c | 4 | ||||
-rw-r--r-- | virt/kvm/ioapic.c | 7 | ||||
-rw-r--r-- | virt/kvm/irq_comm.c | 4 |
4 files changed, 23 insertions, 8 deletions
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c index d6c9c142f813..01124ef3690a 100644 --- a/virt/kvm/arm/vgic-v2.c +++ b/virt/kvm/arm/vgic-v2.c | |||
@@ -231,6 +231,22 @@ int vgic_v2_probe(struct device_node *vgic_node, | |||
231 | ret = -ENXIO; | 231 | ret = -ENXIO; |
232 | goto out_unmap; | 232 | goto out_unmap; |
233 | } | 233 | } |
234 | |||
235 | if (!PAGE_ALIGNED(vcpu_res.start)) { | ||
236 | kvm_err("GICV physical address 0x%llx not page aligned\n", | ||
237 | (unsigned long long)vcpu_res.start); | ||
238 | ret = -ENXIO; | ||
239 | goto out_unmap; | ||
240 | } | ||
241 | |||
242 | if (!PAGE_ALIGNED(resource_size(&vcpu_res))) { | ||
243 | kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n", | ||
244 | (unsigned long long)resource_size(&vcpu_res), | ||
245 | PAGE_SIZE); | ||
246 | ret = -ENXIO; | ||
247 | goto out_unmap; | ||
248 | } | ||
249 | |||
234 | vgic->vcpu_base = vcpu_res.start; | 250 | vgic->vcpu_base = vcpu_res.start; |
235 | 251 | ||
236 | kvm_info("%s@%llx IRQ%d\n", vgic_node->name, | 252 | kvm_info("%s@%llx IRQ%d\n", vgic_node->name, |
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index ede8f6466c95..73eba793b17f 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -1587,11 +1587,11 @@ int kvm_vgic_hyp_init(void) | |||
1587 | goto out_free_irq; | 1587 | goto out_free_irq; |
1588 | } | 1588 | } |
1589 | 1589 | ||
1590 | on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1); | ||
1591 | |||
1592 | /* Callback into for arch code for setup */ | 1590 | /* Callback into for arch code for setup */ |
1593 | vgic_arch_setup(vgic); | 1591 | vgic_arch_setup(vgic); |
1594 | 1592 | ||
1593 | on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1); | ||
1594 | |||
1595 | return 0; | 1595 | return 0; |
1596 | 1596 | ||
1597 | out_free_irq: | 1597 | out_free_irq: |
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 2458a1dc2ba9..e8ce34c9db32 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -254,10 +254,9 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap, | |||
254 | spin_lock(&ioapic->lock); | 254 | spin_lock(&ioapic->lock); |
255 | for (index = 0; index < IOAPIC_NUM_PINS; index++) { | 255 | for (index = 0; index < IOAPIC_NUM_PINS; index++) { |
256 | e = &ioapic->redirtbl[index]; | 256 | e = &ioapic->redirtbl[index]; |
257 | if (!e->fields.mask && | 257 | if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG || |
258 | (e->fields.trig_mode == IOAPIC_LEVEL_TRIG || | 258 | kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, index) || |
259 | kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, | 259 | index == RTC_GSI) { |
260 | index) || index == RTC_GSI)) { | ||
261 | if (kvm_apic_match_dest(vcpu, NULL, 0, | 260 | if (kvm_apic_match_dest(vcpu, NULL, 0, |
262 | e->fields.dest_id, e->fields.dest_mode)) { | 261 | e->fields.dest_id, e->fields.dest_mode)) { |
263 | __set_bit(e->fields.vector, | 262 | __set_bit(e->fields.vector, |
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index ced4a542a031..a228ee82bad2 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c | |||
@@ -323,13 +323,13 @@ out: | |||
323 | 323 | ||
324 | #define IOAPIC_ROUTING_ENTRY(irq) \ | 324 | #define IOAPIC_ROUTING_ENTRY(irq) \ |
325 | { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \ | 325 | { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \ |
326 | .u.irqchip.irqchip = KVM_IRQCHIP_IOAPIC, .u.irqchip.pin = (irq) } | 326 | .u.irqchip = { .irqchip = KVM_IRQCHIP_IOAPIC, .pin = (irq) } } |
327 | #define ROUTING_ENTRY1(irq) IOAPIC_ROUTING_ENTRY(irq) | 327 | #define ROUTING_ENTRY1(irq) IOAPIC_ROUTING_ENTRY(irq) |
328 | 328 | ||
329 | #ifdef CONFIG_X86 | 329 | #ifdef CONFIG_X86 |
330 | # define PIC_ROUTING_ENTRY(irq) \ | 330 | # define PIC_ROUTING_ENTRY(irq) \ |
331 | { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \ | 331 | { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \ |
332 | .u.irqchip.irqchip = SELECT_PIC(irq), .u.irqchip.pin = (irq) % 8 } | 332 | .u.irqchip = { .irqchip = SELECT_PIC(irq), .pin = (irq) % 8 } } |
333 | # define ROUTING_ENTRY2(irq) \ | 333 | # define ROUTING_ENTRY2(irq) \ |
334 | IOAPIC_ROUTING_ENTRY(irq), PIC_ROUTING_ENTRY(irq) | 334 | IOAPIC_ROUTING_ENTRY(irq), PIC_ROUTING_ENTRY(irq) |
335 | #else | 335 | #else |