[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] vmx_setup_platform() may fail. make it return error value.



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1192220053 21600
# Node ID f5bc04410880824cab27bb1cca013a65c91f68cc
# Parent  0badb22cde796d552025af17cce50c85bb5ba7b1
[IA64] vmx_setup_platform() may fail. make it return error value.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/vmx/vmx_init.c |   28 ++++++++++++++++++++--------
 xen/arch/ia64/xen/dom0_ops.c |    2 +-
 xen/include/asm-ia64/vmx.h   |    2 +-
 3 files changed, 22 insertions(+), 10 deletions(-)

diff -r 0badb22cde79 -r f5bc04410880 xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Fri Oct 12 14:11:57 2007 -0600
+++ b/xen/arch/ia64/vmx/vmx_init.c      Fri Oct 12 14:14:13 2007 -0600
@@ -394,24 +394,34 @@ static void vmx_build_io_physmap_table(s
 
 }
 
-void vmx_setup_platform(struct domain *d)
-{
+int vmx_setup_platform(struct domain *d)
+{
+       unsigned long mpa;
        ASSERT(d != dom0); /* only for non-privileged vti domain */
 
        vmx_build_io_physmap_table(d);
 
-       d->arch.vmx_platform.shared_page_va =
-               (unsigned long)__va(__gpa_to_mpa(d, IO_PAGE_START));
+       mpa = __gpa_to_mpa(d, IO_PAGE_START);
+       if (mpa == 0)
+               return -EINVAL;
+       d->arch.vmx_platform.shared_page_va = (unsigned long)__va(mpa);
        /* For buffered IO requests. */
        spin_lock_init(&d->arch.hvm_domain.buffered_io_lock);
-       d->arch.hvm_domain.buffered_io_va =
-               (unsigned long)__va(__gpa_to_mpa(d, BUFFER_IO_PAGE_START));
-       d->arch.hvm_domain.buffered_pio_va =
-               (unsigned long)__va(__gpa_to_mpa(d, BUFFER_PIO_PAGE_START));
+
+       mpa = __gpa_to_mpa(d, BUFFER_IO_PAGE_START);
+       if (mpa == 0)
+               return -EINVAL;
+       d->arch.hvm_domain.buffered_io_va = (unsigned long)__va(mpa);
+       mpa = __gpa_to_mpa(d, BUFFER_PIO_PAGE_START);
+       if (mpa == 0)
+               return -EINVAL;
+       d->arch.hvm_domain.buffered_pio_va = (unsigned long)__va(mpa);
        /* TEMP */
        d->arch.vmx_platform.pib_base = 0xfee00000UL;
 
        d->arch.sal_data = xmalloc(struct xen_sal_data);
+       if (d->arch.sal_data == NULL)
+               return -ENOMEM;
 
        /* Only open one port for I/O and interrupt emulation */
        memset(&d->shared_info->evtchn_mask[0], 0xff,
@@ -421,6 +431,8 @@ void vmx_setup_platform(struct domain *d
        viosapic_init(d);
 
        vacpi_init(d);
+
+       return 0;
 }
 
 void vmx_do_launch(struct vcpu *v)
diff -r 0badb22cde79 -r f5bc04410880 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Fri Oct 12 14:11:57 2007 -0600
+++ b/xen/arch/ia64/xen/dom0_ops.c      Fri Oct 12 14:14:13 2007 -0600
@@ -104,8 +104,8 @@ long arch_do_domctl(xen_domctl_t *op, XE
                     ret = -EINVAL;
                 } else {
                     d->arch.is_vti = 1;
-                    vmx_setup_platform(d);
                     xen_ia64_set_convmem_end(d, ds->maxmem);
+                    ret = vmx_setup_platform(d);
                 }
             }
             else {
diff -r 0badb22cde79 -r f5bc04410880 xen/include/asm-ia64/vmx.h
--- a/xen/include/asm-ia64/vmx.h        Fri Oct 12 14:11:57 2007 -0600
+++ b/xen/include/asm-ia64/vmx.h        Fri Oct 12 14:14:13 2007 -0600
@@ -33,7 +33,7 @@ extern int vmx_final_setup_guest(struct 
 extern int vmx_final_setup_guest(struct vcpu *v);
 extern void vmx_save_state(struct vcpu *v);
 extern void vmx_load_state(struct vcpu *v);
-extern void vmx_setup_platform(struct domain *d);
+extern int vmx_setup_platform(struct domain *d);
 extern void vmx_do_launch(struct vcpu *v);
 extern void vmx_io_assist(struct vcpu *v);
 extern int ia64_hypercall (struct pt_regs *regs);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.