[PATCH v4 00/11] grub-xen: support booting huge pv-domains

2016-02-21 Thread Juergen Gross
The Xen hypervisor supports starting a dom0 with large memory (up to the TB range) by not including the initrd and p2m list in the initial kernel mapping. Especially the p2m list can grow larger than the available virtual space in the initial mapping. The started kernel is indicating the support o

[PATCH v4 06/11] xen: factor out p2m list allocation into separate function

2016-02-21 Thread Juergen Gross
Do the p2m list allocation of the to be loaded kernel in a separate function. This will allow doing the p2m list allocation at different times of the boot preparations depending on the features the kernel is supporting. While at this remove superfluous setting of first_p2m_pfn and nr_p2m_frames as

[PATCH v4 03/11] xen: reduce number of global variables in xen loader

2016-02-21 Thread Juergen Gross
The loader for xen paravirtualized environment is using lots of global variables. Reduce the number by making them either local or by putting them into a single state structure. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 259 +++-

[PATCH v4 02/11] xen: avoid memleaks on error

2016-02-21 Thread Juergen Gross
When loading a Xen pv-kernel avoid memory leaks in case of errors. Signed-off-by: Juergen Gross --- grub-core/loader/i386/xen.c| 2 +- grub-core/loader/i386/xen_fileXX.c | 17 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/grub-core/loader/i386/xen.c b

[PATCH v4 07/11] xen: factor out allocation of special pages into separate function

2016-02-21 Thread Juergen Gross
Do the allocation of special pages (start info, console and xenbus ring buffers) in a separate function. This will allow to do the allocation at different times of the boot preparations depending on the features the kernel is supporting. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper ---

[PATCH v4 04/11] xen: add elfnote.h to avoid using numbers instead of constants

2016-02-21 Thread Juergen Gross
Various features and parameters of a pv-kernel are specified via elf notes in the kernel image. Those notes are part of the interface between the Xen hypervisor and the kernel. Instead of using num,bers in the code when interpreting the elf notes make use of the header supplied by Xen for that pur

[PATCH v4 09/11] xen: add capability to load initrd outside of initial mapping

2016-02-21 Thread Juergen Gross
Modern pvops linux kernels support an initrd not covered by the initial mapping. This capability is flagged by an elf-note. In case the elf-note is set by the kernel don't place the initrd into the initial mapping. This will allow to load larger initrds and/or support domains with larger memory, a

[PATCH v4 01/11] xen: make xen loader callable multiple times

2016-02-21 Thread Juergen Gross
The loader for xen paravirtualized environment isn't callable multiple times as it won't free any memory in case of failure. Call grub_relocator_unload() as other modules do it before allocating a new relocator or when unloading the module. Signed-off-by: Juergen Gross --- V4: split patch into t

[PATCH v4 10/11] xen: modify page table construction

2016-02-21 Thread Juergen Gross
Modify the page table construction to allow multiple virtual regions to be mapped. This is done as preparation for removing the p2m list from the initial kernel mapping in order to support huge pv domains. This allows a cleaner approach for mapping the relocator page by using this capability. The

[PATCH v4 11/11] xen: add capability to load p2m list outside of kernel mapping

2016-02-21 Thread Juergen Gross
Modern pvops linux kernels support a p2m list not covered by the kernel mapping. This capability is flagged by an elf-note specifying the virtual address the kernel is expecting the p2m list to be mapped to. In case the elf-note is set by the kernel don't place the p2m list into the kernel mapping

[PATCH v4 08/11] xen: factor out allocation of page tables into separate function

2016-02-21 Thread Juergen Gross
Do the allocation of page tables in a separate function. This will allow to do the allocation at different times of the boot preparations depending on the features the kernel is supporting. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 91 +

[PATCH v4 05/11] xen: synchronize xen header

2016-02-21 Thread Juergen Gross
Get actual version of include/xen/xen.h from the Xen repository in order to be able to use constants defined there. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- include/xen/arch-x86/xen-x86_32.h | 22 +++ include/xen/arch-x86/xen-x86_64.h | 8 +-- include/xen/xen.h

Re: [PATCH] menu_entry: Disable cursor during update_screen()

2016-02-21 Thread Andrei Borzenkov
29.01.2016 17:26, Thomas Huth пишет: > When running grub in a VGA console of a KVM pseries guest on PowerPC, > you can see the cursor sweeping over the whole line when entering a > character in editor mode. This is visible because grub always refreshes > the whole line when entering a character in

Re: [PATCH v2] ieee1275: prevent buffer over-read

2016-02-21 Thread Andrei Borzenkov
15.02.2016 21:53, Eric Snowberg пишет: > Prevent buffer over-read in grub_machine_mmap_iterate. This was > causing phys_base from being calculated properly. This then > caused the wrong value to be placed in ramdisk_image within > struct linux_hdrs. Which prevented the ramdisk from loading on > boo

Re: [PATCH 1/2] disk: Add support for device-specific malloc function

2016-02-21 Thread Andrei Borzenkov
19.02.2016 19:18, Leif Lindholm пишет: > Some disk types have allocation requirements beyond normal grub_malloc. > Add a function pointer to grub_disk_t and a wrapper function in > kern/disk.c making use of that function if available, to enable these > disk drivers to implement their own malloc. T