From: Dave Young <dyo...@redhat.com>

[ Upstream commit 2ecb7402cfc7f22764e7bbc80790e66eadb20560 ]

kexec reboot fails randomly in UEFI based KVM guest.  The firmware
just resets while calling efi_delete_dummy_variable();  Unfortunately
I don't know how to debug the firmware, it is also possible a potential
problem on real hardware as well although nobody reproduced it.

The intention of the efi_delete_dummy_variable is to trigger garbage collection
when entering virtual mode.  But SetVirtualAddressMap can only run once
for each physical reboot, thus kexec_enter_virtual_mode() is not necessarily
a good place to clean a dummy object.

Drop the efi_delete_dummy_variable so that kexec reboot can work.

Signed-off-by: Dave Young <dyo...@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
Acked-by: Matthew Garrett <mj...@google.com>
Cc: Ben Dooks <ben.do...@codethink.co.uk>
Cc: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com>
Cc: Jerry Snitselaar <jsnit...@redhat.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Lukas Wunner <lu...@wunner.de>
Cc: Lyude Paul <ly...@redhat.com>
Cc: Octavian Purdila <octavian.purd...@intel.com>
Cc: Peter Jones <pjo...@redhat.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Scott Talbert <s...@techie.net>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: linux-efi@vger.kernel.org
Cc: linux-integr...@vger.kernel.org
Link: https://lkml.kernel.org/r/20191002165904.8819-8-ard.biesheu...@linaro.org
Signed-off-by: Ingo Molnar <mi...@kernel.org>
Signed-off-by: Sasha Levin <sas...@kernel.org>
---
 arch/x86/platform/efi/efi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index ad285404ea7f5..4bc352fc08f19 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -859,9 +859,6 @@ static void __init kexec_enter_virtual_mode(void)
 
        if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX))
                runtime_code_page_mkexec();
-
-       /* clean DUMMY object */
-       efi_delete_dummy_variable();
 #endif
 }
 
-- 
2.20.1

Reply via email to