Re: x86-tip.today (4cdf573) early instaboot

From: Tom Lendacky
Date: Tue Apr 10 2018 - 10:07:07 EST


On 04/10/2018 07:37 AM, Mike Galbraith wrote:
> On Tue, 2018-04-10 at 10:59 +0200, Ingo Molnar wrote:
>> * Mike Galbraith <efault@xxxxxx> wrote:
>>
>>> Hi Ingo,
>>>
>>> FYI, my i4790 box reboots immediately.. or close enough to it that you
>>> see nothing at all before again meeting the bios splash. Master with
>>> the ~same config works fine. I haven't poked around yet (work).
>>
>> Hm, so there's been a few 'dangerous' pieces of work merged yesterday-ish.
>>
>> Prime suspects would be:
>>
>> triton:~/tip> gll linus..x86/pti
>>
>> 0564258fb2cf: x86/pti: Leave kernel text global for !PCID
>> a5df4f1f0d78: x86/pti: Never implicitly clear _PAGE_GLOBAL for kernel image
>> e0bb456e3250: x86/pti: Enable global pages for shared areas
>> efad2b415152: x86/mm: Do not forbid _PAGE_RW before init for __ro_after_init
>> 4ddee6efdcd0: x86/mm: Comment _PAGE_GLOBAL mystery
>> e71e836f463d: x86/mm: Remove extra filtering in pageattr code
>> 64c80759408f: x86/mm: Do not auto-massage page protections <== WOOF
>> 6baf4bec02db: x86/espfix: Document use of _PAGE_GLOBAL
>> 8a57f4849f4f: x86/mm: Introduce "default" kernel PTE mask
>> 606c7193d5fb: x86/mm: Undo double _PAGE_PSE clearing
>> d1440b23c922: x86/mm: Factor out pageattr _PAGE_GLOBAL setting
>> ee1400dda318: Merge branch 'linus' into x86/pti to pick up upstream changes
>> 071ccc966ba5: x86/entry/64: Drop idtentry's manual stack switch for user entries
>> 9820e1c3376c: x86/uapi: Fix asm/bootparam.h userspace compilation errors
>>
>> ... which you could test via 0564258fb2cf: if that insta-reboots too then
>> 9820e1c3376c^1 is expected to work and 4 bisection steps should pinpoint the
>> guilty commit ...
>
> Thanks. I already had a full bisect running, so ended up doing more
> than 4 steps, but ended up at the above.

Just out of curiosity, can you try the following patch and see if it
fixes your reboot issue:

diff --git a/arch/x86/boot/compressed/kaslr.c
b/arch/x86/boot/compressed/kaslr.c
index c5196d2..a0a50b9 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -55,7 +55,7 @@
extern unsigned long get_cmd_line_ptr(void);

/* Used by PAGE_KERN* macros: */
-pteval_t __default_kernel_pte_mask __read_mostly;
+pteval_t __default_kernel_pte_mask __read_mostly = ~0;

/* Simplified build-specific string for starting entropy. */
static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"

Thanks,
Tom

>
> -Mike
>