On 2/14/23 6:53 PM, Boris Ostrovsky wrote:

On 2/14/23 11:13 AM, Jan Beulich wrote:

--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -18,6 +18,8 @@
  #include <linux/pgtable.h>
  #include <linux/bpf.h>
  +#include <xen/xen.h>
+
  #include <asm/spec-ctrl.h>
  #include <asm/cmdline.h>
  #include <asm/bugs.h>
@@ -32,6 +34,7 @@
  #include <asm/intel-family.h>
  #include <asm/e820/api.h>
  #include <asm/hypervisor.h>
+#include <asm/xen/hypervisor.h>
  #include <asm/tlbflush.h>
    #include "cpu.h"
@@ -934,7 +937,8 @@ do_cmd_auto:
          break;
        case RETBLEED_MITIGATION_IBPB:
-        setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB);
+        if (!xen_pv_domain() || xen_vm_assist_ibpb(true))


Is this going to compile without CONFIG_XEN?


I also think these two conditions should be wrapped into something to limit 
exposure of non-Xen code to Xen-specific primitives.


Oh, and this needs x86 maintainers.


-boris


Reply via email to