diff options
author | cperciva <cperciva@FreeBSD.org> | 2010-11-25 15:05:21 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2010-11-25 15:05:21 +0000 |
commit | 008430e205fc0486471636b7b05c15ea15b18947 (patch) | |
tree | 66c1c0e02501ae9e643ab0f9f229ca1f15c2fc1c | |
parent | 5f2060fdd76d0040e0acfcba8e0d18f5f2bc0859 (diff) | |
download | FreeBSD-src-008430e205fc0486471636b7b05c15ea15b18947.zip FreeBSD-src-008430e205fc0486471636b7b05c15ea15b18947.tar.gz |
Rename HYPERVISOR_multicall (which performs the multicall hypercall) to
_HYPERVISOR_multicall, and create a new HYPERVISOR_multicall function which
invokes _HYPERVISOR_multicall and checks that the individual hypercalls all
succeeded.
-rw-r--r-- | sys/i386/include/xen/hypercall.h | 3 | ||||
-rw-r--r-- | sys/i386/xen/xen_machdep.c | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/sys/i386/include/xen/hypercall.h b/sys/i386/include/xen/hypercall.h index b33626f..2631a9b 100644 --- a/sys/i386/include/xen/hypercall.h +++ b/sys/i386/include/xen/hypercall.h @@ -234,8 +234,9 @@ HYPERVISOR_memory_op( return _hypercall2(int, memory_op, cmd, arg); } +int HYPERVISOR_multicall(multicall_entry_t *, int); static inline int -HYPERVISOR_multicall( +_HYPERVISOR_multicall( void *call_list, int nr_calls) { return _hypercall2(int, multicall, call_list, nr_calls); diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c index 2d46f6e..a9180fc 100644 --- a/sys/i386/xen/xen_machdep.c +++ b/sys/i386/xen/xen_machdep.c @@ -1177,6 +1177,27 @@ trap_info_t trap_table[] = { { 0, 0, 0, 0 } }; +/* Perform a multicall and check that individual calls succeeded. */ +int +HYPERVISOR_multicall(struct multicall_entry * call_list, int nr_calls) +{ + int ret = 0; + int i; + + /* Perform the multicall. */ + PANIC_IF(_HYPERVISOR_multicall(call_list, nr_calls)); + + /* Check the results of individual hypercalls. */ + for (i = 0; i < nr_calls; i++) + if (unlikely(call_list[i].result < 0)) + ret++; + if (unlikely(ret > 0)) + panic("%d multicall(s) failed: cpu %d\n", + ret, smp_processor_id()); + + /* If we didn't panic already, everything succeeded. */ + return (0); +} /********** CODE WORTH KEEPING ABOVE HERE *****************/ |