linux-stable/arch
Thomas Richter 32f71f3680 s390/cpumf: cpum_cf PMU displays invalid value after hotplug remove
commit 9d48c7afed upstream.

When a CPU is hotplugged while the perf stat -e cycles command is
running, a wrong (very large) value is displayed immediately after the
CPU removal:

  Check the values, shouldn't be too high as in
            time             counts unit events
     1.001101919           29261846      cycles
     2.002454499           17523405      cycles
     3.003659292           24361161      cycles
     4.004816983 18446744073638406144      cycles
     5.005671647      <not counted>      cycles
     ...

The CPU hotplug off took place after 3 seconds.
The issue is the read of the event count value after 4 seconds when
the CPU is not available and the read of the counter returns an
error. This is treated as a counter value of zero. This results
in a very large value (0 - previous_value).

Fix this by detecting the hotplugged off CPU and report 0 instead
of a very large number.

Cc: stable@vger.kernel.org
Fixes: a029a4eab3 ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 19:17:17 +01:00
..
alpha alpha: enable GENERIC_PCI_IOMAP unconditionally 2021-09-19 10:37:00 -07:00
arc ARC: fix potential build snafu 2021-10-15 18:06:32 -07:00
arm ARM: 9156/1: drop cc-option fallbacks for architecture selection 2021-11-18 19:17:13 +01:00
arm64 arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions 2021-11-18 19:17:11 +01:00
csky csky: Make HAVE_TCM depend on !COMPILE_TEST 2021-10-16 07:20:12 +08:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 ia64: don't do IA64_CMPXCHG_DEBUG without CONFIG_PRINTK 2021-11-18 19:16:13 +01:00
m68k m68k: set a default value for MEMORY_RESERVE 2021-11-18 19:17:03 +01:00
microblaze Microblaze patches for 5.15-rc1 2021-09-08 16:02:13 -07:00
mips MIPS: Fix assembly error from MIPSr2 code used within MIPS_ISA_ARCH_LEVEL 2021-11-18 19:17:14 +01:00
nds32 ftrace/nds32: Update the proto for ftrace_trace_function to match ftrace_stub 2021-10-27 13:00:17 -04:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-10-27 09:29:07 -05:00
openrisc openrisc: fix SMP tlb flush NULL pointer dereference 2021-11-18 19:17:06 +01:00
parisc parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page 2021-11-18 19:17:14 +01:00
powerpc powerpc: Don't provide __kernel_map_pages() without ARCH_SUPPORTS_DEBUG_PAGEALLOC 2021-11-18 19:16:57 +01:00
riscv RISC-V Fixes for 5.15 (or -rc8) 2021-10-30 09:28:24 -07:00
s390 s390/cpumf: cpum_cf PMU displays invalid value after hotplug remove 2021-11-18 19:17:17 +01:00
sh signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL) 2021-11-18 19:17:03 +01:00
sparc sparc: Add missing "FORCE" target when using if_changed 2021-11-18 19:17:00 +01:00
um This pull request contains the following changes for UML: 2021-09-09 13:45:26 -07:00
x86 KVM: x86: move guest_pv_has out of user_access section 2021-11-18 19:17:14 +01:00
xtensa xtensa: xtfpga: Try software restart before simulating CPU reset 2021-10-05 12:19:05 -07:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00