Re: [BUG] GPF on reboot of box
From: Andy Lutomirski
Date: Sat Oct 07 2017 - 18:50:02 EST
On Sat, Oct 7, 2017 at 6:36 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> [ Replying from an actual computer this time ]
>
> On Fri, 6 Oct 2017 19:21:26 -0700
> Nadav Amit <nadav.amit@xxxxxxxxx> wrote:
>
>> IIRC, there was a problem in rc1, which should be resolved in newer rcs.
>> If you need to run rc1, you can try to use the kernel parameter ânopcid".
>
> I noticed the bug when I rebased my work on top of rc3 and started
> testing that. I only mentioned rc1 because that's the first tagged
> release that had the bug in it. If it is fixed in a later release, then
> great! But I don't see that as the case (I haven't tested work on top
> of rc3).
>
> I'd like to have this fixed without having to do workarounds like
> adding nopcid to the kernel command line. If it is a bug for me, I'm
> sure it's going to be a bug for many others that wont know how to
> complain about it.
>
Howdy, batman! Can you try the attached patch?
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 54180fa6f66f..add33f600531 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -105,6 +105,10 @@ void __noreturn machine_real_restart(unsigned int type)
load_cr3(initial_page_table);
#else
write_cr3(real_mode_header->trampoline_pgd);
+
+ /* Exiting long mode will fail if CR4.PCIDE is set. */
+ if (static_cpu_has(X86_FEATURE_PCID))
+ cr4_clear_bits(X86_CR4_PCIDE);
#endif
/* Jump to the identity-mapped low memory code */