From patchwork Tue Aug 20 18:09:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 11104463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B483112C for ; Tue, 20 Aug 2019 18:11:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5670020644 for ; Tue, 20 Aug 2019 18:11:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sDWuV3CL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5670020644 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i08ae-0006F8-Gf; Tue, 20 Aug 2019 18:10:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i08ad-0006EN-1v for xen-devel@lists.xenproject.org; Tue, 20 Aug 2019 18:10:39 +0000 X-Inumbo-ID: c1aca482-c375-11e9-92eb-bc764e2007e4 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c1aca482-c375-11e9-92eb-bc764e2007e4; Tue, 20 Aug 2019 18:10:14 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id x4so6008554ljj.6 for ; Tue, 20 Aug 2019 11:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sV0qWOJ/GW8oUNxPGEM0VlC++QHpUA9IjU7eh2HiTNI=; b=sDWuV3CLcTj+dEOKd4Sk+aTpOrNigFGNDIQF/vFn6cZ7LGNciue8yu2CZ4mu5w7N9S rx26bnfN3eGk2BkrP1gnFdo/9r5har2oFwZ29gMQpkTY9N+TZjEGH3CKxeEHk81TI305 KCAWf9F2LteMxTVykF9fxo80TRi6bGPbKmSOXAckp3ahB1JE4jOlkx7p0MzSguWfy8O6 6xDuu2NI7esH9NTrsaJQopKVf6F4RR+91+UDmKdpy0vQMdVwypb62wbTzdr3NeOAt8QX OhKEsgN21ZEebh4kMaIEaK6B3j3psle9NdoA/LYjEd42pDsdV8AtNMAAutQFk8ocH0dW uscg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sV0qWOJ/GW8oUNxPGEM0VlC++QHpUA9IjU7eh2HiTNI=; b=goLoF1ZEGvzFWvG1XefFJX+RMOcfjnAaZgDUU1uFV5CUWBMvo69qdp4ZveDZ+Gz6Vg 8PiJ622CdTqZCN2B8WXIwYEdWYEZ4D1tHYBYQ/EhnUgBHFJok/l717rZJxFYAaOa7Avs 4uRWdXIAUwxXvVfbS4Ys6aAY8MRRSgj7lMnk2zXN/u1UCaRK82PWece6XgKz7lISWt9h E4unngcvaYMQZCNzuo/UEs+3dk3VlQsrZtkAXdmnfZO0pp5im2f3JvkVbzyGWb6QOBrc 2HLnDNO8uEl92HB5YUDiXyRUx8R4KbIGCNfwx5CG+I/NBsdgmxPplv2eUisPaYnQ/ke7 o+cQ== X-Gm-Message-State: APjAAAWcjasgWaiKJbS7LHPxaW1YpxK+DtJ6mADx/BtDSrMEGVCsaM4D 1rwpB0ZKogIW02cxoKdKdxQ4eIK9 X-Google-Smtp-Source: APXvYqzIEMJh06GJk1sgEmwG3QUtQ/zCkKBXI2zw37mrTWmpDQQkoht079jCv2Pi32tw5D/EXssDew== X-Received: by 2002:a2e:89c8:: with SMTP id c8mr17272564ljk.138.1566324613373; Tue, 20 Aug 2019 11:10:13 -0700 (PDT) Received: from otyshchenko.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id f6sm2900642lja.16.2019.08.20.11.10.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Aug 2019 11:10:12 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Tue, 20 Aug 2019 21:09:45 +0300 Message-Id: <1566324587-3442-7-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566324587-3442-1-git-send-email-olekstysh@gmail.com> References: <1566324587-3442-1-git-send-email-olekstysh@gmail.com> Subject: [Xen-devel] [PATCH V3 6/8] iommu: Add of_xlate callback X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Oleksandr Tyshchenko , julien.grall@arm.com, sstabellini@kernel.org, Volodymyr_Babchuk@epam.com, Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Oleksandr Tyshchenko According to the generic IOMMU DT bindings [1] the context of required properties for IOMMU device/master node (#iommu-cells, iommus) depends on many factors and is really driver depended thing. We need some way to provide the driver with DT IOMMU specifier which describes the IOMMU master interfaces of that device (device IDs, etc) to let it decide how to interpret them. For that reason we can borrow Linux's "of_xlate" callback. All IOMMU drivers which support generic IOMMU DT bindings should use this callback. Subsequent patches will use of that support. [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/iommu/iommu.txt Signed-off-by: Oleksandr Tyshchenko CC: Julien Grall CC: Jan Beulich --- xen/include/xen/iommu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 48f8748..79b86ac 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -240,6 +240,16 @@ struct iommu_ops { int __must_check (*iotlb_flush_all)(struct domain *d); int (*get_reserved_device_memory)(iommu_grdm_t *, void *); void (*dump_p2m_table)(struct domain *d); + +#ifdef CONFIG_HAS_DEVICE_TREE + /* + * All IOMMU drivers which support generic IOMMU DT bindings should use + * this callback. This is a way for the framework to provide the driver + * with DT IOMMU specifier which describes the IOMMU master interfaces of + * that device (device IDs, etc). + */ + int (*of_xlate)(device_t *dev, struct dt_phandle_args *args); +#endif }; #include