@@ -20,7 +20,7 @@
#include <sys/mman.h>
#include <xenctrl.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <kernel.h>
#include <console.h>
@@ -8,7 +8,7 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <xenctrl.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <xenstore.h>
#include <xen/sys/xenbus_dev.h>
#include <xen-xsm/flask/flask.h>
@@ -52,20 +52,22 @@ CTRL_SRCS-y += xc_gnttab_compat.c
CTRL_SRCS-y += xc_devicemodel_compat.c
GUEST_SRCS-y :=
-GUEST_SRCS-y += xg_private.c xc_suspend.c
+GUEST_SRCS-y += xg_private.c
+GUEST_SRCS-y += xg_domain.c
+GUEST_SRCS-y += xg_suspend.c
ifeq ($(CONFIG_MIGRATE),y)
-GUEST_SRCS-y += xc_sr_common.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_hvm.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_hvm.c
-GUEST_SRCS-y += xc_sr_restore.c
-GUEST_SRCS-y += xc_sr_save.c
-GUEST_SRCS-y += xc_offline_page.c
+GUEST_SRCS-y += xg_sr_common.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c
+GUEST_SRCS-y += xg_sr_restore.c
+GUEST_SRCS-y += xg_sr_save.c
+GUEST_SRCS-y += xg_offline_page.c
else
-GUEST_SRCS-y += xc_nomigrate.c
+GUEST_SRCS-y += xg_nomigrate.c
endif
vpath %.c ../../xen/common/libelf
@@ -86,25 +88,26 @@ GUEST_SRCS-y += cpuid.c msr.c
endif
# new domain builder
-GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
-GUEST_SRCS-y += xc_dom_elfloader.c
-GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c
-GUEST_SRCS-$(CONFIG_X86) += xc_dom_decompress_lz4.c
-GUEST_SRCS-$(CONFIG_X86) += xc_dom_hvmloader.c
-GUEST_SRCS-$(CONFIG_ARM) += xc_dom_armzimageloader.c
-GUEST_SRCS-y += xc_dom_binloader.c
-GUEST_SRCS-y += xc_dom_compat_linux.c
-
-GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
-GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c
-GUEST_SRCS-$(CONFIG_ARM) += xc_dom_arm.c
+GUEST_SRCS-y += xg_dom_core.c
+GUEST_SRCS-y += xg_dom_boot.c
+GUEST_SRCS-y += xg_dom_elfloader.c
+GUEST_SRCS-$(CONFIG_X86) += xg_dom_bzimageloader.c
+GUEST_SRCS-$(CONFIG_X86) += xg_dom_decompress_lz4.c
+GUEST_SRCS-$(CONFIG_X86) += xg_dom_hvmloader.c
+GUEST_SRCS-$(CONFIG_ARM) += xg_dom_armzimageloader.c
+GUEST_SRCS-y += xg_dom_binloader.c
+GUEST_SRCS-y += xg_dom_compat_linux.c
+
+GUEST_SRCS-$(CONFIG_X86) += xg_dom_x86.c
+GUEST_SRCS-$(CONFIG_X86) += xg_cpuid_x86.c
+GUEST_SRCS-$(CONFIG_ARM) += xg_dom_arm.c
ifeq ($(CONFIG_LIBXC_MINIOS),y)
-GUEST_SRCS-y += xc_dom_decompress_unsafe.c
-GUEST_SRCS-y += xc_dom_decompress_unsafe_bzip2.c
-GUEST_SRCS-y += xc_dom_decompress_unsafe_lzma.c
-GUEST_SRCS-y += xc_dom_decompress_unsafe_lzo1x.c
-GUEST_SRCS-y += xc_dom_decompress_unsafe_xz.c
+GUEST_SRCS-y += xg_dom_decompress_unsafe.c
+GUEST_SRCS-y += xg_dom_decompress_unsafe_bzip2.c
+GUEST_SRCS-y += xg_dom_decompress_unsafe_lzma.c
+GUEST_SRCS-y += xg_dom_decompress_unsafe_lzo1x.c
+GUEST_SRCS-y += xg_dom_decompress_unsafe_xz.c
endif
-include $(XEN_TARGET_ARCH)/Makefile
@@ -190,7 +193,7 @@ install: build
$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
- $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrl_dom.h $(DESTDIR)$(includedir)
$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -210,6 +213,7 @@ uninstall:
rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xencontrol.pc
rm -f $(DESTDIR)$(includedir)/xenctrl.h
rm -f $(DESTDIR)$(includedir)/xenctrl_compat.h
+ rm -f $(DESTDIR)$(includedir)/xenctrl_dom.h
rm -f $(DESTDIR)$(libdir)/libxenctrl.so
rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR).$(MINOR)
similarity index 98%
rename from tools/libxc/include/xc_dom.h
rename to tools/libxc/include/xenctrl_dom.h
@@ -17,9 +17,7 @@
#define _XC_DOM_H
#include <xen/libelf/libelf.h>
-#include <xenguest.h>
-#define INVALID_PFN ((xen_pfn_t)-1)
#define X86_HVM_NR_SPECIAL_PAGES 8
#define X86_HVM_END_SPECIAL_REGION 0xff000u
#define XG_MAX_MODULES 2
@@ -38,6 +36,12 @@ struct xc_dom_seg {
xen_pfn_t pages;
};
+struct xc_hvm_firmware_module {
+ uint8_t *data;
+ uint32_t length;
+ uint64_t guest_addr_out;
+};
+
struct xc_dom_mem {
struct xc_dom_mem *next;
void *ptr;
@@ -255,6 +259,8 @@ struct xc_dom_arch {
int (*setup_pgtables) (struct xc_dom_image * dom);
/* arch-specific data structs setup */
+ /* in Mini-OS environment start_info might be a macro, avoid collision. */
+#undef start_info
int (*start_info) (struct xc_dom_image * dom);
int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
int (*vcpu) (struct xc_dom_image * dom);
@@ -22,6 +22,8 @@
#ifndef XENGUEST_H
#define XENGUEST_H
+#include <xenctrl_dom.h>
+
#define XC_NUMA_NO_NODE (~0U)
#define XCFLAGS_LIVE (1 << 0)
@@ -249,12 +251,6 @@ int xc_linux_build(xc_interface *xch,
unsigned int console_evtchn,
unsigned long *console_mfn);
-struct xc_hvm_firmware_module {
- uint8_t *data;
- uint32_t length;
- uint64_t guest_addr_out;
-};
-
/*
* Sets *lockfd to -1.
* Has deallocated everything even on error.
@@ -60,12 +60,13 @@
*
*/
-#include "xg_private.h"
+#include "xc_private.h"
#include "xc_core.h"
-#include "xc_dom.h"
#include <stdlib.h>
#include <unistd.h>
+#include <xen/libelf/libelf.h>
+
/* number of pages to write at a time */
#define DUMP_INCREMENT (4 * 1024)
@@ -21,7 +21,7 @@
#define XC_CORE_H
#include "xen/version.h"
-#include "xg_private.h"
+#include "xc_private.h"
#include "xen/libelf/elfstructs.h"
/* section names */
@@ -16,7 +16,7 @@
*
*/
-#include "xg_private.h"
+#include "xc_private.h"
#include "xc_core.h"
#include <xen-tools/libs.h>
@@ -17,12 +17,10 @@
*
*/
-#include "xg_private.h"
+#include "xc_private.h"
#include "xc_core.h"
#include <xen/hvm/e820.h>
-#define GET_FIELD(_p, _f) ((dinfo->guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f))
-
int
xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
unsigned long pfn)
@@ -98,7 +96,7 @@ xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc
live_p2m_frame_list_list =
xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ,
- GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list));
+ GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width));
if ( !live_p2m_frame_list_list )
{
@@ -21,8 +21,7 @@
#include "xc_private.h"
#include "xc_core.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
+#include "xc_private.h"
#include <xen/memory.h>
#include <xen/hvm/hvm_op.h>
@@ -1892,132 +1891,6 @@ int xc_domain_unbind_pt_spi_irq(xc_interface *xch,
PT_IRQ_TYPE_SPI, 0, 0, 0, 0, spi));
}
-int xc_unmap_domain_meminfo(xc_interface *xch, struct xc_domain_meminfo *minfo)
-{
- struct domain_info_context _di = { .guest_width = minfo->guest_width,
- .p2m_size = minfo->p2m_size};
- struct domain_info_context *dinfo = &_di;
-
- free(minfo->pfn_type);
- if ( minfo->p2m_table )
- munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE);
- minfo->p2m_table = NULL;
-
- return 0;
-}
-
-int xc_map_domain_meminfo(xc_interface *xch, uint32_t domid,
- struct xc_domain_meminfo *minfo)
-{
- struct domain_info_context _di;
- struct domain_info_context *dinfo = &_di;
-
- xc_dominfo_t info;
- shared_info_any_t *live_shinfo;
- xen_capabilities_info_t xen_caps = "";
- int i;
-
- /* Only be initialized once */
- if ( minfo->pfn_type || minfo->p2m_table )
- {
- errno = EINVAL;
- return -1;
- }
-
- if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 )
- {
- PERROR("Could not get domain info");
- return -1;
- }
-
- if ( xc_domain_get_guest_width(xch, domid, &minfo->guest_width) )
- {
- PERROR("Could not get domain address size");
- return -1;
- }
- _di.guest_width = minfo->guest_width;
-
- /* Get page table levels (see get_platform_info() in xg_save_restore.h */
- if ( xc_version(xch, XENVER_capabilities, &xen_caps) )
- {
- PERROR("Could not get Xen capabilities (for page table levels)");
- return -1;
- }
- if ( strstr(xen_caps, "xen-3.0-x86_64") )
- /* Depends on whether it's a compat 32-on-64 guest */
- minfo->pt_levels = ( (minfo->guest_width == 8) ? 4 : 3 );
- else if ( strstr(xen_caps, "xen-3.0-x86_32p") )
- minfo->pt_levels = 3;
- else if ( strstr(xen_caps, "xen-3.0-x86_32") )
- minfo->pt_levels = 2;
- else
- {
- errno = EFAULT;
- return -1;
- }
-
- /* We need the shared info page for mapping the P2M */
- live_shinfo = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ,
- info.shared_info_frame);
- if ( !live_shinfo )
- {
- PERROR("Could not map the shared info frame (MFN 0x%lx)",
- info.shared_info_frame);
- return -1;
- }
-
- if ( xc_core_arch_map_p2m_writable(xch, minfo->guest_width, &info,
- live_shinfo, &minfo->p2m_table,
- &minfo->p2m_size) )
- {
- PERROR("Could not map the P2M table");
- munmap(live_shinfo, PAGE_SIZE);
- return -1;
- }
- munmap(live_shinfo, PAGE_SIZE);
- _di.p2m_size = minfo->p2m_size;
-
- /* Make space and prepare for getting the PFN types */
- minfo->pfn_type = calloc(sizeof(*minfo->pfn_type), minfo->p2m_size);
- if ( !minfo->pfn_type )
- {
- PERROR("Could not allocate memory for the PFN types");
- goto failed;
- }
- for ( i = 0; i < minfo->p2m_size; i++ )
- minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table,
- minfo->guest_width);
-
- /* Retrieve PFN types in batches */
- for ( i = 0; i < minfo->p2m_size ; i+=1024 )
- {
- int count = ((minfo->p2m_size - i ) > 1024 ) ?
- 1024: (minfo->p2m_size - i);
-
- if ( xc_get_pfn_type_batch(xch, domid, count, minfo->pfn_type + i) )
- {
- PERROR("Could not get %d-eth batch of PFN types", (i+1)/1024);
- goto failed;
- }
- }
-
- return 0;
-
-failed:
- if ( minfo->pfn_type )
- {
- free(minfo->pfn_type);
- minfo->pfn_type = NULL;
- }
- if ( minfo->p2m_table )
- {
- munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE);
- minfo->p2m_table = NULL;
- }
-
- return -1;
-}
-
int xc_domain_memory_mapping(
xc_interface *xch,
uint32_t domid,
deleted file mode 100644
@@ -1,158 +0,0 @@
-/*
- * Extensible Firmware Interface
- * Based on 'Extensible Firmware Interface Specification' version 0.9, April 30, 1999
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 1999 VA Linux Systems
- * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
- * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
- * David Mosberger-Tang <davidm@hpl.hp.com>
- * Stephane Eranian <eranian@hpl.hp.com>
- */
-
-#ifndef XC_EFI_H
-#define XC_EFI_H
-
-/* definitions from xen/include/asm-ia64/linux-xen/linux/efi.h */
-
-typedef struct {
- uint8_t b[16];
-} efi_guid_t;
-
-#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
-((efi_guid_t) \
-{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
- (b) & 0xff, ((b) >> 8) & 0xff, \
- (c) & 0xff, ((c) >> 8) & 0xff, \
- (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
-
-/*
- * Generic EFI table header
- */
-typedef struct {
- uint64_t signature;
- uint32_t revision;
- uint32_t headersize;
- uint32_t crc32;
- uint32_t reserved;
-} efi_table_hdr_t;
-
-/*
- * Memory map descriptor:
- */
-
-/* Memory types: */
-#define EFI_RESERVED_TYPE 0
-#define EFI_LOADER_CODE 1
-#define EFI_LOADER_DATA 2
-#define EFI_BOOT_SERVICES_CODE 3
-#define EFI_BOOT_SERVICES_DATA 4
-#define EFI_RUNTIME_SERVICES_CODE 5
-#define EFI_RUNTIME_SERVICES_DATA 6
-#define EFI_CONVENTIONAL_MEMORY 7
-#define EFI_UNUSABLE_MEMORY 8
-#define EFI_ACPI_RECLAIM_MEMORY 9
-#define EFI_ACPI_MEMORY_NVS 10
-#define EFI_MEMORY_MAPPED_IO 11
-#define EFI_MEMORY_MAPPED_IO_PORT_SPACE 12
-#define EFI_PAL_CODE 13
-#define EFI_MAX_MEMORY_TYPE 14
-
-/* Attribute values: */
-#define EFI_MEMORY_UC ((uint64_t)0x0000000000000001ULL) /* uncached */
-#define EFI_MEMORY_WC ((uint64_t)0x0000000000000002ULL) /* write-coalescing */
-#define EFI_MEMORY_WT ((uint64_t)0x0000000000000004ULL) /* write-through */
-#define EFI_MEMORY_WB ((uint64_t)0x0000000000000008ULL) /* write-back */
-#define EFI_MEMORY_WP ((uint64_t)0x0000000000001000ULL) /* write-protect */
-#define EFI_MEMORY_RP ((uint64_t)0x0000000000002000ULL) /* read-protect */
-#define EFI_MEMORY_XP ((uint64_t)0x0000000000004000ULL) /* execute-protect */
-#define EFI_MEMORY_RUNTIME ((uint64_t)0x8000000000000000ULL) /* range requires runtime mapping */
-#define EFI_MEMORY_DESCRIPTOR_VERSION 1
-
-#define EFI_PAGE_SHIFT 12
-
-/*
- * For current x86 implementations of EFI, there is
- * additional padding in the mem descriptors. This is not
- * the case in ia64. Need to have this fixed in the f/w.
- */
-typedef struct {
- uint32_t type;
- uint32_t pad;
- uint64_t phys_addr;
- uint64_t virt_addr;
- uint64_t num_pages;
- uint64_t attribute;
-#if defined (__i386__)
- uint64_t pad1;
-#endif
-} efi_memory_desc_t;
-
-/*
- * EFI Runtime Services table
- */
-#define EFI_RUNTIME_SERVICES_SIGNATURE ((uint64_t)0x5652453544e5552ULL)
-#define EFI_RUNTIME_SERVICES_REVISION 0x00010000
-
-typedef struct {
- efi_table_hdr_t hdr;
- unsigned long get_time;
- unsigned long set_time;
- unsigned long get_wakeup_time;
- unsigned long set_wakeup_time;
- unsigned long set_virtual_address_map;
- unsigned long convert_pointer;
- unsigned long get_variable;
- unsigned long get_next_variable;
- unsigned long set_variable;
- unsigned long get_next_high_mono_count;
- unsigned long reset_system;
-} efi_runtime_services_t;
-
-/*
- * EFI Configuration Table and GUID definitions
- */
-#define NULL_GUID \
- EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 )
-#define ACPI_20_TABLE_GUID \
- EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 )
-#define SAL_SYSTEM_TABLE_GUID \
- EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
-
-typedef struct {
- efi_guid_t guid;
- unsigned long table;
-} efi_config_table_t;
-
-#define EFI_SYSTEM_TABLE_SIGNATURE ((uint64_t)0x5453595320494249ULL)
-#define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00)
-
-typedef struct {
- efi_table_hdr_t hdr;
- unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
- uint32_t fw_revision;
- unsigned long con_in_handle;
- unsigned long con_in;
- unsigned long con_out_handle;
- unsigned long con_out;
- unsigned long stderr_handle;
- unsigned long stderr;
- efi_runtime_services_t *runtime;
- unsigned long boottime;
- unsigned long nr_tables;
- unsigned long tables;
-} efi_system_table_t;
-
-#endif /* XC_EFI_H */
deleted file mode 100644
@@ -1,16 +0,0 @@
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <xen/libelf/elfstructs.h>
@@ -19,7 +19,6 @@
#include <string.h>
#include "xc_private.h"
-#include "xg_private.h"
xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) = {
.hbuf = NULL,
@@ -18,8 +18,7 @@
*/
#include "xc_private.h"
-#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
+#include <limits.h>
#include <sys/ioctl.h>
#include "_paths.h"
@@ -62,6 +63,39 @@ struct iovec {
#include <sys/uio.h>
#endif
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f))
+
+#define SET_FIELD(_p, _f, _v, _w) do { \
+ if ((_w) == 8) \
+ (_p)->x64._f = (_v); \
+ else \
+ (_p)->x32._f = (_v); \
+} while (0)
+
+/* XXX SMH: following skanky macros rely on variable p2m_size being set */
+/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */
+
+struct domain_info_context {
+ unsigned int guest_width;
+ unsigned long p2m_size;
+};
+
+/* Number of xen_pfn_t in a page */
+#define FPP (PAGE_SIZE/(dinfo->guest_width))
+
+/* Number of entries in the pfn_to_mfn_frame_list_list */
+#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP))
+
+/* Number of entries in the pfn_to_mfn_frame_list */
+#define P2M_FL_ENTRIES (((dinfo->p2m_size)+FPP-1)/FPP)
+
+/* Size in bytes of the pfn_to_mfn_frame_list */
+#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width))
+#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) * \
+ max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width))
+
#define DECLARE_DOMCTL struct xen_domctl domctl
#define DECLARE_SYSCTL struct xen_sysctl sysctl
#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
@@ -75,6 +109,8 @@ struct iovec {
#define PAGE_SIZE XC_PAGE_SIZE
#define PAGE_MASK XC_PAGE_MASK
+#define INVALID_PFN ((xen_pfn_t)-1)
+
/*
** Define max dirty page cache to permit during save/restore -- need to balance
** keeping cache usage down with CPU impact of invalidating too often.
@@ -14,8 +14,6 @@
*/
#include "xc_private.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
#if defined(__i386__) || defined(__x86_64__)
similarity index 100%
rename from tools/libxc/xc_cpuid_x86.c
rename to tools/libxc/xg_cpuid_x86.c
similarity index 99%
rename from tools/libxc/xc_dom_arm.c
rename to tools/libxc/xg_dom_arm.c
@@ -24,7 +24,7 @@
#include <xen-tools/libs.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#define NR_MAGIC_PAGES 4
#define CONSOLE_PFN_OFFSET 0
similarity index 99%
rename from tools/libxc/xc_dom_armzimageloader.c
rename to tools/libxc/xg_dom_armzimageloader.c
@@ -25,7 +25,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include <arpa/inet.h> /* XXX ntohl is not the right function... */
similarity index 99%
rename from tools/libxc/xc_dom_binloader.c
rename to tools/libxc/xg_dom_binloader.c
@@ -83,7 +83,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#define round_pgup(_p) (((_p)+(PAGE_SIZE_X86-1))&PAGE_MASK_X86)
#define round_pgdown(_p) ((_p)&PAGE_MASK_X86)
similarity index 99%
rename from tools/libxc/xc_dom_boot.c
rename to tools/libxc/xg_dom_boot.c
@@ -31,7 +31,7 @@
#include <zlib.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xc_core.h"
#include <xen/hvm/params.h>
#include <xen/grant_table.h>
similarity index 99%
rename from tools/libxc/xc_dom_bzimageloader.c
rename to tools/libxc/xg_dom_bzimageloader.c
@@ -32,7 +32,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom_decompress.h"
+#include "xg_dom_decompress.h"
#include <xen-tools/libs.h>
similarity index 99%
rename from tools/libxc/xc_dom_compat_linux.c
rename to tools/libxc/xg_dom_compat_linux.c
@@ -30,7 +30,7 @@
#include "xenctrl.h"
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
/* ------------------------------------------------------------------------ */
similarity index 99%
rename from tools/libxc/xc_dom_core.c
rename to tools/libxc/xg_dom_core.c
@@ -32,7 +32,7 @@
#include <assert.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "_paths.h"
/* ------------------------------------------------------------------------ */
similarity index 62%
rename from tools/libxc/xc_dom_decompress.h
rename to tools/libxc/xg_dom_decompress.h
@@ -1,7 +1,7 @@
#ifndef __MINIOS__
-# include "xc_dom.h"
+# include "xenctrl_dom.h"
#else
-# include "xc_dom_decompress_unsafe.h"
+# include "xg_dom_decompress_unsafe.h"
#endif
int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size);
similarity index 98%
rename from tools/libxc/xc_dom_decompress_lz4.c
rename to tools/libxc/xg_dom_decompress_lz4.c
@@ -4,7 +4,7 @@
#include <stdint.h>
#include "xg_private.h"
-#include "xc_dom_decompress.h"
+#include "xg_dom_decompress.h"
#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
similarity index 96%
rename from tools/libxc/xc_dom_decompress_unsafe.c
rename to tools/libxc/xg_dom_decompress_unsafe.c
@@ -3,7 +3,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
static struct xc_dom_image *unsafe_dom;
static unsigned char *output_blob;
similarity index 97%
rename from tools/libxc/xc_dom_decompress_unsafe.h
rename to tools/libxc/xg_dom_decompress_unsafe.h
@@ -1,4 +1,4 @@
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
int (*fill)(void*, unsigned int),
similarity index 87%
rename from tools/libxc/xc_dom_decompress_unsafe_bzip2.c
rename to tools/libxc/xg_dom_decompress_unsafe_bzip2.c
@@ -3,7 +3,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
#include "../../xen/common/bunzip2.c"
similarity index 87%
rename from tools/libxc/xc_dom_decompress_unsafe_lzma.c
rename to tools/libxc/xg_dom_decompress_unsafe_lzma.c
@@ -3,7 +3,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
#include "../../xen/common/unlzma.c"
similarity index 96%
rename from tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
rename to tools/libxc/xg_dom_decompress_unsafe_lzo1x.c
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
typedef uint8_t u8;
typedef uint32_t u32;
similarity index 95%
rename from tools/libxc/xc_dom_decompress_unsafe_xz.c
rename to tools/libxc/xg_dom_decompress_unsafe_xz.c
@@ -6,7 +6,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
// TODO
#define XZ_DEC_X86
similarity index 99%
rename from tools/libxc/xc_dom_elfloader.c
rename to tools/libxc/xg_dom_elfloader.c
@@ -26,7 +26,7 @@
#include <inttypes.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xc_bitops.h"
#define XEN_VER "xen-3.0"
similarity index 99%
rename from tools/libxc/xc_dom_hvmloader.c
rename to tools/libxc/xg_dom_hvmloader.c
@@ -26,7 +26,7 @@
#include <assert.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xc_bitops.h"
/* ------------------------------------------------------------------------ */
similarity index 99%
rename from tools/libxc/xc_dom_x86.c
rename to tools/libxc/xg_dom_x86.c
@@ -38,7 +38,7 @@
#include <xen-tools/libs.h>
#include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xenctrl.h"
/* ------------------------------------------------------------------------ */
new file mode 100644
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * xc_domain.c
+ *
+ * API for manipulating and obtaining information on domains.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (c) 2003, K A Fraser.
+ */
+
+#include "xg_private.h"
+#include "xc_core.h"
+
+int xc_unmap_domain_meminfo(xc_interface *xch, struct xc_domain_meminfo *minfo)
+{
+ struct domain_info_context _di = { .guest_width = minfo->guest_width,
+ .p2m_size = minfo->p2m_size};
+ struct domain_info_context *dinfo = &_di;
+
+ free(minfo->pfn_type);
+ if ( minfo->p2m_table )
+ munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE);
+ minfo->p2m_table = NULL;
+
+ return 0;
+}
+
+int xc_map_domain_meminfo(xc_interface *xch, uint32_t domid,
+ struct xc_domain_meminfo *minfo)
+{
+ struct domain_info_context _di;
+ struct domain_info_context *dinfo = &_di;
+
+ xc_dominfo_t info;
+ shared_info_any_t *live_shinfo;
+ xen_capabilities_info_t xen_caps = "";
+ int i;
+
+ /* Only be initialized once */
+ if ( minfo->pfn_type || minfo->p2m_table )
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 )
+ {
+ PERROR("Could not get domain info");
+ return -1;
+ }
+
+ if ( xc_domain_get_guest_width(xch, domid, &minfo->guest_width) )
+ {
+ PERROR("Could not get domain address size");
+ return -1;
+ }
+ _di.guest_width = minfo->guest_width;
+
+ /* Get page table levels (see get_platform_info() in xg_save_restore.h */
+ if ( xc_version(xch, XENVER_capabilities, &xen_caps) )
+ {
+ PERROR("Could not get Xen capabilities (for page table levels)");
+ return -1;
+ }
+ if ( strstr(xen_caps, "xen-3.0-x86_64") )
+ /* Depends on whether it's a compat 32-on-64 guest */
+ minfo->pt_levels = ( (minfo->guest_width == 8) ? 4 : 3 );
+ else if ( strstr(xen_caps, "xen-3.0-x86_32p") )
+ minfo->pt_levels = 3;
+ else if ( strstr(xen_caps, "xen-3.0-x86_32") )
+ minfo->pt_levels = 2;
+ else
+ {
+ errno = EFAULT;
+ return -1;
+ }
+
+ /* We need the shared info page for mapping the P2M */
+ live_shinfo = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ,
+ info.shared_info_frame);
+ if ( !live_shinfo )
+ {
+ PERROR("Could not map the shared info frame (MFN 0x%lx)",
+ info.shared_info_frame);
+ return -1;
+ }
+
+ if ( xc_core_arch_map_p2m_writable(xch, minfo->guest_width, &info,
+ live_shinfo, &minfo->p2m_table,
+ &minfo->p2m_size) )
+ {
+ PERROR("Could not map the P2M table");
+ munmap(live_shinfo, PAGE_SIZE);
+ return -1;
+ }
+ munmap(live_shinfo, PAGE_SIZE);
+ _di.p2m_size = minfo->p2m_size;
+
+ /* Make space and prepare for getting the PFN types */
+ minfo->pfn_type = calloc(sizeof(*minfo->pfn_type), minfo->p2m_size);
+ if ( !minfo->pfn_type )
+ {
+ PERROR("Could not allocate memory for the PFN types");
+ goto failed;
+ }
+ for ( i = 0; i < minfo->p2m_size; i++ )
+ minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table,
+ minfo->guest_width);
+
+ /* Retrieve PFN types in batches */
+ for ( i = 0; i < minfo->p2m_size ; i+=1024 )
+ {
+ int count = ((minfo->p2m_size - i ) > 1024 ) ?
+ 1024: (minfo->p2m_size - i);
+
+ if ( xc_get_pfn_type_batch(xch, domid, count, minfo->pfn_type + i) )
+ {
+ PERROR("Could not get %d-eth batch of PFN types", (i+1)/1024);
+ goto failed;
+ }
+ }
+
+ return 0;
+
+failed:
+ if ( minfo->pfn_type )
+ {
+ free(minfo->pfn_type);
+ minfo->pfn_type = NULL;
+ }
+ if ( minfo->p2m_table )
+ {
+ munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE);
+ minfo->p2m_table = NULL;
+ }
+
+ return -1;
+}
similarity index 100%
rename from tools/libxc/xc_nomigrate.c
rename to tools/libxc/xg_nomigrate.c
similarity index 99%
rename from tools/libxc/xc_offline_page.c
rename to tools/libxc/xg_offline_page.c
@@ -28,7 +28,7 @@
#include <xc_core.h>
#include "xc_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xg_private.h"
#include "xg_save_restore.h"
@@ -97,15 +97,6 @@ typedef uint64_t x86_pgentry_t;
#define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT)
-
-/* XXX SMH: following skanky macros rely on variable p2m_size being set */
-/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */
-
-struct domain_info_context {
- unsigned int guest_width;
- unsigned long p2m_size;
-};
-
static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
unsigned gwidth)
{
@@ -121,19 +112,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
}
}
-/* Number of xen_pfn_t in a page */
-#define FPP (PAGE_SIZE/(dinfo->guest_width))
-
-/* Number of entries in the pfn_to_mfn_frame_list_list */
-#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP))
-
-/* Number of entries in the pfn_to_mfn_frame_list */
-#define P2M_FL_ENTRIES (((dinfo->p2m_size)+FPP-1)/FPP)
-
-/* Size in bytes of the pfn_to_mfn_frame_list */
-#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width))
-#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) * \
- max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width))
/* Masks for PTE<->PFN conversions */
#define MADDR_BITS_X86 ((dinfo->guest_width == 8) ? 52 : 44)
@@ -109,15 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom,
#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT)
#define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT)
-#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f))
-
-#define SET_FIELD(_p, _f, _v, _w) do { \
- if ((_w) == 8) \
- (_p)->x64._f = (_v); \
- else \
- (_p)->x32._f = (_v); \
-} while (0)
-
#define UNFOLD_CR3(_c) \
((uint64_t)((dinfo->guest_width == 8) \
? ((_c) >> 12) \
similarity index 99%
rename from tools/libxc/xc_sr_common.c
rename to tools/libxc/xg_sr_common.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
#include <xen-tools/libs.h>
similarity index 99%
rename from tools/libxc/xc_sr_common.h
rename to tools/libxc/xg_sr_common.h
@@ -5,10 +5,10 @@
#include "xg_private.h"
#include "xg_save_restore.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include "xc_bitops.h"
-#include "xc_sr_stream_format.h"
+#include "xg_sr_stream_format.h"
/* String representation of Domain Header types. */
const char *dhdr_type_to_str(uint32_t type);
similarity index 99%
rename from tools/libxc/xc_sr_common_x86.c
rename to tools/libxc/xg_sr_common_x86.c
@@ -1,4 +1,4 @@
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
int write_x86_tsc_info(struct xc_sr_context *ctx)
{
similarity index 98%
rename from tools/libxc/xc_sr_common_x86.h
rename to tools/libxc/xg_sr_common_x86.h
@@ -1,7 +1,7 @@
#ifndef __COMMON_X86__H
#define __COMMON_X86__H
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
/*
* Obtains a domains TSC information from Xen and writes a X86_TSC_INFO record
similarity index 99%
rename from tools/libxc/xc_sr_common_x86_pv.c
rename to tools/libxc/xg_sr_common_x86_pv.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
xen_pfn_t mfn_to_pfn(struct xc_sr_context *ctx, xen_pfn_t mfn)
{
similarity index 98%
rename from tools/libxc/xc_sr_common_x86_pv.h
rename to tools/libxc/xg_sr_common_x86_pv.h
@@ -1,7 +1,7 @@
#ifndef __COMMON_X86_PV_H
#define __COMMON_X86_PV_H
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
/* Virtual address ranges reserved for hypervisor. */
#define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL
similarity index 99%
rename from tools/libxc/xc_sr_restore.c
rename to tools/libxc/xg_sr_restore.c
@@ -2,7 +2,7 @@
#include <assert.h>
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
/*
* Read and validate the Image and Domain headers.
similarity index 99%
rename from tools/libxc/xc_sr_restore_x86_hvm.c
rename to tools/libxc/xg_sr_restore_x86_hvm.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <arpa/inet.h>
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
/*
* Process an HVM_CONTEXT record from the stream.
similarity index 99%
rename from tools/libxc/xc_sr_restore_x86_pv.c
rename to tools/libxc/xg_sr_restore_x86_pv.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
static xen_pfn_t pfn_to_mfn(const struct xc_sr_context *ctx, xen_pfn_t pfn)
{
similarity index 99%
rename from tools/libxc/xc_sr_save.c
rename to tools/libxc/xg_sr_save.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <arpa/inet.h>
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
/*
* Writes an Image header and Domain header into the stream.
similarity index 99%
rename from tools/libxc/xc_sr_save_x86_hvm.c
rename to tools/libxc/xg_sr_save_x86_hvm.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
#include <xen/hvm/params.h>
similarity index 99%
rename from tools/libxc/xc_sr_save_x86_pv.c
rename to tools/libxc/xg_sr_save_x86_pv.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <limits.h>
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
/* Check a 64 bit virtual address for being canonical. */
static inline bool is_canonical_address(xen_vaddr_t vaddr)
similarity index 100%
rename from tools/libxc/xc_sr_stream_format.h
rename to tools/libxc/xg_sr_stream_format.h
similarity index 100%
rename from tools/libxc/xc_suspend.c
rename to tools/libxc/xg_suspend.c
@@ -3,7 +3,7 @@
#include "libxl_libfdt_compat.h"
#include "libxl_arm.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <stdbool.h>
#include <libfdt.h>
#include <assert.h>
@@ -17,7 +17,7 @@
#include "libxl_internal.h"
#include "libxl_arch.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
_hidden
int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
@@ -20,7 +20,7 @@
#include "libxl_internal.h"
#include "libxl_arch.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <xenguest.h>
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/e820.h>
@@ -19,7 +19,7 @@
#include "libxl_internal.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <xen/hvm/e820.h>
#include <sys/types.h>
#include <pwd.h>
@@ -20,7 +20,7 @@
#include "libxl_internal.h"
#include "libxl_arch.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/hvm_xs_strings.h>
#include <xen/hvm/e820.h>
@@ -57,7 +57,7 @@
#include <xenctrl.h>
#include <xenguest.h>
#include <xenhypfs.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
#include <xen-tools/libs.h>
@@ -17,7 +17,7 @@
#include "libxl_arch.h"
#include <stdlib.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
{
@@ -1,7 +1,7 @@
#include "libxl_internal.h"
#include "libxl_arch.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
int libxl__arch_domain_prepare_config(libxl__gc *gc,
libxl_domain_config *d_config,
@@ -18,7 +18,7 @@
#include <xen/hvm/e820.h>
#include "libacpi/libacpi.h"
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
/* Number of pages holding ACPI tables */
#define NUM_ACPI_PAGES 16
@@ -17,7 +17,7 @@
#include <arpa/inet.h>
#include <xen/elfnote.h>
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/params.h>
@@ -12,7 +12,7 @@
#include <sys/mman.h>
#include <xg_private.h>
-#include <xc_dom.h> /* gunzip bits */
+#include <xenctrl_dom.h> /* gunzip bits */
#include <xen/libelf/libelf.h>