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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E9ABC433EF for ; Sat, 23 Apr 2022 16:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236471AbiDWQpT (ORCPT ); Sat, 23 Apr 2022 12:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236443AbiDWQpR (ORCPT ); Sat, 23 Apr 2022 12:45:17 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF1B3D1D4 for ; Sat, 23 Apr 2022 09:42:20 -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=BbU4qU1u+ib3z06jcjxtpWxewOhWeGRACT3SUClYfQU=; b=AhrDqdLN83fA5xLD4BM2GP2cPe ZPFamzRoBUWgZ6TueAJd/LnTpCkqpIraOwxxnFdhh10vSqfwomorASN5nrlTp8V9Dry0dnGRxjjEw v7JuhY6ox9FidKp5Hlp3HLTXDr3Vz4TBvr3dE48LvKPTfesNhxqNIb3L+LJJZDQI1E1E05OFk7nZJ fdgfnxdUNoQrEcTt1wwc5Cy5Dh82uK7C4oGDIf7aO2Wy+2OHkl7W87Jqi1aFlc6+I3039Se/GEDo3 evKCQOC1ENaEsIIIjNzCQtGidYDx7645wDthEjcAzr29ZEXmNny8nn/OVrakWVtN9qIAf8TKvLahV rbi2qx6g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1niIpu-004etX-T8; Sat, 23 Apr 2022 16:42:18 +0000 Date: Sat, 23 Apr 2022 09:42:18 -0700 From: Christoph Hellwig To: Oleksandr Tyshchenko Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Oleksandr Tyshchenko , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Julien Grall , "Michael S. Tsirkin" , Christoph Hellwig Subject: Re: [PATCH V1 6/6] arm/xen: Assign xen-grant DMA ops for xen-grant DMA devices Message-ID: References: <1650646263-22047-1-git-send-email-olekstysh@gmail.com> <1650646263-22047-7-git-send-email-olekstysh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1650646263-22047-7-git-send-email-olekstysh@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2022 at 07:51:03PM +0300, Oleksandr Tyshchenko wrote: > static inline void xen_setup_dma_ops(struct device *dev) > { > #ifdef CONFIG_XEN > - if (xen_swiotlb_detect()) > + if (arch_has_restricted_virtio_memory_access() && > + xen_is_grant_dma_device(dev)) > + xen_grant_setup_dma_ops(dev); > + else if (xen_swiotlb_detect()) I don't think that arch_has_restricted_virtio_memory_access check should be there as it still is a bit of a layering violation.