Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755195Ab2K1Nd0 (ORCPT ); Wed, 28 Nov 2012 08:33:26 -0500 Received: from ns.km20343-01.keymachine.de ([84.19.182.79]:42008 "EHLO km20343-01.keymachine.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755143Ab2K1NdY (ORCPT ); Wed, 28 Nov 2012 08:33:24 -0500 Message-ID: <1354109602.1479.66.camel@tellur> Subject: Re: [RFC v2 8/8] drm: tegra: Add gr2d device From: Lucas Stach To: Terje =?ISO-8859-1?Q?Bergstr=F6m?= Cc: Dave Airlie , Thierry Reding , "linux-tegra@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Arto Merilainen Date: Wed, 28 Nov 2012 14:33:22 +0100 In-Reply-To: <50B60EFF.1050703@nvidia.com> References: <1353935954-13763-1-git-send-email-tbergstrom@nvidia.com> <1353935954-13763-9-git-send-email-tbergstrom@nvidia.com> <50B46336.8030605@nvidia.com> <50B476E1.4070403@nvidia.com> <50B47DA8.60609@nvidia.com> <1354011776.1479.31.camel@tellur> <20121127103739.GA3329@avionic-0098.adnet.avionic-design.de> <50B4A483.8030305@nvidia.com> <50B60EFF.1050703@nvidia.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 (3.4.4-2.fc17) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 35 Am Mittwoch, den 28.11.2012, 15:17 +0200 schrieb Terje Bergström: > On 28.11.2012 01:00, Dave Airlie wrote: > > We generally aim for the first, to stop the gpu from reading/writing > > any memory it hasn't been granted access to, > > the second is nice to have though, but really requires a GPU with VM > > to implement properly. > > I wonder if we should aim at root only access on Tegra20, and force > IOMMU on Tegra30 and fix the remaining issues we have with IOMMU. The > firewall turns out to be more complicated than I wished. > > Biggest problem is that we aim at zero-copy for everything possible, > including command streams. Kernel gets a handle to a command stream, but > the command stream is allocated by the user space process. So the user > space can tamper with the stream once it's been written to the host1x 2D > channel. > So this is obviously wrong. Userspace has to allocate a pushbuffer from the kernel just as every other buffer, then map it into it's own address space to push in commands. At submit time of the pushbuf kernel has to make sure that userspace is not able to access the memory any more, i.e. kernel shoots down the vma or pagetable of the vma. To keep overhead low and not do any blocking you can just keep some pushbufs around for one channel and switch over the pagetable entries to the next free buffer, just make sure that userspace is never able to tamper with a buffer as long as the gpu isn't done with it. Regards, Lucas -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/