From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuSXa-0005Dt-P5 for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXR-0005Df-LF for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuSXM-0004RS-5U for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:13 -0500 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:45318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXL-0004RG-Ty for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:08 -0500 Received: by mail-wg0-f52.google.com with SMTP id a1so9666835wgh.25 for ; Fri, 28 Nov 2014 12:53:06 -0800 (PST) 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=ZyarQGIoS275u/08f1WRWTBeC/Hor9eEitsjGh4S3Go=; b=CfF691xblyM2/xWSrblUp2u3G9hU7TNd7ARcN1p62gpPHP4RTicbSW23q4nlOeBiq1 TwscEug5QE/rNPGxWxV61WCw0albhEwWkNldy2/uTE0qJwbkjb7fjqkvzKba5CJaVbyt A3DaIW80Ou2urjtwNH3myqUx19csWzhoA0yoXh5D8yyB/lt5799kWvg/EQ/0APM/Sva1 BhIvRrYRKME4MJws/UYh0JR/ILyc2L4SSEYOnNal6sXP4EDdAAHy1+f+pTKCtuJvbUYa XKWOgpU+ODrt+YVoGIxeq4GYMu9SSkrX+jn4XcqhEY/HgPyJEqHfGxauvvgZwepbZwHg 6clg== X-Received: by 10.194.95.196 with SMTP id dm4mr67315252wjb.41.1417207986599; Fri, 28 Nov 2014 12:53:06 -0800 (PST) Received: from [10.222.38.128] ([212.213.198.101]) by mx.google.com with ESMTPSA id w4sm16469905wjw.39.2014.11.28.12.53.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 12:53:05 -0800 (PST) Message-ID: <5478C9CB.2020102@gmail.com> Date: Fri, 28 Nov 2014 21:15:23 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable References: <20141125114357.GD2361@bivouac.eciton.net> In-Reply-To: <20141125114357.GD2361@bivouac.eciton.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JLtKiuDRsEUveVs3aP5cEVRJ26dDG4Vnr" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::234 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: Fri, 28 Nov 2014 20:53:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JLtKiuDRsEUveVs3aP5cEVRJ26dDG4Vnr Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25.11.2014 13:43, Leif Lindholm wrote: > On Thu, Nov 20, 2014 at 09:53:14PM +0100, David Kozub wrote: >> The unaligned local in __aeabi_uidivmod leads to a store to a 64bit >> value at an address that is not divisible by 8 (in grub_divmod64). >> The compiler most likely generates a STRD instruction to store it and >> this causes an exception. >> >> Fixes Savannah bug #43632. >=20 > I agree with this patch - am I OK to push? >=20 Go ahead. > / > Leif > =20 >> This includes improvements done by Leif Lindholm. >> --- >> ChangeLog | 6 ++++++ >> grub-core/kern/arm/misc.S | 14 +++++++------- >> 2 files changed, 13 insertions(+), 7 deletions(-) >> >> diff --git a/ChangeLog b/ChangeLog >> index 6fbec06..8728c04 100644 >> --- a/ChangeLog >> +++ b/ChangeLog >> @@ -1,3 +1,9 @@ >> +2014-11-21 David Kozub >> + >> + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable >> + in __aeabi_uidivmod >> + Fixes Savannah bug #43632. >> + >> 2014-11-20 Andrei Borzenkov >> =20 >> * tests/util/grub-fs-tester.in: Consistently print output >> diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/misc.S >> index 8943cc3..16b6f8e 100644 >> --- a/grub-core/kern/arm/misc.S >> +++ b/grub-core/kern/arm/misc.S >> @@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) >> =20 >> .macro division parent >> =20 >> - stmfd sp!, {lr} >> - sub sp, sp, #12 >> + sub sp, sp, #8 @ Allocate naturally aligned 64-bit s= pace >> + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignmen= t >> + add r3, sp, #8 @ Set r3 to address of 64-bit space >> + str r3, [sp] @ Stack parameter, pointer to 64-bit = space >> mov r2, r1 >> - add r1, sp, #4 >> - str r1, [sp, #0] >> mov r1, #0 >> mov r3, #0 >> bl \parent >> - ldr r1, [sp, #4] >> - add sp, sp, #12 >> - ldmfd sp!, {lr} >> + ldr r1, [sp, #8] @ Extract remainder >> + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch regi= ster >> + add sp, sp, #8 >> bx lr >> .endm >> =20 >> --=20 >> 2.1.1 >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --JLtKiuDRsEUveVs3aP5cEVRJ26dDG4Vnr 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 iF4EAREKAAYFAlR4ycsACgkQmBXlbbo5nOsKegD+PciCO4HHu89O0fMSvoI1HQPq JfsMb8Nu+CdsiJaR/GYA/07L4MZFp4JjaAojAi/yX3rcXHF0betvbyy/UB8pfcyY =jTXf -----END PGP SIGNATURE----- --JLtKiuDRsEUveVs3aP5cEVRJ26dDG4Vnr--