summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ring0/kernel_amd64.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/platform/ring0/kernel_amd64.go')
-rw-r--r--pkg/sentry/platform/ring0/kernel_amd64.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/sentry/platform/ring0/kernel_amd64.go b/pkg/sentry/platform/ring0/kernel_amd64.go
index 02d6d0de4..58ac4b4b2 100644
--- a/pkg/sentry/platform/ring0/kernel_amd64.go
+++ b/pkg/sentry/platform/ring0/kernel_amd64.go
@@ -200,8 +200,8 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) {
// Perform the switch.
swapgs() // GS will be swapped on return.
- wrfs(uintptr(regs.Fs_base)) // Set application FS.
- wrgs(uintptr(regs.Gs_base)) // Set application GS.
+ WriteFS(uintptr(regs.Fs_base)) // Set application FS.
+ WriteGS(uintptr(regs.Gs_base)) // Set application GS.
LoadFloatingPoint(switchOpts.FloatingPointState) // Copy in floating point.
jumpToKernel() // Switch to upper half.
writeCR3(uintptr(userCR3)) // Change to user address space.
@@ -213,7 +213,7 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) {
writeCR3(uintptr(kernelCR3)) // Return to kernel address space.
jumpToUser() // Return to lower half.
SaveFloatingPoint(switchOpts.FloatingPointState) // Copy out floating point.
- wrfs(uintptr(c.registers.Fs_base)) // Restore kernel FS.
+ WriteFS(uintptr(c.registers.Fs_base)) // Restore kernel FS.
return
}
@@ -225,8 +225,8 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) {
//go:nosplit
func start(c *CPU) {
// Save per-cpu & FS segment.
- wrgs(kernelAddr(c))
- wrfs(uintptr(c.Registers().Fs_base))
+ WriteGS(kernelAddr(c))
+ WriteFS(uintptr(c.Registers().Fs_base))
// Initialize floating point.
//