diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-09 17:15:06 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-09 17:15:06 -0700 |
commit | 7420821a7b5fe15f3666bb4971796cd45fc5ff38 (patch) | |
tree | e589b5c862322dd86a1d0ebee93c0bb5c2710e3b /pkg/sentry/arch/fpu | |
parent | dc8f6c6914747c700a629b7717e45759cf1f7650 (diff) | |
parent | eb9b8e53a3ef7bb96dcb59a0121fa9ed22f01bfd (diff) |
Merge pull request #5767 from avagin:mxcsr
PiperOrigin-RevId: 367730917
Diffstat (limited to 'pkg/sentry/arch/fpu')
-rw-r--r-- | pkg/sentry/arch/fpu/fpu_amd64.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/arch/fpu/fpu_amd64.go b/pkg/sentry/arch/fpu/fpu_amd64.go index 1e9625bee..f0ba26736 100644 --- a/pkg/sentry/arch/fpu/fpu_amd64.go +++ b/pkg/sentry/arch/fpu/fpu_amd64.go @@ -219,6 +219,11 @@ func (s *State) PtraceSetXstateRegs(src io.Reader, maxlen int, featureSet *cpuid return copy(*s, f), nil } +// SetMXCSR sets the MXCSR control/status register in the state. +func (s *State) SetMXCSR(mxcsr uint32) { + hostarch.ByteOrder.PutUint32((*s)[mxcsrOffset:], mxcsr) +} + // BytePointer returns a pointer to the first byte of the state. // //go:nosplit |