summaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-28 01:31:15 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-28 01:52:55 +0100
commit4a8995ba22e0862eb8ece1d721870326669719ce (patch)
treeed28e60d134479b4eb0c78a68f8404ddcd952568 /x86_64
parent0b1f1658732cd0e38ecb84a98b3bdf7a97a3b122 (diff)
x86: Pave the way for xsave/xrstor support
* i386/i386/fpu.h (xgetbv, get_xcr0, xsetbv, set_xcr0): New inline functions. (xsave, xrstor): New macros. * i386/i386/locore.S (cpu_features): Extend to two words. (cpu_features_edx, cpu_features_ecx): New labels. (discover_x86_cpu_type): Also save ecx cpuid(1) report. * x86_64/locore.S: Likewise. * i386/i386/locore.h (cpu_features): Extend to two words. (CPU_FEATURE_XSAVE): New macro. * i386/i386/proc_reg.h (CR4_OSXSAVE): New macro.
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/locore.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/x86_64/locore.S b/x86_64/locore.S
index fd3617c5..612fc493 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -1259,6 +1259,9 @@ syscall_addr:
.data
DATA(cpu_features)
+DATA(cpu_features_edx)
+ .long 0
+DATA(cpu_features_ecx)
.long 0
.text
@@ -1271,7 +1274,8 @@ ENTRY(discover_x86_cpu_type)
use it to find out what we are. */
movl $1,%eax /* Fetch CPU type info ... */
cpuid /* ... into eax */
- movl %edx,cpu_features /* Keep a copy */
+ movl %ecx,cpu_features_ecx /* Keep a copy */
+ movl %edx,cpu_features_edx /* Keep a copy */
shrl $8,%eax /* Slide family bits down */
andl $15,%eax /* And select them */
ret /* And return */