Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp927766lqt; Fri, 19 Apr 2024 15:15:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWI7KT5A6YkTfDiIScUTCR/VEh+QJbThJRhr9L+UnYnklmpgTa/iYexCpJZgPCt2JYuEWzgryHiYiWjn9O1HhRAbrK3smXmYTTscBTsfQ== X-Google-Smtp-Source: AGHT+IFlZOSWnPQEnZQkWtpOs2kX6QYIALwIxxuntlEpdgkIMRAYdoZmd8v8L9dK/PzZWTRuyDml X-Received: by 2002:a17:90a:c68e:b0:2a6:7849:e55e with SMTP id n14-20020a17090ac68e00b002a67849e55emr3718184pjt.30.1713564938971; Fri, 19 Apr 2024 15:15:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713564938; cv=pass; d=google.com; s=arc-20160816; b=NzDTP1dZcAwwpq3TWolaY2MeNgZaqz3DqShtkrNQo6SAdHWkwzqFAXzhEyH3EYBf+I aHuH7fEeDr179rvHAlAfCTZ1JDLsN5N7s5Fs6LhOAHeNcyG7vVjGgFogwmSDxtcSf6SK y70KlO/FSU85enW6GFTfr8iFar+fB1Reuy5gfnmkc7BMeDKzT42gSqJdeOOq4GG1gAqV MXrGEo9kG1o86k8UO9Eu+QT/WtusLOkPMsnu72O3W3TAfSuNl1qV/yWHNF2V7QAv63gL n7eLFasgoUvFpZAM9ClwmmFitVGGJheP/90TNtepVQ0a+WhRfSBVogJOMSAFvlMD/KDk i5sg== 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=L4W2D/JQ7v4em6hSEyb605p2cZa0myVJbUGYZmZujGY=; fh=Yq9XNnTVecDx9sqhC0GBlFd0uGzJi6MUaKyn94/j9a8=; b=wjik1aDFwIsUlTwRv/7/X6BcbF9rSjfSj+xdoNDpCeHkgHGzeMPyOwHkGe4XcXvUhX VUAekqdv6V/uxYYs3XAn4oknCVG55sy5ti62dlR/hsyHAEqABxPmqlSdoe659n3Ogtx7 VY19U4Fm2Q0xZMnG7+zpI8VJH002kqQBTXw2RULU4CvpZjbE0MEcR0z+1shCWnO3aV+m sKatmR7Z0ptFh7u81cgNOF8K5uPCf25Km0KBHfLlsGHi0d/zPpKqm8NB6HW3wsCbAhoS P2T0aoqKUKaNAIJZUavGOe0kf0cAojHhXHNO3hVrGzp/fJqSIIGRlTpxS+SDeoJpbVGN nRLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3WuqYFSn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-151995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id nv5-20020a17090b1b4500b002a53a81c01bsi3978931pjb.134.2024.04.19.15.15.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 15:15:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3WuqYFSn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-151995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151995-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 28F22B216D9 for ; Fri, 19 Apr 2024 22:15:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 390AC13D288; Fri, 19 Apr 2024 22:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3WuqYFSn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8t9/3N3O" 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 A6E972BAE0 for ; Fri, 19 Apr 2024 22:15:26 +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=1713564928; cv=none; b=f1utjkSPHKXWspurHQWo/WDyqGl3IgDraPH1pSjBmgtb6WN1K3caMn/fB32+/yDUIzH+mm+13i8MVh0l/yIpiYh2HEaPhE9GVnNgAJZ+ELhxkKXkKksagxHR+Q0vu0rDkjLREFMZZawooR2LQfaVmqUP/SdM6SeQslMYrUFH2Ks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713564928; c=relaxed/simple; bh=ZXE6WJYs4EPCJ09joQHJIQH39glJHJwk77dckbq+RZk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=RcMa+QjUzrHxxEvzqaQqq7zVLbM9EOvuH1nYQpzsJGnP4nZ8FG3UrWPaQEYjhgHrbdKEYvGVgQSfs3KaX87GKbwdD/NrdPBMP3QZ8iFA948VEp8qqJQqWtW7dCSsXLakcN9vNG6PlFkorKQYcV20Vuwx2BYDdri8WnRbY6QBHC4= 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=3WuqYFSn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8t9/3N3O; 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=1713564924; 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=L4W2D/JQ7v4em6hSEyb605p2cZa0myVJbUGYZmZujGY=; b=3WuqYFSnCeoDU81iMBGWr8jLraCz0LXKETrG6z7weEKWrMsVu937p4ijfI+qIykffdMkk1 ZWJqyJFen88h+BzWgf6yauSAIuxPtsXufdkIFeymnBI/YklnHRcnLsTWzAs3lhdtUwmiQT ez4omFxamvD7xL8Akg/Jx/JP8ywQFH2lM/xVLfBMXiMXmqR3DE/gGrwtiNcXkDMQK1dkl/ R/lV07AGDH6VZjvRT0lqPqgAKRF3WZm3JMedn9bjuvS8Kz2DV18cftelhX0DqUFvwXBzS+ ne0EwmcoVnGX3tD59bgg3yD9Nu6pZ/eMQa06zt+OlVXccOq1pRoM8V1fcxmMBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713564924; 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=L4W2D/JQ7v4em6hSEyb605p2cZa0myVJbUGYZmZujGY=; b=8t9/3N3OIrwWPcAEr+hqCEpjL+5xRdtNzmwuHqkwx4N07yL2Vibj/N8gCAB+eiWPkJ4+KX jo/7mxS3yZBsmLCQ== To: Lyude Paul , Borislav Petkov Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package") In-Reply-To: References: <3d77cb89857ee43a9c31249f4eab7196013bc4b4.camel@redhat.com> <20240418082703.GCZiDZVyra7qOQbyqn@fat_crate.local> <87plumxz4x.ffs@tglx> Date: Sat, 20 Apr 2024 00:15:21 +0200 Message-ID: <87le59vw1y.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 Paul! On Fri, Apr 19 2024 at 13:38, Lyude Paul wrote: > Awesome - can confirm the patch does indeed make the machine boot. Full > dmesg from boot attached. Thanks for providing the data. [ 0.089286] CPU topo: APIC ID 0 present 1 [ 0.089294] CPU topo: APIC ID 0 present 0 [ 0.089296] CPU topo: Hot-pluggable APIC ID 0 in present package. ACPI is really a wonderland. Can you please test the patch below? Thanks, tglx --- Subject: x86/topology: Deal with more broken ACPI tables From: Thomas Gleixner Date: Thu, 18 Apr 2024 21:02:39 +0200 Paul reported a regression which waas caused by the handling of non-present CPUs in a present package. It's caused by the ACPI table on the system which advertises APICs twice, present and non-present: CPU topo: APIC ID 0 present 1 CPU topo: APIC ID 0 present 0 CPU topo: Hot-pluggable APIC ID 0 in present package. Which causes the topology to get confused to the point that it fails to bring the system up because the target APIC for the IOAPIC is not available. Prevent this by checking whether a non-present CPU has been already registered as present before. If so emit a firmware warning and ignore the registration request. Fixes: f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package") Reported-by: Lyude Paul Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/topology.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -195,6 +195,12 @@ static __init void topo_register_apic(u3 } else { u32 pkgid = topo_apicid(apic_id, TOPO_PKG_DOMAIN); + if (test_bit(apic_id, phys_cpu_present_map)) { + pr_warn_once(FW_BUG "Already present APIC ID %x registered again as non-present\n", + apic_id); + return; + } + /* * Check for present APICs in the same package when running * on bare metal. Allow the bogosity in a guest.