Received: by 10.213.65.68 with SMTP id h4csp420731imn; Fri, 6 Apr 2018 02:35:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+0GkmJljTAeLFGsEyAEc6bypn+D4luGRZfArVXzsdebD1OXBA1Se/08zMEnjNFgDrcsVZz X-Received: by 2002:a17:902:43:: with SMTP id 61-v6mr21179910pla.259.1523007319513; Fri, 06 Apr 2018 02:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523007319; cv=none; d=google.com; s=arc-20160816; b=jefMI8VPxwp+2m18pRAiu3gOnkkKE/my8axjUlbBGFeiuRpr1JMQT0El2AhWtahCII 1J1T6jqVIkWUxtWdgxLIEgfI4khvtmQ+jbC2Ze361Th205DMDDfJROwEn6q/fZBfPtD8 4j9/InvbC0LfqZHZ2Mqou1qZ0Irr7CAiUp4YYm3DfMNwBbigtMKUg/2mrgr1BdQJh8+x uCez+LM64vVU/yg9Pm5H6h6JrDDz2l4r1EpfXQRhJiPIQJ4Sds//t5zowWMmzIZQsE2Y v7Qhfk+hzHclN7b1uOfWJCIia1L9GuWaAgFb6zt7/hz8FeJRo8HvHzslLPMm7A/GOWkx CRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Z+OF7UudRid9HzymSUw76Ex13v20WKVnlm4MYxmprEk=; b=z15zgZ8KKlvMTSV4V1FwbeOa6f38IJqWdUXOAjraH+BeQK60FOfyiMFqlYkFUi70ZN 5kvrzWvbltGMhVSLV7016ruVZkbbR89GJN5pB1wE7GEplIrK/MrtDWKiWzYrJ/I0iIyP 45kgXtYV+TuB5oiTk+7c0GVSbrd6nLfWYI2BBWFuM6ntqmbntv/3kZKP0ZxqGCCdRaFX DLyAtRItA5Q5lts4WB2OUg/zHIlktv8WbzWltg2kGUXczHWzBWN8YSRVbRC0eM07Uw0v FD/LRPiFwmXiahxCYG1PR59b0Bl+tQHKWbuKyObUAQN9xP+VqpFQVv5DTiAXJBvPIOkV fr3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34-v6si10068959plb.281.2018.04.06.02.34.52; Fri, 06 Apr 2018 02:35:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbeDFJdK (ORCPT + 99 others); Fri, 6 Apr 2018 05:33:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35212 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751329AbeDFJdJ (ORCPT ); Fri, 6 Apr 2018 05:33:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EE9540006E6; Fri, 6 Apr 2018 09:33:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D954AFD6A; Fri, 6 Apr 2018 09:33:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3E9353200F; Fri, 6 Apr 2018 11:33:07 +0200 (CEST) Date: Fri, 6 Apr 2018 11:33:07 +0200 From: Gerd Hoffmann To: christian.koenig@amd.com Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , Tomeu Vizoso , David Airlie , open list , qemu-devel@nongnu.org, "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v2] Add udmabuf misc device Message-ID: <20180406093307.s7wkhpmddd5d4r7a@sirius.home.kraxel.org> References: <20180316074650.5415-1-kraxel@redhat.com> <7547e99b-0e3c-264e-e52b-40ad5d52b49a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7547e99b-0e3c-264e-e52b-40ad5d52b49a@gmail.com> User-Agent: NeoMutt/20180323 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 06 Apr 2018 09:33:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 06 Apr 2018 09:33:08 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > The pages backing a DMA-buf are not allowed to move (at least not without a > patch set I'm currently working on), but for certain MM operations to work > correctly you must be able to modify the page tables entries and move the > pages backing them around. > > For example try to use fork() with some copy on write pages with this > approach. You will find that you have only two options to correctly handle > this. The fork() issue should go away with shared memory pages (no cow). I guess this is the reason why vgem is internally backed by shmem. Hmm. So I could try to limit the udmabuf driver to shmem too (i.e. have the ioctl take a shmem filehandle and offset instead of a virtual address). But maybe it is better then to just extend vgem, i.e. add support to create gem objects from existing shmem. Comments? cheers, Gerd