]> xenbits.xensource.com Git - xen.git/commitdiff
hypercall: update vcpu_op to take an unsigned vcpuid
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Jan 2015 11:19:11 +0000 (12:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Jan 2015 11:19:11 +0000 (12:19 +0100)
This has no guest-visible change, but makes the Hypervisor side bounds
checking more simple.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen/arch/arm/domain.c
xen/arch/x86/hvm/hvm.c
xen/common/compat/domain.c
xen/common/domain.c
xen/include/asm-arm/hypercall.h
xen/include/public/vcpu.h
xen/include/xen/hypercall.h

index 7221bc8a241800effdda9c374bb2c006b33aba36..cfc7ab45f71cbcbd582be0a951b52d424fc45b9d 100644 (file)
@@ -777,7 +777,7 @@ void arch_dump_domain_info(struct domain *d)
 }
 
 
-long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+long do_arm_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
index b03bb101032b1f9797a1e8e912dedec9047da90a..c7984d10c4ef3fc6b033513f88548a212f3c7b06 100644 (file)
@@ -4659,7 +4659,7 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 }
 
 static long hvm_vcpu_op(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+    int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -4718,7 +4718,7 @@ static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 }
 
 static long hvm_vcpu_op_compat32(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+    int cmd, unsigned vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
index b4be3b3df38525ead39719aebac0900d1f7d64c5..510843d83055b204732eb7669c8183058cdafcbb 100644 (file)
@@ -23,13 +23,13 @@ CHECK_SIZE_(struct, vcpu_info);
 CHECK_vcpu_register_vcpu_info;
 #undef xen_vcpu_register_vcpu_info
 
-int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
     int rc = 0;
 
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+    if ( vcpuid >= MAX_VIRT_CPUS )
         return -EINVAL;
 
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
@@ -59,7 +59,7 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         domain_unlock(d);
 
         if ( rc == -ERESTART )
-            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iuh",
                                                cmd, vcpuid, arg);
 
         xfree(cmp_ctxt);
index 336e9eacfcf2f632c34b83db9587f4c4c6d40244..e02823ebc0dd6b94413f943adccdfcabeb4d7cb2 100644 (file)
@@ -1139,14 +1139,14 @@ void unmap_vcpu_info(struct vcpu *v)
     put_page_and_type(mfn_to_page(mfn));
 }
 
-long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
     struct vcpu_guest_context *ctxt;
     long rc = 0;
 
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+    if ( vcpuid >= MAX_VIRT_CPUS )
         return -EINVAL;
 
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
@@ -1174,7 +1174,7 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         free_vcpu_guest_context(ctxt);
 
         if ( rc == -ERESTART )
-            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iuh",
                                                cmd, vcpuid, arg);
 
         break;
index 94a92d4ea6727beb58563dc974208b423a85b177..a0c5a31a2f86c173acdce038118b14feaa7d22b2 100644 (file)
@@ -4,7 +4,7 @@
 #include <public/domctl.h> /* for arch_do_domctl */
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
-long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg);
+long do_arm_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 long subarch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
index e888daf67049a4dab216ad00e90f4c4e8ec4cdc3..898b89f50940a38389f18a6b1839b84010f48780 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Prototype for this hypercall is:
- *  int vcpu_op(int cmd, int vcpuid, void *extra_args)
+ *  long vcpu_op(int cmd, unsigned int vcpuid, void *extra_args)
  * @cmd        == VCPUOP_??? (VCPU operation).
  * @vcpuid     == VCPU to operate on.
  * @extra_args == Operation-specific extra arguments (NULL if none).
index 8c55779ff801d3d97cfca0150c438211d861cafe..eda8a36c46b591396f04cfd3ccd320b3cbfdf9e5 100644 (file)
@@ -109,7 +109,7 @@ do_vm_assist(
 extern long
 do_vcpu_op(
     int cmd,
-    int vcpuid,
+    unsigned int vcpuid,
     XEN_GUEST_HANDLE_PARAM(void) arg);
 
 struct vcpu;
@@ -160,7 +160,7 @@ compat_grant_table_op(
 extern int
 compat_vcpu_op(
     int cmd,
-    int vcpuid,
+    unsigned int vcpuid,
     XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int