Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206194
b: refs/heads/master
c: 97e80a7
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and H. Peter Anvin committed Jul 21, 2010
1 parent 5032ed7 commit c5aa2c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: 0e49bf66d2ca649b167428adddbbbe9d9bd4894c
refs/heads/master: 97e80a70db689fb1e876df9f12305cc72f85ca53
19 changes: 8 additions & 11 deletions trunk/arch/x86/kernel/xsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,10 @@ unsigned int sig_xstate_size = sizeof(struct _fpstate);
/*
* Enable the extended processor state save/restore feature
*/
static void __cpuinit __xsave_init(void)
static inline void xstate_enable(u64 mask)
{
set_in_cr4(X86_CR4_OSXSAVE);

/*
* Enable all the features that the HW is capable of
* and the Linux kernel is aware of.
*/
xsetbv(XCR_XFEATURE_ENABLED_MASK, pcntxt_mask);
xsetbv(XCR_XFEATURE_ENABLED_MASK, mask);
}

/*
Expand Down Expand Up @@ -426,7 +421,7 @@ static void __init setup_xstate_init(void)
/*
* Enable and initialize the xsave feature.
*/
static void __cpuinit xsave_cntxt_init(void)
static void __cpuinit xstate_enable_boot_cpu(void)
{
unsigned int eax, ebx, ecx, edx;

Expand All @@ -443,7 +438,8 @@ static void __cpuinit xsave_cntxt_init(void)
* Support only the state known to OS.
*/
pcntxt_mask = pcntxt_mask & XCNTXT_MASK;
__xsave_init();

xstate_enable(pcntxt_mask);

/*
* Recompute the context size for enabled features
Expand All @@ -470,6 +466,7 @@ void __cpuinit xsave_init(void)
* Boot processor to setup the FP and extended state context info.
*/
if (!smp_processor_id())
xsave_cntxt_init();
__xsave_init();
xstate_enable_boot_cpu();
else
xstate_enable(pcntxt_mask);
}

0 comments on commit c5aa2c4

Please sign in to comment.