diff options
author | Wan Zongshun <Vincent.Wan@amd.com> | 2015-10-30 08:11:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-11-01 05:26:23 -0500 |
commit | 2167ceabf34163727ca4e283c0f030e3960932e5 (patch) | |
tree | 433525ef378c2a76fc5db2e07f22c4c98d2d3669 | |
parent | 221836e92cd5664de6fc2f1d836f6343ae5f2e43 (diff) |
x86/cpu: Add CLZERO detection
AMD Fam17h processors introduce support for the CLZERO
instruction. It zeroes out the 64 byte cache line specified in
RAX.
Add the bit here to allow /proc/cpuinfo to list the feature.
Boris: we're adding this as a separate ->x86_capability leaf
because CPUID_80000008_EBX is going to contain more feature bits
and it will fill out with time.
Signed-off-by: Wan Zongshun <Vincent.Wan@amd.com>
Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
[ Wrap code in patch form, fix comments. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/1446207099-24948-4-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 9727b3b48bd1..e4f8010f22e0 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/disabled-features.h> | 12 | #include <asm/disabled-features.h> |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #define NCAPINTS 13 /* N 32-bit words worth of info */ | 15 | #define NCAPINTS 14 /* N 32-bit words worth of info */ |
16 | #define NBUGINTS 1 /* N 32-bit bug flags */ | 16 | #define NBUGINTS 1 /* N 32-bit bug flags */ |
17 | 17 | ||
18 | /* | 18 | /* |
@@ -255,6 +255,9 @@ | |||
255 | /* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx), word 12 */ | 255 | /* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx), word 12 */ |
256 | #define X86_FEATURE_CQM_OCCUP_LLC (12*32+ 0) /* LLC occupancy monitoring if 1 */ | 256 | #define X86_FEATURE_CQM_OCCUP_LLC (12*32+ 0) /* LLC occupancy monitoring if 1 */ |
257 | 257 | ||
258 | /* AMD-defined CPU features, CPUID level 0x80000008 (ebx), word 13 */ | ||
259 | #define X86_FEATURE_CLZERO (13*32+0) /* CLZERO instruction */ | ||
260 | |||
258 | /* | 261 | /* |
259 | * BUG word(s) | 262 | * BUG word(s) |
260 | */ | 263 | */ |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index de22ea7ff82f..4ddd780aeac9 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -670,6 +670,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c) | |||
670 | 670 | ||
671 | c->x86_virt_bits = (eax >> 8) & 0xff; | 671 | c->x86_virt_bits = (eax >> 8) & 0xff; |
672 | c->x86_phys_bits = eax & 0xff; | 672 | c->x86_phys_bits = eax & 0xff; |
673 | c->x86_capability[13] = cpuid_ebx(0x80000008); | ||
673 | } | 674 | } |
674 | #ifdef CONFIG_X86_32 | 675 | #ifdef CONFIG_X86_32 |
675 | else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) | 676 | else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) |