Re: [RFC] rust: kernel: Add KUnit tests for ARCH_WARN_ASM bug table emission

From: Heiko Carstens

Date: Fri Sep 25 2026 - 04:45:39 EST


On Fri, Sep 25, 2026 at 12:06:28PM +0530, Mukesh Kumar Chaurasiya wrote:
> On Thu, Sep 24, 2026 at 05:13:35PM +0200, Heiko Carstens wrote:
> > On Thu, Sep 24, 2026 at 01:15:57PM +0200, Peter Zijlstra wrote:
> > > Untested thingies for arm64 and s390x.
> > > int is_valid_bugaddr(unsigned long addr)
> > > {
> > > - return 1;
> > > + u16 insn;
> > > +
> > > + if (get_kernel_nofault(insn, (u16 *)addr))
> > > + return 0;
> > > +
> > > + return insn == 0x0001 || insn == 0x000e;
> >
> > I have no idea why anybody wants to do this, but it looks like I'm not
> > alone :) In any case: the check is wrong.
> > s390 uses only the monitor call instruction and this should be
> >
> > return insn == 0xaf00;
>
> should i send this out along with ppc. I am not paricularly very good
> with s390's assembly, but if this looks correct to you, i can send it
> out.

No, I still don't get what this fixes, or what the improvement would be
(also not after reading you reply to Mark). The current code is fine for
s390. Unless there is a pressing need I'd like to keep it as it is.