Message ID | 20230807135026.750360590@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1496486vqr; Mon, 7 Aug 2023 07:37:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDGLojLhtaPBvoz+y4Y+H1hihxDCGGCnL51PieS/+g42hHamZryBSppJYQ69o6lDUGdDAU X-Received: by 2002:a17:902:ea0d:b0:1b8:b4d5:4c3d with SMTP id s13-20020a170902ea0d00b001b8b4d54c3dmr9082631plg.51.1691419030873; Mon, 07 Aug 2023 07:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691419030; cv=none; d=google.com; s=arc-20160816; b=VwshdyJFoxv8imslaICW4kVW7lt26EG0iDhFlUwpKWD6r1mcfjNjAzLm3dvGLkvsiP QPq5loaFUehCia5yYI4xZTiFauAV7nvcYgJQBpNZeuFTjaAbjk7CKSUQIvIbV0OtSbmh HYIWNNNxq7ydBF82kclpfXbHItGvYLXyrTmS7tIXF5eWBN9YwQig2MJV7jGv2yYkGnzl h3GdREonqReQ1htoR6OYURYuw17kvKXyTGRGWix+aNmwIiePs8wfRGkY2YgaP4DiU7Oc ajhitB1sEXj9yIjwwTvPVXJWP28vV9iFOhZYPyuknMbC2CsrxQF/8TEjHtNw684NBMt7 U/bg== 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=ywrW7M6Fms0CIM+WhzKuJj3dJ+Q03lWwDFSQkWbNJj4=; fh=/92WVKYrcN3rA268QXyKzVtm/UtxHeI2lnbU295XDiQ=; b=JzD+A9YtqcA/slxfy4nqPPGNuwftv9Q8b6YoAb8LHNoi3t/Vi4hAMSRNOVO+0o8Ygz vLrZzbKPQ/fv/X1Mj8BnVZ/sHjqWHaAQTp3TQnV2YYsrEOHZEkHfbzUeDagb1f2SlLt7 Zd1/OittQ+02R/njtAXYZyhz7lC/+rFTB5EGSmIicBSkuw0+qO2v54L7ew0HYn1LACX3 EmVUdF9glE6eu7JazxkQ2jF3sTcbLGzVBzazjAiot+HVJA6pmBgGUnXdllLJlF9YfYfU 75gNpJuXH40okkZE8sWUkZNHZZ2iihM4AwlGPETdXdc/lKZupAhDMcEncT//9dsw43Uk o03g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=duVsiKR3; dkim=neutral (no key) header.i=@linutronix.de; 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 j15-20020a170903024f00b001bba90f8b73si6152904plh.78.2023.08.07.07.36.57; Mon, 07 Aug 2023 07:37:10 -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=duVsiKR3; dkim=neutral (no key) header.i=@linutronix.de; 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 S232988AbjHGNzJ (ORCPT <rfc822;aaronkmseo@gmail.com> + 99 others); Mon, 7 Aug 2023 09:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234488AbjHGNwq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Aug 2023 09:52:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4D410EF for <linux-kernel@vger.kernel.org>; Mon, 7 Aug 2023 06:52:44 -0700 (PDT) Message-ID: <20230807135026.750360590@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691416363; 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=ywrW7M6Fms0CIM+WhzKuJj3dJ+Q03lWwDFSQkWbNJj4=; b=duVsiKR3IhfLqm1YxgowBgn9OsTg7/0Em3YJSm/4NOr/GAa1YAq3Zl62aXNCjUhXG7gXCw 9JkbKk1zt6fH103uC6AeyBWd0ltnnPU5RKtOl87wdUMLN8WQCNccbrXMI2GvXRBCFO1vox QmbRnJ/oEMYVDiefiE7q9G6hMR2zADvgwG/pQZgDT815jTOlk8dv4ZMzCvEWBaYxeIgel8 E9Nl6okjjmNsU59T1njcSoM/ZtI1s4c4t50iH9FUBtif569Si55sE/NUBA0mTy0x0L4TBM Hm1NPILRCRuSXHYfMlcz5/GIdvSAH1pcKhP8XYxBRQM0zH78JjrtW2rMpJzruw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691416363; 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=ywrW7M6Fms0CIM+WhzKuJj3dJ+Q03lWwDFSQkWbNJj4=; b=z/LJe82IgSIz5k4djTUhMxGR5alkqU8dX/ygjvlLM9X9uYOcnyFJVM266DrIoMtCxFacUQ /aCl7d38FjGQZODg== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Tom Lendacky <thomas.lendacky@amd.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Arjan van de Ven <arjan@linux.intel.com>, Huang Rui <ray.huang@amd.com>, Juergen Gross <jgross@suse.com>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, Michael Kelley <mikelley@microsoft.com>, Sohil Mehta <sohil.mehta@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Kan Liang <kan.liang@linux.intel.com>, Zhang Rui <rui.zhang@intel.com>, "Paul E. McKenney" <paulmck@kernel.org>, Feng Tang <feng.tang@intel.com>, Andy Shevchenko <andy@infradead.org> Subject: [patch 06/53] x86/ioapic: Make io_apic_get_unique_id() simpler References: <20230807130108.853357011@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 7 Aug 2023 15:52:42 +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 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: 1773581401676973398 X-GMAIL-MSGID: 1773581401676973398 |
Series |
x86/topology: The final installment
|
|
Commit Message
Thomas Gleixner
Aug. 7, 2023, 1:52 p.m. UTC
No need to go through APIC callbacks. It's already established that this is
an ancient APIC. So just copy the present mask and use the direct physid*
functions all over the place.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/apic/io_apic.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
--- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2498,17 +2498,9 @@ static int io_apic_get_unique_id(int ioa unsigned long flags; int i = 0; - /* - * The P4 platform supports up to 256 APIC IDs on two separate APIC - * buses (one for LAPICs, one for IOAPICs), where predecessors only - * supports up to 16 on one shared APIC bus. - * - * TBD: Expand LAPIC/IOAPIC support on P4-class systems to take full - * advantage of new APIC bus architecture. - */ - + /* Initialize the ID map */ if (physids_empty(apic_id_map)) - apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map); + apic_id_map = phys_cpu_present_map; raw_spin_lock_irqsave(&ioapic_lock, flags); reg_00.raw = io_apic_read(ioapic, 0); @@ -2520,14 +2512,10 @@ static int io_apic_get_unique_id(int ioa apic_id = reg_00.bits.ID; } - /* - * Every APIC in a system must have a unique ID or we get lots of nice - * 'stuck on smp_invalidate_needed IPI wait' messages. - */ - if (apic->check_apicid_used(&apic_id_map, apic_id)) { - + /* Every APIC in a system must have a unique ID */ + if (physid_isset(apic_id, apic_id_map)) { for (i = 0; i < broadcast_id; i++) { - if (!apic->check_apicid_used(&apic_id_map, i)) + if (!physid_isset(i, apic_id_map)) break; }