Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1279218imu; Thu, 13 Dec 2018 12:18:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wa3vxQwGox4uOZy16sL4djpD8iKgnskBtVP48hjQXvFXincYwa5casnBoMn/Dm7eYTeb8E X-Received: by 2002:a17:902:4827:: with SMTP id s36mr233076pld.168.1544732319464; Thu, 13 Dec 2018 12:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544732319; cv=none; d=google.com; s=arc-20160816; b=G0ibBx67syiTSspBxZgSy38YVIcj7tY1r5UTryJW/fCK7lPlif6tY2VHLBViDGozRS nVMdWRN9FLL9z3pUYDg5yCf+QSlhLbU4+ZqXEcb3wE37H5g1GH8zf4T/56rvD+HH0TLv vvddjgPDdhuo5fFgVHHS7wKTFeDkfNN0j9IEmrgDz8y8AOS7zpmo5J8Imzg9mJxn+kwf RaQ5YqiiR3qNjar9DYBMn4cu1UkADIbV9aYYZmgIZzsFLVTzfGzK1yjM60oNyKqVfUbW iYHWp07n65yhtkd6vxUm5evNmu3yZzfZ3+JvybV+33LJz1d4L4NhfsYe3a+1VmKAjCAB z0Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2DqkQEf9kyIYcQse5A/i3VKV32fnX4vmMnow5qWhVS0=; b=YhFQ20TM2Mfz6Ixd3HO9coKt8/WSr6OenVk9AQPd5dMYrxqgBGkv2tOBOYM7FOKLlZ UKQ3gf6ID3qp5oZ1e+49SPKP5uPXHzVSrj7XW7/2RWlUKcXFiGbHm4zRkGP2rPBS7bpz Jm2BvFBnP5KCwuv/WdpCx2Lj24/aevSS4eIrX0WgDEAllKTMW/V/fiumRvej7pII9LpU RErkDnYL2KVL1jAL5fy+7m/GHVwGSGiQhL1Yi6o8FTVPfy0+yqh7iPYq1iTOytH68kZM pXeNITCeJZYRRo0gHggMbJiYWYDWx/E9GKdTs6oOf9oqnZ8gJbdMo3YfwBCv/xnM7QJX VskQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=iAtgXtNC; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si2146683pgp.348.2018.12.13.12.18.24; Thu, 13 Dec 2018 12:18:39 -0800 (PST) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=iAtgXtNC; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbeLMUQE (ORCPT + 99 others); Thu, 13 Dec 2018 15:16:04 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:32944 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbeLMUQD (ORCPT ); Thu, 13 Dec 2018 15:16:03 -0500 Received: by mail-oi1-f195.google.com with SMTP id c206so2728221oib.0 for ; Thu, 13 Dec 2018 12:16:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2DqkQEf9kyIYcQse5A/i3VKV32fnX4vmMnow5qWhVS0=; b=iAtgXtNCbKumiVhJ6+sw7EXkDWpKU42uul5ijgV6Gn4mC5bsUybh2f10kscLs/FF6h U9d9LAe3YJZ18DjUpTUtA/gqZJ7/eR7N7yP9GITLt1ra9WynrAQ7N1jZOg45Qi/G3IaO NN5LT2qjXp3EWQW9aX1xZ462hy3rzPh2U6Nd/zlMEsiCj7FXf+to/izsNbNWHkpN5j/y q4HLB67v+3u44ttNmtWlyLPrdJ2E6HD0W59Vu1Bm6N4hV20nRrwHcRZgyUw1tXxYKBo4 M2/5oQwVJS0tPkNJ0XrTQayGdkTfZPbglI0GgQvyy/bKXKyhpepvvAqa2du5mkOdgfTu wC0A== 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=2DqkQEf9kyIYcQse5A/i3VKV32fnX4vmMnow5qWhVS0=; b=WdoEffT7qldQhSBwIraHeggQg7AcXiKv8hry3AQBMwyjda+h+L58ezoDoL0orcC+fP ziCvwQg6YB+IQKCZ6+4vGrIfh/mL0x9gaCEOH5s8C79eN4nOw+7ITfar5FadUMNfbRCn /OEvDV3ktn5tA35vCARPlhK9QPJeqo32tP028ZvgM/a3hvjVVaCf2q8nRfCCuswWExCs C6F3qdHHerRHh1BJVmRuDCU6v01VCLeZBg+irZMYLLMfSw/ke7Z/f9eIaHx1wk4JmbvZ xnoJ1liv3pqpNea5OiPiwW5GA0V8o3G3uKKjnsUixVZwoBBHh34yt/7h2zxR3PnZ9OWX NfQA== X-Gm-Message-State: AA+aEWa0bERA8v1lCc//7fO2Sy9okJTBcjx6Y83UptcLOYaeutiM4s7h QzXy3qezTbzxFfho1F2wY7kM7eifEPHVD2848vSS5A== X-Received: by 2002:aca:d905:: with SMTP id q5mr157163oig.0.1544732162568; Thu, 13 Dec 2018 12:16:02 -0800 (PST) MIME-Version: 1.0 References: <20181210171318.16998-1-vgoyal@redhat.com> <20181210171318.16998-16-vgoyal@redhat.com> <20181213200936.GU2313@work-vm> In-Reply-To: <20181213200936.GU2313@work-vm> From: Dan Williams Date: Thu, 13 Dec 2018 12:15:51 -0800 Message-ID: Subject: Re: [PATCH 15/52] fuse: map virtio_fs DAX window BAR To: "Dr. David Alan Gilbert" Cc: Vivek Goyal , linux-fsdevel , Linux Kernel Mailing List , KVM list , Miklos Szeredi , Stefan Hajnoczi , sweil@redhat.com, Steven Whitehouse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 13, 2018 at 12:09 PM Dr. David Alan Gilbert wrote: > > * Dan Williams (dan.j.williams@intel.com) wrote: > > On Mon, Dec 10, 2018 at 9:22 AM Vivek Goyal wrote: > > > > > > From: Stefan Hajnoczi > > > > > > Experimental QEMU code introduces an MMIO BAR for mapping portions of > > > files in the virtio-fs device. Map this BAR so that FUSE DAX can access > > > file contents from the host page cache. > > > > FUSE DAX sounds terrifying, can you explain a bit more about what this is? > > We've got a guest running in QEMU, it sees an emulated PCI device; > that runs a FUSE protocol over virtio on that PCI device, but also has > a trick where via commands sent over the virtio queue associated with that device, > (fragments of) host files get mmap'd into the qemu virtual memory that corresponds > to the kvm slot exposed to the guest for that bar. > > The guest sees those chunks in that BAR, and thus you can read/write > to the host file by directly writing into that BAR. Ok so it's all software emulated and there won't be hardware DMA initiated by the guest to that address? I.e. if the host file gets truncated / hole-punched the guest would just cause a refault and the filesystem could fill in the block, or the guest is expected to die if the fault to the truncated file range results in SIGBUS. > > > The DAX window is accessed by the fs/dax.c infrastructure and must have > > > struct pages (at least on x86). Use devm_memremap_pages() to map the > > > DAX window PCI BAR and allocate struct page. > > > > PCI BAR space is not cache coherent, > > Note that no real PCI infrastructure is involved - this is all emulated > devices, backed by mmap'd files on the host qemu process. Ok, terror level decreased.