Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-18 Thread Borislav Petkov
On Wed, Dec 18, 2013 at 05:07:57PM +0800, Dave Young wrote: > How about firstly count the md numbers in the 1st loop, then > get/roundup the total size, alloc the pages, map the mds one by one in > another loop. No need as most systems would never need to reallocate. Even on Toshi's big system, th

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-18 Thread Dave Young
On 12/17/13 at 12:36am, Borislav Petkov wrote: > From: Borislav Petkov > > Currently, running SetVirtualAddressMap() and passing the physical > address of the virtual map array was working only by a lucky coincidence > because the memory was present in the EFI page table too. Until Toshi > went a

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-17 Thread Borislav Petkov
On Tue, Dec 17, 2013 at 01:51:56PM +, Matt Fleming wrote: > Couldn't we do the mapping in efi_setup_page_tables() if we pass > __pa(new_memmap) and 1 << new_memmap_shift as arguments? Yep, not a bad idea. I'll give it a try. Thanks. -- Regards/Gruss, Boris. Sent from a fat crate under

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-17 Thread Matt Fleming
On Tue, 17 Dec, at 02:40:06PM, Borislav Petkov wrote: > On Tue, Dec 17, 2013 at 12:10:24PM +, Matt Fleming wrote: > > You sunk my i386 battleship, > > > > /home/build/git/efi/arch/x86/platform/efi/efi.c:824:24: error: ‘struct > > real_mode_header’ has no member named ‘trampoline_pgd’ > > make

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-17 Thread Borislav Petkov
On Tue, Dec 17, 2013 at 12:10:24PM +, Matt Fleming wrote: > You sunk my i386 battleship, > > /home/build/git/efi/arch/x86/platform/efi/efi.c:824:24: error: ‘struct > real_mode_header’ has no member named ‘trampoline_pgd’ > make[4]: *** [arch/x86/platform/efi/efi.o] Error 1 > make[3]: *** [arc

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-17 Thread Matt Fleming
On Tue, 17 Dec, at 12:36:37AM, Borislav Petkov wrote: > From: Borislav Petkov > > Currently, running SetVirtualAddressMap() and passing the physical > address of the virtual map array was working only by a lucky coincidence > because the memory was present in the EFI page table too. Until Toshi >

Re: [PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-17 Thread Borislav Petkov
On Tue, Dec 17, 2013 at 12:36:37AM +0100, Borislav Petkov wrote: > @@ -880,6 +906,19 @@ void __init efi_enter_virtual_mode(void) > > efi_dump_pagetable(); > > + /* > + * It can happen that the physical address of new_memmap lands in memory > + * which is not mapped in the EF

[PATCH 3/3] efi: Make efi virtual runtime map passing more robust

2013-12-16 Thread Borislav Petkov
From: Borislav Petkov Currently, running SetVirtualAddressMap() and passing the physical address of the virtual map array was working only by a lucky coincidence because the memory was present in the EFI page table too. Until Toshi went and booted this on a big HP box - the krealloc() manner of r