From 592ecf07c73896e8b150f8fd748dd3c163d278e8 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 12 Nov 2019 15:48:40 -0800 Subject: [PATCH] x86: add MSR defintions needed for syscalls Define MSR register addresses for various MSRs related to SYSCALL/SYSRET. We also add MSRs for FS/GS base addresses (for GS, both kernel and user mode) to support SWAPGS. Signed-off-by: Andrew Boie --- include/arch/x86/msr.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/arch/x86/msr.h b/include/arch/x86/msr.h index 906ebf6052e..f45e0535c3b 100644 --- a/include/arch/x86/msr.h +++ b/include/arch/x86/msr.h @@ -25,9 +25,26 @@ #define X86_X2APIC_BASE_MSR 0x00000800 /* .. thru 0x00000BFF */ #define X86_EFER_MSR 0xC0000080 +#define X86_EFER_MSR_SCE BIT(0) #define X86_EFER_MSR_LME BIT(8) #define X86_EFER_MSR_NXE BIT(11) +/* STAR 31:0 Unused in long mode + * 47:32 Kernel CS (SS = CS+8) + * 63:48 User CS (SS = CS+8) + */ +#define X86_STAR_MSR 0xC0000081 + +/* Location for system call entry point */ +#define X86_LSTAR_MSR 0xC0000082 + +/* Low 32 bits in this MSR are the SYSCALL mask applied to EFLAGS */ +#define X86_FMASK_MSR 0xC0000084 + +#define X86_FS_BASE 0xC0000100 +#define X86_GS_BASE 0xC0000101 +#define X86_KERNEL_GS_BASE 0xC0000102 + #ifndef _ASMLANGUAGE #ifdef __cplusplus extern "C" {