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

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



Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
v3: Move declaration to pv/domain.h. Re-base.
v2: Add CONFIG_PV conditional.

--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -289,6 +289,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
@@ -24,6 +24,7 @@
 #include <asm/microcode.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
+#include <asm/pv/domain.h>
 #include <asm/pv/shim.h>
 #include <asm/setup.h>
 #include <asm/spec_ctrl.h>
@@ -342,13 +343,16 @@ 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");
 
     printk("  PV L1TF shadowing: Dom0 %s, DomU %s\n",
            opt_pv_l1tf & OPT_PV_L1TF_DOM0  ? "enabled"  : "disabled",
            opt_pv_l1tf & OPT_PV_L1TF_DOMU  ? "enabled"  : "disabled");
+#endif
 }
 
 /* Calculate whether Retpoline is known-safe on this CPU. */
--- a/xen/include/asm-x86/pv/domain.h
+++ b/xen/include/asm-x86/pv/domain.h
@@ -21,6 +21,8 @@
 #ifndef __X86_PV_DOMAIN_H__
 #define __X86_PV_DOMAIN_H__
 
+#include <xen/sched.h>
+
 /*
  * PCID values for the address spaces of 64-bit pv domains:
  *
@@ -59,6 +61,8 @@ int pv_vcpu_initialise(struct vcpu *v);
 void pv_domain_destroy(struct domain *d);
 int pv_domain_initialise(struct domain *d);
 
+bool xpti_pcid_enabled(void);
+
 #else  /* !CONFIG_PV */
 
 #include <xen/errno.h>




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