Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206195
b: refs/heads/master
c: ee813d5
h: refs/heads/master
i:
  206193: 5032ed7
  206191: 29ffbe4
v: v3
  • Loading branch information
Robert Richter authored and H. Peter Anvin committed Jul 21, 2010
1 parent c5aa2c4 commit 7ada7df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97e80a70db689fb1e876df9f12305cc72f85ca53
refs/heads/master: ee813d53a8e980a3a28318efb8935d45723f5211
2 changes: 2 additions & 0 deletions trunk/arch/x86/include/asm/xsave.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <linux/types.h>
#include <asm/processor.h>

#define XSTATE_CPUID 0x0000000d

#define XSTATE_FP 0x1
#define XSTATE_SSE 0x2
#define XSTATE_YMM 0x4
Expand Down
11 changes: 8 additions & 3 deletions trunk/arch/x86/kernel/xsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static void setup_xstate_features(void)
xstate_sizes = alloc_bootmem(xstate_features * sizeof(int));

do {
cpuid_count(0xd, leaf, &eax, &ebx, &ecx, &edx);
cpuid_count(XSTATE_CPUID, leaf, &eax, &ebx, &ecx, &edx);

if (eax == 0)
break;
Expand Down Expand Up @@ -425,7 +425,12 @@ static void __cpuinit xstate_enable_boot_cpu(void)
{
unsigned int eax, ebx, ecx, edx;

cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx);
if (boot_cpu_data.cpuid_level < XSTATE_CPUID) {
WARN(1, KERN_ERR "XSTATE_CPUID missing\n");
return;
}

cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
pcntxt_mask = eax + ((u64)edx << 32);

if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) {
Expand All @@ -444,7 +449,7 @@ static void __cpuinit xstate_enable_boot_cpu(void)
/*
* Recompute the context size for enabled features
*/
cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx);
cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
xstate_size = ebx;

update_regset_xstate_info(xstate_size, pcntxt_mask);
Expand Down

0 comments on commit 7ada7df

Please sign in to comment.