mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Grzegorz Jaszczyk" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Grzegorz Jaszczyk <jaszczyk@chromium.org>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/apic] x86/apic: Remove redundant check from x2apic_phys_probe()
Date: Wed, 04 Nov 2026 01:29:18 -0000	[thread overview]
Message-ID: <179375575883.1009794.4687808587030047502.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260924104102.3534474-4-jaszczyk@chromium.org>

The following commit has been merged into the x86/apic branch of tip:

Commit-ID:     2f4b3e8ea202808c6218e2bf67810dfcdb6cb883
Gitweb:        https://git.kernel.org/tip/2f4b3e8ea202808c6218e2bf67810dfcdb6cb883
Author:        Grzegorz Jaszczyk <jaszczyk@chromium.org>
AuthorDate:    Thu, 24 Sep 2026 10:40:20 
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 03 Nov 2026 17:04:02 -08:00

x86/apic: Remove redundant check from x2apic_phys_probe()

Commit

  9ebd680bd029 ("x86, apic: Use probe routines to simplify apic selection")

introduced x2apic_phys_probe() with a generic fallback check for

  apic == &apic_x2apic_phys

to preserve any prior selection of apic_x2apic_phys by default_acpi_madt_oem_check().

At the time, x2apic_acpi_madt_oem_check() only checked

  x2apic_phys && x2apic_enabled()

so that fallback was already redundant. Commit

  ea0dcf903e7d ("x86/apic: Use x2apic physical mode based on FADT setting")

later added the ACPI_FADT_APIC_PHYSICAL check only to x2apic_acpi_madt_oem_check(),
temporarily relying on the fallback in x2apic_phys_probe() when x2APIC was
pre-enabled by BIOS.

Subsequently,

  cb214ede7657 ("x86/apic: Work around boot failure on HP ProLiant DL980 G7 Server systems")

factored out x2apic_fadt_phys() and added it directly to x2apic_phys_probe(). Because
default_acpi_madt_oem_check() (via the .acpi_madt_oem_check callback) is the only
path that can install apic_x2apic_phys prior to x2apic_phys_probe(), and
x2apic_acpi_madt_oem_check() checks the exact same

  x2apic_phys || x2apic_fadt_phys()

condition, the fallback

  apic == &apic_x2apic_phys

check became completely unreachable again.

Remove the redundant check and the associated forward declaration of apic_x2apic_phys.

In addition to cleaning up dead code, this allows apic_x2apic_phys to be installed as
an early boot default driver when hardware x2APIC is pre-enabled without preventing
x2apic_cluster from being probed and selected later during boot.

  [ bp: Massage commit message. ]

Signed-off-by: Grzegorz Jaszczyk <jaszczyk@chromium.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260924104102.3534474-4-jaszczyk@chromium.org
---
 arch/x86/kernel/apic/x2apic_phys.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 090647c..5bf8683 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -6,8 +6,6 @@
 #include "local.h"
 
 int x2apic_phys;
-
-static struct apic apic_x2apic_phys;
 u32 x2apic_max_apicid __ro_after_init = UINT_MAX;
 
 void __init x2apic_set_max_apicid(u32 apicid)
@@ -110,10 +108,7 @@ static int x2apic_phys_probe(void)
 	if (!x2apic_mode)
 		return 0;
 
-	if (x2apic_phys || x2apic_fadt_phys())
-		return 1;
-
-	return apic == &apic_x2apic_phys;
+	return x2apic_phys || x2apic_fadt_phys();
 }
 
 u32 x2apic_get_apic_id(u32 id)

  parent reply	other threads:[~2026-11-04  1:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 10:40 [PATCH v2 0/4] x86/apic: Switch to x2apic driver early if x2apic is enabled Grzegorz Jaszczyk
2026-09-24 10:40 ` [PATCH v2 1/4] x86/apic: Rename init_apic_mappings() to apic_finalize_early_init() Grzegorz Jaszczyk
2026-10-20 18:32   ` [tip: x86/apic] " tip-bot2 for Grzegorz Jaszczyk
2026-11-04  1:29   ` tip-bot2 for Grzegorz Jaszczyk
2026-09-24 10:40 ` [PATCH v2 2/4] x86/apic: Consolidate early APIC initialization into apic_early_init() Grzegorz Jaszczyk
2026-10-20 18:32   ` [tip: x86/apic] " tip-bot2 for Grzegorz Jaszczyk
2026-11-04  1:29   ` tip-bot2 for Grzegorz Jaszczyk
2026-09-24 10:40 ` [PATCH v2 3/4] x86/apic: Remove redundant check from x2apic_phys_probe() Grzegorz Jaszczyk
2026-10-20 18:32   ` [tip: x86/apic] " tip-bot2 for Grzegorz Jaszczyk
2026-11-04  1:29   ` tip-bot2 for Grzegorz Jaszczyk [this message]
2026-09-24 10:40 ` [PATCH v2 4/4] x86/apic: Switch to x2apic driver early if x2apic is enabled Grzegorz Jaszczyk
2026-10-20 18:32   ` [tip: x86/apic] " tip-bot2 for Grzegorz Jaszczyk
2026-11-04  1:29   ` tip-bot2 for Grzegorz Jaszczyk
2026-10-17 21:04 ` [PATCH v2 0/4] " Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179375575883.1009794.4687808587030047502.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@alien8.de \
    --cc=jaszczyk@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®