Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp293409lqo; Thu, 16 May 2024 06:39:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEgR7RJl6DXMA++yt4we3VzZdTDTybYcBPXZ1eTDP08ex6ruDEwXDAaWxNY2/dvsYt13FS/sk+8bm1enoLRO1lxq9A1690PH8ZM81MDg== X-Google-Smtp-Source: AGHT+IGlibaMuC/cj7jIhlMt2f702OiDFu+IaX+zS4Om+HVk0U4UIiPAb+q+oyrDPjvnDrY93Mw3 X-Received: by 2002:a05:6e02:1aad:b0:36c:7eb2:50d5 with SMTP id e9e14a558f8ab-36cc149a3a6mr230949155ab.25.1715866750858; Thu, 16 May 2024 06:39:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715866750; cv=pass; d=google.com; s=arc-20160816; b=xStDpTYjp7RpDcrgepldT3PtcAn0nlP8Wd54TAnjWUGxim5HWjSALBGBcWhBnwWr+i rBhEQIyqr2YMNdV77A3ghHPA795hl0VY9RT8Phn38U8u80utd+CQ9fooNQyYHu8q2lAo ooA0Pb7QX2RK4hPM9aIIGy0DSbgwq7kq/w3EsWwoTj3sEBH/y7ptkvI1Of81LJo68rrs /0sTvnlSANOIb5rksa9O104+baQOfO49fVRmrgBQdltmdsmyq3oCQoRXm5B33fmAVPn3 dMzBTAL2KE/IZU/h7U8Fyy+BleTaZQ11sAz6HE2TK1u3DgAh+MVfHqZE30guXlW3CsKt BZhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=zgJ4tB9IbQHts8b1nKZFshXdm8OS9cJ15elhzflaJYk=; fh=Q5lWp/rpa/bXskOzk1Uh/3XRQPqvv03dviLsBbBI/i8=; b=TbogA3KNgjB7cQvAgqcdm7miywE8YuzkWx+bPcj0X1ylJ43zwg7wvTGiOqnK5/hd2f rxYFJPkiVZHIxPJx/u/CNf12IdNOYcQ3Jev0rfnWjuRn23yb+fFFl6odvhuxfh5F/tE7 BjX1/Uz2tS5UdGEjc/i2URCmEHk6UxOynukg/qWws7LaiE4BqcAksDsIMOC6GYw1HMAT F1RL5TvyJW9U19mJ1DLw29f/6gxIi1RRiME7wN5wEvRhJsvsnC21Idoj4XlHgPui54bS RQihZonhTX1SEiOXL7BSInm6IGMMW+weU/j8+7fnj9VOJdT2oqGEYaXQL++fSNsp2fmG zpUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3ngIKh6L; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-181130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340b395298si16164746a12.229.2024.05.16.06.39.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 06:39:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3ngIKh6L; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-181130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7429A283F67 for ; Thu, 16 May 2024 13:39:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EE9E1474C6; Thu, 16 May 2024 13:39:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3ngIKh6L"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FNHbFsy5" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B114529CEA for ; Thu, 16 May 2024 13:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715866744; cv=none; b=ULX4MctpHcyrWFAUnhC5YO+bQm0RaPCyg4EWH61KtW9rYsq/o6UfBw3n9n7zm+JjE8RAVvvfQgaZhCjBrYv7kZ3gyano+q5b9ZbQNDChKAd2ebfZRnnAArQVqpzI5oLpZqTNLUpWF6DF9EhiKHWsKLj4sNWbvwW9Sv/Ey65i9J4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715866744; c=relaxed/simple; bh=phIMI3YyrdajUvvCNzHuD18n4LYcirgcPkJzPD9WJfM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=HQchg2YRGS0UZvbssaCY8S72gg2tkN9oEDy3Yqi+o0gRWH4zuHZoQRhtMbn9CZsmqGsWGgIe8kHPNsI0ljd06KHj7Z9x0pvGoVUE+MSo/O86YlWbgskP9l6wx492puMVMTe1B9ARVsi74ZC/bAwrgTmjZfkfzUf8sRZ3LZYlrUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3ngIKh6L; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=FNHbFsy5; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715866739; 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: in-reply-to:in-reply-to:references:references; bh=zgJ4tB9IbQHts8b1nKZFshXdm8OS9cJ15elhzflaJYk=; b=3ngIKh6LUDQYwuYD+JURGqhkm7QGopaBP2FMGezi/s5XHeVtoGc2DabPvfV6e/7zc5ALB6 Axb9vwNwBPqfNfGQ9TbmWOCF8xoufhVJUdgcT/5GpB/uoCMYf0K54Xvmr9n9Ffs4oA8emW FkEnpXVkVUkj1KE5hyp4x3t5Aikkg2a4zPaBQM13c8ce35WhN0UjuqLObuDEbaM61ThHxf 23QY1hxTGPLzbnzM2NHl8nqYtZ1ziAMrWhYZVtJdPV3hf50hG28BAA/E5HGT5yMJ6YlZ00 jkprnd+E8MOwTWDNhr2PBuLjIxFZQHj3Chr4v75I1fe/WzCAiYNfwzTkjbAKqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715866739; 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: in-reply-to:in-reply-to:references:references; bh=zgJ4tB9IbQHts8b1nKZFshXdm8OS9cJ15elhzflaJYk=; b=FNHbFsy54ARhzIhmAJZBE2V94VAYT+qK04NAqOTc05HIIgJCE9QOx2EDqqJANsmfnC5WuW w2HLPWvdH25WEmAw== To: Lyude Paul , "Linux regression tracking (Thorsten Leemhuis)" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Mario Limonciello , Borislav Petkov , Linux kernel regressions list Subject: Re: Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package") In-Reply-To: <2fd6009d21d606d13f0c472dbaa754a21f3105d9.camel@redhat.com> References: <3d77cb89857ee43a9c31249f4eab7196013bc4b4.camel@redhat.com> <20240418082703.GCZiDZVyra7qOQbyqn@fat_crate.local> <87plumxz4x.ffs@tglx> <87le59vw1y.ffs@tglx> <3a0afe545747e5314a9cb6bbaa9ce90b259ddfac.camel@redhat.com> <87edautcmz.ffs@tglx> <3b1d16e357c1f9badeef405366492f05af26c085.camel@redhat.com> <878r11t8zu.ffs@tglx> <016902d9-3858-4c65-b3ec-f7a5103af63c@amd.com> <51d0dff8-2888-463c-95ab-71b491f12a8f@leemhuis.info> <877cg4ppd5.ffs@tglx> <87jzjxn6s5.ffs@tglx> <97bd95480a8b9951edc9ee2d2648d1b9c574e3b0.camel@redhat.com> <87bk58n6le.ffs@tglx> <2fd6009d21d606d13f0c472dbaa754a21f3105d9.camel@redhat.com> Date: Thu, 16 May 2024 15:38:59 +0200 Message-ID: <87wmntkhak.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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 #include +#include #include #include @@ -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);