WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64] vmx_setup_platform() may fail. mak

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] vmx_setup_platform() may fail. make it return error value.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 15:03:52 -0700
Delivery-date: Wed, 31 Oct 2007 15:05:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] vmx_setup_platform() may fail. make it return error value., Xen patchbot-unstable <=