forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork1
Commitf23d74f
x86/mm: Rework wbinvd, hlt operation in stop_this_cpu()
Some issues have been reported with the for loop in stop_this_cpu() thatissues the 'wbinvd; hlt' sequence. Reverting this sequence to halt()has been shown to resolve the issue.However, the wbinvd is needed when running with SME. The reason for thewbinvd is to prevent cache flush races between encrypted and non-encryptedentries that have the same physical address. This can occur whenkexec'ing from memory encryption active to inactive or vice-versa. Theimportant thing is to not have outside of kernel text memory references(such as stack usage), so the usage of the native_*() functions is neededsince these expand as inline asm sequences. So instead of reverting thechange, rework the sequence.Move the wbinvd instruction outside of the for loop as native_wbinvd()and make its execution conditional on X86_FEATURE_SME. In the for loop,change the asm 'wbinvd; hlt' sequence back to a halt sequence but usethe native_halt() call.Fixes:bba4ed0 ("x86/mm, kexec: Allow kexec to be used with SME")Reported-by: Dave Young <dyoung@redhat.com>Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Tested-by: Dave Young <dyoung@redhat.com>Cc: Juergen Gross <jgross@suse.com>Cc: Tony Luck <tony.luck@intel.com>Cc: Yu Chen <yu.c.chen@intel.com>Cc: Baoquan He <bhe@redhat.com>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: kexec@lists.infradead.orgCc: ebiederm@redhat.comCc: Borislav Petkov <bp@alien8.de>Cc: Rui Zhang <rui.zhang@intel.com>Cc: Arjan van de Ven <arjan@linux.intel.com>Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>Cc: Dan Williams <dan.j.williams@intel.com>Cc: stable@vger.kernel.orgLink:https://lkml.kernel.org/r/20180117234141.21184.44067.stgit@tlendack-t1.amdoffice.net1 parent1d966eb commitf23d74f
1 file changed
+15
-10
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
380 | 380 |
| |
381 | 381 |
| |
382 | 382 |
| |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
383 | 394 |
| |
384 | 395 |
| |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
391 |
| - | |
392 |
| - | |
393 |
| - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
394 | 399 |
| |
395 |
| - | |
| 400 | + | |
396 | 401 |
| |
397 | 402 |
| |
398 | 403 |
| |
|
0 commit comments
Comments
(0)