Re: [PATCH] um: Abandon the _PAGE_NEWPROT bit

2024-10-11 Thread Tiwei Bie
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 pres

Re: [PATCH] um: Abandon the _PAGE_NEWPROT bit

2024-10-11 Thread Tiwei Bie
Hi Johannes, On 2024/10/11 15:38, Johannes Berg wrote: > Hi Tiwei, > > So kind of a nit, but if the resulting code looks like this: > >> @@ -184,17 +172,14 @@ static inline pte_t pte_wrprotect(pte_t pte) >> { >> if (likely(pte_get_bits(pte, _PAGE_RW))) >> pte_clear_bits(pte, _

Re: [PATCH] um: Abandon the _PAGE_NEWPROT bit

2024-10-11 Thread Benjamin Berg
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

Re: [PATCH] um: Abandon the _PAGE_NEWPROT bit

2024-10-11 Thread Johannes Berg
Hi Tiwei, So kind of a nit, but if the resulting code looks like this: > @@ -184,17 +172,14 @@ static inline pte_t pte_wrprotect(pte_t pte) > { > if (likely(pte_get_bits(pte, _PAGE_RW))) > pte_clear_bits(pte, _PAGE_RW); > return pte; > } then the if really isn't neede

[PATCH] um: Abandon the _PAGE_NEWPROT bit

2024-10-10 Thread Tiwei Bie
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 cod