From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbaHRBZk (ORCPT ); Sun, 17 Aug 2014 21:25:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbaHRBZj (ORCPT ); Sun, 17 Aug 2014 21:25:39 -0400 Date: Mon, 18 Aug 2014 09:24:54 +0800 From: Dave Young To: Will Deacon Cc: Matt Fleming , Catalin Marinas , Thomas Gleixner , Ingo Molnar , "hpa@zytor.com" , Alessandro Zummo , Leif Lindholm , Ard Biesheuvel , "msalter@redhat.com" , Randy Dunlap , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-efi@vger.kernel.org" , Daniel Kiper , Russ Anderson Subject: Re: [PATCH 5/7] arm64/efi: do not enter virtual mode in case booting with efi=noruntime or noefi Message-ID: <20140818012454.GA3379@darkstar.nay.redhat.com> References: <1408007731-15081-1-git-send-email-dyoung@redhat.com> <1408007731-15081-5-git-send-email-dyoung@redhat.com> <20140815150952.GY27466@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140815150952.GY27466@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/15/14 at 04:09pm, Will Deacon wrote: > On Thu, Aug 14, 2014 at 10:15:30AM +0100, Dave Young wrote: > > In case efi runtime disabled via noefi kernel cmdline arm64_enter_virtual_mode > > should error out. > > > > At the same time move early_memunmap(memmap.map, mapsize) to the beginning of > > the function or it will leak early mem. > > > > Signed-off-by: Dave Young > > --- > > arch/arm64/kernel/efi.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c > > index 6ed0362..309fab1 100644 > > --- a/arch/arm64/kernel/efi.c > > +++ b/arch/arm64/kernel/efi.c > > @@ -392,11 +392,16 @@ static int __init arm64_enter_virtual_mode(void) > > return -1; > > } > > > > + mapsize = memmap.map_end - memmap.map; > > + if (efi_runtime_disabled()) { > > + early_memunmap(memmap.map, mapsize); > > Should this early_memunmap really be conditional? With this change, we no > longer unmap it before setting up the permanent mapping below. Ooops, I tested the right version but sent a wrong version for this arm64 patch. Thanks for catch. > > Will > > > + pr_info("EFI runtime services will be disabled.\n"); > > + return -1; > > + } > > + > > pr_info("Remapping and enabling EFI services.\n"); > > > > /* replace early memmap mapping with permanent mapping */ > > - mapsize = memmap.map_end - memmap.map; > > - early_memunmap(memmap.map, mapsize); > > memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, > > mapsize); > > memmap.map_end = memmap.map + mapsize; > > -- > > 1.8.3.1 > > > >