Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5520666pxb; Mon, 14 Feb 2022 00:37:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbt9APL/i6zEtRxeqHRyYu5V0OHRfbAsX25zzUgq9UO4W93AIgUmFuspuFPny2D83/DXqq X-Received: by 2002:a17:907:6283:: with SMTP id nd3mr10539985ejc.2.1644827835712; Mon, 14 Feb 2022 00:37:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644827835; cv=none; d=google.com; s=arc-20160816; b=qt5kJzBg+Hbok5+uFI8HoQW7K/5QOift79d+QhNW3mmExos3kYugU908L3HnBvK9Ut hJufyXXIXoz3G2rVdBHnDpiabTyrJsCSNcIWTy8nuFkH6abzBQu1TbY2srZjpMWpcE1e wqrEYuN4qC2tCGA9EUm8UqhG5r1QNKGmkKKsj0LejAm4K20eiQIe74OM03XC+SQQRYoe egvRW7jFRl94kpo9s88z5iNAsCdIhV+OD+sd361rpxt4mMyClNLjRhOLIJz4cv61BLi6 2KRj0CzFRxIpeEj4mGnDSz+pokPuNEvacDtimMwuFL9FW0eqXYMmGbjZIbDVh41yXAE+ DoiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=CkyQjo0ugeftPsZyQjLZirnYBh2nhZlLJr53w+AvS3k=; b=Ne3Bz5vfJAv95bordZl+FRoiF4f+T+UA8ACUQn1IMoTsYvvYIcRwQlzeiolZFxw18S Xpdk/oLBowWFcX6YL1K3rX9sLddXfdx5X1/ehqeEbnJaL16wBXqg1W1hNANgsCZavwjU e05w0LpGC1HJqT4BaHEdchrwC4GOtnC5I3y6gz77PehfVGwMuw8D5h2u6+kgnDL7nB4k OQjX0CUsgIMlqzeIH9iItc0Zwirde65+sMjsuaPop+3benjU7y5qOhK25RkeVoSb5PAk VEJnK293+8Sl9ImCycJjI9bzeN9G9CUdFC7Ud288DqsbVn23QNRvQclNvUqHppEjbfbY 8N5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AM8xTou4; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3si13664285ejw.323.2022.02.14.00.36.53; Mon, 14 Feb 2022 00:37:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AM8xTou4; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235243AbiBMK75 (ORCPT + 99 others); Sun, 13 Feb 2022 05:59:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbiBMK74 (ORCPT ); Sun, 13 Feb 2022 05:59:56 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E5825E74F; Sun, 13 Feb 2022 02:59:51 -0800 (PST) Date: Sun, 13 Feb 2022 10:59:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1644749988; 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=CkyQjo0ugeftPsZyQjLZirnYBh2nhZlLJr53w+AvS3k=; b=AM8xTou4Gmszu2WpoBrDFRpmA3tKx1SXU0XtJlmz3YiSmYjsNsEp6aA3lRgKpkIjw4LpwE XQ7ukXenXWadTI3lM7uQH8mKl9Ldj1a5Nt4p/5susL+F29S5HMlKj/wIQsxeioBnki/tCl 8Y3zlESMClNgkYrm61AwyQb5jrOTyUjoxzCwcsqnFcmFyCvADjFrNU/99MNGOCWBEbYikP 21J4OoJVrnqi+PT3HkxhHiyX94H818FX7BP07YVVIQfrTNJthOGIDxgrimjYDF73N33ZYT p0TTuoofEbTDAp03v3Y7+GWEXfAD7FTGyEy0l7DH1edftP7NEANNl3WwQ+Utfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1644749988; 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=CkyQjo0ugeftPsZyQjLZirnYBh2nhZlLJr53w+AvS3k=; b=gJrjxMb++vuI3tvdaX7j9Yhj+fSOapDDh8Wa2FHar/AMKJvHZkeP3Zc9KjKM7KBughtSaS LpETmv9Irm2hFoBQ== From: "tip-bot2 for Borislav Petkov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] cpumask: Add a x86-specific cpumask_clear_cpu() helper Cc: Borislav Petkov , Marco Elver , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220204083015.17317-2-bp@alien8.de> References: <20220204083015.17317-2-bp@alien8.de> MIME-Version: 1.0 Message-ID: <164474998765.16921.8420399786345053314.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: f5c54f77b07b278cfde4a654e111c39996ac8b5b Gitweb: https://git.kernel.org/tip/f5c54f77b07b278cfde4a654e111c39996ac8b5b Author: Borislav Petkov AuthorDate: Fri, 04 Feb 2022 09:30:13 +01:00 Committer: Borislav Petkov CommitterDate: Sat, 12 Feb 2022 18:20:05 +01:00 cpumask: Add a x86-specific cpumask_clear_cpu() helper Add a x86-specific cpumask_clear_cpu() helper which will be used in places where the explicit KASAN-instrumentation in the *_bit() helpers is unwanted. Also, always inline two more cpumask generic helpers. allyesconfig: text data bss dec hex filename 190553143 159425889 32076404 382055436 16c5b40c vmlinux.before 190551812 159424945 32076404 382053161 16c5ab29 vmlinux.after Signed-off-by: Borislav Petkov Acked-by: Marco Elver Link: https://lore.kernel.org/r/20220204083015.17317-2-bp@alien8.de --- arch/x86/include/asm/cpumask.h | 10 ++++++++++ include/linux/cpumask.h | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/cpumask.h b/arch/x86/include/asm/cpumask.h index 3afa990..c5aed9e 100644 --- a/arch/x86/include/asm/cpumask.h +++ b/arch/x86/include/asm/cpumask.h @@ -20,11 +20,21 @@ static __always_inline bool arch_cpu_online(int cpu) { return arch_test_bit(cpu, cpumask_bits(cpu_online_mask)); } + +static __always_inline void arch_cpumask_clear_cpu(int cpu, struct cpumask *dstp) +{ + arch_clear_bit(cpumask_check(cpu), cpumask_bits(dstp)); +} #else static __always_inline bool arch_cpu_online(int cpu) { return cpu == 0; } + +static __always_inline void arch_cpumask_clear_cpu(int cpu, struct cpumask *dstp) +{ + return; +} #endif #define arch_cpu_is_offline(cpu) unlikely(!arch_cpu_online(cpu)) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 6b06c69..fe29ac7 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -102,7 +102,7 @@ extern atomic_t __num_online_cpus; extern cpumask_t cpus_booted_once_mask; -static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits) +static __always_inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits) { #ifdef CONFIG_DEBUG_PER_CPU_MAPS WARN_ON_ONCE(cpu >= bits); @@ -110,7 +110,7 @@ static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits) } /* verify cpu argument to cpumask_* operators */ -static inline unsigned int cpumask_check(unsigned int cpu) +static __always_inline unsigned int cpumask_check(unsigned int cpu) { cpu_max_bits_warn(cpu, nr_cpumask_bits); return cpu;