Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

From: Christoph Hellwig
Date: Tue Feb 01 2022 - 02:45:06 EST


On Mon, Jan 31, 2022 at 09:50:58PM +0800, Guo Ren wrote:
> On Mon, Jan 31, 2022 at 8:26 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> >
> > Given that most rv64 implementations can't run in rv32 mode, what is the
> > failure mode if someone tries it with the compat mode enabled?
> A static linked simple hello_world could still run on a non-compat
> support hardware. But most rv32 apps would meet different userspace
> segment faults.
>
> Current code would let the machine try the rv32 apps without detecting
> whether hw support or not.

Hmm, we probably want some kind of check for not even offer running
rv32 binaries. I guess trying to write UXL some time during early
boot and catching the resulting exception would be the way to go?

>
>
> --
> Best Regards
> Guo Ren
>
> ML: https://lore.kernel.org/linux-csky/
---end quoted text---