Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp642593iob; Wed, 18 May 2022 09:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3MvXY/R825cPaUdyOrljvsIoKwuTzUE+/+2R7MlXggmf/9unfbYZbv3NGZYCJkkeA1KK+ X-Received: by 2002:a17:902:e5c7:b0:15e:9bba:d4dc with SMTP id u7-20020a170902e5c700b0015e9bbad4dcmr414388plf.95.1652892125217; Wed, 18 May 2022 09:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652892125; cv=none; d=google.com; s=arc-20160816; b=EAkgN/Qe/agxvGsl+eIAdOLT+f1DtWFi5zplEwHH1Yu6OfVBej7Kr84N+B4n30j6Cq kSu0TSvgwWUtUpeUaueR11dcRRLFj+ol576LL8AiAVlXgIYztdpnacKb2+L02tkn4hUZ ywEcFSAMeGQWOzzwC5XUHJwNA0sW7MBm4eo0N0XX2nz3c5VspWCYbV2jea+pbKdLb7tq CY9VFnYWthI/LXkzGYaNx7/53ySPoqWUY1yVbf+2ZFnHLgvFUc1sUjOJa7wtXPnoktBj j3X5iKRX9/C1lT9xeNnlwznGP0xwdIEVJRxvMtoEoZMjGsF6HPjnIhEuD/2Tk1a0ZR3e tscQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=C+4wkKItqI6SMbZ2LnK/luO4u/Y6DPbxM4v9qm8+7C0=; b=kp/9sWgZSZIQvNTgu+pQov+BbbW5iHyu80GZuRkk6zACBlFgL/3J2UTOlKm92C5drr OKD9InMhvKT7tXQ3C9lPQQA8aTvuTEs7U0LKc2YdKM7njmqy6teGpc2Rt1TnN/L0in+f SivMuQvyZTsBHvS86nIP9/w7+8c8HQVlY4gyg9GUK++/5l4Gxo8TeqdOs5HH5TfvUMBu aXruIxqQmbr8/enavAdofXsgg2b+S2n6vJjkUpyOIwtWV2RXwFqBOyvtDOfDKZMbyvUn ztEuI9E3LX5BywpNQHzZTbqoaLqu57kvnUfK/l+ToAHnkPukgcteok+HpScRMAsFvob+ lmug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s133-20020a63778b000000b003c64b4e4492si3022209pgc.602.2022.05.18.09.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 09:42:05 -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; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 38A861B12EB; Wed, 18 May 2022 09:39:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240334AbiERQj3 (ORCPT + 99 others); Wed, 18 May 2022 12:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240340AbiERQj2 (ORCPT ); Wed, 18 May 2022 12:39:28 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E39316F93F; Wed, 18 May 2022 09:39:26 -0700 (PDT) Received: from mail-yb1-f175.google.com ([209.85.219.175]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1N63JO-1npMbU28vQ-016PHS; Wed, 18 May 2022 18:39:24 +0200 Received: by mail-yb1-f175.google.com with SMTP id v71so4646073ybi.4; Wed, 18 May 2022 09:39:24 -0700 (PDT) X-Gm-Message-State: AOAM532l8m8lEszDoj70Q9bmmqfVAJcoCtndPIiTWhKzJVVK4wAiysQj LqvGooPp3FLdd8CL4XL5Tw25IChUez5HjYRD8bc= X-Received: by 2002:a25:cfd7:0:b0:64d:9526:1ed4 with SMTP id f206-20020a25cfd7000000b0064d95261ed4mr487184ybg.106.1652891963222; Wed, 18 May 2022 09:39:23 -0700 (PDT) MIME-Version: 1.0 References: <1651947548-4055-1-git-send-email-olekstysh@gmail.com> <1651947548-4055-6-git-send-email-olekstysh@gmail.com> <56e8c32d-6771-7179-005f-26ca58555659@gmail.com> In-Reply-To: <56e8c32d-6771-7179-005f-26ca58555659@gmail.com> From: Arnd Bergmann Date: Wed, 18 May 2022 17:39:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 5/7] dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops To: Oleksandr Cc: Arnd Bergmann , xen-devel , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , DTML , Linux Kernel Mailing List , Linux ARM , Oleksandr Tyshchenko , Jason Wang , Rob Herring , Krzysztof Kozlowski , Julien Grall , Juergen Gross , Stefano Stabellini , "Michael S. Tsirkin" , Christoph Hellwig , Jean-Philippe Brucker Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:l6Zmm0Lt2Cs3Lj3V/oRAG1XoFxKRLpZyyELmAAmBae16I65msdd 5JM6bkwu7sJPAOaiw//CuKljLbLeZcxBAaKafhVBllY8NkFvtnW312uXnwxG1PpeLelGKJe qMT6rxYcCLtfBuOzoyCyJGtUnj3lnf2371xiIqY969MkIQzN0PTHgOe65AdXgsRe8p2wPUZ Ci1OTFOHAUzcBUD0PNqIg== X-UI-Out-Filterresults: notjunk:1;V03:K0:S6JupdEVbEI=:IVS+G9GEQ5TsiitUcqK9BO jzKYAZxO0bn70RdppsRPMUII0MihQqTtSkOAPfNbM9AQQap4U25NhvYinbRizJuqEXvEtP+gs O1iqiZ9m2GrrLMDYQrYBxYaUUaqrdxR9hmy6NxiAcvaKezWxmQwgrqQzJxsn+S2iCpeBBQseZ j3W8mN0IiiQ3YTY6gQBAhzLM0h/UyjuHJwBixIhjd/ur6fQ8hrZSiNU+jMcUfFQjT5yo1FcZu iFcj9L6FnlPAIE/XQ1t3wgDwNXmts8ZZ1jWheZ0mXGl1e1eCxMjn0JOetjO5KR9hDZX8l2Jig M/KDdEZakfN9yjk9a6f/nNKT2orkGPoYLy/8zlVJCSMMqJ5f9ri1M1GkiNb7IvFjAIZK5MLdS KSK5zCvAjwSkRg04WBRwYRyUIUc6vUJAGbnprDlOF6K6SHUiMoYPiE5VMHsB+uPfc9f6tSMyF Ql9dh1/fvuG4eOHt5V8OXugiwgpuXthOW4W5DlRrydmY9kXFt3p43WdoiL3Mo/QSfx6TPy/5q PVeQ1Lr995aIILAGl+mTbHbprEMoK1ukNI4rW6E+SRGpF+/Gli22rJiGtn83yV3GRR+oJ9aD8 P6IsGMrtmCrOKs0aXm6phDpv+qwcX1vBSCZnGCH/XdMUUXSMpXVxdbrjt4RPnnQOP9KMJdQRb hNwKjMOrMoYk9fXPqg9mu0Z9cawdyi8w7V6iVWcK0khHf/qNQPwbovPxG17h0Ao+SUfRFs1JN MMaVUJOGfXc0fRfN6WWDrOFc0uGrMr7phYr0JQ== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, May 18, 2022 at 5:06 PM Oleksandr wrote: > On 18.05.22 17:32, Arnd Bergmann wrote: > > On Sat, May 7, 2022 at 7:19 PM Oleksandr Tyshchenko wrote: > > > This would mean having a device > > node for the grant-table mechanism that can be referred to using the 'iommus' > > phandle property, with the domid as an additional argument. > > I assume, you are speaking about something like the following? > > > xen_dummy_iommu { > compatible = "xen,dummy-iommu"; > #iommu-cells = <1>; > }; > > virtio@3000 { > compatible = "virtio,mmio"; > reg = <0x3000 0x100>; > interrupts = <41>; > > /* The device is located in Xen domain with ID 1 */ > iommus = <&xen_dummy_iommu 1>; > }; Right, that's that's the idea, except I would not call it a 'dummy'. From the perspective of the DT, this behaves just like an IOMMU, even if the exact mechanism is different from most hardware IOMMU implementations. > > It does not quite fit the model that Linux currently uses for iommus, > > as that has an allocator for dma_addr_t space > > yes (# 3/7 adds grant-table based allocator) > > > > , but it would think it's > > conceptually close enough that it makes sense for the binding. > > Interesting idea. I am wondering, do we need an extra actions for this > to work in Linux guest (dummy IOMMU driver, etc)? It depends on how closely the guest implementation can be made to resemble a normal iommu. If you do allocate dma_addr_t addresses, it may actually be close enough that you can just turn the grant-table code into a normal iommu driver and change nothing else. Arnd