[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 11/15] x86/altp2m: define and implement alternate p2m HVMOP types.



>>> On 21.07.15 at 01:58, <edmund.h.white@xxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -6135,6 +6135,141 @@ static int hvmop_get_param(
>      return rc;
>  }
>  
> +static int do_altp2m_op(
> +    XEN_GUEST_HANDLE_PARAM(void) arg)
> +{
> +    struct xen_hvm_altp2m_op a;
> +    struct domain *d = NULL;
> +    int rc = 0;
> +
> +    if ( !hvm_altp2m_supported() )
> +        return -EOPNOTSUPP;
> +
> +    if ( copy_from_guest(&a, arg, 1) )
> +        return -EFAULT;
> +
> +    if ( a.pad1 || a.pad2 ||
> +         (a.version != HVMOP_ALTP2M_INTERFACE_VERSION) ||
> +         (a.cmd > HVMOP_altp2m_change_gfn) )
> +        return -EINVAL;
> +
> +    if ( a.cmd != HVMOP_altp2m_vcpu_enable_notify )
> +    {
> +        d = rcu_lock_domain_by_any_id(a.domain);
> +        if ( d == NULL )
> +            return -ESRCH;
> +    }

    else
        d = rcu_lock_current_domain();

eliminating ...

> +    if ( !is_hvm_domain(d ? d : current->domain) )

... a couple of conditional expressions like this one and the
conditional around the unlock at the end. With this adjusted
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.