diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2018-02-26 21:04:49 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-12 09:37:25 +0100 |
commit | fb5268354d20b82c12569e325b0d051c09f983f7 (patch) | |
tree | 2fb2e6d3037ae0ed36a0bb6a2b31671c6f0df261 /arch/x86/boot/compressed/head_64.S | |
parent | 3548e131ec6a82208f36e68d31947b0fe244c7a7 (diff) | |
download | blackbird-op-linux-fb5268354d20b82c12569e325b0d051c09f983f7.tar.gz blackbird-op-linux-fb5268354d20b82c12569e325b0d051c09f983f7.zip |
x86/boot/compressed/64: Save and restore trampoline memory
The memory area we found for trampoline shouldn't contain anything
useful. But let's preserve the data anyway. Just to be on safe side.
paging_prepare() would save the data into a buffer.
cleanup_trampoline() would restore it back once we are done with the
trampoline.
Tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180226180451.86788-4-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/boot/compressed/head_64.S')
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index d598d65db32c..8ba0582c65d5 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -355,6 +355,16 @@ ENTRY(startup_64) lretq lvl5: + /* + * cleanup_trampoline() would restore trampoline memory. + * + * RSI holds real mode data and needs to be preserved across + * this function call. + */ + pushq %rsi + call cleanup_trampoline + popq %rsi + /* Zero EFLAGS */ pushq $0 popfq |