[HVM] [XEN] Add space for SMBIOS tables to e820 map and fill out hvm_info_table for HVM SMBIOS support. Signed-off-by: Andrew D. Ball <aball@us.ibm.com> diff -r f91cc71173c5 tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Thu Jun 22 20:37:33 2006 +++ b/tools/libxc/xc_hvm_build.c Fri Jul 7 13:48:44 2006 @@ -59,12 +59,12 @@ /* XXX: Doesn''t work for > 4GB yet */ e820entry[nr_map].addr = 0x0; - e820entry[nr_map].size = 0x9F800; + e820entry[nr_map].size = 0x9F000; e820entry[nr_map].type = E820_RAM; nr_map++; - e820entry[nr_map].addr = 0x9F800; - e820entry[nr_map].size = 0x800; + e820entry[nr_map].addr = 0x9F000; + e820entry[nr_map].size = 0x1000; e820entry[nr_map].type = E820_RESERVED; nr_map++; @@ -136,10 +136,14 @@ */ static int set_hvm_info(int xc_handle, uint32_t dom, xen_pfn_t *pfn_list, unsigned int vcpus, - unsigned int pae, unsigned int acpi, unsigned int apic) + uint64_t memsize, + unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, uint8_t uuid[16]) { char *va_map; struct hvm_info_table *va_hvm; + uint32_t xen_version; + char xen_extra_version[XEN_EXTRAVERSION_LEN]; va_map = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, @@ -157,6 +161,24 @@ va_hvm->apic_enabled = apic; va_hvm->pae_enabled = pae; va_hvm->nr_vcpus = vcpus; + va_hvm->memsize = memsize; + va_hvm->smbios_enabled = smbios; + memcpy(va_hvm->uuid, uuid, 16); + + xen_version = xc_version(xc_handle, XENVER_version, NULL); + va_hvm->xen_major_version = (uint16_t) (xen_version >> 16); + va_hvm->xen_minor_version = (uint16_t) xen_version; + + if (xc_version(xc_handle, XENVER_extraversion, &xen_extra_version)) { + /* could not get Xen extra version! */ + PERROR("Could not get Xen extra version for HVM info table!"); + return -1; + } + + snprintf(va_hvm->xen_version, sizeof(va_hvm->xen_version), + "%hd.%hd%s", va_hvm->xen_major_version, va_hvm->xen_minor_version, + xen_extra_version); + va_hvm->xen_version[sizeof(va_hvm->xen_version)-1] = ''\0''; set_hvm_info_checksum(va_hvm); @@ -175,6 +197,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn) { @@ -249,7 +273,8 @@ goto error_out; } - if ( set_hvm_info(xc_handle, dom, page_array, vcpus, pae, acpi, apic) ) + if ( set_hvm_info(xc_handle, dom, page_array, vcpus, memsize, pae, acpi, + apic, smbios, uuid) ) { ERROR("Couldn''t set hvm info for HVM guest.\n"); goto error_out; @@ -345,6 +370,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn) { @@ -399,7 +426,8 @@ ctxt->flags = VGCF_HVM_GUEST; if ( setup_guest(xc_handle, domid, memsize, image, image_size, nr_pages, ctxt, op.u.getdomaininfo.shared_info_frame, - vcpus, pae, acpi, apic, store_evtchn, store_mfn) < 0) + vcpus, pae, acpi, apic, smbios, uuid, + store_evtchn, store_mfn) < 0) { ERROR("Error constructing guest OS"); goto error_out; @@ -591,6 +619,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn) { @@ -605,6 +635,7 @@ sts = xc_hvm_build_internal(xc_handle, domid, memsize, image, image_size, vcpus, pae, acpi, apic, + smbios, uuid, store_evtchn, store_mfn); free(image); @@ -627,6 +658,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn) { @@ -652,6 +685,7 @@ sts = xc_hvm_build_internal(xc_handle, domid, memsize, img, img_len, vcpus, pae, acpi, apic, + smbios, uuid, store_evtchn, store_mfn); /* xc_inflate_buffer may return the original buffer pointer (for diff -r f91cc71173c5 tools/libxc/xenguest.h --- a/tools/libxc/xenguest.h Thu Jun 22 20:37:33 2006 +++ b/tools/libxc/xenguest.h Fri Jul 7 13:48:44 2006 @@ -110,6 +110,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn); @@ -122,6 +124,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn); diff -r f91cc71173c5 tools/libxc/xg_private.c --- a/tools/libxc/xg_private.c Thu Jun 22 20:37:33 2006 +++ b/tools/libxc/xg_private.c Fri Jul 7 13:48:44 2006 @@ -155,6 +155,8 @@ unsigned int pae, unsigned int acpi, unsigned int apic, + unsigned int smbios, + uint8_t uuid[16], unsigned int store_evtchn, unsigned long *store_mfn) { _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel