projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eab696d
)
x86/boot/compressed/64: Reload CS in startup_32
author
Joerg Roedel
<jroedel@suse.de>
Wed, 10 Mar 2021 08:43:20 +0000
(09:43 +0100)
committer
Borislav Petkov
<bp@suse.de>
Thu, 18 Mar 2021 15:44:43 +0000
(16:44 +0100)
Exception handling in the startup_32 boot path requires the CS
selector to be correctly set up. Reload it from the current GDT.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link:
https://lkml.kernel.org/r/20210312123824.306-4-joro@8bytes.org
arch/x86/boot/compressed/head_64.S
patch
|
blob
|
history
diff --git
a/arch/x86/boot/compressed/head_64.S
b/arch/x86/boot/compressed/head_64.S
index e94874f4bbc1d2e563ba76fd74145a8e137b2fc7..c59c80ca546d7371aa15c3182e92148441635c2b 100644
(file)
--- a/
arch/x86/boot/compressed/head_64.S
+++ b/
arch/x86/boot/compressed/head_64.S
@@
-107,9
+107,16
@@
SYM_FUNC_START(startup_32)
movl %eax, %gs
movl %eax, %ss
-
/* setup a stack and make sure cpu supports long mode.
*/
+
/* Setup a stack and load CS from current GDT
*/
leal rva(boot_stack_end)(%ebp), %esp
+ pushl $__KERNEL32_CS
+ leal rva(1f)(%ebp), %eax
+ pushl %eax
+ lretl
+1:
+
+ /* Make sure cpu supports long mode. */
call verify_cpu
testl %eax, %eax
jnz .Lno_longmode