From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD457C4338F for ; Wed, 4 Aug 2021 05:50:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4380360F41 for ; Wed, 4 Aug 2021 05:50:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4380360F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB9ni-0006xE-3d for qemu-devel@archiver.kernel.org; Wed, 04 Aug 2021 01:50:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB9mp-0005r9-SC for qemu-devel@nongnu.org; Wed, 04 Aug 2021 01:49:51 -0400 Received: from mga02.intel.com ([134.134.136.20]:30089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB9mn-0004CR-Je for qemu-devel@nongnu.org; Wed, 04 Aug 2021 01:49:51 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10065"; a="201021404" X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="201021404" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 22:49:40 -0700 X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="521700570" Received: from gao-cwp.sh.intel.com (HELO gao-cwp) ([10.239.159.133]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 22:49:38 -0700 Date: Wed, 4 Aug 2021 13:57:04 +0800 From: Chao Gao To: Jason Wang Subject: Re: [PATCH 0/3] Disable vhost device IOTLB is IOMMU is not enabled Message-ID: <20210804055703.GA5925@gao-cwp> References: <20210804034803.1644-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210804034803.1644-1-jasowang@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Received-SPF: pass client-ip=134.134.136.20; envelope-from=chao.gao@intel.com; helo=mga02.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Wei.Huang2@amd.com, dgilbert@redhat.com, peterx@redhat.com, qemu-devel@nongnu.org, Sriyash.Caculo@amd.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Aug 04, 2021 at 11:48:00AM +0800, Jason Wang wrote: >Hi: > >We currently try to enable device IOTLB when iommu_platform is >set. This may lead unnecessary trasnsactions between qemu and vhost >when vIOMMU is not used (which is the typical case for the encrypted >VM). > >So patch tries to use transport specific method to detect the enalbing >of vIOMMU and enable the device IOTLB only if vIOMMU is enalbed. > >Please review. Tested-by: Chao Gao Tested with TDX; this series fixes the performance issue we saw in a TD when vhost was enabled. Thanks Chao > >Thanks > >Jason Wang (3): > virtio-bus: introduce iommu_enabled() > virtio-pci: implement iommu_enabled() > vhost: correctly detect the enabling IOMMU > > hw/virtio/vhost.c | 2 +- > hw/virtio/virtio-bus.c | 14 ++++++++++++++ > hw/virtio/virtio-pci.c | 14 ++++++++++++++ > include/hw/virtio/virtio-bus.h | 4 +++- > 4 files changed, 32 insertions(+), 2 deletions(-) > >-- >2.25.1 >