# 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);
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
|