Re: [PATCH v2] Linux VM workaround for Knights Landing A/D leak

From: Nadav Amit
Date: Tue Jun 14 2016 - 14:38:15 EST


Lukasz Anaczkowski <lukasz.anaczkowski@xxxxxxxxx> wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

> static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> unsigned long addr, pte_t *ptep)
> {
> - return ptep_get_and_clear(mm, addr, ptep);
> + pte_t pte = ptep_get_and_clear(mm, addr, ptep);
> +
> + if (boot_cpu_has_bug(X86_BUG_PTE_LEAK))
> + fix_pte_leak(mm, addr, ptep);
> + return pte;
> }

I missed it on the previous iteration: ptep_get_and_clear already calls
fix_pte_leak when needed. So do you need to call it again here?

Thanks,
Nadav