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

Re: [Xen-devel] [PATCH v2 01/20] x86: make hvm_{get/set}_param accessible



On 18.12.2019 20:40, Tamas K Lengyel wrote:
> Currently the hvm parameters are only accessible via the HVMOP hypercalls. By
> exposing hvm_{get/set}_param it will be possible for VM forking to copy the
> parameters directly into the clone domain.

Having peeked ahead at patch 17, where this gets used, I wonder why
you want a pair of one-by-one functions, rather than a copy-all one.
This then wouldn't require exposure of the functions you touch here.

> @@ -4429,42 +4446,60 @@ static int hvmop_get_param(
>      if ( !is_hvm_domain(d) )
>          goto out;
>  
> -    rc = hvm_allow_get_param(d, &a);
> +    rc = hvm_get_param(d, a.index, &a.value);
>      if ( rc )
>          goto out;
>  
> -    switch ( a.index )
> +    rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
> +
> +    HVM_DBG_LOG(DBG_LEVEL_HCALL, "get param %u = %"PRIx64,
> +                a.index, a.value);
> +
> + out:
> +    rcu_unlock_domain(d);
> +    return rc;
> +}
> +
> +int hvm_get_param(
> +    struct domain *d,

If this is to be non-static, I think it would be quite nice if
this parameter was const. This will take a prereq patch to
constify the XSM path involved, but other than this I can't
see anything getting in the way.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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