Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp616150iob; Wed, 18 May 2022 09:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZWTA9Pd2edt2q8suKpjGPVJvrdHiW1qlW7FFRVU4v7EvlSKz0/60/TNL6EtSNkToWNqcU X-Received: by 2002:a17:902:e74a:b0:15e:cbfe:690 with SMTP id p10-20020a170902e74a00b0015ecbfe0690mr439118plf.102.1652890357066; Wed, 18 May 2022 09:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652890357; cv=none; d=google.com; s=arc-20160816; b=eA37KyYyEy3uIqkPYj7p/Tv5y6Zb4rN/jBZ7Zg/A2sYkj6djgn/fT3MdYgaBB1zKFS bcZ+rz5Sgd+fZyaCvJbnfpFtxBd/iHQF3EE6Eg2QuowSnlIvIyW/Ph35iiPYtWMTCs1o dg13Cen+cALZNzkGRTAby7u4NWNngCsiTjht99s+4OsZmmmaHBTcNTlZ+rzpg1t+5osv xLlolLsUcqiAhoNzpTDutQdgu/D+sPodibyCePBxbSfl7w+clQfGAj5rICdx6CDq7neG FTfweahCKCmhYT7V7gM/TUIC0UUSa6Y0ABI+hkzrha3BCQnkiWDFrzShZEt+WGRO5qZc 0cOA== 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=w+vvhggY5msFSpuIeQjJEqzu6+KRYjG0/Dyaiz+6Ahk=; b=wgoZ/nmYsPpV+WOo87TP06ykIJUtDNvnBVioocFCv0JM53HtCgjEt+qDJVvav20e4Z 9e+dVvU6M5/shNiE8FJMuWAAVDFFuMR1dCOfw76G9M19srhcek9qkHfLw3R2bsx6NtZv /X3DtyFxV00iWjv3DPSpUvdyhHVe0VymzEyrPNsK1mi/5dyalr1/+AmvPRH/BWP4fBba zMpW0Z+ag5XJ3whb37FyNm/r0ARzWOCMwIV1qfZa/JIr68R7eYV+jZF7PwkJNHxnblHB 4hzS0pKObBfyZwZZwnLYyGMW0Z0EufyOzvOFmp7X3Z7i2l3y7inaC0iumWOQBvvigUSA 5E5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=o26M6FjV; 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 j7-20020a170903024700b00156f362e9ecsi3523084plh.105.2022.05.18.09.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 09:12:37 -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=o26M6FjV; 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 25FF914AA5E; Wed, 18 May 2022 09:06:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239798AbiERQGR (ORCPT + 99 others); Wed, 18 May 2022 12:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239786AbiERQGO (ORCPT ); Wed, 18 May 2022 12:06:14 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1292060ABE; Wed, 18 May 2022 09:06:12 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id w14so4406084lfl.13; Wed, 18 May 2022 09:06:11 -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=w+vvhggY5msFSpuIeQjJEqzu6+KRYjG0/Dyaiz+6Ahk=; b=o26M6FjVrTvwKRycgzqdUgaD/fMY0jNvZPKMBprN5moxEjbqX217K52BG1UyjTlpW8 TkElvlCiEr0oFKj64FnK7D0BTaha0N/RKOAbCZp6lj202WvxDG9+npaV38mjznkxchK0 ca27lzngCapZSKAMZ71QiIF6JaqjhHixL77RF5Bgznjpw5Stn3YUEnJk7Ljy5+7O5rfS AeefrWPMFfMpSVc26Nd93nZqazft3eY/qwXCAtgu5VEdGtAYjSOMBZWD5xn/6e4p2iq3 q6td1dLpMO660K30fnggqk/bf3MfyuwonxtLf5vHC1eQ+bsW7qdtNcAqhVyDZeihDgFS iSvg== 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=w+vvhggY5msFSpuIeQjJEqzu6+KRYjG0/Dyaiz+6Ahk=; b=F5u/ZUk/qIsw3hXGS0TpzdWVTDsvikq4/lacom3BZmMY/AOka6MrslXBhY8aQKI0IN BkqMQvcLsXufvWS5hJoNcqMrrxr1EJowIBrie8DnnkfhrjA/1fHSZBL2ZmjDTUMXOvgP Dr8cIVjy1f9yFwkx8/+Eza5F9naO+DVleQ04SVpEErQcllIXBZ+pN9UnSP9nR7K2WxQS RGrOYeUWAjxmq1D+XkHjBSmgPIdwR5uKz7mGnW8ghpaENTTcOdC2aL4qC5oARJH8XWy4 q+I95vT6zw5Onl0v+iVVgrnCVOB2xBcLw/1xUopGMggsW1J+H5YNF48fKHhTUfJtZ7me cfmg== X-Gm-Message-State: AOAM533omiAHZkXcfsMaFQDXfTXw1EAcqOsNRoOGq5QoFDy4ekrFZJIm ZIPxQpFe3mqqlWxZGjy2FQA= X-Received: by 2002:a19:e203:0:b0:477:c1bc:452 with SMTP id z3-20020a19e203000000b00477c1bc0452mr156732lfg.534.1652889970184; Wed, 18 May 2022 09:06:10 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id d25-20020a2e3619000000b0024f812282a4sm251584lja.131.2022.05.18.09.06.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 09:06:09 -0700 (PDT) Subject: Re: [PATCH V2 5/7] dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops To: Arnd Bergmann Cc: 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 References: <1651947548-4055-1-git-send-email-olekstysh@gmail.com> <1651947548-4055-6-git-send-email-olekstysh@gmail.com> From: Oleksandr Message-ID: <56e8c32d-6771-7179-005f-26ca58555659@gmail.com> Date: Wed, 18 May 2022 19:06:08 +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: 8bit Content-Language: en-US X-Spam-Status: No, score=-3.8 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 18.05.22 17:32, Arnd Bergmann wrote: Hello Arnd > On Sat, May 7, 2022 at 7:19 PM Oleksandr Tyshchenko wrote: >> diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml >> index 10c22b5..29a0932 100644 >> --- a/Documentation/devicetree/bindings/virtio/mmio.yaml >> +++ b/Documentation/devicetree/bindings/virtio/mmio.yaml >> @@ -13,6 +13,9 @@ description: >> See https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio for >> more details. >> >> +allOf: >> + - $ref: /schemas/arm/xen,dev-domid.yaml# >> + >> properties: >> compatible: >> const: virtio,mmio >> @@ -33,6 +36,10 @@ properties: >> description: Required for devices making accesses thru an IOMMU. >> maxItems: 1 >> >> + xen,dev-domid: >> + description: Required when Xen grant mappings need to be enabled for device. >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + >> required: >> - compatible >> - reg > Sorry for joining the discussion late. Have you considered using the > generic iommu > binding here instead of a custom property? I have to admit - no, I haven't. I was thinking that Xen specific feature should be communicated using Xen specific DT property. > 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>; }; > > 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)? > > Arnd -- Regards, Oleksandr Tyshchenko