code: plan9front

Download patch

ref: 3da0a627971a5ec4ca5c8253dbb798df56c5ddcb
parent: 217222e75a112845a0345875b0404afa1c6a58b0
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jul 8 14:19:20 EDT 2023

devvmx: restore previous initial value for xcr0

as the processor manual states, xcr0 should be 1 on reset
(if extended states are supported).

--- a/sys/src/9/pc/devvmx.c
+++ b/sys/src/9/pc/devvmx.c
@@ -1063,7 +1063,7 @@
 #endif
 	fpinit();
 	fpsave(&vmx->fp);
-	vmx->xcr0 = m->xcr0;
+	vmx->xcr0 = m->xcr0 & 1;	/* x87 only */
 	splx(s);
 
 	memset(vmx->msrbits, -1, 4096);