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]
Date:   Mon, 14 May 2018 11:52:19 -0700
From:   Fenghua Yu <fenghua.yu@...el.com>
To:     "Thomas Gleixner" <tglx@...utronix.de>,
        "Ingo Molnar" <mingo@...e.hu>,
        "H. Peter Anvin" <hpa@...ux.intel.com>,
        "Ashok Raj" <ashok.raj@...el.com>,
        "Ravi V Shankar" <ravi.v.shankar@...el.com>,
        "Tony Luck" <tony.luck@...el.com>,
        "Dave Hansen" <dave.hansen@...el.com>,
        "Rafael Wysocki" <rafael.j.wysocki@...el.com>,
        "Arjan van de Ven" <arjan@...radead.org>,
        "Alan Cox" <alan@...ux.intel.com>
Cc:     "x86" <x86@...nel.org>,
        "linux-kernel" <linux-kernel@...r.kernel.org>,
        Fenghua Yu <fenghua.yu@...el.com>
Subject: [PATCH 09/15] x86/split_lock: Explicitly enable or disable #AC for split locked accesses

By default, we don't set or clear the bit 29 in TEST_CTL MSR 0x33 and
the bit is inherited from BIOS/hardware setting.

The kernel parameter "split_lock_ac=on/off" explicitly sets or clears
the bit during boot time.

Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 arch/x86/kernel/cpu/split_lock.c                | 16 ++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 11fc28ecdb6d..862758533346 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4030,6 +4030,17 @@
 	spia_pedr=
 	spia_peddr=
 
+	split_lock_ac=	[X86] Enable or disable #AC exception for
+			split locked accesses
+			By default, kernel just inherits setting by
+			hardware and BIOS which may enable or disable
+			the feature. User can explicitly enable or disable
+			the feature by this parameter to override
+			BIOS/hardware setting.
+
+		on	Enable #AC exception for split locked accesses.
+		off	Disable #AC exception for split locked accesses.
+
 	srcutree.counter_wrap_check [KNL]
 			Specifies how frequently to check for
 			grace-period sequence counter wrap for the
diff --git a/arch/x86/kernel/cpu/split_lock.c b/arch/x86/kernel/cpu/split_lock.c
index 5187a9c6cea6..bc66c21b0ca9 100644
--- a/arch/x86/kernel/cpu/split_lock.c
+++ b/arch/x86/kernel/cpu/split_lock.c
@@ -85,6 +85,22 @@ void __init enumerate_split_lock(void)
 	pr_info("#AC exception for split locked accesses is supported\n");
 }
 
+static __init int setup_split_lock_ac(char *str)
+{
+	if (!str)
+		return -EINVAL;
+
+	if (!strncmp(str, "on", 2))
+		split_lock_ac = ENABLE_SPLIT_LOCK_AC;
+	else if (!strncmp(str, "off", 3))
+		split_lock_ac = DISABLE_SPLIT_LOCK_AC;
+	else
+		return -EINVAL;
+
+	return 0;
+}
+__setup("split_lock_ac=", setup_split_lock_ac);
+
 static bool _setup_split_lock(int split_lock_ac_val)
 {
 	u32 l, h;
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ