[PATCH] um: Abandon the _PAGE_NEWPROT bit

Tiwei Bie tiwei.btw at antgroup.com
Fri Oct 11 01:53:38 PDT 2024


Hi,

On 2024/10/11 15:39, Benjamin Berg wrote:
> Hi,
> 
> On Fri, 2024-10-11 at 13:38 +0800, Tiwei Bie wrote:
>> When a PTE is updated in the page table, the _PAGE_NEWPAGE bit will
>> always be set. And the corresponding page will always be mapped or
>> unmapped depending on whether the PTE is present or not. The check
>> on the _PAGE_NEWPROT bit is not really reachable. Abandoning it will
>> allow us to simplify the code and remove the unreachable code.
> 
> Oh, nice cleanup!
> 
> And I like that mprotect is gone as I don't want it in SECCOMP mode :-)
> 
> Maybe we should rename _PAGE_NEWPAGE to something like _PAGE_NEEDSYNC?
> I think that might make it more clear how everything ties together.

Good idea! Will do.

> 
> Anyway, the change looks good to me.
> 
> Benjamin
> 
> Reviewed-by: Benjamin Berg <benjamin.berg at intel.com>

Thanks! :)

Regards,
Tiwei



More information about the linux-um mailing list