mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
x86/ibt: Fix hibernate
Todd reported, and Len confirmed, that commit582077c940
("x86/cfi: Clean up linkage") broke S4 hiberate on a fair number of machines. Turns out these machines trip #CP when trying to restore the image. As it happens, the commit in question removes two ENDBR instructions in the hibernate code, and clearly got it wrong. Notably restore_image() does an indirect jump to relocated_restore_code(), which is a relocated copy of core_restore_code(). In turn, core_restore_code(), will at the end do an indirect jump to restore_jump_address (r8), which is pointing at a relocated restore_registers(). So both sites do indeed need to be ENDBR. Fixes:582077c940
("x86/cfi: Clean up linkage") Reported-by: Todd Brandt <todd.e.brandt@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Todd Brandt <todd.e.brandt@intel.com> Tested-by: Len Brown <len.brown@intel.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219998 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219998
This commit is contained in:
parent
f0df00ebc5
commit
1fac13956e
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
|||
/* code below belongs to the image kernel */
|
||||
.align PAGE_SIZE
|
||||
SYM_FUNC_START(restore_registers)
|
||||
ANNOTATE_NOENDBR
|
||||
ENDBR
|
||||
/* go back to the original page tables */
|
||||
movq %r9, %cr3
|
||||
|
||||
|
@ -120,7 +120,7 @@ SYM_FUNC_END(restore_image)
|
|||
|
||||
/* code below has been relocated to a safe page */
|
||||
SYM_FUNC_START(core_restore_code)
|
||||
ANNOTATE_NOENDBR
|
||||
ENDBR
|
||||
/* switch to temporary page tables */
|
||||
movq %rax, %cr3
|
||||
/* flush TLB */
|
||||
|
|
Loading…
Add table
Reference in a new issue