mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G
Date: Sun, 22 Feb 2015 21:18:01 +0800	[thread overview]
Message-ID: <20150222131801.GA2073@dhcp-17-102.nay.redhat.com> (raw)
In-Reply-To: <20150221024738.GA2899@dhcp-17-102.nay.redhat.com>

On 02/21/15 at 10:49am, Baoquan He wrote:
> On 02/20/15 at 03:53pm, Yinghai Lu wrote:
> > 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.
> 
> At the beginning I did it just as you said, add IDT table and $PF
> handler. Get page fault address and built ident mapping around it when
> reload kernel above 4G. In this case 3 more pages are enough if kernel
                                      ~~
                                       typo, it should be 4

> is put to another 512G and cross the boundary of 512G.
> kernel_ident_mapping_init code can be borrowed and need be adjusted a
> little bit. This works as expected, but a GPF reported and reboot to
> BIOS. That's why I made a simple debug patch as I pasted before to
> filter unnecessary interference.
> 
> Since in arch/x86/boot/compressed/head_64.S 6 pages are used, 1 for pgd,
> 1 for pud, 4 for pmd, all of them cover 0~4G ident mapping. So I added 4
> more pages as pmd, then 0~8G are covered. Now I hardcoded the output of
> randomization of physical address as 5G, means kernel will be reloaded
> there and decompressed. With these ident mapping for this hard coded
> address should be correctly setted, still that GPF will happen. I
> borrowed a printf.c from arch/x86/boot and made it work for
> boot/compressed, can see in this case it will decompress successfully
> and jump into arch/x86/kernel/head_64.S, then it reboot there during a
> jump.
> 
> > 
> > Thanks
> > 
> > Yinghai

      parent reply	other threads:[~2015-02-22 13:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04  2:03 Yinghai Lu
2015-02-05  3:25 ` Dave Young
2015-02-05  5:25   ` Yinghai Lu
2015-02-05  6:09     ` Dave Young
2015-02-18  7:29       ` Yinghai Lu
2015-02-09 18:27 ` Matt Fleming
2015-02-09 20:23   ` Yinghai Lu
2015-02-11 15:55     ` Matt Fleming
2015-02-11 16:29       ` Peter Jones
2015-02-12 14:59         ` Matt Fleming
2015-02-11  6:11 ` Baoquan He
2015-02-18  7:22   ` Yinghai Lu
2015-02-18 11:29     ` Baoquan He
2015-02-18 19:47       ` Yinghai Lu
2015-02-20  2:13         ` Baoquan He
2015-02-20  3:35           ` Yinghai Lu
2015-02-20  9:28             ` Baoquan He
2015-02-20 23:53               ` Yinghai Lu
2015-02-21  2:49                 ` Baoquan He
2015-02-21 20:00                   ` Yinghai Lu
2015-02-22 13:18                   ` Baoquan He [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150222131801.GA2073@dhcp-17-102.nay.redhat.com \
    --to=bhe@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®