From patchwork Tue Nov 7 10:28:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 16330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp139390vqo; Tue, 7 Nov 2023 02:29:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQL+A72DaZICjIU9TuPTnX+I+dEVFQLUup2Gn7upFMqibMsndMegfIDLVJk9wTDc9xIlSq X-Received: by 2002:a05:6808:1805:b0:3b2:e4bd:17e1 with SMTP id bh5-20020a056808180500b003b2e4bd17e1mr32158791oib.24.1699352954022; Tue, 07 Nov 2023 02:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699352953; cv=none; d=google.com; s=arc-20160816; b=kQboiwu7BKwwp3c9YRF2QzcWw4fXvZSCZk+7H4j6a+UhfqDfIV3D4+ii4SAAJfPrIE zeb0FMMwJCdIirFi/fmCTHUwufVEn0OLqNAs0CxGO5iU/ZddaZpU754t3IBFAdAO9ISd VM1VxvihQd8G68tWn/h0MMJdu4dBzIYUcAo4b2iStzeUpeS39pOpDJ8S+wsFL45vdllf UjzbEefsduo8WnVYdl2P1Rg0riAbbsaFv4BjqQEYoj8tjhGam6BY6dlRjxwEEOhBU/MM 9ITqnQ+lxFS/BOHfpVCSYz9L65V5pbbY/CsSEyaLwhCakWp3bl2IXjllTAoYuYz2otnm 1TOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=mnU5AkoHae2A4t/6hUnkAeF1QeR2fa8gldl6fabdpys=; fh=PFBY+1y3ILx3iz5+HFfTKkUGKhgv/4WtaXPW1UMRhBs=; b=jB2upuhDaSYlSPulAUSgo45G5r5fC2etou4cFzVlo089jv6lOW5Ge96yWBOKkrepn8 GPPZhKPUJvg6IgHfNKD7CG8uegJ2gn0QNbf0iBU7ZZYfVwd48l3oOWo1eDC1VxMgFylT KYjldGc2JubIOW0FJEBl/nFmLBka0WZSbd+iX1l4nU1tkmPSSEN+NAEsEmBUw65j4W/U 4aFvaBUS6eGsU4p6yd+q7beNDB3iCHOQJCIXkK80tMjFkV8AaI/g7MZT2YwYYrTIOQtc r0feugmEeTBsuwFRzCU1QrV9+K/H37XVTMm5KOo5cwDo8loQB1ht4ddZZyQ4Ex2PE6Sz 4daQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Xvbg8rVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u13-20020a056a00124d00b006c33c8497b8si10337065pfi.170.2023.11.07.02.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 02:29:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Xvbg8rVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D09C481389B9; Tue, 7 Nov 2023 02:29:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233843AbjKGK3L (ORCPT + 32 others); Tue, 7 Nov 2023 05:29:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbjKGK3K (ORCPT ); Tue, 7 Nov 2023 05:29:10 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3DEF7; Tue, 7 Nov 2023 02:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mnU5AkoHae2A4t/6hUnkAeF1QeR2fa8gldl6fabdpys=; b=Xvbg8rVwQvptDasFluB1GivJJR lkmYK9tHPkK3vfKg66aLbO07r9lL+qDWdsMtP1fVlOa8E6KTkOYoEs2lwy4BuATJgRxBHul9tXxli QGqH/a1GwQbXH4Ty2qge3vzSS6Lc2LavAFmQ5ENfzpAimPTrAHwq4g364DPRdQkTj0tDP0qjcdxfK STyjqt1AJWeyZh74VX0SvsNhUiKdGJQ5F9Q8X2OntVFa17qD+omT8nLqUX52QnKNsc7MXWynhIz17 xiLH8jwcSjSqGdcRk8+6xspJu1Yko/6rlvG1nsItzUsrSafRMYvzk7lo3JLicVij5zIccje25TllF GUWgjCdw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37708) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r0JKK-0000DJ-2j; Tue, 07 Nov 2023 10:28:56 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r0JKF-0006qX-KE; Tue, 07 Nov 2023 10:28:51 +0000 Date: Tue, 7 Nov 2023 10:28:51 +0000 From: "Russell King (Oracle)" To: 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, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Albert Ou , Borislav Petkov , Catalin Marinas , Dave Hansen , Greg Kroah-Hartman , Guo Ren , "H. Peter Anvin" , Huacai Chen , Ingo Molnar , James Morse , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, Len Brown , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , "Rafael J. Wysocki" , Salil Mehta , Sudeep Holla , Thomas Gleixner , WANG Xuerui , Will Deacon Subject: [PATCH RFC 00/22] Initial cleanups for vCPU hotplug Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 07 Nov 2023 02:29:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781900723043716722 X-GMAIL-MSGID: 1781900723043716722 Hi, Rather than posting the entire set of vCPU kernel patches, this is a subset of those patches which I hope will be able to be appropriately queued for the next merge window. I am also hoping that nothing here is covered by Rafael's concerns he alluded to in his response to the RFC v3 series. This series aims to switch most architectures over to using generic CPU devices rather than arch specific implementations, which I think is worthwhile doing even if the vCPU hotplug series needs further work. Since this series changes the init order (node_dev_init() vs cpu_dev_init()) and later on in the vCPU hotplug series move the location that CPUs are registered, the first two patches head off problems with register_cpu_capacity_sysctl() and the intel_epb code. These two were ordered later in the original series. The next pair of patches are new and remove the exports of arch_*register_cpu() which are not necessary - these functions are only called from non-modular code - drivers/base/cpu.c and acpi_processor.c both of which can only be built-in. The majority of the other patches come from the vCPU hotplug RFC v3 series I posted earlier, rebased on Linus' current tip, but with some new patches adding arch_cpu_is_hotpluggable() as the remaining arch_register_cpu() functions only differ in the setting of the hotpluggable member of the CPU device - so let's get generic code doing that and provide a way for an architecture to specify whether a CPU is hotpluggable. I would appreciate testing reports on loongarch, riscv and x86 platforms please. Thanks! arch/arm64/Kconfig | 1 + arch/arm64/include/asm/cpu.h | 1 - arch/arm64/kernel/setup.c | 13 ++----------- arch/loongarch/Kconfig | 2 ++ arch/loongarch/kernel/topology.c | 42 ++-------------------------------------- arch/riscv/Kconfig | 1 + arch/riscv/kernel/setup.c | 18 ++--------------- arch/x86/Kconfig | 2 ++ arch/x86/include/asm/cpu.h | 4 ---- arch/x86/kernel/cpu/intel_epb.c | 2 +- arch/x86/kernel/topology.c | 33 ++----------------------------- drivers/acpi/Kconfig | 1 - drivers/acpi/acpi_processor.c | 18 ----------------- drivers/base/arch_topology.c | 38 ++++++++++++++++++++++++------------ drivers/base/cpu.c | 39 +++++++++++++++++++++++++++++-------- drivers/base/init.c | 2 +- drivers/base/node.c | 7 ------- include/linux/cpu.h | 5 +++++ 18 files changed, 78 insertions(+), 151 deletions(-)