public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Takao Indoh <indou.takao@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	ebiederm@xmission.com, tglx@linutronix.de, mingo@redhat.com,
	vgoyal@redhat.com, nhorman@tuxdriver.com
Subject: Re: [PATCH][EFI] Run EFI in physical mode
Date: Fri, 13 Aug 2010 15:28:37 -0700	[thread overview]
Message-ID: <4C65C715.5030201@zytor.com> (raw)
In-Reply-To: <F0CB3B1C601247indou.takao@jp.fujitsu.com>

On 08/13/2010 12:18 PM, Takao Indoh wrote:
> Hi all,
> 
> The attached patch enables EFI to run in physical mode.
> 
> Basically EFI is in physical mode at first and it's switched to virtual
> mode after calling SetVirtualAddressMap. By applying this patch, you can
> run EFI always in physical mode. And you can also specify "virtefi" as
> kernel boot parameter to run EFI in virtual mode as before. Note that
> this patch supports only x86_64.
> 
> This is needed to run kexec/kdump in EFI-booted system. The following is
> an original discussion. In this thread, I explained that kdump does not
> work because EFI system table is modified by SetVirtualAddressMap. And
> the idea to run EFI in physical mode was proposed. This patch implements
> it.
> 
> http://marc.info/?l=linux-kernel&m=128018221820234&w=2
>> When the 1st kernel boots, EFI system table(efi_system_table_t) is
>> modified by SetVirtualAddressMap, which is one of EFI runtime service.
>> This runtime changes physical address in EFI system table to virtual
>> address.
>>
>> When the 2nd kernel boots, it also receives the same EFI system table,
>> and the address included in it is already virtual address(1st kernel
>> rewrote it).  But 2nd kernel does not know that, 2nd kernel thinks it is
>> a physical address. This causes problems.
> 
> Basic idea of this patch is to create EFI own pagetable. This pagetable
> maps physical address of EFI runtime to the virtual address which is the
> same value so that we can call it directly. For example, physical 
> address 0x800000 is mapped to virtual address 0x800000. Before calling
> EFI runtime, cr3 register is switched to this pagetable, and restored
> when we come back from EFI.
> 
> Any comments would be appreciated.
> 

Another aspect of this... this plays well into the already-outstanding
proposal to keep an identity-mapped set of page tables around at all
times.  Right now we do it ad hoc for 64 bits and not really for 32
bits, but that is being changed, see the thread starting at:

http://marc.info/?i=1280940316-7966-1-git-send-email-bp@amd64.org

This would definitely be better than keeping yet another private page table.

	-hpa

  parent reply	other threads:[~2010-08-13 22:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 19:18 [PATCH][EFI] Run EFI in physical mode Takao Indoh
2010-08-13 22:19 ` Eric W. Biederman
2010-08-16 19:30   ` Takao Indoh
2010-08-13 22:24 ` H. Peter Anvin
2010-08-13 22:33   ` Luck, Tony
2010-08-13 23:11     ` Eric W. Biederman
2010-08-13 23:16       ` H. Peter Anvin
2010-08-13 23:36         ` Tony Luck
2010-08-16  1:31           ` Simon Horman
2010-08-13 22:28 ` H. Peter Anvin [this message]
2010-08-16  1:43 ` huang ying
2010-08-16  3:27   ` H. Peter Anvin
2010-08-16  4:58     ` huang ying
2010-08-16  5:08       ` H. Peter Anvin
2010-08-16 23:39         ` Eric W. Biederman
2010-08-16 23:54           ` H. Peter Anvin

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=4C65C715.5030201@zytor.com \
    --to=hpa@zytor.com \
    --cc=ebiederm@xmission.com \
    --cc=indou.takao@jp.fujitsu.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nhorman@tuxdriver.com \
    --cc=tglx@linutronix.de \
    --cc=vgoyal@redhat.com \
    /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