Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZT80A-0004sJ-8A for mharc-grub-devel@gnu.org; Sat, 22 Aug 2015 08:34:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZT807-0004rX-P7 for grub-devel@gnu.org; Sat, 22 Aug 2015 08:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZT804-00075J-IH for grub-devel@gnu.org; Sat, 22 Aug 2015 08:34:23 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:28246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZT804-00074s-Bk for grub-devel@gnu.org; Sat, 22 Aug 2015 08:34:20 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7MCY8Yr001830 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 22 Aug 2015 12:34:09 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t7MCY74H007063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 22 Aug 2015 12:34:07 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t7MCY7EH013434; Sat, 22 Aug 2015 12:34:07 GMT Received: from olila.local.net-space.pl (/10.175.213.167) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 22 Aug 2015 05:34:06 -0700 Date: Sat, 22 Aug 2015 14:33:59 +0200 From: Daniel Kiper To: Jan Beulich Subject: Re: [PATCH v2 09/23] efi: create efi_enabled() Message-ID: <20150822123359.GX7143@olila.local.net-space.pl> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-10-git-send-email-daniel.kiper@oracle.com> <55D60BD9020000780009C3CE@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D60BD9020000780009C3CE@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: Juergen Gross , grub-devel@gnu.org, wei.liu2@citrix.com, 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, keir@xen.org, 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: Sat, 22 Aug 2015 12:34:25 -0000 On Thu, Aug 20, 2015 at 09:18:17AM -0600, Jan Beulich wrote: > >>> On 20.07.15 at 16:29, wrote: > > --- a/xen/arch/x86/efi/stub.c > > +++ b/xen/arch/x86/efi/stub.c > > @@ -4,9 +4,14 @@ > > #include > > #include > > > > -#ifndef efi_enabled > > -const bool_t efi_enabled = 0; > > -#endif > > +struct efi __read_mostly efi = { > > + .flags = 0, /* Initialized later. */ > > + .acpi = EFI_INVALID_TABLE_ADDR, > > + .acpi20 = EFI_INVALID_TABLE_ADDR, > > + .mps = EFI_INVALID_TABLE_ADDR, > > + .smbios = EFI_INVALID_TABLE_ADDR, > > + .smbios3 = EFI_INVALID_TABLE_ADDR > > +}; > > How is this change related to the subject of the patch? I need to add this struct because... > > --- a/xen/arch/x86/xen.lds.S > > +++ b/xen/arch/x86/xen.lds.S > > @@ -191,8 +191,6 @@ SECTIONS > > .pad : { > > . = ALIGN(MB(16)); > > } :text > > -#else > > - efi = .; > > #endif > > Same here. ...this creates efi symbol to just satisfy linker and I am removing it. However, existing solution does not allocate space for this symbol and any references to acpi20, etc. does not make sense. As I saw any efi.* references are protected by relevant ifs but we should not do that because it makes code very fragile. If somebody does not know how efi symbol is created he/she may assume that it always represent valid structure and do invalid references somewhere. So, I still think that stub.c should define efi struct properly even if we assume that flags should not be there. However, I agree that this could be separate patch. By the way why did you choose so strange way to satisfy liker needs? > > --- a/xen/common/efi/boot.c > > +++ b/xen/common/efi/boot.c > > @@ -717,6 +717,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE > > *SystemTable) > > char *option_str; > > bool_t use_cfg_file; > > > > +#ifndef CONFIG_ARM /* Disabled until runtime services implemented. */ > > + set_bit(EFI_PLATFORM, &efi.flags); > > +#endif > > Just for this to work? I don't see the need for all the pointers in > the stub case - why can't this be a separate variable? We don't Could be but if we create struct with so generic name like just simple efi it suggest that this is good place to put flags there. If it is not how to call it? efi_flags? Or maybe we should rename efi to efi_tables too. Then everything will be clear. Daniel