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

Re: [Xen-devel] [PATCH] x86/libxl: choose a sane default for HAP



> -----Original Message-----
[snip]
> -void libxl__arch_domain_create_info_setdefault(libxl__gc *gc,
> -                                               libxl_domain_create_info 
> *c_info)
> +int libxl__arch_domain_create_info_setdefault(libxl__gc *gc,
> +                                              libxl_domain_create_info 
> *c_info)
>  {
> +    libxl_physinfo pi;
> +    int rc = libxl_get_physinfo(CTX, &pi);
> +
> +    if (rc) {
> +        LOG(ERROR, "unable to get physinfo");
> +        return rc;
> +    }
> +
> +    libxl_defbool_setdefault(&c_info->hap, pi.cap_hap);

Is this going to work on ARM (where CDF_hap is required)? Because...

> +
> +    return 0;
>  }
> 
>  void libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
> diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
> index c50d910a1c..74ea184087 100644
> --- a/xen/arch/x86/sysctl.c
> +++ b/xen/arch/x86/sysctl.c
> @@ -165,6 +165,8 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
>          pi->capabilities |= XEN_SYSCTL_PHYSCAP_pv;
>      if ( iommu_enabled )
>          pi->capabilities |= XEN_SYSCTL_PHYSCAP_directio;
> +    if ( hvm_hap_supported() )
> +        pi->capabilities |= XEN_SYSCTL_PHYSCAP_hap;

...this is x86-only code, and I don't see an equivalent hunk for ARM.

  Paul

>  }
> 
>  long arch_do_sysctl(
> diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> index 91c48dcae0..6c457625e9 100644
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -90,6 +90,10 @@ struct xen_sysctl_tbuf_op {
>   /* (x86) The platform supports direct access to I/O devices with IOMMU. */
>  #define _XEN_SYSCTL_PHYSCAP_directio     2
>  #define XEN_SYSCTL_PHYSCAP_directio  (1u<<_XEN_SYSCTL_PHYSCAP_directio)
> +/* (x86) The platform supports Hardware Assisted Paging. */
> +#define _XEN_SYSCTL_PHYSCAP_hap          3
> +#define XEN_SYSCTL_PHYSCAP_hap           (1u<<_XEN_SYSCTL_PHYSCAP_hap)
> +
>  struct xen_sysctl_physinfo {
>      uint32_t threads_per_core;
>      uint32_t cores_per_socket;
> --
> 2.22.0

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