summaryrefslogtreecommitdiffhomepage
path: root/pkg/ring0/lib_amd64.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2021-03-30 21:40:07 -0700
committerAndrei Vagin <avagin@gmail.com>2021-04-01 13:28:15 -0700
commiteb9b8e53a3ef7bb96dcb59a0121fa9ed22f01bfd (patch)
treed01a7b7aae854e5b2a89c156d809e1b6aafc4640 /pkg/ring0/lib_amd64.go
parent6c10c772e46ffe8d27cffe77aed24f0d334d611c (diff)
platform/kvm/x86: restore mxcsr when switching from guest to sentry
Goruntime sets mxcsr once and never changes it. Reported-by: syzbot+ec55cea6e57ec083b7a6@syzkaller.appspotmail.com Fixes: #5754
Diffstat (limited to 'pkg/ring0/lib_amd64.go')
-rw-r--r--pkg/ring0/lib_amd64.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/ring0/lib_amd64.go b/pkg/ring0/lib_amd64.go
index 0ec5c3bc5..3e6bb9663 100644
--- a/pkg/ring0/lib_amd64.go
+++ b/pkg/ring0/lib_amd64.go
@@ -61,6 +61,12 @@ func wrgsbase(addr uintptr)
// wrgsmsr writes to the GS_BASE MSR.
func wrgsmsr(addr uintptr)
+// stmxcsr reads the MXCSR control and status register.
+func stmxcsr(addr *uint32)
+
+// ldmxcsr writes to the MXCSR control and status register.
+func ldmxcsr(addr *uint32)
+
// readCR2 reads the current CR2 value.
func readCR2() uintptr