From: Kei Tokunaga <ktokunag@redhat.com> Subject: [RHEL5.1 PATCH 19/21] Fix PV-on-HVM driver Date: Thu, 07 Jun 2007 03:47:51 -0400 Bugzilla: 242144 Message-Id: <4667B827.4050104@redhat.com> Changelog: [xen] ia64: Fix PV-on-HVM driver bz242144 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242144 Backport of cset#14832. xen-platform-pci fails to load with undefined symbols for some of the sched_op hypercalls in machine_reboot.c. This adds them to xencomm mini to allow them to be called from modules. Thanks, Kei rh bug 242144 # HG changeset patch # User Alex Williamson <alex.williamson@hp.com> # Date 1176354930 21600 # Node ID e1580c3bb75a7d8a57bbacf5a2a97aa27c3a8b58 # Parent e4bd31a66a2e2bc70faa3851cb8706d791b38f99 [IA64] Fix PV-on-HVM driver xen-platform-pci fails to load w/ undefined symbols for some of the sched_op hypercalls in machine_reboot.c. This adds them to xencomm mini to allow them to be called from modules. Signed-off-by: Alex Williamson <alex.williamson@hp.com> --- linux-2.6.18-21.el5-gerd-order-kei/arch/ia64/xen/xcom_mini.c | 36 ++++++++++ linux-2.6.18-21.el5-gerd-order-kei/include/asm-ia64/hypervisor.h | 2 2 files changed, 37 insertions(+), 1 deletion(-) diff -puN arch/ia64/xen/xcom_mini.c~14832-IA64_Fix_PV-on-HVM_driver arch/ia64/xen/xcom_mini.c --- linux-2.6.18-21.el5-gerd-order/arch/ia64/xen/xcom_mini.c~14832-IA64_Fix_PV-on-HVM_driver 2007-06-07 02:44:33.000000000 -0400 +++ linux-2.6.18-21.el5-gerd-order-kei/arch/ia64/xen/xcom_mini.c 2007-06-07 02:44:33.000000000 -0400 @@ -320,3 +320,39 @@ xencomm_mini_hypercall_xen_version(int c return xencomm_arch_hypercall_xen_version(cmd, desc); } EXPORT_SYMBOL(xencomm_mini_hypercall_xen_version); + +int +xencomm_mini_hypercall_sched_op(int cmd, void *arg) +{ + int rc, nbr_area = 2; + struct xencomm_mini xc_area[2]; + struct xencomm_handle *desc; + unsigned int argsize; + + switch (cmd) { + case SCHEDOP_yield: + case SCHEDOP_block: + argsize = 0; + break; + case SCHEDOP_shutdown: + argsize = sizeof(sched_shutdown_t); + break; + case SCHEDOP_poll: + argsize = sizeof(sched_poll_t); + break; + case SCHEDOP_remote_shutdown: + argsize = sizeof(sched_remote_shutdown_t); + break; + + default: + printk("%s: unknown sched op %d\n", __func__, cmd); + return -ENOSYS; + } + + rc = xencomm_create_mini(xc_area, &nbr_area, arg, argsize, &desc); + if (rc) + return rc; + + return xencomm_arch_hypercall_sched_op(cmd, desc); +} +EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_sched_op); diff -puN include/asm-ia64/hypervisor.h~14832-IA64_Fix_PV-on-HVM_driver include/asm-ia64/hypervisor.h --- linux-2.6.18-21.el5-gerd-order/include/asm-ia64/hypervisor.h~14832-IA64_Fix_PV-on-HVM_driver 2007-06-07 02:44:33.000000000 -0400 +++ linux-2.6.18-21.el5-gerd-order-kei/include/asm-ia64/hypervisor.h 2007-06-07 02:44:33.000000000 -0400 @@ -64,7 +64,6 @@ extern start_info_t *xen_start_info; void force_evtchn_callback(void); -#ifndef CONFIG_VMX_GUEST /* Turn jiffies into Xen system time. XXX Implement me. */ #define jiffies_to_st(j) 0 @@ -118,6 +117,7 @@ HYPERVISOR_poll( #include <asm/hypercall.h> +#ifndef CONFIG_VMX_GUEST // for drivers/xen/privcmd/privcmd.c #define machine_to_phys_mapping 0 struct vm_area_struct; _