lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703085426.274801-3-xin@zytor.com>
Date: Wed,  3 Jul 2024 01:54:24 -0700
From: "Xin Li (Intel)" <xin@...or.com>
To: linux-kernel@...r.kernel.org
Cc: hpa@...or.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, x86@...nel.org, peterz@...radead.org,
        andrew.cooper3@...rix.com, nik.borisov@...e.com,
        houwenlong.hwl@...group.com
Subject: [PATCH v1 2/4] x86/fred: Write to FRED MSRs with wrmsrns()

Do FRED MSR writes with wrmsrns() rather than wrmsrl().

No functional change intended.

Signed-off-by: Xin Li (Intel) <xin@...or.com>
---
 arch/x86/kernel/fred.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/fred.c b/arch/x86/kernel/fred.c
index 4bcd8791ad96..b202685b8e77 100644
--- a/arch/x86/kernel/fred.c
+++ b/arch/x86/kernel/fred.c
@@ -26,27 +26,27 @@ void cpu_init_fred_exceptions(void)
 	/* When FRED is enabled by default, remove this log message */
 	pr_info("Initialize FRED on CPU%d\n", smp_processor_id());
 
-	wrmsrl(MSR_IA32_FRED_CONFIG,
-	       /* Reserve for CALL emulation */
-	       FRED_CONFIG_REDZONE |
-	       FRED_CONFIG_INT_STKLVL(0) |
-	       FRED_CONFIG_ENTRYPOINT(asm_fred_entrypoint_user));
+	wrmsrns(MSR_IA32_FRED_CONFIG,
+		/* Reserve for CALL emulation */
+		FRED_CONFIG_REDZONE |
+		FRED_CONFIG_INT_STKLVL(0) |
+		FRED_CONFIG_ENTRYPOINT(asm_fred_entrypoint_user));
 
 	/*
 	 * The purpose of separate stacks for NMI, #DB and #MC *in the kernel*
 	 * (remember that user space faults are always taken on stack level 0)
 	 * is to avoid overflowing the kernel stack.
 	 */
-	wrmsrl(MSR_IA32_FRED_STKLVLS,
-	       FRED_STKLVL(X86_TRAP_DB,  FRED_DB_STACK_LEVEL) |
-	       FRED_STKLVL(X86_TRAP_NMI, FRED_NMI_STACK_LEVEL) |
-	       FRED_STKLVL(X86_TRAP_MC,  FRED_MC_STACK_LEVEL) |
-	       FRED_STKLVL(X86_TRAP_DF,  FRED_DF_STACK_LEVEL));
+	wrmsrns(MSR_IA32_FRED_STKLVLS,
+		FRED_STKLVL(X86_TRAP_DB,  FRED_DB_STACK_LEVEL) |
+		FRED_STKLVL(X86_TRAP_NMI, FRED_NMI_STACK_LEVEL) |
+		FRED_STKLVL(X86_TRAP_MC,  FRED_MC_STACK_LEVEL) |
+		FRED_STKLVL(X86_TRAP_DF,  FRED_DF_STACK_LEVEL));
 
 	/* The FRED equivalents to IST stacks... */
-	wrmsrl(MSR_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
-	wrmsrl(MSR_IA32_FRED_RSP2, __this_cpu_ist_top_va(NMI));
-	wrmsrl(MSR_IA32_FRED_RSP3, __this_cpu_ist_top_va(DF));
+	wrmsrns(MSR_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
+	wrmsrns(MSR_IA32_FRED_RSP2, __this_cpu_ist_top_va(NMI));
+	wrmsrns(MSR_IA32_FRED_RSP3, __this_cpu_ist_top_va(DF));
 
 	/* Enable FRED */
 	cr4_set_bits(X86_CR4_FRED);
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ