mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
1 parent
04447f4453
commit
1d4290342f
7 files changed
+13
-13
No files matched your search
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||