# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1226585996 0
# Node ID d44ad6db638c1308e5ee4a47509769c3cccbe1e8
# Parent 48879ca5884866c38b99a984ddf2854dfc6f9ff0
x86, hvm: Provide access to limited VCPUOP_ hypercalls.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
xen/arch/x86/hvm/hvm.c | 41 +++++++++++++++++++++++++++++++++++++++++
xen/include/xen/hypercall.h | 6 ++++++
2 files changed, 47 insertions(+)
diff -r 48879ca58848 -r d44ad6db638c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c Thu Nov 13 13:03:16 2008 +0000
+++ b/xen/arch/x86/hvm/hvm.c Thu Nov 13 14:19:56 2008 +0000
@@ -1884,6 +1884,25 @@ static long hvm_memory_op(int cmd, XEN_G
return rc;
}
+static long hvm_vcpu_op(
+ int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+{
+ long rc;
+
+ switch ( cmd )
+ {
+ case VCPUOP_register_runstate_memory_area:
+ case VCPUOP_get_runstate_info:
+ rc = do_vcpu_op(cmd, vcpuid, arg);
+ break;
+ default:
+ rc = -ENOSYS;
+ break;
+ }
+
+ return rc;
+}
+
typedef unsigned long hvm_hypercall_t(
unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
@@ -1895,6 +1914,7 @@ static hvm_hypercall_t *hvm_hypercall32_
static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
[ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
[ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
+ [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
HYPERCALL(xen_version),
HYPERCALL(event_channel_op),
HYPERCALL(sched_op),
@@ -1911,9 +1931,29 @@ static long hvm_memory_op_compat32(int c
return rc;
}
+static long hvm_vcpu_op_compat32(
+ int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+{
+ long rc;
+
+ switch ( cmd )
+ {
+ case VCPUOP_register_runstate_memory_area:
+ case VCPUOP_get_runstate_info:
+ rc = compat_vcpu_op(cmd, vcpuid, arg);
+ break;
+ default:
+ rc = -ENOSYS;
+ break;
+ }
+
+ return rc;
+}
+
static hvm_hypercall_t *hvm_hypercall64_table[NR_hypercalls] = {
[ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
[ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
+ [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
HYPERCALL(xen_version),
HYPERCALL(event_channel_op),
HYPERCALL(sched_op),
@@ -1923,6 +1963,7 @@ static hvm_hypercall_t *hvm_hypercall32_
static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
[ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op_compat32,
[ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
+ [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
HYPERCALL(xen_version),
HYPERCALL(event_channel_op),
HYPERCALL(sched_op),
diff -r 48879ca58848 -r d44ad6db638c xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h Thu Nov 13 13:03:16 2008 +0000
+++ b/xen/include/xen/hypercall.h Thu Nov 13 14:19:56 2008 +0000
@@ -124,6 +124,12 @@ compat_memory_op(
unsigned int cmd,
XEN_GUEST_HANDLE(void) arg);
+extern int
+compat_vcpu_op(
+ int cmd,
+ int vcpuid,
+ XEN_GUEST_HANDLE(void) arg);
+
#endif
#endif /* __XEN_HYPERCALL_H__ */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|