Skip to content

Commit 8732209

Browse files
christofferdall-armMarc Zyngier
authored andcommitted
KVM: arm/arm64: vgic: Signal IRQs using their configured group
Now when we have a group configuration on the struct IRQ, use this state when populating the LR and signaling interrupts as either group 0 or group 1 to the VM. Depending on the model of the emulated GIC, and the guest's configuration of the VMCR, interrupts may be signaled as IRQs or FIQs to the VM. Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Christoffer Dall <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 8df3c8f commit 8732209

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/linux/irqchip/arm-gic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
#define GICH_LR_PENDING_BIT (1 << 28)
105105
#define GICH_LR_ACTIVE_BIT (1 << 29)
106106
#define GICH_LR_EOI (1 << 19)
107+
#define GICH_LR_GROUP1 (1 << 30)
107108
#define GICH_LR_HW (1 << 31)
108109

109110
#define GICH_VMCR_ENABLE_GRP0_SHIFT 0

virt/kvm/arm/vgic/vgic-v2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ void vgic_v2_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
159159
}
160160
}
161161

162+
if (irq->group)
163+
val |= GICH_LR_GROUP1;
164+
162165
if (irq->hw) {
163166
val |= GICH_LR_HW;
164167
val |= irq->hwintid << GICH_LR_PHYSID_CPUID_SHIFT;

virt/kvm/arm/vgic/vgic-v3.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,7 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
197197
if (vgic_irq_is_mapped_level(irq) && (val & ICH_LR_PENDING_BIT))
198198
irq->line_level = false;
199199

200-
/*
201-
* We currently only support Group1 interrupts, which is a
202-
* known defect. This needs to be addressed at some point.
203-
*/
204-
if (model == KVM_DEV_TYPE_ARM_VGIC_V3)
200+
if (irq->group)
205201
val |= ICH_LR_GROUP;
206202

207203
val |= (u64)irq->priority << ICH_LR_PRIORITY_SHIFT;

0 commit comments

Comments
 (0)