diff options
author | Kees Cook <keescook@chromium.org> | 2013-10-11 02:18:13 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-10-13 12:12:02 +0200 |
commit | dd78b97367bd575918204cc89107c1479d3fc1a7 (patch) | |
tree | 145b40fe13f64045d0a5e1063ac17357e9fad0de /arch/x86/boot/cpuflags.h | |
parent | x86, relocs: Add more per-cpu gold special cases (diff) | |
download | linux-dd78b97367bd575918204cc89107c1479d3fc1a7.tar.xz linux-dd78b97367bd575918204cc89107c1479d3fc1a7.zip |
x86, boot: Move CPU flags out of cpucheck
Refactor the CPU flags handling out of the cpucheck routines so that
they can be reused by the future ASLR routines (in order to detect CPU
features like RDRAND and RDTSC).
This reworks has_eflag() and has_fpu() to be used on both 32-bit and
64-bit, and refactors the calls to cpuid to make them PIC-safe on 32-bit.
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: http://lkml.kernel.org/r/1381450698-28710-2-git-send-email-keescook@chromium.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/cpuflags.h')
-rw-r--r-- | arch/x86/boot/cpuflags.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/boot/cpuflags.h b/arch/x86/boot/cpuflags.h new file mode 100644 index 000000000000..9bb4e25f7317 --- /dev/null +++ b/arch/x86/boot/cpuflags.h @@ -0,0 +1,19 @@ +#ifndef BOOT_CPUFLAGS_H +#define BOOT_CPUFLAGS_H + +#include <asm/cpufeature.h> +#include <asm/processor-flags.h> + +struct cpu_features { + int level; /* Family, or 64 for x86-64 */ + int model; + u32 flags[NCAPINTS]; +}; + +extern struct cpu_features cpu; +extern u32 cpu_vendor[3]; + +int has_eflag(unsigned long mask); +void get_flags(void); + +#endif |