Re: [PATCH 1/5] x86/ibrs: Introduce native_rdmsrl, and native_wrmsrl

From: Borislav Petkov
Date: Fri Jan 12 2018 - 07:28:42 EST


On Thu, Jan 11, 2018 at 05:32:15PM -0800, Ashok Raj 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@xxxxxxxxx>
> ---
> 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;
> +}

There's no need to add new ones but simply lift the ones from
microcode.h and use them.

No duplication of *MSR functions pls.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.