From patchwork Fri Sep 15 16:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 14061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1196211vqi; Fri, 15 Sep 2023 10:08:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJi2sAgKeNizjGPDZAkqxoqKBSoP+rlJ6FYda34em/s5jja1lPU02I18r8QOt/xIrUgUhD X-Received: by 2002:a17:902:e9d5:b0:1bd:e64c:5c71 with SMTP id 21-20020a170902e9d500b001bde64c5c71mr1801502plk.21.1694797698148; Fri, 15 Sep 2023 10:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694797698; cv=none; d=google.com; s=arc-20160816; b=V4YDZucp5jPVWAEkXNmYvScv0QbRQE7EtyjtQ7TDwb1wpy8YrJFm0nc+25IyskooiR S8X3hB/rZq6I0SL01w497+93B/W2NxyOV85I75RT/v5iMGiTBbfDTS97SJ71SNbgit1s MPwjmIqMuP6gpEvxSFxY4mT+3eMr2NwMPN15O3+9RXPzmYedqmL6TahRIaqhAEORUJDc cF+aMkB2XREEB8Nb5iXYhj+bHFrT8myP66YBCM2R5fyyCtxAkxngf4sXH8P3WRRJ29se 39xRHBLTkZn0zlWAs4Nh7mFsW2CmHFDroBCGRJC3nUU3+ojPa4FtaBTL2cWCo6Ju50aB SzAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cVMFiGoRYsntQSFd3nBdqYsQLIu0thgYijJXT9mMGxo=; fh=3SO4sBNpOFNxfB4XNpCUWqe4lDXSOQ4O5f1XEPxUZRQ=; b=sIodlaX6/XH0Hj25irV57++5Jv+Fo/fiJ+01DIbijtUOy8xtscjDZ4F89jWcBZCEwq 6Jbp/b+HikwndZ8tJNBDh/OqTnYJXjsfXneb0G8T/7AamavL8EAYRIeKkvXl2YTObj6S VVTwtXG1vUoFljzP+p91aAC3htnawk0ClDDRGd1ulyBuYCYVlgwrIF4O6sndFZVl9ZSi zN4YMK858byXFhF8pY3Iu6HL+YjUUpwRFBP8MqJUGKjwcCb3N64PYl++5OJwR0R+gYJg CURuSaOl/nRVnNS3M4jHxmf/Yh71wW8XwLJRp8QoWG1hMf5UiT4yuud1q2h4khCZwcNU Kplg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o5-20020a17090323c500b001bbc6846a21si3585836plh.429.2023.09.15.10.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7CBC783EDD83; Fri, 15 Sep 2023 09:59:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233088AbjIOQ6k (ORCPT + 30 others); Fri, 15 Sep 2023 12:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234172AbjIOQ6X (ORCPT ); Fri, 15 Sep 2023 12:58:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9EA8F19BC for ; Fri, 15 Sep 2023 09:58:18 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 711AC1FB; Fri, 15 Sep 2023 09:58:55 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A6A73F5A1; Fri, 15 Sep 2023 09:58:16 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jgg@nvidia.com, baolu.lu@linux.intel.com Subject: [PATCH v3 0/7] Iommu: Retire bus ops Date: Fri, 15 Sep 2023 17:58:04 +0100 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 09:59:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777124191271115418 X-GMAIL-MSGID: 1777124191271115418 v2: https://lore.kernel.org/linux-iommu/cover.1674753627.git.robin.murphy@arm.com/ Hi all, I've finally been able to get back to this again, and I think it is now hopefully ready to go. Changes from v3 are quite minor - basically a few cosmetics and small tweaks (where I've taken the liberty of keeping Baolu and Jason's review tags; hope that's OK!), the one functional thing around blocking domains fixed, and plenty of reshuffling from rebases. I'm happy to see that the IOMMUFD selftest problem has resolved itself in the meantime, and it might even be able to use the standard registration flow after this, however I'll leave that for someone else more motivated, since my follow-up priority will be moving the of_xlate business around at the bus level to sort out the probe_device ordering mess once and for all. Thanks, Robin. Robin Murphy (7): iommu: Factor out some helpers iommu: Decouple iommu_present() from bus ops iommu: Validate that devices match domains iommu: Switch __iommu_domain_alloc() to device ops iommu/arm-smmu: Don't register fwnode for legacy binding iommu: Retire bus ops iommu: Clean up open-coded ownership checks drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 12 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 14 +- drivers/iommu/iommu.c | 140 ++++++++++++++------ drivers/iommu/mtk_iommu.c | 7 +- drivers/iommu/mtk_iommu_v1.c | 3 - drivers/iommu/sprd-iommu.c | 8 +- drivers/iommu/virtio-iommu.c | 3 - include/acpi/acpi_bus.h | 2 + include/linux/device.h | 1 - include/linux/device/bus.h | 5 - include/linux/dma-map-ops.h | 1 + include/linux/iommu.h | 1 + 13 files changed, 108 insertions(+), 92 deletions(-)