Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YOqGy-0002Xa-5l for mharc-grub-devel@gnu.org; Fri, 20 Feb 2015 11:17:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOqGs-0002WM-2o for grub-devel@gnu.org; Fri, 20 Feb 2015 11:17:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOqGn-0002gp-F4 for grub-devel@gnu.org; Fri, 20 Feb 2015 11:17:42 -0500 Received: from mail.emea.novell.com ([130.57.118.101]:34623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOqGn-0002gY-7n for grub-devel@gnu.org; Fri, 20 Feb 2015 11:17:37 -0500 Received: from EMEA1-MTA by mail.emea.novell.com with Novell_GroupWise; Fri, 20 Feb 2015 16:17:36 +0000 Message-Id: <54E76C2F0200007800062262@mail.emea.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.1 Date: Fri, 20 Feb 2015 16:17:35 +0000 From: "Jan Beulich" To: "Daniel Kiper" Subject: Re: [PATCH 05/18] efi: split efi_enabled to efi_platform and efi_loader References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> <1422640462-28103-6-git-send-email-daniel.kiper@oracle.com> In-Reply-To: <1422640462-28103-6-git-send-email-daniel.kiper@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 130.57.118.101 Cc: Juergen Gross , grub-devel@gnu.org, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, phcoder@gmail.com, xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 16:17:46 -0000 >>> On 30.01.15 at 18:54, wrote: > We need more fine grained knowledge about EFI environment and check > for EFI platform and EFI loader separately to properly support > multiboot2 protocol. ... because of ... (i.e. I can't see from the description what the separation is good for). Looking at the comments you placed aside the variables doesn't help me either. > In general Xen loaded by this protocol uses > memory mappings and loaded modules in simliar way to Xen loaded > by multiboot (v1) protocol. Hence, split efi_enabled to efi_platform > and efi_loader. And if I'm guessing things right, then introducing efi_loader but leaving efi_enabled alone (only converting where needed) would seem the right approach. > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -431,7 +431,7 @@ static void __init parse_video_info(void) > struct boot_video_info *bvi =3D &bootsym(boot_vid_info); > =20 > /* The EFI loader fills vga_console_info directly. */ > - if ( efi_enabled ) > + if ( efi_platform ) This looks wrong considering the comment. > @@ -663,7 +663,7 @@ void __init noreturn __start_xen(unsigned long = mbi_p) > if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) !=3D 0 ) > panic("Misaligned CPU0 stack."); > =20 > - if ( efi_enabled ) > + if ( efi_loader ) > { > set_pdx_range(xen_phys_start >> PAGE_SHIFT, > (xen_phys_start + BOOTSTRAP_MAP_BASE) >> = PAGE_SHIFT); > @@ -774,7 +774,7 @@ void __init noreturn __start_xen(unsigned long = mbi_p) > * we can relocate the dom0 kernel and other multiboot modules. = Also, on > * x86/64, we relocate Xen to higher memory. > */ > - for ( i =3D 0; !efi_enabled && i < mbi->mods_count; i++ ) > + for ( i =3D 0; !efi_loader && i < mbi->mods_count; i++ ) > { > if ( mod[i].mod_start & (PAGE_SIZE - 1) ) > panic("Bootloader didn't honor module alignment request."); > @@ -962,7 +962,7 @@ void __init noreturn __start_xen(unsigned long = mbi_p) > =20 > if ( !xen_phys_start ) > panic("Not enough memory to relocate Xen."); > - reserve_e820_ram(&boot_e820, efi_enabled ? mbi->mem_upper : = __pa(&_start), > + reserve_e820_ram(&boot_e820, efi_loader ? mbi->mem_upper : = __pa(&_start), For all of these it's really hard to tell whether they're right without knowing which parts of the current EFI loading code you intend to re-use. Perhaps switching these would better be done along with adding the re-using code (or splitting out the not re-used parts)? > --- a/xen/include/xen/efi.h > +++ b/xen/include/xen/efi.h > @@ -5,7 +5,11 @@ > #include > #endif > =20 > -extern const bool_t efi_enabled; > +/* If true then Xen runs on EFI platform. */ > +extern bool_t efi_platform; > + > +/* If true then Xen was loaded by native EFI loader as PE application. = */ > +extern bool_t efi_loader; I don't see why you're losing the constness. Jan