From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler Date: Tue, 24 Sep 2013 10:20:47 +0200 Message-ID: <20130924082047.GB3715@gmail.com> References: <52323734.4070908@canonical.com> <5232B44C.9010408@vmware.com> <5232BBE1.5030509@canonical.com> <5232C2BB.9070303@vmware.com> <20130913082933.GH31370@twins.programming.kicks-ass.net> <20130913090000.GJ31370@twins.programming.kicks-ass.net> <52405F3E.4000609@canonical.com> <52413DA9.4050000@vmware.com> <5241409B.6010102@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <5241409B.6010102@canonical.com> Sender: linux-kernel-owner@vger.kernel.org To: Maarten Lankhorst Cc: Thomas Hellstrom , Peter Zijlstra , Daniel Vetter , Dave Airlie , intel-gfx , dri-devel , Linux Kernel Mailing List , Thomas Gleixner , Ben Skeggs , Alex Deucher List-Id: dri-devel@lists.freedesktop.org * Maarten Lankhorst wrote: > > I think the Nouveau guys need to comment further on this, but > > returning -EFAULT might break existing user-space, and that's not > > allowed, but IIRC the return value of "presumed" is only a hint, and > > if it's incorrect will only trigger future command stream patching. > > > > Otherwise reviewing mostly the TTM stuff. FWIW, from wat I can tell > > the vmwgfx driver doesn't need any fixups. > > Well because we read the list of buffer objects the presumed offsets are > at least read-mapped. Although I guess in the worst case the mapping > might disappear before the syscall copies back the data. So if -EFAULT > happens here then userspace messed up in some way, either by forgetting > to map the offsets read-write, which cannot happen with libdrm or > free'ing the bo list before the syscall returns, which would probably > result in libdrm crashing shortly afterwards anyway. > > So I don't know whether to swallow that -EFAULT or not, which is what I > asked. In such a case returning -EFAULT is very strongly preferred. If there's a user-space bug, such as a context life time race between graphics context creation/destruction and user threads making use of the graphics context, then getting the -EFAULT would be very helpful to user-space debugging as well. Thanks, Ingo