Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp92535pxb; Mon, 25 Apr 2022 06:27:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc8m+AL53k8shW56Qx8sZQftJDDepK8+jBLbMu8XwO76CSugh8+PsziHpe2Z0Rrz5PJc0W X-Received: by 2002:a63:6806:0:b0:3aa:a481:63f0 with SMTP id d6-20020a636806000000b003aaa48163f0mr15256083pgc.44.1650893265314; Mon, 25 Apr 2022 06:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650893265; cv=none; d=google.com; s=arc-20160816; b=pOkbtwCObVUirqlvX+Q7Adxi5ytYwbtI1ma5HgV7lz5xk9IV9PrL6ioNQaBFSvlHHS VT4umEab1s/sD6xWiz4OfH3M9Ipyr1dpSi/OUMckGazIv8MwzDuNFZCnIPyEubpSQYix 6oYqEJqWdwnaeI35W/kJrhwaOtGNSVMz7aplScpE8JH9FuxPCF8sE1cRR/gidJXi+BK5 oPSIYRGlT5IP3IWq8CMHvSMO1ClMiwVbSWMXaPLiRCAds8wbx6y44iuHnnOD5Pinmm05 7pR/GE/EdF2P/dMtohbgfbepAOuJ5/PwvAnPwDPU1LjK6s9I0CJF17u+m0baW+Ge39km eoMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=P0QTcW9KC8jtIUCRBrIIRQHtbmv2CJL2pbvGJ+qNveo=; b=bPuGZwbyl0zerzs8f2AVF6r7MQLV6eGlhHBVwFuVM1FI+sL2IUQsgJKkfLM1KIeDJb nNdASts5MjIU5mrsjib1aaMkhiEafz1O48dMGMmP2dluhpsoNPbRKPQL0mSS4wV+wGoD RaWsGSwPGEMSLvZcYn45oCVNDM0F8CJMHZVE58goLTN8abuIkqD/gsfCXjNz3URu2AY0 gBEuLBiEHzOcOdZkvTA321+VHatyMru29+6QMB75ynB+DxYpNInxnJ7oUaycZOa9J6c/ OoG9oyLwEviADZiBI+toYin9YcA/xtwNVX4ts7e2yPK1mr3ZX+TfGVp/MwaphwLU+geK Shvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RiDL8hh9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902bd9100b0015852e64a54si9344683pls.278.2022.04.25.06.27.29; Mon, 25 Apr 2022 06:27:45 -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=@gmail.com header.s=20210112 header.b=RiDL8hh9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234001AbiDXQK3 (ORCPT + 99 others); Sun, 24 Apr 2022 12:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbiDXQK2 (ORCPT ); Sun, 24 Apr 2022 12:10:28 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC5A2D5579 for ; Sun, 24 Apr 2022 09:07:27 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id n14so1583739lfu.13 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=nJ875wItR/CFkMQXxdlWMDPRVfsRJxRuJMnfKb5g245Ff5WensxcoHM/+OFxG6+pR1 BK2RodiBkMm70Fz5dHx6cjd28abMhoo0IjohWCqUpEQRklQ+ogzl/tYF+84gGNZeWozi NdAOMxLHpI+kVBPVKvIlu9qa8HmUCoJc1aDRBHL/SmXOVOU9veUbfaWSkeG5grrRJx1C CRId1UxLC9VZ8lZbCh4St653f3s5r4Mj1XGfksqdXwHB6TnEqXRzXpsUROD0wI+KXO6H GTDXTIdpGcxefiYsy5UUXva1g31ZXMFPLmctVeXOPU89CvcLIRbPvmia/xZMqJirxwPw yzJQ== X-Gm-Message-State: AOAM531sr8/YBbZ8sXi3eT08JS9vGXetakN5bPydaiMWWWOk0E3qcA+Z GLVfxGgLHFwXKKJcIhmpZPE= 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-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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