From 02bcb4ece75a659636524777480d54f55d4bc1dd Mon Sep 17 00:00:00 2001 From: Abdelkareem Abdelsaamad Date: Wed, 3 Jun 2026 11:36:14 +0200 Subject: [PATCH] x86/svm: Add Enumerations for the SVM virtual NMI Introduce the cpuid bit for the SVM vNMI feature support for the x86\AMD platforms. The feature support is indicated by the CPUID Fn8000_000A_EDX[25] = 1. Add defines for the three SVM's Virtual NMI (vNMI) managements bits in the VMCB structure's vintr_t: vintr_t(11) - Virtual NMI is pending. vintr_t(12) - Virtual NMI is masked. vintr_t(26) - Enable NMI virtualization. Signed-off-by: Abdelkareem Abdelsaamad Reviewed-by: Teddy Astie Acked-by: Jan Beulich master commit: 0294292b4ca6d90e18cb66912d18b88576dd2733 master date: 2026-02-23 08:41:32 +0100 --- xen/arch/x86/include/asm/hvm/svm/svm.h | 2 ++ xen/arch/x86/include/asm/hvm/svm/vmcb.h | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/include/asm/hvm/svm/svm.h b/xen/arch/x86/include/asm/hvm/svm/svm.h index 4eeeb25da9..eb6fe3e993 100644 --- a/xen/arch/x86/include/asm/hvm/svm/svm.h +++ b/xen/arch/x86/include/asm/hvm/svm/svm.h @@ -37,6 +37,7 @@ extern u32 svm_feature_flags; #define SVM_FEATURE_VGIF 16 /* Virtual GIF */ #define SVM_FEATURE_SSS 19 /* NPT Supervisor Shadow Stacks */ #define SVM_FEATURE_SPEC_CTRL 20 /* MSR_SPEC_CTRL virtualisation */ +#define SVM_FEATURE_VNMI 25 /* Virtual NMI */ static inline bool cpu_has_svm_feature(unsigned int feat) { @@ -56,5 +57,6 @@ static inline bool cpu_has_svm_feature(unsigned int feat) #define cpu_has_svm_vloadsave cpu_has_svm_feature(SVM_FEATURE_VLOADSAVE) #define cpu_has_svm_sss cpu_has_svm_feature(SVM_FEATURE_SSS) #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL) +#define cpu_has_svm_vnmi cpu_has_svm_feature(SVM_FEATURE_VNMI) #endif /* __ASM_X86_HVM_SVM_H__ */ diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include/asm/hvm/svm/vmcb.h index 28f715e376..78bc0a8075 100644 --- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h +++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h @@ -338,13 +338,17 @@ typedef union u64 tpr: 8; u64 irq: 1; u64 vgif: 1; - u64 rsvd0: 6; + u64 : 1; + u64 vnmi_pending: 1; + u64 vnmi_blocking:1; + u64 : 3; u64 prio: 4; u64 ign_tpr: 1; u64 rsvd1: 3; u64 intr_masking: 1; u64 vgif_enable: 1; - u64 rsvd2: 6; + u64 vnmi_enable: 1; + u64 : 5; u64 vector: 8; u64 rsvd3: 24; } fields;