From: Gavin Shan <gshan@redhat.com>
To: Kohei Enju <enju.kohei@fujitsu.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Sami Mujawar <sami.mujawar@arm.com>,
Steven Price <steven.price@arm.com>
Subject: Re: [PATCH v3] virt: arm-cca-guest: use migrate_disable() for attestation token requests
Date: Thu, 9 Jul 2026 14:05:35 +1000 [thread overview]
Message-ID: <56e6a456-92a4-4ea6-91fe-d379c5547c25@redhat.com> (raw)
In-Reply-To: <20260612111007.49434-1-enju.kohei@fujitsu.com>
On 6/12/26 9:09 PM, Kohei Enju wrote:
> The RSI attestation token init and continue calls must be issued from
> the same CPU. arm_cca_report_new() currently snapshots the CPU number
> and uses smp_call_function_single() to issue those calls on that CPU.
>
> With CONFIG_DEBUG_PREEMPT=y, the smp_processor_id() call used for the
> snapshot triggers a debug splat [0] because it runs in preemptible
> context. The snapshot does not pin the task to that CPU; it is only used
> to choose the target CPU for smp_call_function_single(), which can fail
> if that CPU is no longer available.
>
> Use migrate_disable() and issue the token init and continue operations
> directly, without the smp_call_function_single() callbacks. This keeps
> the token request sequence on the same CPU while preserving a sleepable
> context for the GFP_KERNEL allocations needed after the init call.
>
> [0]
> BUG: using smp_processor_id() in preemptible [00000000] code: cca-workload-at/264
> caller is debug_smp_processor_id+0x20/0x30
> CPU: 0 UID: 0 PID: 264 Comm: cca-workload-at Not tainted 7.1.0-rc1-00044-g55542ab273f2 #80 PREEMPT(lazy)
> Hardware name: linux,dummy-virt (DT)
> Call trace:
> [...]
> check_preemption_disabled+0xd8/0xf8
> debug_smp_processor_id+0x20/0x30
> arm_cca_report_new+0x48/0x278
> tsm_report_read+0x154/0x1f8
> tsm_report_outblob_read+0x20/0x38
> configfs_bin_read_iter+0x118/0x208
> vfs_read+0x220/0x318
> [...]
>
> Fixes: 7999edc484ca ("virt: arm-cca-guest: TSM_REPORT support for realms")
> Signed-off-by: Kohei Enju <enju.kohei@fujitsu.com>
> ---
> Changes:
> v3:
> - Switch to migrate_disable() and call RSI directly, removing
> smp_call_function_single() (Will, Suzuki)
> - Remove arm_cca_attestation_init() helper and unused fields from
> arm_cca_token_info
> - Drop Reviewed-by tags since the approach changed from v2
> v2: https://lore.kernel.org/linux-arm-kernel/20260519101217.155740-1-enju.kohei@fujitsu.com/
> - Add comment about why this path doesn't use migrate_disable()
> v1: https://lore.kernel.org/linux-arm-kernel/20260518033157.1865498-1-enju.kohei@fujitsu.com/
> ---
> .../virt/coco/arm-cca-guest/arm-cca-guest.c | 97 +++++++------------
> 1 file changed, 36 insertions(+), 61 deletions(-)
>
Reviewed-by: Gavin Shan <gshan@redhat.com>
next prev parent reply other threads:[~2026-07-09 4:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 11:09 [PATCH v3] virt: arm-cca-guest: use migrate_disable() for attestation token requests Kohei Enju
2026-07-03 6:28 ` Kohei Enju
2026-07-03 14:30 ` Steven Price
2026-07-09 4:05 ` Gavin Shan [this message]
2026-07-09 17:48 ` Suzuki K Poulose
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=56e6a456-92a4-4ea6-91fe-d379c5547c25@redhat.com \
--to=gshan@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=enju.kohei@fujitsu.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sami.mujawar@arm.com \
--cc=steven.price@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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