Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53927
b: refs/heads/master
c: 72b1b1d
h: refs/heads/master
i:
  53925: 4d77d00
  53923: f281bba
  53919: b6b981b
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed May 2, 2007
1 parent 7627340 commit 8c9a1e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 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: 4637a74cf2ac3a3696d385c8624d84de789d1bbe
refs/heads/master: 72b1b1d0133d7eb4040697f1052bf92123fb051b
23 changes: 16 additions & 7 deletions trunk/arch/x86_64/kernel/verify_cpu.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,27 @@
* appropriately. Either display a message or halt.
*/

verify_cpu:
#include <asm/cpufeature.h>

verify_cpu:
pushfl # Save caller passed flags
pushl $0 # Kill any dangerous flags
popfl

/* minimum CPUID flags for x86-64 */
/* see http://www.x86-64.org/lists/discuss/msg02971.html */
#define SSE_MASK ((1<<25)|(1<<26))
#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
(1<<13)|(1<<15)|(1<<24))
#define REQUIRED_MASK2 (1<<29)
/* minimum CPUID flags for x86-64 as defined by AMD */
#define M(x) (1<<(x))
#define M2(a,b) M(a)|M(b)
#define M4(a,b,c,d) M(a)|M(b)|M(c)|M(d)

#define SSE_MASK \
(M2(X86_FEATURE_XMM,X86_FEATURE_XMM2))
#define REQUIRED_MASK1 \
(M4(X86_FEATURE_FPU,X86_FEATURE_PSE,X86_FEATURE_TSC,X86_FEATURE_MSR)|\
M4(X86_FEATURE_PAE,X86_FEATURE_CX8,X86_FEATURE_PGE,X86_FEATURE_CMOV)|\
M(X86_FEATURE_FXSR))
#define REQUIRED_MASK2 \
(M(X86_FEATURE_LM - 32))

pushfl # standard way to check for cpuid
popl %eax
movl %eax,%ebx
Expand Down

0 comments on commit 8c9a1e0

Please sign in to comment.