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=-5.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 B4A4AC43461 for ; Thu, 17 Sep 2020 12:03:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 385902087D for ; Thu, 17 Sep 2020 12:03:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SHAudCos" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 385902087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 691BC6B0003; Thu, 17 Sep 2020 08:03:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 642566B0037; Thu, 17 Sep 2020 08:03:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50A996B0055; Thu, 17 Sep 2020 08:03:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id 37F196B0003 for ; Thu, 17 Sep 2020 08:03:55 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EBD85181AEF23 for ; Thu, 17 Sep 2020 12:03:54 +0000 (UTC) X-FDA: 77272419588.01.flag64_350ee7727122 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id C5F5A1005234A for ; Thu, 17 Sep 2020 12:03:54 +0000 (UTC) X-HE-Tag: flag64_350ee7727122 X-Filterd-Recvd-Size: 5240 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 12:03:54 +0000 (UTC) Received: by mail-ej1-f50.google.com with SMTP id z22so2893872ejl.7 for ; Thu, 17 Sep 2020 05:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=4IJg+4CZG5b0foFWn90FskEpijf8EknkkB/FydWSevk=; b=SHAudCosEoaJOlkj1OVOjFQm0Y2jdQloxoQK1u5ghFaOZNsqVQcaReGEzOO22+/PoG e+zmIJbfaxRDJn6F1W66FvvVqDnIsGGL6MnPxsZh8q19Odhf0uffGcPV6JlO9CSgYMj5 QkbbrYxjVMjJru3LbVs2G9zuGLrpFenz8DlODuTJz87bSSJz05S7gbQDzrFDLzCPv/kp GJP8rX03ZnSiOdHNJDp+lHa+bInML9gW2trO21lhdxxYzkvRIn4jvoVv1FHWfSG5mPzM jBvCQfiVTBMNHksmujp+0ZgfYbsewbmHSE9bb1GJlNVIVWAigb+EHj3/Od4EcoLFVcPO dmXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=4IJg+4CZG5b0foFWn90FskEpijf8EknkkB/FydWSevk=; b=Vgw7pMxdiL1Q47VbGtDN1OlvoHnwucFpv7Bw0Q29K2gSBGBocydYe0YABOuXyw6stN BFw7J1R6kRZQm05ObN8XhQbhG8nX//th8Ool/MLgne98OVBGeuEWXY4mk/AFESdX45rX eiupu3gNvex4YRtwSA/tiod7qgu9Wh8me6hjiwansMkRYXXcIyvFJ1l0thy4NIMYHBjP ARbp7O1+SyNMVwOo+GOYv9y9/YeD8wuMwO+RHx9rL1u7Ml0DXjiBYBMdjcOVXFXXEI+O B6GtC6PAFXRzqiPlMGahpkFZsGvB8p5Vr4dEIomiDslrZy9mw0//yJ8qQJYBNUkHJqAQ mHuw== X-Gm-Message-State: AOAM532xCT6CCHwzP3JcK9+iVCVj8pFQfm1h7b6LN7qc+XZaMDTmHjxJ Oo7eZL+g57IpiG4IH9tA0BQ= X-Google-Smtp-Source: ABdhPJxQ/GtwTry9ihPN5KEPP052Fm0uzzwbkUZn/afLWALJ8NH4ADJ6T2No/Zdu/rqor4uEEJWmkA== X-Received: by 2002:a17:906:d14e:: with SMTP id br14mr28329723ejb.299.1600344233035; Thu, 17 Sep 2020 05:03:53 -0700 (PDT) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id o3sm16325516edt.79.2020.09.17.05.03.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 05:03:50 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [Linaro-mm-sig] Changing vma->vm_file in dma_buf_mmap() To: Jason Gunthorpe , Daniel Vetter Cc: Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Linux MM , Andrew Morton , =?UTF-8?Q?Christian_K=c3=b6nig?= , "open list:DMA BUFFER SHARING FRAMEWORK" References: <20200914140632.GD1221970@ziepe.ca> <9302e4e0-0ff0-8b00-ada1-85feefb49e88@gmail.com> <20200916095359.GD438822@phenom.ffwll.local> <20200916140710.GA8409@ziepe.ca> <8db2474f-ecb7-0e17-5f5b-145708fe44d5@amd.com> <8d8693db-a3f0-4f5f-3e32-57d23ca620f8@amd.com> <20200917113110.GE8409@ziepe.ca> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <6fd74b84-959c-8b3b-c27b-e9fbf66396c7@gmail.com> Date: Thu, 17 Sep 2020 14:03:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200917113110.GE8409@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Am 17.09.20 um 13:31 schrieb Jason Gunthorpe: > On Thu, Sep 17, 2020 at 10:09:12AM +0200, Daniel Vetter wrote: > >> Yeah, but it doesn't work when forwarding from the drm chardev to the >> dma-buf on the importer side, since you'd need a ton of different >> address spaces. And you still rely on the core code picking up your >> pgoff mangling, which feels about as risky to me as the vma file >> pointer wrangling - if it's not consistently applied the reverse map >> is toast and unmap_mapping_range doesn't work correctly for our needs. > I would think the pgoff has to be translated at the same time the > vm->vm_file is changed? > > The owner of the dma_buf should have one virtual address space and FD, > all its dma bufs should be linked to it, and all pgoffs translated to > that space. Yeah, that is exactly like amdgpu is doing it. Going to document that somehow when I'm done with TTM cleanups. Christian. > > Jason > _______________________________________________ > Linaro-mm-sig mailing list > Linaro-mm-sig@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/linaro-mm-sig