Skip to content

Commit 08a7d25

Browse files
committed
tools arch x86: Sync the msr-index.h copy with the kernel sources
To pick up the changes from these csets: dc1e67f ("KVM VMX: Move MSR_IA32_VMX_MISC bit defines to asm/vmx.h") d7bfc9f ("KVM: VMX: Move MSR_IA32_VMX_BASIC bit defines to asm/vmx.h") beb2e44 ("x86/cpu: KVM: Move macro to encode PAT value to common header") e7e80b6 ("x86/cpu: KVM: Add common defines for architectural memory types (PAT, MTRRs, etc.)") That cause no changes to tooling: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after $ To see how this works take a look at this previous update: https://git.kernel.org/torvalds/c/174372668933ede5 1743726 ("tools arch x86: Sync the msr-index.h copy with the kernel sources to pick IA32_MKTME_KEYID_PARTITIONING") Just silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Please see tools/include/uapi/README for further details. Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Xin Li <[email protected]> Link: https://lore.kernel.org/lkml/ZxpLSBzGin3vjs3b@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 758f181 commit 08a7d25

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

tools/arch/x86/include/asm/msr-index.h

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
#define EFER_FFXSR (1<<_EFER_FFXSR)
3737
#define EFER_AUTOIBRS (1<<_EFER_AUTOIBRS)
3838

39+
/*
40+
* Architectural memory types that are common to MTRRs, PAT, VMX MSRs, etc.
41+
* Most MSRs support/allow only a subset of memory types, but the values
42+
* themselves are common across all relevant MSRs.
43+
*/
44+
#define X86_MEMTYPE_UC 0ull /* Uncacheable, a.k.a. Strong Uncacheable */
45+
#define X86_MEMTYPE_WC 1ull /* Write Combining */
46+
/* RESERVED 2 */
47+
/* RESERVED 3 */
48+
#define X86_MEMTYPE_WT 4ull /* Write Through */
49+
#define X86_MEMTYPE_WP 5ull /* Write Protected */
50+
#define X86_MEMTYPE_WB 6ull /* Write Back */
51+
#define X86_MEMTYPE_UC_MINUS 7ull /* Weak Uncacheabled (PAT only) */
52+
3953
/* FRED MSRs */
4054
#define MSR_IA32_FRED_RSP0 0x1cc /* Level 0 stack pointer */
4155
#define MSR_IA32_FRED_RSP1 0x1cd /* Level 1 stack pointer */
@@ -365,6 +379,12 @@
365379

366380
#define MSR_IA32_CR_PAT 0x00000277
367381

382+
#define PAT_VALUE(p0, p1, p2, p3, p4, p5, p6, p7) \
383+
((X86_MEMTYPE_ ## p0) | (X86_MEMTYPE_ ## p1 << 8) | \
384+
(X86_MEMTYPE_ ## p2 << 16) | (X86_MEMTYPE_ ## p3 << 24) | \
385+
(X86_MEMTYPE_ ## p4 << 32) | (X86_MEMTYPE_ ## p5 << 40) | \
386+
(X86_MEMTYPE_ ## p6 << 48) | (X86_MEMTYPE_ ## p7 << 56))
387+
368388
#define MSR_IA32_DEBUGCTLMSR 0x000001d9
369389
#define MSR_IA32_LASTBRANCHFROMIP 0x000001db
370390
#define MSR_IA32_LASTBRANCHTOIP 0x000001dc
@@ -1159,15 +1179,6 @@
11591179
#define MSR_IA32_VMX_VMFUNC 0x00000491
11601180
#define MSR_IA32_VMX_PROCBASED_CTLS3 0x00000492
11611181

1162-
/* VMX_BASIC bits and bitmasks */
1163-
#define VMX_BASIC_VMCS_SIZE_SHIFT 32
1164-
#define VMX_BASIC_TRUE_CTLS (1ULL << 55)
1165-
#define VMX_BASIC_64 0x0001000000000000LLU
1166-
#define VMX_BASIC_MEM_TYPE_SHIFT 50
1167-
#define VMX_BASIC_MEM_TYPE_MASK 0x003c000000000000LLU
1168-
#define VMX_BASIC_MEM_TYPE_WB 6LLU
1169-
#define VMX_BASIC_INOUT 0x0040000000000000LLU
1170-
11711182
/* Resctrl MSRs: */
11721183
/* - Intel: */
11731184
#define MSR_IA32_L3_QOS_CFG 0xc81
@@ -1185,11 +1196,6 @@
11851196
#define MSR_IA32_SMBA_BW_BASE 0xc0000280
11861197
#define MSR_IA32_EVT_CFG_BASE 0xc0000400
11871198

1188-
/* MSR_IA32_VMX_MISC bits */
1189-
#define MSR_IA32_VMX_MISC_INTEL_PT (1ULL << 14)
1190-
#define MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS (1ULL << 29)
1191-
#define MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE 0x1F
1192-
11931199
/* AMD-V MSRs */
11941200
#define MSR_VM_CR 0xc0010114
11951201
#define MSR_VM_IGNNE 0xc0010115

0 commit comments

Comments
 (0)