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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 A734DC4338F for ; Thu, 29 Jul 2021 22:35:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 75D7060F5E for ; Thu, 29 Jul 2021 22:35:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 75D7060F5E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+j2q4hwbGAvYd0rHVvifAmb/O91gb73RyUlpQpC5cyE=; b=HZ02czlcSyMC3U 4mpF26B051W5D8LIgwzR5EPtspNp5mNjl+982Jil3t6iQpEbQnk1jlbwHgsLftkZjXNCzk0L6wobV G+TjV7+TQmsDeUgcCe1tu+fnQfxuS2dwqbZlKmQgIk0nWLd7FHMVdQc8XyF93xxDZI2xnmP9Sxxw5 nnhwfy5JDt683tuPzpu4Sgz0dCWPDHw1C8EsMHXcox7/ZfZmk6Al15RSB6wonL+bw/wcqs2Zw8ogc m20V+Rz1LW8pb2P5DGcXm2b2etZys2He/G2VVkoRqDQSeT0wHK1W1hEK5sZIu527oFPa3YONHGEuj 0RolajezfgIkO+Y7+Mtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9Eb1-006DpI-5q; Thu, 29 Jul 2021 22:33:43 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9Eax-006Dok-B5 for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 22:33:41 +0000 Received: by mail-qt1-x82b.google.com with SMTP id b1so5154988qtx.0 for ; Thu, 29 Jul 2021 15:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wSwaXGR0ffkfvWSYpOo1mSV78T7UHpROeIuBTm4Z1MA=; b=JNsWCZEiSnwSWX4wOvM5A/54GOSNToWAvaSyXaVfkfUMj2iAO83NDeysjcv6v2HSus a7FXhiwDzdQMcThODZIAMpFvWYE0wKp+72IRfKZUjq6dJMu3CSvGv9gRIe0mEYk7f4iR 6lRau+ZIUy3OOBkEyqFaxTXUHZacdvac+hgno= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wSwaXGR0ffkfvWSYpOo1mSV78T7UHpROeIuBTm4Z1MA=; b=Fa1M/iHyBFw70FOC1dp8V/OBrcboV5O3a2eyH0NheA3L6nENgg4V8ovA+ACyIt4WB9 CNOUVE7MoWyE76JH60V7uYpeGJmzbkqMvPlFfS53wOZyO52+5Zh1/Hc1rhXneV9IQx0s /+91jgO8NWuFq+yKwJNW+4fHN0wTnJYwBbVIpwYlQz6Vgvs2YmCmMnvGPGkRBH4++tnm c9TsDe9lKXuAOHbI+Ly148wmlvH7lIRZ6xnd8E9uYDxzOsgHO06Pwq03XffHqXclZoGf g8TZ9S3O2zu+4rpnl4/+3dkyq/ka0Fga+K9RHOPY2l9DPUuC24iPLqxkXJwBSWMLkb3f tFJw== X-Gm-Message-State: AOAM532wgFKmKD4ibZ2GxNaeeJe8kOMM+K7GqS1mDYRDv8BudlOieIZu 1kbP0ToZCHpdbdSthUCewUko2N7p7OVSPw== X-Google-Smtp-Source: ABdhPJxVQUCg9HbEi5xUd7VFeq94dFM9aI6z9JHGczzKB+0Jwdv1PgEuNfUb1FX3RdyBR6i8z12XLg== X-Received: by 2002:ac8:d4a:: with SMTP id r10mr6238573qti.245.1627598017116; Thu, 29 Jul 2021 15:33:37 -0700 (PDT) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com. [209.85.219.178]) by smtp.gmail.com with ESMTPSA id c197sm2431874qke.33.2021.07.29.15.33.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jul 2021 15:33:34 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id m193so12711187ybf.9 for ; Thu, 29 Jul 2021 15:33:34 -0700 (PDT) X-Received: by 2002:a25:6088:: with SMTP id u130mr9908544ybb.257.1627598013905; Thu, 29 Jul 2021 15:33:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Doug Anderson Date: Thu, 29 Jul 2021 15:33:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/24] iommu: Refactor DMA domain strictness To: Robin Murphy Cc: Joerg Roedel , Will Deacon , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " , Linux ARM , LKML , suravee.suthikulpanit@amd.com, Lu Baolu , John Garry , Marek Szyprowski , Yoshihiro Shimoda , Geert Uytterhoeven , Yong Wu , Heiko Stuebner , Chunyan Zhang , Maxime Ripard , Jean-Philippe Brucker X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_153339_449677_34F33940 X-CRM114-Status: GOOD ( 29.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Wed, Jul 28, 2021 at 8:59 AM Robin Murphy wrote: > > Hi all, > > Here's v2 where things start to look more realistic, hence the expanded > CC list. The patches are now based on the current iommu/core branch to > take John's iommu_set_dma_strict() cleanup into account. > > The series remiains in two (or possibly 3) logical parts - for people > CC'd on cookie cleanup patches, the later parts should not affect you > since your drivers don't implement non-strict mode anyway; the cleanup > is all pretty straightforward, but please do yell at me if I've managed > to let a silly mistake slip through and broken your driver. > > This time I have also build-tested x86 as well as arm64 :) > > Changes in v2: > > - Add iommu_is_dma_domain() helper to abstract flag check (and help > avoid silly typos like the one in v1). > - Tweak a few commit messages for spelling and (hopefully) clarity. > - Move the iommu_create_device_direct_mappings() update to patch #14 > where it should have been. > - Rewrite patch #20 as a conversion of the now-existing option. > - Clean up the ops->flush_iotlb_all check which is also made redundant > by the new domain type > - Add patch #24, which is arguably tangential, but it was something I > spotted during the rebase, so... > > Once again, the whole lot is available on a branch here: > > https://gitlab.arm.com/linux-arm/linux-rm/-/tree/iommu/fq > > Thanks, > Robin. > > > CC: Marek Szyprowski > CC: Yoshihiro Shimoda > CC: Geert Uytterhoeven > CC: Yong Wu > CC: Heiko Stuebner > CC: Chunyan Zhang > CC: Chunyan Zhang > CC: Maxime Ripard > CC: Jean-Philippe Brucker > > Robin Murphy (24): > iommu: Pull IOVA cookie management into the core > iommu/amd: Drop IOVA cookie management > iommu/arm-smmu: Drop IOVA cookie management > iommu/vt-d: Drop IOVA cookie management > iommu/exynos: Drop IOVA cookie management > iommu/ipmmu-vmsa: Drop IOVA cookie management > iommu/mtk: Drop IOVA cookie management > iommu/rockchip: Drop IOVA cookie management > iommu/sprd: Drop IOVA cookie management > iommu/sun50i: Drop IOVA cookie management > iommu/virtio: Drop IOVA cookie management > iommu/dma: Unexport IOVA cookie management > iommu/dma: Remove redundant "!dev" checks > iommu: Introduce explicit type for non-strict DMA domains > iommu/amd: Prepare for multiple DMA domain types > iommu/arm-smmu: Prepare for multiple DMA domain types > iommu/vt-d: Prepare for multiple DMA domain types > iommu: Express DMA strictness via the domain type > iommu: Expose DMA domain strictness via sysfs > iommu: Merge strictness and domain type configs > iommu/dma: Factor out flush queue init > iommu: Allow enabling non-strict mode dynamically > iommu/arm-smmu: Allow non-strict in pgtable_quirks interface > iommu: Only log strictness for DMA domains > > .../ABI/testing/sysfs-kernel-iommu_groups | 2 + > drivers/iommu/Kconfig | 80 +++++++++---------- > drivers/iommu/amd/iommu.c | 21 +---- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 25 ++++-- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 29 ++++--- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 8 -- > drivers/iommu/dma-iommu.c | 44 +++++----- > drivers/iommu/exynos-iommu.c | 18 +---- > drivers/iommu/intel/iommu.c | 23 ++---- > drivers/iommu/iommu.c | 53 +++++++----- > drivers/iommu/ipmmu-vmsa.c | 27 +------ > drivers/iommu/mtk_iommu.c | 6 -- > drivers/iommu/rockchip-iommu.c | 11 +-- > drivers/iommu/sprd-iommu.c | 6 -- > drivers/iommu/sun50i-iommu.c | 12 +-- > drivers/iommu/virtio-iommu.c | 8 -- > include/linux/dma-iommu.h | 9 ++- > include/linux/iommu.h | 15 +++- > 18 files changed, 171 insertions(+), 226 deletions(-) I ran with: a) mainline Linux (at commit 4010a528219e) b) pulled iommu/next (at commit 9be9f5580ab6) c) picked from patchwork your series ...and I ran on sc7180-trogdor-lazor. Things worked OK and I could transition my eMMC to non-strict mode with: echo DMA-FQ > /sys/devices/platform/soc@0/7c4000.sdhci/iommu_group/type I was definitely getting some inconsistencies in my tests where the eMMC speeds were getting into a bad state, but I don't believe it's related to your patch series. I could transition myself back to strict DMA with this (only got one unrelated warn splat about dev_pm_opp_put_clkname when unbinding) because I was booted up from USB for testing: cd /sys/bus/mmc/drivers/mmcblk echo mmc1:0001 > unbind cd /sys/bus/platform/drivers/sdhci_msm/ echo 7c4000.sdhci > unbind echo DMA > /sys/devices/platform/soc@0/7c4000.sdhci/iommu_group/type echo 7c4000.sdhci > bind ...and it was consistently faster with non-strict than with strict so whatever bad state I sometimes managed to get in it affected both modes. ;-) So I guess that's a long-winded way to say this: Tested-by: Douglas Anderson _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel