# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID ba7fca36fbd066129afc17ecfbd514be868ebc38
# Parent 27c2e9aa83e9ee41041bdb86d2cb4e8e28143379
[IA64] Fix VTi domain creation
Signed-off-by: Zhang Xin <xing.z.zhang@xxxxxxxxx>
---
tools/libxc/ia64/xc_ia64_hvm_build.c | 10 ++++++----
tools/python/xen/lowlevel/xc/xc.c | 13 ++++++++++++-
xen/include/public/arch-ia64.h | 7 +++++++
3 files changed, 25 insertions(+), 5 deletions(-)
diff -r 27c2e9aa83e9 -r ba7fca36fbd0 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c Tue Dec 05 09:09:44 2006 -0700
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c Tue Dec 05 09:44:24 2006 -0700
@@ -591,6 +591,7 @@ setup_guest(int xc_handle, uint32_t dom,
unsigned long dom_memsize = ((memsize - 16) << 20);
unsigned long nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT);
unsigned long normal_pages = nr_pages - GFW_PAGES;
+ unsigned long vcpus;
int rc;
long i, j;
DECLARE_DOMCTL;
@@ -668,7 +669,6 @@ setup_guest(int xc_handle, uint32_t dom,
if (xc_domctl(xc_handle, &domctl))
goto error_out;
-
// Load guest firmware
if (xc_ia64_copy_to_domain_pages(xc_handle, dom, image,
(GFW_START + GFW_SIZE - image_size) >> PAGE_SHIFT,
@@ -677,15 +677,17 @@ setup_guest(int xc_handle, uint32_t dom,
goto error_out;
}
+ // Get number of vcpus, stored by pyxc_hvm_build()
+ xc_get_hvm_param(xc_handle, dom, HVM_PARAM_VCPUS, &vcpus);
+
// Hand-off state passed to guest firmware
- if (xc_ia64_build_hob(xc_handle, dom, dom_memsize,
- (unsigned long)vcpus) < 0) {
+ if (xc_ia64_build_hob(xc_handle, dom, dom_memsize, vcpus) < 0) {
PERROR("Could not build hob\n");
goto error_out;
}
xc_set_hvm_param(xc_handle, dom,
- HVM_PARAM_STORE_PFN, STORE_PAGE_START>>PAGE_SHIFT);
+ HVM_PARAM_STORE_PFN, pfn_list[nr_pages - 2]);
// Retrieve special pages like io, xenstore, etc.
sp = (shared_iopage_t *)xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
diff -r 27c2e9aa83e9 -r ba7fca36fbd0 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Dec 05 09:09:44 2006 -0700
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Dec 05 09:44:24 2006 -0700
@@ -374,10 +374,13 @@ static PyObject *pyxc_hvm_build(XcObject
PyObject *kwds)
{
uint32_t dom;
+#if !defined(__ia64__)
struct hvm_info_table *va_hvm;
uint8_t *va_map, sum;
+ int i;
+#endif
char *image;
- int i, store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1;
+ int store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1;
unsigned long store_mfn;
static char *kwd_list[] = { "domid", "store_evtchn",
@@ -388,9 +391,14 @@ static PyObject *pyxc_hvm_build(XcObject
&image, &vcpus, &pae, &acpi, &apic) )
return NULL;
+#if defined(__ia64__)
+ /* Set vcpus to later be retrieved in setup_guest() */
+ xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VCPUS, vcpus);
+#endif
if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 )
return PyErr_SetFromErrno(xc_error);
+#if !defined(__ia64__)
/* Set up the HVM info table. */
va_map = xc_map_foreign_range(self->xc_handle, dom, XC_PAGE_SIZE,
PROT_READ | PROT_WRITE,
@@ -408,9 +416,12 @@ static PyObject *pyxc_hvm_build(XcObject
sum += ((uint8_t *)va_hvm)[i];
va_hvm->checksum = -sum;
munmap(va_map, XC_PAGE_SIZE);
+#endif
xc_get_hvm_param(self->xc_handle, dom, HVM_PARAM_STORE_PFN, &store_mfn);
+#if !defined(__ia64__)
xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_PAE_ENABLED, pae);
+#endif
xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_STORE_EVTCHN,
store_evtchn);
diff -r 27c2e9aa83e9 -r ba7fca36fbd0 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h Tue Dec 05 09:09:44 2006 -0700
+++ b/xen/include/public/arch-ia64.h Tue Dec 05 09:44:24 2006 -0700
@@ -65,6 +65,13 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
/* Maximum number of virtual CPUs in multi-processor guests. */
/* WARNING: before changing this, check that shared_info fits on a page */
#define MAX_VIRT_CPUS 64
+
+/*
+ * HVM_PARAM_PAE_ENABLED is meaningless on ia64, so we overload this
+ * entry to store the number of vCPUs. XXX Need arch-specific extentions
+ * for xc_get/set_hvm_param().
+ */
+#define HVM_PARAM_VCPUS HVM_PARAM_PAE_ENABLED
#ifndef __ASSEMBLY__
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|