Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1787701rwl; Fri, 31 Mar 2023 17:19:16 -0700 (PDT) X-Google-Smtp-Source: AKy350aOpPzWRZohutaAhNfIQZlmBj45/Hs25grKklDmjAblCGz0R1O8SZiQ1Rq5sx95QeTPNgID X-Received: by 2002:a17:906:49:b0:930:aa02:f9cf with SMTP id 9-20020a170906004900b00930aa02f9cfmr6783008ejg.2.1680308356660; Fri, 31 Mar 2023 17:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680308356; cv=none; d=google.com; s=arc-20160816; b=WlmbeviX7P1hlwdxweWKjWH9QhpjzRvVxPd0i2XvSKizEuqyITws7DprqXtn658LfV HdDciWz7JTUBii9LXGzJCmi+BZkBXZDmvL7D+14yzuA8zUF/iAiN20uDChaFeap8Zist Ea+FsyqBbL9GaXufq2JGxgzlLUO2ohnM4Q3NqLP9Kw5D+SrdvGMPw9AWzgSmUiPhR1Z2 PRU3+5UqR08IVYSq7gbHNiBxQniBk8Y2IEM034UCDsuTCaZReF+CMxRZS/IDTLy6iFT7 z5JVaMdAjxAac5Nv05dqjynU8s7Qyw8TrWgdyKR+4mvBPByYNvcuUhhO9ZfdVjlCQjzb Kuqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:organization:references:in-reply-to:date :cc:to:from:subject:message-id:dkim-signature; bh=NL54WwypdfaSjaxUxBBBx0hRcNBlMPANtnUbzkWfNYM=; b=P/2Rbbeg6CJOkouPDMgty7jCMEyZZ0YKFLq+zjztNt1KJvVbVOu/cDbtJ/H4ky3lvb gE9i35dMhCas6+NWT1k28bZK9ALOG9y/tyQlKPzTTa2+0YkRm067+R5xeaOrhvGRyrZw FVAQoVuhnEfKFpEV+TIfspmuJIiYMHQ0kiqGn4JwMtSWniZQ/ZKlb+SojzVIFcHwUUDs 4ruq/NrbESmzMKL8NN5Psj4MNv+VCw3igSdXch5vRi/UIsPc+UEZSvGelKkgHei9hnsU EJyXUMIE9p183J9tjdrLRjfUsMltqNC2EVIsXr3rJp87f2aU0h87wCHAVJnIRCDQkH/J WnUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KOpEl1uK; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cf9-20020a170906b2c900b0093d836861f8si3389217ejb.31.2023.03.31.17.18.50; Fri, 31 Mar 2023 17:19:16 -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=@redhat.com header.s=mimecast20190719 header.b=KOpEl1uK; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233424AbjCaX5p (ORCPT + 99 others); Fri, 31 Mar 2023 19:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233466AbjCaX5a (ORCPT ); Fri, 31 Mar 2023 19:57:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34C12032D for ; Fri, 31 Mar 2023 16:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680306966; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NL54WwypdfaSjaxUxBBBx0hRcNBlMPANtnUbzkWfNYM=; b=KOpEl1uKssNlGVB5KYauJa1r3RVPQeFk39b36mptPYUn5w5xjbn6CWq7uSTh6XqgSg0w0b 2PiFFpLKZsbmWa8JhiaXonPp9rLB9GLnHIX8TVMPE9P6Dy+SgAw0YKOc5dv7r6rwU4QkmR IS1axO9pfQQC+xTUmnBdAHHrYw0yaH8= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-16-hKbwK1UsNEelfybxP-ftDA-1; Fri, 31 Mar 2023 19:56:05 -0400 X-MC-Unique: hKbwK1UsNEelfybxP-ftDA-1 Received: by mail-qt1-f200.google.com with SMTP id p22-20020a05622a00d600b003e38f7f800bso15476222qtw.9 for ; Fri, 31 Mar 2023 16:56:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680306965; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NL54WwypdfaSjaxUxBBBx0hRcNBlMPANtnUbzkWfNYM=; b=Mn/Xu7NgdIrTzVGTxiJcgGUaciuxKO5r7Y4/kKuDEaarZXI4xQMAbMoCW+x3Vdk68K cbFb4AJWi/QboxgMR8bo1XBOYzRcoVxEhp/7OJUFaRFc4xi0FtiINL+K/n+191R0llQO qFDv7+wPGEEn6T0QYsUQQJqEsuA6FnHlvCFLVV5XKwagh409PJxHTPtTQKkxyv4VOJkV Y2flOkIvmX/POjOjkM9lLBZ2n9tG1MbRuW8NxunRwtBaokf4lf6KvpUwite+GWW2fp1X 1QI8ZkrB8Thv4dXkHM3jMbwuB18X40ScBq50Ie4cMtRBb3YYmAA8Giy9lsZeI914sErq X6LQ== X-Gm-Message-State: AAQBX9eKOXuyJ+8sSH2ZoprUL0JP//USVZjQBEp6jL4Ep65wxkOQQvDh 02vt5PECpwKtC/HV2wsA+6IJ4M2mTMoarVKC4vYpI2/faQrumuUXsDYp5VX6znASd5ddywgn1Sh KCctbQ+Bu10TNHqdevat3wQLE X-Received: by 2002:ac8:5a87:0:b0:3e6:454f:9a89 with SMTP id c7-20020ac85a87000000b003e6454f9a89mr4220237qtc.14.1680306965040; Fri, 31 Mar 2023 16:56:05 -0700 (PDT) X-Received: by 2002:ac8:5a87:0:b0:3e6:454f:9a89 with SMTP id c7-20020ac85a87000000b003e6454f9a89mr4220222qtc.14.1680306964805; Fri, 31 Mar 2023 16:56:04 -0700 (PDT) Received: from ?IPv6:2600:4040:5c57:b700::feb? ([2600:4040:5c57:b700::feb]) by smtp.gmail.com with ESMTPSA id t18-20020a37ea12000000b0074860fcfbecsm1031786qkj.21.2023.03.31.16.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 16:56:04 -0700 (PDT) Message-ID: Subject: Re: [PATCH] Revert "x86/acpi/boot: Do not register processors that cannot be onlined for x2APIC" From: Lyude Paul To: linux-acpi@vger.kernel.org Cc: Leo Duran , Kishon Vijay Abraham I , Borislav Petkov , Zhang Rui , "Rafael J . Wysocki" , "Rafael J. Wysocki" , Len Brown , Thomas Gleixner , Ingo Molnar , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Date: Fri, 31 Mar 2023 19:56:03 -0400 In-Reply-To: <20230331235328.4312-1-lyude@redhat.com> References: <20230331235328.4312-1-lyude@redhat.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 On Fri, 2023-03-31 at 19:53 -0400, Lyude Paul wrote: > This reverts commit e2869bd7af608c343988429ceb1c2fe99644a01f. This commit > unfortunately seems to have resulted in one of my machines no longer > booting. Specifically, this machine is a custom build with a MS-7A39/A320= M > GAMING PRO motherboard with firmware version v1.10. I'm not entirely sure > of the cause yet, but starting it up with "earlycon=3Defifb keep_bootcon"= has > informed me that the kernel panics like so: >=20 > Call Trace: > > dump_stack_lvl+0x33/0x46 > panic+0x105/0x2b1 > ? timer_irq_works+0x53/0xef > panic_if_irq_remap.cold+0x5/0x5 > setup_IO_APIC+0x3c4/0x831 > ? __pfx_native_io_apic_read+0x10/0x10 > ? __ioapic_read_entry+0x34/0x50 > ? _raw_spin_unlock_irqrestore+0x1b/0x40 > ? clear_IO_APIC_pin+0x16b/0x240 > apic_intr_mode_init+0x101/0x106 > x86_late_time_init+0x20/0x34 > start_kernel+0x8b4/0x95f > secondary_startup_64_no_verify+0x5e/0xeb > > ---[ end Kernel panic - not syncing: timer doesn't work through > interrupt-mapped IO-APIC ]--- Agh, I totally forgot to actually decode the stacktrace on this before send= ing it out. I can do that if anyone would think it would help, but I have a feeling the stacktrace here isn't particularly useful in the first place considering the culprit commit here. As well, hopefully it goes without saying but: I'm happy to try any kind of fixes or provide any more information from this machine. Just let me know = =E2=99=A5 >=20 > My assumption is there's probably something funky with the firmware on th= e > machine seeing as it's a random gaming motherboard, but that also probabl= y > means there are other boards out there like this that are cold, afraid, a= nd > unable to boot. We could warm their hearts by reverting this, or maybe by > figuring out a proper fix. >=20 > Signed-off-by: Lyude Paul > Fixes: e2869bd7af60 ("x86/acpi/boot: Do not register processors that cann= ot be onlined for x2APIC") > Cc: Leo Duran > Cc: Kishon Vijay Abraham I > Cc: Borislav Petkov (AMD) > Cc: Zhang Rui > Cc: Rafael J. Wysocki > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: linux-acpi@vger.kernel.org > --- > arch/x86/kernel/acpi/boot.c | 19 +++---------------- > 1 file changed, 3 insertions(+), 16 deletions(-) >=20 > diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c > index 1c38174b5f019..4177577c173bf 100644 > --- a/arch/x86/kernel/acpi/boot.c > +++ b/arch/x86/kernel/acpi/boot.c > @@ -188,17 +188,6 @@ static int acpi_register_lapic(int id, u32 acpiid, u= 8 enabled) > return cpu; > } > =20 > -static bool __init acpi_is_processor_usable(u32 lapic_flags) > -{ > - if (lapic_flags & ACPI_MADT_ENABLED) > - return true; > - > - if (acpi_support_online_capable && (lapic_flags & ACPI_MADT_ONLINE_CAPA= BLE)) > - return true; > - > - return false; > -} > - > static int __init > acpi_parse_x2apic(union acpi_subtable_headers *header, const unsigned lo= ng end) > { > @@ -223,10 +212,6 @@ acpi_parse_x2apic(union acpi_subtable_headers *heade= r, const unsigned long end) > if (apic_id =3D=3D 0xffffffff) > return 0; > =20 > - /* don't register processors that cannot be onlined */ > - if (!acpi_is_processor_usable(processor->lapic_flags)) > - return 0; > - > /* > * We need to register disabled CPU as well to permit > * counting disabled CPUs. This allows us to size > @@ -265,7 +250,9 @@ acpi_parse_lapic(union acpi_subtable_headers * header= , const unsigned long end) > return 0; > =20 > /* don't register processors that can not be onlined */ > - if (!acpi_is_processor_usable(processor->lapic_flags)) > + if (acpi_support_online_capable && > + !(processor->lapic_flags & ACPI_MADT_ENABLED) && > + !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) > return 0; > =20 > /* --=20 Cheers, Lyude Paul (she/her) Software Engineer at Red Hat