summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/arch/fpu
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-09 17:15:06 -0700
committergVisor bot <gvisor-bot@google.com>2021-04-09 17:15:06 -0700
commit7420821a7b5fe15f3666bb4971796cd45fc5ff38 (patch)
treee589b5c862322dd86a1d0ebee93c0bb5c2710e3b /pkg/sentry/arch/fpu
parentdc8f6c6914747c700a629b7717e45759cf1f7650 (diff)
parenteb9b8e53a3ef7bb96dcb59a0121fa9ed22f01bfd (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.go5
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