#include <xen/mm.h>
#include <xen/kexec.h>
#include <xen/kimage.h>
+#include <xen/lu.h>
#include <asm/page.h>
return ret;
}
+#ifdef CONFIG_LIVE_UPDATE
+int kimage_add_live_update_data(struct kexec_image *image, mfn_t data, int nr_mfns)
+{
+ int ret;
+
+ /*
+ * For live update, we place the physical location of 'data'
+ * into the first 64 bits of the reserved live update bootmem
+ * region. At 'data' is an MFN list of pages containing the
+ * actual live update stream, which the new Xen can vmap().
+ *
+ * Append IND_WRITE64 operations to the end of the kimage stream
+ * to store the live update magic and the address of 'data' for
+ * the new Xen to see.
+ */
+ if (!lu_bootmem_start || kimage_dst_used(image, lu_bootmem_start))
+ return -EINVAL;
+
+ ret = machine_kexec_add_page(image, lu_bootmem_start, lu_bootmem_start);
+ if ( ret < 0 )
+ return ret;
+
+ ret = kimage_set_destination(image, lu_bootmem_start);
+ if (!ret)
+ ret = kimage_add_entry(image, LIVE_UPDATE_MAGIC | IND_WRITE64);
+ if (!ret)
+ ret = kimage_add_entry(image, mfn_to_maddr(data) | IND_WRITE64);
+ if (!ret)
+ ret = kimage_add_entry(image, (nr_mfns << PAGE_SHIFT) | IND_WRITE64);
+
+ kimage_terminate(image);
+
+ return ret;
+}
+#endif /* CONFIG_LIVE_UPDATE */
+
/*
* Local variables:
* mode: C
int kimage_build_ind(struct kexec_image *image, mfn_t ind_mfn,
bool_t compat);
+int kimage_add_live_update_data(struct kexec_image *image, mfn_t data,
+ int nr_mfns);
+
#endif /* __ASSEMBLY__ */
#endif /* __XEN_KIMAGE_H__ */