From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411Ab3HSVJm (ORCPT ); Mon, 19 Aug 2013 17:09:42 -0400 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:43299 "EHLO g6t0187.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258Ab3HSVJk (ORCPT ); Mon, 19 Aug 2013 17:09:40 -0400 Date: Mon, 19 Aug 2013 15:09:39 -0600 From: Linn Crosetto To: Yinghai Lu Cc: "H. Peter Anvin" , Matt Fleming , Thomas Gleixner , Ingo Molnar , the arch/x86 maintainers , Pekka Enberg , Jacob Shin , linux-efi@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [RFC PATCH 0/4] EFI boot stub memory map fix Message-ID: <20130819210939.GJ14273@oranje.fc.hp.com> References: <1376942419-5684-1-git-send-email-linn@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2013 at 01:47:41PM -0700, Yinghai Lu wrote: > On Mon, Aug 19, 2013 at 1:06 PM, H. Peter Anvin wrote: > > I would strongly disagree that option 2 is the cleaner solution. > > Agreed. > > > > > Linn Crosetto wrote: > >>I realize the EFI stub for ARM patches are in flight, > >> > >>https://lkml.org/lkml/2013/8/9/554 > >> > >>and overlap with some of the files but I wanted to send these out for > >>comment. > >> > >>This series fixes a problem with EFI memory maps larger than 128 > >>entries when > >>booting using the EFI boot stub, which results in overflowing the > >>e820_map in > >>boot_params and an eventual halt when checking the map size in > >>sanitize_e820_map(). > >> > >>The fix implemented is to add the EFI memory map from setup_arch() via > >>a > >>memory_setup hook. > >> > >>Two options were considered: > >> > >> 1. Use the SETUP_E820_EXT setup_data type to add the extra entries. > >> > >>2. Create a memory_setup function to be enabled when the EFI memory map > >>is > >> needed. > >> > >>Option 2 appeared to be the cleaner solution, reducing duplication with > >>existing code, given a reasonable mechanism for determining when to > >>replace the default memory_setup function. > > If boot_loader could create setup_data with SETUP_E820_EXT, > efi_stub should go that path too. > We should not add another path. My consideration was in leveraging do_add_efi_memmap(), which duplicates what is done with the map in exit_boot(), and can already be called via the "add_efi_memmap" parameter. One complication with SETUP_E820_EXT is in determining the size needed, since a call to allocate_pool will change the memory map. I will send another version which uses SETUP_E820_EXT. Thanks, Linn