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-ia64-devel

[Xen-ia64-devel] [PATCH 7/23] make vmx_setup_platfrom() return error.

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 7/23] make vmx_setup_platfrom() return error.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Fri, 12 Oct 2007 12:51:35 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Thu, 11 Oct 2007 20:53:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1190789430 -32400
# Node ID 879c3cd63276668ab5854d702c3a1076640d51f0
# Parent  5041a02c4913f435cbe264ad663ecc59cb0aa6fb
vmx_setup_platform() may fail. make it return error value.
PATCHNAME: vxm_setup_platform_return_error

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 5041a02c4913 -r 879c3cd63276 xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Tue Sep 25 12:30:34 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_init.c      Wed Sep 26 15:50:30 2007 +0900
@@ -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 5041a02c4913 -r 879c3cd63276 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Tue Sep 25 12:30:34 2007 +0900
+++ b/xen/arch/ia64/xen/dom0_ops.c      Wed Sep 26 15:50:30 2007 +0900
@@ -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 5041a02c4913 -r 879c3cd63276 xen/include/asm-ia64/vmx.h
--- a/xen/include/asm-ia64/vmx.h        Tue Sep 25 12:30:34 2007 +0900
+++ b/xen/include/asm-ia64/vmx.h        Wed Sep 26 15:50:30 2007 +0900
@@ -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);

Attachment: 16057_879c3cd63276_vxm_setup_platform_return_error.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 7/23] make vmx_setup_platfrom() return error., Isaku Yamahata <=