From: "Jan Beulich" Subject: Re: [PATCH 2/2] CA-162192: Fix rebooting on some EFI-booted systems Date: Thu, 12 Mar 2015 14:39:20 +0000 Message-ID: <5501B3280200007800069239@mail.emea.novell.com> References: <1426074292-32624-1-git-send-email-ross.lagerwall@citrix.com> <1426074292-32624-2-git-send-email-ross.lagerwall@citrix.com> <55005A75020000780006891B@mail.emea.novell.com> <20150311143617.GC27525@l.oracle.com> <55006B100200007800068A2A@mail.emea.novell.com> <20150311184914.GA3299@l.oracle.com> <55018A4A0200007800068F32@mail.emea.novell.com> <55019DB5.3050001@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55019DB5.3050001@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Ross Lagerwall , Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 12.03.15 at 15:07, wrote: > On 12/03/15 11:44, Jan Beulich wrote: >> @@ -452,6 +464,7 @@ static struct dmi_system_id __initdata r >> >> static int __init reboot_init(void) >> { >> + default_reboot_type(); > > This still suffers from the bug Ross fixed in patch 1. If the user > provides an override, the dmi quirks should be skipped so the request on > the command line is honoured. And I assumed he'd resubmit that patch anyway, i.e. I didn't even mean to fix this here. >> @@ -532,6 +550,11 @@ void machine_restart(unsigned int delay_ >> reboot_type = (((attempt == 1) && (orig_reboot_type == BOOT_ACPI)) >> ? BOOT_ACPI : BOOT_TRIPLE); >> break; >> + case BOOT_EFI: >> + efi_reset_system(reboot_mode != 0); >> + reboot_type = acpi_disabled ? BOOT_KBD : BOOT_ACPI; >> + *((unsigned short *)__va(0x472)) = reboot_mode; >> + break; > > Update the reboot type before calling efi_reset_system() > > That way, if efi_reset_system() does fault, we will reenter > machine_restart() and take an alternate route. > > The exact symptoms with the reference code is that efi_reset_system() > causes a #GP fault which breaks back into Xen, and the panic() path > reenters efi_reset_system() at which point the system wedges and needs a > hard power cycle. Good point, flipped. Jan