Message ID | 1564763985-20312-1-git-send-email-olekstysh@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <xen-devel-bounces@lists.xenproject.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2711D13AC for <patchwork-xen-devel@patchwork.kernel.org>; Fri, 2 Aug 2019 16:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17223286D0 for <patchwork-xen-devel@patchwork.kernel.org>; Fri, 2 Aug 2019 16:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B13028899; Fri, 2 Aug 2019 16:41:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 852F7286D0 for <patchwork-xen-devel@patchwork.kernel.org>; Fri, 2 Aug 2019 16:41:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1htab3-0003fE-5N; Fri, 02 Aug 2019 16:40:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from <SRS0=/l75=V6=gmail.com=olekstysh@srs-us1.protection.inumbo.net>) id 1htab2-0003f5-Bm for xen-devel@lists.xenproject.org; Fri, 02 Aug 2019 16:40:00 +0000 X-Inumbo-ID: 2a2095e5-b544-11e9-8980-bc764e045a96 Received: from mail-lj1-x244.google.com (unknown [2a00:1450:4864:20::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 2a2095e5-b544-11e9-8980-bc764e045a96; Fri, 02 Aug 2019 16:39:58 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id r9so73447164ljg.5 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2019 09:39:58 -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; bh=Uw+jv3JNkt6+knfySxxwH3jZ5VSifysIyy23XqbU+jE=; b=afYcsw871VoPfIB1O3RQP9cIVjTbXtiQgVjcZFC4fes178QdVzQcs3WosSSghhSI5b qDyoitVyNO5U5zW8Kzvln3Nx/QKRkSl7dF/58RlvufQLC+RL8X/yxp29HmkTxqYEtwnf 0TUFsmYgFrP4hS79V54csDdHgorjpKi/sRyDMfluimFXRGBNwenCDS5mls2H7Ah1XRCj 46AuxORs5g9Lwb9fGaUpDaLKZBg3YM5sy57qVqOMU6s1wkfiqmMK3mc/LLcilxSr1Hfy Biaa/bggKP6l2MN/el8eu8MTbd1m5QkV8+aNoP6yCFncLSQBFff81RSMqiO9MJg+14JH F8Ag== 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; bh=Uw+jv3JNkt6+knfySxxwH3jZ5VSifysIyy23XqbU+jE=; b=oW8d3qkT83pVJ9pFHk4gSAVHEHIsZJKpqUL1wMuRtpGS+t304ocTiHCATTQrvOs4Ts i0xKyi3+nvmQktIzBNxJ21ZpO1nSY0K2aXfELsEN3aFZ3L3Ac7hcWYHp1BbT05enzST4 ocbCMBToepgP7W8iEQqPwBlbjb+I7W2DHxT6o0IiP6VyNE8xNCzGrraaNRn7VvLmE8r7 lZXA4If/UsQ4pDNmLijCwwycnbk/QPUMtgilYkZZentPIMyRcnNyrB17D7Dc1uMz2gyp DPBbA95UMHGGXm10IHVct2XPYpn49z3tkR3s2zx9gTwIIObn7oHw6e18fHxOdsYlxvBD gSJw== X-Gm-Message-State: APjAAAUH8iNL/IYi/paGVIoUUQXoBGICY0k+TIdwS22cq86RG1S7LALi 3rf1iGacZS0YMv121VsjUSUvgvd8lNo= X-Google-Smtp-Source: APXvYqy/KdT4awfRVW6od2NwBB3VWth231tdLMZqjEMt5TiJyeBm6HE8TIc+Xw4lAQrE3DcZBLq2/A== X-Received: by 2002:a2e:980e:: with SMTP id a14mr13118687ljj.60.1564763997408; Fri, 02 Aug 2019 09:39:57 -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 q6sm15378998lji.70.2019.08.02.09.39.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Aug 2019 09:39:56 -0700 (PDT) From: Oleksandr Tyshchenko <olekstysh@gmail.com> To: xen-devel@lists.xenproject.org Date: Fri, 2 Aug 2019 19:39:39 +0300 Message-Id: <1564763985-20312-1-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH V2 0/6] iommu/arm: Add Renesas IPMMU-VMSA support + Linux's iommu_fwspec X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, julien.grall@arm.com, sstabellini@kernel.org, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
iommu/arm: Add Renesas IPMMU-VMSA support + Linux's iommu_fwspec
|
expand
|
Hello, all. Forgot to mention that an additional patch from Xen staging is needed, otherwise Xen may crash at the early stage: ead6b9f78355e8d366e0c80c4a73fa7fbd6d26cc "xen/arm: cpuerrata: Align a virtual address before unmap"
On 05/08/2019 08:58, Oleksandr wrote: > > Hello, all. Hi, > > Forgot to mention that an additional patch from Xen staging is needed, otherwise > Xen may crash at the early stage: > ead6b9f78355e8d366e0c80c4a73fa7fbd6d26cc > "xen/arm: cpuerrata: Align a virtual address before unmap" This patch is already merged in Xen :). Cheers,
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> The purpose of this patch series is to add IPMMU-VMSA support to Xen on ARM. Besides new IOMMU driver, this series contains "iommu_fwspec" support and new API iommu_add_dt_device() for adding DT device to IOMMU. The IPMMU-VMSA is VMSA-compatible I/O Memory Management Unit (IOMMU) which provides address translation and access protection functionalities to processing units and interconnect networks. Please note, this driver is supposed to work only with newest Gen3 SoCs revisions which IPMMU hardware supports stage 2 translation table format and is able to use CPU's P2M table as is if one is 3-level page table (up to 40 bit IPA). ---------- This driver is based on Linux's IPMMU-VMSA driver from Renesas BSP: https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/tree/drivers/iommu/ipmmu-vmsa.c?h=v4.14.75-ltsi/rcar-3.9.6 and Xen's SMMU driver: xen/drivers/passthrough/arm/smmu.c Although Xen driver has a lot in common with Linux driver, it is not a "direct ported" copy and should be treated as such. The major differences compare to the Linux driver are: 1. Stage 1/Stage 2 translation. Linux driver supports Stage 1 translation only (with Stage 1 translation table format). It manages page table by itself. But Xen driver supports Stage 2 translation (with Stage 2 translation table format) to be able to share the P2M with the CPU. Stage 1 translation is always bypassed in Xen driver. So, Xen driver is supposed to be used with newest Gen3 SoC revisions only (H3 ES3.0, M3 ES3.0, etc.) which IPMMU H/W supports stage 2 translation table format. 2. AArch64 support. Linux driver uses VMSAv8-32 mode, while Xen driver enables Armv8 VMSAv8-64 mode to cover up to 40 bit input address. 3. Context bank (sets of page table) usage. In Xen, each context bank is mapped to one Xen domain. So, all devices being pass throughed to the same Xen domain share the same context bank. ---------- Driver was tested on Gen3 H3 ES3.0 based boards using current staging (7d1460c xen/arm: optee: fix compilation with GCC 4.8) in a system with several DMA masters being assigned to different guest domains. You can find it here: repo: https://github.com/otyshchenko1/xen.git branch: ipmmu_upstream2 You can find previous discussions here: [V1] https://lists.xenproject.org/archives/html/xen-devel/2019-06/msg01755.html Oleksandr Tyshchenko (6): iommu/arm: Add iommu_helpers.c file to keep common for IOMMUs stuff iommu/arm: Add ability to handle deferred probing request [RFC] xen/common: Introduce _xrealloc function iommu/arm: Add lightweight iommu_fwspec support iommu/arm: Introduce iommu_add_dt_device API iommu/arm: Add Renesas IPMMU-VMSA support xen/arch/arm/domain_build.c | 12 + xen/arch/arm/platforms/Kconfig | 1 + xen/common/device_tree.c | 1 + xen/common/xmalloc_tlsf.c | 21 + xen/drivers/passthrough/Kconfig | 13 + xen/drivers/passthrough/arm/Makefile | 3 +- xen/drivers/passthrough/arm/iommu.c | 80 +- xen/drivers/passthrough/arm/iommu_fwspec.c | 91 ++ xen/drivers/passthrough/arm/iommu_helpers.c | 78 ++ xen/drivers/passthrough/arm/ipmmu-vmsa.c | 1342 +++++++++++++++++++++++++++ xen/drivers/passthrough/arm/smmu.c | 48 +- xen/include/asm-arm/device.h | 7 +- xen/include/asm-arm/iommu.h | 12 + xen/include/asm-arm/iommu_fwspec.h | 65 ++ xen/include/xen/device_tree.h | 1 + xen/include/xen/xmalloc.h | 1 + 16 files changed, 1727 insertions(+), 49 deletions(-) create mode 100644 xen/drivers/passthrough/arm/iommu_fwspec.c create mode 100644 xen/drivers/passthrough/arm/iommu_helpers.c create mode 100644 xen/drivers/passthrough/arm/ipmmu-vmsa.c create mode 100644 xen/include/asm-arm/iommu_fwspec.h