lkml.org 
[lkml]   [2018]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/5] x86/ibrs: Introduce native_rdmsrl, and native_wrmsrl
On Thu, Jan 11, 2018 at 5:32 PM, Ashok Raj <ashok.raj@intel.com> wrote:
> - 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@intel.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;
> +}

What's wrong with native_read_msr()?

> +
> +static inline void native_wrmsrl(unsigned int msr, u64 val)
> +{
> + __wrmsr(msr, (u32) (val & 0xffffffffULL), (u32) (val >> 32));
> +}

What's wrong with just wrmsrl()? If you really need a native helper
like this, please add it to arch/x86/asm/msr.h.

\
 
 \ /
  Last update: 2018-01-14 23:25    [W:0.299 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site