From: "Andrew D. Ball" <aball@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] HVM SMBIOS v2 2/5
Date: Wed, 12 Jul 2006 17:26:07 -0400 [thread overview]
Message-ID: <44B568EF.2000007@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
This patch modifies HVM domain builder code in libxenguest to
(1) take the domU's UUID as an argument
(2) fill in the new fields in hvm_info_table needed for SMBIOS
[-- Attachment #2: smbios_2-libxenguest.patch --]
[-- Type: text/plain, Size: 6638 bytes --]
Add support for SMBIOS to HVM domain builder: make room for the tables in
the e820 map and write data needed for the SMBIOS tables to the
hvm_info_table struct.
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
diff -r a1c2cede77c7 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c Mon Jul 10 14:01:49 2006
+++ b/tools/libxc/xc_hvm_build.c Wed Jul 12 11:48:10 2006
@@ -60,12 +60,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++;
@@ -135,12 +135,15 @@
* Use E820 reserved memory 0x9F800 to pass HVM info to hvmloader
* hvmloader will use this info to set BIOS accordingly
*/
-static int set_hvm_info(int xc_handle, uint32_t dom,
+static int set_hvm_info(int xc_handle, uint32_t dom, uint64_t memsize,
xen_pfn_t *pfn_list, unsigned int vcpus,
- unsigned int pae, unsigned int acpi, unsigned int apic)
+ unsigned int pae, unsigned int acpi, unsigned int apic,
+ uint8_t *uuid)
{
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,
@@ -158,6 +161,22 @@
va_hvm->apic_enabled = apic;
va_hvm->pae_enabled = pae;
va_hvm->nr_vcpus = vcpus;
+ va_hvm->memsize = memsize;
+ 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)) {
+ 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);
@@ -177,7 +196,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn)
+ unsigned long *store_mfn,
+ uint8_t *uuid)
{
xen_pfn_t *page_array = NULL;
unsigned long count, i;
@@ -250,7 +270,8 @@
goto error_out;
}
- if ( set_hvm_info(xc_handle, dom, page_array, vcpus, pae, acpi, apic) )
+ if ( set_hvm_info(xc_handle, dom, memsize, page_array, vcpus, pae, acpi,
+ apic, uuid) )
{
ERROR("Couldn't set hvm info for HVM guest.\n");
goto error_out;
@@ -347,7 +368,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn)
+ unsigned long *store_mfn,
+ uint8_t *uuid)
{
dom0_op_t launch_op, op;
int rc, i;
@@ -400,7 +422,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, store_evtchn, store_mfn,
+ uuid) < 0)
{
ERROR("Error constructing guest OS");
goto error_out;
@@ -593,7 +616,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn)
+ unsigned long *store_mfn,
+ uint8_t *uuid)
{
char *image;
int sts;
@@ -606,7 +630,7 @@
sts = xc_hvm_build_internal(xc_handle, domid, memsize,
image, image_size,
vcpus, pae, acpi, apic,
- store_evtchn, store_mfn);
+ store_evtchn, store_mfn, uuid);
free(image);
@@ -629,7 +653,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn)
+ unsigned long *store_mfn,
+ uint8_t *uuid)
{
int sts;
unsigned long img_len;
@@ -653,7 +678,7 @@
sts = xc_hvm_build_internal(xc_handle, domid, memsize,
img, img_len,
vcpus, pae, acpi, apic,
- store_evtchn, store_mfn);
+ store_evtchn, store_mfn, uuid);
/* xc_inflate_buffer may return the original buffer pointer (for
for already inflated buffers), so exercise some care in freeing */
diff -r a1c2cede77c7 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h Mon Jul 10 14:01:49 2006
+++ b/tools/libxc/xenguest.h Wed Jul 12 11:48:10 2006
@@ -111,7 +111,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn);
+ unsigned long *store_mfn,
+ uint8_t *uuid);
int xc_hvm_build_mem(int xc_handle,
uint32_t domid,
@@ -123,6 +124,7 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn);
+ unsigned long *store_mfn,
+ uint8_t *uuid);
#endif /* XENGUEST_H */
diff -r a1c2cede77c7 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c Mon Jul 10 14:01:49 2006
+++ b/tools/libxc/xg_private.c Wed Jul 12 11:48:10 2006
@@ -156,7 +156,8 @@
unsigned int acpi,
unsigned int apic,
unsigned int store_evtchn,
- unsigned long *store_mfn)
+ unsigned long *store_mfn,
+ uint8_t *uuid)
{
return -ENOSYS;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-07-12 21:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-12 21:26 Andrew D. Ball [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-07-12 20:29 [PATCH] HVM SMBIOS v2 2/5 aball
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B568EF.2000007@us.ibm.com \
--to=aball@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.