On Thu, Feb 07, 2019 at 06:57:20PM +0100, Peter Zijlstra wrote:
> Something like so then? AFAICT CLFLUSH will also #GP if feed it crap.

Correct. CFLUSH will also #GP on a non-canonical address.

> -             __flush_tlb_one_kernel(__cpa_addr(cpa, i));
> +             __flush_tlb_one_kernel(fix_addr(__cpa_addr(cpa, i)));


> -                     clflush_cache_range_opt((void *)addr, PAGE_SIZE);
> +                     clflush_cache_range_opt((void *)fix_addr(addr), 
> PAGE_SIZE);

Looks like as close as you can get without being crazy. Many/most
of the apparent function calls here are going to be inlined. So
likely safe.

Tried it out and it works!

So:

Tested-by: Tony Luck <tony.l...@intel.com>

Thanks

-Tony

Reply via email to