From nobody Fri Apr 19 16:49:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1581335010041252.64186050849537; Mon, 10 Feb 2020 03:43:30 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j17SJ-000601-Ud; Mon, 10 Feb 2020 11:42:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j17SH-0005zq-Uc for xen-devel@lists.xenproject.org; Mon, 10 Feb 2020 11:42:21 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 65956644-4bfa-11ea-852a-bc764e2007e4; Mon, 10 Feb 2020 11:42:21 +0000 (UTC) X-Inumbo-ID: 65956644-4bfa-11ea-852a-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1581334942; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QEILRaYX5mYlkb6OwVe6kk2u8v4uLe6Y6Nce7nvnsIU=; b=IooPNaGnb4h5tvDB2f7/4/+JqmaV436jFTdlinSIRiem9ZA1QCJsDCzA a88mLqtUR/zWBi5CNYnVLMwcaDAF+JGCGRNGjWi/9+fZqBnNfvHR0MmQ5 6qPT6wCLmUrNTHaqYbv7sUKeEP74T3F2gGaUyCtqTIfCz6W8o4I9dHSOv A=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: WwnHjby62vsfFz7dYYXmyop07pMHMh14XS7b+BDSqh8l1HBip6w9GlysAS6sDDgLzCquez5gP3 UeRwCKwFU/1aeUwLS/WHh5x7nYyOKhR/mMOIG/4yvvJmKJELsTU3JGvLFkTSK/CEgFjyvhrwD0 ljXOSUB7Gg4Lf9X0aIuPm/3nkqktRK85c10Mgd94EnGfawXyPHMqU5RCywfx5FbtGYA177Dq3o 2FfY3AN0ziJUFL6htfCey6womzpmEXeGADHAYL7t0TemC65HmELncFz5uR9/wCD69+ausOh3OU zpg= X-SBRS: 2.7 X-MesageID: 12202802 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,424,1574139600"; d="scan'208";a="12202802" From: Andrew Cooper To: Xen-devel Date: Mon, 10 Feb 2020 11:42:06 +0000 Message-ID: <20200210114206.17115-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/svm: Reduce vmentry latency X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Writing to the stack pointer in the middle of a line of pop operations is specifically recommended against by the optimisation guide, and is a techni= que used by Speculative Load Hardening to combat SpectreRSB. In practice, it causes all further stack-relative accesses to block until t= he write to the stack pointer retires, so the stack engine can get back in syn= c. Pop into any dead register to discard %rax's value without clobbering the stack engine. Smaller compiled code, and runs faster. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 In a small test where I wired ICEBP to tighly re-enter the guest, this drop= ped the guests perviced time for ICEBP (as close to one vmexit and entry as I could realistically manage) by 20 ticks. Sadly, that also seems to be the granuarlity of measurement. The modal measurement (accounting for 80% of samples) was 1200 ticks, and reduced to 1180 with just this change in place. --- xen/arch/x86/hvm/svm/entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S index e954d8e021..1d2df08e89 100644 --- a/xen/arch/x86/hvm/svm/entry.S +++ b/xen/arch/x86/hvm/svm/entry.S @@ -76,7 +76,7 @@ __UNLIKELY_END(nsvm_hap) pop %r10 pop %r9 pop %r8 - add $8,%rsp /* Skip %rax: restored by VMRUN. */ + pop %rcx /* Skip %rax: restored by VMRUN. */ pop %rcx pop %rdx pop %rsi --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel