Message ID | 20240118123649.859589066@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-35366-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp328506dyi; Tue, 23 Jan 2024 05:23:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVTSPSpJgXAGFHiGQPOAlTwsVkgmIMuHPFv25tB1dMmQkSaKjC1JA0suJHoQFr+hS0Dmkx X-Received: by 2002:a17:907:8b98:b0:a2f:b9c0:4c0f with SMTP id tb24-20020a1709078b9800b00a2fb9c04c0fmr245946ejc.4.1706016196374; Tue, 23 Jan 2024 05:23:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706016196; cv=pass; d=google.com; s=arc-20160816; b=HPGgO3juxxlJrC5GG96uQfFIDzQaWyn+CXjNDg06xqmzeiA+pAsme/5IEsZkIEW52C YVlCoJPvbANV+cBVBJnlqEUMSMbZr20gsUopHRGHJKcKfPnS//RIHj2gRr43xI+cJsm/ +B8yXxsXHmcNu7XfAmOmxtBN0wugj+sxnoijXa/CSvhW2Nl86JNxg/T6EOnmDiPIyiQk 3qd5pJWI6PsSoFRQYqvZwU+cgfJkU1xVQxxwm/9SXY80YM45a+Ut/w4keBc4PP7XDhg3 QIKtvSo1SUXNMoHJfJQ/kXbYWhuSDG/0jgsVfNyBQ2BhU7okcv9WBGNJ/sfZPsIyKoY3 +Ing== 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=z/7LKCK271zDhMePtD3LaOENCMpQvaSbIcr3vh7U/p4=; fh=Te0fDPJ/sd+7p881M6fa/oF213lBbJvGdEFWr/TLqNA=; b=lxijyRZKsIeszUQR5ujdFf+WaFwRMzr/YH3ta4m97rR9V3CJN4KrklBU4P9J2IeCVi /4mq3EtLwbyd3llA6pObcRdycV3kU3AKlBDqj+Sl/o4PDNn1u3/88kejaDruvuVNi7/v OGJydiYzG7kJvap1xYDo56YxvAPjTNZRQRLQf6HdBfzpm9RyRGL41wA4CSko95xlfxcI 4bRiia6X7EtuKHwObPTPQ8VKmyBTg0ViiqJh+1FuOLj2GnZRsyT0Gl/P4Y5VTTCBcCY+ IWjBU0toyBK4qIZGgYnH2DK5HSAp3XzKLWkPIetRPnIxB/9BPELMF/Zb1yVBExbsGTOF M2qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4gZenHUW; 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-35366-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35366-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 ka22-20020a170907991600b00a2d54ca0913si9421793ejc.817.2024.01.23.05.23.16 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35366-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=4gZenHUW; 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-35366-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35366-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 D01351F220B6 for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 13:23:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDC3E5FBAA; Tue, 23 Jan 2024 13:11:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4gZenHUW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ff6/QnPC" 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 1646F664AE for <linux-kernel@vger.kernel.org>; Tue, 23 Jan 2024 13:11:30 +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=1706015491; cv=none; b=SwvBMBm8JEn+TTp2mObJlwqi+rMEM3tV58t8ZPzC7gL2t0vY9WLLRHPjEojBBe1bvbqFhYUwH/vGnGeDrYTB5JXpVkCkPDzCn+6bPqVy7Ze8sX8QSLb6MqnIPWVJraxAZjOB/9onR4ptNRftR0dMHK1amBshfQhh/fgwbAhYU04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706015491; c=relaxed/simple; bh=Vn7gdV4WGfNx8aLyfIUr6q7nCYaATvUyyo4XK/qBAf4=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=rK/PQUVfd5WsXkWU4y+SBZGzfK5sLHb0ZWpGB9wmzJw1gYR6ovjsV3TEMkLEC7d8hq8KCPsUNk/WsFbBjycZqHF5bTcngR3CUhEAzJtVb0Bj5FAUblSl41/k8Kk22wzcZ1+insDiE4UvIANmmimrTVNvwahmKzqzeAhHNJBgSNw= 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=4gZenHUW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ff6/QnPC; 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.859589066@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706015488; 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=z/7LKCK271zDhMePtD3LaOENCMpQvaSbIcr3vh7U/p4=; b=4gZenHUW0ZHyHU3KWNiCXBMCFACsK53OVjQX9jUZUSscAx4rIvzHJVeKv5GIE9CaAWlncs 3Q9vLvSZj/9xhzeN0CZ0YKuV8Tu+87X/CLHfWofGjWdRBkmCPrYUrzfCCK58wfwYUd38ju zvfsuQE9g1JM4MzLb1iiB6QBOO9YhKDXldJJZdc6pShpXU08rYZMKEwJ6U4YYsCPFHvu8t IqbUDmsvwIg8ojXMRNGaaixZZUB6kLBXGzpLmStnFugpjp+e9dQOUNMn7sRbPrFoQKeol3 PA9o+UAJ2MbuMzsekI+MiYXfwxWF3aN55Gd0daA/cZXfc9ufp911/JI7NsbLNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706015488; 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=z/7LKCK271zDhMePtD3LaOENCMpQvaSbIcr3vh7U/p4=; b=ff6/QnPCcCoCzV9cCY8Xb/KjEKlFohr0aBbSm4BPQJMXVngYfhiyEygy4Q14b6cozzKvP0 srY35JEAdoPwjMCw== 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 23/30] x86/cpu/topology: Simplify cpu_mark_primary_thread() 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:27 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788887639272522610 X-GMAIL-MSGID: 1788887639272522610 |
Series |
x86/apic: Rework APIC registration
|
|
Commit Message
Thomas Gleixner
Jan. 23, 2024, 1:11 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> No point in creating a mask via fls(). smp_num_siblings is guaranteed to be a power of 2. So just using (smp_num_siblings - 1) has the same effect. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/kernel/cpu/topology.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) ---
--- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -76,10 +76,7 @@ bool arch_match_cpu_phys_id(int cpu, u64 #ifdef CONFIG_SMP static void cpu_mark_primary_thread(unsigned int cpu, unsigned int apicid) { - /* Isolate the SMT bit(s) in the APICID and check for 0 */ - u32 mask = (1U << (fls(smp_num_siblings) - 1)) - 1; - - if (smp_num_siblings == 1 || !(apicid & mask)) + if (!(apicid & (smp_num_siblings - 1))) cpumask_set_cpu(cpu, &__cpu_primary_thread_mask); } #else