[PATCH v2 2/6] riscv: insn: Set sstatus.MXR when reading userspace instruction

Yicong Yang yang.yicong at picoheart.com
Tue Aug 25 00:39:23 PDT 2026


On 8/25/26 8:06 AM, Paul Walmsley wrote:
> Hi,
> 
> On Tue, 28 Jul 2026, Yicong Yang wrote:
> 
>> The __read_insn() uses get_user() to read userspace instructions.
>> Bo Gan noticed that get_user() is insufficient in this case since
>> it's possible for the instruction segment mapped as execute-only
>> and get_user() doesn't have permissions to load it. The architecture
>> provides sstatus.MXR for handling this so set MXR when reading
>> userspace instruction.
> 
> If this patch fixes a bug with the preceding patch, it would
> better just to roll the fix into the original patch.


sure, will squash into previous one.

I used to split the refactor (preceding) and fix (current)
to separate patches for better review.

thanks.



More information about the linux-riscv mailing list