From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC1EC43603 for ; Wed, 4 Dec 2019 11:45:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6801620659 for ; Wed, 4 Dec 2019 11:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727703AbfLDLpm (ORCPT ); Wed, 4 Dec 2019 06:45:42 -0500 Received: from heinz.dinsnail.net ([81.169.187.250]:40280 "EHLO heinz.dinsnail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfLDLpl (ORCPT ); Wed, 4 Dec 2019 06:45:41 -0500 Received: from heinz.dinsnail.net ([IPv6:0:0:0:0:0:0:0:1]) by heinz.dinsnail.net (8.15.2/8.15.2) with ESMTP id xB4BjCuD029792; Wed, 4 Dec 2019 12:45:12 +0100 Received: from eldalonde.UUCP (uucp@localhost) by heinz.dinsnail.net (8.15.2/8.15.2/Submit) with bsmtp id xB4BjCEg029791; Wed, 4 Dec 2019 12:45:12 +0100 Received: from eldalonde.weiser.dinsnail.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by eldalonde.weiser.dinsnail.net (8.15.2/8.15.2) with ESMTP id xB4BVe65003589; Wed, 4 Dec 2019 12:31:40 +0100 Received: (from michael@localhost) by eldalonde.weiser.dinsnail.net (8.15.2/8.15.2/Submit) id xB4BVexW003588; Wed, 4 Dec 2019 12:31:40 +0100 Date: Wed, 4 Dec 2019 12:31:40 +0100 From: Michael Weiser To: Dave Young Cc: linux-efi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , kexec@lists.infradead.org, Ingo Molnar , Borislav Petkov , "Eric W. Biederman" , "H. Peter Anvin" , Thomas Gleixner Subject: Re: [PATCH] x86/efi: update e820 about reserved EFI boot services data to fix kexec breakage Message-ID: <20191204113140.GA3081@weiser.dinsnail.net> References: <20191204075233.GA10520@dhcp-128-65.nay.redhat.com> <20191204075917.GA10587@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191204075917.GA10587@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-dinsnail-net-MailScanner-Information: Please contact the ISP for more information X-dinsnail-net-MailScanner-ID: xB4BjCuD029792 X-dinsnail-net-MailScanner: Found to be clean X-dinsnail-net-MailScanner-From: michael@weiser.dinsnail.net Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Hello Dave, On Wed, Dec 04, 2019 at 03:59:17PM +0800, Dave Young wrote: > > Signed-off-by: Dave Young > > --- > > arch/x86/platform/efi/quirks.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > --- linux-x86.orig/arch/x86/platform/efi/quirks.c > > +++ linux-x86/arch/x86/platform/efi/quirks.c > > @@ -260,10 +260,6 @@ void __init efi_arch_mem_reserve(phys_ad > > return; > > } > > > > - /* No need to reserve regions that will never be freed. */ > > - if (md.attribute & EFI_MEMORY_RUNTIME) > > - return; > > - > > size += addr % EFI_PAGE_SIZE; > > size = round_up(size, EFI_PAGE_SIZE); > > addr = round_down(addr, EFI_PAGE_SIZE); > > @@ -293,6 +289,8 @@ void __init efi_arch_mem_reserve(phys_ad > > early_memunmap(new, new_size); > > > > efi_memmap_install(new_phys, num_entries); > > + e820__range_update(addr, size, E820_TYPE_RAM, E820_TYPE_RESERVED); > > + e820__update_table(e820_table); > > } > > > > /* > Michael, could you a one more test and provide a tested-by if it works > for you? Did three successful kexecs in sequence of mainline 5.4.0 plus the patch (had problems getting recent -next to boot on my machine). ESRT region stayed reserved and intact so that the "Invalid version" error message is gone. Tested-by: Michael Weiser -- Thanks! Michael