Regressions List Tracking
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Lyude Paul <lyude@redhat.com>,
	"Linux regression tracking (Thorsten Leemhuis)"
	<regressions@leemhuis.info>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Mario Limonciello <mario.limonciello@amd.com>,
	Borislav Petkov <bp@alien8.de>,
	Linux kernel regressions list <regressions@lists.linux.dev>
Subject: Re: Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package")
Date: Thu, 16 May 2024 15:38:59 +0200	[thread overview]
Message-ID: <87wmntkhak.ffs@tglx> (raw)
In-Reply-To: <2fd6009d21d606d13f0c472dbaa754a21f3105d9.camel@redhat.com>

Lyude!

On Wed, May 15 2024 at 19:15, Lyude Paul wrote:
> On Tue, 2024-05-14 at 10:25 +0200, Thomas Gleixner wrote:
>> 
>> Which one of the debug patches did you use?
>
> The one you sent on 4/18, when you also asked me for the output of
> /sys/kernel/debug/x86/topo/
>
> (I thought I remembered that patch not booting on previous kernels but maybe
> I'm misremembering)

It booted with the -rc kernel too. :)

I found an interesting and probably related difference in the boot logs
though. Up to 8 possible CPUs the kernel uses logical destination mode
for the APIC. With more than 8 it uses physical destination mode.

Can you please test the patch below on top of 6.9 and validate that it
boots w/o any magic command line parameter?

Thanks,

        tglx
---
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 66fd4b2a37a3..db5e93a7c194 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1883,6 +1883,8 @@ static inline void try_to_enable_x2apic(int remap_mode) { }
 static inline void __x2apic_enable(void) { }
 #endif /* !CONFIG_X86_X2APIC */
 
+int irq_remap_mode = -1;
+
 void __init enable_IR_x2apic(void)
 {
 	unsigned long flags;
@@ -1915,6 +1917,8 @@ void __init enable_IR_x2apic(void)
 
 	if (ir_stat < 0)
 		restore_ioapic_entries();
+	else
+		irq_remap_mode = ir_stat;
 	legacy_pic->restore_mask();
 	local_irq_restore(flags);
 }
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index f37ad3392fec..5cc386db3557 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -12,6 +12,7 @@
 #include <linux/export.h>
 #include <linux/acpi.h>
 
+#include <asm/irq_remapping.h>
 #include <asm/jailhouse_para.h>
 #include <asm/apic.h>
 
@@ -130,7 +131,8 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 
 static int physflat_probe(void)
 {
-	return apic == &apic_physflat || num_possible_cpus() > 8 || jailhouse_paravirt();
+	return apic == &apic_physflat || irq_remap_mode == IRQ_REMAP_XAPIC_MODE ||
+		num_possible_cpus() > 8 || jailhouse_paravirt();
 }
 
 static struct apic apic_physflat __ro_after_init = {
diff --git a/arch/x86/kernel/apic/local.h b/arch/x86/kernel/apic/local.h
index 842fe28496be..f633ab6dfa9f 100644
--- a/arch/x86/kernel/apic/local.h
+++ b/arch/x86/kernel/apic/local.h
@@ -22,6 +22,8 @@ void x2apic_send_IPI_allbutself(int vector);
 void x2apic_send_IPI_self(int vector);
 extern u32 x2apic_max_apicid;
 
+extern int irq_remap_mode;
+
 /* IPI */
 
 DECLARE_STATIC_KEY_FALSE(apic_use_ipi_shorthand);

  reply	other threads:[~2024-05-16 13:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3d77cb89857ee43a9c31249f4eab7196013bc4b4.camel@redhat.com>
     [not found] ` <20240418082703.GCZiDZVyra7qOQbyqn@fat_crate.local>
     [not found]   ` <fd040809d95b3e12b2fdc78a2409e187716bc66f.camel@redhat.com>
     [not found]     ` <87plumxz4x.ffs@tglx>
     [not found]       ` <abbb7d7ca781f6c664e4c5b1dffc19394ac79691.camel@redhat.com>
     [not found]         ` <87le59vw1y.ffs@tglx>
     [not found]           ` <3a0afe545747e5314a9cb6bbaa9ce90b259ddfac.camel@redhat.com>
     [not found]             ` <87edautcmz.ffs@tglx>
     [not found]               ` <3b1d16e357c1f9badeef405366492f05af26c085.camel@redhat.com>
     [not found]                 ` <878r11t8zu.ffs@tglx>
     [not found]                   ` <016902d9-3858-4c65-b3ec-f7a5103af63c@amd.com>
2024-05-08  8:38                     ` Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package") Linux regression tracking (Thorsten Leemhuis)
2024-05-08 10:30                       ` Thomas Gleixner
2024-05-08 21:02                         ` Lyude Paul
2024-05-08 23:21                           ` Lyude Paul
2024-05-13 14:08                             ` Thomas Gleixner
2024-05-13 23:18                               ` Lyude Paul
2024-05-13 23:32                                 ` Lyude Paul
2024-05-14  8:25                                   ` Thomas Gleixner
2024-05-15 23:15                                     ` Lyude Paul
2024-05-16 13:38                                       ` Thomas Gleixner [this message]
2024-05-22 19:35                                         ` Lyude Paul
2024-05-22 22:12                                           ` Thomas Gleixner
2024-05-23  5:20                                             ` Linux regression tracking (Thorsten Leemhuis)
2024-05-23 10:47                                             ` Thomas Gleixner
2024-05-28 22:43                                               ` Thomas Gleixner
2024-05-09 19:22                         ` Lyude Paul

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=87wmntkhak.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=mario.limonciello@amd.com \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).