linux-stable/drivers/cpuidle
Russell Currey 3c5e8e6667 powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT
[ Upstream commit eac030b22e ]

lppaca_shared_proc() takes a pointer to the lppaca which is typically
accessed through get_lppaca().  With DEBUG_PREEMPT enabled, this leads
to checking if preemption is enabled, for example:

  BUG: using smp_processor_id() in preemptible [00000000] code: grep/10693
  caller is lparcfg_data+0x408/0x19a0
  CPU: 4 PID: 10693 Comm: grep Not tainted 6.5.0-rc3 #2
  Call Trace:
    dump_stack_lvl+0x154/0x200 (unreliable)
    check_preemption_disabled+0x214/0x220
    lparcfg_data+0x408/0x19a0
    ...

This isn't actually a problem however, as it does not matter which
lppaca is accessed, the shared proc state will be the same.
vcpudispatch_stats_procfs_init() already works around this by disabling
preemption, but the lparcfg code does not, erroring any time
/proc/powerpc/lparcfg is accessed with DEBUG_PREEMPT enabled.

Instead of disabling preemption on the caller side, rework
lppaca_shared_proc() to not take a pointer and instead directly access
the lppaca, bypassing any potential preemption checks.

Fixes: f13c13a005 ("powerpc: Stop using non-architected shared_proc field in lppaca")
Signed-off-by: Russell Currey <ruscur@russell.cc>
[mpe: Rework to avoid needing a definition in paca.h and lppaca.h]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230823055317.751786-4-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:48:24 +02:00
..
governors cpuidle: teo: Update idle duration estimate when choosing shallower state 2023-09-13 09:47:58 +02:00
Kconfig cpuidle-haltpoll: select haltpoll governor 2023-01-13 20:50:46 +01:00
Kconfig.arm cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT 2023-02-13 17:15:42 +01:00
Kconfig.mips treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.powerpc treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.riscv cpuidle: Add RISC-V SBI CPU idle driver 2022-03-10 09:29:51 -08:00
Makefile cpuidle: Add RISC-V SBI CPU idle driver 2022-03-10 09:29:51 -08:00
coupled.c cpuidle: coupled: Drop duplicate word from a comment 2022-08-31 20:54:01 +02:00
cpuidle-arm.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-at91.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
cpuidle-big_little.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-calxeda.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
cpuidle-clps711x.c cpuidle: clps711x: convert to devm_platform_ioremap_resource() 2019-12-20 10:04:27 +01:00
cpuidle-cps.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cpuidle-exynos.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpuidle-haltpoll.c cpuidle-haltpoll: Replace default_idle() with arch_cpu_idle() 2023-01-20 17:33:52 +01:00
cpuidle-kirkwood.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
cpuidle-mvebu-v7.c cpuidle: mvebu: Fix duplicate flags assignment 2023-01-18 12:03:54 +01:00
cpuidle-powernv.c powerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state 2022-12-06 23:18:19 +11:00
cpuidle-psci-domain.c cpuidle: psci: Move enabling OSI mode after power domains creation 2023-08-16 18:32:19 +02:00
cpuidle-psci.c cpuidle: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
cpuidle-psci.h cpuidle: Factor-out power domain related code from PSCI domain driver 2022-03-10 09:29:44 -08:00
cpuidle-pseries.c powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-13 09:48:24 +02:00
cpuidle-qcom-spm.c cpuidle: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
cpuidle-riscv-sbi.c RISC-V: Align SBI probe implementation with spec 2023-04-29 13:04:50 -07:00
cpuidle-tegra.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-ux500.c mfd/cpuidle: ux500: Rename driver symbol 2021-08-16 13:42:34 +01:00
cpuidle-zynq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
cpuidle.c cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00
cpuidle.h cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00
driver.c cpuidle: driver: Update microsecond values of state parameters as needed 2023-02-13 16:08:44 +01:00
dt_idle_genpd.c cpuidle: dt_idle_genpd: Add helper function to remove genpd topology 2023-08-16 18:32:19 +02:00
dt_idle_genpd.h cpuidle: dt_idle_genpd: Add helper function to remove genpd topology 2023-08-16 18:32:19 +02:00
dt_idle_states.c cpuidle: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
dt_idle_states.h
governor.c cpuidle: Remove redundant check in cpuidle_switch_governor() 2022-09-03 20:14:51 +02:00
poll_state.c cpuidle: Fix poll_idle() noinstr annotation 2023-01-31 15:01:47 +01:00
sysfs.c cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00