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

[PATCH v3 3/4] x86: limit issuing of IBPB during context switch


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 25 Jan 2023 16:26:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=DxE8sU+0fw6taHSR/FfhMJ8LA+rLgHnMSqhdgo6D/y0=; b=giwGbcvOEsP2fp7R1guOV+dUq0VrCVqUBCkTf91MDVxrS192ASZHBDqRnb4Gu08Y3tpvtsCOjysy02slsRrKoT4Vd4b3z5NM4qF/QdQsEFf/cS3grbXJasA2zphyj6XBM8H1FqnEpzUCAZqWgoj8uQQb7Ep5SJR1o3UZjmPYOYjzxPcvKbUMueFAKCE+emdRmJXPVexdYPJf9AAAjY9hi1uNL+IOHTaABmO8bt3FygzLoTE0TekbProFWCJP3KuQWIMc5aJzsET3Cdpm+ZZ8E0CBCLKvdSFMBqnwzy4b7b4ANAu4QQE7jLRY7Q0drFqL/vjzuHuVdrcJKhfBaFVBEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CR/jY9DYtV8ZcBFm/SD/ViDqcDsMptrfwccZHAQWBZCpYuRjAxSv0vkuvgL1uJNnhjHstGyBi9LceuD4Tv8XxvXUUKZD7zUrdQ52AwfDhwVBJU/eCj+JWVJbYmU0k7f4JCmrPF1JH+BwG808c1DgBZmfQjJA3Dv+032qgfu2LRez8Ok6sCfsBoJo2TzFPiLlvlVGpkgggJGjwQrN4QcZxlL0iOcKXcH0iNAyAQmC4dFsOWG+T+HUKaEZUgNe7buVyUfQrb4p69lIwqPMhfoItl5r1AMphu89VFsuN8Pz/uNwhnFeKhRGPMRfOj1gvcOk+5W2sAe1mvLmfI3tchFcCA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 25 Jan 2023 15:26:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When the outgoing vCPU had IBPB issued upon entering Xen there's no
need for a 2nd barrier during context switch.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v3: Fold into series.

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2015,7 +2015,8 @@ void context_switch(struct vcpu *prev, s
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
+        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) &&
+             !(prevd->arch.spec_ctrl_flags & SCF_entry_ibpb) )
         {
             static DEFINE_PER_CPU(unsigned int, last);
             unsigned int *last_id = &this_cpu(last);




 


Rackspace

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