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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12AABC6FA99 for ; Fri, 10 Mar 2023 14:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1Y24kO++iCmle0boWAHEqcmUlJm4Nd4K2PnDj3c/yxM=; b=S9WZaTKAEoI2pp yUD00etgVanIh3c4JDThuhvgBl++EpIcKwUVBQ89GyL1sdm2jIbPwqjKYPHRcJ+ZEuyD7qWUhnoxf 7cmeN3r1mw47W9RjkegzRgAztwO33Sq1dBGaEn9Km/r8d04P96LzxWtcyiwbFTQzgnb02+UxkaV// rN3Hpnr1xwSfVi4nOKfzzEVl7UaKcMNDxM1HriWtoaJReh8Dix4zihFJOTaVPjg1PwaGjqyc+plqO 42ZjWjoEuQZbGF99X/sTe1KM5yk+6q1lRwsPDsxVp3xEO+8tmkDgTUnlBWRKhgLQTAIeWCnwaV46n EemM5RAD7HWioKEWzsVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paeAF-00Er7P-O8; Fri, 10 Mar 2023 14:56:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pae74-00Epea-1r for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:52:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 77AED1515; Fri, 10 Mar 2023 06:53:33 -0800 (PST) Received: from [10.57.90.67] (unknown [10.57.90.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11F5C3F71A; Fri, 10 Mar 2023 06:52:47 -0800 (PST) Message-ID: <82f5b94b-01fe-5c99-608c-f7d124247b7c@arm.com> Date: Fri, 10 Mar 2023 14:52:42 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v1 02/14] iommufd: Add nesting related data structures for ARM SMMUv3 Content-Language: en-GB To: Jason Gunthorpe , Jean-Philippe Brucker Cc: Nicolin Chen , will@kernel.org, eric.auger@redhat.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, joro@8bytes.org, shameerali.kolothum.thodi@huawei.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, yi.l.liu@intel.com References: <364cfbe5b228ab178093db2de13fa3accf7a6120.1678348754.git.nicolinc@nvidia.com> <20230309134217.GA1673607@myrica> <20230309182659.GA1710571@myrica> From: Robin Murphy In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_065254_219870_8DE6A542 X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023-03-09 21:01, Jason Gunthorpe wrote: >> For a lot of SMMUv3 implementations that have a single queue and for >> other architectures, we can do better than hardware emulation. > > How is using a SW emulated virtio formatted queue better than using a > SW emulated SMMUv3 ECMDQ? Since it's not been said, the really big thing is that virtio explicitly informs the host whenever the guest maps something. Emulating SMMUv3 means the host has to chase all the pagetable pointers in guest memory and trap writes such that it has visibility of invalid->valid transitions and can update the physical shadow pagetable correspondingly. FWIW we spent quite some time on and off discussing something like VT-d's "caching mode", but never found a convincing argument that it was a gap which needed filling, since we already had hardware nesting for maximum performance and a paravirtualisation option for efficient emulation. Thus full SMMUv3 emulation seems to just sit at the bottom as the maximum-compatibility option for pushing an unmodified legacy bare-metal software stack into a VM where nesting isn't available. Cheers, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel