Re: [PATCH] kernel/cpu: Disallow offlining boot CPU based on config

From: Thomas Gleixner

Date: Fri Jun 05 2026 - 08:37:56 EST


On Fri, Jun 05 2026 at 12:43, Peter Zijlstra wrote:

> On Fri, Jun 05, 2026 at 04:00:46PM +0530, Sneh Mankad wrote:
>> The Qualcomm SoCs like LeMans, Monaco support suspend to ram which leads
>> the SoC to ACPI S3 similar state where SoC is turned off and DDR is
>> retained.
>> The hardware design on these SoCs forces a constraint to suspend and
>> resume the system on boot CPU / CPU0.
>>
>> If CPU0 is already offline before starting suspend to ram the
>> freeze_secondary_cpus() picks alternate CPU as primary / last CPU and
>> proceed further to invoke PSCI SYSTEM_SUSPEND.
>> This leads to a system crash.
>>
>> In order to prevent such an issue introduce PM_SLEEP_SMP_CPU_ZERO_STRICT
>> config and when enabled prohibit the CPU0 to be offline.
>
> Why do this in generic code? Why can't this live in arch code.
> Specifically, x86 can't typically unplug CPU0 at all either.

arch_cpu_is_hotpluggable(cpu) provides that info to the cpu device core.

No hackery in cpu.c required at all.

Thanks,

tglx