Skip to content

Commit

Permalink
Merge pull request #1528 from hermit-os/readfsgs
Browse files Browse the repository at this point in the history
fix(x86_64): use correct MSR for `read{fs,gs}`
  • Loading branch information
mkroening authored Dec 24, 2024
2 parents 85941c4 + e87b644 commit 461455c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arch/x86_64/kernel/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 461455c

Please sign in to comment.