From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7031C43461 for ; Tue, 15 Sep 2020 11:24:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46B3B20872 for ; Tue, 15 Sep 2020 11:24:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Ab3Cclpc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbgIOLX4 (ORCPT ); Tue, 15 Sep 2020 07:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbgIOLSI (ORCPT ); Tue, 15 Sep 2020 07:18:08 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1FEC061223 for ; Tue, 15 Sep 2020 04:07:30 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id 60so2831975otw.3 for ; Tue, 15 Sep 2020 04:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wAqBxwSqHBPcdUvSTQKCijq+CRd5S/6aTYUwocFvz7g=; b=Ab3CclpcmjliQcUxf05Du8gVcg1tOOkwjfN7S7+mMKqY+QobElboTlKKG/K3TtoDAg jN9ksqtTvV5K0CkYWOyTD6EOOpJPBKcoEScWZBBaDrPlA0EBfsG9cf/MIcMhL1dmKZ7I /Vtos2xPEWUgcsEiyEAAfW1BnOmbyKfP4VBbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wAqBxwSqHBPcdUvSTQKCijq+CRd5S/6aTYUwocFvz7g=; b=O4zdutlYckkHHvEDc7+AOMKwhbMvwlIaGCcp+aBFFW4So3u+P8TPdKmoaomsI1KIMJ lrFupFXpuDqRTGKxEXQUTKFv+NHxb0X1138/Lyj46r6+PRwR2FiaYMOeI9Kk5JHto1Cr DrkAk2re1C8UamxmXgbJjvVI6vn3/4Jprh5pKitxP9sarlH8KRY9wuzBLCYhRwq2iw2V v0Q/EYu3oMz9kNG6PpZRPpJXFzUt7GQLej8NO28gimQd5/3JOi9IYh/X3e6cW4HQW8nP TADJPaKjeIyDhKjQSFi7EG5N87VFgiOxe+bN+dzfOKlDAlz+SK0GoO5GFnPpHtuo34kN YisA== X-Gm-Message-State: AOAM531mKNx6N1DoqTvU7yc93fm+ZJ05MmtMSLT3HP39IxsL9UR2nk6E R3V96K6axtKWm+VMB0JMpsldcc1wA+zFvV0fLT1gEQ== X-Google-Smtp-Source: ABdhPJy2dt3RJ1FG4/6bhDA1qzn4xmAgfk+y6FmsSUEi6ZJD7I1IcHsBaS6ztwX2Dy4bot9PsL6PWq1L3saj3QmAlOM= X-Received: by 2002:a05:6830:14d9:: with SMTP id t25mr13128038otq.188.1600168050256; Tue, 15 Sep 2020 04:07:30 -0700 (PDT) MIME-Version: 1.0 References: <20200914132920.59183-1-christian.koenig@amd.com> <20200914132920.59183-2-christian.koenig@amd.com> <92b77d29-ae9b-b9cd-4e03-f193aa386cae@gmail.com> In-Reply-To: <92b77d29-ae9b-b9cd-4e03-f193aa386cae@gmail.com> From: Daniel Vetter Date: Tue, 15 Sep 2020 13:07:18 +0200 Message-ID: Subject: Re: [PATCH 1/2] drm/shmem-helpers: revert "Redirect mmap for imported dma-buf" To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Andrew Morton , Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Linux MM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 1:03 PM Christian K=C3=B6nig wrote: > > Am 15.09.20 um 12:39 schrieb Daniel Vetter: > > On Mon, Sep 14, 2020 at 3:29 PM Christian K=C3=B6nig > > wrote: > >> This reverts commit 26d3ac3cb04d171a861952e89324e347598a347f. > >> > >> We need to figure out if dma_buf_mmap() is valid or not first. > >> > >> Signed-off-by: Christian K=C3=B6nig > > The trouble is that doing dma-buf mmap by looking at the struct pages > > behind the sg list and just inserting those into userspace doesn't > > really work any better. You still won't get the unmap_mapping_range > > and hence pte shoot-down. So maybe dma_buf_mmap forwarding doesn't > > work, but this doesn't make it any better. > > Good point. Question is what should we do? Return -EPERM? IIrc there's userspace which expects this to work, but I think it's also only trying to do this with simpler drivers that don't need unmap_mapping_range to work correctly. Or it's simply that no one ever reported the bugs. It's a bit a mess :-/ -Daniel > > > > > Also commit message should probably explain a bit the context here, > > not a lot of people have been in our private discussion on this. > > Well, that's certain true. > > Christian. > > > -Daniel > > > >> --- > >> drivers/gpu/drm/drm_gem_shmem_helper.c | 3 --- > >> 1 file changed, 3 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/= drm_gem_shmem_helper.c > >> index 0a952f27c184..cd727343f72b 100644 > >> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c > >> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c > >> @@ -594,9 +594,6 @@ int drm_gem_shmem_mmap(struct drm_gem_object *obj,= struct vm_area_struct *vma) > >> /* Remove the fake offset */ > >> vma->vm_pgoff -=3D drm_vma_node_start(&obj->vma_node); > >> > >> - if (obj->import_attach) > >> - return dma_buf_mmap(obj->dma_buf, vma, 0); > >> - > >> shmem =3D to_drm_gem_shmem_obj(obj); > >> > >> ret =3D drm_gem_shmem_get_pages(shmem); > >> -- > >> 2.17.1 > >> > >> _______________________________________________ > >> dri-devel mailing list > >> dri-devel@lists.freedesktop.org > >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch