Re: [PATCH v2] mm: fix double page fault on arm64 if PTE_AF is cleared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote:
>  		 * This really shouldn't fail, because the page is there
>  		 * in the page tables. But it might just be unreadable,
>  		 * in which case we just give up and fill the result with
> -		 * zeroes.
> +		 * zeroes. If PTE_AF is cleared on arm64, it might
> +		 * cause double page fault. So makes pte young here

How about:
		 * zeroes. On architectures with software "accessed" bits,
		 * we would take a double page fault here, so mark it
		 * accessed here.

>  		 */
> +		if (!pte_young(vmf->orig_pte)) {

Let's guard this with:

		if (arch_sw_access_bit && !pte_young(vmf->orig_pte)) {

#define arch_sw_access_bit	0
by default and have arm64 override it (either to a variable or a constant
... your choice).  Also, please somebody decide on a better name than
arch_sw_access_bit.

> +			entry = pte_mkyoung(vmf->orig_pte);
> +			if (ptep_set_access_flags(vmf->vma, vmf->address,
> +				vmf->pte, entry, 0))

This indentation is wrong; it makes vmf->pte look like part of the subsequent
statement instead of part of the condition.

> +				update_mmu_cache(vmf->vma, vmf->address,
> +						vmf->pte);
> +		}
> +




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux