Re: [PATCH] um: Abandon the _PAGE_NEWPROT bit

From: Tiwei Bie
Date: Fri Oct 11 2024 - 04:53:59 EST


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@xxxxxxxxx>

Thanks! :)

Regards,
Tiwei