Re: [patch 1/1] make PROT_WRITE imply PROT_READ

Arjan van de Ven
2006-09-17T20:48:56Z

Chris Wedgwood wrote:
> On Thu, Sep 14, 2006 at 06:39:47PM -0700, akpm@osdl.org wrote:
>
>> Make PROT_WRITE imply PROT_READ for a number of architectures which
>> don't support write only in hardware.
>
> Why don't we WARN where PROT_WRITE is used w/o PROT_READ? Do
> non-trivial or non-contrived applications really use PROT_WRITE and
> assume reads are OK?
>
> It seems once we do this there will be little or no chance of ever
> doing write-only mappings should we want to in the future using this
> mechanism.
>
> We could just update the definition of PROT_WRITE in the userspace
> headers...

btw PROT_WRITE does make sense in principle for MMIO mappings, especially
uncachable ones. Not per se on native hardware, but in the hardware enabled
virtualization (Intel VT or AMD-V) case this suddenly becomes very easily
enforcable and probably even worth enforcing (since in that case the hypervisor
traps on each access to the memory and simulates the instruction anyway;
only writes means it's a lot simpler in terms of IOMMU and cache coherency etc
etc)