Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1300865imu; Thu, 13 Dec 2018 12:42:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ur1WLFKs1pn9Q6mf1BS0Tqi3Lxwkx18E+qW1yoT4DhqVb1vX0pujxZHbAaQz+5EC8Znqji X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr293807plu.122.1544733720530; Thu, 13 Dec 2018 12:42:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544733720; cv=none; d=google.com; s=arc-20160816; b=hMwTbDd5phQu26tifOXJd2TTSESSWu9902Km6QZGungE4N03AB4f4RzMFd3z4dk4pC fAcG/mEMC+KmiLYSSn492l5kaH1F13yDIUFXmGWfnCIsRQYyu9TkzdxF4wKPm3rMvGtU J7z68mSZiHbZcWFbJAUaLhtJvigR/j/Isd3GzwmFH5iAtqS5hCF5UY/HU1wpHCieWn91 owQlvGmhYLAMjhVxYyeZyvlbs2IE693Z60t71DLLM/cBidfEzYss7gYoNGjfsemruX+6 8KYJy4WRahAVyzAlUDlBTp/8DKgvceZ31Kd7gpYubAxHMnT/w12dooZGknht8tk/jb34 Khmw== 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=RTvIVqdERzx64v9RuuWytVk50A+Tkg4xuUyjgUe2L84=; b=0lZzozPHPpT5gMa3nbXFoyDdIEvPXwi3nYMpIegp+T9a/h7EgVl7Jj7QqjiVKG0M/w y3J+cX5da3mPTh2DCys2JqSpxQcLGEW45Efm+2WLF/uM6deZHjSRJiqOHxpKcx1ysYh1 uAHU9Him8HThk0dJAm9F8UB2O8UBRKcBs8IIEVTgjmbMadSNW1WgZDbai7P07xODmytH cmbxjJvUBLMq/ner3vbBEsWTXVTCH/F1zIlSSwSrDO5fUa78bRTZVPrgTLjCq6A6VN0f AW/WLCRDTPB5oDghmTVFOoyhshu8iiMmNGbqmILZMYR2WxujdbaUM4w0LNBU8vYCPMzI hiWQ== 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 r14si2283777pfh.229.2018.12.13.12.41.46; Thu, 13 Dec 2018 12:42:00 -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 S1727810AbeLMUk4 (ORCPT + 99 others); Thu, 13 Dec 2018 15:40:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34678 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbeLMUkz (ORCPT ); Thu, 13 Dec 2018 15:40:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E40AC057F33; Thu, 13 Dec 2018 20:40:55 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id F236760BE7; Thu, 13 Dec 2018 20:40:52 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 8CE142208FC; Thu, 13 Dec 2018 15:40:52 -0500 (EST) Date: Thu, 13 Dec 2018 15:40:52 -0500 From: Vivek Goyal To: Dan Williams Cc: "Dr. David Alan Gilbert" , linux-fsdevel , Linux Kernel Mailing List , KVM list , Miklos Szeredi , Stefan Hajnoczi , sweil@redhat.com, Steven Whitehouse Subject: Re: [PATCH 15/52] fuse: map virtio_fs DAX window BAR Message-ID: <20181213204052.GE4384@redhat.com> References: <20181210171318.16998-1-vgoyal@redhat.com> <20181210171318.16998-16-vgoyal@redhat.com> <20181213200936.GU2313@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Dec 2018 20:40:55 +0000 (UTC) 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:15:51PM -0800, Dan Williams wrote: > 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? That's my understanding. > 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, Right > or the guest is expected to die if > the fault to the truncated file range results in SIGBUS. Are you referring to the case where a file page is mapped in qemu and another guest/process trucates that page and when qemu tries to access it it will get SIGBUS. Have not tried it, will give it a try. Not sure what happens when QEMU receives SIGBUS. Having said that, this is not different from the case of one process mapping a file and another process truncating the file and first process getting SIGBUS, right? Thanks Vivek > > > > > 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.