Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5921329imu; Sun, 20 Jan 2019 23:28:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Qg4lmMAPfPhrjRugERzVfpKGCKa90y0CeBemdh57karSUNhrFQUXAdWyESYzfPz69hW9O X-Received: by 2002:a65:6645:: with SMTP id z5mr27311820pgv.351.1548055733860; Sun, 20 Jan 2019 23:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548055733; cv=none; d=google.com; s=arc-20160816; b=eZfILmyYXO7nZBQwee8ZC+IX05M1CE5U9oHa/ZI3muds2PhP/p+ZGj0QTmY1iLQiJW RLAmRhxO9mr0AKmx7wNNUiJm79FYypHZlR7P5v0hA0jwzRrQ1KY6DjizYuUzoodQ9/18 yISkz5MUhWVt5Nn5nA+a5Jv5enCM7S7i/2sFQQoaA8cWkS8Z5BekK0xDy/2lMCMjkQnK xXE+31I2xbg6qNMKRv+RSzTxLPuRgvo1ckeUR8YuPpIpPV3kleP2rs0MEjLxLyfVdkbJ DlF2sGTr/mT3A2TxlLC9da31rXn5Hrcc1UH3qLSpkg0LekOeeAQs7fx8JVdDQhuzxwsn oHog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ajYMFC2reghOmzcthv0vHrytNzOAbc6ti5YAojE+CZM=; b=UrzEXpiMC9iEZEIrFLoVIXpLf717rha55yv5mD1waVepXw7chTgXLQvjf+4vQ9TEsZ 8fBGEP193+M7QXz8ZmYOZzj2iUgqDy531wlIC9PxI023qdpU4dESmnDl8vuyey/AOSo+ 9YtZbhT6smcylKgIaoTAGsgYkzdmBH6JVhLx+oTzvgG0dykQMi02Fao5i3dh2ZySlERn nbgFJzV/OO6+OZlYYGCKQ/7uui1p/7nVpAjMBB7m+OjAxcEyKZ3YHs3QFSLK4agvp0tk nxhFjBLPw5ZcQvJLrdV+9MfnhXXrXpFBGCK9gJgir6GoJP5YFQOKYCdKWDrPMBSg0Zrq dIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U44LmsnC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33si11957757pld.121.2019.01.20.23.28.38; Sun, 20 Jan 2019 23:28:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U44LmsnC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbfAUH0Q (ORCPT + 99 others); Mon, 21 Jan 2019 02:26:16 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:53330 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbfAUH0P (ORCPT ); Mon, 21 Jan 2019 02:26:15 -0500 Received: by mail-it1-f193.google.com with SMTP id g85so15172369ita.3 for ; Sun, 20 Jan 2019 23:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ajYMFC2reghOmzcthv0vHrytNzOAbc6ti5YAojE+CZM=; b=U44LmsnC/9sS1fBgJPAdNPCuCUDcsd3tgK4roX5+ENPyA8ZkQf02E40wJJWNxe4xoM NkDPOIPlBKjLgWJc41d/3Grx7wkY+qpMgQEC5cjXn0EA3bYE06pGlYLLRHwkWlK8E1P2 iPnD+AU0lgplUJtxXnQKuD4tWXPPAcLuXVqeQ= 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=ajYMFC2reghOmzcthv0vHrytNzOAbc6ti5YAojE+CZM=; b=Pq3zu4jOQKPQKqx1ZGsNZOwmTpIhjOY62XUx0Xcgch0b8cgxpDWVOY+/37y1HdYBO1 aN4Q8fxdR+NI86TvzR3EEfgPVUU07ib6k+cIHGxpUiV6hk1+1BEGr21lHtCOpTVWoDHh sB7irltr82UICcijfvRkioFyIxxT87kH2pkAs6GfhKOYYtHEYANrGFP+oF56Z9hno8Rl J88Xc9sxtCmoNQCuvhGawje4aAL47S/zYPE2rTDAChmXBj7fzua5R6Gur2Z9xcL0DI04 XBgH+5NdZvPY0qJDNKE+eHbt/XC2z5PV0vpp4TDM1/Ho9aYk4/ry6JUTUhIVOfrp8FMX yL7w== X-Gm-Message-State: AJcUukeg5oKu4pkA2ePIfD99ZeYKq/cQEQ9QgdTBTOwGWip40c9gkwwa Adh2ULE1sUdlYInXVoBQUytEAwu82nf3wrYDmLoNZA== X-Received: by 2002:a02:4c9:: with SMTP id 192mr16576843jab.2.1548055574176; Sun, 20 Jan 2019 23:26:14 -0800 (PST) MIME-Version: 1.0 References: <20190121055335.15430-1-vivek.gautam@codeaurora.org> In-Reply-To: <20190121055335.15430-1-vivek.gautam@codeaurora.org> From: Ard Biesheuvel Date: Mon, 21 Jan 2019 08:26:02 +0100 Message-ID: Subject: Re: [PATCH 0/3] iommu/arm-smmu: Add support to use Last level cache To: Vivek Gautam Cc: Will Deacon , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org, pdaly@codeaurora.org, linux-arm-msm@vger.kernel.org, Linux Kernel Mailing List , tfiga@chromium.org, jcrouse@codeaurora.org, pratikp@codeaurora.org, linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jan 2019 at 06:54, Vivek Gautam wrote: > > Qualcomm SoCs have an additional level of cache called as > System cache, aka. Last level cache (LLC). This cache sits right > before the DDR, and is tightly coupled with the memory controller. > The clients using this cache request their slices from this > system cache, make it active, and can then start using it. > For these clients with smmu, to start using the system cache for > buffers and, related page tables [1], memory attributes need to be > set accordingly. This series add the required support. > Does this actually improve performance on reads from a device? The non-cache coherent DMA routines perform an unconditional D-cache invalidate by VA to the PoC before reading from the buffers filled by the device, and I would expect the PoC to be defined as lying beyond the LLC to still guarantee the architected behavior. > This change is a realisation of following changes from downstream msm-4.9: > iommu: io-pgtable-arm: Support DOMAIN_ATTRIBUTE_USE_UPSTREAM_HINT[2] > iommu: io-pgtable-arm: Implement IOMMU_USE_UPSTREAM_HINT[3] > > Changes since v2: > - Split the patches into io-pgtable-arm driver and arm-smmu driver. > - Converted smmu domain attributes to a bitmap, so multiple attributes > can be managed easily. > - With addition of non-coherent page table mapping support [4], this > patch series now aligns with the understanding of upgrading the > non-coherent devices to use some level of outer cache. > - Updated the macros and comments to reflect the use of QCOM_SYS_CACHE. > - QCOM_SYS_CACHE can still be used at stage 2, so that doens't depend on > stage-1 mapping. > - Added change to disable the attribute from arm_smmu_domain_set_attr() > when needed. > - Removed the page protection controls for QCOM_SYS_CACHE at the DMA API > level. > > Goes on top of the non-coherent page tables support patch series [4] > > [1] https://patchwork.kernel.org/patch/10302791/ > [2] https://source.codeaurora.org/quic/la/kernel/msm-4.9/commit/?h=msm-4.9&id=bf762276796e79ca90014992f4d9da5593fa7d51 > [3] https://source.codeaurora.org/quic/la/kernel/msm-4.9/commit/?h=msm-4.9&id=d4c72c413ea27c43f60825193d4de9cb8ffd9602 > [4] https://lore.kernel.org/patchwork/cover/1032938/ > > Vivek Gautam (3): > iommu/arm-smmu: Move to bitmap for arm_smmu_domain atrributes > iommu/io-pgtable-arm: Add support to use system cache > iommu/arm-smmu: Add support to use system cache > > drivers/iommu/arm-smmu.c | 28 ++++++++++++++++++++++++---- > drivers/iommu/io-pgtable-arm.c | 15 +++++++++++++-- > drivers/iommu/io-pgtable.h | 4 ++++ > include/linux/iommu.h | 2 ++ > 4 files changed, 43 insertions(+), 6 deletions(-) > > -- > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member > of Code Aurora Forum, hosted by The Linux Foundation > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel