From: ebiederm@xmission.com (Eric W. Biederman)
To: Takao Indoh <indou.takao@jp.fujitsu.com>
Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
horms@verge.net.au, nhorman@tuxdriver.com,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de,
vgoyal@redhat.com
Subject: Re: [PATCH v2][EFI] Run EFI in physical mode
Date: Wed, 15 Dec 2010 15:42:44 -0800 [thread overview]
Message-ID: <m1d3p2vc0b.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <ACB9BDFABD971indou.takao@jp.fujitsu.com> (Takao Indoh's message of "Tue, 14 Dec 2010 17:38:47 -0500")
Takao Indoh <indou.takao@jp.fujitsu.com> writes:
> On Tue, 14 Dec 2010 12:43:58 +0900, Kenji Kaneshige wrote:
>
>>Hi,
>>
>>I tested this patch on the system that has large amount of memory (1TB),
>>and I encountered the immediate system reset problem that happens every
>>time I modify the EFI boot entry using efibootmgr command. It seems that
>>triple fault happens due to the incorrect page table setup.
>>
>>> +void __init efi_pagetable_init(void)
>>> +{
>>(snip.)
>>> + pgd = efi_pgd + pgd_index(PAGE_OFFSET);
>>> + set_pgd(pgd, *pgd_offset_k(PAGE_OFFSET));
>>> + pgd = efi_pgd + pgd_index(__START_KERNEL_map);
>>> + set_pgd(pgd, *pgd_offset_k(__START_KERNEL_map));
>>> +}
>>
>>Maybe we need to map whole kernel address space. The problem doesn't
>>happen by modifying as follows.
>>
>> clone_pgd_range(efi_pgd + KERNEL_PGD_BOUNDARY,
>> swapper_pg_dir + KERNEL_PGD_BOUNDARY,
>>KERNEL_PGD_PTRS);
>
>
> Besides this bug, I'm thinking that we need global TLB flush after
> restoring cr3 because EFI code page is mapped with PAGE_KERNEL_EXEC.
>
> void efi_call_phys_epilog_in_physmode(void)
> {
> write_cr3(get_cpu_var(save_cr3));
> + if (cpu_has_pge)
> + __flush_tlb_global();
> local_irq_restore(get_cpu_var(efi_flags));
> }
>
> Somethinkg like this. Anybody comments?
If only one cpu runs efi we shouldn't need a global flush.
I presume you aren't modifying the kernel's global page table?
If we are giving the entire machine to efi then yes we would need
to set cr3 on all machines.
Eric
prev parent reply other threads:[~2010-12-15 23:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 23:07 [PATCH v2][EFI] Run EFI in physical mode Takao Indoh
2010-12-14 3:43 ` Kenji Kaneshige
2010-12-14 18:01 ` Takao Indoh
2010-12-16 20:22 ` H. Peter Anvin
2011-01-13 16:38 ` Matthew Garrett
2011-01-13 17:16 ` Eric W. Biederman
2011-01-13 17:41 ` Matthew Garrett
2010-12-14 22:38 ` Takao Indoh
2010-12-15 23:42 ` Eric W. Biederman [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=m1d3p2vc0b.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=horms@verge.net.au \
--cc=hpa@zytor.com \
--cc=indou.takao@jp.fujitsu.com \
--cc=kaneshige.kenji@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