diff options
author | LuckTony <[email protected]> | 2018-08-31 09:55:06 -0700 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2018-09-01 14:59:19 +0200 |
commit | c7486104a5ce7e8763e3cb5157bba8d0f1468d87 (patch) | |
tree | 2ee0f08523889787829bf370b0f3566855dd0f01 /arch/x86/kernel/cpu/microcode/amd.c | |
parent | eeb89e2bb1ac45b0836d4170e97a988c3a746c62 (diff) |
x86/mce: Fix set_mce_nospec() to avoid #GP fault
The trick with flipping bit 63 to avoid loading the address of the 1:1
mapping of the poisoned page while the 1:1 map is updated used to work when
unmapping the page. But it falls down horribly when attempting to directly
set the page as uncacheable.
The problem is that when the cache mode is changed to uncachable, the pages
needs to be flushed from the cache first. But the decoy address is
non-canonical due to bit 63 flipped, and the CLFLUSH instruction throws a
#GP fault.
Add code to change_page_attr_set_clr() to fix the address before calling
flush.
Fixes: 284ce4011ba6 ("x86/memory_failure: Introduce {set, clear}_mce_nospec()")
Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Linus Torvalds <[email protected]>
Cc: Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: linux-edac <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Dave Jiang <[email protected]>
Link: https://lkml.kernel.org/r/20180831165506.GA9605@agluck-desk
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/amd.c')
0 files changed, 0 insertions, 0 deletions