From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA733C4345F for ; Fri, 12 Apr 2024 20:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RykwiDcQ5LUjZSLlB8a6l/XaJv46Lc91sQCiK672PEU=; b=PFlJbfFro8cyET vhmHpj+jkC91uD5a8b3tl1Ad2mehFxrzm0/P+uGd2XD1JgpdU2L1f7sJFE1IaSgi275jE+C1T3f6x 76vg+IShohvKNxHd7Xbd/HKSlxA9kKH0q3C57gKjq5QsWdHXnks9rUiv6mMgf/6p+iVI4pWzSm8lC 0NjK0Bc+4jwN3HYDzw7h3W/V8zqvt5kmgQ0NDSl6TuoJ2JD1bdzhfGhKg8/2FJPUsnfCC0mxLW7JN VbvmTow+BjbLngHy/8EEwAw62uFpSu40tWpU6OnwE/Olzptd8zZQJI6wZfAXwFkPAuaZsWACxYKar UKwDCRVUyZ/Var5Q19HA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvNv2-00000001HSq-0Mp0; Fri, 12 Apr 2024 20:54:44 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvNuw-00000001HQd-3Iy2 for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 20:54:42 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712955272; 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: in-reply-to:in-reply-to:references:references; bh=zFYNr9CZirRSWZqeBDz7mLZZYuH7MefaeEp2ihefL/4=; b=4inyeoqySqn696oIZQlb9IXUMxLGpByf7AJE7/CY3qCd+WjjkE8MjR2OKow6V0vZ7qLzwJ UZ+Z3xAvJ8LxU9A0fRQW+JlkXq2hlaYRtlDal7asbeGA5LeiC4jZHhVc3QdIauZLLAHox7 /ViUdvsemMuvP5+RZYBl195exp6cIwTO0yekVxDM2JA8pBkPnrXcsmZQW5PN1xZKTB7yW0 8Z4F95k9a4JoZWM5tsSVxImLVs6Wfk7WB5bkG/a9aiqCT3OYfswjoZnFG3EhOfp441eAxY lpWYte7RtW1FJk/uUAJeUX/o2WmjQZw9mI/NcIEqhOPgLNtycMHUFDMUkZ+eyQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712955272; 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: in-reply-to:in-reply-to:references:references; bh=zFYNr9CZirRSWZqeBDz7mLZZYuH7MefaeEp2ihefL/4=; b=K69eqoT0yTN1N7e3SvOMWhl0A8acYvwWN5ZnRp0dVlstFtDzCgqLvKs7ylRIQnh26GWFqf iUuHNO8hLeSYkoAw== To: "Russell King (Oracle)" , "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, kvmarm@lists.linux.dev, x86@kernel.org, Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com Subject: Re: [PATCH v5 03/18] ACPI: processor: Register deferred CPUs from acpi_processor_get_info() In-Reply-To: References: <20240412143719.11398-1-Jonathan.Cameron@huawei.com> <20240412143719.11398-4-Jonathan.Cameron@huawei.com> Date: Fri, 12 Apr 2024 22:54:32 +0200 Message-ID: <87bk6ez4hj.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_135439_253923_ED25C656 X-CRM114-Status: GOOD ( 31.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 12 2024 at 21:16, Russell King (Oracle) wrote: > On Fri, Apr 12, 2024 at 08:30:40PM +0200, Rafael J. Wysocki wrote: >> Say acpi_map_cpu) / acpi_unmap_cpu() are turned into arch calls. >> What's the difference then? The locking, which should be fine if I'm >> not mistaken and need_hotplug_init that needs to be set if this code >> runs after the processor driver has loaded AFAICS. > > It is over this that I walked away from progressing this code, because > I don't think it's quite as simple as you make it out to be. > > Yes, acpi_map_cpu() and acpi_unmap_cpu() are already arch implemented > functions, so Arm64 can easily provide stubs for these that do nothing. > That never caused me any concern. > > What does cause me great concern though are the finer details. For > example, above you seem to drop the evaluation of _STA for the > "make_present" case - I've no idea whether that is something that > should be deleted or not (if it is something that can be deleted, > then why not delete it now?) > > As for the cpu locking, I couldn't find anything in arch_register_cpu() > that depends on the cpu_maps_update stuff nor needs the cpus_write_lock > being taken - so I've no idea why the "make_present" case takes these > locks. Anything which updates a CPU mask, e.g. cpu_present_mask, after early boot must hold the appropriate write locks. Otherwise it would be possible to online a CPU which just got marked present, but the registration has not completed yet. > Finally, the "pr->flags.need_hotplug_init = 1" thing... it's not > obvious that this is required - remember that with Arm64's "enabled" > toggling, the "processor" is a slice of the system and doesn't > actually go away - it's just "not enabled" for use. > > Again, as "processors" in Arm64 are slices of the system, they have > to be fully described in ACPI before the OS boots, and they will be > marked as being "present", which means they will be enumerated, and > the driver will be probed. Any processor that is not to be used will > not have its enabled bit set. It is my understanding that every > processor will result in the ACPI processor driver being bound to it > whether its enabled or not. > > The difference between real hotplug and Arm64 hotplug is that real > hotplug makes stuff not-present (and thus unenumerable). Arm64 hotplug > makes stuff not-enabled which is still enumerable. Define "real hotplug" :) Real physical hotplug does not really exist. That's at least true for x86, where the physical hotplug support was chased for a while, but never ended up in production. Though virtualization happily jumped on it to hot add/remove CPUs to/from a guest. There are limitations to this and we learned it the hard way on X86. At the end we came up with the following restrictions: 1) All possible CPUs have to be advertised at boot time via firmware (ACPI/DT/whatever) independent of them being present at boot time or not. That guarantees proper sizing and ensures that associations between hardware entities and software representations and the resulting topology are stable for the lifetime of a system. It is really required to know the full topology of the system at boot time especially with hybrid CPUs where some of the cores have hyperthreading and the others do not. 2) Hot add can only mark an already registered (possible) CPU present. Adding non-registered CPUs after boot is not possible. The CPU must have been registered in #1 already to ensure that the system topology does not suddenly change in an incompatible way at run-time. The same restriction would apply to real physical hotplug. I don't think that's any different for ARM64 or any other architecture. Hope that helps. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel