Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp602114rdb; Tue, 23 Jan 2024 08:58:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFroJfNnDCK64eZ6jJjbq01zYxQPhnpY9AvC1SoJmzTekeYNanfjn9MWXP+IkpyGfDm3jOe X-Received: by 2002:a05:6358:724f:b0:170:d73f:d25f with SMTP id i15-20020a056358724f00b00170d73fd25fmr6657883rwa.37.1706029086069; Tue, 23 Jan 2024 08:58:06 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id le9-20020a056a004fc900b006dd86c9a2f4si209837pfb.310.2024.01.23.08.58.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 08:58:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35653-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=aI5GPVMb; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-35653-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35653-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 5D2DCB24923 for ; Tue, 23 Jan 2024 16:36:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E6A77FBAA; Tue, 23 Jan 2024 16:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="aI5GPVMb" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 53BF3481C7; Tue, 23 Jan 2024 16:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706027779; cv=none; b=AXg/hzX82jAoYMNfaWKNGs/lB3o5cEP/D041eIdf6HaZX5qAb3mzxUUdSl+TdCc5qCvFOm+sooHGZ1ve3jc3BzeMO/7fifj/770hQuIXCDpK7XKA5B2lrqArgYSOduywl/yJ1+NJUZm2e0LJ7pxBPZCwxb7wZ45D6WHA1U3tpCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706027779; c=relaxed/simple; bh=mg1lFDQ2Cc93Q00sMStqVpL8+TpnAXOykvzRqppkaQY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A0Scfbg1Z/gzHRuWrJjoA+z5/Ebm6hwAPcegNSscf7HLuQfnKrHblKIAcPuWODreYeaxEX+Y5fv0DfzEt3TxV5Kr8KjQ8vhpqkbvFWm1zt0oFaccUDwboWd7/raOch78pqWLT59LpiCdstos6824CI2Tu9Oxm81VmzbZQsv+yCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=aI5GPVMb; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=l/85CMUwYvGkFstcoi4Kb56LZAx3H/rR4TH74ZR+ABU=; b=aI5GPVMbgrAMQLi/sxpdR2JIEB lD7i+cyhbu5o25Cq3bZOXaKDk8cy0Gmn/iCiM5grQc/Lgv5UbI2usWWgflQ0WEMXvX/i374t61Sp8 JXyHiJfmV1B9tBrrumUkhF4+2QzxPqvR5LjPfK1GpAcTrn3pSCZ87oSUkCMmgZSbzgtfIgXTUbGZP B5aJXDK7/UCVmXh2ORo8l0dcCzSBAvDFBXvN+X/ZZMVGJlp1VT7uYvVFvsMO6r3OCSG3dac52Kz7r dhMY/wsZf7J+sYDfDey0TJCtGdPZSb8do/Sgu6OnmJ1nLj94n0+uoVuMExEsGDtLPU++QWS5/6er8 75aVPHTQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33630) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rSJkv-0002kH-2j; Tue, 23 Jan 2024 16:36:09 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rSJks-00025O-9V; Tue, 23 Jan 2024 16:36:06 +0000 Date: Tue, 23 Jan 2024 16:36:06 +0000 From: "Russell King (Oracle)" To: "Rafael J. Wysocki" Cc: Jonathan Cameron , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Subject: Re: [PATCH RFC v3 05/21] ACPI: Rename ACPI_HOTPLUG_CPU to include 'present' Message-ID: References: <20240122180013.000016d5@Huawei.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) On Tue, Jan 23, 2024 at 05:15:54PM +0100, Rafael J. Wysocki wrote: > On Tue, Jan 23, 2024 at 2:28 PM Russell King (Oracle) > wrote: > > > > On Mon, Jan 22, 2024 at 06:00:13PM +0000, Jonathan Cameron wrote: > > > On Mon, 18 Dec 2023 21:35:16 +0100 > > > "Rafael J. Wysocki" wrote: > > > > > > > On Wed, Dec 13, 2023 at 1:49 PM Russell King wrote: > > > > > > > > > > From: James Morse > > > > > > > > > > The code behind ACPI_HOTPLUG_CPU allows a not-present CPU to become > > > > > present. > > > > > > > > Right. > > > > > > > > > This isn't the only use of HOTPLUG_CPU. On arm64 and riscv > > > > > CPUs can be taken offline as a power saving measure. > > > > > > > > But still there is the case in which a non-present CPU can become > > > > present, isn't it there? > > > > > > Not yet defined by the architectures (and I'm assuming it probably never will be). > > > > > > The original proposal we took to ARM was to do exactly that - they pushed > > > back hard on the basis there was no architecturally safe way to implement it. > > > Too much of the ARM arch has to exist from the start of time. > > > > > > https://lore.kernel.org/linux-arm-kernel/cbaa6d68-6143-e010-5f3c-ec62f879ad95@arm.com/ > > > is one of the relevant threads of the kernel side of that discussion. > > > > > > Not to put specific words into the ARM architects mouths, but the > > > short description is that there is currently no demand for working > > > out how to make physical CPU hotplug possible, as such they will not > > > provide an architecturally compliant way to do it for virtual CPU hotplug and > > > another means is needed (which is why this series doesn't use the present bit > > > for that purpose and we have the Online capable bit in MADT/GICC) > > > > > > It was a 'fun' dance of several years to get to that clarification. > > > As another fun fact, the same is defined for x86, but I don't think > > > anyone has used it yet (GICC for ARM has an online capable bit in the flags to > > > enable this, which was remarkably similar to the online capable bit in the > > > flags of the Local APIC entries as added fairly recently). > > > > > > > > > > > > On arm64 an offline CPU may be disabled by firmware, preventing it from > > > > > being brought back online, but it remains present throughout. > > > > > > > > > > Adding code to prevent user-space trying to online these disabled CPUs > > > > > needs some additional terminology. > > > > > > > > > > Rename the Kconfig symbol CONFIG_ACPI_HOTPLUG_PRESENT_CPU to reflect > > > > > that it makes possible CPUs present. > > > > > > > > Honestly, I don't think that this change is necessary or even useful. > > > > > > Whilst it's an attempt to avoid future confusion, the rename is > > > not something I really care about so my advice to Russell is drop > > > it unless you are attached to it! > > > > While I agree that it isn't a necessity, I don't fully agree that it > > isn't useful. > > > > One of the issues will be that while Arm64 will support hotplug vCPU, > > it won't be setting ACPI_HOTPLUG_CPU because it doesn't support > > the present bit changing. So I can see why James decided to rename > > it - because with Arm64's hotplug vCPU, the idea that ACPI_HOTPLUG_CPU > > somehow enables hotplug CPU support is now no longer true. > > > > Keeping it as ACPI_HOTPLUG_CPU makes the code less obvious, because it > > leads one to assume that it ought to be enabled for Arm64's > > implementatinon, and that could well cause issues in the future if > > people make the assumption that "ACPI_HOTPLUG_CPU" means hotplug CPU > > is supported in ACPI. It doesn't anymore. > > On x86 there is no confusion AFAICS. It's always meant "as long as > the platform supports it". That's x86, which supports physical CPU hotplug. We're introducing support for Arm64 here which doesn't support physical CPU hotplug. ACPI-based Physical Virtual Arch HOTPLUG_CPU ACPI_HOTPLUG_CPU Hotplug Hotplug Hotplug Arm64 Y N Y N Y x86 Y Y Y Y Y So ACPI_HOTPLUG_CPU becomes totally misnamed with the introduction of hotplug on Arm64. If we want to just look at stuff from an x86 perspective, then yes, it remains correct to call it ACPI_HOTPLUG_CPU. It isn't correct as soon as we add Arm64, as I already said. And honestly, a two line quip to my reasoned argument is not IMHO an acceptable reply. .. getting close to throwing the rag in over this. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!