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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 2CC7DC76196 for ; Tue, 11 Apr 2023 04:10:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A8881409A8; Tue, 11 Apr 2023 04:10:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A8881409A8 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2k9gMIre X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1U7H6OfXxD0D; Tue, 11 Apr 2023 04:10:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 81B4D4099A; Tue, 11 Apr 2023 04:10:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 81B4D4099A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 50D33C0037; Tue, 11 Apr 2023 04:10:01 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4E309C002A for ; Tue, 11 Apr 2023 04:09:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 19473409A7 for ; Tue, 11 Apr 2023 04:09:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 19473409A7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qoVYQb5wrrLp for ; Tue, 11 Apr 2023 04:09:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 626284099A Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by smtp4.osuosl.org (Postfix) with ESMTPS id 626284099A for ; Tue, 11 Apr 2023 04:09:58 +0000 (UTC) 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=rD+dqujxYl9Osiyleh1grufBuXxhfBKDA17jK04Tidk=; b=2k9gMIrex63k49reJibh4Nz+WX wkqgOSjaBK86idsx/R94gqWybN+VmdlF4Tirt9ersZxldQv25YXVG27pX2lT2q/xDTw6z9ookrne5 Ym2rL5hlRJit1AIwCvyaLkQt+Uo2JK8GsE5Ao5aecXF3cgrEMRy9jBpZ++rj/A3Wls08QRvFvMaS1 TjRYM9sdNUIiyjO/ZEKDUfwd9ioWWUWo7z8nHvgcdsGg4IvY/8xMKpW9SCKS30xv2dZq/W0jCsHHJ D55tAykJfhhKuDZbu+sqSEJ0Jv22erHxQ5UgK/XOVUw+TfYDLwwA+B1zmkz3D+dA913+ohIGq40SG Cu8nw7Gg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pm5KN-00GNFD-0z; Tue, 11 Apr 2023 04:09:55 +0000 Date: Mon, 10 Apr 2023 21:09:55 -0700 From: Christoph Hellwig To: Jason Wang Subject: Re: [PATCH vhost v6 08/11] virtio_ring: introduce virtqueue_dma_dev() Message-ID: References: <20230327040536.48338-9-xuanzhuo@linux.alibaba.com> <73a24f95-b779-44ac-be28-45b35d1bf540@roeck-us.net> <20230407064634-mutt-send-email-mst@kernel.org> <1681097397.338332-4-xuanzhuo@linux.alibaba.com> <1681178179.2350223-1-xuanzhuo@linux.alibaba.com> MIME-Version: 1.0 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 Cc: Christoph Hellwig , Xuan Zhuo , virtualization@lists.linux-foundation.org, Guenter Roeck , "Michael S. Tsirkin" X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Tue, Apr 11, 2023 at 11:56:47AM +0800, Jason Wang wrote: > > The DMA device for virtio_pci is the underlying PCI device, always. > > !VIRTIO_F_ACCESS_PLATFORM means there is no dma device at all. Because > > of all these things you can't just expose a pointer to the dma_device > > as that is just a completely wrong way of thinking about the problem. > > Ok, so if there's no DMA at all we should avoid using the DMA API > completely. This means we should check dma_dev against NULL in > virtio_has_dma_quirk(). No nee to add a check to virtio_has_dma_quirk. But looking at virtio_has_dma_quirk shows that virtio-gpu is pretty messed up already as well. It can't really poke into the DMA details. We'll need core virtio helpers for allocating and syncing a sg_table instead and make virtio_has_dma_quirk private to the core. _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization