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: <1515720739-43819-2-git-send-email-ashok.raj@intel.com>
Date:   Thu, 11 Jan 2018 17:32:15 -0800
From:   Ashok Raj <ashok.raj@...el.com>
To:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg KH <gregkh@...uxfoundation.org>
Cc:     Ashok Raj <ashok.raj@...el.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Arjan Van De Ven <arjan.van.de.ven@...el.com>,
        David Woodhouse <dwmw@...zon.co.uk>,
        Peter Zijlstra <peterz@...radead.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Jun Nakajima <jun.nakajima@...el.com>,
        Asit Mallick <asit.k.mallick@...el.com>
Subject: [PATCH 1/5] x86/ibrs: Introduce native_rdmsrl, and native_wrmsrl

- Remove including microcode.h, and use native macros from asm/msr.h
- added license header for spec_ctrl.c

Signed-off-by: Ashok Raj <ashok.raj@...el.com>
---
 arch/x86/include/asm/spec_ctrl.h | 17 ++++++++++++++++-
 arch/x86/kernel/cpu/spec_ctrl.c  |  1 +
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/spec_ctrl.h b/arch/x86/include/asm/spec_ctrl.h
index 948959b..2dfa31b 100644
--- a/arch/x86/include/asm/spec_ctrl.h
+++ b/arch/x86/include/asm/spec_ctrl.h
@@ -3,12 +3,27 @@
 #ifndef _ASM_X86_SPEC_CTRL_H
 #define _ASM_X86_SPEC_CTRL_H
 
-#include <asm/microcode.h>
+#include <asm/processor.h>
+#include <asm/msr.h>
 
 void spec_ctrl_scan_feature(struct cpuinfo_x86 *c);
 void spec_ctrl_unprotected_begin(void);
 void spec_ctrl_unprotected_end(void);
 
+static inline u64 native_rdmsrl(unsigned int msr)
+{
+	u64 val;
+
+	val = __rdmsr(msr);
+
+	return val;
+}
+
+static inline void native_wrmsrl(unsigned int msr, u64 val)
+{
+	__wrmsr(msr, (u32) (val & 0xffffffffULL), (u32) (val >> 32));
+}
+
 static inline void __disable_indirect_speculation(void)
 {
 	native_wrmsrl(MSR_IA32_SPEC_CTRL, SPEC_CTRL_ENABLE_IBRS);
diff --git a/arch/x86/kernel/cpu/spec_ctrl.c b/arch/x86/kernel/cpu/spec_ctrl.c
index 843b4e6..9e9d013 100644
--- a/arch/x86/kernel/cpu/spec_ctrl.c
+++ b/arch/x86/kernel/cpu/spec_ctrl.c
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #include <linux/string.h>
 
 #include <asm/spec_ctrl.h>
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ