Commit 7b2984c4 authored by Marc Zyngier's avatar Marc Zyngier Committed by chenxiang
Browse files

KVM: arm64: vgic-v3: Allow the NMI state to make it into the LRs

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I97WGU

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=arm64/nmi&id=b056525df56d8c92c299a72c344b1b41d5f78d59



----------------------------------------------------------------

Add the new NMI state to the vgic IRQ state, and allow it to
make it into the LRs. Nothing can set it yet, so no impact
is expected from this change.

Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarcaijian <caijian11@h-partners.com>
parent d46e5245
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -932,6 +932,7 @@
#define ICH_LR_VIRTUAL_ID_MASK	((1ULL << 32) - 1)

#define ICH_LR_EOI		(1ULL << 41)
#define ICH_LR_NMI		(1ULL << 59)
#define ICH_LR_GROUP		(1ULL << 60)
#define ICH_LR_HW		(1ULL << 61)
#define ICH_LR_STATE		(3ULL << 62)
+4 −1
Original line number Diff line number Diff line
@@ -181,6 +181,9 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
	if (irq->group)
		val |= ICH_LR_GROUP;

	if (irq->nmi)
		val |= ICH_LR_NMI;
	else
		val |= (u64)irq->priority << ICH_LR_PRIORITY_SHIFT;

	vcpu->arch.vgic_cpu.vgic_v3.vgic_lr[lr] = val;
+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ struct vgic_irq {
	bool active;			/* not used for LPIs */
	bool enabled;
	bool hw;			/* Tied to HW IRQ */
	bool nmi;			/* Configured as NMI */
	struct kref refcount;		/* Used for LPIs */
	u32 hwintid;			/* HW INTID number */
	unsigned int host_irq;		/* linux irq corresponding to hwintid */