Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp161719lqf; Fri, 26 Apr 2024 02:58:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2XLIilq7zOY+47uf1T8vDLNkJpX7ibY26BGgCkCLQuKZNuS6gDcN6c0V/KugLJGyZPRw+CCpVC2KQYhBhyoGQ/Ievu/IMee7Jo+KZ+g== X-Google-Smtp-Source: AGHT+IHJRnZPxhNMQ8BDgUWVIkQzCP55HQ2PL8Z1cVlV8rxikAFXx8FZkJeq5DizSsmq3sA3BfST X-Received: by 2002:a05:6214:3011:b0:6a0:8b8e:54a0 with SMTP id ke17-20020a056214301100b006a08b8e54a0mr2840154qvb.21.1714125482124; Fri, 26 Apr 2024 02:58:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714125482; cv=pass; d=google.com; s=arc-20160816; b=FkyvqfiKeml/4KouEUhnE1yopFWV/YF4RlamN0DpAe/kz8f97rKE+w+6yiPTG346sd uoSyeK5kPrkpzc0kjbtGqEx8D1Zziz8HCNUM0KiVkVGU6MnwmcZOWH8wucYiTzKoAYfh zKvcRgVWUmyIVCbi0Bpx3i+nqP5z0efs4N1Go2qv5eWPivOCDJuBNMNmRKkai8jUrsON yN5goi1dtLOIqvFzQrM2/ANZ+VoXWvwL3ri21RF2zrE1RsrljwCtCS10F1y+YX9kHBnk L/f6BoDzKOGOPYkF2aHrA4hzrLBULIlHbD4A8ROQX5znlczU45+iMek1OIMzONd7Uhi4 5FMg== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=6EAOD0EmoYi9Pa9IL6WYBj5iZ8Q6vOvCvpfoa2Nt+Aw=; fh=/UdBpbh88O0hudjwR4/6xSqZRmExK1EB+PJ19LyrBtw=; b=PhIVCjZMgUxiaWYoSV2finyTEtOKJz4zHLxMEGbXCu+HFumDAOnOXWFny15XBW5qSF 4Rn2VnHX8YxReSQzcqWufaKxDemGqcrhnlR2E2LvjCH8eYxsB+CSLV62BKWivD8/jFOV kMyX9fYg1I2fI7okfn+a/1SpZ3XLIr1z0T7d39hmPake8FZ5dnE0ZbcZJnr9pfCrqbO/ 7ZdhbQnvtbtAtSex9h1YjppbtdUP+5I8ZlDKswwu6Oq0+ZQl0EbMY9YGDpkeMKAuYYqw hiX4DSEZMVmZV1HnhLa/CIc74n+pP7OANTFMzaNObcZKW6b2aQWIHu3lQfx4r3cElequ JrOg==; 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-159824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z3-20020a05622a028300b00437b740c3d4si17612069qtw.79.2024.04.26.02.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-159824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159824-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C6E2D1C21D11 for ; Fri, 26 Apr 2024 09:58:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 325D61422A2; Fri, 26 Apr 2024 09:57:53 +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 80BCF140388; Fri, 26 Apr 2024 09:57:49 +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=1714125472; cv=none; b=ZnsOooNSBcOwuNhMOBQUPlgSiu7A11gOVCVfxfXp9PMl8V7CHEqh8htrW0M257dg/XhKRuWhicGtVxyMJC3gagvn+76zVy6k7+ea/iFkgVOZY5aZ/pJAXJ9Ym5i7jgAfHmn22QoTkJBesV+ZeRy15FnVXA45VgYKj1DwlKO/a8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714125472; c=relaxed/simple; bh=YnunoMN8nkdnM17N5BzTnP4Rk0EAfSVEPkyuNjEpSow=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z10pMqm01N9HqLmtQ1Eb+SQaMDIgcMxtpyjy/w0fDWWiKtq7IBZl7M6asXHyvSHqw9rERmZv4mN+CEiy6AYtomJoXRQrH5Jn5wmi54ws3Za2ssnx7LSUwED0rydUgzbECVUyA71B0h29rWdGRZyv7y61X3ruSPySIDzYHTLT9eo= 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 4VQp4K2HcZz6K6tS; Fri, 26 Apr 2024 17:55:13 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 82256140B2A; Fri, 26 Apr 2024 17:57:41 +0800 (CST) Received: from localhost (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.35; Fri, 26 Apr 2024 10:57:40 +0100 Date: Fri, 26 Apr 2024 10:57:39 +0100 From: Jonathan Cameron To: Gavin Shan CC: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , "Jean-Philippe Brucker" , Catalin Marinas , Will Deacon , Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: Re: [PATCH v7 12/16] arm64: psci: Ignore DENIED CPUs Message-ID: <20240426105739.00007879@huawei.com> In-Reply-To: References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-13-Jonathan.Cameron@huawei.com> Organization: Huawei Technologies R&D (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) On Fri, 26 Apr 2024 19:36:10 +1000 Gavin Shan wrote: > On 4/18/24 23:54, Jonathan Cameron wrote: > > 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. > > > > 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: Jonathan Cameron > > Signed-off-by: Russell King (Oracle) > > Signed-off-by: Jonathan Cameron > > --- > > v7: No change > > --- > > 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 4ced34f62dab..dc0e0b3ec2d4 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; > > } > > > > The changes in smp.c are based the assumption that PSCI is the only backend, which > isn't true. So we probably need move this error message to specific backend, which > could be PSCI, ACPI parking protocol, or smp_spin_table. Do we? I'll check but I doubt other options ever return -EPERM so this change should not impact those at all. If they do add support in future for rejecting on the basis of not having permission then this is fine anyway. Jonathan > > Thanks, > Gavin >