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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A9A87C433DB for ; Thu, 4 Feb 2021 20:21:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6321364F3F for ; Thu, 4 Feb 2021 20:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239971AbhBDUUw (ORCPT ); Thu, 4 Feb 2021 15:20:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239969AbhBDUUt (ORCPT ); Thu, 4 Feb 2021 15:20:49 -0500 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D735C06178B for ; Thu, 4 Feb 2021 12:20:09 -0800 (PST) Received: by mail-oi1-x236.google.com with SMTP id k204so3489598oih.3 for ; Thu, 04 Feb 2021 12:20:09 -0800 (PST) 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=Xpi3ivwmVLdqOvs1N6dWfJPh+KUCL6ESv/15EWzkk0SYh5UrDZbnAFeuQ0LjKLDPJ7 De9JuaYPvilTUPbN7e/X9v+MAUVlzWXjljZf3QA9W/YfZZpTGY/2YH7tJ7fp5LhhaJ1E TecADaHNqVMOJ3iZ/L1xhrSQ2gaVbYy3ceflA= 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=HtXz8C4mjpYFIX0xdGXd6vr0bMeUUjXJBet/Sc8yEfbvswLagwOHDNG4LK329Wm20e ksEpfoF8KbqJCCUtMCSwPOMFlgDtA9VJL+wFyWjS01zMkt9XUXTUGrL1eoK9j5B1WpMA ZC1YB9jE41WIO1nPWHzumhu5RYNBFwCLz8QOfGBV9Ikk+1kZtDtoeYY51uZ2OrZ6D7/1 Ws/TtNgHuha9w/wzMwMJEd933Fnh1wXoNbfGXRQJBeHqAEuvJ5lkosighD+QecIWcETY vvbnLD7L/LNX0qczCDXAIgHg524V8YtbYorf0EtThmmPXKaD75aDmfKxDnZoI911orOC xEQw== X-Gm-Message-State: AOAM5307HHWNTDAz/0GBsKVFKtTcwprp/aQwCmQxiSQlfaK4AacVgThR Dr0SHZ0tKFrkutiuFBTYx2Jms1sU75E7dP1xbJu+gw== X-Google-Smtp-Source: ABdhPJx/eLdhIzXnP9kqJ04S5q7V3UVm0UNcMndwh3kT46QCp6BCgQGHr/UZJ84rtpMCXuoIRTD3gtusKXypuS6WNDw= X-Received: by 2002:aca:4ac5:: with SMTP id x188mr845032oia.14.1612470008816; Thu, 04 Feb 2021 12:20:08 -0800 (PST) MIME-Version: 1.0 References: <20210203211948.2529297-1-daniel.vetter@ffwll.ch> <20210204161339.GX4718@ziepe.ca> <20210204183808.GY4718@ziepe.ca> <20210204200918.GA4718@ziepe.ca> In-Reply-To: <20210204200918.GA4718@ziepe.ca> From: Daniel Vetter Date: Thu, 4 Feb 2021 21:19:57 +0100 Message-ID: Subject: Re: [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap To: Jason Gunthorpe Cc: DRI Development , Intel Graphics Development , Suren Baghdasaryan , Matthew Wilcox , John Stultz , Daniel Vetter , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, Feb 4, 2021 at 9:09 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 08:59:59PM +0100, Daniel Vetter wrote: > > > So I think just checking for VM_PFNMAP after the vma is set up should > > be enough to guarantee we'll only have pte_special ptes in there, > > ever. But I'm not sure, this stuff all isn't really documented much > > and the code is sometimes a maze (to me at least). > > Yes, that makes sense. VM_PFNMAP and !VM_MIXEDMAP seems like the right > check after the VMA is populated > > But how do you stuff special pfns into a VMA outside the fault > handler? Many drivers we have don't have dynamic buffer management (kinda overkill for a few framebuffers on a display-only IP block), so the just remap_pfn_range on ->mmap, and don't have a fault handler at all. Or I'm not understanding what you're asking? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 67273C433DB for ; Thu, 4 Feb 2021 20:20:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABB0864E0A for ; Thu, 4 Feb 2021 20:20:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABB0864E0A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8CE06EE66; Thu, 4 Feb 2021 20:20:09 +0000 (UTC) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 814F76EE67 for ; Thu, 4 Feb 2021 20:20:09 +0000 (UTC) Received: by mail-oi1-x229.google.com with SMTP id k25so5026407oik.13 for ; Thu, 04 Feb 2021 12:20:09 -0800 (PST) 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=Xpi3ivwmVLdqOvs1N6dWfJPh+KUCL6ESv/15EWzkk0SYh5UrDZbnAFeuQ0LjKLDPJ7 De9JuaYPvilTUPbN7e/X9v+MAUVlzWXjljZf3QA9W/YfZZpTGY/2YH7tJ7fp5LhhaJ1E TecADaHNqVMOJ3iZ/L1xhrSQ2gaVbYy3ceflA= 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=qQHUbf7NDH07B0Hh9qlbSOHiNnrQTV8qMBlFxht/Oba3tYK39qtcr6EQoOV4uhWBpU GBSS/VfYbcO9NmBGr3AywS0fK1nP04V0R6rLSiOCgN3PRkAPEJBXyEVcEV+HqdKloRGd 19v7OlO1mQbRHjIRvhb26VW0Be5NnvImWXqcxMfglAFEZtkDGb8H3N+ZFWZI4XZf+Xjc uUz6BAkNsXFZ7WGxZ3Xyka2RIs3myFRKtpgAn3cYNJkhyqqt0whNT5q9TeW0i0zKTbyo PM2RwxZyDq4qxWGfU8k6XmFF88BDoVL6O5Vu7bq5y9ERABuaFcPzABSrThUofINdJLOq xVMA== X-Gm-Message-State: AOAM5337EXeX9kKKKKdz7foKNarn4rWr1hJYX6xpsncdbRoB+kRK7nKj XnJeF2JGrxyq6IEKf7uvq3lkvVET0SmyvSMivPsjXA== X-Google-Smtp-Source: ABdhPJx/eLdhIzXnP9kqJ04S5q7V3UVm0UNcMndwh3kT46QCp6BCgQGHr/UZJ84rtpMCXuoIRTD3gtusKXypuS6WNDw= X-Received: by 2002:aca:4ac5:: with SMTP id x188mr845032oia.14.1612470008816; Thu, 04 Feb 2021 12:20:08 -0800 (PST) MIME-Version: 1.0 References: <20210203211948.2529297-1-daniel.vetter@ffwll.ch> <20210204161339.GX4718@ziepe.ca> <20210204183808.GY4718@ziepe.ca> <20210204200918.GA4718@ziepe.ca> In-Reply-To: <20210204200918.GA4718@ziepe.ca> From: Daniel Vetter Date: Thu, 4 Feb 2021 21:19:57 +0100 Message-ID: Subject: Re: [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap To: Jason Gunthorpe X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , Matthew Wilcox , =?UTF-8?Q?Christian_K=C3=B6nig?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , DRI Development , Daniel Vetter , Suren Baghdasaryan , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Feb 4, 2021 at 9:09 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 08:59:59PM +0100, Daniel Vetter wrote: > > > So I think just checking for VM_PFNMAP after the vma is set up should > > be enough to guarantee we'll only have pte_special ptes in there, > > ever. But I'm not sure, this stuff all isn't really documented much > > and the code is sometimes a maze (to me at least). > > Yes, that makes sense. VM_PFNMAP and !VM_MIXEDMAP seems like the right > check after the VMA is populated > > But how do you stuff special pfns into a VMA outside the fault > handler? Many drivers we have don't have dynamic buffer management (kinda overkill for a few framebuffers on a display-only IP block), so the just remap_pfn_range on ->mmap, and don't have a fault handler at all. Or I'm not understanding what you're asking? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 7F155C433DB for ; Thu, 4 Feb 2021 20:20:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFE0564E0A for ; Thu, 4 Feb 2021 20:20:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFE0564E0A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1A0B6EE67; Thu, 4 Feb 2021 20:20:10 +0000 (UTC) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77BC46EE66 for ; Thu, 4 Feb 2021 20:20:09 +0000 (UTC) Received: by mail-oi1-x22f.google.com with SMTP id k142so5065755oib.7 for ; Thu, 04 Feb 2021 12:20:09 -0800 (PST) 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=Xpi3ivwmVLdqOvs1N6dWfJPh+KUCL6ESv/15EWzkk0SYh5UrDZbnAFeuQ0LjKLDPJ7 De9JuaYPvilTUPbN7e/X9v+MAUVlzWXjljZf3QA9W/YfZZpTGY/2YH7tJ7fp5LhhaJ1E TecADaHNqVMOJ3iZ/L1xhrSQ2gaVbYy3ceflA= 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; bh=wpgT6Yz8SEv8X0iAsr6guPodAvl5pFjIWmhOvi/hibA=; b=e2RjBwhrtLbdnqYTL0QQxzVVlhK+NFXvDCdRmfukHw3GeB9UP6dIeU+twr+PKDOCjg uNXDdpoTPeGkgPWmBIZ4M3Es6wG3YppT8Uph7zH4z5DXG8eqH2ugr+3ObocrFMOJXG2o FtUNsqt8vahy3ZYOXf89lFcJeJOSLO03Q4OH3YnmjBMBvNZl1XGor4Mu+vqqXXZhjyxi xyfh1O4FR5h+Qzx3XFLGxYjZO9sh32TAzGUEu1Oqszf3OrVpMcKpMlVxyTUVxfUjFU7w OXLbI25Zb/TyIysn54H/P4bUQ7Ys6rpMhNHDJYQjZhWQvvbxTROMvg4iNx00DvfHtaE5 INGA== X-Gm-Message-State: AOAM533uPisblOu40YrMsakKqk1HsE03SqfvrZiLJQ1G4WDyu+EHqdJF GB+SMpviy+LodatZbZz7T4Dh8gDafCgvAAhnk28nkg== X-Google-Smtp-Source: ABdhPJx/eLdhIzXnP9kqJ04S5q7V3UVm0UNcMndwh3kT46QCp6BCgQGHr/UZJ84rtpMCXuoIRTD3gtusKXypuS6WNDw= X-Received: by 2002:aca:4ac5:: with SMTP id x188mr845032oia.14.1612470008816; Thu, 04 Feb 2021 12:20:08 -0800 (PST) MIME-Version: 1.0 References: <20210203211948.2529297-1-daniel.vetter@ffwll.ch> <20210204161339.GX4718@ziepe.ca> <20210204183808.GY4718@ziepe.ca> <20210204200918.GA4718@ziepe.ca> In-Reply-To: <20210204200918.GA4718@ziepe.ca> From: Daniel Vetter Date: Thu, 4 Feb 2021 21:19:57 +0100 Message-ID: To: Jason Gunthorpe Subject: Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , Matthew Wilcox , =?UTF-8?Q?Christian_K=C3=B6nig?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , John Stultz , DRI Development , Daniel Vetter , Suren Baghdasaryan , Sumit Semwal , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, Feb 4, 2021 at 9:09 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 08:59:59PM +0100, Daniel Vetter wrote: > > > So I think just checking for VM_PFNMAP after the vma is set up should > > be enough to guarantee we'll only have pte_special ptes in there, > > ever. But I'm not sure, this stuff all isn't really documented much > > and the code is sometimes a maze (to me at least). > > Yes, that makes sense. VM_PFNMAP and !VM_MIXEDMAP seems like the right > check after the VMA is populated > > But how do you stuff special pfns into a VMA outside the fault > handler? Many drivers we have don't have dynamic buffer management (kinda overkill for a few framebuffers on a display-only IP block), so the just remap_pfn_range on ->mmap, and don't have a fault handler at all. Or I'm not understanding what you're asking? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx