Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XtEXd-00051W-KJ for mharc-grub-devel@gnu.org; Tue, 25 Nov 2014 06:44:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtEXO-00050M-Ph for grub-devel@gnu.org; Tue, 25 Nov 2014 06:44:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtEXJ-0006P5-W6 for grub-devel@gnu.org; Tue, 25 Nov 2014 06:44:06 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtEXJ-0006Ov-Pw for grub-devel@gnu.org; Tue, 25 Nov 2014 06:44:01 -0500 Received: by mail-wi0-f180.google.com with SMTP id n3so1132271wiv.1 for ; Tue, 25 Nov 2014 03:44:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=tzfEFcb/XbXV+T1j9PVx8nhXNtACiloXfCiZdkeAUMo=; b=loN0hX6MGC7v+X+T3x4Mdxjd81g6Xnjx+RfXxyD6prS5ASA/8K+Q5hi6RaPYTJO6D3 unDv/JYpnnefkO9/pun/F4fjwK+fBIzMwPEkvLirBDiNbtFKu3xZTCvMcgTwaBM7mfx3 oWJNsBl33IUzFbgtFVFhaEXvDPSk0A1Ah2TwwMRnihuyS0wIVmgjIxEvY0r3LN//EJsg GjLMTbgApC9ISfQuBpr1z61mAmcEgBzlgwe9Cw/hAv1XOi8KGQU7MiaN5T/lTUvaY35q kzspYzLw3lFGBcwkF0/OYKQG9DNnKDMPafUYIwm1sHixolqmED8uBBNs3yHBF9G6XUsY U9Eg== X-Gm-Message-State: ALoCoQl7PnkJO/J9zpbjoSZ1D7QRHqABZWA2pAFeTtp0EYApoWQCJLzu8B0RJsh9+kayN3k5lrzG X-Received: by 10.180.80.133 with SMTP id r5mr30197114wix.20.1416915840790; Tue, 25 Nov 2014 03:44:00 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id d2sm1527566wjs.32.2014.11.25.03.43.59 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 03:43:59 -0800 (PST) Date: Tue, 25 Nov 2014 11:43:57 +0000 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH] grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable Message-ID: <20141125114357.GD2361@bivouac.eciton.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.180 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: Tue, 25 Nov 2014 11:44:19 -0000 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. I agree with this patch - am I OK to push? / Leif > 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 > > * 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) > > .macro division parent > > - stmfd sp!, {lr} > - sub sp, sp, #12 > + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space > + 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 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 register > + add sp, sp, #8 > bx lr > .endm > > -- > 2.1.1 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel