Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3963415rdb; Mon, 11 Dec 2023 05:21:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFo/F5+MGtBilQsf+JU6JVGFfLI71HHHp0SP+fvdBmQqfDCecwoTWf2pWidxSqcUx0+afcM X-Received: by 2002:a05:6a21:3284:b0:18f:fe5a:8bb7 with SMTP id yt4-20020a056a21328400b0018ffe5a8bb7mr5747681pzb.24.1702300877681; Mon, 11 Dec 2023 05:21:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702300877; cv=none; d=google.com; s=arc-20160816; b=ErbTYpflDCa24R03itePE7SQJWxIZ4R7oTYX25IeUYUxAHi2jT+lxo3L34AJLNR7A2 nVQ1Oejl4ME5eF4X8R9KR/yLNcLzSebhVe7OARL4bsGDnZu9QSXwUvli4Oy0C38SMgZl +vRsKxDKmMMxxNCYI+zqCcL1lyp77vDUzA6EZKbc5OCaSSdqwKQsq9mFa+m5QfYnlTw9 +21vELMyL2/EiduA4iUStwiypbtySDTcw+unpVFQ434Gws37/ZvGC7v7/C3xde+vv37k koQaOGj0ga/mQfbAoi5OLywatvhLjucrw5D3zzsNLy0EGAGKhmgwDjO2lqgrKFmrTZrr M37w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=q3QOzEhunnwPvIGSFes81QwqPW9ZIqinyA/1N27ODEw=; fh=0+Q4gEPLjhh5U/GKDYY/LOJMZMoCwpvkTk4mYSWsgFY=; b=AgFJT6YLF16mZllH763xpkHQpknc+znSsn3/y8rKqA2fr97wvTpDqatEf/mVx5Ioyz FhsTzvky/efzUl8SyuD4KQG5upqlVRIxaY01nft7HHE8Rh3N0CqgPXtMpR6ldxkx8Xqm VeWecoHS2ZVefBl45oqpb/rRW1V/mH+/6MGzXQRYCagqCTds/0xSibrB+bbdrWTe/AEu 9dpkNa4ucdLkY5TlBxL0MAQdSG8kepBMhWwnpk+OglFD1xWeG0xImt2xyrDYPBnxiMQo kv/SA9AKoMTGqQhv1Zl0TqVfGdc/1JcBgKIRrEYgPaX8xaWD850f4j25ki4FaPz+g1hp tyQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OtVmf+id; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j11-20020a056a00174b00b006cb88a16f29si6065681pfc.161.2023.12.11.05.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:21:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OtVmf+id; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A63E0805C14C; Mon, 11 Dec 2023 05:21:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343636AbjLKNU5 (ORCPT + 99 others); Mon, 11 Dec 2023 08:20:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343502AbjLKNU4 (ORCPT ); Mon, 11 Dec 2023 08:20:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2299F for ; Mon, 11 Dec 2023 05:21:02 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96BCBC433C7; Mon, 11 Dec 2023 13:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702300862; bh=q1SgpAHgTb9yNjf1ijuF/WsU7ziWgOtp9e+gjYp9MJo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OtVmf+id/i3jL+CkVLVQSKAM+su33w9usY4qz6ohe9ikJJaAELtzij3VYjgA9Ewp8 IbjgnPDTmFzYLzisW9RoqzCM+BlinoHFZh9dn8c3DWcsxaE7n/xlIFYd5cNd5iiZYM xn+RGUNrzobVTZmgr2G/YPkzYJMxadR3JbLDRVmqIeguYU5M9B/epx6dLNTOKngCI1 MfqbPSRfjDDI0mZH6L+x+WiFuG5bmPQYYmqls0mwsWZmq8aHN3nwqrQ5zwoWRasUBO t0AaPcL5MZAHJ+qrn0787/YMKkAZKw1LM4Ra/RYRDixl9gMGsxMV+U5fiYp+UkKYuN EBTvml+3hP+1Q== Date: Mon, 11 Dec 2023 13:20:55 +0000 From: Will Deacon To: Russell King Cc: 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, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Catalin Marinas Subject: Re: [PATCH 12/21] arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Message-ID: <20231211132054.GC25681@willie-the-truck> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 05:21:14 -0800 (PST) On Tue, Nov 21, 2023 at 01:44:51PM +0000, Russell King wrote: > From: James Morse > > To allow ACPI's _STA value to hide CPUs that are present, but not > available to online right now due to VMM or firmware policy, the > register_cpu() call needs to be made by the ACPI machinery when ACPI > is in use. This allows it to hide CPUs that are unavailable from sysfs. > > Switching to GENERIC_CPU_DEVICES is an intermediate step to allow all > five ACPI architectures to be modified at once. > > Switch over to GENERIC_CPU_DEVICES, and provide an arch_register_cpu() > that populates the hotpluggable flag. arch_register_cpu() is also the > interface the ACPI machinery expects. > > The struct cpu in struct cpuinfo_arm64 is never used directly, remove > it to use the one GENERIC_CPU_DEVICES provides. > > This changes the CPUs visible in sysfs from possible to present, but > on arm64 smp_prepare_cpus() ensures these are the same. > > This patch also has the effect of moving the registration of CPUs from > subsys to driver core initialisation, prior to any initcalls running. > > Signed-off-by: James Morse > Reviewed-by: Russell King (Oracle) > Reviewed-by: Shaoqin Huang > Reviewed-by: Gavin Shan > Signed-off-by: Russell King (Oracle) > --- > Changes since RFC v2: > * Add note about initialisation order change. > --- > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/cpu.h | 1 - > arch/arm64/kernel/setup.c | 13 ++++--------- > 3 files changed, 5 insertions(+), 10 deletions(-) Acked-by: Will Deacon Will