Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6673407ybh; Thu, 8 Aug 2019 03:56:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjTQ6anHwarSk5ht1RbO0qHcK2sHzq4+uCRYeF4WPjxWMtisG43O9UEE6PxgGZYu4NgaOT X-Received: by 2002:a17:90b:8cd:: with SMTP id ds13mr3257240pjb.141.1565261798065; Thu, 08 Aug 2019 03:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565261798; cv=none; d=google.com; s=arc-20160816; b=Rkcfe0HwuBIbfbEVa0cL5NuHocoanuXmFjdAJqAZS/+hAzVsnnlCGgkKd32lo26kDd DDK5PuqgUMWpAvUxIqJjqpe02YDBmyZVQvEaKq82Bko0DFJKEr2x+wWdtF+lu47BvYm6 hpb8wLPQTI90/OVLE5bWrJWVmoTW4vrVrhzWP5R+6ao5iKgA9ERIgwAOz2ZddH3snH4y yICCDzjFZ9OeEAcvI3igcxNSlznWlhq/JCtf06zf3SK+jx0TgGoA4r1581ALSn0m7kD/ ALloqdC6I8efB29DuTyMDmR2PB2aGZv0utsDcBW7Dt86fmOn0G6kl+WpAMB4oJ17ynMv 1EEQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9QFVWTgpecdSnWjJzdFehQNOgqClDHQtjtjWUDbgZwg=; b=RvmulDpPiHbHRySfD2HU5BqG0bzSsAmWENHNcYf0gWMdbJbnDsvyCxQfTgStspDv0I f+l1q/zovREjHnUT3XT93pquzWri5/nNjID2Z/dhPbfapxKJ70d8iPwJJtQqmMTdmkZD l+mp3S/4I3Xm9A3mmjUg1fwEJG00DSUDMjZ3A0mfEwR16huuZJ0giKLhTh6oBTnYntvb /BQWLELn5FVAQKYO7vQCM1oHBeS560yBQKIVrt/UkjApZc1SPVCDSMxmBnpHOliT7Ehr loHtUn0ktslw5HSIyyhvmA/uGVJOuJ1cTLed2qq39ImnMwsbkyVei/m1DHL4HeoUaf0Q 17zQ== 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 u2si51859650pgm.242.2019.08.08.03.56.22; Thu, 08 Aug 2019 03:56:38 -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 S1732199AbfHHKAh (ORCPT + 99 others); Thu, 8 Aug 2019 06:00:37 -0400 Received: from verein.lst.de ([213.95.11.211]:45231 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfHHKAg (ORCPT ); Thu, 8 Aug 2019 06:00:36 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DE187227A81; Thu, 8 Aug 2019 12:00:31 +0200 (CEST) Date: Thu, 8 Aug 2019 12:00:31 +0200 From: Christoph Hellwig To: Rob Clark Cc: Christoph Hellwig , 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: <20190808100031.GA32658@lst.de> References: <20190805211451.20176-1-robdclark@gmail.com> <20190806084821.GA17129@lst.de> <20190806155044.GC25050@lst.de> <20190807062545.GF6627@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 07, 2019 at 09:09:53AM -0700, Rob Clark wrote: > > > (Eventually I'd like to support pages passed in from userspace.. but > > > that is down the road.) > > > > Eww. Please talk to the iommu list before starting on that. > > This is more of a long term goal, we can't do it until we have > per-context/process pagetables, ofc. > > Getting a bit off topic, but I'm curious about what problems you are > concerned about. Userspace can shoot it's own foot, but if it is not > sharing GPU pagetables with other processes, it can't shoot other's > feet. (I'm guessing you are concerned about non-page-aligned > mappings?) Maybe I misunderstood what you mean above, I though you mean messing with page cachability attributes for userspace pages. If what you are looking into is just "standard" SVM I only hope that our APIs for that which currently are a mess are in shape by then, as all users currently have their own crufty and at least slightly buggy versions of that. But at least it is an issue that is being worked on. > > So back to the question, I'd like to understand your use case (and > > maybe hear from the other drm folks if that is common): > > > > - you allocate pages from shmem (why shmem, btw? if this is done by > > other drm drivers how do they guarantee addressability without an > > iommu?) > > shmem for swappable pages. I don't unpin and let things get swapped > out yet, but I'm told it starts to become important when you have 50 > browser tabs open ;-) Yes, but at that point the swapping can use the kernel linear mapping and we are going into aliasing problems that can disturb the cache. So as-is this is going to problematic without new hooks into shmemfs. > > - then the memory is either mapped to userspace or vmapped (or even > > both, althrough the lack of aliasing you mentioned would speak > > against it) as writecombine (aka arm v6+ normal uncached). Does > > the mapping live on until the memory is freed? > > (side note, *most* of the drm/msm supported devices are armv8, the > exceptions are 8060 and 8064 which are armv7.. I don't think drm/msm > will ever have to deal w/ armv6) Well, the point was that starting from v6 the kernels dma uncached really is write combine. So that applied to v7 and v8 as well.