diff options
| author | Borislav Petkov <bp@suse.de> | 2017-01-09 06:41:43 -0500 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2017-01-09 17:11:13 -0500 |
| commit | 5dedade6dfa243c130b85d1e4daba6f027805033 (patch) | |
| tree | c6e315a77002b5d3e3b3305fbc4844fe813ef022 | |
| parent | fac69d0efad08fc15e4dbfc116830782acc0dc9a (diff) | |
x86/CPU: Add native CPUID variants returning a single datum
... similarly to the cpuid_<reg>() variants.
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/20170109114147.5082-2-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| -rw-r--r-- | arch/x86/include/asm/processor.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index eaf100508c36..1be64da0384e 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
| @@ -219,6 +219,24 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, | |||
| 219 | : "memory"); | 219 | : "memory"); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | #define native_cpuid_reg(reg) \ | ||
| 223 | static inline unsigned int native_cpuid_##reg(unsigned int op) \ | ||
| 224 | { \ | ||
| 225 | unsigned int eax = op, ebx, ecx = 0, edx; \ | ||
| 226 | \ | ||
| 227 | native_cpuid(&eax, &ebx, &ecx, &edx); \ | ||
| 228 | \ | ||
| 229 | return reg; \ | ||
| 230 | } | ||
| 231 | |||
| 232 | /* | ||
| 233 | * Native CPUID functions returning a single datum. | ||
| 234 | */ | ||
| 235 | native_cpuid_reg(eax) | ||
| 236 | native_cpuid_reg(ebx) | ||
| 237 | native_cpuid_reg(ecx) | ||
| 238 | native_cpuid_reg(edx) | ||
| 239 | |||
| 222 | static inline void load_cr3(pgd_t *pgdir) | 240 | static inline void load_cr3(pgd_t *pgdir) |
| 223 | { | 241 | { |
| 224 | write_cr3(__pa(pgdir)); | 242 | write_cr3(__pa(pgdir)); |
