[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] arm/psci: Handle PSCI_ALREADY_ON and PSCI_ON_PENDING as non-fatal


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Sat, 20 Jun 2026 11:38:01 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rbksNNuRvqZIp7HG4ezBwuPrg62fSvJRHarBf9UUhF8=; b=Uf6rRBlrlmd8xAmyHVjvZSwf3vN44V55YYb6LrIl06IFPrvDgZfjc0o5U5QznuCqXyU3cJWItWjE2eevVOllxbnNI3u98GTTx374y4DbKDxZlXC/wuRSqulPoKl1a3d3j5e9NPdOSa6ci0RlcjESynNbtwlj5k53GjN9TY+iDleUZc8mRg5XQhZL8cPpuBhsB6Xb0mPt9Cxy/MlsozkU2E0BFBtlihUmZI3JSnbTXHh8eTsOyhzMI2TFtfhp3WahVD8ucVFniYDljmyJUv6c0eYyA9sfO1eduYkUqpv7zKeMQNc8mbfQKlnWvH587ppCH53wyO1MX3TKjTnW4jr4eg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U20Is2fQke0Pbh3rhb0AGIaQudywI8BYRy+LmMKAzJhJSIBdhMFj+p1nTuoSwz80snJhM+mwl2U8vpZtLQE8Q+RAnzm+oO2zRjn1fBBj7aPIrHGouYQkB2OaSxl+LTVyNb/FiXdH2fTvxgqdr+PDjEriJKOkwhH/Qvy9j014YOmp0hYJOcdHbHShG2SFqT9xSgG+Dx4ahagNcHfStIeeCVX3yvtCmFMfRm2EdXMaQ3dpMeiNmZQo4aD/0dJ/owfUw1c0mMtmqxl4SyNmxHFWIIUzYDeLkaRXybRrC4RMo78vBq2/Zgaq4C09FrCbdnQI///IwHrrbFFQXBTYNp6stA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Sat, 20 Jun 2026 11:38:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdAKlAK1umCsX/P0eRzZ/s11RmWw==
  • Thread-topic: [PATCH] arm/psci: Handle PSCI_ALREADY_ON and PSCI_ON_PENDING as non-fatal

When bringing up a secondary CPU, call_psci_cpu_on() returns the PSCI
result codes back to arch_cpu_up(). If the physical CPU is already powered
on (PSCI_ALREADY_ON) or is powering on (PSCI_ON_PENDING), these negative
codes are treated as fatal errors. This causes Xen to fail the CPU bring-up.

Map PSCI_ALREADY_ON and PSCI_ON_PENDING return codes to PSCI_SUCCESS
inside call_psci_cpu_on(). This allows arch_cpu_up() to succeed and
lets __cpu_up() proceed to poll until the CPU is fully active.

References: Arm Power State Coordination Interface (DEN0022) Section 5.6.2
"Caller responsibilities", Section 6.6 "Implementation CPU_ON/CPU_OFF races".

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
Test CI pipeline: 
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2609141554
---
 xen/arch/arm/psci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index b6860a7760..6015bc0a5a 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -40,11 +40,16 @@ static uint32_t psci_cpu_on_nr;
 int call_psci_cpu_on(int cpu)
 {
     struct arm_smccc_res res;
+    int32_t ret;
 
     arm_smccc_smc(psci_cpu_on_nr, cpu_logical_map(cpu), __pa(init_secondary),
                   &res);
 
-    return PSCI_RET(res);
+    ret = PSCI_RET(res);
+    if ( ret == PSCI_ALREADY_ON || ret == PSCI_ON_PENDING )
+        return PSCI_SUCCESS;
+
+    return ret;
 }
 
 void call_psci_cpu_off(void)
-- 
2.43.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.