]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common/x86: Add macro-definition for `X86_MSR_KERNEL_GS_BASE`
authorSergiu Moga <sergiu@unikraft.io>
Wed, 1 Nov 2023 06:32:07 +0000 (08:32 +0200)
committerSergiu Moga <sergiu@unikraft.io>
Fri, 24 Nov 2023 17:16:10 +0000 (19:16 +0200)
Add a macro-definition for the x86 `KERNEL_GS_BASE` MSR that is usually
used in conjunction with the `swapgs` instruction for an efficient swap
between the `gs_base` register placed in `KERNEL_GS_BASE` and `GS_BASE`.

Co-authored-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
plat/common/include/x86/cpu_defs.h

index 487af7effcbbe0ba144822be9ae9fcf329d572ad..02497dcb00d8b4622c43f0efe7d221222744618e 100644 (file)
@@ -91,6 +91,8 @@
 /* FS and GS Registers in 64-bit Mode */
 #define X86_MSR_FS_BASE         0xc0000100
 #define X86_MSR_GS_BASE         0xc0000101
+/* Used in conjunction with swapgs instruction */
+#define X86_MSR_KERNEL_GS_BASE 0xc0000102
 /* extended feature register */
 #define X86_MSR_EFER           0xc0000080
 /* legacy mode SYSCALL target */