From mboxrd@z Thu Jan 1 00:00:00 1970 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 47148449B39; Wed, 29 Jul 2026 09:55:23 +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=1785318928; cv=none; b=UerXg84CzSlmqiaV8z2GlhfSkbk3V3iShTTM51FFw+SDBIu3FW7hEvSLa1XkvA7verSRg7m6IPAFalSPSi2odhcin/qTv2GAsKxSyyOkummTC7UEwP2wwDaaq02Xr1ona4pmLtW84GpmWFrM0b4XKfoXiUK2fAVhlmnFXx7QFfQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785318928; c=relaxed/simple; bh=6ezStjd2oyCZvB0sL39tiaGOlIp9OpC1eSz7cHBan+4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=somVR4/ejzog+OoOSE5YvkBPV8W7YhhCtcRiXq90a+WAf/CQnjbv6Xv8p6tbTAxEYBNc6Qd2oBwRaQQKA2HPran0Lzs96drDSJat2nsQ2amDzD5JF6HWv/aOJb6++e+fT0EPJ1GmNy+EakqpP8sVEfQL9vz+X5Mmknjtkavx5GU= 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=xwVeXQEN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8CtST3hF; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xwVeXQEN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8CtST3hF" Date: Wed, 29 Jul 2026 09:55:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1785318920; 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=cqSgYcAx4IPYM5cqdYbOMXY/9wMt8irdSgPWtzNyUIg=; b=xwVeXQENt2facG7iBiXmot2PAq0G6oFVXOz9GO4KRqn33qj3GYe0wFDGAEAT56Oj/B4M4B /gnruWgxUDXkm4OHnUL7tL7Cr1EcnUSZNh7LeCBgfIB5eX+jkKD9tq7ge7r5QT/rmVujnl ABFNAkkbUAQpBX9P6bRvF2781JBHR1hLt50Nyn/3fnUVO5rAxwgBpbuuixNy1dg87+KPGI BsVw8+UlphF0x8Um/lEih8HOMtX4q826rc3fVCjHJJs4LW8yT69LS/CfIY1zrM3r/4e2mM 69Rt7No9F6OAeOw5Dpiii3Urb3h8Osa5gcbWJRJ6PZXku4o6jdYkALyWJXpB4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1785318920; 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=cqSgYcAx4IPYM5cqdYbOMXY/9wMt8irdSgPWtzNyUIg=; b=8CtST3hFJU7ShCOyhKEGTLUoI/M7x6JcbBtcFTIKxLFbXoPGAufghqa+i9N/HsdDCKM1cg Z1BqNnMd6t6/C+Dg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] x86/runtime-const: Introduce runtime_const_mask_32() Cc: "Peter Zijlstra (Intel)" , K Prateek Nayak , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260728052540.4728-2-kprateek.nayak@amd.com> References: <20260728052540.4728-2-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178531891877.112641.9898908965546490101.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: quoted-printable The following commit has been merged into the locking/core branch of tip: Commit-ID: 775e0f2284554e24855c4372faeb957a5e515337 Gitweb: https://git.kernel.org/tip/775e0f2284554e24855c4372faeb957a5e5= 15337 Author: Peter Zijlstra AuthorDate: Tue, 28 Jul 2026 05:25:33=20 Committer: Peter Zijlstra CommitterDate: Tue, 28 Jul 2026 13:07:14 +02:00 x86/runtime-const: Introduce runtime_const_mask_32() Futex hash computation requires a mask operation with read-only after init data that will be converted to a runtime constant in the subsequent commit. Introduce runtime_const_mask_32 to further optimize the mask operation in the futex hash computation hot path. [ prateek: Broke off the x86 chunk, commit message. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260227161841.GH606826@noisy.programming.kick= s-ass.net Link: https://patch.msgid.link/20260728052540.4728-2-kprateek.nayak@amd.com --- arch/x86/include/asm/runtime-const.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/include/asm/runtime-const.h b/arch/x86/include/asm/runt= ime-const.h index 4cd94fd..b13f703 100644 --- a/arch/x86/include/asm/runtime-const.h +++ b/arch/x86/include/asm/runtime-const.h @@ -41,6 +41,15 @@ :"+r" (__ret)); \ __ret; }) =20 +#define runtime_const_mask_32(val, sym) ({ \ + typeof(0u+(val)) __ret =3D (val); \ + asm_inline("and $0x12345678, %k0\n1:\n" \ + ".pushsection runtime_mask_" #sym ",\"a\"\n\t"\ + ".long 1b - 4 - .\n" \ + ".popsection" \ + : "+r" (__ret)); \ + __ret; }) + #define runtime_const_init(type, sym) do { \ extern s32 __start_runtime_##type##_##sym[]; \ extern s32 __stop_runtime_##type##_##sym[]; \ @@ -65,6 +74,11 @@ static inline void __runtime_fixup_shift(void *where, unsi= gned long val) *(unsigned char *)where =3D val; } =20 +static inline void __runtime_fixup_mask(void *where, unsigned long val) +{ + *(unsigned int *)where =3D val; +} + static inline void runtime_const_fixup(void (*fn)(void *, unsigned long), unsigned long val, s32 *start, s32 *end) {