From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WRnlw-0002TJ-53 for mharc-grub-devel@gnu.org; Sun, 23 Mar 2014 15:09:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRnll-0002Ap-9w for grub-devel@gnu.org; Sun, 23 Mar 2014 15:09:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRnlc-00005X-SS for grub-devel@gnu.org; Sun, 23 Mar 2014 15:09:17 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:53450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRnlc-00005G-Ki for grub-devel@gnu.org; Sun, 23 Mar 2014 15:09:08 -0400 Received: by mail-ee0-f42.google.com with SMTP id d17so3709644eek.29 for ; Sun, 23 Mar 2014 12:09:07 -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=jjtfLb5ORvjLmzO5WuC9bGEtb7nQIa+ftTQb/e60PH8=; b=jWRU4sWHN+6uOI0pjNADySSeyrumGtmsh38BiD0dtcCMRvq/7mZgWx+bVGjwE/m185 YOKCYCwKyGf6gxWNLPJsSG1ss37bIydLE94lAitgpx7vVookBrhted85HcQlHPS7B9c4 LlREH3QE+m3VVr2TyYcCs1ytfCvgUXF8iIgrwQHorOmyB0YM2BoB/ljGKabYuQwyD4OR V53VTdpukUdvG9s6SvMdE/wTtRjN2sxG1ZGUAZCn/A5BMFGyg8p1ClObUPg72M1AkPX7 7eEru40pQF3sAzdFI734Y4PSZXw09504e6W36jGT9Q4EGMxTVg5vIXLxSYFUHlDj1aFM 5jNQ== X-Received: by 10.15.31.137 with SMTP id y9mr59598131eeu.12.1395601747414; Sun, 23 Mar 2014 12:09:07 -0700 (PDT) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id q49sm27989475eem.34.2014.03.23.12.09.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 12:09:06 -0700 (PDT) Message-ID: <532F3150.8020302@gmail.com> Date: Sun, 23 Mar 2014 20:09:04 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Unable to boot very old Linux kernels References: <1395094513-29201-1-git-send-email-piotras@gmail.com> In-Reply-To: <1395094513-29201-1-git-send-email-piotras@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1SVe8GnRDadtkOwHlfVcVsILWm5bbUob8" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22a 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, 23 Mar 2014 19:09:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1SVe8GnRDadtkOwHlfVcVsILWm5bbUob8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 17.03.2014 23:15, Piotr Krysiuk wrote: > Hi, >=20 > I occasionally need to boot a very old Linux kernel. >=20 > This works fine with old versions of GRUB, from before relocator was > introduced. However the kernel cannot be started by recent versions > of GRUB - machine simply restarts as soon as GRUB passes control to > Linux. As mentioned above this affects very old Linux only, so very > few users (if any) would care. But as I have a patch, here it is. >=20 > I tracked the issues to code initializing BSS that is used by old > Linux kernels. See code following "Clear BSS" on > 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 >=20 > AFAIK old Linux kernels do not provide information allowing boot > loader to determine end of BSS. As the consequence, current GRUB > may place GPT in the area overlapping with BSS sections of old > Linux kernels. The location of GPT was changed at the same time > when relocator was added, introducing regression. >=20 Top of memory doesn't sound like a right place. Could you try with > err =3D grub_relocator_alloc_chunk_align (rel, &ch, 0, > (0xa0000 - RELOCATOR_SIZEOF (32)), ... This will put GDT in low memory > In order to improve compatibility with these old kernels, we could > switch back to old strategy and simply place GPT close to end of > physical memory. >=20 > Best regards, >=20 > Piotr Krysiuk > --- > ChangeLog | 5 +++++ > grub-core/lib/i386/relocator.c | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/ChangeLog b/ChangeLog > index 770269c..5a91e5e 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2014-03-17 Piotr Krysiuk > + > + * grub-core/lib/i386/relocator.c: Moved GDT to end of physical memory= > + to avoid collision with old Linux BSS. > + > 2014-02-28 Vladimir Serbinenko > =20 > * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields.= > diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/reloca= tor.c > index d2a1b27..523f669 100644 > --- a/grub-core/lib/i386/relocator.c > +++ b/grub-core/lib/i386/relocator.c > @@ -84,7 +84,7 @@ grub_relocator32_boot (struct grub_relocator *rel, > err =3D grub_relocator_alloc_chunk_align (rel, &ch, 0, > (0xffffffff - RELOCATOR_SIZEOF (32)) > + 1, RELOCATOR_SIZEOF (32), 16, > - GRUB_RELOCATOR_PREFERENCE_NONE, > + GRUB_RELOCATOR_PREFERENCE_HIGH, > avoid_efi_bootservices); > if (err) > return err; >=20 --1SVe8GnRDadtkOwHlfVcVsILWm5bbUob8 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/ iF4EAREKAAYFAlMvMVAACgkQmBXlbbo5nOvLFwEAq47DB+bXoIzz1vSzAPBXYkGz IMjhiShGXNe6NDVxKMsA/17Vvo11FpPVcFZBWbEYEu/WWFKU1ZBL1ro3MV9/yVv0 =/hQv -----END PGP SIGNATURE----- --1SVe8GnRDadtkOwHlfVcVsILWm5bbUob8--