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=-7.0 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED,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 519B8C11F66 for ; Tue, 13 Jul 2021 17:24:52 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 D86FB61249 for ; Tue, 13 Jul 2021 17:24:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D86FB61249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9FFD883B02; Tue, 13 Jul 2021 17:24:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xL8bQX0QHcqk; Tue, 13 Jul 2021 17:24:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8B8468293F; Tue, 13 Jul 2021 17:24:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 714ACC001A; Tue, 13 Jul 2021 17:24:50 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 738C8C000E for ; Tue, 13 Jul 2021 17:24:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5F22E83A5C for ; Tue, 13 Jul 2021 17:24:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ujkGOUgu3xgm for ; Tue, 13 Jul 2021 17:24:48 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by smtp1.osuosl.org (Postfix) with ESMTPS id DD4848293F for ; Tue, 13 Jul 2021 17:24:48 +0000 (UTC) Received: by mail-pl1-x630.google.com with SMTP id d1so6234203plg.0 for ; Tue, 13 Jul 2021 10:24:48 -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:mime-version :content-transfer-encoding; bh=oNw+zYjGLCxUN5d1sFI6uhg5qD8hAV6e7VF77djR0Qk=; b=LDDeVdQyyCZr+nS6kwbTKuHYesQQ1YAhjGz2GZfqKLu6Yi5m/VheF0U5QOYvl0RhbG qdhbnlHrHze2/cy5ZOJpdaGJNzRZWk4Ofs4jAhkvXh8QFjK7j+OZUTUMhrqvnsP+mxQg L6fHyxMRW51oS5MkGZiJ3TdRpuOqq+2EVnXew/5kU2O1nMXE5VVVb3+5E44Wo06AVhHk b5pO91Anr7Cj6zd6YkGIHNIpuPryoyU+PP6ohojshJGNx9HaieM7r5WINCH0hHtETEHK EkJoREgttzxNKlAJlMM0xj2csBr1ieDvT3JkuQ5Wausp1Pu531MTpOC9RPPr8dpM33hr B7Nw== 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=oNw+zYjGLCxUN5d1sFI6uhg5qD8hAV6e7VF77djR0Qk=; b=uoVODb5cUs5482GHjw19Q7UcqmSnS/D3BRjdDsW86CcR2Rq1WyvRwTWGEaGAC1rrk5 RW2WeuPx2bJpIPyrPk6lUzo6cbdQ9n0IB1jL3L/qWjXMptk8RTzM7AIW8t4F0/gBCz8U 8XKR2qWrhhJJ0c5OMYYRzRp4+Thk3l0q4e5No6SmMUAoBnjjYSgGW+YQXaHW1TKTERuq ZMFyGjU/M3LTViF4+YD7wQiHz8M3aXfOiYyPTcnOkoy12mrf9WCsilsRk+gZ6o8o9DZp PAbGZ9UNiXNylO50RzUzWcn0XfeFuM4MfsTAB5kVhuZ0gvM5nMgfOxaL6g0WSq4CXugH CMLA== X-Gm-Message-State: AOAM531OACTjeR9loLc17rizPnMYsCan1NhTfU+Mc7mlbpJqV+Qc17cB sDC6bGEt1N2b7Rb7muIxQNE= X-Google-Smtp-Source: ABdhPJz5YQFne3dqlopytY9Q2+i2Tn62pz8b0WFr2DgcZe4rnbm+JtKjnl8C4fpxxLg33OKcCZPwvg== X-Received: by 2002:a17:90a:5892:: with SMTP id j18mr5454749pji.18.1626197088123; Tue, 13 Jul 2021 10:24:48 -0700 (PDT) Received: from sc2-haas01-esx0118.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id lt14sm18239032pjb.47.2021.07.13.10.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 10:24:47 -0700 (PDT) From: Nadav Amit X-Google-Original-From: Nadav Amit To: Joerg Roedel Subject: [PATCH v5 0/7] iommu/amd: Enable page-selective flushes Date: Tue, 13 Jul 2021 02:41:44 -0700 Message-Id: <20210713094151.652597-1-namit@vmware.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: Robin Murphy , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Nadav Amit , Jiajun Cao , Will Deacon X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" From: Nadav Amit The previous patch, commit 268aa4548277 ("iommu/amd: Page-specific invalidations for more than one page") was supposed to enable page-selective IOTLB flushes on AMD. Besides the bug that was already fixed by commit a017c567915f ("iommu/amd: Fix wrong parentheses on page-specific invalidations") there are several remaining matters to enable and benefit from page-selective IOTLB flushes on AMD: 1. Enable selective flushes on unmap (patch 1) 2. Avoid using flush-queue on vIOMMUs (patch 2) 3. Relaxed flushes when gathering, excluding vIOMMUs (patches 3-5) 4. Syncing once on scatter-gather map operations (patch 6) 5. Breaking flushes to naturally aligned ranges on vIOMMU (patch 7) The main difference in this version is that the logic that flushes vIOMMU was improved based on Robin's feedback. Batching decisions are not based on alignment anymore, but instead the flushing range is broken into naturally aligned regions on sync. Doing so allows us to flush only the entries that we modified with the minimal number of flushes. Robin, others: your feedback would be highly appreciated to get these patches merge. Cc: Joerg Roedel Cc: Will Deacon Cc: Jiajun Cao Cc: Robin Murphy Cc: Lu Baolu Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org --- v4->v5: * Rebase on v5.14-rc1 * Change pr_warn() to pr_info() [John Garry] v3->v4: * Breaking flushes to naturally aligned ranges on vIOMMU [Robin] * Removing unnecessary stubs; fixing comment [Robin] * Removing unused variable [Yong] * Changing pr_warn_once() to pr_warn() [Robin] * Improving commit log [Will] v2->v3: * Rebase on v5.13-rc5 * Refactoring (patches 4-5) [Robin] * Rework flush logic (patch 5): more relaxed on native * Syncing once on scatter-gather operations (patch 6) v1->v2: * Rebase on v5.13-rc3 Nadav Amit (6): iommu/amd: Selective flush on unmap iommu/amd: Do not use flush-queue when NpCache is on iommu: Factor iommu_iotlb_gather_is_disjoint() out iommu/amd: Tailored gather logic for AMD iommu/amd: Sync once for scatter-gather operations iommu/amd: Use only natural aligned flushes in a VM Robin Murphy (1): iommu: Improve iommu_iotlb_gather helpers drivers/iommu/amd/init.c | 7 ++- drivers/iommu/amd/iommu.c | 96 +++++++++++++++++++++++++++++++++++---- drivers/iommu/mtk_iommu.c | 6 +-- include/linux/iommu.h | 72 +++++++++++++++++++++++------ 4 files changed, 153 insertions(+), 28 deletions(-) -- 2.25.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu