linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 4.17.x won't boot due to "x86/boot/compressed/64: Handle 5-level paging boot if kernel is above 4G"
@ 2018-07-25 17:26 Dmitry Malkin
  2018-07-25 21:21 ` Kirill A. Shutemov
  0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Malkin @ 2018-07-25 17:26 UTC (permalink / raw)
  To: linux-x86_64, linux-kernel, Kirill A. Shutemov, Ingo Molnar,
	Thomas Gleixner, H. Peter Anvin, x86

there may be some other reasons which may cause undefined behavior 
(reboot for example):

in arch/x86/boot/compressed/pgtable_64.c in function paging_prepare():

1. structure "paging_config" allocated on stack without setting default 
value for flag "l5_required":
 >>struct paging_config paging_config = {};
l5_required is set only if CONFIG_X86_5LEVEL is defined

2. reading from memory which may be reserved in case of EFI systems:
 >>    ebda_start = *(unsigned short *)0x40e << 4;
 >>    bios_start = *(unsigned short *)0x413 << 10;
Also, on EFI system without CSM it will results in all zeros. Which will 
place trampoline_start to 0x9d000. And it also may be reserved memory. 
In fact I have such system and it is causes instant reboot (when code 
starts copying to "trampoline_start").

3. paging_prepare(void) returns "struct paging_config". Copy by value. 
Is it really specified by ABI or GCC itself that the second field (which 
is flag "l5_required") will go to RDX register?




^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2018-07-27 13:46 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAF=P+=5c-baQp-CK1ViG8h=mMRv6d3EgEsN_U4rbBx-Pwv_Krw@mail.gmail.com>
2018-07-01 21:32 ` 4.17.x won't boot due to "x86/boot/compressed/64: Handle 5-level paging boot if kernel is above 4G" Benjamin Gilbert
2018-07-02  9:34   ` Kirill A. Shutemov
2018-07-02 19:01     ` Benjamin Gilbert
2018-07-03  8:30       ` Kirill A. Shutemov
2018-07-03  8:59         ` Thomas Gleixner
2018-07-03 11:01           ` Kirill A. Shutemov
2018-07-03 11:24   ` Gabriel C
2018-07-03 12:44     ` Kirill A. Shutemov
2018-07-03 14:02       ` Thomas Gleixner
2018-07-03 14:07         ` Bernhard Rosenkraenzer
2018-07-03 14:19           ` Thomas Gleixner
2018-07-03 14:21       ` Kirill A. Shutemov
2018-07-03 14:27         ` Thomas Gleixner
2018-07-03 18:03         ` Andi Kleen
2018-07-03 20:26           ` Kirill A. Shutemov
2018-07-03 21:00             ` Andi Kleen
2018-07-04  3:10         ` Benjamin Gilbert
2018-07-04 13:21           ` Kirill A. Shutemov
2018-07-04 15:08         ` Kirill A. Shutemov
2018-07-04 20:42           ` Benjamin Gilbert
2018-07-06  6:37           ` Masahiro Yamada
2018-07-06 10:41             ` Kirill A. Shutemov
2018-07-06 14:13               ` Masahiro Yamada
2018-07-06 14:39                 ` Gabriel C
2018-07-06 16:33                   ` Kirill A. Shutemov
2018-07-06 17:31                     ` Gabriel C
2018-07-07  0:55                   ` Masahiro Yamada
2018-07-06 16:29                 ` Kirill A. Shutemov
2018-07-06 18:11                   ` Andi Kleen
2018-07-06 19:34                     ` Benjamin Gilbert
2018-07-07  1:21                   ` Masahiro Yamada
2018-07-09 10:10                     ` Kirill A. Shutemov
2018-07-09 10:37                       ` Masahiro Yamada
2018-07-25 17:26 Dmitry Malkin
2018-07-25 21:21 ` Kirill A. Shutemov
2018-07-26  8:10   ` Dmitry Malkin
2018-07-26 14:50     ` Kirill A. Shutemov
2018-07-26 16:21       ` Dmitry Malkin
2018-07-27 13:46         ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).