|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] hypercall: update vcpu_op to take an unsigned vcpuid
commit 1d4290342fa541effa93cd517a7f6eadf5adc515
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Jan 19 12:19:11 2015 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jan 19 12:19:11 2015 +0100
hypercall: update vcpu_op to take an unsigned vcpuid
This has no guest-visible change, but makes the Hypervisor side bounds
checking more simple.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
xen/arch/arm/domain.c | 2 +-
xen/arch/x86/hvm/hvm.c | 4 ++--
xen/common/compat/domain.c | 6 +++---
xen/common/domain.c | 6 +++---
xen/include/asm-arm/hypercall.h | 2 +-
xen/include/public/vcpu.h | 2 +-
xen/include/xen/hypercall.h | 4 ++--
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 7221bc8..cfc7ab4 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -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 )
{
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b03bb10..c7984d1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -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;
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index b4be3b3..510843d 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -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);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 336e9ea..e02823e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -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;
diff --git a/xen/include/asm-arm/hypercall.h b/xen/include/asm-arm/hypercall.h
index 94a92d4..a0c5a31 100644
--- a/xen/include/asm-arm/hypercall.h
+++ b/xen/include/asm-arm/hypercall.h
@@ -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);
diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h
index e888daf..898b89f 100644
--- a/xen/include/public/vcpu.h
+++ b/xen/include/public/vcpu.h
@@ -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).
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index 8c55779..eda8a36 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -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
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |