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

Re: [PATCH] x86/Xen: make use of IBPB controlling VM assist


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Tue, 14 Feb 2023 19:07:51 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YCYmNgxwj/GhlCG7BbHd6Wb7Rzaxaov6suppziMNPA0=; b=d3tkSW0A2p5+5/2lQa7RjfjKmiuH+CwUuqVSlnMEYuPhAv8g1mFvW3cHrtqMP/18RMg0kDmdGYHnZ2SgDNoEyQlTB+Pe4xppgfHKILYvO3VvJrwWPpWyE7bgvtGdfxCBmZH4bLJOjcPb6Fv173sgGcEB7JUGtCCUl8bIGhp/EkmWtQkUVu4L+EglO6z0bCNYgTx0k18BlFiZVLEzaMa4s0QpHcdxMiVkpRanQeANIRK2Wm8DKJ7D9muCGWYgqxzfgk2JL2ZjQeAwQ36uaxy+8ajgmy3HiJsyPDmRYV1c/0SyPhGzQ/cOhBBXCbBK2wy6n5IEDhYfQeC2i3OK1JmUew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n++t09cH+hVPi8Lwr6qfRJeFFX4eYbArc43e1IPt2kBZLdLgqPVavQODwARJY9t7JBJmDT3rdxmNAUA5NDqWp2Ls2DQbQYDAHaum6DnuZqMOcBqV/0g2gPEz5MLSnIn+RHRdAbn2MjSmSqerkD35w3Cu4F9tgskdiOox2vhTUtqe7gy0usG1K7LegrEqKJpLPVhHzifQ4dcr0+Zu+1jy0Q3IU9OPCqkgkPJy8PMK8QB9UR/z/MUky4H2JvWGIzsSXNUB0obHAAqT6NsqgLNje7oUR8pjbF8fwadkHXzJBSnjafQCSggRcNLzht7EwYBrVSNQIIdm9Ferw4CNWEXznQ==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Wed, 15 Feb 2023 00:08:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.