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 A8579C433EF for ; Sun, 24 Apr 2022 16:09:01 +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:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EhkRMZmxdbBcpGjV6uyl9YacxwoT+QgQ5vMf3qG1Bmk=; b=1ATf9p8u+UNe9CXlxMlckzqYhu 3FpUode3e35HRSmEaVD2JGZe+bjl5yT4dM4Fc1b32uEbD/0rJTxO+TXWWnowWQQNLztVaAk3yfosE iHwKW1TEeHBmgv+i+qQil3aCDzCLTeOGdKV9P1tRtLviC3vRh2fVWxroVSzOj6umRIv1xZok6NkKs otk2cO9drM6vO0oMYV/fUC1vP8ViO9iFzn4QLHIDRY47jeA3A3naBdIdJresQ5bf1QH/cUkDxyMu/ vgUMegJ67JF3X0RjxUIn4HeDoK9tOB4+dVJfYI/heUN/24o7whi+BpidckBTnKxkv1etlTShOgNhW 6NLH6/mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nielm-006u9b-TM; Sun, 24 Apr 2022 16:07:31 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nielk-006u8s-OG for linux-arm-kernel@lists.infradead.org; Sun, 24 Apr 2022 16:07:29 +0000 Received: by mail-lf1-x129.google.com with SMTP id x17so22306805lfa.10 for ; Sun, 24 Apr 2022 09:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=P0QTcW9KC8jtIUCRBrIIRQHtbmv2CJL2pbvGJ+qNveo=; b=RiDL8hh90QWpKHeZOtsPDicsUv8uA01P9JI5zDhJzv9S+hSKAbApcqzHs0T8Ldp9TH fAKRmSgdTSQEE98j8anHPESWwfAC2Wr6fwaU0UzzpCRUSoyOzbyPMzyk4xG8MnEvB3iV vXzmNcMzP3+/OStgwtLtURtgOrLqR3sG0n+QrmZd6F+knSa4ckhblkdvzPf132oMlyW7 8t9564ctxOVGtPTZPcgIhaetMmVgXzuHspqXhW5Z1CHzDb7rM2I+v0s8lEPpdwVc60cp RKkWFcAQAI+3ep3nitOiLgSd5r38470CHVIt8zrx9Sfl0OWd+5F9Bp8RCTq2DFJy08Ox nIrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=P0QTcW9KC8jtIUCRBrIIRQHtbmv2CJL2pbvGJ+qNveo=; b=1JNF5qrq7JJfuZh2c1apA0i3Ak/yIyaJcdrCrX/u7JF/76D5/vCoEtszRFAAJ4yfc+ 2LS1MyyX82RN1xzp329uSI+mzYDIMHL12t3qWlssBx7lxCEK+89fCMzSOOWWRgKftEf0 uRsJTYxRJ5L55QWymEpvkkbg3ZqDcN/Ibh06vEiTSmNCodk7yMm9MrqopdlxRXiL0OGI q0m5EnBvaDXnCarXgPiQnUYC676dWmZYr/GjWxHl+DkBYjjmz/KWZvqZ6/xD03b8Bpl0 gc1lQM65+QFF+HEiV49LJEyVlhNYPlZ4Eg651AZolFP7aPbFUdBhvwcpvG8rJaKHH4ul yX5w== X-Gm-Message-State: AOAM532eVfc5XYCdY6NUfd8ATUmduRbOkDAyMFtTn7/1mmuuYjeco/tz vEYlRq8C0dT9itrm1dMWB7w= X-Google-Smtp-Source: ABdhPJwXDQKL0ddwC14m+1rm/W4CunYi8dET47R83s7iLr9ZMexO+AO6MY6p46hpbAM/pGFodjYHLQ== X-Received: by 2002:a05:6512:685:b0:471:d466:9750 with SMTP id t5-20020a056512068500b00471d4669750mr9842846lfe.623.1650816445822; Sun, 24 Apr 2022 09:07:25 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id x5-20020a2e9dc5000000b0024dbe5356bcsm925671ljj.91.2022.04.24.09.07.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Apr 2022 09:07:25 -0700 (PDT) Subject: Re: [PATCH V1 6/6] arm/xen: Assign xen-grant DMA ops for xen-grant DMA devices To: Christoph Hellwig 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" References: <1650646263-22047-1-git-send-email-olekstysh@gmail.com> <1650646263-22047-7-git-send-email-olekstysh@gmail.com> From: Oleksandr Message-ID: Date: Sun, 24 Apr 2022 19:07:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220424_090728_814919_9291F8BF X-CRM114-Status: GOOD ( 16.11 ) 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 23.04.22 19:42, Christoph Hellwig wrote: Hello Christoph > 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. Well, I will remove it then (and update commit description). For virtualized but non-virtio devices, it is not needed at all. For the virtio devices, this check is already present at virtio.c:virtio_features_ok() > -- Regards, Oleksandr Tyshchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel