Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753862AbbBTJ3V (ORCPT ); Fri, 20 Feb 2015 04:29:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49848 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbbBTJ3T (ORCPT ); Fri, 20 Feb 2015 04:29:19 -0500 Date: Fri, 20 Feb 2015 17:28:59 +0800 From: Baoquan He To: Yinghai Lu Cc: "H. Peter Anvin" , Linux Kernel Mailing List Subject: Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G Message-ID: <20150220092859.GA1572@dhcp-17-102.nay.redhat.com> References: <1423015400-12629-1-git-send-email-yinghai@kernel.org> <20150211061148.GA4448@dhcp-17-102.nay.redhat.com> <20150218112956.GA1965@dhcp-17-102.nay.redhat.com> <20150220021306.GA2621@dhcp-17-102.nay.redhat.com> 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2374 Lines: 61 On 02/19/15 at 07:35pm, Yinghai Lu wrote: > On Thu, Feb 19, 2015 at 6:13 PM, Baoquan He wrote: > > On 02/18/15 at 11:47am, Yinghai Lu wrote: > > > > Kaslr need both virtual and physical address be randomized, otherwise > > it doesn't make sense. Please check what hpa said about this issue: > > > > https://lkml.org/lkml/2014/10/13/350 > > > > If I read correctly, it could be separated. phy one could be on bootloader > and virtual could be in kernel. I think people want physical address randomization too. This is what Vivek replied to hpa's comment: https://lkml.org/lkml/2014/10/13/377 And after I posted the patchset handling randomization of virtual and physical address separately, Kees Cook also think it makes sense: http://www.gossamer-threads.com/lists/linux/kernel/2090014 > > > And usually no bootloader often load kernel onto a random physical > > address. Fow now we can often see kexec/kdump did this. I believe Kees > > introduced kaslr to mainly solve security issue of normal kernel which > > is not like kexec/kdump for testing or debugging. Randomizing physical > > address makes sense for kaslr feature. > > I put some grub2 patches that extend grub2 to load kernel/initrd above > 4G into github tree. > > https://github.com/yhlu/grub2.git > > main purpose for that feature is to handle initrd that bigger than 4G. > > or you can try you solution on system that have 64bit EFI support, > then you will don't need to > worry about set ident mapping even. Actually kexec is a bootloader which can put kernel at any address. This is done in user space program kexec-tools. However kexec-tools make kernel jump from 64bit into 64bit directly, and has built ident mapping of whole physical memory. I have tried this and it works. kexec is mainly used for kernel developer, kaslr is meaningless for kexec. However kaslr focus on normal kernel, and jump from 32bit to 64bit mode. I can't figure out a way to work around this. Now I just want to figure out what register setting cause GPF when reload kernel above 4G in this jumping from 32bit to 64bit way. > > Thanks > > Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/