From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1h4WRd-0000uT-83 for mharc-grub-devel@gnu.org; Thu, 14 Mar 2019 15:55:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4WRa-0000dr-CF for grub-devel@gnu.org; Thu, 14 Mar 2019 15:55:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4WPR-0002zm-Hq for grub-devel@gnu.org; Thu, 14 Mar 2019 15:52:59 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:55143) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4WPP-0002wI-TQ for grub-devel@gnu.org; Thu, 14 Mar 2019 15:52:56 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 051E021F56; Thu, 14 Mar 2019 15:52:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 14 Mar 2019 15:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=e0w51q Hr0Z1ecSo/cugPqXaksBfHAqZepPWNxrtQVWA=; b=4usC04oNG7eI0nkpiWoHSp sLHzDUYtlNLvK1hSvkFH54LrcFBwJpG4oSMaBl/8fDW3iGizpn4QREzrewSdjAZY O0lAk3i80icKghtD4D4EUtaYW2BNhu6+I23HaDT/wjbdJR9fPJl3cTgh/7yJQCYe GL1RhtyUgDVqV6u/vMFGl0S6JfNnHA6ZiS5FSaoH6SdnMIOmhg7ea+x1h9ptOiqC Nl1AMKug5wfhyLXCtiXX2aIs1UwJXVTjwLq00LfvXvxkZJ/cFjsQ4cP22lL2VFSj F475l0gA25C9gqrPRkP6nmzW9mz0He7deY3dfp3zpOh/Ny0wKdf6jB55y3RjiLfg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrheefgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujggfsehgtderredtreejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from mail-itl (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 35192E455C; Thu, 14 Mar 2019 15:52:48 -0400 (EDT) Date: Thu, 14 Mar 2019 20:52:45 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Daniel Kiper Cc: grub-devel@gnu.org Subject: Re: [PATCH] xen: look for Xen notes in section headers too Message-ID: <20190314195245.GL1208@mail-itl> References: <20190314015708.6744-1-marmarek@invisiblethingslab.com> <20190314123943.7ckvvexhyd2ryvwb@tomti.i.net-space.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aqWxf8ydqYKP8htK" Content-Disposition: inline In-Reply-To: <20190314123943.7ckvvexhyd2ryvwb@tomti.i.net-space.pl> User-Agent: Mutt/1.11.1+94 (9b965fac) (2019-01-05) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.26 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2019 19:55:11 -0000 --aqWxf8ydqYKP8htK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2019 at 01:39:43PM +0100, Daniel Kiper wrote: > On Thu, Mar 14, 2019 at 02:57:08AM +0100, Marek Marczykowski-G=C3=B3recki= wrote: > > Mirror behaviour of elf loader in libxc: first look for Xen notes in > > PT_NOTE segment, then in SHT_NOTE section and only then fallback to > > a section with __xen_guest name. > > This fixes loading PV kernels that Xen note have outside of PT_NOTE. > > While this may be result of a buggy linker script, loading such kernel > > directly works fine, so make it work with grub too. > > Specifically, this applies to binaries built from Unikraft. > > > > Signed-off-by: Marek Marczykowski-G=C3=B3recki >=20 > I treat this as a fix, so, Reviewed-by: Daniel Kiper >=20 > However, ... >=20 > > --- > > grub-core/loader/i386/xen_fileXX.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386= /xen_fileXX.c > > index fb66e66fe..6af6cc0da 100644 > > --- a/grub-core/loader/i386/xen_fileXX.c > > +++ b/grub-core/loader/i386/xen_fileXX.c > > @@ -344,6 +344,21 @@ grub_xen_get_infoXX (grub_elf_t elf, struct grub_x= en_file_info *xi) > > s =3D (Elf_Shdr *) ((char *) s0 + elf->ehdr.ehdrXX.e_shstrndx * shen= tsize); > > stroff =3D s->sh_offset; > > > > + for (s =3D s0; s < (Elf_Shdr *) ((char *) s0 + shnum * shentsize); > > + s =3D (Elf_Shdr *) ((char *) s + shentsize)) > > + { > > + if (s->sh_type =3D=3D SHT_NOTE) { >=20 > Curly bracket is in wrong place... >=20 > > + err =3D parse_note (elf, xi, s->sh_offset, s->sh_size); > > + if (err) > > + goto cleanup; > > + } >=20 > ... and this is also in wrong place. >=20 > > + } > > + > > + if (xi->has_note) { > > + err =3D GRUB_ERR_NONE; > > + goto cleanup; > > + } >=20 > Ditto. Next time please double check that you have correct formatting. > Now I will fix it before the push. If there are no objections then it > will happen at the beginning of next week. Thanks. This code style is very different than any other project I contribute to...=20 Anyway, there is a comment earlier in this function: /* FIXME: check note. */ Is it about this very issue and now can be removed? --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --aqWxf8ydqYKP8htK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlyKsQ0ACgkQ24/THMrX 1ywNawf4rdFXe+EivgQ/fHSLBfYSMPyR2qvPYsub4MWIkxX2/6DqYjD2vuEjNSF4 6SWsI63pfiIMr3EFTptE/q2UxzTQlUP5rofCTWoXyvdAexGH5+5C54iHIzZ/5cpR 6/V+odSDQhQ9CASEGO2sT+6aRAYyjHShi4XV/peubIspjvPnjsWCH3JoLaXahKyT /HnRr03wFEE1QXVU31iBf3c4S7DV/QMUyxbQXGx1qUXLfdiFUpPAoL3MWGplJxyx 3u44fee01j6tztMiEtajuy1v61FFPWwy4m+N+uVXI8vS2bBOCzaGS8Dgt+e0pl4G 7u/rDx7EYBCxXJySUaibqS/UiDe2 =r2bF -----END PGP SIGNATURE----- --aqWxf8ydqYKP8htK--