From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Xu00n-00035S-5n for mharc-grub-devel@gnu.org; Thu, 27 Nov 2014 09:25:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu00g-00032X-3H for grub-devel@gnu.org; Thu, 27 Nov 2014 09:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu00b-0003Zv-63 for grub-devel@gnu.org; Thu, 27 Nov 2014 09:25:29 -0500 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]:34638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu00a-0003Zg-Us for grub-devel@gnu.org; Thu, 27 Nov 2014 09:25:25 -0500 Received: by mail-la0-f48.google.com with SMTP id s18so4369638lam.35 for ; Thu, 27 Nov 2014 06:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=nFUU5KxrtRfEyZ6rjGZ4OobAIO3r6LNaBMnSSOD07xM=; b=1G6IUNk0sHPcE0HNappB/8kxAWTPjs9sKESGY2wb6lF7lgvU7qcAYw8W9HV0Rp6Lkr I0WooCSfqss5DY3zQbl601dHwcc7NHZinwQX3zx8ra7hmgT8ZhPMLuenIgVkM/cDkvS8 RcQ0FO8sd9/+hA4YYEcot+8FitG4cRS8zNSZCmrCNy4cGl4xCJgq2b8C/nqR5ilMfvH+ H12Wtr8ibLQSjI/DY4JgFnOl+6YXBmHwpFPDho8oMGwc15l5BCia83K6WmcUma17PHna fOEceOAhqme1tu31KBdToUVHAfyV3Sliira9/D/3mjhjqS5M5/5UDR6L7W5RnpDFxtSy VmdA== X-Received: by 10.112.201.226 with SMTP id kd2mr28551958lbc.98.1417098323983; Thu, 27 Nov 2014 06:25:23 -0800 (PST) Received: from opensuse.site (ppp91-76-149-193.pppoe.mtu-net.ru. [91.76.149.193]) by mx.google.com with ESMTPSA id ro7sm1928059lbb.14.2014.11.27.06.25.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 06:25:23 -0800 (PST) Date: Thu, 27 Nov 2014 17:25:21 +0300 From: Andrei Borzenkov To: Leif Lindholm Subject: Re: [PATCH] grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable Message-ID: <20141127172521.2d8992bd@opensuse.site> In-Reply-To: <20141125114357.GD2361@bivouac.eciton.net> References: <20141125114357.GD2361@bivouac.eciton.net> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::230 Cc: The development of GNU GRUB 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: Thu, 27 Nov 2014 14:25:34 -0000 =D0=92 Tue, 25 Nov 2014 11:43:57 +0000 Leif Lindholm =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > 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. > >=20 > > Fixes Savannah bug #43632. >=20 > I agree with this patch - am I OK to push? Yes, you are the best expert here. >=20 > / > 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(-) > >=20 > > 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 sp= ace > > + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment > > + add r3, sp, #8 @ Set r3 to address of 64-bit space > > + str r3, [sp] @ Stack parameter, pointer to 64-bit s= pace > > 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 regis= ter > > + add sp, sp, #8 > > bx lr > > .endm > > =20 > > --=20 > > 2.1.1 > >=20 > >=20 > > _______________________________________________ > > 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