From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EBBDC433FF for ; Thu, 8 Aug 2019 10:00:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7B8021881 for ; Thu, 8 Aug 2019 10:00:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OyBdZRsm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7B8021881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aqEw7u4ofmw8RlVnLu5IHtGs71ETV7e2zu0GqTGjznA=; b=OyBdZRsmaGx3t+ Iilr3IdhecCRJ9TQHIzAtJFc36GsQsYAuZjQbFPYHsxZgByqE+hauQcJlX05bP9x4KAHRUg7Y18vh lAluGG9QFyDlOb+oj7NrUym3ZuloofoIsNJdO5pu33Tyzr/CMDM+JuuenNg9jjXVchUe0D3h/yUe9 IJzkJfIAt32vRs52WLHwiicOmat0KpiGBn6Jk15jIKLc6xvkieqjBLCfmEvszW6xKGOLYgUv9pDJS d1yjYK5zAKjXQ58DU1xfHPyM8nvuWj+Nk53d/Y5bIV36Q7ZMgsH9viPFzUO8CkG6L84dit1WSGDOO qWBMmfAtmmVvWg+TM87Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvfDs-0007wq-8i; Thu, 08 Aug 2019 10:00:40 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvfDo-0007wK-SQ for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2019 10:00:38 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_030037_075273_8A029B0B X-CRM114-Status: GOOD ( 22.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , Maxime Ripard , Catalin Marinas , Maarten Lankhorst , LKML , dri-devel , David Airlie , Rob Clark , linux-arm-kernel@lists.infradead.org, Daniel Vetter , Greg Kroah-Hartman , Thomas Gleixner , Will Deacon , Christoph Hellwig , Allison Randal Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel