Re: [PATCH v2] riscv: Make mmap() with PROT_WRITE imply PROT_READ

From: Celeste Liu
Date: Fri Sep 09 2022 - 11:45:48 EST


On 2022/9/9 23:16, Andrew Bresticker wrote>
> I think leaving the PROT_WRITE-implies-PROT_READ as being specified as
> architecture-dependent is reasonable, but of course portable programs
> shouldn't rely on this behavior. There are CPUs out there that support
> write-only mappings -- MIPS with RI/XI comes to mind and indeed
> mmap(PROT_WRITE) on such CPUs results in write-only mappings.
>
> -Andrew
>

Ok, I have no question now. This patch looks good to me.

This feature shouldn't be relied upon indeed, as it depends on the specific
hardware implementation.

Thanks for your explanation!

Yours,
Celeste Liu