Received: by 10.213.65.68 with SMTP id h4csp506546imn; Fri, 6 Apr 2018 04:18:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+gHV5TAXLhnNkyNL81bLbO9tmrZ7AYbM+r6T+pGQwnWRWZ0YCwaH0+MNZuWiqj4GTdbLQV X-Received: by 10.99.166.10 with SMTP id t10mr17474963pge.357.1523013522401; Fri, 06 Apr 2018 04:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523013522; cv=none; d=google.com; s=arc-20160816; b=rpWvuqxa9ct8V41pcoEYdNNhezd8U/wxWZACptwnuINDWjzKZFHEqEt/4EYo21B8cI 2jya/mAL/rXU8xg8Jp0ecU3LbIvKyInUEd/Xat3GB5TLxiztlkdDu4pW6owfgPQHNNeb zTVCcgyaLCfVHI60/E4hy8X2/GdY1bqOc7L5lNovaP5Wwj+FBFGHWxSk6Iw1hxHFRL/r uifU8OvFlW6YOTcYx5b9W2MMDigqbOAzS3V9DLQwAIIvlaEY6X8A0B9Hp+rksFgMliuw cbxkvU12gGVmKipcDAJJqHmRb5nmkcxZcC592StxCVuI1nRFE9UoW+X4OqPGcZgQfiRn zsMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=sQ8+b85e944cQNHJnyrHMvYtyfCSEZjY+VslXx6PMOU=; b=JYeeD/FGKVWrGepFpfAhiWlcZYwjEjPBSe2QJnzQVBrBPO6OnxOzmyZ8q4APljCJX6 LmDwqnkGRk5LnoRmuC6YIHiOiQ0kOytHqS3VvmJUPrKtGzOwez4ptwLT4EFT7UD+PbsM NxtjodKj81E5/LfNlF3MvHi2RwG78/ouftjHlJ/7u99PNCk6ZhOcLLOiVy1jlHO0AQMt MzvjFRH35Ljf/T+o5mI5Jz7inTv1Y9zBXXfJbNVZePOsmmqHxuiSvwCyV8NXYQiLZtC1 Oq3QYZMykiSZ7cTX5RmCIhVrTNLP9qd+UtMA2IelEprOOtSi7+8pqma2Q5XudjmR1yyo kNtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aT1c35ib; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7si6817383pgv.558.2018.04.06.04.18.28; Fri, 06 Apr 2018 04:18:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aT1c35ib; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbeDFLRO (ORCPT + 99 others); Fri, 6 Apr 2018 07:17:14 -0400 Received: from mail-lf0-f51.google.com ([209.85.215.51]:36107 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494AbeDFLRN (ORCPT ); Fri, 6 Apr 2018 07:17:13 -0400 Received: by mail-lf0-f51.google.com with SMTP id z143-v6so22465lff.3; Fri, 06 Apr 2018 04:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=sQ8+b85e944cQNHJnyrHMvYtyfCSEZjY+VslXx6PMOU=; b=aT1c35ibFnlouRIeAiDGR49IOLg1IOhpW0rG1CavSG9TeTM6eCf10Fs3g2NP5vnb0J b+klM4CHYy//ltfK6FSrLuUfSvTX+DqIo+xfIQiM1Q+aQBCLTHia8s3GLFjscFm5ayy0 hCOmnSj3azExvCyHIQlEUXAoZJDKB2ygtAjTN4u2/TkLHh9RcdnCKIgR3+8Qo8GKAN6+ OgwMaerm3Wqcn0X031bbLB5REA/UUDvs4zk4xlilQkKgZWl2i4KNAgqliuYoB9xWZNn8 l9p0xY1eRk2El4voQkKYm0MQEJWnt+BnhWo1j91OzSDzfqtZUgrxLY0ck7as5jP1RMAH xY0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=sQ8+b85e944cQNHJnyrHMvYtyfCSEZjY+VslXx6PMOU=; b=ja6rTEWh6Gwy8lOer2E5YFowdtEE/AqeevM2iBJh4swkm1wyBhA2PBDE8ecKSegEi6 eZb63JJZ/EuQLJtTJT7F7zZimfz/IJm/eF3E75yFqQxiylkl6/WcjFipK/UWx9S70SJR JVlpUFGQYtppQcwrDP7yLXio7BeydxzQ0MxAvdXLZiYvqdI0pYMFEE/ULvSKQ9Spw1UQ 71a+0Jaj7ZJ3vrtq4sIN04DmtbyoMzR3nrtHihn7D9coyMwrnOVMuUqut3qdkzqDurEV qZ0P8JVGsJaTth4tgP4S2du/yXgHldcemaQUU4H5ohacqMvhL2anc1XCSwkH9efTRgWa hqYg== X-Gm-Message-State: ALQs6tBbWak6NbC168WOvKQmh6Gf58HieLMl6+bkylhBFOfMVENr5lt4 VbrIj9SJqCDxL4f48EONrt2S+Lqc9x8= X-Received: by 10.46.93.219 with SMTP id v88mr16135724lje.88.1523013426103; Fri, 06 Apr 2018 04:17:06 -0700 (PDT) Received: from [10.17.182.9] (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id r12-v6sm2030282lff.91.2018.04.06.04.17.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 04:17:05 -0700 (PDT) Subject: Re: [RfC PATCH] Add udmabuf misc device To: Gerd Hoffmann , Oleksandr Andrushchenko Cc: Dongwon Kim , Tomeu Vizoso , David Airlie , open list , dri-devel , qemu-devel@nongnu.org, "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" References: <20180313154826.20436-1-kraxel@redhat.com> <20180313161035.GL4788@phenom.ffwll.local> <20180314080301.366zycak3whqvvqx@sirius.home.kraxel.org> <20180406001117.GD31612@mdroper-desk.amr.corp.intel.com> <2411d2c1-33c0-2ba5-67ea-3bb9af5d5ec9@epam.com> <20180406090747.gwiegu22z4noj23i@sirius.home.kraxel.org> From: Oleksandr Andrushchenko Message-ID: <9a085854-3758-1500-9971-806c611cb54f@gmail.com> Date: Fri, 6 Apr 2018 14:17:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180406090747.gwiegu22z4noj23i@sirius.home.kraxel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/06/2018 12:07 PM, Gerd Hoffmann wrote: > I'm not sure we can create something which works on both kvm and xen. > The memory management model is quite different ... > > > On xen the hypervisor manages all memory. Guests can allow other guests > to access specific pages (using grant tables). In theory any guest <=> > guest communication is possible. In practice is mostly guest <=> dom0 > because guests access their virtual hardware that way. dom0 is the > priviledged guest which owns any hardware not managed by xen itself. > > Xen guests can ask the hypervisor to update the mapping of guest > physical pages. They can ballon down (unmap and free pages). They can > ballon up (ask the hypervisor to map fresh pages). They can map pages > exported by other guests using grant tables. xen-zcopy makes heavy use > of this. It balloons down, to make room in the guest physical address > space, then goes map the exported pages there, finally composes a > dma-buf. > > > On kvm qemu manages all guest memory. qemu also has all guest memory > mapped, so a grant-table like mechanism isn't needed to implement > virtual devices. qemu can decide how it backs memory for the guest. > qemu propagates the guest memory map to the kvm driver in the linux > kernel. kvm guests have some control over the guest memory map, for > example they can map pci bars wherever they want in their guest physical > address space by programming the base registers accordingly, but unlike > xen guests they can't ask the host to remap individual pages. > > Due to qemu having all guest memory mapped virtual devices are typically > designed to have the guest allocate resources, then notify the host > where they are located. This is where the udmabuf idea comes from: > Guest tells the host (qemu) where the gem object is, and qemu then can > create a dmabuf backed by those pages to pass it on to other processes > such as the wayland display server. Possibly even without the guest > explicitly asking for it, i.e. export the framebuffer placed by the > guest in the (virtual) vga pci memory bar as dma-buf. And I can imagine > that this is useful outsize virtualization too. > > > I fail to see any common ground for xen-zcopy and udmabuf ... Does the above mean you can assume that xen-zcopy and udmabuf can co-exist as two different solutions? And what about hyper-dmabuf? Thank you, Oleksandr