Skip to content

Commit f1ac171

Browse files
committed
tools arch x86: Sync the msr-index.h copy with the kernel sources
jira LE-4694 Rebuild_History Non-Buildable kernel-6.12.0-55.43.1.el10_0 commit-author Arnaldo Carvalho de Melo <acme@redhat.com> commit 8122b04 Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-6.12.0-55.43.1.el10_0/8122b047.failed To pick up the changes from these csets: 3f3c8be Merge tag 'for-linus-5.5a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip 4e3f77d ("xen/mcelog: add PPIN to record when available") db4d30f ("x86/bugs: Add ITLB_MULTIHIT bug infrastructure") 1b42f01 ("x86/speculation/taa: Add mitigation for TSX Async Abort") c2955f2 ("x86/msr: Add the IA32_TSX_CTRL MSR") These are the changes in tooling that this udpate ensues: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > /tmp/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 > /tmp/after $ diff -u /tmp/before /tmp/after --- /tmp/before 2019-12-02 11:54:44.371035723 -0300 +++ /tmp/after 2019-12-02 11:55:31.847859784 -0300 @@ -48,6 +48,7 @@ [0x00000119] = "IA32_BBL_CR_CTL", [0x0000011e] = "IA32_BBL_CR_CTL3", [0x00000120] = "IDT_MCR_CTRL", + [0x00000122] = "IA32_TSX_CTRL", [0x00000140] = "MISC_FEATURES_ENABLES", [0x00000174] = "IA32_SYSENTER_CS", [0x00000175] = "IA32_SYSENTER_ESP", @@ -283,4 +284,6 @@ [0xc0010240 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTL", [0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR", [0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC", + [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL", + [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN", }; $ CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o LD /tmp/build/perf/trace/beauty/perf-in.o LD /tmp/build/perf/perf-in.o Now it is possible to use these strings when setting up filters for the msr:* tracepoints, like: # perf trace -e msr:* --filter=msr==IA32_TSX_CTRL ^C[root@quaco ~]# If we use an invalid operator we can check what is the filter that is put in place: # perf trace -e msr:* --filter=msr=IA32_TSX_CTRL Failed to set filter "(msr=0x122) && (common_pid != 25976 && common_pid != 25860)" on event msr:read_msr with 22 (Invalid argument) One can as well use -v to see the tracepoints and its filters: # perf trace -v -e msr:* --filter=msr==IA32_TSX_CTRL Using CPUID GenuineIntel-6-8E-A New filter for msr:read_msr: (msr==0x122) && (common_pid != 26110 && common_pid != 25860) New filter for msr:write_msr: (msr==0x122) && (common_pid != 26110 && common_pid != 25860) New filter for msr:rdpmc: (msr==0x122) && (common_pid != 26110 && common_pid != 25860) mmap size 528384B ^C# Better than keep looking up those numbers, works with callchains as well, e.g. for something more common: # perf trace -e msr:*/max-stack=16/ --filter="msr==IA32_SPEC_CTRL" --max-events=2 0.000 SCTP timer/6158 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __sched_text_start ([kernel.kallsyms]) schedule ([kernel.kallsyms]) schedule_hrtimeout_range_clock ([kernel.kallsyms]) poll_schedule_timeout.constprop.0 ([kernel.kallsyms]) do_select ([kernel.kallsyms]) core_sys_select ([kernel.kallsyms]) kern_select ([kernel.kallsyms]) __x64_sys_select ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64 ([kernel.kallsyms]) __select (/usr/lib64/libc-2.29.so) [0] ([unknown]) 0.024 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __sched_text_start ([kernel.kallsyms]) schedule_idle ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) start_secondary ([kernel.kallsyms]) [0x2000d4] ([kernel.kallsyms]) # Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Juergen Gross <jgross@suse.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vineela Tummalapalli <vineela.tummalapalli@intel.com> Link: https://lkml.kernel.org/n/tip-n1xd78fpd5lxn4q1brqi2jl6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> (cherry picked from commit 8122b04) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # tools/arch/x86/include/asm/msr-index.h
1 parent 9d37c5c commit f1ac171

File tree

1 file changed

+233
-0
lines changed

1 file changed

+233
-0
lines changed
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
tools arch x86: Sync the msr-index.h copy with the kernel sources
2+
3+
jira LE-4694
4+
Rebuild_History Non-Buildable kernel-6.12.0-55.43.1.el10_0
5+
commit-author Arnaldo Carvalho de Melo <acme@redhat.com>
6+
commit 8122b047dd18ef6e7e1c564e28f3c7067c5a2d71
7+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
8+
Will be included in final tarball splat. Ref for failed cherry-pick at:
9+
ciq/ciq_backports/kernel-6.12.0-55.43.1.el10_0/8122b047.failed
10+
11+
To pick up the changes from these csets:
12+
13+
3f3c8be973af Merge tag 'for-linus-5.5a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
14+
4e3f77d8419b ("xen/mcelog: add PPIN to record when available")
15+
db4d30fbb71b ("x86/bugs: Add ITLB_MULTIHIT bug infrastructure")
16+
1b42f017415b ("x86/speculation/taa: Add mitigation for TSX Async Abort")
17+
c2955f270a84 ("x86/msr: Add the IA32_TSX_CTRL MSR")
18+
19+
These are the changes in tooling that this udpate ensues:
20+
21+
$ tools/perf/trace/beauty/tracepoints/x86_msr.sh > /tmp/before
22+
$
23+
$ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
24+
$
25+
$ tools/perf/trace/beauty/tracepoints/x86_msr.sh > /tmp/after
26+
$ diff -u /tmp/before /tmp/after
27+
--- /tmp/before 2019-12-02 11:54:44.371035723 -0300
28+
+++ /tmp/after 2019-12-02 11:55:31.847859784 -0300
29+
@@ -48,6 +48,7 @@
30+
[0x00000119] = "IA32_BBL_CR_CTL",
31+
[0x0000011e] = "IA32_BBL_CR_CTL3",
32+
[0x00000120] = "IDT_MCR_CTRL",
33+
+ [0x00000122] = "IA32_TSX_CTRL",
34+
[0x00000140] = "MISC_FEATURES_ENABLES",
35+
[0x00000174] = "IA32_SYSENTER_CS",
36+
[0x00000175] = "IA32_SYSENTER_ESP",
37+
@@ -283,4 +284,6 @@
38+
[0xc0010240 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTL",
39+
[0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR",
40+
[0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC",
41+
+ [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL",
42+
+ [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN",
43+
};
44+
$
45+
46+
CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
47+
LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
48+
LD /tmp/build/perf/trace/beauty/perf-in.o
49+
LD /tmp/build/perf/perf-in.o
50+
51+
Now it is possible to use these strings when setting up filters for the msr:*
52+
tracepoints, like:
53+
54+
# perf trace -e msr:* --filter=msr==IA32_TSX_CTRL
55+
^C[root@quaco ~]#
56+
57+
If we use an invalid operator we can check what is the filter that is put in
58+
place:
59+
60+
# perf trace -e msr:* --filter=msr=IA32_TSX_CTRL
61+
Failed to set filter "(msr=0x122) && (common_pid != 25976 && common_pid != 25860)" on event msr:read_msr with 22 (Invalid argument)
62+
63+
One can as well use -v to see the tracepoints and its filters:
64+
65+
# perf trace -v -e msr:* --filter=msr==IA32_TSX_CTRL
66+
Using CPUID GenuineIntel-6-8E-A
67+
New filter for msr:read_msr: (msr==0x122) && (common_pid != 26110 && common_pid != 25860)
68+
New filter for msr:write_msr: (msr==0x122) && (common_pid != 26110 && common_pid != 25860)
69+
New filter for msr:rdpmc: (msr==0x122) && (common_pid != 26110 && common_pid != 25860)
70+
mmap size 528384B
71+
^C#
72+
73+
Better than keep looking up those numbers, works with callchains as
74+
well, e.g. for something more common:
75+
76+
# perf trace -e msr:*/max-stack=16/ --filter="msr==IA32_SPEC_CTRL" --max-events=2
77+
0.000 SCTP timer/6158 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6)
78+
do_trace_write_msr ([kernel.kallsyms])
79+
do_trace_write_msr ([kernel.kallsyms])
80+
__switch_to_xtra ([kernel.kallsyms])
81+
__switch_to ([kernel.kallsyms])
82+
__sched_text_start ([kernel.kallsyms])
83+
schedule ([kernel.kallsyms])
84+
schedule_hrtimeout_range_clock ([kernel.kallsyms])
85+
poll_schedule_timeout.constprop.0 ([kernel.kallsyms])
86+
do_select ([kernel.kallsyms])
87+
core_sys_select ([kernel.kallsyms])
88+
kern_select ([kernel.kallsyms])
89+
__x64_sys_select ([kernel.kallsyms])
90+
do_syscall_64 ([kernel.kallsyms])
91+
entry_SYSCALL_64 ([kernel.kallsyms])
92+
__select (/usr/lib64/libc-2.29.so)
93+
[0] ([unknown])
94+
0.024 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL)
95+
do_trace_write_msr ([kernel.kallsyms])
96+
do_trace_write_msr ([kernel.kallsyms])
97+
__switch_to_xtra ([kernel.kallsyms])
98+
__switch_to ([kernel.kallsyms])
99+
__sched_text_start ([kernel.kallsyms])
100+
schedule_idle ([kernel.kallsyms])
101+
do_idle ([kernel.kallsyms])
102+
cpu_startup_entry ([kernel.kallsyms])
103+
start_secondary ([kernel.kallsyms])
104+
[0x2000d4] ([kernel.kallsyms])
105+
#
106+
107+
Cc: Adrian Hunter <adrian.hunter@intel.com>
108+
Cc: Jan Beulich <jbeulich@suse.com>
109+
Cc: Jiri Olsa <jolsa@kernel.org>
110+
Cc: Juergen Gross <jgross@suse.com>
111+
Cc: Namhyung Kim <namhyung@kernel.org>
112+
Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
113+
Cc: Thomas Gleixner <tglx@linutronix.de>
114+
Cc: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
115+
Link: https://lkml.kernel.org/n/tip-n1xd78fpd5lxn4q1brqi2jl6@git.kernel.org
116+
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
117+
(cherry picked from commit 8122b047dd18ef6e7e1c564e28f3c7067c5a2d71)
118+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
119+
120+
# Conflicts:
121+
# tools/arch/x86/include/asm/msr-index.h
122+
diff --cc tools/arch/x86/include/asm/msr-index.h
123+
index 3ae84c3b8e6d,084e98da04a7..000000000000
124+
--- a/tools/arch/x86/include/asm/msr-index.h
125+
+++ b/tools/arch/x86/include/asm/msr-index.h
126+
@@@ -149,66 -105,6 +149,69 @@@
127+
* Not susceptible to
128+
* TSX Async Abort (TAA) vulnerabilities.
129+
*/
130+
++<<<<<<< HEAD
131+
+#define ARCH_CAP_SBDR_SSDP_NO BIT(13) /*
132+
+ * Not susceptible to SBDR and SSDP
133+
+ * variants of Processor MMIO stale data
134+
+ * vulnerabilities.
135+
+ */
136+
+#define ARCH_CAP_FBSDP_NO BIT(14) /*
137+
+ * Not susceptible to FBSDP variant of
138+
+ * Processor MMIO stale data
139+
+ * vulnerabilities.
140+
+ */
141+
+#define ARCH_CAP_PSDP_NO BIT(15) /*
142+
+ * Not susceptible to PSDP variant of
143+
+ * Processor MMIO stale data
144+
+ * vulnerabilities.
145+
+ */
146+
+#define ARCH_CAP_FB_CLEAR BIT(17) /*
147+
+ * VERW clears CPU fill buffer
148+
+ * even on MDS_NO CPUs.
149+
+ */
150+
+#define ARCH_CAP_FB_CLEAR_CTRL BIT(18) /*
151+
+ * MSR_IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]
152+
+ * bit available to control VERW
153+
+ * behavior.
154+
+ */
155+
+#define ARCH_CAP_RRSBA BIT(19) /*
156+
+ * Indicates RET may use predictors
157+
+ * other than the RSB. With eIBRS
158+
+ * enabled predictions in kernel mode
159+
+ * are restricted to targets in
160+
+ * kernel.
161+
+ */
162+
+#define ARCH_CAP_BHI_NO BIT(20) /*
163+
+ * CPU is not affected by Branch
164+
+ * History Injection.
165+
+ */
166+
+#define ARCH_CAP_XAPIC_DISABLE BIT(21) /*
167+
+ * IA32_XAPIC_DISABLE_STATUS MSR
168+
+ * supported
169+
+ */
170+
+#define ARCH_CAP_PBRSB_NO BIT(24) /*
171+
+ * Not susceptible to Post-Barrier
172+
+ * Return Stack Buffer Predictions.
173+
+ */
174+
+#define ARCH_CAP_GDS_CTRL BIT(25) /*
175+
+ * CPU is vulnerable to Gather
176+
+ * Data Sampling (GDS) and
177+
+ * has controls for mitigation.
178+
+ */
179+
+#define ARCH_CAP_GDS_NO BIT(26) /*
180+
+ * CPU is not vulnerable to Gather
181+
+ * Data Sampling (GDS).
182+
+ */
183+
+#define ARCH_CAP_RFDS_NO BIT(27) /*
184+
+ * Not susceptible to Register
185+
+ * File Data Sampling.
186+
+ */
187+
+#define ARCH_CAP_RFDS_CLEAR BIT(28) /*
188+
+ * VERW clears CPU Register
189+
+ * File.
190+
+ */
191+
++=======
192+
++>>>>>>> 8122b047dd18 (tools arch x86: Sync the msr-index.h copy with the kernel sources)
193+
194+
#define MSR_IA32_FLUSH_CMD 0x0000010b
195+
#define L1D_FLUSH BIT(0) /*
196+
@@@ -223,13 -119,6 +226,16 @@@
197+
#define TSX_CTRL_RTM_DISABLE BIT(0) /* Disable RTM feature */
198+
#define TSX_CTRL_CPUID_CLEAR BIT(1) /* Disable TSX enumeration */
199+
200+
++<<<<<<< HEAD
201+
+#define MSR_IA32_MCU_OPT_CTRL 0x00000123
202+
+#define RNGDS_MITG_DIS BIT(0) /* SRBDS support */
203+
+#define RTM_ALLOW BIT(1) /* TSX development mode */
204+
+#define FB_CLEAR_DIS BIT(3) /* CPU Fill buffer clear disable */
205+
+#define GDS_MITG_DIS BIT(4) /* Disable GDS mitigation */
206+
+#define GDS_MITG_LOCKED BIT(5) /* GDS mitigation locked */
207+
+
208+
++=======
209+
++>>>>>>> 8122b047dd18 (tools arch x86: Sync the msr-index.h copy with the kernel sources)
210+
#define MSR_IA32_SYSENTER_CS 0x00000174
211+
#define MSR_IA32_SYSENTER_ESP 0x00000175
212+
#define MSR_IA32_SYSENTER_EIP 0x00000176
213+
@@@ -612,16 -411,8 +618,19 @@@
214+
#define MSR_AMD64_OSVW_STATUS 0xc0010141
215+
#define MSR_AMD_PPIN_CTL 0xc00102f0
216+
#define MSR_AMD_PPIN 0xc00102f1
217+
++<<<<<<< HEAD
218+
+#define MSR_AMD64_CPUID_FN_1 0xc0011004
219+
++=======
220+
++>>>>>>> 8122b047dd18 (tools arch x86: Sync the msr-index.h copy with the kernel sources)
221+
#define MSR_AMD64_LS_CFG 0xc0011020
222+
#define MSR_AMD64_DC_CFG 0xc0011022
223+
+#define MSR_AMD64_TW_CFG 0xc0011023
224+
+
225+
+#define MSR_AMD64_DE_CFG 0xc0011029
226+
+#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
227+
+#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)
228+
+#define MSR_AMD64_DE_CFG_ZEN2_FP_BACKUP_FIX_BIT 9
229+
+
230+
#define MSR_AMD64_BU_CFG2 0xc001102a
231+
#define MSR_AMD64_IBSFETCHCTL 0xc0011030
232+
#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
233+
* Unmerged path tools/arch/x86/include/asm/msr-index.h

0 commit comments

Comments
 (0)