From e87b644e0b26c428aec15dfe1f64aa12e7651fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 24 Dec 2024 14:50:31 +0100 Subject: [PATCH] fix(x86_64): use correct MSR for `read{fs,gs}` --- src/arch/x86_64/kernel/processor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/x86_64/kernel/processor.rs b/src/arch/x86_64/kernel/processor.rs index 0ddfdbf1d8..e5003674d2 100644 --- a/src/arch/x86_64/kernel/processor.rs +++ b/src/arch/x86_64/kernel/processor.rs @@ -1079,7 +1079,7 @@ pub fn readfs() -> usize { if cfg!(feature = "fsgsbase") { unsafe { segmentation::rdfsbase() } } else { - unsafe { rdmsr(IA32_GS_BASE) } + unsafe { rdmsr(IA32_FS_BASE) } } .try_into() .unwrap() @@ -1090,7 +1090,7 @@ pub fn readgs() -> usize { if cfg!(feature = "fsgsbase") { unsafe { segmentation::rdgsbase() } } else { - unsafe { rdmsr(IA32_FS_BASE) } + unsafe { rdmsr(IA32_GS_BASE) } } .try_into() .unwrap()