Commit c47431f6 authored by Jan Beulich's avatar Jan Beulich

public/domctl: drop unnecessary typedefs and handles

By virtue of the struct xen_domctl container structure, most of them
are really just cluttering the name space.

While doing so,
- convert an enum typed (pt_irq_type_t) structure field to a fixed
  width type,
- make x86's paging_domctl() and descendants take a properly typed
  handle,
- add const in a few places.
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Acked-by: default avatarRazvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: default avatarDario Faggioli <dario.faggioli@citrix.com>
Acked-by: default avatarWei Liu <wei.liu2@citrix.com>
Acked-by: default avatarMeng Xu <mengxu@cis.upenn.edu>
Acked-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
Acked-by: default avatarJulien Grall <julien.grall@arm.com>
Acked-by: default avatarGeorge Dunlap <george.dunlap@citrix.com>
Acked-by: default avatarTamas K Lengyel <tamas@tklengyel.com>
parent 3c6d3b9a
......@@ -903,7 +903,7 @@ int xc_vcpu_get_extstate(xc_interface *xch,
uint32_t vcpu,
xc_vcpu_extstate_t *extstate);
typedef xen_domctl_getvcpuinfo_t xc_vcpuinfo_t;
typedef struct xen_domctl_getvcpuinfo xc_vcpuinfo_t;
int xc_vcpu_getinfo(xc_interface *xch,
uint32_t domid,
uint32_t vcpu,
......@@ -916,7 +916,7 @@ long long xc_domain_get_cpu_usage(xc_interface *xch,
int xc_domain_sethandle(xc_interface *xch, uint32_t domid,
xen_domain_handle_t handle);
typedef xen_domctl_shadow_op_stats_t xc_shadow_op_stats_t;
typedef struct xen_domctl_shadow_op_stats xc_shadow_op_stats_t;
int xc_shadow_control(xc_interface *xch,
uint32_t domid,
unsigned int sop,
......
......@@ -1714,8 +1714,7 @@ int xc_domain_update_msi_irq(
uint64_t gtable)
{
int rc;
xen_domctl_bind_pt_irq_t *bind;
struct xen_domctl_bind_pt_irq *bind;
DECLARE_DOMCTL;
domctl.cmd = XEN_DOMCTL_bind_pt_irq;
......@@ -1740,8 +1739,7 @@ int xc_domain_unbind_msi_irq(
uint32_t gflags)
{
int rc;
xen_domctl_bind_pt_irq_t *bind;
struct xen_domctl_bind_pt_irq *bind;
DECLARE_DOMCTL;
domctl.cmd = XEN_DOMCTL_unbind_pt_irq;
......@@ -1770,7 +1768,7 @@ static int xc_domain_bind_pt_irq_int(
uint16_t spi)
{
int rc;
xen_domctl_bind_pt_irq_t * bind;
struct xen_domctl_bind_pt_irq *bind;
DECLARE_DOMCTL;
domctl.cmd = XEN_DOMCTL_bind_pt_irq;
......@@ -1828,7 +1826,7 @@ static int xc_domain_unbind_pt_irq_int(
uint8_t spi)
{
int rc;
xen_domctl_bind_pt_irq_t * bind;
struct xen_domctl_bind_pt_irq *bind;
DECLARE_DOMCTL;
domctl.cmd = XEN_DOMCTL_unbind_pt_irq;
......
......@@ -41,7 +41,7 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
case XEN_DOMCTL_bind_pt_irq:
{
int rc;
xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
struct xen_domctl_bind_pt_irq *bind = &domctl->u.bind_pt_irq;
uint32_t irq = bind->u.spi.spi;
uint32_t virq = bind->machine_irq;
......@@ -87,7 +87,7 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
case XEN_DOMCTL_unbind_pt_irq:
{
int rc;
xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
struct xen_domctl_bind_pt_irq *bind = &domctl->u.bind_pt_irq;
uint32_t irq = bind->u.spi.spi;
uint32_t virq = bind->machine_irq;
......
......@@ -48,7 +48,7 @@ static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
}
static int update_domain_cpuid_info(struct domain *d,
const xen_domctl_cpuid_t *ctl)
const struct xen_domctl_cpuid *ctl)
{
struct cpuid_policy *p = d->arch.cpuid;
const struct cpuid_leaf leaf = { ctl->eax, ctl->ebx, ctl->ecx, ctl->edx };
......@@ -363,8 +363,7 @@ long arch_do_domctl(
{
case XEN_DOMCTL_shadow_op:
ret = paging_domctl(d, &domctl->u.shadow_op,
guest_handle_cast(u_domctl, void), 0);
ret = paging_domctl(d, &domctl->u.shadow_op, u_domctl, 0);
if ( ret == -ERESTART )
return hypercall_create_continuation(__HYPERVISOR_arch_1,
"h", u_domctl);
......@@ -707,7 +706,7 @@ long arch_do_domctl(
case XEN_DOMCTL_bind_pt_irq:
{
xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
struct xen_domctl_bind_pt_irq *bind = &domctl->u.bind_pt_irq;
int irq;
ret = -EINVAL;
......@@ -738,7 +737,7 @@ long arch_do_domctl(
case XEN_DOMCTL_unbind_pt_irq:
{
xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
struct xen_domctl_bind_pt_irq *bind = &domctl->u.bind_pt_irq;
int irq = domain_pirq_to_irq(d, bind->machine_irq);
ret = -EPERM;
......
......@@ -162,7 +162,7 @@ static int vioapic_hwdom_map_gsi(unsigned int gsi, unsigned int trig,
unsigned int pol)
{
struct domain *currd = current->domain;
xen_domctl_bind_pt_irq_t pt_irq_bind = {
struct xen_domctl_bind_pt_irq pt_irq_bind = {
.irq_type = PT_IRQ_TYPE_PCI,
.machine_irq = gsi,
};
......
......@@ -608,8 +608,8 @@ out:
paging_unlock(d);
}
int hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl)
int hap_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
{
int rc;
bool preempted = false;
......
......@@ -1606,7 +1606,7 @@ out:
return rc;
}
int mem_sharing_domctl(struct domain *d, xen_domctl_mem_sharing_op_t *mec)
int mem_sharing_domctl(struct domain *d, struct xen_domctl_mem_sharing_op *mec)
{
int rc;
......
......@@ -674,8 +674,9 @@ void paging_vcpu_init(struct vcpu *v)
}
int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming)
int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
bool_t resuming)
{
int rc;
......@@ -775,8 +776,7 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
{
if ( domctl_lock_acquire() )
{
ret = paging_domctl(d, &op.u.shadow_op,
guest_handle_cast(u_domctl, void), 1);
ret = paging_domctl(d, &op.u.shadow_op, u_domctl, 1);
domctl_lock_release();
}
......
......@@ -3809,8 +3809,8 @@ out:
/* Shadow-control XEN_DOMCTL dispatcher */
int shadow_domctl(struct domain *d,
xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl)
struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
{
int rc;
bool preempted = false;
......
......@@ -244,7 +244,7 @@ void domctl_lock_release(void)
}
static inline
int vcpuaffinity_params_invalid(const xen_domctl_vcpuaffinity_t *vcpuaff)
int vcpuaffinity_params_invalid(const struct xen_domctl_vcpuaffinity *vcpuaff)
{
return vcpuaff->flags == 0 ||
((vcpuaff->flags & XEN_VCPUAFFINITY_HARD) &&
......@@ -691,7 +691,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
case XEN_DOMCTL_getvcpuaffinity:
{
struct vcpu *v;
xen_domctl_vcpuaffinity_t *vcpuaff = &op->u.vcpuaffinity;
struct xen_domctl_vcpuaffinity *vcpuaff = &op->u.vcpuaffinity;
ret = -EINVAL;
if ( vcpuaff->vcpu >= d->max_vcpus )
......
......@@ -1345,7 +1345,7 @@ rt_dom_cntl(
struct vcpu *v;
unsigned long flags;
int rc = 0;
xen_domctl_schedparam_vcpu_t local_sched;
struct xen_domctl_schedparam_vcpu local_sched;
s_time_t period, budget;
uint32_t index = 0;
......
......@@ -41,7 +41,7 @@
static int vm_event_enable(
struct domain *d,
xen_domctl_vm_event_op_t *vec,
struct xen_domctl_vm_event_op *vec,
struct vm_event_domain **ved,
int pause_flag,
int param,
......@@ -587,7 +587,7 @@ void vm_event_cleanup(struct domain *d)
#endif
}
int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec,
int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec,
XEN_GUEST_HANDLE_PARAM(void) u_domctl)
{
int rc;
......
......@@ -276,7 +276,7 @@ static struct vcpu *vector_hashing_dest(const struct domain *d,
}
int pt_irq_create_bind(
struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
struct domain *d, const struct xen_domctl_bind_pt_irq *pt_irq_bind)
{
struct hvm_irq_dpci *hvm_irq_dpci;
struct hvm_pirq_dpci *pirq_dpci;
......@@ -620,7 +620,7 @@ int pt_irq_create_bind(
}
int pt_irq_destroy_bind(
struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
struct domain *d, const struct xen_domctl_bind_pt_irq *pt_irq_bind)
{
struct hvm_irq_dpci *hvm_irq_dpci;
struct hvm_pirq_dpci *pirq_dpci;
......
......@@ -34,8 +34,8 @@
/* hap domain level functions */
/************************************************/
void hap_domain_init(struct domain *d);
int hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl);
int hap_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
int hap_enable(struct domain *d, u32 mode);
void hap_final_teardown(struct domain *d);
void hap_teardown(struct domain *d, bool *preempted);
......
......@@ -87,7 +87,7 @@ int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
bool_t allow_sleep);
int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg);
int mem_sharing_domctl(struct domain *d,
xen_domctl_mem_sharing_op_t *mec);
struct xen_domctl_mem_sharing_op *mec);
void mem_sharing_init(void);
/* Scans the p2m and relinquishes any shared pages, destroying
......
......@@ -202,8 +202,9 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags);
/* Handler for paging-control ops: operations from user-space to enable
* and disable ephemeral shadow modes (test mode and log-dirty mode) and
* manipulate the log-dirty bitmap. */
int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming);
int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
bool_t resuming);
/* Helper hypercall for dealing with continuations. */
long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
......
......@@ -69,8 +69,8 @@ int shadow_track_dirty_vram(struct domain *d,
* and disable ephemeral shadow modes (test mode and log-dirty mode) and
* manipulate the log-dirty bitmap. */
int shadow_domctl(struct domain *d,
xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl);
struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
/* Call when destroying a domain */
void shadow_teardown(struct domain *d, bool *preempted);
......@@ -106,8 +106,9 @@ static inline void sh_remove_shadows(struct domain *d, mfn_t gmfn,
static inline void shadow_blow_tables_per_domain(struct domain *d) {}
static inline int shadow_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
XEN_GUEST_HANDLE_PARAM(void) u_domctl)
static inline int shadow_domctl(struct domain *d,
struct xen_domctl_shadow_op *sc,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
{
return -EINVAL;
}
......
This diff is collapsed.
......@@ -96,8 +96,8 @@ void pt_pci_init(void);
struct pirq;
int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
int pt_irq_create_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
int pt_irq_destroy_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
int pt_irq_create_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
int pt_irq_destroy_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
......
......@@ -69,7 +69,7 @@ int vm_event_get_response(struct domain *d, struct vm_event_domain *ved,
void vm_event_resume(struct domain *d, struct vm_event_domain *ved);
int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec,
int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec,
XEN_GUEST_HANDLE_PARAM(void) u_domctl);
void vm_event_vcpu_pause(struct vcpu *v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment