|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH-for-4.9 v1 7/8] dm_op: convert HVMOP_inject_trap and HVMOP_inject_msi
>>> On 18.11.16 at 18:14, <paul.durrant@xxxxxxxxxx> wrote:
> +static int dm_op_inject_trap(struct domain *d, unsigned int vcpuid,
> + uint16_t vector, uint8_t type,
> + uint8_t insn_len, uint32_t error_code,
> + unsigned long cr2)
> +{
> + struct vcpu *v;
> +
> + if ( vector > INT16_MAX )
> + return -EINVAL;
Please limit vector to uint8_t and delete this strange (architecturally
wrong) check.
> + if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
> + return -EINVAL;
ENOENT (to make error reasons distinguishable for the caller)?
> + case DMOP_inject_msi:
> + {
> + struct xen_dm_op_inject_msi *data =
> + &op.u.inject_msi;
> +
> + rc = hvm_inject_msi(d, data->addr, data->data);
Line length clearly is not an issue here, but if you want to keep
the helper variable, then please constify it (which I guess would
apply to some of the earlier patches too).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |