diff -r 1ec09a35d13d linux-2.6-xen-sparse/arch/ia64/kernel/setup.c --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Thu Oct 05 07:47:21 2006 +0200 @@ -63,6 +63,7 @@ #include #ifdef CONFIG_XEN #include +#include #endif #include @@ -76,8 +77,6 @@ EXPORT_SYMBOL(__per_cpu_offset); #endif #ifdef CONFIG_XEN -unsigned long kernel_start_pa; - static int xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { @@ -435,7 +434,9 @@ setup_arch (char **cmdline_p) #ifdef CONFIG_XEN if (is_running_on_xen()) { - kernel_start_pa = KERNEL_START - ia64_tpa(KERNEL_START); + /* Must be done before any hypercall. */ + xencomm_init (); + setup_xen_features(); /* Register a call for panic conditions. */ notifier_chain_register(&panic_notifier_list, &xen_panic_block); diff -r 1ec09a35d13d linux-2.6-xen-sparse/arch/ia64/xen/Makefile --- a/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Thu Oct 05 07:47:21 2006 +0200 @@ -4,6 +4,6 @@ obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o \ hypervisor.o pci-dma-xen.o util.o xencomm.o xcom_hcall.o \ - xcom_privcmd.o + xcom_mini.o xcom_privcmd.o pci-dma-xen-y := ../../i386/kernel/pci-dma-xen.o diff -r 1ec09a35d13d linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Thu Oct 05 07:47:21 2006 +0200 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -128,7 +127,8 @@ xencommize_grant_table_op(unsigned int c } int -xencomm_hypercall_grant_table_op(unsigned int cmd, void *op, unsigned int count) +xencomm_hypercall_grant_table_op(unsigned int cmd, + void *op, unsigned int count) { void *desc = xencommize_grant_table_op (cmd, op, count); @@ -263,207 +263,3 @@ xencomm_hypercall_suspend(unsigned long return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg)); } - -int -xencomm_mini_hypercall_event_channel_op(int cmd, void *op) -{ - struct xencomm_mini xc_area[2]; - int nbr_area = 2; - struct xencomm_handle *desc; - int rc; - - rc = xencomm_create_mini(xc_area, &nbr_area, - op, sizeof(evtchn_op_t), &desc); - if (rc) - return rc; - - return xencomm_arch_hypercall_event_channel_op(cmd, desc); -} -EXPORT_SYMBOL(xencomm_mini_hypercall_event_channel_op); - -static int -xencommize_mini_grant_table_op(struct xencomm_mini *xc_area, int *nbr_area, - unsigned int cmd, void *op, unsigned int count, - struct xencomm_handle **desc) -{ - struct xencomm_handle *desc1; - unsigned int argsize; - int rc; - - switch (cmd) { - case GNTTABOP_map_grant_ref: - argsize = sizeof(struct gnttab_map_grant_ref); - break; - case GNTTABOP_unmap_grant_ref: - argsize = sizeof(struct gnttab_unmap_grant_ref); - break; - case GNTTABOP_setup_table: - { - struct gnttab_setup_table *setup = op; - - argsize = sizeof(*setup); - - if (count != 1) - return -EINVAL; - rc = xencomm_create_mini - (xc_area, nbr_area, - xen_guest_handle(setup->frame_list), - setup->nr_frames - * sizeof(*xen_guest_handle(setup->frame_list)), - &desc1); - if (rc) - return rc; - set_xen_guest_handle(setup->frame_list, (void *)desc1); - break; - } - case GNTTABOP_dump_table: - argsize = sizeof(struct gnttab_dump_table); - break; - case GNTTABOP_transfer: - argsize = sizeof(struct gnttab_transfer); - break; - default: - printk("%s: unknown mini grant table op %d\n", __func__, cmd); - BUG(); - } - - rc = xencomm_create_mini(xc_area, nbr_area, op, count * argsize, desc); - if (rc) - return rc; - - return 0; -} - -int -xencomm_mini_hypercall_grant_table_op(unsigned int cmd, void *op, - unsigned int count) -{ - int rc; - struct xencomm_handle *desc; - int nbr_area = 2; - struct xencomm_mini xc_area[2]; - - rc = xencommize_mini_grant_table_op(xc_area, &nbr_area, - cmd, op, count, &desc); - if (rc) - return rc; - - return xencomm_arch_hypercall_grant_table_op(cmd, desc, count); -} -EXPORT_SYMBOL(xencomm_mini_hypercall_grant_table_op); - -int -xencomm_mini_hypercall_multicall(void *call_list, int nr_calls) -{ - int i; - multicall_entry_t *mce; - int nbr_area = 2 + nr_calls * 3; - struct xencomm_mini xc_area[nbr_area]; - struct xencomm_handle *desc; - int rc; - - for (i = 0; i < nr_calls; i++) { - mce = (multicall_entry_t *)call_list + i; - - switch (mce->op) { - case __HYPERVISOR_update_va_mapping: - case __HYPERVISOR_mmu_update: - /* No-op on ia64. */ - break; - case __HYPERVISOR_grant_table_op: - rc = xencommize_mini_grant_table_op - (xc_area, &nbr_area, - mce->args[0], (void *)mce->args[1], - mce->args[2], &desc); - if (rc) - return rc; - mce->args[1] = (unsigned long)desc; - break; - case __HYPERVISOR_memory_op: - default: - printk("%s: unhandled multicall op entry op %lu\n", - __func__, mce->op); - return -ENOSYS; - } - } - - rc = xencomm_create_mini(xc_area, &nbr_area, call_list, - nr_calls * sizeof(multicall_entry_t), &desc); - if (rc) - return rc; - - return xencomm_arch_hypercall_multicall(desc, nr_calls); -} -EXPORT_SYMBOL(xencomm_mini_hypercall_multicall); - -static int -xencommize_mini_memory_reservation(struct xencomm_mini *area, int *nbr_area, - xen_memory_reservation_t *mop) -{ - struct xencomm_handle *desc; - int rc; - - rc = xencomm_create_mini - (area, nbr_area, - xen_guest_handle(mop->extent_start), - mop->nr_extents - * sizeof(*xen_guest_handle(mop->extent_start)), - &desc); - if (rc) - return rc; - - set_xen_guest_handle(mop->extent_start, (void *)desc); - - return 0; -} - -int -xencomm_mini_hypercall_memory_op(unsigned int cmd, void *arg) -{ - int nbr_area = 4; - struct xencomm_mini xc_area[4]; - struct xencomm_handle *desc; - int rc; - unsigned int argsize; - - switch (cmd) { - case XENMEM_increase_reservation: - case XENMEM_decrease_reservation: - case XENMEM_populate_physmap: - argsize = sizeof(xen_memory_reservation_t); - rc = xencommize_mini_memory_reservation - (xc_area, &nbr_area, (xen_memory_reservation_t *)arg); - if (rc) - return rc; - break; - - case XENMEM_maximum_ram_page: - argsize = 0; - break; - - case XENMEM_exchange: - argsize = sizeof(xen_memory_exchange_t); - rc = xencommize_mini_memory_reservation - (xc_area, &nbr_area, - &((xen_memory_exchange_t *)arg)->in); - if (rc) - return rc; - rc = xencommize_mini_memory_reservation - (xc_area, &nbr_area, - &((xen_memory_exchange_t *)arg)->out); - if (rc) - return rc; - break; - - default: - printk("%s: unknown mini memory 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_memory_op(cmd, desc); -} -EXPORT_SYMBOL(xencomm_mini_hypercall_memory_op); diff -r 1ec09a35d13d linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c Thu Oct 05 07:47:21 2006 +0200 @@ -18,11 +18,19 @@ #include #include +#include #include #include -#include static int xencomm_debug = 0; + +static unsigned long kernel_start_pa; + +void +xencomm_init (void) +{ + kernel_start_pa = KERNEL_START - ia64_tpa(KERNEL_START); +} /* Translate virtual address to physical address. */ unsigned long @@ -47,8 +55,6 @@ xencomm_vaddr_to_paddr(unsigned long vad work on addresses. */ if (vaddr >= KERNEL_START && vaddr < (KERNEL_START + KERNEL_TR_PAGE_SIZE)) { - extern unsigned long kernel_start_pa; - return vaddr - kernel_start_pa; } @@ -78,6 +84,11 @@ xencomm_vaddr_to_paddr(unsigned long vad return __pa(vaddr); } + +#ifdef CONFIG_VMX_GUEST + /* No privcmd within vmx guest. */ + return ~0UL; +#else /* XXX double-check (lack of) locking */ vma = find_extend_vma(current->mm, vaddr); if (!vma) @@ -89,10 +100,11 @@ xencomm_vaddr_to_paddr(unsigned long vad return ~0UL; return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK); +#endif } static int -xencomm_init(struct xencomm_desc *desc, void *buffer, unsigned long bytes) +xencomm_init_desc(struct xencomm_desc *desc, void *buffer, unsigned long bytes) { unsigned long recorded = 0; int i = 0; @@ -183,9 +195,9 @@ xencomm_create(void *buffer, unsigned lo } handle = (struct xencomm_handle *)__pa(desc); - rc = xencomm_init(desc, buffer, bytes); + rc = xencomm_init_desc(desc, buffer, bytes); if (rc) { - printk("%s failure: %d\n", "xencomm_init", rc); + printk("%s failure: %d\n", "xencomm_init_desc", rc); xencomm_free(handle); return rc; } @@ -231,7 +243,7 @@ xencomm_create_mini(struct xencomm_mini return -ENOMEM; desc->nr_addrs = XENCOMM_MINI_ADDRS; - rc = xencomm_init(desc, buffer, bytes); + rc = xencomm_init_desc(desc, buffer, bytes); if (rc) return rc; diff -r 1ec09a35d13d linux-2.6-xen-sparse/include/asm-ia64/hypercall.h --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Thu Oct 05 07:47:21 2006 +0200 @@ -390,11 +390,7 @@ HYPERVISOR_add_physmap(unsigned long gpf #define HYPERVISOR_xen_version xencomm_mini_hypercall_xen_version #define HYPERVISOR_console_io xencomm_mini_hypercall_console_io #define HYPERVISOR_hvm_op xencomm_mini_hypercall_hvm_op -#ifdef CONFIG_VMX_GUEST -#define HYPERVISOR_memory_op 0 -#else #define HYPERVISOR_memory_op xencomm_mini_hypercall_memory_op -#endif #else #define HYPERVISOR_sched_op xencomm_hypercall_sched_op #define HYPERVISOR_event_channel_op xencomm_hypercall_event_channel_op diff -r 1ec09a35d13d linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h Thu Oct 05 07:47:21 2006 +0200 @@ -66,6 +66,8 @@ extern int xencomm_mini_hypercall_callba extern int xencomm_mini_hypercall_memory_op(unsigned int cmd, void *arg); +extern unsigned long xencomm_mini_hypercall_hvm_op(int cmd, void *arg); + /* For privcmd. Locally declare argument type to avoid include storm. Type coherency will be checked within privcmd.c */ struct privcmd_hypercall; diff -r 1ec09a35d13d linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h Tue Oct 03 14:46:10 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h Thu Oct 05 07:47:21 2006 +0200 @@ -27,6 +27,9 @@ struct xencomm_mini { uint64_t address[XENCOMM_MINI_ADDRS]; }; +/* Must be called before any hypercall. */ +extern void xencomm_init (void); + /* To avoid additionnal virt to phys conversion, an opaque structure is presented. */ struct xencomm_handle; diff -r 1ec09a35d13d unmodified_drivers/linux-2.6/mkbuildtree --- a/unmodified_drivers/linux-2.6/mkbuildtree Tue Oct 03 14:46:10 2006 -0600 +++ b/unmodified_drivers/linux-2.6/mkbuildtree Thu Oct 05 07:47:21 2006 +0200 @@ -19,6 +19,7 @@ mkdir -p include/xen mkdir -p include/xen mkdir -p include/public mkdir -p include/asm +mkdir -p include/asm/xen lndir -silent ${XL}/include/xen include/xen ln -sf ${XEN}/include/public include/xen/interface @@ -47,6 +48,10 @@ i[34567]86) ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm ln -sf ${XL}/include/asm-ia64/maddr.h include/asm + ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen + ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen + ln -sf ${XL}/arch/ia64/xen/xcom_mini.c platform-pci + ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci ;; *) echo unknown architecture $uname diff -r 1ec09a35d13d unmodified_drivers/linux-2.6/platform-pci/Kbuild --- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild Tue Oct 03 14:46:10 2006 -0600 +++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild Thu Oct 05 07:47:21 2006 +0200 @@ -5,3 +5,8 @@ EXTRA_CFLAGS += -I$(M)/platform-pci EXTRA_CFLAGS += -I$(M)/platform-pci xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o + +# Can we do better ? +ifeq ($(ARCH),ia64) + xen-platform-pci-objs += xcom_mini.o xencomm.o +endif diff -r 1ec09a35d13d unmodified_drivers/linux-2.6/platform-pci/platform-pci.c --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Tue Oct 03 14:46:10 2006 -0600 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Thu Oct 05 07:47:21 2006 +0200 @@ -35,6 +35,9 @@ #include #include #include +#ifdef __ia64__ +#include +#endif #include "platform-pci.h" @@ -58,6 +61,10 @@ static int __init init_xen_info(void) unsigned long shared_info_frame; struct xen_add_to_physmap xatp; extern void *shared_info_area; + +#ifdef __ia64__ + xencomm_init (); +#endif setup_xen_features(); diff -r 1ec09a35d13d linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c Thu Oct 05 07:47:21 2006 +0200 @@ -0,0 +1,320 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Tristan Gingold + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_VMX_GUEST +#include +#else +#include +#endif +#include + +int +xencomm_mini_hypercall_event_channel_op(int cmd, void *op) +{ + struct xencomm_mini xc_area[2]; + int nbr_area = 2; + struct xencomm_handle *desc; + int rc; + + rc = xencomm_create_mini(xc_area, &nbr_area, + op, sizeof(evtchn_op_t), &desc); + if (rc) + return rc; + + return xencomm_arch_hypercall_event_channel_op(cmd, desc); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_event_channel_op); + +static int +xencommize_mini_grant_table_op(struct xencomm_mini *xc_area, int *nbr_area, + unsigned int cmd, void *op, unsigned int count, + struct xencomm_handle **desc) +{ + struct xencomm_handle *desc1; + unsigned int argsize; + int rc; + + switch (cmd) { + case GNTTABOP_map_grant_ref: + argsize = sizeof(struct gnttab_map_grant_ref); + break; + case GNTTABOP_unmap_grant_ref: + argsize = sizeof(struct gnttab_unmap_grant_ref); + break; + case GNTTABOP_setup_table: + { + struct gnttab_setup_table *setup = op; + + argsize = sizeof(*setup); + + if (count != 1) + return -EINVAL; + rc = xencomm_create_mini + (xc_area, nbr_area, + xen_guest_handle(setup->frame_list), + setup->nr_frames + * sizeof(*xen_guest_handle(setup->frame_list)), + &desc1); + if (rc) + return rc; + set_xen_guest_handle(setup->frame_list, (void *)desc1); + break; + } + case GNTTABOP_dump_table: + argsize = sizeof(struct gnttab_dump_table); + break; + case GNTTABOP_transfer: + argsize = sizeof(struct gnttab_transfer); + break; + default: + printk("%s: unknown mini grant table op %d\n", __func__, cmd); + BUG(); + } + + rc = xencomm_create_mini(xc_area, nbr_area, op, count * argsize, desc); + if (rc) + return rc; + + return 0; +} + +int +xencomm_mini_hypercall_grant_table_op(unsigned int cmd, void *op, + unsigned int count) +{ + int rc; + struct xencomm_handle *desc; + int nbr_area = 2; + struct xencomm_mini xc_area[2]; + + rc = xencommize_mini_grant_table_op(xc_area, &nbr_area, + cmd, op, count, &desc); + if (rc) + return rc; + + return xencomm_arch_hypercall_grant_table_op(cmd, desc, count); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_grant_table_op); + +int +xencomm_mini_hypercall_multicall(void *call_list, int nr_calls) +{ + int i; + multicall_entry_t *mce; + int nbr_area = 2 + nr_calls * 3; + struct xencomm_mini xc_area[nbr_area]; + struct xencomm_handle *desc; + int rc; + + for (i = 0; i < nr_calls; i++) { + mce = (multicall_entry_t *)call_list + i; + + switch (mce->op) { + case __HYPERVISOR_update_va_mapping: + case __HYPERVISOR_mmu_update: + /* No-op on ia64. */ + break; + case __HYPERVISOR_grant_table_op: + rc = xencommize_mini_grant_table_op + (xc_area, &nbr_area, + mce->args[0], (void *)mce->args[1], + mce->args[2], &desc); + if (rc) + return rc; + mce->args[1] = (unsigned long)desc; + break; + case __HYPERVISOR_memory_op: + default: + printk("%s: unhandled multicall op entry op %lu\n", + __func__, mce->op); + return -ENOSYS; + } + } + + rc = xencomm_create_mini(xc_area, &nbr_area, call_list, + nr_calls * sizeof(multicall_entry_t), &desc); + if (rc) + return rc; + + return xencomm_arch_hypercall_multicall(desc, nr_calls); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_multicall); + +static int +xencommize_mini_memory_reservation(struct xencomm_mini *area, int *nbr_area, + xen_memory_reservation_t *mop) +{ + struct xencomm_handle *desc; + int rc; + + rc = xencomm_create_mini + (area, nbr_area, + xen_guest_handle(mop->extent_start), + mop->nr_extents + * sizeof(*xen_guest_handle(mop->extent_start)), + &desc); + if (rc) + return rc; + + set_xen_guest_handle(mop->extent_start, (void *)desc); + + return 0; +} + +int +xencomm_mini_hypercall_memory_op(unsigned int cmd, void *arg) +{ + int nbr_area = 4; + struct xencomm_mini xc_area[4]; + struct xencomm_handle *desc; + int rc; + unsigned int argsize; + + switch (cmd) { + case XENMEM_increase_reservation: + case XENMEM_decrease_reservation: + case XENMEM_populate_physmap: + argsize = sizeof(xen_memory_reservation_t); + rc = xencommize_mini_memory_reservation + (xc_area, &nbr_area, (xen_memory_reservation_t *)arg); + if (rc) + return rc; + break; + + case XENMEM_maximum_ram_page: + argsize = 0; + break; + + case XENMEM_exchange: + argsize = sizeof(xen_memory_exchange_t); + rc = xencommize_mini_memory_reservation + (xc_area, &nbr_area, + &((xen_memory_exchange_t *)arg)->in); + if (rc) + return rc; + rc = xencommize_mini_memory_reservation + (xc_area, &nbr_area, + &((xen_memory_exchange_t *)arg)->out); + if (rc) + return rc; + break; + + case XENMEM_add_to_physmap: + argsize = sizeof (xen_add_to_physmap_t); + break; + + default: + printk("%s: unknown mini memory 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_memory_op(cmd, desc); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_memory_op); + +unsigned long +xencomm_mini_hypercall_hvm_op(int cmd, void *arg) +{ + struct xencomm_handle *desc; + int nbr_area = 2; + struct xencomm_mini xc_area[2]; + unsigned int argsize; + int rc; + + switch (cmd) { + case HVMOP_get_param: + case HVMOP_set_param: + argsize = sizeof(xen_hvm_param_t); + break; + default: + printk("%s: unknown HVMOP %d\n", __func__, cmd); + return -EINVAL; + } + + rc = xencomm_create_mini(xc_area, &nbr_area, arg, argsize, &desc); + if (rc) + return rc; + + return xencomm_arch_hypercall_hvm_op(cmd, desc); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_hvm_op); + +int +xencomm_mini_hypercall_xen_version(int cmd, void *arg) +{ + struct xencomm_handle *desc; + int nbr_area = 2; + struct xencomm_mini xc_area[2]; + unsigned int argsize; + int rc; + + switch (cmd) { + case XENVER_version: + /* do not actually pass an argument */ + return xencomm_arch_hypercall_xen_version(cmd, 0); + case XENVER_extraversion: + argsize = sizeof(xen_extraversion_t); + break; + case XENVER_compile_info: + argsize = sizeof(xen_compile_info_t); + break; + case XENVER_capabilities: + argsize = sizeof(xen_capabilities_info_t); + break; + case XENVER_changeset: + argsize = sizeof(xen_changeset_info_t); + break; + case XENVER_platform_parameters: + argsize = sizeof(xen_platform_parameters_t); + break; + case XENVER_pagesize: + argsize = (arg == NULL) ? 0 : sizeof(void *); + break; + case XENVER_get_features: + argsize = (arg == NULL) ? 0 : sizeof(xen_feature_info_t); + break; + + default: + printk("%s: unknown version 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_xen_version(cmd, desc); +} +EXPORT_SYMBOL(xencomm_mini_hypercall_xen_version);