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 0096B445ACD; Wed, 29 Jul 2026 09:55:19 +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=1785318923; cv=none; b=sDTZ3bjrNZtFv4WVPmlhFejo5eZX3Lz5Y9vZCIY3OEc/+jw/lOYP/RKZMX9xQbdAuejhd+QZN21UBV8XPY7X3Xk/KiUyEOW3HwXRRIwr+xywlJEbhdiS0yJcVF+tUssqo3ugCz64+IrhvDsDpnFAoE1HT0DUIcgbmGNf01gRKRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785318923; c=relaxed/simple; bh=8nKp6FWYQGF33qwECK36f6ObAQtcw26zc29GFt8DZ28=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=UDcl8SR3bAPghO0X3/0yWtXpN2W6DH547RD8qNsxdEyek7wKfaMl0/ONMWg5M4aNvVBBK/l4HMTifph5APthrVN6hn3eknrk98djpKW+ENHpacvjTT6rBS4c/IfCv3x8SWQ4GciGrCv1YCfBSlL9VraxGTC8Resth2Iv+yRJTeg= 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=QhKZfpKP; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JKQCg8BO; 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="QhKZfpKP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JKQCg8BO" Date: Wed, 29 Jul 2026 09:55:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1785318915; 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=b2TJf021ossKontoxRgeA+oR5W5JPwoLQhyD9h7Gabc=; b=QhKZfpKPCD/yCGYAyiNQRiMP5o9CeBZM3Pd9ujJxKYNy1xMlIS3vrGb55BJ659TyHVAHCj yU9EqGquMasyFck6IuOpa8fYMMf7hWobKNYIatdK3W3zi8lvaXlrmSqdP4nExIAuZCjlJy Vqo0LrVDXhGORbLx4d9P91o6SUpFwB5hVCJcSw3owzvKH4ume5ztZHUL+aabraFw9/+1/3 IVIX3Dj9nvC6vXHwJQVBMtOppoTBtBfY39zRl0JYqAMcHnf5VhNKKs+fP974G9EHKnO5Y9 hM8F+znzmqdOgligs2dGoBkzmn5YCVHtaU+xsqO2QFg5xE239LeiNdq2LYQkOw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1785318915; 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=b2TJf021ossKontoxRgeA+oR5W5JPwoLQhyD9h7Gabc=; b=JKQCg8BOOrRYKbYWhPUxE2NQUsvJMRUKLHLotV96uijlpqtXBrCfU4+gSeTgjTicqk1d7G 6oHlTRwbFsSuhZCA== From: "tip-bot2 for K Prateek Nayak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] riscv/runtime-const: Replace open-coded placeholder with RUNTIME_MAGIC Cc: Guo Ren , K Prateek Nayak , "Peter Zijlstra (Intel)" , Charlie Jenkins , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260728052540.4728-5-kprateek.nayak@amd.com> References: <20260728052540.4728-5-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: <178531891411.112641.4657286786896320109.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: ee10b1028129a73857593801614d5bf75a15b9c7 Gitweb: https://git.kernel.org/tip/ee10b1028129a73857593801614d5bf75a1= 5b9c7 Author: K Prateek Nayak AuthorDate: Tue, 28 Jul 2026 05:25:36=20 Committer: Peter Zijlstra CommitterDate: Tue, 28 Jul 2026 13:07:15 +02:00 riscv/runtime-const: Replace open-coded placeholder with RUNTIME_MAGIC Define the placeholder used for lui + addi[w] patching sequence as RUNTIME_MAGIC and use that instead of open coding the constants in the inline assembly. No functional changes intended. Suggested-by: Guo Ren Signed-off-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Charlie Jenkins Reviewed-by: Guo Ren Tested-by: Charlie Jenkins Link: https://patch.msgid.link/20260728052540.4728-5-kprateek.nayak@amd.com --- arch/riscv/include/asm/runtime-const.h | 38 +++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/arch/riscv/include/asm/runtime-const.h b/arch/riscv/include/asm/= runtime-const.h index 900db0a..1ce0260 100644 --- a/arch/riscv/include/asm/runtime-const.h +++ b/arch/riscv/include/asm/runtime-const.h @@ -15,21 +15,23 @@ =20 #include =20 +#define RUNTIME_MAGIC __ASM_STR(0x89ABCDEF) + #ifdef CONFIG_32BIT -#define runtime_const_ptr(sym) \ -({ \ - typeof(sym) __ret; \ - asm_inline(".option push\n\t" \ - ".option norvc\n\t" \ - "1:\t" \ - "lui %[__ret],0x89abd\n\t" \ - "addi %[__ret],%[__ret],-0x211\n\t" \ - ".option pop\n\t" \ - ".pushsection runtime_ptr_" #sym ",\"a\"\n\t" \ - ".long 1b - .\n\t" \ - ".popsection" \ - : [__ret] "=3Dr" (__ret)); \ - __ret; \ +#define runtime_const_ptr(sym) \ +({ \ + typeof(sym) __ret; \ + asm_inline(".option push\n\t" \ + ".option norvc\n\t" \ + "1:\t" \ + "lui %[__ret], %%hi(" RUNTIME_MAGIC ")\n\t" \ + "addi %[__ret],%[__ret], %%lo(" RUNTIME_MAGIC ")\n\t" \ + ".option pop\n\t" \ + ".pushsection runtime_ptr_" #sym ",\"a\"\n\t" \ + ".long 1b - .\n\t" \ + ".popsection" \ + : [__ret] "=3Dr" (__ret)); \ + __ret; \ }) #else /* @@ -46,10 +48,10 @@ ".option push\n\t" \ ".option norvc\n\t" \ "1:\t" \ - "lui %[__ret],0x89abd\n\t" \ - "lui %[__tmp],0x1234\n\t" \ - "addiw %[__ret],%[__ret],-0x211\n\t" \ - "addiw %[__tmp],%[__tmp],0x567\n\t" \ + "lui %[__ret], %%hi(" RUNTIME_MAGIC ")\n\t" \ + "lui %[__tmp], %%hi(" RUNTIME_MAGIC ")\n\t" \ + "addiw %[__ret],%[__ret], %%lo(" RUNTIME_MAGIC ")\n\t" \ + "addiw %[__tmp],%[__tmp], %%lo(" RUNTIME_MAGIC ")\n\t" \ =20 #define RISCV_RUNTIME_CONST_64_BASE \ "slli %[__tmp],%[__tmp],32\n\t" \