Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1427246lqo; Sat, 18 May 2024 02:45:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUF2sOJocedi8zH/MnuIlyWUBhQvYLOW7ZBQkstNcjpzMTLQ7x2e6kwz3OReOi65L0y1iyiCkpXdSbJHOS//BMjrxDK67NbUWZOnhuhgQ== X-Google-Smtp-Source: AGHT+IG+i/3UJYrGbDCIiW+6LK9+lqb7uVgH5XxA71mzLivQiUoAXi/OueWsulYK+TJ4TfDLnEdh X-Received: by 2002:a05:620a:5711:b0:792:c151:d027 with SMTP id af79cd13be357-792c75f4bd9mr2483583385a.47.1716025510812; Sat, 18 May 2024 02:45:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716025510; cv=pass; d=google.com; s=arc-20160816; b=ZY5kOAdam8QzV9UFPbeBcIUFCJaQo2BiCf4mE7H6SQXXi0mUcnZbGjNGj6vm/yL6xn raePAHKzD1CjF9tkT3S0T1Tw3mJ2qbSxdyuJx8N0rQZBV81sOWQnRXQMbkD6cP5iu2Tm ev2H34xFDqXm2zNXl0YjQLv52/84Pe7OoDlWtCJucKJ2iDfm9hVTZ/MXIDbQQrZ+xrKN rhKTo3OrC5ZxXmIAMYMOk0cNJsvX3hUUTL+2rUtTwcAH/5h0kuBaPZd6ka0FZOOFemN8 H3pRs16Mpwev65TV3EPl0Oidf5HjlZ5mYz/Vd9aTtbiEBp7VV2sQ72SB7x7f7W4+5w5T Kepg== 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=MolmMBZt1LO4RiCedTEusJA5MaqJfY9Y/sAo5N3HZuA=; fh=LFzeYgb0ex3z8fytjE8glOGl8UR5Le6kyQY6lwbIcLs=; b=hbq1njF0U62TtCV2dOG1NnbvuJFVI/ExYt4LlfjSCnmDpEOToDvoTjgudVV6Rqy7xL GpzDV3pyxICwbQh3w6ndwBocuIpM/mZxWZjl7QAvOj/J2Iq0lhXxssfasXrsqOA4rTco gfdR8axZFOBLFBzf6Y0fnpVVUNXsbrelkv/3B6xWGO5IRCozMewbtP942FOGwm1TCovZ AX7E8OEvq4X95nbc0KSTvCdirkfB39PwsntlgrFcpFfgjn6mlAfAXfPBZI+DhMT2frJy kIEA2ORPv7j72yuGDyfjshH6TIr9szUr3yYYIU1x9BH5AkMNHyDkgEFnLzT5SxMBHZw4 5bsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xgU7ciUD; 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-182811-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf38dcc1si1878958285a.712.2024.05.18.02.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 02:45:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182811-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xgU7ciUD; 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-182811-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182811-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7D3121C20E31 for ; Sat, 18 May 2024 09:45:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B57A376F1; Sat, 18 May 2024 09:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xgU7ciUD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JpDmxsTA" 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 C425D28376; Sat, 18 May 2024 09:44:54 +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=1716025496; cv=none; b=FnAN20w7Ab+a4bUm9F5nQt5VUQ/hZ9xGjOnMezEEhtFB8jf0/k4zeGsMx1LspnWnhhSBIy3jkqvWxBD4UflGtCYFI4D2PXBMClerblD8mkqJfqIvAemYFo29dIs4Dnihzkhzrzcjr9e0La/uTku022E5gQJxGBaWTuYuMMrIhjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716025496; c=relaxed/simple; bh=YnNbaHbLo6hEpCYus0gSKcmmmNiGpYvHLIWFn4j7U1k=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=EeKuh8C06yw0XQEeog2LvGRM2PJC08uXggZsGm+glAZLwMYoPluOd69guXOrahr90fLZuvBADJHHvhw6JgCa2mKiIAPHwW5x1ilNEimUNSbezYxyCIqI2tQqnxa50UpVI8AR/pQJW1IdGtXFGnL4LY3nNJDXcxMo9p4gbfdbdhc= 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=xgU7ciUD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JpDmxsTA; 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: Sat, 18 May 2024 09:44:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716025493; 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=MolmMBZt1LO4RiCedTEusJA5MaqJfY9Y/sAo5N3HZuA=; b=xgU7ciUD+TRqjQmg+z0Bze9aKGplO3j9URgi+hP9K0Nx0hhQfJHc3VlqziPOdNhIA/OlLh 2KtUOJvY7ZgCHEWkFDINPQ9rzwsEB3/FqAyTQFrXBdZVRbnbQDu9MOZhtxcLoKSup/2849 FupZL9KX5hnF2MrjEny2mI6KuLmJSfLdG6b6Ys1HQq9j8+9MrUOihxeG4AWHYqu7T6L7WP u7HTCbUroOnGCGLBeUbQWDMj8qB4mGb8UGVtx09FHyPBPpC3Z0d4dFIdj2eiqvUb15ItSa 6ohtsTAsgMT2k+/LNXKJRCoj4UV0LC78/CVHYNiug6UGvFTVa76a2v46nzwelw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716025493; 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=MolmMBZt1LO4RiCedTEusJA5MaqJfY9Y/sAo5N3HZuA=; b=JpDmxsTAKbAc13WAGBSRr45WmZVNel5k+na8V9Ecis6Po1oeg1xxKedr8GA4OjJ0slK0Uc H1w54zeemB5EICBg== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/percpu] x86/percpu: Introduce the __raw_cpu_read_const() macro Cc: Uros Bizjak , Ingo Molnar , Andy Lutomirski , Josh Poimboeuf , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240430091833.196482-4-ubizjak@gmail.com> References: <20240430091833.196482-4-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171602549283.10875.15739867145799719700.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/percpu branch of tip: Commit-ID: 539615de7004a46778020183622856f4ca14e4ac Gitweb: https://git.kernel.org/tip/539615de7004a46778020183622856f4ca14e4ac Author: Uros Bizjak AuthorDate: Tue, 30 Apr 2024 11:17:23 +02:00 Committer: Ingo Molnar CommitterDate: Sat, 18 May 2024 11:18:42 +02:00 x86/percpu: Introduce the __raw_cpu_read_const() macro Introduce the __raw_cpu_read_const() macro to further reduce ifdeffery and differences between configs w/ and w/o USE_X86_SEG_SUPPORT. No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Josh Poimboeuf Cc: Linus Torvalds Link: https://lore.kernel.org/r/20240430091833.196482-4-ubizjak@gmail.com --- arch/x86/include/asm/percpu.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index f360ac5..d202551 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -156,6 +156,8 @@ do { \ *(qual __my_cpu_type(pcp) *)__my_cpu_ptr(&(pcp)) = (val); \ } while (0) +#define __raw_cpu_read_const(pcp) __raw_cpu_read(, , pcp) + #else /* CONFIG_USE_X86_SEG_SUPPORT */ #define __raw_cpu_read(size, qual, _var) \ @@ -180,6 +182,12 @@ do { \ : [val] __pcpu_reg_imm_##size(pto_val__)); \ } while (0) +/* + * The generic per-cpu infrastrucutre is not suitable for + * reading const-qualified variables. + */ +#define __raw_cpu_read_const(pcp) ({ BUILD_BUG(); (typeof(pcp))0; }) + #endif /* CONFIG_USE_X86_SEG_SUPPORT */ #define percpu_stable_op(size, op, _var) \ @@ -470,16 +478,7 @@ do { \ #define this_cpu_write_8(pcp, val) __raw_cpu_write(8, volatile, pcp, val) #endif -#ifdef CONFIG_USE_X86_SEG_SUPPORT -#define this_cpu_read_const(pcp) __raw_cpu_read(, , pcp) -#else /* CONFIG_USE_X86_SEG_SUPPORT */ - -/* - * The generic per-cpu infrastrucutre is not suitable for - * reading const-qualified variables. - */ -#define this_cpu_read_const(pcp) ({ BUILD_BUG(); (typeof(pcp))0; }) -#endif /* CONFIG_USE_X86_SEG_SUPPORT */ +#define this_cpu_read_const(pcp) __raw_cpu_read_const(pcp) #define this_cpu_read_stable_1(pcp) percpu_stable_op(1, "mov", pcp) #define this_cpu_read_stable_2(pcp) percpu_stable_op(2, "mov", pcp)