From: Will Deacon <will@kernel•org>
To: Kohei Enju <enju.kohei@fujitsu•com>
Cc: Catalin Marinas <catalin.marinas@arm•com>,
Sami Mujawar <sami.mujawar@arm•com>,
Gavin Shan <gshan@redhat•com>,
Steven Price <steven.price@arm•com>,
Suzuki K Poulose <suzuki.poulose@arm•com>,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH v2] virt: arm-cca-guest: use raw variant of smp_processor_id() in arm_cca_report_new()
Date: Tue, 2 Jun 2026 12:01:04 +0100 [thread overview]
Message-ID: <ah638FZAyCSqtzMi@willie-the-truck> (raw)
In-Reply-To: <20260519101217.155740-1-enju.kohei@fujitsu.com>
On Tue, May 19, 2026 at 07:12:08PM +0900, Kohei Enju wrote:
> With CONFIG_DEBUG_PREEMPT=y, smp_processor_id() becomes an alias of
> debug_smp_processor_id(). This debug function complains when certain
> conditions that ensure CPU ID stability are not met, specifically when
> it's called from a preemptible context.
>
> In arm_cca_report_new(), which runs in a preemptible context,
> smp_processor_id() triggers a splat [0] due to this.
>
> However, the CPU ID obtained here is used as the target CPU for
> smp_call_function_single() to designate a specific CPU for subsequent
> operations, not to assert that the current thread will continue to
> execute on the same CPU. Therefore, snapshotting the CPU ID itself is
> correct, and thus there's no actual harm except for the splat.
>
> Use raw_smp_processor_id() instead, to directly retrieve the current CPU
> ID without the debug checks, avoiding the unnecessary warning message
> while preserving the correct functional behavior.
That's pretty disgusting imo so I'd like to see some more justification
for this approach.
> Note that while migrate_disable() would pin the task to the current CPU,
> this path should not block CPU hotplug events. Therefore, we snapshot
> the current CPU ID and accept that smp_call_function_single() may fail
> if the CPU goes offline.
Why shouldn't it block CPU hotplug events? What happens if the CPU goes
offline and comes back online again during the loop of continue calls?
Will
next prev parent reply other threads:[~2026-06-02 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 10:12 [PATCH v2] virt: arm-cca-guest: use raw variant of smp_processor_id() in arm_cca_report_new() Kohei Enju
2026-06-02 11:01 ` Will Deacon [this message]
2026-06-02 15:48 ` Suzuki K Poulose
2026-06-03 11:48 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ah638FZAyCSqtzMi@willie-the-truck \
--to=will@kernel$(echo .)org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=enju.kohei@fujitsu$(echo .)com \
--cc=gshan@redhat$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=sami.mujawar@arm$(echo .)com \
--cc=steven.price@arm$(echo .)com \
--cc=suzuki.poulose@arm$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox