Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1271259imu; Thu, 13 Dec 2018 12:11:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uck6kUpVs3GY76Xm+6mZ6xUqZjKSon/8ba5KZURWx42LdxthO31P0Ljg5IN+WSQfn7vXWS X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr175442pls.281.1544731868221; Thu, 13 Dec 2018 12:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544731868; cv=none; d=google.com; s=arc-20160816; b=zGPi60/oOKMPKy8/3ol3Oujdy3tyjo+xxCbvaNqXgzJAwkzrwydE1ltaU1JvHKO6Zn cCLB1tkcRi5Ovx6q/yOSgTEhwiI848XLsbwppfDnyrYwnsHC7LKfb6ZjHpbIo0YZF6Xf H0oOsAeDLAZ7ItAR6IqqqOhVeOkE+ZmZ+735br30l7bkHtKUiIuJ6Hj8vpmTCQ8Grevz KBQOjMNxypKffOXULcC2/U4YMpcTobaa35P4aqvmLhT1HWGybe+QNeJoAweZ+L7pcfdQ sta2BmIuyJN3ngnw6BnWCcpETr/SimWwi5O3glOgZVJ6I0mBG2fmGAREbAzxSy7MCFQA NhAg== 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; bh=srybY2pnn4Ui/+DGV7/JLEvld8QnlGNBtqGnXfw1Cyc=; b=GWXYMTTAUBU6aqn7HOSSatf0jYPQdJXoXWIizE/QnqSzYpMfIv0zXDXKp9tfFxqtDa KZkDiTMvR1uITPYaNyN09Jln/KckgOmD6ViM8G6vFPsmG2x25/27Xm1Nc2kSDDYYBIT4 Fy5y46IqqLH/YaFhO7U/f+sk00X6xyw9oW/bRsMg75m/vNV/n33WR0Ka8ku4AtN60Cgu gX3hVJx2e5phymEUl1zn3szgG/NW8M3ey7CE/jLPKbnA19/BjICA7/bv8/zXQz2mJ/Wr /5U6ZVOw/XLH+6YI5IflsyetYU4Atgxv+o2zIIHxXVGRQszHgNGiwb1/o4Vu/1xet3ZZ Odfg== 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 y10si2146683pgp.348.2018.12.13.12.10.51; Thu, 13 Dec 2018 12:11:08 -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; 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 S1726976AbeLMUJo (ORCPT + 99 others); Thu, 13 Dec 2018 15:09:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51348 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbeLMUJo (ORCPT ); Thu, 13 Dec 2018 15:09:44 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A000307EA90; Thu, 13 Dec 2018 20:09:44 +0000 (UTC) Received: from work-vm (ovpn-117-213.ams2.redhat.com [10.36.117.213]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE4FE19744; Thu, 13 Dec 2018 20:09:38 +0000 (UTC) Date: Thu, 13 Dec 2018 20:09:36 +0000 From: "Dr. David Alan Gilbert" To: Dan Williams Cc: vgoyal@redhat.com, linux-fsdevel , Linux Kernel Mailing List , KVM list , Miklos Szeredi , stefanha@redhat.com, sweil@redhat.com, swhiteho@redhat.com Subject: Re: [PATCH 15/52] fuse: map virtio_fs DAX window BAR Message-ID: <20181213200936.GU2313@work-vm> References: <20181210171318.16998-1-vgoyal@redhat.com> <20181210171318.16998-16-vgoyal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Dec 2018 20:09:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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. > > 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. Dave > what prevents these pages from > being used in paths that would do: > > object = page_address(pfn_to_page(virtio_fs_pfn)); > > ...? -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK