Re: [PATCH] mm: Fix PTE_AF handling in fault path on architectures with HW AF support

From: Yin, Fengwei
Date: Tue Jul 09 2024 - 21:08:51 EST




On 7/10/2024 8:09 AM, Ram Tummala wrote:
The polarity of prefault calculation is incorrect. This leads to prefault
being incorrectly set for the faulting address. The following if check will
incorrectly clear the PTE_AF bit instead of setting it and the access will
fault again on the same address due to the missing PTE_AF bit.

if (prefault && arch_wants_old_prefaulted_pte())
entry = pte_mkold(entry);

I have same confusion as Matthew about the PTE_AF.

But I think this is a good catch as old code is like:
bool prefault = vmf->address != addr;

Sorry for the issue by me. And

Reviewed-by: Yin Fengwei <fengwei.yin@xxxxxxxxx>


Regards
Yin, Fengwei