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 657CBC433F5 for ; Sat, 23 Apr 2022 16:43:26 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XRYqtTBVkRlxrMq5Y/CEvAg+M7nQ5xdqdZYYbb/gXxY=; b=VTluu46yhBCJng Stui8cTywlo1N5SIKJ8vXH8A9n/McjI8rvdaw49678GTRzcPqhj07r0tHHrhB+N0jSOEPX1Jf5aAZ cJ/QV5qHg96YKYmW1q1p5cu1csaGo0x9R6lXik5hY37WmpTrFfuAEJPBvmV4yFpReMsWSixTJjtWs e26XZJtXxpFN1fstK3hinWMRJARhW1a5NvgBZPo7pDpLsyAtGVH4e9xqYYkFUFcsS53xQ2b7vSaXz 6PDakuLXRaQnpZXhRsCFMV+pV7IxRDqaZ4kKP0LRbEb7nJEAeBZQwLL/J+ixhfiB/FDLjglu1nYHN 9INL41x+zeTxJ1JdyTgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1niIpw-004etv-Fa; Sat, 23 Apr 2022 16:42:20 +0000 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-Disposition: inline In-Reply-To: <1650646263-22047-7-git-send-email-olekstysh@gmail.com> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel