Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp645173lqb; Wed, 29 May 2024 06:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3psaYSviwYNawUlQl5+3/FJ4q+DrIciqyl3D1QQeGOmcaqIMrYb8GPv0cDMn8Pbq41u7X2TJ7yB3gIzQDmVFz5wtrZJ4s+VUdjAfQMg== X-Google-Smtp-Source: AGHT+IF0wS8syQGz/Y6NMkknWuXablv25Mc/0PSJ977xrGaoLRbPlLz5T+mllFTkRXX/Q2xQ7YZz X-Received: by 2002:a05:6a00:4c12:b0:6f3:ead3:c287 with SMTP id d2e1a72fcca58-6f8f194beaemr17988744b3a.0.1716990476200; Wed, 29 May 2024 06:47:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716990476; cv=pass; d=google.com; s=arc-20160816; b=TH1QrNsV9tRQYjYf0O63TuZE7Z5RCII5sLJdGOZ1gsSwRlFHbNg4p3qSyIP93ReeOS wasi5hFXSrsqABsk3CZnkfN3UMg2FkCb73GjI23FxarRrPMGLkBNVwlKxvCys0k/GTGv ePfwO7JUYqFE31ofeAu65SRvXwAu5uTWDmU0BJ/BYLyorA7GV8+1SRy9d16q2/nFBC6E 70quPVci20IdwET260HoeUURccpQJ/qxVrrI20ZnHmq+x46l3SZo9FxzLabHaDM4o4KH RDdLG3p0r1X/CTV5elBipl6RoifqBxwyvlBb7y08d7OU+YX4Etb4RsV+KmKmToYCUplV b7Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ibG74lziw69Z05PLXiWiVzjwqWf0lV81Vpd42psAqK4=; fh=NxmCHexitX7P6x/7ARv3vZBmyAUGQGWkF2RSnxwWsIo=; b=pdIqGIH5Y0+oyOsxzXpyzoddV1OAqvIu2tW/S9sKtpfKE0JDkyDXxjsFzXNbqz0CjW fon2tf6T5N9e17keKJnel9AjnLNd0Oaj38E2Tst8Tm1EAPlCoCBDm6C4AtRizeFhE2i5 4AQhCPt52wxaeBewjtvEmw/be1bNqV2PUNElS62PiA6gAfT5iCvlxPDtj08KiS4p9OJK RtgjSVCL8F387I2Ohv8k0I9c68C1KntYdpvQd/rwKxaBWgNiqn5ZxJhUmD+MflfVirEg XvgTiXho1sBkEN47AyJZ91k3uqiHAOFiHKNFKZODbNdMfvjUqx0kwIvrebCKot5nKeX+ Dq0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-194185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fc051238si9902274b3a.7.2024.05.29.06.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 06:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-194185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B1B10B2555A for ; Wed, 29 May 2024 13:42:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4861A1B949; Wed, 29 May 2024 13:42:37 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 5711D17BBA; Wed, 29 May 2024 13:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716990156; cv=none; b=gUtirKho2yfth2lO5JL+BmlmNoehx8FJXGmuL14/rXL7NG7Vn+aGnpQHVZECO5JcHtHG7/KhjHXejwYbwyB/7p+GofCNJzg6QOWZZrE/QWIOUTBDj18JA+zjT0UTi+UO4Rb0aMyibYJctzZjYYcUWGOsdmMDoJSD5nIyYuLx8zI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716990156; c=relaxed/simple; bh=0LPxpDknx3zfZcyGuH1mlTgiwezfEYHQZxzUf6U1jp8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PBikrlwy4dHuyqo/O3Ng3WqBwAyE+WZ73Ni2NHpUaY/YYyyPqwfrP4et8vGyxwDl+fzBrjWl4tJTc0WrTc4Xl93huWpIzqt+C9syevFU8DhbDqGejsVSut6rZiMCIgBck363O+Va43fyn2Oo6hYXlOGc0g/IjeanSVXRgXlfqks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vq9SV135bz6J6nV; Wed, 29 May 2024 21:38:18 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id EA9B9140A30; Wed, 29 May 2024 21:42:31 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 29 May 2024 14:42:31 +0100 From: Jonathan Cameron To: Marc Zyngier , Will Deacon , Catalin Marinas , , , , , CC: Mark Rutland , Thomas Gleixner , Peter Zijlstra , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Hanjun Guo , Gavin Shan , Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v10 15/19] arm64: psci: Ignore DENIED CPUs Date: Wed, 29 May 2024 14:34:42 +0100 Message-ID: <20240529133446.28446-16-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> References: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) From: Jean-Philippe Brucker When a CPU is marked as disabled, but online capable in the MADT, PSCI applies some firmware policy to control when it can be brought online. PSCI returns DENIED to a CPU_ON request if this is not currently permitted. The OS can learn the current policy from the _STA enabled bit. Handle the PSCI DENIED return code gracefully instead of printing an error. Note the alternatives to the PSCI cpu_boot() callback do not return -EPERM so the change in smp.c has no affect. See https://developer.arm.com/documentation/den0022/f/?lang=en page 58. Signed-off-by: Jean-Philippe Brucker [ morse: Rewrote commit message ] Signed-off-by: James Morse Tested-by: Miguel Luis Tested-by: Vishnu Pajjuri Tested-by: Jianyong Wu Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) Signed-off-by: Jonathan Cameron --- arch/arm64/kernel/psci.c | 2 +- arch/arm64/kernel/smp.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 29a8e444db83..fabd732d0a2d 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -40,7 +40,7 @@ static int cpu_psci_cpu_boot(unsigned int cpu) { phys_addr_t pa_secondary_entry = __pa_symbol(secondary_entry); int err = psci_ops.cpu_on(cpu_logical_map(cpu), pa_secondary_entry); - if (err) + if (err && err != -EPERM) pr_err("failed to boot CPU%d (%d)\n", cpu, err); return err; diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 6b0572daa9da..a755b9f902fa 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -132,7 +132,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) /* Now bring the CPU into our world */ ret = boot_secondary(cpu, idle); if (ret) { - pr_err("CPU%u: failed to boot: %d\n", cpu, ret); + if (ret != -EPERM) + pr_err("CPU%u: failed to boot: %d\n", cpu, ret); return ret; } -- 2.39.2