Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6349645imu; Mon, 21 Jan 2019 07:25:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN6QuSenm+sjFIC0nTNZ0zS3JjkSTLk7KJnZcWYw1PgZkE98+EkrHW1pW2U+ge1HU4BGFWRj X-Received: by 2002:a63:ff16:: with SMTP id k22mr28715901pgi.244.1548084327050; Mon, 21 Jan 2019 07:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548084327; cv=none; d=google.com; s=arc-20160816; b=ONXOniTPLie3mddTMI5eKtwTmhtnH9vaGoid+S5/I5VNofGMuOpDGxxK8tdKDCD14s 46OdaDkAx1USnk2k5jEUO6JRUOoEXFJQAQuKu/nnIZie/koHdzlPbgo0vHThyJMvrUGv pEy2CY0dImohoQTtV16CYLFOZ+PEXCdbxEEejl0kCeZiRpdO4PrVluRhMZoJd0CEhdYZ lamKRbUXMnvWi5q7rDDC8Hheuzf19+i4fnR0bYp8/YJ4Dh5s1Zzxcx2Y2oOJlzv3KAre b/nHWe5BF5ZwKSA/rZjnCqfTMsRzJn//cfFLlfqgBAmww2jDDu0PK1H8vErmq7BDcHRV g98A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/I4kJyrQ0yDLsSGu0HbXVcipCLJBsg7KhQByDkoH1eA=; b=sgjCzWr7z2xDXd67Mu5wUIVSdtvbTXou1vy8AY/qhH74cxZVTiAXVHOEhYIstz+B7R 57YqJxnrfwjhuwOOtpxnLWQBlf90v9bru0VVAJLwCNUSs9M7NVGVcyshuCyKRuYeWplh ILd7pRFte7ZCmKtVA7ekYYdYXAXQjG1ONVE59o0VIACo3Av5kNY/F7Vh0fyOHLBfdNfm oSuPnwTh6dFGIALmX+R/sTizuzCCEV4BetZt7ONjzGmRkNw+bFmJwg/bw8tEuB3VDEnI va+2tfi8aKrvUCJM5Z4g1adZOuPMbjtJFOeyU2FbDP+4OcHfItB+YZ5qoZ0YOTsfH2en +knA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m65si12747803pfg.282.2019.01.21.07.25.11; Mon, 21 Jan 2019 07:25:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728970AbfAUNZy (ORCPT + 99 others); Mon, 21 Jan 2019 08:25:54 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33974 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbfAUNZy (ORCPT ); Mon, 21 Jan 2019 08:25:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 563B980D; Mon, 21 Jan 2019 05:25:53 -0800 (PST) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D03E73F614; Mon, 21 Jan 2019 05:25:50 -0800 (PST) Subject: Re: [PATCH 0/3] iommu/arm-smmu: Add support to use Last level cache To: Ard Biesheuvel , Vivek Gautam Cc: Will Deacon , Joerg Roedel , "list@263.net:IOMMU DRIVERS" , Joerg Roedel , iommu@lists.linux-foundation.org, pdaly@codeaurora.org, linux-arm-msm , Linux Kernel Mailing List , Tomasz Figa , Jordan Crouse , pratikp@codeaurora.org, linux-arm-kernel References: <20190121055335.15430-1-vivek.gautam@codeaurora.org> From: Robin Murphy Message-ID: Date: Mon, 21 Jan 2019 13:25:49 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/01/2019 10:50, Ard Biesheuvel wrote: > On Mon, 21 Jan 2019 at 11:17, Vivek Gautam wrote: >> >> Hi, >> >> >> On Mon, Jan 21, 2019 at 12:56 PM Ard Biesheuvel >> wrote: >>> >>> 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. >> >> We have seen performance improvements when running Manhattan >> GFXBench benchmarks. >> > > Ah ok, that makes sense, since in that case, the data flow is mostly > to the device, not from the device. > >> As for the PoC, from my knowledge on sdm845 the system cache, aka >> Last level cache (LLC) lies beyond the point of coherency. >> Non-cache coherent buffers will not be cached to system cache also, and >> no additional software cache maintenance ops are required for system cache. >> Pratik can add more if I am missing something. >> >> To take care of the memory attributes from DMA APIs side, we can add a >> DMA_ATTR definition to take care of any dma non-coherent APIs calls. >> > > So does the device use the correct inner non-cacheable, outer > writeback cacheable attributes if the SMMU is in pass-through? > > We have been looking into another use case where the fact that the > SMMU overrides memory attributes is causing issues (WC mappings used > by the radeon and amdgpu driver). So if the SMMU would honour the > existing attributes, would you still need the SMMU changes? Even if we could force a stage 2 mapping with the weakest pagetable attributes (such that combining would work), there would still need to be a way to set the TCR attributes appropriately if this behaviour is wanted for the SMMU's own table walks as well. Robin.