From patchwork Wed Aug 9 16:49:28 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: 133357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2957260vqr; Wed, 9 Aug 2023 10:23:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs+bkZ0JD/BSn5GJXh4U5FJJiLmtr3Ml9ab6Ko6igOoGJZ06YBEiQ50yRXYnTODvwu0AoO X-Received: by 2002:a05:6a21:9983:b0:137:2d73:707f with SMTP id ve3-20020a056a21998300b001372d73707fmr3696756pzb.5.1691601793818; Wed, 09 Aug 2023 10:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601793; cv=none; d=google.com; s=arc-20160816; b=mK9Q6m9RMZMJkTkj+NbFF11ymgDeie8x9F52HvNuQNW+HV3kxnOesezKj6wJJd3ejm Y8B74zdhh0oD4ikQUFPAb8Asl1nPPpl5TDcWhc6QqwZMiAQXqGh7hD5AN00wG6ZgiBBt I/uNrm3ACEu0lcLVxSzTIPP+BFRYtU5RgutW4D3F6t8jkET54tc8EiAU+7RkACJOAvkk EPp/uZfi5xNgDxMvIeWweg64s9IXHAcRyQLkm5b+TTsRbKbI+S5dQWmVdhCA1C0/5HtY ik1mD/4P+yDxbugJ/sfm8UcpbxEYV1P2OR/0RbRdMKOR+0z8sl0IgVhu7yFasNp1OWXz B0Sg== 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=J7hAAA9xgdDSVLUfzr4ZCNcE2fFKQLk8bvire+70PSA=; fh=xeBNGOuZM5vy4okdFvBNsMTGHQ6tdBlFPaNKCUScG5A=; b=TfC1R4jJUvsL9hUm9s+tgZTYxQXstezqK2gveKiJONy1q3bv1vKMreIkXbBjoMEs7x VWXP90umN97PNpvVrDT85uJrPnw6JI357xnsX0zLa6eTUCc0TLQjyAmf3sM9mYAHinCd 2S2N1kvRMpGWlUt2JIEuDbISshyGlQtva/5jHJcDLKYZCqRI/tZDAPgij51ZzB/seLde uqCtyU3Gsovq5sLrujAegLhE+bQNkdo5u+VHKPRTqVdo2mMIQjsxgfnQLsJ4ZKJOb11I S7X3UzI64AaBk++3HcBsxuYQ71zl4BXY9sN+vSAazU3Q0QltXQhGRPdjDqQhCqBszLRc rXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PwgIVzeR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=EF2NxXZL; 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 b75-20020a63344e000000b005634fdd0979si9738301pga.496.2023.08.09.10.23.00; Wed, 09 Aug 2023 10:23:13 -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=PwgIVzeR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=EF2NxXZL; 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 S231224AbjHIQtd (ORCPT + 99 others); Wed, 9 Aug 2023 12:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjHIQtb (ORCPT ); Wed, 9 Aug 2023 12:49:31 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 114361BF7; Wed, 9 Aug 2023 09:49:30 -0700 (PDT) Date: Wed, 09 Aug 2023 16:49:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691599769; 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=J7hAAA9xgdDSVLUfzr4ZCNcE2fFKQLk8bvire+70PSA=; b=PwgIVzeRC+eHR2QhNR5TsKbbAqRYl57R0VbeeIrN+piku5vjrUhF6FNFLF//0e8Ygl07NX O1RNlNAzW/Kuo4Kv+alR61rdA+z4DyWDHKB7myIoPYkjvVq4RCow1oRaA8cnHH4etXdwzZ DYFZX809fdY3cPV3NjrO7aK4DvZ722rZKYSi6ilR9y00wG360W2T4iijtaDYKXCyicqrAq JlZFlPygBYdeTtH4UH3CkVdUioZu/ob2QHcnP751ZuQKln0h4B0P14w0laF3yekR1UMUYk 2JmXistRKNkVwenGCfkliKM6nFAR2eoyEhvgahlQaQ5UGCrcgwT3EnDYFtqXEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691599769; 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=J7hAAA9xgdDSVLUfzr4ZCNcE2fFKQLk8bvire+70PSA=; b=EF2NxXZLuS9vOwPoaK+sVnsEj9HbGHqTPzzLgFQpVXhNzCR3Xae3iKneVKidQxenn3N/cf G/z4dkyxQiFKaiDg== 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)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169159976830.27769.1143180202055854109.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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,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: 1773773042669792838 The following commit has been merged into the x86/apic branch of tip: Commit-ID: 169a37eb5403f7fcbc1d317c5995faa9eac4a9c6 Gitweb: https://git.kernel.org/tip/169a37eb5403f7fcbc1d317c5995faa9eac4a9c6 Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:04:08 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 08:10:12 -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) --- 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; } }