RFC: extern illegal instruction trap and trap RDCYCLE

Palmer Dabbelt palmer at dabbelt.com
Tue Sep 17 06:46:30 PDT 2024


On Tue, 17 Sep 2024 06:08:50 PDT (-0700), ben.dooks at codethink.co.uk wrote:
> This is a RFC series to change how the illegal instruction trap
> is handled and then how to trap RDCYCLE and emulate it with RDTIME
> instead.

Only 1/3 made it to lore for me, not sure if it's just stuck somewhere.

>
> I did this when we found multiple libraries using RDCYCLE and
> upgrading multiple runners to newer kernels caused many problems

OK, so I think we're kind of just stuck with RDCYCLE then -- it was part 
of the base ISA when we merged the port, and every time it disappears 
we end up breaking userspace.

I'm not sure what exactly the right way to do this is: IIRC there's some 
perf-related hooks for this, but there's also systems that just don't 
implement the RDCYCLE instruction at all and thus we'll need some sort 
of emulation for those.

So hopefully the other two patches get through the lists at some point, 
but I think in general this is a reasonable thing to do -- or I guess 
maybe a completely unreasonable thing to be stuck needing to do, but no 
way around it ;)

>
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv



More information about the linux-riscv mailing list