From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RK5OJ-0004LM-N6 for mharc-grub-devel@gnu.org; Sat, 29 Oct 2011 05:39:51 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK5OE-0004Hv-EP for grub-devel@gnu.org; Sat, 29 Oct 2011 05:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK5OC-0004uz-UV for grub-devel@gnu.org; Sat, 29 Oct 2011 05:39:46 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:34640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK5OC-0004un-OT for grub-devel@gnu.org; Sat, 29 Oct 2011 05:39:44 -0400 Received: by wwe3 with SMTP id 3so50637wwe.30 for ; Sat, 29 Oct 2011 02:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=L/YcSOS0Q9X6R885g84swPLetJTQTaQ4y/WAOcm8Bmw=; b=ww+I4LF51wnQ6n9HEWKI/ZsoyXPm8RA5x8zxd/njOTTrPUmCXdIyICImELc2K5Ueg9 yhBhs6yepPBL+16vDuNOXIvTqWEB/v4FneN+m2d2mfs4mm0Z/qiGZ0mnuS55MP3YZL62 Wp6ti/8kzZeDHDo1yjGnUPlMvVLfSkWO5YPrI= Received: by 10.227.198.203 with SMTP id ep11mr8344603wbb.0.1319881183642; Sat, 29 Oct 2011 02:39:43 -0700 (PDT) Received: from debian.x201.phnet (gprs21.swisscom-mobile.ch. [193.247.250.21]) by mx.google.com with ESMTPS id ff6sm20259612wbb.10.2011.10.29.02.39.40 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Oct 2011 02:39:41 -0700 (PDT) Message-ID: <4EABC9D9.1010002@gmail.com> Date: Sat, 29 Oct 2011 11:39:37 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20111005 Iceowl/1.0b2 Icedove/3.1.15 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Fix module relocation errors on PowerPC References: <20111018154817.752a92f6@kryten> <20111018164940.42101700@kryten> In-Reply-To: <20111018164940.42101700@kryten> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig1C151B47A32B7977BBDB233F" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 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, 29 Oct 2011 09:39:48 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1C151B47A32B7977BBDB233F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 18.10.2011 07:49, Anton Blanchard wrote: > Hi, > >> Modules (and therefore the heap) need to be close to the executable to= >> avoid requiring more complicated relocations. This patch uses the same= >> method sparc does and puts the heap directly above the executable. > Sparc doesn't appear to claim the heap. Adding this patch on top of the= > relocation one fixes things for me on PowerPC. > > Any suggestions on the best way to fix it? The non Sparc version of > grub_claim_heap is rather complicated and I'm not sure why it just > doesn't allocate a couple of MB right above the executable. Assuming > we have ~4MB of free space at the address OF loads us is pretty > reasonable to me. > This is an eternal course to restrict usable space to supported relocations. It should be the other way round. I'll prepare a patch for adding necessary trampolines. > Anton > > -- > > Index: grub/grub-core/kern/ieee1275/init.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- grub.orig/grub-core/kern/ieee1275/init.c 2011-10-18 16:30:03.824984= 376 +1100 > +++ grub/grub-core/kern/ieee1275/init.c 2011-10-18 16:38:34.394100481 += 1100 > @@ -139,8 +139,16 @@ grub_machine_get_bootlocation (char **de > static void=20 > grub_claim_heap (void) > { > - grub_mm_init_region ((void *) (grub_modules_get_end () > - + GRUB_KERNEL_MACHINE_STACK_SIZE), 0x200000); > + grub_uint64_t addr, len; > + > + addr =3D grub_modules_get_end () + GRUB_KERNEL_MACHINE_STACK_SIZE; > + len =3D 0x200000; > + > + if (grub_claimmap (addr, len) < 0) > + grub_error (GRUB_ERR_OUT_OF_MEMORY, > + "failed to claim heap at 0x%llx, len 0x%llx", > + addr, len); > + grub_mm_init_region ((void *) (grub_addr_t)addr, len); > } > #else > static void=20 > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig1C151B47A32B7977BBDB233F 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.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk6rydkACgkQNak7dOguQgmklgD+IjdxdFkXfu66nEbiyrdDG+Fq W3DSdwLq3AI1jML456wA/Apkwl5gE2zphrjD2grDFUpvIMJXU5+sTFP3YwE4HyR+ =Eehc -----END PGP SIGNATURE----- --------------enig1C151B47A32B7977BBDB233F--