]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86: report use of PCID together with reporting XPTI status
authorJan Beulich <jbeulich@suse.com>
Wed, 29 Aug 2018 14:28:01 +0000 (16:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 29 Aug 2018 14:28:01 +0000 (16:28 +0200)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/pv/domain.c
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/pv/domain.h

index 52108d4a83887c2735c7da3949fabbf24a683bb7..301e25078e60568a2f3130b260fd5f7883636ac7 100644 (file)
@@ -289,6 +289,12 @@ int pv_domain_initialise(struct domain *d)
     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;
index c430b25b840b6dc1474ba75963cc54a1b6f3aa47..1eb624ecf995fda91c4df02676692c8c399e2bfc 100644 (file)
@@ -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 ind_thunk thunk, uint64_t caps)
            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. */
index 4fea76444a928a8431293f8230a5fc94a70ee20e..7d9d09dd131bff21c4f6b9eda4ec7f3901a8fa43 100644 (file)
@@ -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>