]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
Add KEXEC_RANGE_MA_LIVEUPDATE liveupdate
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 12 Dec 2019 17:02:10 +0000 (17:02 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 12 Dec 2019 17:02:13 +0000 (17:02 +0000)
This allows kexec userspace to tell the next Xen where the range is,
on its command line.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
xen/arch/x86/machine_kexec.c
xen/arch/x86/setup.c
xen/include/public/kexec.h

index b70d5a6a86e734196dabbde618ed77db00fcc6f1..f0c4617234a0238ce92944dd8e572deee8ca6ce1 100644 (file)
@@ -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)
index 0374c060e93c9efe9421a55062ab85ed90c117a8..d947072492c06aa3ec0e4cb362c840a8d151826e 100644 (file)
@@ -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)
 {
index 74ea981ab26f5fd180ada445313689f89aa5334e..414df9b5b22ca06f2b2191d362f96dab583b9e30 100644 (file)
@@ -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