Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbcLDORu (ORCPT ); Sun, 4 Dec 2016 09:17:50 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34887 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbcLDORt (ORCPT ); Sun, 4 Dec 2016 09:17:49 -0500 Date: Sun, 4 Dec 2016 14:17:46 +0000 From: Matt Fleming To: tglx@linutronix.de, peterz@infradead.org, arnd@arndb.de, mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, hpa@zytor.com, ard.biesheuvel@linaro.org Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:efi/core] efi/libstub: Make efi_random_alloc() allocate below 4 GB on 32-bit Message-ID: <20161204141746.GL20785@codeblueprint.co.uk> References: <1480010543-25709-2-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2153 Lines: 45 On Thu, 24 Nov, at 10:47:15PM, tip-bot for Ard Biesheuvel wrote: > Commit-ID: 018edcfac4c3b140366ad51b0907f3becb5bb624 > Gitweb: http://git.kernel.org/tip/018edcfac4c3b140366ad51b0907f3becb5bb624 > Author: Ard Biesheuvel > AuthorDate: Thu, 24 Nov 2016 18:02:23 +0000 > Committer: Ingo Molnar > CommitDate: Fri, 25 Nov 2016 07:15:23 +0100 > > efi/libstub: Make efi_random_alloc() allocate below 4 GB on 32-bit > > The UEFI stub executes in the context of the firmware, which identity > maps the available system RAM, which implies that only memory below > 4 GB can be used for allocations on 32-bit architectures, even on [L]PAE > capable hardware. > > So ignore any reported memory above 4 GB in efi_random_alloc(). This > also fixes a reported build problem on ARM under -Os, where the 64-bit > logical shift relies on a software routine that the ARM decompressor does > not provide. > > A second [minor] issue is also fixed, where the '+ 1' is moved out of > the shift, where it belongs: the reason for its presence is that a > memory region where start == end should count as a single slot, given > that 'end' takes the desired size and alignment of the allocation into > account. > > To clarify the code in this regard, rename start/end to 'first_slot' and > 'last_slot', respectively, and introduce 'region_end' to describe the > last usable address of the current region. > > Reported-by: Arnd Bergmann > Signed-off-by: Ard Biesheuvel > Cc: Linus Torvalds > Cc: Matt Fleming > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: linux-efi@vger.kernel.org > Link: http://lkml.kernel.org/r/1480010543-25709-2-git-send-email-ard.biesheuvel@linaro.org > Signed-off-by: Ingo Molnar > --- > drivers/firmware/efi/libstub/random.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) Ard, was this picked up for the correct tip branch? If it fixes a build failure it should have gone into tip/efi/urgent, right?