Re: [PATCH v2] arch: arm64: add early_param idle=<wfi|yield|nop>

From: Sudeep Holla

Date: Mon Jul 13 2026 - 11:41:22 EST


On Mon, Jul 13, 2026 at 05:54:16PM +0530, Anshuman Khandual wrote:
> On 13/07/26 3:27 PM, Sudeep Holla wrote:
> > On Sat, Jul 11, 2026 at 09:35:25AM +0200, Yureka Lilian wrote:
> >> Overriding the idle mechanism might be useful for debugging and performance
> >> testing. Add a cmdline parameter for it, similar to the existing idle=
> >> parameter already present for the x86 and ppc architectures.
> >>
> >> It is also useful on platforms where the WFI instruction misbehaves,
> >> such as Apple Silicon SoCs. Generally, a misbehaving instruction should
> >> be treated as an erratum and patched using the alternatives framework.
> >> However, in the Apple Silicon case we need more flexibility because it is
> >> difficult to detect whether the erratum applies. For example, Linux VMs
> >> inside macOS have the same MIDR and may even seem like they're running
> >> in EL2 in the case of NV, but should continue using WFI (it's trapped and
> >> handled correctly by the hypervisor there). Thus, we prefer to
> >> let the m1n1 bootloader add the idle=nop parameter[1].
> >>
> >> Link[1]: https://lore.kernel.org/all/99b69262-e54b-424e-baa2-96ef7013b87a@xxxxxxxxxx/
> >> Suggested-by: Will Deacon <will@xxxxxxxxxx>
> >> Signed-off-by: Yureka Lilian <yureka@xxxxxxxxxxxxxx>
> >> ---
> >> Changes in v2:
> >> - Applied suggestions by Anshuman Khandual (Thanks!)
> >> - Link to v1: https://patch.msgid.link/20260705-arm64-idle-param-v1-1-7454249f473f@xxxxxxxxxxxxxx
> >> ---
> >> Documentation/admin-guide/kernel-parameters.txt | 23 +++++++++++++++++++
> >> arch/arm64/kernel/idle.c | 30 +++++++++++++++++++++++--
> >> arch/arm64/kernel/idle.h | 13 +++++++++++
> >> arch/arm64/lib/delay.c | 5 ++++-
> >> 4 files changed, 68 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> >> index b2d7d3540ded..d7f5471edf8f 100644
> >> --- a/Documentation/admin-guide/kernel-parameters.txt
> >> +++ b/Documentation/admin-guide/kernel-parameters.txt
> >> @@ -2239,6 +2239,29 @@ Kernel parameters
> >>
> >> idle=nomwait: Disable mwait for CPU C-states
> >>
> >> + [ARM64,EARLY]
> >> + Format: idle=wfi, idle=yield, idle=nop
> >> +
> >> + idle=wfi: Use the WFI (Wait For Interrupt) hint
> >> + instruction in the idle loop. This is the default and
> >> + allows the CPU to enter a low-power state until an
> >> + interrupt arrives.
> >
> > Just curious as when and why one would need to use idle=wfi if that is the
> > default behaviour. I am missing the need to have it.
>
> I guess once there is a list to chose options from in the command line,
> should not the default option be listed there as well ?
>

I don't know if it is a requirement or just a practice. But for reasons
Will mentioned, it becomes a requirement.

--
Regards,
Sudeep