From 0690c25e062ad1b8dc162b4b4d70ab59879b9bff Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 22 Jul 2021 15:53:06 -0700 Subject: kvm: set CR0.NE = 1 CR0.NE enables internal x87 floating point error reporting when set, else enables PC style x87 error detection. On AMD, the #MF exception isn't generated if CR0.NE isn't set. PiperOrigin-RevId: 386340269 --- pkg/ring0/kernel_amd64.go | 2 +- pkg/ring0/x86.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/ring0') diff --git a/pkg/ring0/kernel_amd64.go b/pkg/ring0/kernel_amd64.go index 23ec33f92..4a4c0ae26 100644 --- a/pkg/ring0/kernel_amd64.go +++ b/pkg/ring0/kernel_amd64.go @@ -177,7 +177,7 @@ func (c *CPU) TSS() (uint64, uint16, *SegmentDescriptor) { // //go:nosplit func (c *CPU) CR0() uint64 { - return _CR0_PE | _CR0_PG | _CR0_AM | _CR0_ET + return _CR0_PE | _CR0_PG | _CR0_AM | _CR0_ET | _CR0_NE } // CR4 returns the CPU's CR4 value. diff --git a/pkg/ring0/x86.go b/pkg/ring0/x86.go index 7c96cca6b..9a98703da 100644 --- a/pkg/ring0/x86.go +++ b/pkg/ring0/x86.go @@ -25,6 +25,7 @@ import ( const ( _CR0_PE = 1 << 0 _CR0_ET = 1 << 4 + _CR0_NE = 1 << 5 _CR0_AM = 1 << 18 _CR0_PG = 1 << 31 -- cgit v1.2.3