Message ID | 20230801103817.350848224@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2592285vqg; Tue, 1 Aug 2023 04:10:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJ+1N5P1oaUFvqTYfXafBSdbZuqoYvcAQDtafoIf+kBjBaK1ws4qYuDqKJ33nLr3Ew3GuM X-Received: by 2002:a17:907:7751:b0:99b:4d3d:c9b7 with SMTP id kx17-20020a170907775100b0099b4d3dc9b7mr3427254ejc.31.1690888239295; Tue, 01 Aug 2023 04:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690888239; cv=none; d=google.com; s=arc-20160816; b=wORS6WND47xT+7JUuPNPbxIMlzI7aIWBk/RrVwUGsICUoPprj+gM2GniZjEcWKRpR7 AZjzoWWbr2AkKIJ4c2KASQskENNI3H1j8mdbfwQYymBxfvNqp3Xmb6wchUz1WtqFhteT Ylf6sH24rBuKhZBYy6JHeG9qIKrt/Omis4+wtWT5byYr99jG4HIrNSsNShpLYV8aJQ64 gKiCqZgnyBDKj3g52ueHyHo2o/piA9Vm7dfV1b6tn+iwQok/v3qDn+d9upzE/mBoXhNL tqOTsEJP3feIM2VPGWmgk8uiX79guTr2joGAicKx18FR61VGx769kBEmQmksv22Y6cIx 9qqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=BfaXC6qRGr8XWK4LjXyteInjeXWpDiNfshAXINVsujg=; fh=mE3iieUIZLcDfOLIULj9X6/p0bMDPZGFSVRsnyRUnTc=; b=C7N/OXTqulj4NgUd1SSxG8UvWzwg6mXEaoLoC/ldvViNzPEl9BvmVJ6IZVu7AFDS2n A3FkE0u3DOd+sJVvFBl7v080tuoHfWtByEQlzfBtx48+o65xk4h8jVXKCHBPIbanJxOj I3LG1ayox7Qe6qk8ou/J8094dqcDjCjlZzJP+V7C88N0SbuGGBZFZYm16IhDY15RhGiW CATEm1/mXDwyjuhWpdRGRgJsxCSY92LwqJ2pNFLUh48qiQRpx/2fnHVDQa8buUDRxriP 3pr3mGWufZvQYVhia7loBuAmq8ArgXZmEy9jLOdw5Gy1YIZDgUnLI6DwKPO6TGe+IHKF 3BvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LGMIkIAv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VfpDmiSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dv22-20020a170906b81600b00992f7e90360si9008878ejb.727.2023.08.01.04.10.14; Tue, 01 Aug 2023 04:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LGMIkIAv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VfpDmiSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232440AbjHAKuQ (ORCPT <rfc822;maxi.paulin@gmail.com> + 99 others); Tue, 1 Aug 2023 06:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbjHAKtV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Aug 2023 06:49:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 274DDE67 for <linux-kernel@vger.kernel.org>; Tue, 1 Aug 2023 03:47:50 -0700 (PDT) Message-ID: <20230801103817.350848224@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690886850; 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: references:references; bh=BfaXC6qRGr8XWK4LjXyteInjeXWpDiNfshAXINVsujg=; b=LGMIkIAvrUcgGmyBK8dkv3QdDQbOaE8cKvA9mptEdM2JBVCAWkUvvSu4fWPBSvvIUBTwRh JhnQFArWVYX2yJLApZHViro8ax+4P1SwvVqJRKAjNSP5GDg5rYTIbRet3TOS1MltkZSgWg IK+fvkLaqyN86b09eTmJHNjSRQg+3bH72MRXM8BhqGa1eARTdwfZYNCgBS/QgbWWdSsb0C uv5uaLNOGBClzwuYS8rx+Vkc8dorxpindSMZyKUQXXn2geOmH4jp+sbkrSlwyT5KuaMJmJ OMDY6b8NsjE+czFA9I5q+mqfq6z/koIugwxws6Ejf+1JAGYqldfh/lXQayYi0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690886850; 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: references:references; bh=BfaXC6qRGr8XWK4LjXyteInjeXWpDiNfshAXINVsujg=; b=VfpDmiSXSmVKPFo2gWjCj0HaHmiuqXoJG4PKmbCMgoDXyTCdTcAGGwlUt5WztHwkUl2AER zRYUgRH0nV4nosBw== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Andrew Cooper <andrew.cooper3@citrix.com>, Tom Lendacky <thomas.lendacky@amd.com>, Paolo Bonzini <pbonzini@redhat.com>, Wei Liu <wei.liu@kernel.org>, Arjan van de Ven <arjan@linux.intel.com>, Juergen Gross <jgross@suse.com>, Michael Kelley <mikelley@microsoft.com>, Peter Keresztes Schmidt <peter@keresztesschmidt.de>, "Peter Zijlstra (Intel)" <peterz@infradead.org> Subject: [patch V3 40/60] x86/apic/64: Uncopypaste probing References: <20230801103042.936020332@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 1 Aug 2023 12:47:30 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773024826278994841 X-GMAIL-MSGID: 1773024826278994841 |
Series |
[V3,01/60] x86/cpu: Make identify_boot_cpu() static
|
|
Commit Message
Thomas Gleixner
Aug. 1, 2023, 10:47 a.m. UTC
No need for the same thing twice. Also prepares for simplifying the APIC ID validation checks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- arch/x86/kernel/apic/probe_64.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
--- a/arch/x86/kernel/apic/probe_64.c +++ b/arch/x86/kernel/apic/probe_64.c @@ -13,6 +13,15 @@ #include "local.h" +static __init void apic_install_driver(struct apic *driver) +{ + if (apic == driver) + return; + + apic = driver; + pr_info("Switched APIC routing to %s:\n", apic->name); +} + /* Select the appropriate APIC driver */ void __init x86_64_probe_apic(void) { @@ -22,11 +31,7 @@ void __init x86_64_probe_apic(void) for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { if ((*drv)->probe && (*drv)->probe()) { - if (apic != *drv) { - apic = *drv; - pr_info("Switched APIC routing to %s.\n", - apic->name); - } + apic_install_driver(*drv); break; } } @@ -38,11 +43,7 @@ int __init default_acpi_madt_oem_check(c for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) { - if (apic != *drv) { - apic = *drv; - pr_info("Setting APIC routing to %s.\n", - apic->name); - } + apic_install_driver(*drv); return 1; } }