From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54E4EC433E1 for ; Mon, 17 Aug 2020 17:18:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A293206FA for ; Mon, 17 Aug 2020 17:18:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BR09cPe8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A293206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D4046B0002; Mon, 17 Aug 2020 13:18:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9832A6B0005; Mon, 17 Aug 2020 13:18:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8988A6B0006; Mon, 17 Aug 2020 13:18:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 719D36B0002 for ; Mon, 17 Aug 2020 13:18:30 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2C25D181AEF21 for ; Mon, 17 Aug 2020 17:18:30 +0000 (UTC) X-FDA: 77160719580.17.moon00_4905d2427018 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id A6A7F180D0184 for ; Mon, 17 Aug 2020 17:18:29 +0000 (UTC) X-HE-Tag: moon00_4905d2427018 X-Filterd-Recvd-Size: 6104 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Aug 2020 17:18:29 +0000 (UTC) Received: by mail-ej1-f66.google.com with SMTP id kq25so18657158ejb.3 for ; Mon, 17 Aug 2020 10:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R7aC/DW1op4r+Z4hZksSzHEK9PjzVJ3p6kxoSLnPAKg=; b=BR09cPe8bipj+PNSPJ1rZYq6F49uZsaAAEaiZZeLUza/HWSgYsHfiQUqvehNj/zHdo qbAxbhzWgLv+JgXc9Hf8u2r0v1qrwMCu7IY9bpfe2MF85MUYUijjETNvgjULx5UIGbMx vN81Nd7Fr3GNRpruujEBEwi/FOk3fs+L+J1ksom42jt/RIrqDQ7WW/C4Q+72/n9Kq5Tq due0daqEBODsHaOjJ9pd0+84Yq8HsJ3xE9GoW+cLGESU0YeMSiOWmp56VWa09Lly0cQo yQVqNC6ia55Pl7kROeww6SaTcZpoM6TDOlbVsdYI6d9Y6hnApPDaUub8SL5YIR+nIsKH UcNg== 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:mime-version :content-transfer-encoding; bh=R7aC/DW1op4r+Z4hZksSzHEK9PjzVJ3p6kxoSLnPAKg=; b=dygBbKbwO7A/K6KnDDL3ilKYDpW0yp3D/sHHzKD+x/+rZwRm8yBXLHw3MZpf7sqtxf qAjG9GJEzvcroaBi352lTPgqjXY+qwdx4Cqm4lwj/6VVp95U0RRbr7DNxkBkaduZF7bp W5GTz+a5+AJVde57UvktLSDtDIYd0NB/uYHSXuKmlTenQCw9wFK2YM1CtOIp3624iQsP A+3r+OD61NJL2uq7JicvGHLF567lfb5ceKR79pOyt4U7ZpzDKP61XTQSTRiN4Y8ByWj0 oOwK5b1+fDYq07TiK+rhJ4qq94VLlA0aj4bCJDgJt0T5DQa0rsmgOtde4g2JnupDZOU0 vxIw== X-Gm-Message-State: AOAM532VzlUF3QVOqoqr0HdNnFuv7+k4D1hG86YfAxits1PbFtzL/8f5 achwRrrMJv1NlmbLCx8MRr6y7Q== X-Google-Smtp-Source: ABdhPJz+VQOQnttZCxy1+owk4CZNaUQxcFkQ4Xi34Vfk+EDoxMENCWtTQOcb42FV3aeK6PlTS6T3Tg== X-Received: by 2002:a17:906:c7c8:: with SMTP id dc8mr15694071ejb.285.1597684707897; Mon, 17 Aug 2020 10:18:27 -0700 (PDT) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id lc18sm14672502ejb.29.2020.08.17.10.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 10:18:27 -0700 (PDT) From: Jean-Philippe Brucker To: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Cc: joro@8bytes.org, catalin.marinas@arm.com, will@kernel.org, robin.murphy@arm.com, baolu.lu@linux.intel.com, Jonathan.Cameron@huawei.com, jacob.jun.pan@linux.intel.com, zhangfei.gao@linaro.org, xuzaibo@huawei.com, zhengxiang9@huawei.com, fenghua.yu@intel.com, Jean-Philippe Brucker Subject: [PATCH RESEND v9 00/13] iommu: Shared Virtual Addressing for SMMUv3 (PT sharing part) Date: Mon, 17 Aug 2020 19:15:46 +0200 Message-Id: <20200817171558.325917-1-jean-philippe@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: A6A7F180D0184 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This is version 9 of the page table sharing support for SMMUv3, rebased onto v5.9-rc1. v9 resend: * Rebased onto v5.9-rc1. Moved to drivers/iommu/arm/arm-smmu-v3/ as a result. v9: https://lore.kernel.org/linux-iommu/20200723145724.3014766-1-jean-phi= lippe@linaro.org/ * Moved most of the SVA code to arm-smmu-v3-sva.c. This required moving struct definitions and macros to arm-smmu-v3.h (patch 7), hence the new 700 insertions/deletions in the diffstat. * Updated patches 4 and 8 following review. * Fixed a bug when replacing a private ASID. v8: https://lore.kernel.org/linux-iommu/20200618155125.1548969-1-jean-phi= lippe@linaro.org/ * Split SVA series into three parts: page table sharing, I/O page faults, and additional features (DVM, VHE and HTTU). Fenghua Yu (1): mm: Define pasid in mm Jean-Philippe Brucker (12): iommu/ioasid: Add ioasid references iommu/sva: Add PASID helpers arm64: mm: Pin down ASIDs for sharing mm with devices iommu/io-pgtable-arm: Move some definitions to a header arm64: cpufeature: Export symbol read_sanitised_ftr_reg() iommu/arm-smmu-v3: Move definitions to a header iommu/arm-smmu-v3: Share process page tables iommu/arm-smmu-v3: Seize private ASID iommu/arm-smmu-v3: Check for SVA features iommu/arm-smmu-v3: Add SVA device feature iommu/arm-smmu-v3: Implement iommu_sva_bind/unbind() iommu/arm-smmu-v3: Hook up ATC invalidation to mm ops drivers/iommu/Kconfig | 17 + drivers/iommu/Makefile | 1 + drivers/iommu/arm/arm-smmu-v3/Makefile | 5 +- arch/arm64/include/asm/mmu.h | 3 + arch/arm64/include/asm/mmu_context.h | 11 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 752 +++++++++++++++ drivers/iommu/io-pgtable-arm.h | 30 + drivers/iommu/iommu-sva-lib.h | 15 + include/linux/ioasid.h | 10 +- include/linux/mm_types.h | 4 + arch/arm64/kernel/cpufeature.c | 1 + arch/arm64/mm/context.c | 105 ++- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 487 ++++++++++ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 860 ++++-------------- drivers/iommu/intel/iommu.c | 4 +- drivers/iommu/intel/svm.c | 6 +- drivers/iommu/io-pgtable-arm.c | 27 +- drivers/iommu/ioasid.c | 38 +- drivers/iommu/iommu-sva-lib.c | 85 ++ MAINTAINERS | 3 +- 20 files changed, 1729 insertions(+), 735 deletions(-) create mode 100644 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h create mode 100644 drivers/iommu/io-pgtable-arm.h create mode 100644 drivers/iommu/iommu-sva-lib.h create mode 100644 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c create mode 100644 drivers/iommu/iommu-sva-lib.c --=20 2.28.0