# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 9e8fdcc46fa31a6e4f607c67e97f8a9d3fa0455c
# Parent b725c9e51a7cebc8069c95986179a819ff6bf563
[IA64] Xencomm fixes for HVM PV-drivers and driver domain.
Create xcom_mini.c from xcom_hcall.c
Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
---
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c | 7
linux-2.6-xen-sparse/arch/ia64/xen/Makefile | 2
linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c | 218 -----------
linux-2.6-xen-sparse/arch/ia64/xen/xcom_mini.c | 319 +++++++++++++++++
linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c | 26 +
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h | 4
linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h | 2
linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h | 3
8 files changed, 359 insertions(+), 222 deletions(-)
diff -r b725c9e51a7c -r 9e8fdcc46fa3
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Sat Oct 14 13:28:45
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Sat Oct 14 16:26:27
2006 -0600
@@ -63,6 +63,7 @@
#include <asm/system.h>
#ifdef CONFIG_XEN
#include <asm/hypervisor.h>
+#include <asm/xen/xencomm.h>
#endif
#include <linux/dma-mapping.h>
@@ -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 b725c9e51a7c -r 9e8fdcc46fa3 linux-2.6-xen-sparse/arch/ia64/xen/Makefile
--- a/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Sat Oct 14 13:28:45
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Sat Oct 14 16:26:27
2006 -0600
@@ -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 b725c9e51a7c -r 9e8fdcc46fa3
linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Sat Oct 14 13:28:45
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c Sat Oct 14 16:26:27
2006 -0600
@@ -32,7 +32,6 @@
#include <xen/interface/callback.h>
#include <xen/interface/acm_ops.h>
#include <xen/interface/hvm/params.h>
-#include <xen/public/privcmd.h>
#include <asm/hypercall.h>
#include <asm/page.h>
#include <asm/uaccess.h>
@@ -142,9 +141,18 @@ xencomm_hypercall_sched_op(int cmd, void
case SCHEDOP_yield:
case SCHEDOP_block:
case SCHEDOP_shutdown:
+ case SCHEDOP_remote_shutdown:
+ break;
case SCHEDOP_poll:
- case SCHEDOP_remote_shutdown:
- break;
+ {
+ sched_poll_t *poll = arg;
+ struct xencomm_handle *ports;
+
+ ports = xencomm_create_inline(xen_guest_handle(poll->ports));
+
+ set_xen_guest_handle(poll->ports, (void *)ports);
+ break;
+ }
default:
printk("%s: unknown sched op %d\n", __func__, cmd);
return -ENOSYS;
@@ -263,207 +271,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 b725c9e51a7c -r 9e8fdcc46fa3
linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c Sat Oct 14 13:28:45
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c Sat Oct 14 16:26:27
2006 -0600
@@ -18,11 +18,19 @@
#include <linux/gfp.h>
#include <linux/mm.h>
+#include <xen/interface/xen.h>
#include <asm/page.h>
#include <asm/xen/xencomm.h>
-#include <xen/interface/xen.h>
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 b725c9e51a7c -r 9e8fdcc46fa3
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Sat Oct 14 13:28:45
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Sat Oct 14 16:26:27
2006 -0600
@@ -402,11 +402,7 @@ HYPERVISOR_expose_p2m(unsigned long conv
#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 b725c9e51a7c -r 9e8fdcc46fa3
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 Sat Oct 14
13:28:45 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h Sat Oct 14
16:26:27 2006 -0600
@@ -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 b725c9e51a7c -r 9e8fdcc46fa3
linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h Sat Oct 14
13:28:45 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h Sat Oct 14
16:26:27 2006 -0600
@@ -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 b725c9e51a7c -r 9e8fdcc46fa3
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 Sat Oct 14 16:26:27
2006 -0600
@@ -0,0 +1,319 @@
+/*
+ * 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 <tristan.gingold@xxxxxxxx>
+ */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <xen/interface/xen.h>
+#include <xen/interface/dom0_ops.h>
+#include <xen/interface/memory.h>
+#include <xen/interface/xencomm.h>
+#include <xen/interface/version.h>
+#include <xen/interface/event_channel.h>
+#include <xen/interface/physdev.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/hvm/params.h>
+#ifdef CONFIG_VMX_GUEST
+#include <asm/hypervisor.h>
+#else
+#include <asm/hypercall.h>
+#endif
+#include <asm/xen/xencomm.h>
+
+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);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|