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
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, _
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
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
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