Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3513327rwb; Sun, 7 Aug 2022 00:52:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4895TS9m5Y50kPiep6MvDvM8STov2/qRfFgu7zicQTXtXP4U2rPzjQOGqzxsOuMa2wM7dV X-Received: by 2002:a17:907:1dc5:b0:730:aade:95fb with SMTP id og5-20020a1709071dc500b00730aade95fbmr10256190ejc.520.1659858768878; Sun, 07 Aug 2022 00:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659858768; cv=none; d=google.com; s=arc-20160816; b=Dt3+fDGtuzFOBS5yhOTrdO/wdxK3RdNFL2o3WRFktvwfjVWYI2/+/UG6fXaU4WtJ1d uMLqXhBHkwF0Bm7FhDemyPnwjnOTE6uNApqNsWbRq6cSeTGHnf9MrkWmUWORklYeZbKV zwod0xiBVuG4YCg/phvE1Fd+csgiM6REId/CQHf4AzO+scv0K+IZi8D2p2SleHsJB6lQ SnWqYZBAwCulgvW4tLZWeuAxrQmVP5MAymbIa32CumvyUKPqfoDd8IjvJFmtm7ScglLI Gavj27T+4UgKsgu3q/KnW1bADsn8IL9UcH/p45x4bS+Y6hNjH2n9oYM1KocntKjA3pOi xN6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=T5G3kNwYRK7zLNUCU3R4YTUeZT4VSRInrZ5Z/Pp3Lkw=; b=LMhH62PfMx52K2xTtz31slQduxOCRDubRb242/EGnCiHV41MrvdTcjV0D5qkszrAgZ vU6FPbJL6CxxLIwYvHbJbe247JsUPXUuAavkjCVxJN9+u98BDMMBBHhRm8FigwpUsaSF fGFXKQtHMpW442UvoSDowKiIxhj5zoZA5Oj/fJ1PBFpidYFi9RhekqzwqF8H9jttLrVA asqAbxIALW/ie+KVBAdRt8zz6XpBl8aJxCRIea/r9Zfc+2+9aPZwdPMgqVfSiu1iDDlk V/0eKHQqGwsEeIEuOkFogrERvXk21hKuXIDitSggEGsvyEAG+OdQj4zkUjBYUqlFoZ0W tfcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=dCJLYoEW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020a05640251c600b0043c44a822e0si4044024edd.53.2022.08.07.00.52.23; Sun, 07 Aug 2022 00:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=dCJLYoEW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbiHGGwk (ORCPT + 99 others); Sun, 7 Aug 2022 02:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbiHGGwi (ORCPT ); Sun, 7 Aug 2022 02:52:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94017A18A; Sat, 6 Aug 2022 23:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=T5G3kNwYRK7zLNUCU3R4YTUeZT4VSRInrZ5Z/Pp3Lkw=; b=dCJLYoEWdMdq7/FPcLfiG3jJ3W wv4d+6ODFzDjRx+CPUhu0szsBENo+10WjIWSfgFDu2Ee0AWGv+cDPHlYrZuy6lXjevoWiSI071j0l CUUKF2QWwn4hZjEzNAiW9mL3Tvl/7cLETJ6yvSC/ZWFZ+Zzm+IU1c8VfwKR5wJX4+3FUzubPbehxK R/DdhY1UjhTq1kFAj+grLPDvto3F2m5EE/IC4lrC/a+LQEoeGVoLvsqqnuWm+59a9mXfwcGlicWsD NZRhuAHRJshRVzaEFOsu5cfFZLH8U9Qxab1KuBhwvdgDtlwJxsG9XC3ZBMgn9dmpramTuL7rqo7nb AghKr/vg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKa8z-007LfM-Rq; Sun, 07 Aug 2022 06:52:13 +0000 Date: Sat, 6 Aug 2022 23:52:13 -0700 From: Christoph Hellwig To: Linus Torvalds Cc: Will Deacon , mst@redhat.com, stefanha@redhat.com, jasowang@redhat.com, ascull@google.com, maz@kernel.org, keirf@google.com, jiyong@google.com, kernel-team@android.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Stefano Garzarella Subject: Re: IOTLB support for vhost/vsock breaks crosvm on Android Message-ID: References: <20220805181105.GA29848@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > Why is "IOMMU support" called "VIRTIO_F_ACCESS_PLATFORM"? Because, as far as the virtio spec and virtio "guest" implementation is concerned it is not about IOMMU support at all. It is about treating virtio DMA as real DMA by the platform, which lets the platform let whatever method of DMA mapping it needs to the virtio device. This is needed to make sure harware virtio device are treated like actual hardware and not like a magic thing bypassing the normal PCIe rules. Using an IOMMU if one is present for bus is just one thing, others are using offets of DMAs that are very common on non-x86 platforms, or doing the horrible cache flushing needed on devices where PCIe is not cache coherent. It really is vhost that seems to abuse it so that if the guest claims it can handle VIRTIO_F_ACCESS_PLATFORM (which every modern guest should) it enables magic behavior, which I don't think is what the virtio spec intended.