Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5866105ioo; Wed, 1 Jun 2022 14:27:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyesBucN53LsK7Q5kFLHF5SHOv89QfGeCk4xQAejhMyN+9oQdrwkSb2Kz1+PUUBHHfj2s99 X-Received: by 2002:a17:90b:1bcd:b0:1e2:c8da:7c29 with SMTP id oa13-20020a17090b1bcd00b001e2c8da7c29mr23262722pjb.4.1654118834803; Wed, 01 Jun 2022 14:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654118834; cv=none; d=google.com; s=arc-20160816; b=tUXJb9tiQa1ql+xQwkj1z+Qxf9Fsg9bFYhPv81VOzkXNJKzBZDsztqPWa2M85IuK/g CHlaVkykGLtFAJG68yYaVHkOWzIUDEwLNZXjl0KEoH9s5Ogx9CwIagzDTLoQwnidVGen JqyBQIyC/XTszar6ZxAbJhIexh2UY+hXDCRgU06hkSaiftI3b+GcPbVTkvF/0EFWQPBD VYrCIWL6ckplIOLqeRSYUYLW4tM+ICooRm8dU/NfwMykuCTYBvwrR3iJE3CmdzffnlFg +Ah1wN114IOfjaqzuqGzBcDP8GzuszfH7+6SU9YrJKk4F2g5xZuAKn3QLXIBA9X3TqB0 hFuQ== 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=oXC+omMyhQE+yQOLbS6KJe5K78bZY03LjtAozxlOWS4=; b=snbxLBHalSlHeUZWO5veJI7xZK9I97QByJy+vnbOLxVGB6CsAIyAPJNb5WjK6UdzCO hYjgaQtrf8axWXjL/R18PnsKjgmRB3s2VGJSV3vNVQfjuTH6rTgcuRVtGbbwbimRa4z5 1IZlk7xHpmpW8F9T5LWcaJSoLapOOTBn/dhL4GKY8GlunGR5aXbnSbG3zo1KgWDwCFCO 06aL8Cd8x8BThNX38o7tA3vX1Gqp5cNxkkoa9bm3j5BOib0NF5DLHVYIoe4h4qbz2iR7 HXAN0zM5KS8ipwf9BX1rYmn3p4uAlPDXuOaoJjJIGz2mPXvYDQlkLuL4GlWqgFHNeV6r 9xUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TAyjZkyH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y1-20020a170902700100b00164081096afsi3467621plk.195.2022.06.01.14.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TAyjZkyH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A2AA248BAA; Wed, 1 Jun 2022 13:17:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346431AbiEaRJ0 (ORCPT + 99 others); Tue, 31 May 2022 13:09:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236090AbiEaRJY (ORCPT ); Tue, 31 May 2022 13:09:24 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8465A6B036; Tue, 31 May 2022 10:09:23 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id s6so6526300lfo.13; Tue, 31 May 2022 10:09:23 -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=oXC+omMyhQE+yQOLbS6KJe5K78bZY03LjtAozxlOWS4=; b=TAyjZkyHiTXmbmHCSrE2qWJwfpy2mK18RqayHB9KPwF3D5Pg+bZ6eGYNeN34jbspjz XKAIAKaqLBFgTkjxxqEqqjzKoQ4toUSB64OhXxsfMMRXeKBxTuUTXvyIQGUiGfioo7kC oMkYvmT4C0UXva0czCxfN3JpmbeZVhWBsYi1qGOpj0WhxatmjVmbr0Qp0zNQmGicVbqD XOkcjG3W1KKt5f0akOma0UDAHja0EIq/KJOrVyQ2kluOg8ugvRzH57Wsp2EqTBQKNt5m 4tqMtwtv+jysyfjiBaAa2EYLry0bXPvGexMdU0w2FewQWJm/hZYWq2QWm7FRLYNLGMi4 npkw== 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=oXC+omMyhQE+yQOLbS6KJe5K78bZY03LjtAozxlOWS4=; b=PtSFlzs/ZV6s2lB045ns/cNkFL0Qj4KFrIkWpZ2KrlQ1dUN8S1QVOuAgxnVDi9Zug5 5anLRvBfgYNGvoTJIrai+cQwo4f2kvmyWJuYE/Tc2sJo31gLiT6XRWxGqIRxPH2dj8qa PnSDjGI9TTzfaURHJSGaVTQD60QS8wmQ7cy3AfDnfYwxWReFjMWu5xcaTvOn6nE7BLHh Bb3tCw1wZcJcf9R4mAbR+E35OcJC8SoWYFawRxaleI5dsBshNAEdA9xE9PMILQCbUu/k S1mb5hS5FaoQbj44hn6VjvK1U+vIn/VYuWWhMW6MMRX556BbvXc2sh33Bjk66aIVIPZJ 8Kaw== X-Gm-Message-State: AOAM5310fwHwklb2R2goWSWJUEMp1XPsvJ3KDzOqioSbHdTLPJYvhbc4 6whBHQPALodaYmZJQJmPr0O/fZogUOw= X-Received: by 2002:ac2:4f09:0:b0:478:6c80:64fc with SMTP id k9-20020ac24f09000000b004786c8064fcmr26696653lfr.34.1654016961692; Tue, 31 May 2022 10:09:21 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id i6-20020a196d06000000b00477cab33759sm3072432lfc.256.2022.05.31.10.09.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 10:09:21 -0700 (PDT) Subject: Re: [PATCH V3 5/8] dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops To: Krzysztof Kozlowski , xen-devel@lists.xenproject.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Cc: Oleksandr Tyshchenko , Rob Herring , Joerg Roedel , Will Deacon , Krzysztof Kozlowski , Julien Grall , Juergen Gross , Stefano Stabellini , "Michael S. Tsirkin" , Christoph Hellwig , Arnd Bergmann References: <1653944417-17168-1-git-send-email-olekstysh@gmail.com> <1653944417-17168-6-git-send-email-olekstysh@gmail.com> <15eef004-74c7-0eb5-3f87-86e164ef70ff@linaro.org> From: Oleksandr Message-ID: Date: Tue, 31 May 2022 20:09:19 +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: <15eef004-74c7-0eb5-3f87-86e164ef70ff@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 31.05.22 14:52, Krzysztof Kozlowski wrote: Hello Krzysztof > On 30/05/2022 23:00, Oleksandr Tyshchenko wrote: >> From: Oleksandr Tyshchenko > Thank you for your patch. There is something to discuss/improve. > >> diff --git a/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> new file mode 100644 >> index 00000000..ab5765c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> @@ -0,0 +1,49 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iommu/xen,grant-dma.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Xen specific IOMMU for virtualized devices (e.g. virtio) >> + >> +maintainers: >> + - Stefano Stabellini >> + >> +description: >> + The reference to Xen specific IOMMU node using "iommus" property indicates >> + that Xen grant mappings need to be enabled for the device, and it specifies >> + the ID of the domain where the corresponding backend resides. >> + The binding is required to restrict memory access using Xen grant mappings. >> + >> +properties: >> + compatible: >> + const: xen,grant-dma >> + >> + '#iommu-cells': >> + const: 1 >> + description: >> + Xen specific IOMMU is multiple-master IOMMU device. >> + The single cell describes the domid (domain ID) of the domain where >> + the backend is running. >> + >> +required: >> + - compatible >> + - "#iommu-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + xen_iommu { > No underscores in node names, generic node names, so this looks like > "iommu". ok, will change > >> + compatible = "xen,grant-dma"; >> + #iommu-cells = <1>; >> + }; >> + >> + virtio@3000 { >> + compatible = "virtio,mmio"; >> + reg = <0x3000 0x100>; >> + interrupts = <41>; >> + >> + /* The backend is located in Xen domain with ID 1 */ >> + iommus = <&xen_iommu 1>; > There is no need usually to give consumer examples in provider binding. > If there is nothing specific here (looks exactly like every IOMMU > consumer in Linux kernel), drop the consumer. I got it.  There is nothing specific from the device tree's perspective, I was thinking to draw attention to the IOMMU specifier (in our case, the master device's ID == backend's domain ID). But  '#iommu-cells' description above already clarifies that. Will drop. > >> + }; > > Best regards, > Krzysztof -- Regards, Oleksandr Tyshchenko