git: b9fba0c59689 - stable/15 - amd64_cpu_init_fred(): set stack level for NMI and not #NM

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 03 Nov 2026 09:02:03 UTC
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=b9fba0c59689aebd930d04b34d2dfc223afe86af

commit b9fba0c59689aebd930d04b34d2dfc223afe86af
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-27 08:54:43 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-03 09:01:13 +0000

    amd64_cpu_init_fred(): set stack level for NMI and not #NM
    
    (cherry picked from commit 787e2e411d2a169fd28581f9bbf1e87c51757303)
---
 sys/amd64/amd64/initcpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 2d2f5835e3b3..925f312421c5 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -416,14 +416,14 @@ amd64_cpu_init_fred(void)
 	/*
 	 * With FRED, there is no need for workarounds requiring
 	 * dedicated stack for #DB.  Also, there is no need to have
-	 * separate stacks for #NM and #MC, because CSL rules ensure
+	 * separate stacks for NMI and #MC, because CSL rules ensure
 	 * that interrupted frame is safe even if NMI was interrupted
 	 * by machine check or vice versa.
 	 *
 	 * Still, we need to provide a stack for events that can occur
 	 * with the interrupts disabled, to avoid caring about the
 	 * ordering of the context update in cpu_switch.S.  Use CSL 1
-	 * for #NM and #MC.
+	 * for NMI and #MC.
 	 *
 	 * Since double fault handler is used to handle stack
 	 * overflow, it gets the dedicated stack, of the highest used
@@ -432,7 +432,7 @@ amd64_cpu_init_fred(void)
 	 * CSL 3 is unused, and we have some space to re-arrange this
 	 * if a need in the future appears.
 	 */
-	wrmsr(MSR_FRED_STKLVLS, (1ul << (IDT_NM * 2)) |
+	wrmsr(MSR_FRED_STKLVLS, (1ul << (IDT_NMI * 2)) |
 	    (1ul << (IDT_MC * 2)) | (2ul << (IDT_DF * 2)));
 	wrmsr(MSR_FRED_RSP3, 0);
 	load_cr4(rcr4() | CR4_FRED);