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

From: Nadav Amit
Date: Thu Jun 16 2016 - 12:43:14 EST



Lukasz Anaczkowski <lukasz.anaczkowski@xxxxxxxxx> wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> +void fix_pte_leak(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
> +{
> + if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids) {
> + trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
This tracing seems incorrect since you donât perform a local flush.
I donât think you need any tracing - native_flush_tlb_others will do it for you.

> + flush_tlb_others(mm_cpumask(mm), mm, addr,
> + addr + PAGE_SIZE);
> + mb();
Why do you need the memory barrier?

Regards,
Nadav