x86/mm/cpa: Fix set_mce_nospec()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 8 Feb 2019 12:08:59 +0000 (13:08 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 8 Feb 2019 13:31:56 +0000 (14:31 +0100)
commit0521e8be211cd20d547bff9da2534b7ed6f2c1b9
tree8310e4114dde040bc1b5080e13b7143c1d56bafe
parent45b13b424faafb81c8c44541f093a682fdabdefc
x86/mm/cpa: Fix set_mce_nospec()

The recent commit fe0937b24ff5 ("x86/mm/cpa: Fold cpa_flush_range() and
cpa_flush_array() into a single cpa_flush() function") accidentally made
the call to make_addr_canonical_again() go away, which breaks
set_mce_nospec().

Re-instate the call to convert the address back into canonical form right
before invoking either CLFLUSH or INVLPG. Rename the function while at it
to be shorter (and less MAGA).

Fixes: fe0937b24ff5 ("x86/mm/cpa: Fold cpa_flush_range() and cpa_flush_array() into a single cpa_flush() function")
Reported-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tony Luck <tony.luck@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Rik van Riel <riel@surriel.com>
Link: https://lkml.kernel.org/r/20190208120859.GH32511@hirez.programming.kicks-ass.net
arch/x86/mm/pageattr.c