From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WbsI8-0004KR-ED for mharc-grub-devel@gnu.org; Sun, 20 Apr 2014 10:00:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbsHx-0004Hn-DW for grub-devel@gnu.org; Sun, 20 Apr 2014 10:00:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbsHk-0003Jb-JC for grub-devel@gnu.org; Sun, 20 Apr 2014 10:00:09 -0400 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:64918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbsHk-0003JN-Ao for grub-devel@gnu.org; Sun, 20 Apr 2014 09:59:56 -0400 Received: by mail-ee0-f47.google.com with SMTP id b15so3017559eek.34 for ; Sun, 20 Apr 2014 06:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=rfxes1E0kC1aKwEC5IkCwW2TwwaDAW70Y1VczN2qyC8=; b=f7rOhANOPCu159ygWmWJmCI1xRSL3qX2NDlVWdvhx490cs69RDB9xrEEMt7I3g1/vW 4NQr0AGfbYpltCfQwoTjXnZOazxzn4mMWjCWVfe2slIfv6FbNsig3b8nE5RTsg2zyDrn MR6FqpEXk/HNJI4caGG8IO31SdMQf2GHtd5z7tDhFgErzYs0FOQWrHH93l3vppMq2e6H ApxRcXXVnLCV2CUzaYdy6RYAhlDRYvYvqJ/UNbZupm/av6j3GWVtgiDogKkR2COcoPLT rDpFCgfxJLiU1c2HrjhxPmrwcobFbfsqUBy8knbao/U2F4RlpC8sSp2pmt5LXQW2sW59 5bEg== X-Received: by 10.14.87.7 with SMTP id x7mr38745029eee.44.1398002394679; Sun, 20 Apr 2014 06:59:54 -0700 (PDT) Received: from [192.168.42.163] (1-228.197-178.cust.bluewin.ch. [178.197.228.1]) by mx.google.com with ESMTPSA id z48sm94846939eel.27.2014.04.20.06.59.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Apr 2014 06:59:53 -0700 (PDT) Message-ID: <5353D2CD.2050108@gmail.com> Date: Sun, 20 Apr 2014 15:59:41 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCHv2] Unable to boot very old Linux kernels References: <1397563120-3509-1-git-send-email-piotras@gmail.com> In-Reply-To: <1397563120-3509-1-git-send-email-piotras@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qfqBBKaepL6JWIamKCS83gnbf2ixMLt5D" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22f 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: Sun, 20 Apr 2014 14:00:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qfqBBKaepL6JWIamKCS83gnbf2ixMLt5D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Committed, thanks. On 15.04.2014 13:58, Piotr Krysiuk wrote: > GRUB cannot determine end of BSS section of compressed image when loadi= ng > very old Linux kernels. Booting these kernels, grub_relocator32_start = and > new Global Descriptor Table are placed in the area overlapping with the= BSS > section of loaded image. When Linux executes, it initializes BSS also > wiping Global Descriptor Table that is still active. This leads to fai= lure > on segment reload that follows. >=20 > Current HEAD of GRUB repository is affected, with "Clear BSS" code from= > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tr= ee/arch/x86_64/boot/compressed/head.S?h=3Dlinux-2.6.17.y#n57 > wiping GDT. >=20 > Old versions of GRUB, from before relocator was introduced, placed GDT = close > to end of physical memory avoiding this issue. This patch fixes regres= sion > by moving GDT into conventional memory. >=20 > * grub-core/lib/i386/relocator.c: Move GDT into conventional memory > to avoid collision with BSS section of compressed Linux image for > very old kernels. > --- > grub-core/lib/i386/relocator.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) >=20 > diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/reloca= tor.c > index d2a1b27..ffaf25f 100644 > --- a/grub-core/lib/i386/relocator.c > +++ b/grub-core/lib/i386/relocator.c > @@ -81,10 +81,13 @@ grub_relocator32_boot (struct grub_relocator *rel, > void *relst; > grub_relocator_chunk_t ch; > =20 > - err =3D grub_relocator_alloc_chunk_align (rel, &ch, 0, > - (0xffffffff - RELOCATOR_SIZEOF (32)) > - + 1, RELOCATOR_SIZEOF (32), 16, > - GRUB_RELOCATOR_PREFERENCE_NONE, > + /* Specific memory range due to Global Descriptor Table for use by p= ayload > + that we will store in returned chunk. The address range and pref= erence > + are based on "THE LINUX/x86 BOOT PROTOCOL" specification. */ > + err =3D grub_relocator_alloc_chunk_align (rel, &ch, 0x1000, > + 0x9a000 - RELOCATOR_SIZEOF (32), > + RELOCATOR_SIZEOF (32), 16, > + GRUB_RELOCATOR_PREFERENCE_LOW, > avoid_efi_bootservices); > if (err) > return err; >=20 --qfqBBKaepL6JWIamKCS83gnbf2ixMLt5D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlNT0tQACgkQmBXlbbo5nOum/QEAgGpjZDyumlPAZbF7ZstRvz3/ NqW4WNBfI50mAUxmPGcBAK7t4NLPdcIw/2gNK0dYHIOcWztN3UiphYq0+s0ujO49 =Suke -----END PGP SIGNATURE----- --qfqBBKaepL6JWIamKCS83gnbf2ixMLt5D--