diff options
author | Marc Zyngier <maz@kernel.org> | 2021-03-15 16:11:58 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-06-01 12:46:00 +0300 |
commit | 354920e79441c8a53ac73008b06d3b70ed06eb34 (patch) | |
tree | bbbf888458a716159eb5c8910d1dbc10655576fc /include | |
parent | db75f1a33f82ad332b6e139c5960e01999969d2c (diff) | |
download | linux-354920e79441c8a53ac73008b06d3b70ed06eb34.tar.xz |
KVM: arm64: vgic: Implement SW-driven deactivation
In order to deal with these systems that do not offer HW-based
deactivation of interrupts, let implement a SW-based approach:
- When the irq is queued into a LR, treat it as a pure virtual
interrupt and set the EOI flag in the LR.
- When the interrupt state is read back from the LR, force a
deactivation when the state is invalid (neither active nor
pending)
Interrupts requiring such treatment get the VGIC_SW_RESAMPLE flag.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/kvm/arm_vgic.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index e5f06df000f2..e602d848fc1a 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -99,6 +99,11 @@ enum vgic_irq_config { * kvm_arm_get_running_vcpu() to get the vcpu pointer for private IRQs. */ struct irq_ops { + /* Per interrupt flags for special-cased interrupts */ + unsigned long flags; + +#define VGIC_IRQ_SW_RESAMPLE BIT(0) /* Clear the active state for resampling */ + /* * Callback function pointer to in-kernel devices that can tell us the * state of the input level of mapped level-triggered IRQ faster than @@ -150,6 +155,11 @@ struct vgic_irq { for in-kernel devices. */ }; +static inline bool vgic_irq_needs_resampling(struct vgic_irq *irq) +{ + return irq->ops && (irq->ops->flags & VGIC_IRQ_SW_RESAMPLE); +} + struct vgic_register_region; struct vgic_its; |