[RFC,42/42] KVM: VMX: Notify importers of exported TDP to flush TLBs on KVM flushes EPT
Message ID | 20231202093712.16049-1-yan.y.zhao@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1679975vqy; Sat, 2 Dec 2023 02:06:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyTVIJkaCEhacpu4YlHDIenzPDAS/j4ixrajBU691zfQBqN2H4HyVRV7yqxINIq7xLJKLo X-Received: by 2002:a9d:674d:0:b0:6d7:f363:eb0 with SMTP id w13-20020a9d674d000000b006d7f3630eb0mr1130675otm.35.1701511610621; Sat, 02 Dec 2023 02:06:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701511610; cv=none; d=google.com; s=arc-20160816; b=XhIvq0sdCz3iiiun+tl8aDs3tLR4dZQpCfgx6TNwL/vwPS0k08iLtlFIsOXPUZN7cH ckT3mkqGGzMLz+kX+EErdL7nMpe6HLIukv/F9OyQ+5v7fFYdG8yPwN4qQQpUd6dj4Gpa +QANgg9YCNaOdQRA4QJWxHvDYsdiu8RPfAc3J6YJ2y3pTTz53Y6/gLzv9ehrCdmWl9sB z0L1Sm3OvnSA74dVnD4U8/2WwO9bIWn+vCdYti1LFjOpjefsmNpJm+ttJ+gnjlmy0zl4 PSp3eJ2rAypUv+li8LYg2Qdh4o/lICsbaEEr5/Lq2DHjGNmAtjHUJVpTtYltp3nB4NJF XXZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=oDpH+HNfJa91xtSRusHBAfnt3IpjK7vwQD5RmMpEEAI=; fh=+WI4m5k3dRLR+dR3neThuZkNBTzIm/a8HgtddERL9fA=; b=uDSMRZlgz9cdUD2Zp72AMu0fkR4s+RmLOku3J4RprsES0vn0//FVU4JvSH/RwS59ds iidP1ZXiyNAnsrIGF7Sg8SbfS//31Vm0itEYYiTckwbl4f0WRWRc+OeRwesm2SKTpHMk Da9WmBLfZlJXchY4ptYvJ3/PJ1j6C5GtazzlZG7lq6iJttIJOD7x80SGtpZIYmU1H/ah tUVZFrpXBKSzIX8Aup9hZ5xlKRaLMciqBl0rG72c0rPCBVgomxqWbck8JKJPYwywYpVA LeeY5FGe83B5GSOA6LZYb58b6WosXWfi/oCYN1oCk5GRWQI8G5F3/EzHYZXSno02wfSf pMJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F8wGCTFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z21-20020a630a55000000b005bdbe64cc26si4788263pgk.535.2023.12.02.02.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 02:06:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F8wGCTFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5AA78808EF47; Sat, 2 Dec 2023 02:06:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232549AbjLBKGG (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sat, 2 Dec 2023 05:06:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232545AbjLBKGE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 2 Dec 2023 05:06:04 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DAE01A4; Sat, 2 Dec 2023 02:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701511571; x=1733047571; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Kur6VrDVtWtZgYRN/PKml2utDvkLe+OiXJiTkkUWmVs=; b=F8wGCTFZk2QUknO7gbXDejUEEb48++ssQQ0oTcPgn+IvpZwj373BhywE oBuan7FuN2fOBZtxFCvFyDuYB+uXrCiP9hLsI09Xk2EJXrBZPiTSWYt+E +gepyrYcVIStGEJ9pYti4pyaUrjuURhupDe4W6pd8lc7V9UedhyVWf0Ft ypAMK62lK2pZctfH8ScnM/Kjukr7QfHYTyAw5LsruhPudT6VpDABAdV1p ffJxv4xL4sQl5ga9DmyWgd2WT4OBjNK7WPgqzqu0nggO40NOGrCwXEeM2 F3Mtpn3X0PHtz2PiffhMztIAKC7n839j5uoLFI5ci+eOZ4/K9F4TbLQC/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="383989384" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="383989384" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 02:06:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="913854410" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="913854410" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 02:06:07 -0800 From: Yan Zhao <yan.y.zhao@intel.com> To: iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alex.williamson@redhat.com, jgg@nvidia.com, pbonzini@redhat.com, seanjc@google.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, yi.l.liu@intel.com, Yan Zhao <yan.y.zhao@intel.com> Subject: [RFC PATCH 42/42] KVM: VMX: Notify importers of exported TDP to flush TLBs on KVM flushes EPT Date: Sat, 2 Dec 2023 17:37:12 +0800 Message-Id: <20231202093712.16049-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231202091211.13376-1-yan.y.zhao@intel.com> References: <20231202091211.13376-1-yan.y.zhao@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 02 Dec 2023 02:06:14 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784164238634619502 X-GMAIL-MSGID: 1784164238634619502 |
Series |
Sharing KVM TDP to IOMMU
|
|
Commit Message
Yan Zhao
Dec. 2, 2023, 9:37 a.m. UTC
Call TDP FD helper to notify importers of exported TDP to flush TLBs when
KVM flushes EPT.
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
---
arch/x86/kvm/vmx/vmx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 2fec351a3fa5b..3a2b6ddcde108 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7547,6 +7547,9 @@ static int vmx_vcpu_create(struct kvm_vcpu *vcpu) static int vmx_flush_remote_tlbs_range(struct kvm *kvm, gfn_t gfn, gfn_t nr_pages) { kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH); +#if IS_ENABLED(CONFIG_KVM_INTEL_EXPORTED_EPT) + kvm_tdp_fd_flush_notify(kvm, gfn, nr_pages); +#endif return 0; }