Re: [PATCH v3 2/4] s390/jump_label: Implement ARCH_STATIC_BRANCH_JUMP_ASM and ARCH_STATIC_BRANCH_ASM macros
From: Jan Polensky
Date: Wed May 27 2026 - 17:30:52 EST
On Wed, May 27, 2026 at 05:57:58AM +0000, Alice Ryhl wrote:
> On Thu, May 21, 2026 at 06:56:20PM +0200, Jan Polensky wrote:
> > Rust static branch support needs the s390 jump label instruction sequence
> > and __jump_table emission in a reusable form. The current implementation
> > embeds the sequence directly in the C asm goto blocks, which cannot be
> > shared with Rust.
> >
> > Introduce ARCH_STATIC_BRANCH_ASM and ARCH_STATIC_BRANCH_JUMP_ASM to
> > describe the brcl sequences for the likely-false and likely-true cases
> > and to emit the same __jump_table entries as before. Switch the existing
> > C helpers to use the new macros to avoid duplication without changing
> > the generated code.
> >
> > Signed-off-by: Jan Polensky <japo@xxxxxxxxxxxxx>
>
> This looks right.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
> Did you test it?
>
> Alice
Hi Alice,
yes, I tested it.
I used a small Rust sample module to exercise and validate the
behavior on s390. The patch is attached for reference. I did not
include the sample in this series.
It was not only rust I've used, my samples are not part of this series
(attached):
❯ readelf -SW samples/rust/rust_jump_label.ko | egrep '__jump_table|text|rela'
[ 2] .rela__ksymtab RELA 0000000000000000 06c298 000048 18 I 46 1 8
[ 5] __jump_table PROGBITS 0000000000000000 000060 000010 00 WA 0 0 8
[ 6] .rela__jump_table RELA 0000000000000000 06c2e0 000048 18 I 46 5 8
[ 7] .text PROGBITS 0000000000000000 000070 0001bc 00 AX 0 0 16
[ 8] .rela.text RELA 0000000000000000 06c328 000228 18 I 46 7 8
[ 9] .exit.text PROGBITS 0000000000000000 000230 00003c 00 AX 0 0 16
[10] .rela.exit.text RELA 0000000000000000 06c550 000060 18 I 46 9 8
[11] .init.text PROGBITS 0000000000000000 000270 000026 00 AX 0 0 16
[12] .rela.init.text RELA 0000000000000000 06c5b0 000018 18 I 46 11 8
[16] .rela.gnu.linkonce.this_module RELA 0000000000000000 06c5c8 000030 18 I 46 15 8
[20] .rela.init.data RELA 0000000000000000 06c5f8 000018 18 I 46 19 8
[22] .rela.exit.data RELA 0000000000000000 06c610 000018 18 I 46 21 8
[32] .rela.debug_aranges RELA 0000000000000000 06c628 000108 18 I 46 31 8
[34] .rela.debug_info RELA 0000000000000000 06c730 0573f0 18 I 46 33 8
[37] .rela.debug_line RELA 0000000000000000 0c3b20 000048 18 I 46 36 8
[39] .rela.debug_frame RELA 0000000000000000 0c3b68 000120 18 I 46 38 8
[42] .rela.debug_loc RELA 0000000000000000 0c3c88 000150 18 I 46 41 8
[44] .rela.debug_ranges RELA 0000000000000000 0c3dd8 000300 18 I 46 43 8
Best regards,
Jan