[PATCH 2/5] x86/nmi: Drop K7_NMI_EVENT

Andrew Cooper <[email protected]> Wed, 5 Aug 2026 13:45:22 +0100
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
This name is misleading.

It's not possible to configure NMI or not from the event select register; that
comes from the APIC configuration for performance events.

This name is "the thing we want to count for the NMI watchdog", but that's
clearer to follow when it simply names the event.  Drop the indirection.

No functional change.

Signed-off-by: Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau MonnĂ© <[email protected]>
CC: Teddy Astie <[email protected]>
---
 xen/arch/x86/nmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 616bfdbc9029..113e672c4f15 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -102,7 +102,6 @@ static int nmi_active;
 #define K7_EVNTSEL_OS		(1 << 17)
 #define K7_EVNTSEL_USR		(1 << 16)
 #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
-#define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
 #define K7_EVENT_WIDTH          32
 
 #define P6_EVNTSEL0_ENABLE	(1 << 22)
@@ -259,7 +258,7 @@ static void setup_k7_watchdog(void)
     evntsel = K7_EVNTSEL_INT
         | K7_EVNTSEL_OS
         | K7_EVNTSEL_USR
-        | K7_NMI_EVENT;
+        | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING;
 
     wrmsrns(MSR_K7_EVNTSEL0, evntsel);
     write_watchdog_counter("K7_PERFCTR0");
-- 
2.34.1