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 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel