From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8CAF346A15 for ; Thu, 9 Jul 2026 04:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783569949; cv=none; b=ZRckC4gzLVHTtvDLfLHQIXIjo2r1t+88IzpRLcKXSYwPX1/vDqLzWHNKUwTGzzHfsthIGD3gdXxFCGZ/jdOs/i6v8SFp1TsrWRA0PzA/3/SH2AIGH/DuV4ZcaxMNQhiqRMLuGtpRKkIu/QlRvrurE57qMz0Un5kr4l5qkxDieQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783569949; c=relaxed/simple; bh=UxOl/Cgec8r5SWlCyxoFuaz+8t46VPWvd7TaCdKCkpI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hCEl1ogqaPpOQ4ammq+SiguIFtqUpRMHK6OI0kOiIZar14TKZnNygqfztHStFCju/eiEN2iwyuWJkKDc7aPoxJVjsraAkxd4HJtqu6AZCzRO/uysQPwOmL2EqCl1DYyqO+STKTf1+2zYtiaIAwU96gp2YaMFL8uysYcDOxwjq7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=e/Q9b9Cv; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=uH3IgfbR; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="e/Q9b9Cv"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="uH3IgfbR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783569946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pvDvI4dnfztHHa3NeUm1AhJrwbMud7s42MrEuRwKfag=; b=e/Q9b9CvwCJePgOMn7dKIqPbpFaAiRjfOgvCC8L4NQ9cO+ItLAawkoX1ThYJZhzHjBG4h+ z3rJ89+pVLWDV592XlTDtJH4sE3JBCGKXAf5zq7j6WP2LrqKY+aNweuernn1zmFkCkl9en jGBiycm62fKOaX9B96zKjqy2w9tvvAw= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-gyjPJ0AzMsm1cFeXyw9cGQ-1; Thu, 09 Jul 2026 00:05:44 -0400 X-MC-Unique: gyjPJ0AzMsm1cFeXyw9cGQ-1 X-Mimecast-MFC-AGG-ID: gyjPJ0AzMsm1cFeXyw9cGQ_1783569944 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8483dd13b63so751995b3a.1 for ; Wed, 08 Jul 2026 21:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783569944; x=1784174744; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pvDvI4dnfztHHa3NeUm1AhJrwbMud7s42MrEuRwKfag=; b=uH3IgfbRgic3vzeBFPAdYjVbo7eJLZWh0bSnD6NgBJ/UA2RaYP3NfUdI7+s5zwBZrg qxqkePfw9J3SB6a9f4pwlRVplBuX5SUTJpIxC8GFASUnKlg0HKgsHkJB+x8nOesn8Gzx 0BfSd+oUVtss7MNM7udHYxbdZM4LveX1uFDxtlHGHCU8O3GrNdEHvN/+iF5TA8hOGP2/ 9VK3VGFDqxUD0cH6zvmD0eoYF1jkeyFIuEIry3GTgr/CjIW0MeksmQzAQdqJtLHEQuwM 0fkIvlndr4GuEreRVDaqA4pgLV2YCXSBmK77nPeEl65831R52NNralxFQxb7/qOQ8Gph UiFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783569944; x=1784174744; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pvDvI4dnfztHHa3NeUm1AhJrwbMud7s42MrEuRwKfag=; b=edBBeQ6tTNTw/UWHupaAf9aawzxDxdm7pULwkt3QrKzA4jFjcf4C9oozIRK6+/fITB F0Juq+PqnpTsGuW21hvba0tXPIh+UuwtZWP8JsENvzsu608KeCnTDsO0ExLOTbh4F5Xl DZunM4DR3wSl65YkYPFvIRKaP4SJfSpeniVIasLqanndxRe3jO3sahqXMIsJnfrrb8Vx J7u7NnxyNIR3c0LgRUZKtcjeDMfSOvaDum67BwZNYFDvD3bFHIFqGqGrFzqqClT8ghjq yu/yQAh1nBx4kOEDVK6Qb1pKBNt/Q5VnRZrWV75rlbVOTU0ZxKEML3y5HdslleMNSttB wNBw== X-Forwarded-Encrypted: i=1; AHgh+RqyvrxxIWIIgWX5zPAUR3xgDNQVkL1P4FJFoXYpHluKxrUQRDZQDCOA/A0EovipN1Zr5RYn0ohNjqAHo9k=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3nnHBMsJWzVy42zWdCfMXE25WiinGY1Ty0aHtA2ekHdGYrPMy OOiz49cFn/fYg8qsvwVAPEV4OTqmxWe75hzRwVE62hMUDCERLfwmSm16Vus+sUqkEQ5B1wJK+Qn mHG9q1nvU9ICx1yaawR1MW8AnXJQEt6A1Brye8FW4CQhlTpIXq6YCnlHfmj0A6Qx3RA== X-Gm-Gg: AfdE7cnHCbVS5KWlq6s02HO9opJ13LwzuMeT8Nl25r/QuiOuurY/HRKUKSOyuS0Or8Z snx4qviQ1DxqSbo46snuiI2nG3RO+ntB/ALK0BUnAcI4QM1rDJ2jx5ZG4DFbRl0dd688yHaA8Ea qD77RCbFXmztO1gEZxp5Om0irn6kMyyx9eUeeWdWJwUQlha2vAsulBzc/2EBRI4ZmptlnGZ9w4u nAib3MrTycgbBwoZ/b5MCMdlzNUXZZf1xCxD/uinFiRd0huaek7AJ3IaTPXnTsX5A6oY1OCbeLG vNJVgFWXdYmVGu6jGEyXbXPkZ6bKyw5rqPgtjl5WY6aXRQWAxVR8JvrT7Q2bmr09u68FkGsIPi5 +gbkzhzXY118GOG99uCbETqrpHrpMAI+ln6/sEalaHhApF+iwGOOSKA== X-Received: by 2002:a05:6a00:91d6:b0:848:44ae:47c1 with SMTP id d2e1a72fcca58-84844ae87b9mr4478259b3a.78.1783569943596; Wed, 08 Jul 2026 21:05:43 -0700 (PDT) X-Received: by 2002:a05:6a00:91d6:b0:848:44ae:47c1 with SMTP id d2e1a72fcca58-84844ae87b9mr4478243b3a.78.1783569943100; Wed, 08 Jul 2026 21:05:43 -0700 (PDT) Received: from [192.168.68.51] (n175-34-8-244.mrk21.qld.optusnet.com.au. [175.34.8.244]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6b93f8csm8277145b3a.19.2026.07.08.21.05.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2026 21:05:42 -0700 (PDT) Message-ID: <56e6a456-92a4-4ea6-91fe-d379c5547c25@redhat.com> Date: Thu, 9 Jul 2026 14:05:35 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] virt: arm-cca-guest: use migrate_disable() for attestation token requests To: Kohei Enju , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Suzuki K Poulose , Sami Mujawar , Steven Price References: <20260612111007.49434-1-enju.kohei@fujitsu.com> Content-Language: en-US From: Gavin Shan In-Reply-To: <20260612111007.49434-1-enju.kohei@fujitsu.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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