Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1883787imu; Fri, 14 Dec 2018 02:11:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/UaeLGDcaLpBl6DFedAnSuFwmhKxV7OCyWzrFjAUG6P9OE3+yp+/g1N9q3owyrt/ZonsS9F X-Received: by 2002:a63:5207:: with SMTP id g7mr2170093pgb.253.1544782279058; Fri, 14 Dec 2018 02:11:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544782279; cv=none; d=google.com; s=arc-20160816; b=jZ8jidaxGbC8LCBryQsA8+CithWkEa7DZJRC/Zl3tVBNTPeKOZe+mUY1lcDXgz9/Xi TN1jr0zdCbTZI9cIKdNb0guHIi2wmxDHKm1sZeIfp3FbEBK3sMZbD6iL2s1mUo1Ot8pG O6ocDM24wXCsS227ipzHIDJ95nJwxG7O3BszAu7DaSwTmVVrAjtRA/Lw0C7T+GSG/pvY xeeRV8BIjwZLb/Pm2AgclB56p4k/CArgLrKmh59qDwTO0HCIGx+5mSxrRI+gEMJRdx3x Ly4ff2ur95JgzitX6dV0glI42i+IYfT8J1TTLFNXGskfkV4XISCfS60CjNYxTOAPqr6P 9ruw== 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=Qm90hwFeDgnk5ZcxlHvh9UQv/w7shubx/rLv/Om9dv0=; b=KSY6LCe+WkoEYeRJKorl5Eb3Cr6CB+CfwyIaLsyHJO5FwmZ85qp5I1mCmZjZ682tFH b8YVVF5ghX8w/FpOYOCmNtpJOqE8ct/SqnAPrgXU8jE/gwCoojV9YbfEhYs5iFE2Hk1s WOBeWbv5JXHIr40OcFbzcQ1+CWYydur+jZMXa8HV/skEMWRSlQXGL0BjYCygSB479DVJ WU2bqPqoxIHZZgp19bfkOE4v5yf74e6oFl8jrwz6r3gGJKi2H5/63qlmG5ByVPtMtZyG mnUtF/e+DFS/5Ao4F/gqlJOdMeh+jSlfOoomLxT+nOvc2m1SLe/l87je46y2zuPZ41U2 jRIg== 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 p66si3789376pfp.144.2018.12.14.02.11.04; Fri, 14 Dec 2018 02:11:19 -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 S1729349AbeLNKKI (ORCPT + 99 others); Fri, 14 Dec 2018 05:10:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbeLNKKI (ORCPT ); Fri, 14 Dec 2018 05:10:08 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3ACFCC0495BF; Fri, 14 Dec 2018 10:10:07 +0000 (UTC) Received: from work-vm (ovpn-117-198.ams2.redhat.com [10.36.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B61395D6B3; Fri, 14 Dec 2018 10:09:59 +0000 (UTC) Date: Fri, 14 Dec 2018 10:09:57 +0000 From: "Dr. David Alan Gilbert" To: Vivek Goyal Cc: Dan Williams , 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: <20181214100956.GC2454@work-vm> References: <20181210171318.16998-1-vgoyal@redhat.com> <20181210171318.16998-16-vgoyal@redhat.com> <20181213200936.GU2313@work-vm> <20181213204052.GE4384@redhat.com> <20181213211819.GF4384@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181213211819.GF4384@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 14 Dec 2018 10:10:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Vivek Goyal (vgoyal@redhat.com) wrote: > On Thu, Dec 13, 2018 at 03:40:52PM -0500, Vivek Goyal wrote: > > 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? > > Ok, tried this and guest process hangs. > > Stefan, dgilbert, this reminds me that we have faced this issue during > our testing and we decided that this will need some fixing in KVM. I > even put this in as part of changelog of patch with subject "fuse: Take > inode lock for dax inode truncation" > > "Another problem is, if we setup a mapping in fuse_iomap_begin(), and > file gets truncated and dax read/write happens, KVM currently hangs. > It tries to fault in a page which does not exist on host (file got > truncated). It probably requries fixing in KVM." > > Not sure what should happen though when qemu receives SIGBUS in this > case. Yes, and I noted it in the TODO in my qemu patch posting. We need to figure out what we want the guest to see in this case and figure out how to make QEMU/kvm fix it up so that the guest doesn't see anything odd. Dave > Thanks > Vivek -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK