From patchwork Wed Aug 9 20:36:13 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: 133572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp36884vqi; Wed, 9 Aug 2023 15:09:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaAHi/jtsxXBc/2Iblz3X9pXRTX3rsrTIQkOaPDm5Lbksy2gpH7/DhWKxTDwpg4gEKa569 X-Received: by 2002:a05:6402:31eb:b0:523:3609:d3ca with SMTP id dy11-20020a05640231eb00b005233609d3camr472757edb.20.1691618960076; Wed, 09 Aug 2023 15:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691618960; cv=none; d=google.com; s=arc-20160816; b=m3d9+GkL0kfy8mJg3vYCdds/wi0yN8/XgiuGb2W1/XbE7FPLD00+aXxEn+IoctHk+U vIfOZ+mehugV3dRLa+8cd8hbjmkRDhcnEf1FrKBcpoUnaunkWtJhMPezeCAJ4iyIF1cN 4TyQrwd+dE5ydikRpMA9iL2FP4cg4SbFVW2Uh0ienPpEUvRRGfnceGMJjfs6XQYIT6/D H1vSyBch7UHVhvvgB8byQOEKLfpOqbTe9KxcbAKS1lkBxKTLqmHKqoIlV4E6fD1t7//b Mo9EKtG+2SiH0cEB9Ijjdkm9QPlGWjsZGc1YlRMBK7jN6k4EYRLVDzb/1vU/WS0nYVJ0 zEDg== 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=pLS/yN2JRu4KeYQ10Wo0ka6U0a/tWqGmM3JwO0xgb5Y=; fh=jBwjuriIPWA1lnCf5oMMiNAPpgGE0iGPmBzZMsd85oQ=; b=qLemQGYF0v8UfdKqZKk5YZvMBn3c5/jHAyP6D9G48zibgGBC05FUFGp8eocWjRdk5/ IfH6DaTnGnq8wIFzyDiB+z3qCJH36C037d/e+4hyKeiq0UNFF1f4484O7MoFTcewk2QM cOCqZw9jeHKFqklZtbtBnIncNjmh0mD23nVbFAJy60Zy+nAsjKc4ElI6y+F08lsfmk98 +67kBT6sQd5evj7fIoWGCUCsBtEUh/nevzX2tH4xJIkjzKkRYVEmDc1DYKfk6GWc8iuJ poeXZ+MgIg3Ea5O5ns04xYKijTsQjg96nMUlvrCrx8tIEuqYbJUWXHQff1H6Lxslbm1v qgMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lg3Ef+xi; dkim=neutral (no key) header.i=@linutronix.de header.b=4RpydYh7; 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 d5-20020a05640208c500b00522572f323bsi60562edz.374.2023.08.09.15.08.56; Wed, 09 Aug 2023 15:09:20 -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=lg3Ef+xi; dkim=neutral (no key) header.i=@linutronix.de header.b=4RpydYh7; 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 S234719AbjHIUg5 (ORCPT + 99 others); Wed, 9 Aug 2023 16:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234598AbjHIUgT (ORCPT ); Wed, 9 Aug 2023 16:36:19 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24A692681; Wed, 9 Aug 2023 13:36:15 -0700 (PDT) Date: Wed, 09 Aug 2023 20:36:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691613373; 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=pLS/yN2JRu4KeYQ10Wo0ka6U0a/tWqGmM3JwO0xgb5Y=; b=lg3Ef+xijgqHZ39tCEiv5nHBcz22+8KXgVtThgOCp9VGKPKriyNgJNhUGjQxUxmr/wnog4 P8+wQpfnkR5mRcs+Xhg+s+OFKEfwJ8eUoQYXaj+De+LVtCuAiJLaw60/xi6QxyPJ0T8r4N u89W85zyU1VJr06WyYx3JeBO45dS7A9foNjhjTDQfrddD7wF2b7nz7TQGZGjLfA2cmvUXv KwkV3xsZOBbvysqPoJrOZfAJhnvX5m7ewxZCXR6mrrHb4ZaIKrCi3e7YnPysvTSt3xJT25 VYeOKgKdjy9328zB5jgS9//4FqBo1Ox1JSjWGbFJfZQ7D3biFcfbcyGevEuuDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691613373; 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=pLS/yN2JRu4KeYQ10Wo0ka6U0a/tWqGmM3JwO0xgb5Y=; b=4RpydYh79RXBQkC8Ms34GL2O8t5hM6VoGbDqGzu43tCuar9Xdwn5aTfAhMEVurz8S8ufSj oGZxG923NYp9sRCQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/apic/64: Uncopypaste probing Cc: Thomas Gleixner , Dave Hansen , "Peter Zijlstra (Intel)" , Michael Kelley , Sohil Mehta , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169161337321.27769.6325032308676598325.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773773042669792838 X-GMAIL-MSGID: 1773791042562040011 The following commit has been merged into the x86/apic branch of tip: Commit-ID: d65eb3195862d600b120b3f6481e016c312158cb Gitweb: https://git.kernel.org/tip/d65eb3195862d600b120b3f6481e016c312158cb Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:04:08 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 11:58:30 -07:00 x86/apic/64: Uncopypaste probing No need for the same thing twice. Also prepares for simplifying the APIC ID validation checks. Signed-off-by: Thomas Gleixner Signed-off-by: Dave Hansen Acked-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Sohil Mehta Tested-by: Juergen Gross # Xen PV (dom0 and unpriv. guest) --- arch/x86/kernel/apic/probe_64.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c index 7c9f1a8..a82bb52 100644 --- 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(char *oem_id, char *oem_table_id) 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; } }