Skip to contentSkip to conversation

libxc: Defer initialization of start_page for HVM guests

PATCH New Boris Ostrovsky 1 participant 1 message Jan 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 libxc: Defer initialization of start_page for HVM guests

With commit 8c45adec18e0 ("libxc: create unmapped initrd in domain builder if supported") location of ramdisk may not be available to HVMlite guests by the time alloc_magic_pages_hvm() is invoked if the guest supports unmapped initrd.

So let's move ramdisk info initialization (along with a few other operations that are not directly related to allocating magic/special pages) from alloc_magic_pages_hvm() to bootlate_hvm().

Since we now split allocation and mapping of the start_info segment let's stash it, along with cmdline length, in xc_dom_image so that we can check whether we are mapping correctly-sized range.

We can also stop using xc_dom_image.start_info_pfn and leave it for PV(H) guests only.

---
v4:
* See the last two paragraphs from commit message above

 tools/libxc/include/xc_dom.h |    2 +
 tools/libxc/xc_dom_x86.c     |  140 +++++++++++++++++++++++------------------
 2 files changed, 80 insertions(+), 62 deletions(-)
tools/libxc/include/xc_dom.h +2 -0
index 2460818..cac4698 100644
@@ -71,6 +71,7 @@ struct xc_dom_image {
 
     /* arguments and parameters */
     char *cmdline;
+    size_t cmdline_size;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
 
     /* info from (elf) kernel image */
@@ -91,6 +92,7 @@ struct xc_dom_image {
     struct xc_dom_seg p2m_seg;
     struct xc_dom_seg pgtables_seg;
     struct xc_dom_seg devicetree_seg;
+    struct xc_dom_seg start_info_seg; /* HVMlite only */
     xen_pfn_t start_info_pfn;
     xen_pfn_t console_pfn;
     xen_pfn_t xenstore_pfn;
tools/libxc/xc_dom_x86.c +78 -62

181 lines not on this page · raw message

Signature · 1 line
1.7.1