From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rutland Subject: Re: [PATCH] arm64: efi: make sure vmlinux load address aligned on 2MBytes Date: Wed, 28 Oct 2015 11:28:39 +0000 Message-ID: <20151028112839.GA24930@leverpostej> References: <1445981041-8774-1-git-send-email-timur@codeaurora.org> <56302E7C.7000605@codeaurora.org> <56302F42.4040408@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <56302F42.4040408-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Timur Tabi Cc: Ard Biesheuvel , Mark Salter , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Will Deacon , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , Matt Fleming , Shanker Donthineni , Mark Langsdorf , Jon Masters List-Id: linux-efi@vger.kernel.org On Tue, Oct 27, 2015 at 09:13:22PM -0500, Timur Tabi wrote: > Ard Biesheuvel wrote: > >No. I screwed up the patch since the trailing ) should not be there, > >but we do need to round first, and only then add the offset. > > But if the offset is not a multiple of 2MB, won't the address passed > to allocate_pages be unaligned? I'll test your patch on our system, > but I thought the problem was that the allocated address must be > aligned. The kernel needs to be loaded at an address which is text_offset bytes past a 2M-aligned base. It is not loaded at the 2M-aligned base itself. Ard's patch correctly findd a 2M-aligned base, then adds the text offset. Mark.