Message ID | 20240213210252.462231229@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-64302-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp814292dyb; Tue, 13 Feb 2024 13:19:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXRkXAfJ5PdwShsFigItiz/K2l88LkmDxNiRvSgzKhCBcadthAFX42Xd5IcwqXqVM/DTUIbfd512H0GemlIgqdgOXMFfQ== X-Google-Smtp-Source: AGHT+IGHm1q22freEz7A8JntNzYKDW3oWKxYWRoOGd6AW6W/5uRdB4+zgxVZdiyXpYg6mtztU7er X-Received: by 2002:a2e:a7c7:0:b0:2d0:d02e:26d8 with SMTP id x7-20020a2ea7c7000000b002d0d02e26d8mr818236ljp.32.1707859155792; Tue, 13 Feb 2024 13:19:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707859155; cv=pass; d=google.com; s=arc-20160816; b=0UatvjcFmTVyUy/a9tMJQg0XJj5aLgu2MpUjDZ9wWx2CqK0CgunK6UuSG2b94HfkU/ YK2egJpW2Lg/kCo3hnMxBoJ6Mqt8IxH/Kq3bxxhU0wL23TY5+mfHviczrL0uFayrfm/5 Lr0gUp4gsAjJj7dHRL4PCKbFRTn3weCnGKXJByM5BQepu5yMAkYUF1spAEnauRmFNMTf KXcdiE0aAymBbFOuHSIRYfj2tw5ALAGczbBjF93XtHqYCgUAYmag6gfhkZq94j2hH6s3 rcA0LrdFCHEu987qADsW8A+yi2bR1B9pev6Wj4AeB2bg+jkhIb8K/+tBFwwD962Lb/tv GMGg== 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=5JJur1G2I1XboqcLYG+3cvwsrYIK9ClOurubWw6N59g=; fh=UF+iV9/tuONsXyq8SAZKPR4Sngod+Pm4TaAFL+4JnyE=; b=j/IqxIKcwDWEDTBAK7kb0cCXYKKBK6Fef0qpyEZvcdOcV6QtnpifYCGuqTDCpDXsea 543qiIXRBFGsEFGLCSBElP4LpBZQa4iRjAFlQltMm80MkwfFlR2IR44YOtImhBv413db 13OW7hjIB2ZFWR2IG/jLSNz3O3OOqZRR+EHcnKMtn0ylxhFJsUrugQNHtMlpkNLLLBbQ vfS4TS1+Qj1gn/sfWhmwKPrLhF3isKGEg868MpmGJuSCvcsv8tRObABQ1WseYENQdl1a cBG8AUx6FBRCiJGUG4yHkV0XMLsYZ4/GVZLxEj5nigUkIGnRqdmtuIh+ZxmrXdiI37Xm ae0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3LmvAtsd; 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-64302-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64302-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCVAC1FgLe3cIaBUmUj17zlRISohwSO3MOv8WAhsKPt1GSCJLDTfhiD+7Q62mkDiER9XBOdzX3VkBrqWSBwD6jdy2aVQAA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n29-20020a5099dd000000b00561b93ff5d5si2211594edb.174.2024.02.13.13.19.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:19:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64302-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3LmvAtsd; 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-64302-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64302-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 635E71F21CAD for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 21:19:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97F9A82C6B; Tue, 13 Feb 2024 21:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3LmvAtsd"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="W/G5phlw" 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 A9DF38174F for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 21:05:59 +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=1707858361; cv=none; b=PpF+f5aftNVxRuko8ihWhOQhT9Fe5hOKcp0OOMNVwHlfn1ey/IyTDUsjvs6rHLzN3ro3BZeF1HJ7tVp0n1nuHnqv1wFRJSwb3LrXrf31xPyNIARfqzvxVl/Xx+ic3FQJjC/acEJc1eDlJB9eGDsxZnl+rGWPodcD9awomG41FPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858361; c=relaxed/simple; bh=HtpJ3xliOS+lPd3a3JPFOOp0Bo2w5a0wYDFDoURbUEc=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=e/bYG5loZ5CsZnJvGcuH6jKS75OxmdCCOolWQy9ZxihXUQFwlIH2pVX/iPrSt7LIhDYLrZVVxUGfBYHw+8v2I+QYjKs2TPyNuWfRWUpU1LZTog2lS1n6V78PWD9lJTJvnsPucob6LQWwbr6uETjQIL6nj8zTE+jDkTlfPSWnK0I= 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=3LmvAtsd; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=W/G5phlw; 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: <20240213210252.462231229@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858358; 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=5JJur1G2I1XboqcLYG+3cvwsrYIK9ClOurubWw6N59g=; b=3LmvAtsdVeujQdo7UnZ7n3gPd2u6LuvJ12D7j7Q/OAex3Tz20+9lnZ9WOjRmvoOKvzSdBy teJdnz7sBDo/GOpIRiwzPeSEa8R+28cvWZAsTxIileQnt3XXMCnrfjQzaEdBmZNmdzKFV6 4eLEPrVkk5MTOiLmfNJOn+H8zXjsGAjK2rFOTjVT0stpD2xMK8UxecOR0ZaB3fRg/dzI1Z yub0+4ismEhZoBPIaWkbe8vUYhGST5vw8XwdUzpSyZy6n1vwvtwqJHoc3Fknc+Ex+y5av9 TLIe8gh3Eqp+N9OoQqNJAroioOZdEBuMiKYudmjh9fFaNKNB2Rn02xK2BKynCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858358; 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=5JJur1G2I1XboqcLYG+3cvwsrYIK9ClOurubWw6N59g=; b=W/G5phlwoDRR/PczSSP9ln5sld6ZNCEsiZWpdwtNQOP6KaTMl61YhqjIdobHV0NjUB+dWI M/Zg1y/1CmSOt1BQ== 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 17/30] x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug References: <20240213205415.307029033@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, 13 Feb 2024 22:05:57 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790820121982762146 X-GMAIL-MSGID: 1790820121982762146 |
Series |
x86/apic: Rework APIC registration
|
|
Commit Message
Thomas Gleixner
Feb. 13, 2024, 9:05 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 @@ -272,6 +272,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)