Re: [PATCH v3] alpha: Add support for HAVE_ARCH_JUMP_LABEL

From: Magnus Lindholm

Date: Sat Nov 14 2026 - 12:46:53 EST


Hi Matt,

On Sat, Nov 14, 2026 at 5:54 PM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> On Sat, Nov 14, 2026 at 4:48 AM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> > diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
> > index 850f1265cc55..4088cd56866e 100644
> > --- a/arch/alpha/kernel/Makefile
> > +++ b/arch/alpha/kernel/Makefile
> > @@ -92,3 +92,5 @@ obj-$(CONFIG_ALPHA_TITAN) += err_ev6.o err_titan.o
> > obj-$(CONFIG_ALPHA_TSUNAMI) += err_ev6.o err_tsunami.o
> >
> > endif # GENERIC
> > +
> > +obj-$(CONFIG_JUMP_LABEL) += jump_label.o
>
> Nit: this would read better up with the other unconditional obj-
> lines near the top of the file rather than trailing the GENERIC
> block.
>
> > +#include <linux/jump_label.h>
> > +#include <linux/kernel.h>
> > +#include <asm/cacheflush.h>
>
> Nit: checkpatch --strict suggests <linux/cacheflush.h> here.
>
> > + if (WARN_ON_ONCE(disp < -(1L << 20) || disp > ((1L << 20) - 1)))
> > + return false;
>
> Thanks. The target is always within the same function and Alpha gcc
> doesn't do hot/cold partitioning, so I don't expect this to fire, but
> it's a cheap safety net.
>
> > +static inline void alpha_patch_text(u32 *site, u32 insn)
> > +{
> > + WRITE_ONCE(*site, insn);
> > + /*
> > + * Alpha needs an I-cache sync after patching executable text.
> > + */
> > + flush_icache_range((unsigned long)site, (unsigned long)site + sizeof(*site));
> > +}
>
> On SMP this is smp_imb(), so every key flip IPIs all CPUs once per
> site. That's correct, and fine as a starting point; batching via
> arch_jump_label_transform_queue()/_apply() would be the natural
> follow-up you mention in the cover letter.
>
> I applied this on 0b4cadbe7c39 and cross-built an SMP defconfig with
> JUMP_LABEL and STATIC_KEYS_SELFTEST at W=1 with no new warnings. The
> patch sites in vmlinux are the expected 0x47ff041f nops with nearby
> targets.
>
> The diffstat in the cover letter is stale (63/146 vs. 65/148 in the
> patch), but that doesn't matter for applying.
>
> None of the above needs a respin from my side.
>
> Reviewed-by: Matt Turner <mattst88@xxxxxxxxx>

Thanks for reviewing and build-testing this. I'll fix the Makefile
placement and cacheflush include when applying it, and refresh the
cover-letter diffstat. Batching can remain a follow-up.

The boot selftest and 30 module load/unload cycles also passed on
my three-CPU ES40, including cross-module static keys.

Thanks,
Magnus