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

Re: [Xen-devel] [PATCH v2 11/12] x86/altp2m: Add altp2mhvm HVM domain parameter.



On 22/06/15 19:56, Ed White wrote:
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index b3e74ce..8453489 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -5732,6 +5732,7 @@ static int hvm_allow_set_param(struct domain *d,
>      case HVM_PARAM_VIRIDIAN:
>      case HVM_PARAM_IOREQ_SERVER_PFN:
>      case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
> +    case HVM_PARAM_ALTP2MHVM:
>          if ( value != 0 && a->value != value )
>              rc = -EEXIST;
>          break;
> @@ -5854,6 +5855,9 @@ static int hvmop_set_param(
>           */
>          if ( cpu_has_svm && !paging_mode_hap(d) && a.value )
>              rc = -EINVAL;
> +        if ( a.value &&
> +             d->arch.hvm_domain.params[HVM_PARAM_ALTP2MHVM] )
> +            rc = -EINVAL;
>          /* Set up NHVM state for any vcpus that are already up. */
>          if ( a.value &&
>               !d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
> @@ -5864,6 +5868,13 @@ static int hvmop_set_param(
>              for_each_vcpu(d, v)
>                  nestedhvm_vcpu_destroy(v);
>          break;
> +    case HVM_PARAM_ALTP2MHVM:
> +        if ( a.value > 1 )
> +            rc = -EINVAL;
> +        if ( a.value &&
> +             d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] )
> +            rc = -EINVAL;
> +        break;
>      case HVM_PARAM_BUFIOREQ_EVTCHN:
>          rc = -EINVAL;
>          break;

As altp2m is useful as much for an inguest agent as well as an external
agent, it might be an idea to add HVM_PARAM_ALTP2MHVM to the whitelist
of guest-readable params, unless we intend to support a "only external
agent" XSM mode and avoid to avoid the guest snooping on its own settings.

~Andrew

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