Re: [PATCH 2/4] x86/mm/cpa: Fix cpa_flush_array()

From: Dave Hansen
Date: Fri Nov 30 2018 - 12:43:19 EST


> +void __cpa_flush_array(void *data)
> {
> - unsigned int i, level;
> + struct cpa_data *cpa = data;
> + unsigned int i;
>
> - if (__cpa_flush_range(baddr, numpages, cache))
> + for (i = 0; i < cpa->numpages; i++)
> + __flush_tlb_one_kernel(__cpa_addr(cpa, i));
> +}

While I guess it won't _hurt_ anything, we do have cases where
__cpa_addr() can return 0. So, won't this be flushing virtual address
0x0 unnecessarily for those?