diff options
Diffstat (limited to 'pkg/ring0')
-rw-r--r-- | pkg/ring0/defs.go | 2 | ||||
-rw-r--r-- | pkg/ring0/kernel_amd64.go | 12 | ||||
-rw-r--r-- | pkg/ring0/kernel_arm64.go | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/pkg/ring0/defs.go b/pkg/ring0/defs.go index e2561e4c2..e8ce608ba 100644 --- a/pkg/ring0/defs.go +++ b/pkg/ring0/defs.go @@ -96,7 +96,7 @@ type SwitchOpts struct { // FloatingPointState is a byte pointer where floating point state is // saved and restored. - FloatingPointState *byte + FloatingPointState arch.FloatingPointData // PageTables are the application page tables. PageTables *pagetables.PageTables diff --git a/pkg/ring0/kernel_amd64.go b/pkg/ring0/kernel_amd64.go index 36a60700e..e9e706716 100644 --- a/pkg/ring0/kernel_amd64.go +++ b/pkg/ring0/kernel_amd64.go @@ -239,17 +239,17 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) { regs.Ss = uint64(Udata) // Ditto. // Perform the switch. - swapgs() // GS will be swapped on return. - WriteFS(uintptr(regs.Fs_base)) // escapes: no. Set application FS. - WriteGS(uintptr(regs.Gs_base)) // escapes: no. Set application GS. - LoadFloatingPoint(switchOpts.FloatingPointState) // escapes: no. Copy in floating point. + swapgs() // GS will be swapped on return. + WriteFS(uintptr(regs.Fs_base)) // escapes: no. Set application FS. + WriteGS(uintptr(regs.Gs_base)) // escapes: no. Set application GS. + LoadFloatingPoint(&switchOpts.FloatingPointState[0]) // escapes: no. Copy in floating point. if switchOpts.FullRestore { vector = iret(c, regs, uintptr(userCR3)) } else { vector = sysret(c, regs, uintptr(userCR3)) } - SaveFloatingPoint(switchOpts.FloatingPointState) // escapes: no. Copy out floating point. - WriteFS(uintptr(c.registers.Fs_base)) // escapes: no. Restore kernel FS. + SaveFloatingPoint(&switchOpts.FloatingPointState[0]) // escapes: no. Copy out floating point. + WriteFS(uintptr(c.registers.Fs_base)) // escapes: no. Restore kernel FS. return } diff --git a/pkg/ring0/kernel_arm64.go b/pkg/ring0/kernel_arm64.go index 41909b3a0..c9a120952 100644 --- a/pkg/ring0/kernel_arm64.go +++ b/pkg/ring0/kernel_arm64.go @@ -62,7 +62,7 @@ func IsCanonical(addr uint64) bool { //go:nosplit func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) { storeAppASID(uintptr(switchOpts.UserASID)) - storeEl0Fpstate(switchOpts.FloatingPointState) + storeEl0Fpstate(&switchOpts.FloatingPointState[0]) if switchOpts.Flush { FlushTlbByASID(uintptr(switchOpts.UserASID)) @@ -82,7 +82,7 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) { fpDisableTrap = CPACREL1() if fpDisableTrap != 0 { - SaveFloatingPoint(switchOpts.FloatingPointState) + SaveFloatingPoint(&switchOpts.FloatingPointState[0]) } vector = c.vecCode |