From nobody Sun May 5 01:06:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1561032476; cv=none; d=zoho.com; s=zohoarc; b=csZFU6Xb1yySlxRIO+Jbz72GtFlS8qabZ45qgqMW5/ef2FXjMPKSzsT/4w/049MsWnFuhuNy2yNVgijUQpK6FFwu26jnPB4TdROIfxz4yGJDfOUcdpdsMhu/F6Ruj2ddsn93+lre8ZUCbuLO6kQyXTDR/4z+b9UCnA0+0rbQROM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561032476; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=UzHOPZAixTAJRxiVjAFxZ82oviijhw0bnlGbagi5X4s=; b=Tuo7g8xlSvmiNGW9jgGF3NHPGOegC8b54BTr6PWeZiob/XoXp09ko7Ek3UgZe2Fymu7/2sIf917Zff5tGN9bwquCVZi08NXQCbfe0dY9ylcpWKId6bknnJ+e78d3lBtLTrlhfGKTd73CM92n6v6ftdv0hgfGhmnS0knTrZ34tEA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1561032476368905.8896457024382; Thu, 20 Jun 2019 05:07:56 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdvpr-00064n-Gn; Thu, 20 Jun 2019 12:06:35 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdvpp-00064i-Vk for xen-devel@lists.xenproject.org; Thu, 20 Jun 2019 12:06:34 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d6ca76e8-9353-11e9-af64-8f220008ee0d; Thu, 20 Jun 2019 12:06:31 +0000 (UTC) X-Inumbo-ID: d6ca76e8-9353-11e9-af64-8f220008ee0d 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 (zoho.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 ~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: bK/WM6lDttzmGjbXWMerrkkeVOi/gukRsB65BJU0JKIvEGfDY9SQdPHzV/zUnPeVACe+Lju1H5 r/jy+mvx5pG45q8AMyzJz8UXCB7x3JHhq9TY90Uc0eqF68gP4Vwe+d8BIuHhwOKMTxIfnvvBdD czTHGsMKmPAGYlWlI36fLTecqtyRXJhJqdXAwi3pt5r3bRH2SOiqVzgmgEcoKl3+gX4DZtOI5v Nz3G5Fo42QuNsc6ghRPGIQYFuIiQUWxKuMwjxeh6yCYG/WNN0mWq2HyKFKOJS89pUl5GIPgAmA YaM= X-SBRS: 2.7 X-MesageID: 1988511 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.63,396,1557201600"; d="scan'208";a="1988511" From: Andrew Cooper To: Xen-devel Date: Thu, 20 Jun 2019 13:06:21 +0100 Message-ID: <1561032381-24385-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/svm: Drop svm_vm{load,save}() helpers 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: Jan Beulich , Wei Liu , Andrew Cooper , Suravee Suthikulpanit , Boris Ostrovsky , Brian Woods , =?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" Following on from c/s 7d161f6537 "x86/svm: Fix svm_vmcb_dump() when used in current context", there is now only a single user of svm_vmsave() remaining= in the tree, with all users moved to svm_vm{load,save}_pa(). nv->nv_n1vmcx has a matching nv->nv_n1vmcx_pa which is always correct, and avoids a redundant __pa() translation behind the scenes. With this gone, all VM{LOAD,SAVE} operations are using paddr_t's which is m= ore efficient, so drop the svm_vm{load,save}() helpers to avoid uses of them reappearing in the future. Signed-off-by: Andrew Cooper Acked-by: Brian Woods Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Boris Ostrovsky CC: Suravee Suthikulpanit CC: Brian Woods It turns out I was mistaken about how complicated this was. --- xen/arch/x86/hvm/svm/nestedsvm.c | 2 +- xen/include/asm-x86/hvm/svm/svm.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nested= svm.c index 35c1a04..fef124f 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -1030,7 +1030,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_u= ser_regs *regs) struct vmcb_struct *ns_vmcb =3D nv->nv_vvmcx; struct vmcb_struct *n2vmcb =3D nv->nv_n2vmcx; =20 - svm_vmsave(nv->nv_n1vmcx); + svm_vmsave_pa(nv->nv_n1vmcx_pa); =20 /* Cache guest physical address of virtual vmcb * for VMCB Cleanbit emulation. diff --git a/xen/include/asm-x86/hvm/svm/svm.h b/xen/include/asm-x86/hvm/sv= m/svm.h index 6e688a8..16a994e 100644 --- a/xen/include/asm-x86/hvm/svm/svm.h +++ b/xen/include/asm-x86/hvm/svm/svm.h @@ -22,9 +22,6 @@ =20 #include =20 -#define svm_vmload(x) svm_vmload_pa(__pa(x)) -#define svm_vmsave(x) svm_vmsave_pa(__pa(x)) - static inline void svm_vmload_pa(paddr_t vmcb) { asm volatile ( --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel