Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2182400ybl; Thu, 5 Dec 2019 13:32:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyel9/UWe5RjzH5u8sL+6cFq0AKMtmSdoZdjqyTFpTR16kSYDQqmEuaHJFIgepypzAUepwZ X-Received: by 2002:a9d:4789:: with SMTP id b9mr8798139otf.110.1575581553064; Thu, 05 Dec 2019 13:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575581553; cv=none; d=google.com; s=arc-20160816; b=KBK7lR6D4QJbIpALHKGz+vz7PaxMygIPZIbHBRvHnNV6obQs0jvaJPCNN/xUdy2Kki /qjuDak5FGLBx+bd/LgNYYnLc2HxlEKo70ce31nmQAvkA38wvXnR5ksrGX6UNmYrLsVs aOCjYns35/sytdhkig6Dnr6fI/Dg/X3UPrUywoCQuvofXQJbfIeiChBl5DNrb3+HSKEa 92EFq6LiFg72ygJGciVpiEpZ2Yn7CDEY/bD7VQSLji6YF8Sj1fk/8W10PuolUbxEUWSx AiYcLf4TxeiOrDWhBkqbQt5IqtwA9hlRo7sn0ppgFseiTMeOyV4hnt7R3tM0kWfVHmw1 pxWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cab/NEtv22jf9WuuYgE41nXbjmp0hGial1t8cvX/Cv0=; b=ovstC4jowD4M3eIQqR3HCDVBhv5V5UGylNMkBzyl2u6y66O7OC9U96pLJsXYwXVLKF Uy2QQy0oxqEJYeO2fzagih7zGOB9wiYI4ajiwNabCxws5LwVNLeZ/06eRjXHn7ovWcMz GUT6s6GYP/wthgja1Y4n4533oiiXpyxwB6yylzU2i17N4l+3lv9UokkqyFPHK2M1r2XF h/OvmuXnPeSA+hl67WVhFg71onvp255LOwRJQMzGkoL9OLNpjI2YSyODVG9q3e/qhPzq cl5B/v/QYXzKeWmi9adlcngvn3LBun6w3yWHHRmf3NFdFajvXvDB4g1jfD6AsEpgu4Ag CewA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si5726191otl.286.2019.12.05.13.32.20; Thu, 05 Dec 2019 13:32:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730411AbfLEVay (ORCPT + 99 others); Thu, 5 Dec 2019 16:30:54 -0500 Received: from heinz.dinsnail.net ([81.169.187.250]:42578 "EHLO heinz.dinsnail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729656AbfLEVay (ORCPT ); Thu, 5 Dec 2019 16:30:54 -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 xB5LUEC0010903; Thu, 5 Dec 2019 22:30:14 +0100 Received: from eldalonde.UUCP (uucp@localhost) by heinz.dinsnail.net (8.15.2/8.15.2/Submit) with bsmtp id xB5LUDNb010898; Thu, 5 Dec 2019 22:30:13 +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 xB5LFWAK010648; Thu, 5 Dec 2019 22:15:32 +0100 Received: (from michael@localhost) by eldalonde.weiser.dinsnail.net (8.15.2/8.15.2/Submit) id xB5LFWDY010647; Thu, 5 Dec 2019 22:15:32 +0100 Date: Thu, 5 Dec 2019 22:15:32 +0100 From: Michael Weiser To: Dave Young Cc: Ingo Molnar , 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: <20191205211532.GA10177@weiser.dinsnail.net> References: <20191204075233.GA10520@dhcp-128-65.nay.redhat.com> <20191204075917.GA10587@dhcp-128-65.nay.redhat.com> <20191204101412.GD114697@gmail.com> <20191205105545.GA6710@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205105545.GA6710@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: xB5LUEC0010903 X-dinsnail-net-MailScanner: Found to be clean X-dinsnail-net-MailScanner-From: michael@weiser.dinsnail.net X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 05, 2019 at 06:55:45PM +0800, Dave Young wrote: > > esrt: Unsupported ESRT version 2904149718861218184. > > > > The ESRT memory stays in EFI boot services data, and it was reserved > > in kernel via efi_mem_reserve(). The initial purpose of the reservation > > is to reuse the EFI boot services data across kexec reboot. For example > > the BGRT image data and some ESRT memory like Michael reported. > > > > But although the memory is reserved it is not updated in the X86 E820 table, > > and kexec_file_load() iterates system RAM in the IO resource list to find places > > for kernel, initramfs and other stuff. In Michael's case the kexec loaded > > initramfs overwrote the ESRT memory and then the failure happened. > > > > Since kexec_file_load() depends on the E820 table being updated, just fix this > > by updating the reserved EFI boot services memory as reserved type in E820. > Thanks for the amending, also thank all for the review and test. Same from me, particularly everyone's patience with my haphazard guesswork around an area I clearly know nothing about. :) -- Thanks, Michael