Skip to content

Commit 4a4a28f

Browse files
committed
Merge tag 'x86_misc_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc x86 updates from Borislav Petkov: - Add a x86 hw vulnerabilities section to MAINTAINERS so that the folks involved in it can get CCed on patches - Add some more CPUID leafs to the kcpuid tool and extend its functionality to be more useful when grepping for CPUID bits * tag 'x86_misc_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: MAINTAINERS: Add x86 hardware vulnerabilities section tools/x86/kcpuid: Dump the CPUID function in detailed view tools/x86/kcpuid: Update AMD leaf Fn80000001 tools/x86/kcpuid: Fix avx512bw and avx512lvl fields in Fn00000007
2 parents e3420f9 + 5910f06 commit 4a4a28f

File tree

3 files changed

+92
-12
lines changed

3 files changed

+92
-12
lines changed

MAINTAINERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22663,6 +22663,17 @@ S: Maintained
2266322663
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm
2266422664
F: arch/x86/entry/
2266522665

22666+
X86 HARDWARE VULNERABILITIES
22667+
M: Thomas Gleixner <[email protected]>
22668+
M: Borislav Petkov <[email protected]>
22669+
M: Peter Zijlstra <[email protected]>
22670+
M: Josh Poimboeuf <[email protected]>
22671+
R: Pawan Gupta <[email protected]>
22672+
S: Maintained
22673+
F: Documentation/admin-guide/hw-vuln/
22674+
F: arch/x86/include/asm/nospec-branch.h
22675+
F: arch/x86/kernel/cpu/bugs.c
22676+
2266622677
X86 MCE INFRASTRUCTURE
2266722678
M: Tony Luck <[email protected]>
2266822679
M: Borislav Petkov <[email protected]>

tools/arch/x86/kcpuid/cpuid.csv

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@
184184
7, 0, EBX, 27, avx512er, AVX512 Exponent Reciproca instr
185185
7, 0, EBX, 28, avx512cd, AVX512 Conflict Detection instr
186186
7, 0, EBX, 29, sha, Intel Secure Hash Algorithm Extensions instr
187-
7, 0, EBX, 26, avx512bw, AVX512 Byte & Word instr
188-
7, 0, EBX, 28, avx512vl, AVX512 Vector Length Extentions (VL)
187+
7, 0, EBX, 30, avx512bw, AVX512 Byte & Word instr
188+
7, 0, EBX, 31, avx512vl, AVX512 Vector Length Extentions (VL)
189189
7, 0, ECX, 0, prefetchwt1, X
190190
7, 0, ECX, 1, avx512vbmi, AVX512 Vector Byte Manipulation Instructions
191191
7, 0, ECX, 2, umip, User-mode Instruction Prevention
@@ -340,19 +340,70 @@
340340
# According to SDM
341341
# 40000000H - 4FFFFFFFH is invalid range
342342

343-
344343
# Leaf 80000001H
345344
# Extended Processor Signature and Feature Bits
346345

346+
0x80000001, 0, EAX, 27:20, extfamily, Extended family
347+
0x80000001, 0, EAX, 19:16, extmodel, Extended model
348+
0x80000001, 0, EAX, 11:8, basefamily, Description of Family
349+
0x80000001, 0, EAX, 11:8, basemodel, Model numbers vary with product
350+
0x80000001, 0, EAX, 3:0, stepping, Processor stepping (revision) for a specific model
351+
352+
0x80000001, 0, EBX, 31:28, pkgtype, Specifies the package type
353+
347354
0x80000001, 0, ECX, 0, lahf_lm, LAHF/SAHF available in 64-bit mode
355+
0x80000001, 0, ECX, 1, cmplegacy, Core multi-processing legacy mode
356+
0x80000001, 0, ECX, 2, svm, Indicates support for: VMRUN, VMLOAD, VMSAVE, CLGI, VMMCALL, and INVLPGA
357+
0x80000001, 0, ECX, 3, extapicspace, Extended APIC register space
358+
0x80000001, 0, ECX, 4, altmovecr8, Indicates support for LOCK MOV CR0 means MOV CR8
348359
0x80000001, 0, ECX, 5, lzcnt, LZCNT
360+
0x80000001, 0, ECX, 6, sse4a, EXTRQ, INSERTQ, MOVNTSS, and MOVNTSD instruction support
361+
0x80000001, 0, ECX, 7, misalignsse, Misaligned SSE Mode
349362
0x80000001, 0, ECX, 8, prefetchw, PREFETCHW
350-
363+
0x80000001, 0, ECX, 9, osvw, OS Visible Work-around support
364+
0x80000001, 0, ECX, 10, ibs, Instruction Based Sampling
365+
0x80000001, 0, ECX, 11, xop, Extended operation support
366+
0x80000001, 0, ECX, 12, skinit, SKINIT and STGI support
367+
0x80000001, 0, ECX, 13, wdt, Watchdog timer support
368+
0x80000001, 0, ECX, 15, lwp, Lightweight profiling support
369+
0x80000001, 0, ECX, 16, fma4, Four-operand FMA instruction support
370+
0x80000001, 0, ECX, 17, tce, Translation cache extension
371+
0x80000001, 0, ECX, 22, TopologyExtensions, Indicates support for Core::X86::Cpuid::CachePropEax0 and Core::X86::Cpuid::ExtApicId
372+
0x80000001, 0, ECX, 23, perfctrextcore, Indicates support for Core::X86::Msr::PERF_CTL0 - 5 and Core::X86::Msr::PERF_CTR
373+
0x80000001, 0, ECX, 24, perfctrextdf, Indicates support for Core::X86::Msr::DF_PERF_CTL and Core::X86::Msr::DF_PERF_CTR
374+
0x80000001, 0, ECX, 26, databreakpointextension, Indicates data breakpoint support for Core::X86::Msr::DR0_ADDR_MASK, Core::X86::Msr::DR1_ADDR_MASK, Core::X86::Msr::DR2_ADDR_MASK and Core::X86::Msr::DR3_ADDR_MASK
375+
0x80000001, 0, ECX, 27, perftsc, Performance time-stamp counter supported
376+
0x80000001, 0, ECX, 28, perfctrextllc, Indicates support for L3 performance counter extensions
377+
0x80000001, 0, ECX, 29, mwaitextended, MWAITX and MONITORX capability is supported
378+
0x80000001, 0, ECX, 30, admskextn, Indicates support for address mask extension (to 32 bits and to all 4 DRs) for instruction breakpoints
379+
380+
0x80000001, 0, EDX, 0, fpu, x87 floating point unit on-chip
381+
0x80000001, 0, EDX, 1, vme, Virtual-mode enhancements
382+
0x80000001, 0, EDX, 2, de, Debugging extensions, IO breakpoints, CR4.DE
383+
0x80000001, 0, EDX, 3, pse, Page-size extensions (4 MB pages)
384+
0x80000001, 0, EDX, 4, tsc, Time stamp counter, RDTSC/RDTSCP instructions, CR4.TSD
385+
0x80000001, 0, EDX, 5, msr, Model-specific registers (MSRs), with RDMSR and WRMSR instructions
386+
0x80000001, 0, EDX, 6, pae, Physical-address extensions (PAE)
387+
0x80000001, 0, EDX, 7, mce, Machine Check Exception, CR4.MCE
388+
0x80000001, 0, EDX, 8, cmpxchg8b, CMPXCHG8B instruction
389+
0x80000001, 0, EDX, 9, apic, advanced programmable interrupt controller (APIC) exists and is enabled
351390
0x80000001, 0, EDX, 11, sysret, SYSCALL/SYSRET supported
391+
0x80000001, 0, EDX, 12, mtrr, Memory-type range registers
392+
0x80000001, 0, EDX, 13, pge, Page global extension, CR4.PGE
393+
0x80000001, 0, EDX, 14, mca, Machine check architecture, MCG_CAP
394+
0x80000001, 0, EDX, 15, cmov, Conditional move instructions, CMOV, FCOMI, FCMOV
395+
0x80000001, 0, EDX, 16, pat, Page attribute table
396+
0x80000001, 0, EDX, 17, pse36, Page-size extensions
352397
0x80000001, 0, EDX, 20, exec_dis, Execute Disable Bit available
398+
0x80000001, 0, EDX, 22, mmxext, AMD extensions to MMX instructions
399+
0x80000001, 0, EDX, 23, mmx, MMX instructions
400+
0x80000001, 0, EDX, 24, fxsr, FXSAVE and FXRSTOR instructions
401+
0x80000001, 0, EDX, 25, ffxsr, FXSAVE and FXRSTOR instruction optimizations
353402
0x80000001, 0, EDX, 26, 1gb_page, 1GB page supported
354403
0x80000001, 0, EDX, 27, rdtscp, RDTSCP and IA32_TSC_AUX are available
355-
#0x80000001, 0, EDX, 29, 64b, 64b Architecture supported
404+
0x80000001, 0, EDX, 29, lm, 64b Architecture supported
405+
0x80000001, 0, EDX, 30, threednowext, AMD extensions to 3DNow! instructions
406+
0x80000001, 0, EDX, 31, threednow, 3DNow! instructions
356407

357408
# Leaf 80000002H/80000003H/80000004H
358409
# Processor Brand String

tools/arch/x86/kcpuid/kcpuid.c

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ struct reg_desc {
3333
struct bits_desc descs[32];
3434
};
3535

36-
enum {
36+
enum cpuid_reg {
3737
R_EAX = 0,
3838
R_EBX,
3939
R_ECX,
4040
R_EDX,
4141
NR_REGS
4242
};
4343

44+
static const char * const reg_names[] = {
45+
"EAX", "EBX", "ECX", "EDX",
46+
};
47+
4448
struct subleaf {
4549
u32 index;
4650
u32 sub;
@@ -428,12 +432,18 @@ static void parse_text(void)
428432

429433

430434
/* Decode every eax/ebx/ecx/edx */
431-
static void decode_bits(u32 value, struct reg_desc *rdesc)
435+
static void decode_bits(u32 value, struct reg_desc *rdesc, enum cpuid_reg reg)
432436
{
433437
struct bits_desc *bdesc;
434438
int start, end, i;
435439
u32 mask;
436440

441+
if (!rdesc->nr) {
442+
if (show_details)
443+
printf("\t %s: 0x%08x\n", reg_names[reg], value);
444+
return;
445+
}
446+
437447
for (i = 0; i < rdesc->nr; i++) {
438448
bdesc = &rdesc->descs[i];
439449

@@ -468,13 +478,21 @@ static void show_leaf(struct subleaf *leaf)
468478
if (!leaf)
469479
return;
470480

471-
if (show_raw)
481+
if (show_raw) {
472482
leaf_print_raw(leaf);
483+
} else {
484+
if (show_details)
485+
printf("CPUID_0x%x_ECX[0x%x]:\n",
486+
leaf->index, leaf->sub);
487+
}
488+
489+
decode_bits(leaf->eax, &leaf->info[R_EAX], R_EAX);
490+
decode_bits(leaf->ebx, &leaf->info[R_EBX], R_EBX);
491+
decode_bits(leaf->ecx, &leaf->info[R_ECX], R_ECX);
492+
decode_bits(leaf->edx, &leaf->info[R_EDX], R_EDX);
473493

474-
decode_bits(leaf->eax, &leaf->info[R_EAX]);
475-
decode_bits(leaf->ebx, &leaf->info[R_EBX]);
476-
decode_bits(leaf->ecx, &leaf->info[R_ECX]);
477-
decode_bits(leaf->edx, &leaf->info[R_EDX]);
494+
if (!show_raw && show_details)
495+
printf("\n");
478496
}
479497

480498
static void show_func(struct cpuid_func *func)

0 commit comments

Comments
 (0)