From patchwork Fri Nov 24 13:02:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 169408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1167108vqx; Fri, 24 Nov 2023 05:02:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxRFSF4fqL9P5hhwMPFPV7zNvjTHVHiuejjUVfwY7oxsdIxM1tlrmD0j+sbmCHzIeL4hjx X-Received: by 2002:a5b:88e:0:b0:d9a:d16f:dddf with SMTP id e14-20020a5b088e000000b00d9ad16fdddfmr2200890ybq.24.1700830971700; Fri, 24 Nov 2023 05:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700830971; cv=none; d=google.com; s=arc-20160816; b=hMwzAkpQGCiuGm/M+DEsKJK4+fQ5WjSa/eFt/94qIMlKgRpxlJNl/58+DP3FOMOehi drDscgnHyiogkPuP7dxO4sNaFINj+L0652X1q1mJRD/O6mxDjZi06dvTmsSOYNDah6OY Y98XUln52nYkX9N21ZLZcPigIoUO/LrL0ztxRHC8lvMApTwaT89li0d6tfqRdZoTyfkB SmATXlS5mNezfTJEprCidv8YyPT0hFn1YhK96pxKE0VBuioQxsNgR+d+/CkhcczYWwPT NOOU6jFpFRwo66/0yScfARMPy7Bbn6a9yZGYUDmMakpkf0pisj5hxgbMpojCUMo+QgX5 Aq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=2WoqphQa08ilBa/Wdt28ASnV8BgNEE4rSutt3haeXKU=; fh=+zICgNvuhKP4OjGjOrDTXaAqSczyftqvR/qKlRQM2Ng=; b=VsrZbYGDEPSdRT8nxnyDeHgX0uOKt0XQYcgEr8BnfK54HxmsLd+ScvfsSKYmq1miyg +fNOn1r4oaDz7p3WtA9OlljDXLn2tNWTNg+W2iatb12CWM6vzW+YlchPPKBhnGyfCXUi UMnlgK7WjkwheW+Oe1gkq4/1e9zseeHRqBdGEApSkpDWwKP/d0BqVjjFf9ytBBVHGGnO CxyyHKxIavz4EBeEbPMBbfbVqjA/OTkRRVzu4CUMLkxjf9dUI77yjMjGnVM5JkiAdO05 5GWop88e9ACJGfBJ06hHLXgBctI5IP8Cr9/Km5uyYOx6CvpGp18W/1SF8TjV1ONVO4OJ 7UVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=OJcxRTyl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="p3E/IMxH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v41-20020a25abac000000b00db416d1015dsi2201419ybi.673.2023.11.24.05.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 05:02:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=OJcxRTyl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="p3E/IMxH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B9F93804C215; Fri, 24 Nov 2023 05:02:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345088AbjKXNCJ (ORCPT + 99 others); Fri, 24 Nov 2023 08:02:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjKXNCI (ORCPT ); Fri, 24 Nov 2023 08:02:08 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74790110; Fri, 24 Nov 2023 05:02:14 -0800 (PST) Date: Fri, 24 Nov 2023 13:02:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1700830932; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2WoqphQa08ilBa/Wdt28ASnV8BgNEE4rSutt3haeXKU=; b=OJcxRTylPJPUbQbDBmMf7deHJuscmSZT3NApgBlLtseA0j6ckf/VfCTWOgtR5DeFwhAQZM 9LAvQMs0q0ihnKl7Mni+NVKEs8KskFMnjK7SNJn5im0hGQ3NgmN08qulDA/VuHSvd7Mqxh H3jJ3F6IKYxCgBwLezqwIMsILRpKtfLeBTr1dlhvmTfHnB0WIEBuuqzzqpv9S1dE6s7Yd+ wrTEzhwg7iN7DTTl56vJ5b/AHZQhZkgXbcEfwAG6v4ZEPRzmN0XAoKWuJMi6b2QG1XEp0h AmdntZiPbgZ28ocyzIcFxD1zDhe4vxwQj8APyoPxOEr5Fo5W7PD95d6K+m5aNQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1700830932; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2WoqphQa08ilBa/Wdt28ASnV8BgNEE4rSutt3haeXKU=; b=p3E/IMxHJFUhF1yAPFfRTS8JOPXurIBEfwvpfKH8/n5GeD4w0FtJQw93l0v/Du88P+8IyQ DRS+45L21z2xKJDQ== From: "tip-bot2 for James Morse" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu/intel_epb: Don't rely on link order Cc: James Morse , "Russell King (Oracle)" , Ingo Molnar , Gavin Shan , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <170083093117.398.8055972416269136622.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 05:02:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783450536977563868 X-GMAIL-MSGID: 1783450536977563868 The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 5bfa0e45e9e7212b87fe1564ab45f146c7d56e5f Gitweb: https://git.kernel.org/tip/5bfa0e45e9e7212b87fe1564ab45f146c7d56e5f Author: James Morse AuthorDate: Fri, 24 Nov 2023 09:38:53 Committer: Ingo Molnar CommitterDate: Fri, 24 Nov 2023 13:54:31 +01:00 x86/cpu/intel_epb: Don't rely on link order intel_epb_init() is called as a subsys_initcall() to register cpuhp callbacks. The callbacks make use of get_cpu_device() which will return NULL unless register_cpu() has been called. register_cpu() is called from topology_init(), which is also a subsys_initcall(). This is fragile. Moving the register_cpu() to a different subsys_initcall() leads to a NULL dereference during boot. Make intel_epb_init() a late_initcall(), user-space can't provide a policy before this point anyway. Signed-off-by: James Morse Signed-off-by: Russell King (Oracle) Signed-off-by: Ingo Molnar Reviewed-by: Gavin Shan Acked-by: Rafael J. Wysocki --- arch/x86/kernel/cpu/intel_epb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel_epb.c b/arch/x86/kernel/cpu/intel_epb.c index e4c3ba9..f18d35f 100644 --- a/arch/x86/kernel/cpu/intel_epb.c +++ b/arch/x86/kernel/cpu/intel_epb.c @@ -237,4 +237,4 @@ err_out_online: cpuhp_remove_state(CPUHP_AP_X86_INTEL_EPB_ONLINE); return ret; } -subsys_initcall(intel_epb_init); +late_initcall(intel_epb_init);