Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755440AbbBTXxO (ORCPT ); Fri, 20 Feb 2015 18:53:14 -0500 Received: from mail-ig0-f175.google.com ([209.85.213.175]:50647 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754759AbbBTXxN (ORCPT ); Fri, 20 Feb 2015 18:53:13 -0500 MIME-Version: 1.0 In-Reply-To: <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> <20150220092859.GA1572@dhcp-17-102.nay.redhat.com> Date: Fri, 20 Feb 2015 15:53:12 -0800 X-Google-Sender-Auth: 7UUfRI2n1SB8pqjCjnNoQbzuOHc Message-ID: Subject: Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G From: Yinghai Lu To: Baoquan He Cc: "H. Peter Anvin" , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1524 Lines: 37 On Fri, Feb 20, 2015 at 1:28 AM, Baoquan He wrote: > > 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. Then you are not setting the ident mapping correctly. you should make sure add extra ident mapping for the new [output, output+output_len - 1]. bootloader only cover old [output, output+output_len - 1] and you should check if the mapping is present before add new one, otherwise will overrite the one from 64bit bootloader like kexec-tools or grub2-x86_64 etc. You could use kernel_ident_mapping_init() from arch/x86/mm/init_64.c --- may need to cut and paste or split and include to arch/x86/boot/compressed/misc.c also you need to find some pages for alloc_pgt_page. 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/