Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1167925rdb; Fri, 16 Feb 2024 07:19:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVwj1YAiWun1p3h5XtRApip7JqABxufbSZCHi+D6rl/sSq8ZIPGeXbY8LWNei/n+rHtAzFNE5/jMBtr8vnUwk9OcdusZOvU8MGaaseZ9g== X-Google-Smtp-Source: AGHT+IH+K/0ZG2F6z/0Y2EDeZ9TI2VmX0RI3X1DSFclzxQhaHrScFelZZi/AjK4NG1+goJ8hi0Ji X-Received: by 2002:a17:902:784b:b0:1db:4b29:9b21 with SMTP id e11-20020a170902784b00b001db4b299b21mr4867055pln.23.1708096757466; Fri, 16 Feb 2024 07:19:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708096757; cv=pass; d=google.com; s=arc-20160816; b=DGUJDc3DigzwWzqlpx9pdTLRQN6xrJlcp+LiyTj2jVp26om2sfTGpM6W0urLsOWyn/ R9fMut5tYaNLdCRfbvcyMiZllntQSl48Lmf9ShmywDTXJjNTnczpjSGfaeYjZY9qC/Vn 8X3nLyfNi4mpvQK9QfxVg+B/xQMrXZlFyE267N4ytpovMom5PcNtQ807dFrV+W757/Dv U+aJuGfRM6TfmaHX3VnzKySWmBn+XxXLmyNkW9h6VuG0j4F9lZ9NWct8fIzdBQZyqpIg IhiMYbLPSQpxNhEqtz9tYO/8lSRSyCKqt943Dtm6HVIId9FLSckXOQluLlP8k5QzaMtj azHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=4LV/zW7WYjx/rxhAoZSyS/jCFFgneTCDUUKuyDOb+z8=; fh=HfXWoIhgCc+vt39DMIJv/Ec0aAKnw0eFA8QxuIQTUoQ=; b=W/Q0fumqPeqo93Q8Su+RXnih8ee/3l4EecP4xteRfPHS9vMToTWth8Re7qkzriZaq8 2hdpCRCXeYGKwRKcFEnoxnsWgJGIOocNOx3fJD2Oc48D7E7PCGQ+034iUzBsK4gNp2s9 qup+JyP9V8UCSeWpNXDHA9Z9GznIVG32O4OVgBfo67kSNO+4LfX7yJ4zqOuV7e0/6DPj BIoFxnN/EleNlmmFY75uoCHT1mRrll7hiXMBBcAcDkTP0Tv7y4f2TDnI01SEik/CbEkW CfU86gdPgSY6krTb8/talwyApSdQE0lv9pz9WkDeuiQWRLYBq8doRsnJqniNVNDUA7RZ ZsbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XV9QIAAi; 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-68803-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68803-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. [139.178.88.99]) by mx.google.com with ESMTPS id a15-20020a170902eccf00b001da2c896119si3256460plh.432.2024.02.16.07.19.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:19:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68803-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XV9QIAAi; 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-68803-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68803-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 27CE6283A27 for ; Fri, 16 Feb 2024 15:19:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA6EC1332B2; Fri, 16 Feb 2024 15:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XV9QIAAi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0EjtVv/n" 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 59B1A13247C; Fri, 16 Feb 2024 15:16:58 +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=1708096620; cv=none; b=KA6LPRJYz1YXOXmvxVPn99lARuNl9p29Oq61aRg55Eqd8hWfXWn8L0WKxSJJAJzPrreOCFEVe3C3vi03XhJNFNO4eR03E8a4VmAK11pH0E+ECBRpO1PKFhAdH7LCPejy3iZOmWdotJ9Q6al3KPIa43kR+3ri0bsa/H2QoX6NF7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096620; c=relaxed/simple; bh=trweuBSo/h9CIN/Ec8CYbB1vMjQTpDwBwRB5WPD/ZN4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Q3x8Z6sSq0juMu9kuxE9HjPHHjswtESMjUlvP3An9DEn+vr94GPhcp0757GAjn6wMXO8sWb+yxI75qh8DRCMTi77aD6lMgoRb9ptr3+YYeAjwa4qTHxhAM1b2/kb2Q+bPoNebZ1yOxZXq+4+zar1Ihg1vdRZZ+/RbSM3SbhmChk= 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=XV9QIAAi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0EjtVv/n; 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 Date: Fri, 16 Feb 2024 15:16:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708096616; h=from:from:sender:sender:reply-to: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=4LV/zW7WYjx/rxhAoZSyS/jCFFgneTCDUUKuyDOb+z8=; b=XV9QIAAiAOujMnK8IHhqP3x3FEpog205cBYpQqVeNX5S1rf1Nm6GnUl33DQaNrvXlqiK2Y S6nfbh4nhi8zpcs5y6BQlKYh7bOpcRb24XVKVJywSlIPtxCh5XeD4Rz7M2d+jxGbm8LkH6 AgtVQsALyBxypEBwnIgSSF1aZ+6XMv3z1jnQJG7H8sI/pI09cgJ/+OzRqn3FLsKV/KJvy2 6fG+ROVQyDeeiN4rvNMGQhhCXGJSSjxVGTEkUrtvqWGNsNwN+tyPOE9bJSqafQCxi4goyl ePdIsvg3NEUK/ZTz0+zRERgwx63AEr7NiAnxORuwK6+S/w5aKp9dr+XXmtrcKA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708096616; h=from:from:sender:sender:reply-to: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=4LV/zW7WYjx/rxhAoZSyS/jCFFgneTCDUUKuyDOb+z8=; b=0EjtVv/ngib1IpArnZXjB7VOUTH3rg5jrqjsxKeRe+C9sHaJUUvjQnJarTU4ZLeDJrbqGd lJ7Dd1/LKOrIEmDg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug Cc: Thomas Gleixner , Michael Kelley , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240213210252.462231229@linutronix.de> References: <20240213210252.462231229@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170809661586.398.14625417257528542096.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/apic branch of tip: Commit-ID: 7cdcdab1a660bbe9f98bf1591c048ce7ccee59e0 Gitweb: https://git.kernel.org/tip/7cdcdab1a660bbe9f98bf1591c048ce7ccee59e0 Author: Thomas Gleixner AuthorDate: Tue, 13 Feb 2024 22:05:57 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 15 Feb 2024 22:07:43 +01:00 x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug 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 Tested-by: Michael Kelley Tested-by: Sohil Mehta Link: https://lore.kernel.org/r/20240213210252.462231229@linutronix.de --- arch/x86/kernel/cpu/topology.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index c671206..a6d045b 100644 --- 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, u32 acpi_id) 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)