Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6635071ybh; Thu, 8 Aug 2019 03:22:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1FUOKDKG29p5Xc4S90YU9BO6g9phUOxUTEBD9JcurkDcezeaKgFtAxAUguzuHXiqVbL1P X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr13097634pll.321.1565259742411; Thu, 08 Aug 2019 03:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565259742; cv=none; d=google.com; s=arc-20160816; b=eMwIv5Yu9PoVYj2ipAJg5DI1+OIYZLh0Lg1bNNEA9yuyHAoKZphVUx/IECS55LnHD+ +wZhMIucsUmG3hsqyOvpGEY+xON4RhBn6UjNAAavCPwSD6Zxp3ytcCFMcWw1vUw/XtPF Z/xBCA0KQ26l4VUX//j3elBB0v8dmJho2rEJWCAXu2nQLvcRzIEJ/BYHtKNnDNpEWQI2 01FRGceD/Oj3VLBmjMpbgzfgQjUka1yv0LevhtUZKf+Hn3nZrSa73vSkQNDCJtVLQ2DZ QPEMLdNdvs/YtGFa2ncptWJSsuTHTEP8T0Jib7Po+A+TNoqy85I2KiqkPN2FGBD3orKP D9uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jQ7eOCLV5bGeFlzuwlDRWV84DCbrLLu/WwHPpK5EYt8=; b=wA+SzR/rlCx1eo2aImmbVQmh7zkrLtuxnpCS865VNpmvYk2CGjGieVj20BZZvTWzKK DzWSt9fQj2fHU6fWKw/vWFXUOwi3fg000u5mfCc/0PFoSAYTV+a9Efjpp4KG2eZqGFvq XAPaTngJAh/bn8yMVaMWV6U7Ki13KIIPbAsPtTq8vYViKNSmw3wM44jJ3/PvWwv9jeLz JoF6Lw4ONMfOwV5jpHy4yy3TTdBaoabgAoxxWXLdnfpZEOP89ZC2j7lUBu6sreaIav8P xcLycIPLF7ElfO73pEF9SpDnL1+Qt83rEgiupYPaSKyYJ9LaGyaqMUvqOU4VHRtpN+L4 3zvQ== 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 i1si56553949pfr.203.2019.08.08.03.22.06; Thu, 08 Aug 2019 03:22:22 -0700 (PDT) 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 S2389902AbfHHKVB (ORCPT + 99 others); Thu, 8 Aug 2019 06:21:01 -0400 Received: from foss.arm.com ([217.140.110.172]:59406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389773AbfHHKVB (ORCPT ); Thu, 8 Aug 2019 06:21:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EF2428; Thu, 8 Aug 2019 03:21:00 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37F123F694; Thu, 8 Aug 2019 03:20:58 -0700 (PDT) Date: Thu, 8 Aug 2019 11:20:53 +0100 From: Mark Rutland To: Christoph Hellwig Cc: Rob Clark , Rob Clark , dri-devel , Catalin Marinas , Will Deacon , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Allison Randal , Greg Kroah-Hartman , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, LKML Subject: Re: [PATCH 1/2] drm: add cache support for arm64 Message-ID: <20190808102053.GA46901@lakrids.cambridge.arm.com> References: <20190805211451.20176-1-robdclark@gmail.com> <20190806084821.GA17129@lst.de> <20190806143457.GF475@lakrids.cambridge.arm.com> <20190807123807.GD54191@lakrids.cambridge.arm.com> <20190807164958.GA44765@lakrids.cambridge.arm.com> <20190808075827.GD30308@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190808075827.GD30308@lst.de> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 08, 2019 at 09:58:27AM +0200, Christoph Hellwig wrote: > On Wed, Aug 07, 2019 at 05:49:59PM +0100, Mark Rutland wrote: > > For arm64, we can tear down portions of the linear map, but that has to > > be done explicitly, and this is only possible when using rodata_full. If > > not using rodata_full, it is not possible to dynamically tear down the > > cacheable alias. > > Interesting. For this or next merge window I plan to add support to the > generic DMA code to remap pages as uncachable in place based on the > openrisc code. AŃ• far as I can tell the requirement for that is > basically just that the kernel direct mapping doesn't use PMD or bigger > mapping so that it supports changing protection bits on a per-PTE basis. > Is that the case with arm64 + rodata_full? Yes, with the added case that on arm64 we can also have contiguous entries at the PTE level, which we also have to disable. Our kernel page table creation code does that for rodata_full or DEBUG_PAGEALLOC. See arch/arm64/mmu.c, in map_mem(), where we pass NO_{BLOCK,CONT}_MAPPINGS down to our pagetable creation code. Thanks, Mark.