From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: Breakage in "track dev_mapping in more robust and flexible way" Date: Thu, 25 Oct 2012 10:41:38 -0400 Message-ID: <20121025144136.GB2062@gmail.com> References: <50894671.2070803@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 97F679EF5A for ; Thu, 25 Oct 2012 07:44:46 -0700 (PDT) Received: by mail-vc0-f177.google.com with SMTP id p16so1944140vcq.36 for ; Thu, 25 Oct 2012 07:44:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <50894671.2070803@vmware.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Thomas Hellstrom Cc: Dave Airlie , linux-graphics-maintainer@vmware.com, "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Thu, Oct 25, 2012 at 04:02:25PM +0200, Thomas Hellstrom wrote: > Hi, > > This commit > > From 949c4a34afacfe800fc442afac117aba15284962 Mon Sep 17 00:00:00 2001 > From: Ilija Hadzic > Date: Tue, 15 May 2012 16:40:10 -0400 > Subject: [PATCH] drm: track dev_mapping in more robust and flexible way > > Setting dev_mapping (pointer to the address_space structure > used for memory mappings) to the address_space of the first > opener's inode and then failing if other openers come in > through a different inode has a few restrictions that are > eliminated by this patch. > > If we already have valid dev_mapping and we spot an opener > with different i_node, we force its i_mapping pointer to the > already established address_space structure (first opener's > inode). This will make all mappings from drm device hang off > the same address_space object. > ... > > Breaks drivers using TTM, since when the X server calls into the > driver open, drm's dev_mapping has not > yet been setup. The setup needs to be moved before the driver's open > hook is called. > > Typically, if a TTM-aware driver is provoked by the Xorg server to > move a buffer from system to VRAM or AGP, > before any other drm client is started, The user-space page table > entries are not killed before the move, and left pointing > into freed pages, causing system crashes and / or user-space access > to arbitrary memory. Doesn't handle move invalidate the drm file mapping before scheduling the move ? Cheers, Jerome