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

Re: [Xen-devel] [PATCH] xen/hvm: Fix handling of obsolete HVM_PARAMs



On 06.02.2020 14:24, Andrew Cooper wrote:
> The local xc_hvm_param_deprecated_check() in libxc tries to guess Xen's
> behaviour for the MEMORY_EVENT params, but is wrong for the get side, where
> Xen would return 0 (which is also a bug).  Delete the helper.
> 
> In Xen, perform the checks in hvm_allow_set_param(), rather than
> hvm_set_param(), and actually implement checks on the get side so the
> hypercall doesn't return successfully with 0 as an answer.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Hypervisor parts
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
with one remark:

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4105,8 +4105,14 @@ static int hvm_allow_set_param(struct domain *d,
>          break;
>      /* The following parameters are deprecated. */
>      case HVM_PARAM_DM_DOMAIN:
> +    case HVM_PARAM_MEMORY_EVENT_CR0:
> +    case HVM_PARAM_MEMORY_EVENT_CR3:
> +    case HVM_PARAM_MEMORY_EVENT_CR4:
> +    case HVM_PARAM_MEMORY_EVENT_INT3:
> +    case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
>      case HVM_PARAM_BUFIOREQ_EVTCHN:
> -        rc = -EPERM;
> +    case HVM_PARAM_MEMORY_EVENT_MSR:
> +        rc = -EINVAL;
>          break;

Other than in the header, where sorting by numeric value makes
(more) sense, I think it would be better to sort case labels
alphabetically. Otherwise when wanting to add to it, one needs
to go look up (or memorize, from doing the header file change
first) the insertion point.

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®.