Message ID | 20240118123649.513878058@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-35360-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp328108dyi; Tue, 23 Jan 2024 05:22:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9sngoAsRMIFH5/coHdLBEOpDZJ3Cyq26DmmhIQOe93g9FPzEMWsP2IsMh4YdBl4SPaofs X-Received: by 2002:a05:6402:30ad:b0:55a:51c9:20e2 with SMTP id df13-20020a05640230ad00b0055a51c920e2mr797186edb.70.1706016149462; Tue, 23 Jan 2024 05:22:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706016149; cv=pass; d=google.com; s=arc-20160816; b=AqDfGK9PCKGlgAPgXVqUEnpaVq4iJIY7Sh8pqdG6/ZOfzH0c26KNhHw+04w59zbhZA yKFUxa3obSD+iPpxT14ZIKzS6CXQS5hwBWdhy+eTl6keBmfN0mlrB27LGxSJRiWxTFvs mB3ZnMysrfHZM5/+avCo7AoZRe4jjC9WNuDNN1imFLbqdf8RvSeyRAbPyEW/GudAwf8d t/wRc+TixEStxJjWeR84pKVEkcDbyeyOL5zPE3RIhvhx8O0mBaK9CH0lYQ3vJs2MgiKR J96aMpM4vWICgdF+guCy+6E6Gk5KAvnJGIUNurf8yqqq9OkBYrS7XozmLhVpqbpfyOFY FwcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=AL6rtCpTcNHRwvmkB9lH73XsGA1kAtoRIuLTc7Fw7rE=; fh=Te0fDPJ/sd+7p881M6fa/oF213lBbJvGdEFWr/TLqNA=; b=SLiBDHLDpT5ZFGNacUPGaMKh3OJPcclgvUVI/mD63gsh6oT09vJXjJL8FuJMDpwor9 Qvhmdo3D4drBEEt49Hwzp2pvXnRMrmkFhuxlM7/McI4fekD/YCdG2+RazaAP9n5hvIck 8zTGTAh1wfLFVZDPnR8/CPo1Q76TEITT1KKponEf5dhbCBE81GtHyXzn97/KyAmCPADR hrqI/wV53yvysJY5i18+CsZMvSPVFcfw8yTnL/8OoOAAQun5gF84yRORPpH0mrn7jGXx Li5srvx4dBPc+crLfqhTd9xUGIfzWLiVK9pWOTPfAzeTxEYrJZ/0110uC+AF8tKXk0q/ 7pig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rMqAeOL8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QwHll0Gi; 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-35360-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35360-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h20-20020a056402281400b005574ba7cd24si12087312ede.226.2024.01.23.05.22.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:22:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35360-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rMqAeOL8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QwHll0Gi; 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-35360-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35360-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id B1B871F23BE2 for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 13:21:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9DAD657C7; Tue, 23 Jan 2024 13:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rMqAeOL8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QwHll0Gi" 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 DE0FF64CEE for <linux-kernel@vger.kernel.org>; Tue, 23 Jan 2024 13:11:19 +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=1706015481; cv=none; b=U4dBm2qc+be6Bz/1JeVe4G4IZpce1ODgZsRHaJN4njHl5sZyyrL/7FwDvnlzvEwaCDWfo3T91yS9qPF941TSdb1HrvcelzK5niKM/8eYjg/zptqwJQwxPjgULUalzIrKIziNnA6fU+SWcwQDco1s6pnN7jgo2fLI7fIOttPUHso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706015481; c=relaxed/simple; bh=r5AGb/XQ+lkMk/28b6KQQlUOwH5R5IM2l6YzETADWPk=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=sOvUzrBauSZM2XcqKz8xvgHYVYJ4tpp7txJBrxFVXUp4AyUM+0Oez/K6lllhPbWpscMM7hQvSc/KjCXqsIcOjxzNyp8Sj6rwCXRNVIq6KI0Q6mHNSPFTEo9QrRbe7J88RVBYC5ZBrGnK15gVPErDXrbedZLPRNX8CxrCHVqxTJ0= 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=rMqAeOL8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QwHll0Gi; 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 Message-ID: <20240118123649.513878058@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706015478; 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: references:references; bh=AL6rtCpTcNHRwvmkB9lH73XsGA1kAtoRIuLTc7Fw7rE=; b=rMqAeOL8SfoskRhVnzzZ1cgGVKKHEy8/LjTFzaZoz/fPvYB43MMg84vcWq6nK+lgOyqL9L GG8IfX33+gpg2N/Hs/ZDmMe7kXAfPBsBUZiO0eVzhlpNmDeLYvGc7RfK19cGQjqGB+U4Qo //vhaLKF+OTuYmSpur0IcWJRGqpUwsLk9XuSHzLh3TvlibBeYWg94Vb9wF77FX4kXBSArN gDFmfu7707rducLbdtEdxKqVun2X9Lbu3jcmI/gNBh2/0dKCucm+H5ryLF2A8KuEHJMDgq 8XHpv0/ueVjniKnXbLOuJHaO7tV/3nJdwqTsFf3PzyTCDpo3+dlIOCpG4s/0GA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706015478; 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: references:references; bh=AL6rtCpTcNHRwvmkB9lH73XsGA1kAtoRIuLTc7Fw7rE=; b=QwHll0GiP2lanU8HeZcYPYuEpVbvjY7KofnkML6uapGHzV9/Wi5oW+JP41OoJnOWLPJwyw Vhoe8kGyemadi0Cw== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Tom Lendacky <thomas.lendacky@amd.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Arjan van de Ven <arjan@linux.intel.com>, Huang Rui <ray.huang@amd.com>, Juergen Gross <jgross@suse.com>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, Sohil Mehta <sohil.mehta@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Kan Liang <kan.liang@linux.intel.com>, Zhang Rui <rui.zhang@intel.com>, "Paul E. McKenney" <paulmck@kernel.org>, Feng Tang <feng.tang@intel.com>, Andy Shevchenko <andy@infradead.org>, Michael Kelley <mhklinux@outlook.com>, "Peter Zijlstra (Intel)" <peterz@infradead.org> Subject: [patch v2 17/30] x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug References: <20240118123127.055361964@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 23 Jan 2024 14:11:17 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788887589900254852 X-GMAIL-MSGID: 1788887589900254852 |
Series |
x86/apic: Rework APIC registration
|
|
Commit Message
Thomas Gleixner
Jan. 23, 2024, 1:11 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> The topology bitmaps track all possible APIC IDs which have been registered during enumeration. As sizing and further topology information is going to be derived from these bitmaps, reject attempts to hotplug an APIC ID which was not registered during enumeration. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/kernel/cpu/topology.c | 4 ++++ 1 file changed, 4 insertions(+) ---
--- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -266,6 +266,10 @@ int topology_hotplug_apic(u32 apic_id, u if (apic_id >= MAX_LOCAL_APIC) return -EINVAL; + /* Reject if the APIC ID was not registered during enumeration. */ + if (!test_bit(apic_id, apic_maps[TOPO_SMT_DOMAIN].map)) + return -ENODEV; + cpu = topo_lookup_cpuid(apic_id); if (cpu < 0) { if (topo_info.nr_assigned_cpus >= nr_cpu_ids)