Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6675427ybh; Thu, 8 Aug 2019 03:58:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyR2L/E+2IK86Jmc8F3PsC3tG8MTEiVwUejvIGl/pMGMBba7YDSVuDnQlrXPkncrpEmM9xI X-Received: by 2002:aa7:9834:: with SMTP id q20mr15091253pfl.196.1565261929190; Thu, 08 Aug 2019 03:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565261929; cv=none; d=google.com; s=arc-20160816; b=r5qP83YM1KWrnPSLk2v+cdIPzSL45sYvzOJX5eyltmUrTjRJyIcdYjfs9TvEepXhcH bIbSUX3vXe2zdzR+arbeZmr7ZgM4MzAtu4m5gmHpQId3iJUttjNo3YYQLgKdlYPCPVbh sWX5DsU86av8nbvs6Ve8iZew6+t36lZdePylpdFJ4IwCfpDHgexXDm+bbOmzayxCctiq y5r+H2+gjbRRsrc8FFcxdJLuTYxxv4dEdIvs0LDJRGDSog8f2Rz2IQM6YJ/UG5EO3YEM 04a+QMDntQHxOWthWAGVzYtT6hcqHSFNQQnSHiZev/ra3s05tTIUfiSV6dIZLhE/iGYz R+Mw== 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:dkim-signature; bh=D2EMrqm8iDy5Nqn49tL6WdXY1MyIwPFXNYfWQgp6DaY=; b=0vlDsXHpcTeOyn57fmjCQFoNzboX86pfHz9hpbHmg1Gx6Bl+MyM8TUQaVY/MTErwDD TuIgrIJa69rkfYYP/HENRwkLKYS4DkLJB93zsZsjjxj/lno64P+tGpzj9qiQ8wGjeV5h ib5e2sByQS1WavbfekbEqqhVoB8CiVGQfAOiJyzJoqxUj9mo6oFhcxYKI6axADSYRsRM FIBkLfeDbSLFpo+EWPLgzVRfAsOXp1v5XXEDRKDXqpk7m0pKh7TRlE2Jmghx9Nw7Fk/p ueXtrUlBbYLH3++jCl6OKKZYy748K/ncR8CI+kLSafYUvFX3eJUhznrpnX7nZstXQHmn NuOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i0cpkV6y; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si51282105pff.46.2019.08.08.03.58.33; Thu, 08 Aug 2019 03:58:49 -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; dkim=pass header.i=@kernel.org header.s=default header.b=i0cpkV6y; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731460AbfHHKdE (ORCPT + 99 others); Thu, 8 Aug 2019 06:33:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfHHKdE (ORCPT ); Thu, 8 Aug 2019 06:33:04 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DB142173E; Thu, 8 Aug 2019 10:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565260383; bh=FQ6+FsASdUdEGiZDnohQHtyEdIqjQg4sf53ogeYronU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i0cpkV6yxp9rMymSHvxjKf0jsHk3h+WHG95kn4WWQPwZZAhvUGd7+TO3nZ23eheGH A1Bc1VB+y4plVRkxLuTagWC3CwLI59ZuuyCt8w7z6tlpdftzRnlxyD9l5Azt8tFrEI fWGfWW3kB9p8pDXuOdw6q+Z0Q4YvrTZy9VrwpRPc= Date: Thu, 8 Aug 2019 11:32:57 +0100 From: Will Deacon To: Mark Rutland Cc: Christoph Hellwig , Rob Clark , Rob Clark , dri-devel , Catalin Marinas , 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: <20190808103257.4tqpip7ty4gf7eqf@willie-the-truck> 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> <20190808102053.GA46901@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190808102053.GA46901@lakrids.cambridge.arm.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 11:20:53AM +0100, Mark Rutland wrote: > 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. FWIW, we made rodata_full the default a couple of releases ago, so if solving the cacheable alias for non-cacheable DMA buffers requires this to be present, then we could probably just refuse to probe non-coherent DMA-capable devices on systems where rodata_full has been disabled. Will