mirror-linux/arch
Breno Leitao ab33a8f764 perf/x86/amd/core: Always clear status for idx
[ Upstream commit 263f5ecaf7 ]

The variable 'status' (which contains the unhandled overflow bits) is
not being properly masked in some cases, displaying the following
warning:

  WARNING: CPU: 156 PID: 475601 at arch/x86/events/amd/core.c:972 amd_pmu_v2_handle_irq+0x216/0x270

This seems to be happening because the loop is being continued before
the status bit being unset, in case x86_perf_event_set_period()
returns 0. This is also causing an inconsistency because the "handled"
counter is incremented, but the status bit is not cleaned.

Move the bit cleaning together above, together when the "handled"
counter is incremented.

Fixes: 7685665c39 ("perf/x86/amd/core: Add PerfMonV2 overflow handling")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sandipan Das <sandipan.das@amd.com>
Link: https://lore.kernel.org/r/20230321113338.1669660-1-leitao@debian.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-30 12:49:13 +02:00
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:50:31 +01:00
arc
arm ARM: dts: imx6sl: tolino-shine2hd: fix usbotg1 pinctrl 2023-03-30 12:49:01 +02:00
arm64 arm64: dts: imx93: add missing #address-cells and #size-cells to i2c nodes 2023-03-30 12:49:02 +02:00
csky
hexagon
ia64 ia64: fix build error due to switch case label appearing next to declaration 2023-02-09 11:28:23 +01:00
loongarch LoongArch: Only call get_timer_irq() once in constant_clockevent_init() 2023-03-22 13:33:54 +01:00
m68k m68k: mm: Move initrd phys_to_virt handling after paging_init() 2023-03-17 08:50:26 +01:00
microblaze kbuild: fix "cat: .version: No such file or directory" 2022-11-24 09:26:02 +09:00
mips MIPS: Fix a compilation issue 2023-03-17 08:50:30 +01:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-11-27 08:28:41 +09:00
openrisc
parisc parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case 2023-02-09 11:28:20 +01:00
powerpc powerpc/64: Replace -mcpu=e500mc64 by -mcpu=e5500 2023-03-22 13:34:07 +01:00
riscv riscv: asid: Fixup stale TLB entry cause application crash 2023-03-22 13:34:00 +01:00
s390 s390/ipl: add missing intersection check to ipl_report handling 2023-03-22 13:33:56 +01:00
sh sh: define RUNTIME_DISCARD_EXIT 2023-02-25 11:25:42 +01:00
sparc sparc: allow PM configs for sparc32 COMPILE_TEST 2023-03-10 09:33:27 +01:00
um UML: define RUNTIME_DISCARD_EXIT 2023-03-17 08:50:32 +01:00
x86 perf/x86/amd/core: Always clear status for idx 2023-03-30 12:49:13 +02:00
xtensa xtensa: add __umulsidi3 helper 2023-01-07 11:11:46 +01:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:32:45 +01:00