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

Re: [Xen-devel] [PATCH v2 1/2] x86: report use of PCID together with reporting XPTI status



On Wed, Jul 18, 2018 at 02:33:02AM -0600, Jan Beulich wrote:
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> v2: Add CONFIG_PV conditional.
> 
> --- a/xen/arch/x86/pv/domain.c
> +++ b/xen/arch/x86/pv/domain.c
> @@ -288,6 +288,12 @@ int pv_domain_initialise(struct domain *
>      return rc;
>  }
>  
> +bool __init xpti_pcid_enabled(void)
> +{
> +    return use_invpcid && cpu_has_pcid &&
> +           (opt_pcid == PCID_ALL || opt_pcid == PCID_XPTI);
> +}
> +
>  static void _toggle_guest_pt(struct vcpu *v)
>  {
>      const struct domain *d = v->domain;
> --- a/xen/arch/x86/spec_ctrl.c
> +++ b/xen/arch/x86/spec_ctrl.c
> @@ -256,9 +256,12 @@ static void __init print_details(enum in
>             boot_cpu_has(X86_FEATURE_SC_RSB_HVM)      ? " RSB"           : "",
>             opt_eager_fpu                             ? " EAGER_FPU"     : 
> "");
>  
> -    printk("  XPTI (64-bit PV only): Dom0 %s, DomU %s\n",
> +#ifdef CONFIG_PV
> +    printk("  XPTI (64-bit PV only): Dom0 %s, DomU %s (with%s PCID)\n",
>             opt_xpti & OPT_XPTI_DOM0 ? "enabled" : "disabled",
> -           opt_xpti & OPT_XPTI_DOMU ? "enabled" : "disabled");
> +           opt_xpti & OPT_XPTI_DOMU ? "enabled" : "disabled",
> +           xpti_pcid_enabled() ? "" : "out");
> +#endif
>  }
>  
>  /* Calculate whether Retpoline is known-safe on this CPU. */
> --- a/xen/include/asm-x86/spec_ctrl.h
> +++ b/xen/include/asm-x86/spec_ctrl.h
> @@ -38,6 +38,8 @@ extern uint8_t opt_xpti;
>  #define OPT_XPTI_DOM0  0x01
>  #define OPT_XPTI_DOMU  0x02
>  
> +bool xpti_pcid_enabled(void);
> +

I would have placed the prototype in pv/domain.h instead if the
function is defined in pv/domain.c.

Thanks, Roger.

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