From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 274CDE9128E for ; Thu, 5 Feb 2026 08:09:52 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4f68yk1KWMz2xrk; Thu, 05 Feb 2026 19:09:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770278990; cv=none; b=HmLgnijkprV+eg83E5d7X0SbcytYhe5rADu72Pu+FpylZv8aUVfRxRO9ULjb3D2Io+piwfCLLReQsKCR9dZdFF1DC8D/9vi0yqunBi88057OdtAFaGel753Jbp47siEWWTS0jWMlgN1tuM0dAGWb2JHbzIqc1+/iENmMOGcZ9w2gEGqkPQTIpq6gku9nxTYiYTaEtDSXFfNrv2ymV7FdtnLEzZbnqGUg7Y0zslrDA9tO5tVsX22qoWPVH7+t7v241E1bU2XLrpZDU+38vC6swYftxgxGX2GS95whAsPgtrEnB39am4r8D49OhEVPPkU4Jo7L29lsgS0GU0/W9nrzOw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770278990; c=relaxed/relaxed; bh=j0zOtfOLPNEn9L9ERmStb8da84cpm/uZMBH6mKpx9nM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=aDxZ8wgU8fZROiOuOO/7vnOlcvpjUkyANzGC5k1OWtvAeHZ96FMr7WfyN7faoq6AKl4PxzI4eQNmWPQuMCRk/OkXGvTQMhhe2KuucTgNPM0XyYAVyz/jdmPWCmPk4DNIetH79bdW/lxtJuDgNjsUbaa2S/2xDxTP0KWh3uPaWM/mtJ3jIa8tzceZ8z/BALXKLm/jF0k89g4MVVX6wQeJjJFDPHnfwuSR0t0CoTaVcTpc938tkSyqzNZbpPOzcgp4FTed+1URPNKbwVZusl0nW6tyCxbgqYY13ul/O+svb+CTXVuZbhe8RjbnRSe25y9XXeOfrgHrsHbMROCQBebFAA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pB2e8MNX; dkim-atps=neutral; spf=pass (client-ip=172.234.252.31; helo=sea.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pB2e8MNX; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=172.234.252.31; helo=sea.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4f68yj2k0nz2xg9 for ; Thu, 05 Feb 2026 19:09:49 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 84C9343B8D; Thu, 5 Feb 2026 08:09:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33374C4CEF7; Thu, 5 Feb 2026 08:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770278987; bh=Gk1rpoOJ3qlMNhZI4HdytNI08bOgFElC6mEKS/IYXNY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=pB2e8MNXaRPUmdj792704a5mCJ0O/XIcY+O/2uRB8F5ajnD4PcWkA5KMzKdeEv6lr 1uUJN8R989oRBO7EdhPbQ6DY7ClEQcXN6BH40hSFaFL34sfY2LJiOslN+vusKxUq5M 7AinykT94Vuh8f1ztqhVGOk6b3g7bai93vDS+1Fii6v1Eooi66xu05r+3tGuW9REsC HHy6KSI7JjgIhhbLQNpDPf/rhBrUvbebMayFanIA0pa7w2sSqk3ka0qoG7MqSLq2O7 1TNzuHjjOsM9ii53boG+MXTyhUyTTv1CEpljC4vj5gNuGBrgBzqfZnfe1x8M1yTlje VRvEXr3Tb4PMQ== Message-ID: <306b01a2-caba-4c15-89d4-849c3f4848cb@kernel.org> Date: Thu, 5 Feb 2026 09:09:41 +0100 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 1/3] powerpc/jump_label: adjust inline asm to be consistent To: "Mukesh Kumar Chaurasiya (IBM)" , linkmauve@linkmauve.fr, ojeda@kernel.org, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, corbet@lwn.net, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20260204210125.613350-1-mkchauras@gmail.com> <20260204210125.613350-2-mkchauras@gmail.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260204210125.613350-2-mkchauras@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 04/02/2026 à 22:01, Mukesh Kumar Chaurasiya (IBM) a écrit : > [Vous ne recevez pas souvent de courriers de mkchauras@gmail.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > Added support for a new macro ARCH_STATIC_BRANCH_ASM in powerpc > to avoid duplication of inline asm between C and Rust. This is > inline with commit aecaf181651c '("jump_label: adjust inline asm to be consistent")' > > Signed-off-by: Madhavan Srinivasan > Signed-off-by: Mukesh Kumar Chaurasiya (IBM) Reviewed-by: Christophe Leroy (CS GROUP) > --- > arch/powerpc/include/asm/jump_label.h | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) > > diff --git a/arch/powerpc/include/asm/jump_label.h b/arch/powerpc/include/asm/jump_label.h > index d4eaba459a0e..a6b211502bfe 100644 > --- a/arch/powerpc/include/asm/jump_label.h > +++ b/arch/powerpc/include/asm/jump_label.h > @@ -15,14 +15,20 @@ > #define JUMP_ENTRY_TYPE stringify_in_c(FTR_ENTRY_LONG) > #define JUMP_LABEL_NOP_SIZE 4 > > +#define JUMP_TABLE_ENTRY(key, label) \ > + ".pushsection __jump_table, \"aw\" \n\t" \ > + ".long 1b - ., " label " - . \n\t" \ > + JUMP_ENTRY_TYPE key " - . \n\t" \ > + ".popsection \n\t" > + > +#define ARCH_STATIC_BRANCH_ASM(key, label) \ > + "1: nop \n\t" \ > + JUMP_TABLE_ENTRY(key,label) > + > static __always_inline bool arch_static_branch(struct static_key *key, bool branch) > { > - asm goto("1:\n\t" > - "nop # arch_static_branch\n\t" > - ".pushsection __jump_table, \"aw\"\n\t" > - ".long 1b - ., %l[l_yes] - .\n\t" > - JUMP_ENTRY_TYPE "%c0 - .\n\t" > - ".popsection \n\t" > + asm goto( > + ARCH_STATIC_BRANCH_ASM("%c0", "%l[l_yes]") > : : "i" (&((char *)key)[branch]) : : l_yes); > > return false; > @@ -34,10 +40,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool > { > asm goto("1:\n\t" > "b %l[l_yes] # arch_static_branch_jump\n\t" > - ".pushsection __jump_table, \"aw\"\n\t" > - ".long 1b - ., %l[l_yes] - .\n\t" > - JUMP_ENTRY_TYPE "%c0 - .\n\t" > - ".popsection \n\t" > + JUMP_TABLE_ENTRY("%c0", "%l[l_yes]") > : : "i" (&((char *)key)[branch]) : : l_yes); > > return false; > -- > 2.52.0 >