[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] kexec: read more iomem regions from hypervisor
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1204196095 0 # Node ID 11371d0e841b7e12ae280c8746e53a0c8f8d2556 # Parent b7f980c60a6182740bd03a9d03bff80388669d62 kexec: read more iomem regions from hypervisor This sets the location of the efi memmap and boot parameter regions using information provided by the hypervisor, overriding values derived by dom0 from the virtualised efi memory regions. It also creates a xen heap region and uses this as the parent of per-cpu regions - they belong in hypervisor memory not dom0 kernel memory. The xen heap region is inserted into /proc/iomem_machine * There is also a hypervisor portion of this patch. * In order for the regions to show up after kexec patches to kexec-tools are required. I have posted them to the kexec mailing list and intend to merge them. http://lists.infradead.org/pipermail/kexec/2008-February/001348.html Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx> --- arch/ia64/kernel/machine_kexec.c | 50 ++++++++++++++++++++++++++++++++++++--- include/xen/interface/kexec.h | 15 +++++++++-- 2 files changed, 59 insertions(+), 6 deletions(-) diff -r b7f980c60a61 -r 11371d0e841b arch/ia64/kernel/machine_kexec.c --- a/arch/ia64/kernel/machine_kexec.c Thu Feb 28 10:54:20 2008 +0000 +++ b/arch/ia64/kernel/machine_kexec.c Thu Feb 28 10:54:55 2008 +0000 @@ -143,18 +143,62 @@ void machine_kexec_setup_load_arg(xen_ke kexec_page_to_pfn(image->control_code_page) << PAGE_SHIFT; } +static struct resource xen_hypervisor_heap_res; + int __init machine_kexec_setup_resources(struct resource *hypervisor, struct resource *phys_cpus, int nr_phys_cpus) { + xen_kexec_range_t range; int k; - /* The per-cpu crash note resources belong to the hypervisor resource */ + /* fill in xen_hypervisor_heap_res with hypervisor heap + * machine address range + */ + + memset(&range, 0, sizeof(range)); + range.range = KEXEC_RANGE_MA_XENHEAP; + + if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range)) + return -1; + + xen_hypervisor_heap_res.name = "Hypervisor heap"; + xen_hypervisor_heap_res.start = range.start; + xen_hypervisor_heap_res.end = range.start + range.size - 1; + xen_hypervisor_heap_res.flags = IORESOURCE_BUSY | IORESOURCE_MEM; + + /* The per-cpu crash note resources belong inside the + * hypervisor heap resource */ for (k = 0; k < nr_phys_cpus; k++) - request_resource(hypervisor, phys_cpus + k); + request_resource(&xen_hypervisor_heap_res, phys_cpus + k); + + /* fill in efi_memmap_res with EFI memmap machine address range */ + + memset(&range, 0, sizeof(range)); + range.range = KEXEC_RANGE_MA_EFI_MEMMAP; + + if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range)) + return -1; + + efi_memmap_res.start = range.start; + efi_memmap_res.end = range.start + range.size - 1; + + /* fill in boot_param_res with boot parameter machine address range */ + + memset(&range, 0, sizeof(range)); + range.range = KEXEC_RANGE_MA_BOOT_PARAM; + + if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range)) + return -1; + + boot_param_res.start = range.start; + boot_param_res.end = range.start + range.size - 1; return 0; } -void machine_kexec_register_resources(struct resource *res) { ; } +void machine_kexec_register_resources(struct resource *res) +{ + request_resource(res, &xen_hypervisor_heap_res); +} #endif /* CONFIG_XEN */ diff -r b7f980c60a61 -r 11371d0e841b include/xen/interface/kexec.h --- a/include/xen/interface/kexec.h Thu Feb 28 10:54:20 2008 +0000 +++ b/include/xen/interface/kexec.h Thu Feb 28 10:54:55 2008 +0000 @@ -126,9 +126,18 @@ typedef struct xen_kexec_load { xen_kexec_image_t image; } xen_kexec_load_t; -#define KEXEC_RANGE_MA_CRASH 0 /* machine address and size of crash area */ -#define KEXEC_RANGE_MA_XEN 1 /* machine address and size of Xen itself */ -#define KEXEC_RANGE_MA_CPU 2 /* machine address and size of a CPU note */ +#define KEXEC_RANGE_MA_CRASH 0 /* machine address and size of crash area */ +#define KEXEC_RANGE_MA_XEN 1 /* machine address and size of Xen itself */ +#define KEXEC_RANGE_MA_CPU 2 /* machine address and size of a CPU note */ +#define KEXEC_RANGE_MA_XENHEAP 3 /* machine address and size of xenheap + * Note that although this is adjacent + * to Xen it exists in a separate EFI + * region on ia64, and thus needs to be + * inserted into iomem_machine separately */ +#define KEXEC_RANGE_MA_BOOT_PARAM 4 /* machine address and size of + * the ia64_boot_param */ +#define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of + * of the EFI Memory Map */ /* * Find the address and size of certain memory areas _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |