From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tormod Volden Subject: Re: [PATCH v2] drm: Compare only lower 32 bits of framebuffer map offsets Date: Wed, 1 Jun 2011 00:04:40 +0200 Message-ID: References: <1306711744.21613.14.camel@clockmaker-el6> <1306784743-2430-1-git-send-email-lists.tormod@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bw0-f49.google.com (mail-bw0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 887319E7CC for ; Tue, 31 May 2011 15:04:41 -0700 (PDT) Received: by bwz1 with SMTP id 1so5251998bwz.36 for ; Tue, 31 May 2011 15:04:40 -0700 (PDT) In-Reply-To: <1306784743-2430-1-git-send-email-lists.tormod@gmail.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: dri-devel@lists.freedesktop.org Cc: Dave Airlie List-Id: dri-devel@lists.freedesktop.org On Mon, May 30, 2011 at 9:45 PM, Tormod Volden wrote: > (*) It actually checks if _DRM_CONTAINS_LOCK is the /only/ flag set. I > suppose this is intentional. My v2 patch does not change anything in the > case of _DRM_SHM: If it contains a lock, it returns a match without > comparing offsets. If no lock, it compares the full offsets. Is this > because the only _DRM_SHM used by userspace is the one with a lock, so > there is never a need to check a userspace-provided offset, or are those > always within 32 bit so a full check is ok? After googling up an old "DRM map design" thread from 2005 (http://thread.gmane.org/gmane.comp.video.dri.devel/19545/focus=19689), and http://dri.freedesktop.org/wiki/DrmMapHandling I think I can answer this to some extent myself: For _DRM_SHM it is not an offset that is passed from/to userspace, but a handle, which I guess is kept within 32 bit. Although this is not fully clear to me after browsing through drm_addmap_core(), where the offset or handle is the result of vmalloc_user(). Tormod