mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Klara Modin <klarasmodin@gmail.com>
To: Charlie Jenkins <charlie@rivosinc.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH FOR-NEXT] riscv: Add norvc after .option arch in runtime const
Date: Mon, 31 Mar 2025 21:39:50 +0200	[thread overview]
Message-ID: <256412b3-9878-41be-8a22-78d5356b8479@gmail.com> (raw)
In-Reply-To: <20250331-fix_runtime_const_norvc-v1-1-89bc62687ab8@rivosinc.com>

On 2025-03-31 20:45, Charlie Jenkins wrote:
> .option arch clobbers .option norvc. Prevent gas from emitting
> compressed instructions in the runtime const alternative blocks by
> setting .option norvc after .option arch. This issue starts appearing on
> gcc 15, which adds zca to the march.
> 
> Reported by: Klara Modin <klarasmodin@gmail.com>
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Fixes: a44fb5722199 ("riscv: Add runtime constant support")
> Closes: https://lore.kernel.org/all/cc8f3525-20b7-445b-877b-2add28a160a2@gmail.com/
> ---
>   arch/riscv/include/asm/runtime-const.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/riscv/include/asm/runtime-const.h b/arch/riscv/include/asm/runtime-const.h
> index c07d049fdd5d2999c57d8a90e7363829c5462368..451fd76b881152919f22de8f5c56b51171acbf3c 100644
> --- a/arch/riscv/include/asm/runtime-const.h
> +++ b/arch/riscv/include/asm/runtime-const.h
> @@ -56,6 +56,7 @@
>   #define RISCV_RUNTIME_CONST_64_ZBA				\
>   	".option push\n\t"					\
>   	".option arch,+zba\n\t"					\
> +	".option norvc\n\t"					\
>   	"slli	%[__tmp],%[__tmp],32\n\t"			\
>   	"add.uw %[__ret],%[__ret],%[__tmp]\n\t"			\
>   	"nop\n\t"						\
> @@ -65,6 +66,7 @@
>   #define RISCV_RUNTIME_CONST_64_ZBKB				\
>   	".option push\n\t"					\
>   	".option arch,+zbkb\n\t"				\
> +	".option norvc\n\t"					\
>   	"pack	%[__ret],%[__ret],%[__tmp]\n\t"			\
>   	"nop\n\t"						\
>   	"nop\n\t"						\
> 
> ---
> base-commit: b2117b630c48be69d2782ed79fefe35dcd192ce6
> change-id: 20250331-fix_runtime_const_norvc-407af1f24541

Thanks!

Tested-by: Klara Modin <klarasmodin@gmail.com>

  parent reply	other threads:[~2025-03-31 19:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 18:45 Charlie Jenkins
2025-03-31 18:54 ` Palmer Dabbelt
2025-03-31 19:39 ` Klara Modin [this message]
2025-04-01  9:27 ` Clément Léger
2025-04-01 14:10 ` patchwork-bot+linux-riscv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=256412b3-9878-41be-8a22-78d5356b8479@gmail.com \
    --to=klarasmodin@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=charlie@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®