Commit 669062d2 authored by Marc Zyngier's avatar Marc Zyngier

KVM: arm64: vgic: Be tolerant to the lack of maintenance interrupt masking

As it turns out, not all the interrupt controllers are able to
expose a vGIC maintenance interrupt that can be independently
enabled/disabled.

And to be fair, it doesn't really matter as all we require is
for the interrupt to kick us out of guest mode out way or another.

To that effect, add gic_kvm_info.no_maint_irq_mask for an interrupt
controller to advertise the lack of masking.
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 74501499
...@@ -519,12 +519,15 @@ void kvm_vgic_init_cpu_hardware(void) ...@@ -519,12 +519,15 @@ void kvm_vgic_init_cpu_hardware(void)
*/ */
int kvm_vgic_hyp_init(void) int kvm_vgic_hyp_init(void)
{ {
bool has_mask;
int ret; int ret;
if (!gic_kvm_info) if (!gic_kvm_info)
return -ENODEV; return -ENODEV;
if (!gic_kvm_info->maint_irq) { has_mask = !gic_kvm_info->no_maint_irq_mask;
if (has_mask && !gic_kvm_info->maint_irq) {
kvm_err("No vgic maintenance irq\n"); kvm_err("No vgic maintenance irq\n");
return -ENXIO; return -ENXIO;
} }
...@@ -552,6 +555,9 @@ int kvm_vgic_hyp_init(void) ...@@ -552,6 +555,9 @@ int kvm_vgic_hyp_init(void)
if (ret) if (ret)
return ret; return ret;
if (!has_mask)
return 0;
ret = request_percpu_irq(kvm_vgic_global_state.maint_irq, ret = request_percpu_irq(kvm_vgic_global_state.maint_irq,
vgic_maintenance_handler, vgic_maintenance_handler,
"vgic", kvm_get_running_vcpus()); "vgic", kvm_get_running_vcpus());
......
...@@ -24,6 +24,8 @@ struct gic_kvm_info { ...@@ -24,6 +24,8 @@ struct gic_kvm_info {
struct resource vcpu; struct resource vcpu;
/* Interrupt number */ /* Interrupt number */
unsigned int maint_irq; unsigned int maint_irq;
/* No interrupt mask, no need to use the above field */
bool no_maint_irq_mask;
/* Virtual control interface */ /* Virtual control interface */
struct resource vctrl; struct resource vctrl;
/* vlpi support */ /* vlpi support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment