diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-10 10:10:17 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-10 10:10:17 -0800 |
commit | b9db7db3bdfe1405d14465bb7ad8fb33637fd840 (patch) | |
tree | ec64146aacde6dd09258b3c80095637327dbdd9c /pkg/ring0/kernel_arm64.go | |
parent | 298c129cc151e197db35a927f9676cc40ec80d5c (diff) | |
parent | 6eb80b2e2df4a7e0a0b9dcfc99906a84fd8fc3f0 (diff) |
Merge pull request #5267 from lubinszARM:pr_usr_lazy_fp
PiperOrigin-RevId: 356762859
Diffstat (limited to 'pkg/ring0/kernel_arm64.go')
-rw-r--r-- | pkg/ring0/kernel_arm64.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/ring0/kernel_arm64.go b/pkg/ring0/kernel_arm64.go index c05284641..41909b3a0 100644 --- a/pkg/ring0/kernel_arm64.go +++ b/pkg/ring0/kernel_arm64.go @@ -62,6 +62,8 @@ func IsCanonical(addr uint64) bool { //go:nosplit func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) { storeAppASID(uintptr(switchOpts.UserASID)) + storeEl0Fpstate(switchOpts.FloatingPointState) + if switchOpts.Flush { FlushTlbByASID(uintptr(switchOpts.UserASID)) } @@ -71,13 +73,17 @@ func (c *CPU) SwitchToUser(switchOpts SwitchOpts) (vector Vector) { regs.Pstate &= ^uint64(PsrFlagsClear) regs.Pstate |= UserFlagsSet - EnableVFP() - LoadFloatingPoint(switchOpts.FloatingPointState) + fpDisableTrap := CPACREL1() + if fpDisableTrap != 0 { + FPSIMDEnableTrap() + } kernelExitToEl0() - SaveFloatingPoint(switchOpts.FloatingPointState) - DisableVFP() + fpDisableTrap = CPACREL1() + if fpDisableTrap != 0 { + SaveFloatingPoint(switchOpts.FloatingPointState) + } vector = c.vecCode |