Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6080372imu; Mon, 21 Jan 2019 02:53:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN6jkBTYCWfSSVbu6/34eP09XK0W1KUJsbTZSDKpWJOGvO8hptzVu7BSp9vQY6i1wY1t+rUk X-Received: by 2002:a62:13c3:: with SMTP id 64mr29318829pft.93.1548067992273; Mon, 21 Jan 2019 02:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548067992; cv=none; d=google.com; s=arc-20160816; b=QA3my6abUE3XQhn1vihmC72A6tAd+aU66AyiQbkX2HA3ayAzqC+DmGpbNSMoJv3ijk +CBv99yN8N9JPGH8G0malhRn6AolXcZt8eYBXKMKxeTZ30n1fideHAgpMNLJFWXJZUnW KIvPMxxAY8jegsY8fUYNhWokn8E1A+up455i8MBH8mUs8fhvtjHqusg0Vy5Ui61LlS9l M+9UgRX7qalGgG0sCFTgK5W9EE4kpJthWrGUmx5Q2ZTQekJHQRfXhGUCBOR+6nbCZUc2 iGz+Qq7KERj5jGW4/Ov5gvhMDhe95C4nxGOnTeCL9kXXQN6+SCpCqK6oDW62wjkq2JIN BEVA== 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=kZG6s3eS8O+Mar/3L/gvujTkcPoy9mBP6SvWrZ1AAL0=; b=Eew/uq9w7mW2glwX3RUIExMOGjzfUkMUlUFL+9sKj/gtuJwB1LfH159RRLFZ4gCta+ Sn5XbJV3ZeQeRhuQS8Our4hadvjtMxH8WH27tpRoe7+DhHNNV5A1tRVzH6R8miraniYZ +CMP7H9Ek85UX6Zt5lSjg/AzEzqdwDWpEsy1idUJUe84mdOqXeta87M5T0rQW5Nc0UoF HWxKKVxhFNb9RS+L8dhOFCeAQ3NrnrYNQVhq2afMpOCnlXjLh2WKdElVbNgH81UhRQBF 2TzEC94BUE3DbbBFBdmQiB0E2f2S6eRqO67H6+F51WChH2h1Xe+GPyBKaTP/3kXb8n40 APpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W74LD6fa; 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 k15si11951148pgi.99.2019.01.21.02.52.56; Mon, 21 Jan 2019 02:53:12 -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=W74LD6fa; 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 S1727544AbfAUKvF (ORCPT + 99 others); Mon, 21 Jan 2019 05:51:05 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:35093 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfAUKvF (ORCPT ); Mon, 21 Jan 2019 05:51:05 -0500 Received: by mail-it1-f195.google.com with SMTP id p197so14521592itp.0 for ; Mon, 21 Jan 2019 02:51:04 -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=kZG6s3eS8O+Mar/3L/gvujTkcPoy9mBP6SvWrZ1AAL0=; b=W74LD6faC9UTZ4Cci0rtns3bNle+1yA0bGh6FjsWHbGWci2K3pngKAuBKOil0nZl9u dMuoXpjCxhXJ9H8AnlnSEHcYKz2+W2tibHMM2VLs2K1PNdmISh6Wp277/DGnkkpqWfZm vzAVqEf8LsS0EwA/ev0IUYWg/3KgTAHlGXjII= 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=kZG6s3eS8O+Mar/3L/gvujTkcPoy9mBP6SvWrZ1AAL0=; b=F4OUtR93Yi/KWx19C6EjPGM4r8ntDj64SCFPclLY2jANGGnvvm3U8I9esWpznJuWHu ba1oOD+lAdrP95WVI0HPbcAeeMI0MKi+IABoKSvwwwg1pVdgSID5uCOAikUKenZoJ4sd l59UreK8ZNiD8NvqIj8T838F271ON6SeNxAPNf3ryAIQVF2c+BnWH90VphaUmjxinpeo WAFIJKsNYMHIeeyz5iY4p3SF+BryhwEFkJPWdkJHSxb1CI6Y9QPyEyNTyYorcSxMZGxg 6YaVpwYIgteh55gbXXwDI27dOtlnU116xdZavK1AFbJl0KKQFLvbmJgV0kTMWbQjiNb4 b1XQ== X-Gm-Message-State: AJcUukdwRDBlmsW+VabbX6/2Eux3Dt3Er9Ko47o6c48GRbBI/Sp02UHD BC4aWwpKZI9xK1L/sVsVw2TBHnrUYLJCqegOztFQdg== X-Received: by 2002:a24:edc4:: with SMTP id r187mr18369678ith.158.1548067864287; Mon, 21 Jan 2019 02:51:04 -0800 (PST) MIME-Version: 1.0 References: <20190121055335.15430-1-vivek.gautam@codeaurora.org> In-Reply-To: From: Ard Biesheuvel Date: Mon, 21 Jan 2019 11:50:53 +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 , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , pdaly@codeaurora.org, linux-arm-msm , Linux Kernel Mailing List , Tomasz Figa , Jordan Crouse , 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 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?