[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1d3p2vc0b.fsf@fess.ebiederm.org>
Date: Wed, 15 Dec 2010 15:42:44 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Takao Indoh <indou.takao@...fujitsu.com>
Cc: Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>,
horms@...ge.net.au, nhorman@...driver.com,
kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
mingo@...hat.com, hpa@...or.com, tglx@...utronix.de,
vgoyal@...hat.com
Subject: Re: [PATCH v2][EFI] Run EFI in physical mode
Takao Indoh <indou.takao@...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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists