[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 18:53:23 -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=k/C632FvearAKr5zLZcpmc22IeiMcKenmPUIyo4mnxo=; b=X13HGCPg9nk5DIuXhgwbxmk0bJhsWB0dyOifxaJntNIEIfnv2fMQ4/E17r0i0DrAlnhMVid3+IfQxalDhdThZq//QADlgvaQVZ6uVeXPQhAyxus50Bj46KAi6Aiw6rzgg69/BUOI/9Mana8ydWKZQdYQR06lnHdkTpk3tB5rOQgXAVge1dJoP2PmpQRBepYMiP5yXdbHxFsCHMKrzx7MehbaoOxB6OZdQTB8W9m/DsQFyZWG7A9o01oW6/z+lELdRtwFiTA3p9JhDcWteVSzjPOnXB3XVy9oWyxiZmv2Yq9PjOivq3qUaiIHZgCZJt9VnjMShm+jaI3t6cKqZNbgxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jj6SQlFb0sQsAjQMUR5A/5mTtaLqQcpNymPASci34N7tUpUuu7CbrW29ba9y+6bMp+/ONt+iZhb4/vDO/TvNc20XlpOzlo/jT/JsCZfse0Md5IvgFztRgrMn/rbJY5peNVa/lP2ekhs3Ths6dOLoZX4t7a7VECTkreLHUa30ch/GHVQSC4TuCM/pQo5DB1lPGsVoaUk5NYhf9077+F2pAdPNcL5ojx7Cwhh06YhgXwl5tiF+eauDTBRIADCRHybhs+RnnTQE0tgCm1QcDa7QBBLJDUo/MamIH+FhpOLXpy0dFzE3wUdtolLy2C6+vrw+oyHU7BeAwkgZNq+2uHDHtw==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 14 Feb 2023 23:53:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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.


-boris


+                       setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB);
                mitigate_smt = true;
                break;



 


Rackspace

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