<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/events, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-17T12:40:36Z</updated>
<entry>
<title>perf/core: Add perf_clear_branch_entry_bitfields() helper</title>
<updated>2022-08-17T12:40:36Z</updated>
<author>
<name>Stephane Eranian</name>
</author>
<published>2022-03-22T22:15:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5897480af004ae6bf2b34165a779183bd4384661'/>
<id>urn:sha1:5897480af004ae6bf2b34165a779183bd4384661</id>
<content type='text'>
[ Upstream commit bfe4daf850f45d92dcd3da477f0b0456620294c3 ]

Make it simpler to reset all the info fields on the
perf_branch_entry by adding a helper inline function.

The goal is to centralize the initialization to avoid missing
a field in case more are added.

Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20220322221517.2510440-2-eranian@google.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/x86/intel/lbr: Fix unchecked MSR access error on HSW</title>
<updated>2022-07-29T15:28:14Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-07-14T18:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=625bcd0685a1612225df83468c83412fc0edb3d7'/>
<id>urn:sha1:625bcd0685a1612225df83468c83412fc0edb3d7</id>
<content type='text'>
commit b0380e13502adf7dd8be4c47d622c3522aae6c63 upstream.

The fuzzer triggers the below trace.

[ 7763.384369] unchecked MSR access error: WRMSR to 0x689
(tried to write 0x1fffffff8101349e) at rIP: 0xffffffff810704a4
(native_write_msr+0x4/0x20)
[ 7763.397420] Call Trace:
[ 7763.399881]  &lt;TASK&gt;
[ 7763.401994]  intel_pmu_lbr_restore+0x9a/0x1f0
[ 7763.406363]  intel_pmu_lbr_sched_task+0x91/0x1c0
[ 7763.410992]  __perf_event_task_sched_in+0x1cd/0x240

On a machine with the LBR format LBR_FORMAT_EIP_FLAGS2, when the TSX is
disabled, a TSX quirk is required to access LBR from registers.
The lbr_from_signext_quirk_needed() is introduced to determine whether
the TSX quirk should be applied. However, the
lbr_from_signext_quirk_needed() is invoked before the
intel_pmu_lbr_init(), which parses the LBR format information. Without
the correct LBR format information, the TSX quirk never be applied.

Move the lbr_from_signext_quirk_needed() into the intel_pmu_lbr_init().
Checking x86_pmu.lbr_has_tsx in the lbr_from_signext_quirk_needed() is
not required anymore.

Both LBR_FORMAT_EIP_FLAGS2 and LBR_FORMAT_INFO have LBR_TSX flag, but
only the LBR_FORMAT_EIP_FLAGS2 requirs the quirk. Update the comments
accordingly.

Fixes: 1ac7fd8159a8 ("perf/x86/intel/lbr: Support LBR format V7")
Reported-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20220714182630.342107-1-kan.liang@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>perf/amd/ibs: Use interrupt regs ip for stack unwinding</title>
<updated>2022-06-09T08:30:08Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2022-04-29T05:14:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4e2399317f9e40393a2894cf80238036dc93a45'/>
<id>urn:sha1:c4e2399317f9e40393a2894cf80238036dc93a45</id>
<content type='text'>
[ Upstream commit 3d47083b9ff46863e8374ad3bb5edb5e464c75f8 ]

IbsOpRip is recorded when IBS interrupt is triggered. But there is
a skid from the time IBS interrupt gets triggered to the time the
interrupt is presented to the core. Meanwhile processor would have
moved ahead and thus IbsOpRip will be inconsistent with rsp and rbp
recorded as part of the interrupt regs. This causes issues while
unwinding stack using the ORC unwinder as it needs consistent rip,
rsp and rbp. Fix this by using rip from interrupt regs instead of
IbsOpRip for stack unwinding.

Fixes: ee9f8fce99640 ("x86/unwind: Add the ORC unwinder")
Reported-by: Dmitry Monakhov &lt;dmtrmonakhov@yandex-team.ru&gt;
Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20220429051441.14251-1-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/amd/ibs: Cascade pmu init functions' return value</title>
<updated>2022-06-09T08:29:41Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2022-05-09T04:49:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7c8f209f59da545bfd4e4465669c06155c5c8f0c'/>
<id>urn:sha1:7c8f209f59da545bfd4e4465669c06155c5c8f0c</id>
<content type='text'>
[ Upstream commit 39b2ca75eec8a33e2ffdb8aa0c4840ec3e3b472c ]

IBS pmu initialization code ignores return value provided by
callee functions. Fix it.

Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20220509044914.1473-2-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/x86/intel: Fix event constraints for ICL</title>
<updated>2022-06-09T08:29:30Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-05-25T13:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c553b6ba212c0a3bb85e6a41f8dce9833e3ba3be'/>
<id>urn:sha1:c553b6ba212c0a3bb85e6a41f8dce9833e3ba3be</id>
<content type='text'>
commit 86dca369075b3e310c3c0adb0f81e513c562b5e4 upstream.

According to the latest event list, the event encoding 0x55
INST_DECODED.DECODERS and 0x56 UOPS_DECODED.DEC0 are only available on
the first 4 counters. Add them into the event constraints table.

Fixes: 6017608936c1 ("perf/x86/intel: Add Icelake support")
Signed-off-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220525133952.1660658-1-kan.liang@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>perf/x86/cstate: Add SAPPHIRERAPIDS_X CPU support</title>
<updated>2022-04-19T19:15:42Z</updated>
<author>
<name>Zhang Rui</name>
</author>
<published>2022-04-15T10:45:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=528c9f1daf20da14d3e7348dc4b1d7c55743ee64'/>
<id>urn:sha1:528c9f1daf20da14d3e7348dc4b1d7c55743ee64</id>
<content type='text'>
From the perspective of Intel cstate residency counters,
SAPPHIRERAPIDS_X is the same as ICELAKE_X.

Share the code with it. And update the comments for SAPPHIRERAPIDS_X.

Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Link: https://lkml.kernel.org/r/20220415104520.2737004-1-rui.zhang@intel.com
</content>
</entry>
<entry>
<title>perf/x86/intel: Update the FRONTEND MSR mask on Sapphire Rapids</title>
<updated>2022-04-05T07:59:44Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-03-28T15:49:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e590928de7547454469693da9bc7ffd562e54b7e'/>
<id>urn:sha1:e590928de7547454469693da9bc7ffd562e54b7e</id>
<content type='text'>
On Sapphire Rapids, the FRONTEND_RETIRED.MS_FLOWS event requires the
FRONTEND MSR value 0x8. However, the current FRONTEND MSR mask doesn't
support it.

Update intel_spr_extra_regs[] to support it.

Fixes: 61b985e3e775 ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids")
Signed-off-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1648482543-14923-2-git-send-email-kan.liang@linux.intel.com
</content>
</entry>
<entry>
<title>perf/x86/intel: Don't extend the pseudo-encoding to GP counters</title>
<updated>2022-04-05T07:59:44Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-03-28T15:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a263bf331c512849062805ef1b4ac40301a9829'/>
<id>urn:sha1:4a263bf331c512849062805ef1b4ac40301a9829</id>
<content type='text'>
The INST_RETIRED.PREC_DIST event (0x0100) doesn't count on SPR.
perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0

 Performance counter stats for 'CPU(s) 0':

           607,246      cpu/event=0xc0,umask=0x0/
                 0      cpu/event=0x0,umask=0x1/

The encoding for INST_RETIRED.PREC_DIST is pseudo-encoding, which
doesn't work on the generic counters. However, current perf extends its
mask to the generic counters.

The pseudo event-code for a fixed counter must be 0x00. Check and avoid
extending the mask for the fixed counter event which using the
pseudo-encoding, e.g., ref-cycles and PREC_DIST event.

With the patch,
perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0

 Performance counter stats for 'CPU(s) 0':

           583,184      cpu/event=0xc0,umask=0x0/
           583,048      cpu/event=0x0,umask=0x1/

Fixes: 2de71ee153ef ("perf/x86/intel: Fix ICL/SPR INST_RETIRED.PREC_DIST encodings")
Signed-off-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1648482543-14923-1-git-send-email-kan.liang@linux.intel.com
</content>
</entry>
<entry>
<title>perf/x86/uncore: Add Raptor Lake uncore support</title>
<updated>2022-04-05T07:59:43Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-03-15T17:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad4878d4d71d9ada913be2ad5b6d7f526a695b6f'/>
<id>urn:sha1:ad4878d4d71d9ada913be2ad5b6d7f526a695b6f</id>
<content type='text'>
The uncore PMU of the Raptor Lake is the same as Alder Lake.
Add new PCIIDs of IMC for Raptor Lake.

Signed-off-by: Kan Liang &lt;kan.liang@intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/1647366360-82824-4-git-send-email-kan.liang@linux.intel.com
</content>
</entry>
<entry>
<title>perf/x86/msr: Add Raptor Lake CPU support</title>
<updated>2022-04-05T07:59:43Z</updated>
<author>
<name>Kan Liang</name>
</author>
<published>2022-03-15T17:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82cd83047a9a80e52c0849e56885279166215310'/>
<id>urn:sha1:82cd83047a9a80e52c0849e56885279166215310</id>
<content type='text'>
Raptor Lake is Intel's successor to Alder lake. PPERF and SMI_COUNT MSRs
are also supported.

Signed-off-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/1647366360-82824-3-git-send-email-kan.liang@linux.intel.com
</content>
</entry>
</feed>
