Commit 8b487c60 authored by Marc Zyngier's avatar Marc Zyngier Committed by chenxiang
Browse files

KVM: arm64: vgic-v3: Don't inject an NMI if the vcpu doesn't have FEAT_NMI

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=92d02ae8d987bb16f2c6ac092f366f646093c9bc



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

Since it is allowed to have any combination of CPU and GIC supporting
NMIs or not, let's drop the NMI feature at the point where it is
injected in the LR if the vcpu doesn't have FEAT_NMI.

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 e2895896
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -181,7 +181,8 @@ 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)
	if (vcpu->kvm->arch.pfr1_nmi == ID_AA64PFR1_EL1_NMI_IMP &&
	    irq->nmi)
		val |= ICH_LR_NMI;
	else
		val |= (u64)irq->priority << ICH_LR_PRIORITY_SHIFT;