From: David Woodhouse Date: Thu, 12 Dec 2019 17:02:10 +0000 (+0000) Subject: Add KEXEC_RANGE_MA_LIVEUPDATE X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fliveupdate;p=people%2Fdwmw2%2Fxen.git Add KEXEC_RANGE_MA_LIVEUPDATE This allows kexec userspace to tell the next Xen where the range is, on its command line. Signed-off-by: David Woodhouse --- diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c index b70d5a6a86..f0c4617234 100644 --- a/xen/arch/x86/machine_kexec.c +++ b/xen/arch/x86/machine_kexec.c @@ -184,11 +184,20 @@ void machine_kexec(struct kexec_image *image) image->head, image->entry_maddr, reloc_flags); } +extern unsigned long lu_bootmem_start, lu_bootmem_size; + int machine_kexec_get(xen_kexec_range_t *range) { - if (range->range != KEXEC_RANGE_MA_XEN) - return -EINVAL; - return machine_kexec_get_xen(range); + switch (range->range) { + case KEXEC_RANGE_MA_XEN: + return machine_kexec_get_xen(range); + case KEXEC_RANGE_MA_LIVEUPDATE: + range->start = lu_bootmem_start; + range->size = lu_bootmem_size; + return 0; + default: + return -EINVAL; + } } void arch_crash_save_vmcoreinfo(void) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 0374c060e9..d947072492 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -662,7 +662,7 @@ static char * __init cmdline_cook(char *p, const char *loader_name) } -static unsigned long lu_bootmem_start, lu_bootmem_size, lu_data; +unsigned long lu_bootmem_start, lu_bootmem_size, lu_data; static int __init parse_liveupdate(const char *str) { diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h index 74ea981ab2..414df9b5b2 100644 --- a/xen/include/public/kexec.h +++ b/xen/include/public/kexec.h @@ -150,6 +150,7 @@ typedef struct xen_kexec_load_v1 { #define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of * of the EFI Memory Map */ #define KEXEC_RANGE_MA_VMCOREINFO 6 /* machine address and size of vmcoreinfo */ +#define KEXEC_RANGE_MA_LIVEUPDATE 7 /* Boot mem for live update */ /* * Find the address and size of certain memory areas