From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgQE3-0006Ak-SH for qemu-devel@nongnu.org; Mon, 28 Sep 2015 00:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgQE0-0004FW-Km for qemu-devel@nongnu.org; Mon, 28 Sep 2015 00:39:43 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:39900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgQDz-0004Dq-Ub for qemu-devel@nongnu.org; Mon, 28 Sep 2015 00:39:40 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Sep 2015 10:09:35 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 41CE3125801A for ; Mon, 28 Sep 2015 10:09:05 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t8S4dTPS11993380 for ; Mon, 28 Sep 2015 10:09:30 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t8S4dSCR005956 for ; Mon, 28 Sep 2015 10:09:28 +0530 Date: Mon, 28 Sep 2015 10:09:26 +0530 From: Bharata B Rao Message-ID: <20150928043926.GA18760@in.ibm.com> References: <1443189192-108681-1-git-send-email-imammedo@redhat.com> <1443189192-108681-3-git-send-email-imammedo@redhat.com> <20150927104821.GA22959@redhat.com> <20150927150624.70f60f1a@nial.brq.redhat.com> <20150927160752-mutt-send-email-mst@redhat.com> <20150927160406.010edbd1@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150927160406.010edbd1@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] pc: memhp: force gaps between DIMM's GPA Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: pkrempa@redhat.com, ehabkost@redhat.com, "Michael S. Tsirkin" , qemu-devel@nongnu.org, pbonzini@redhat.com, david@gibson.dropbear.id.au On Sun, Sep 27, 2015 at 04:04:06PM +0200, Igor Mammedov wrote: > On Sun, 27 Sep 2015 16:11:02 +0300 > "Michael S. Tsirkin" wrote: > > > On Sun, Sep 27, 2015 at 03:06:24PM +0200, Igor Mammedov wrote: > > > On Sun, 27 Sep 2015 13:48:21 +0300 > > > "Michael S. Tsirkin" wrote: > > > > > > > On Fri, Sep 25, 2015 at 03:53:12PM +0200, Igor Mammedov wrote: > > > > > mapping DIMMs non contiguously allows to workaround > > > > > virtio bug reported earlier: > > > > > http://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00522.html > > > > > in this case guest kernel doesn't allocate buffers > > > > > that can cross DIMM boundary keeping each buffer > > > > > local to a DIMM. > > > > > > > > > > Suggested-by: Michael S. Tsirkin > > > > > Signed-off-by: Igor Mammedov > > > > > --- > > > > > benefit of this workaround is that no guest side > > > > > changes are required. > > > > > > > > That's a hard requirement, I agree. > > > > > > > > > > > > > --- > > > > > hw/i386/pc.c | 4 +++- > > > > > hw/i386/pc_piix.c | 3 +++ > > > > > hw/i386/pc_q35.c | 3 +++ > > > > > include/hw/i386/pc.h | 2 ++ > > > > > 4 files changed, 11 insertions(+), 1 deletion(-) > > > > > > > > Aren't other architectures besides PC ever affected? > > > > Do they all allocate all of memory contigious in HVA space? > > > I'm not sure about other targets I've CCed interested parties. > > > > > > > > > > > Also - does the issue only affect hotplugged memory? > > > Potentially it affects -numa memdev=foo, but however I've > > > tried I wasn't able to reproduce. > > > We could do it as > > > separate workaround later if it would affect someone > > > and virtio is not fixed to handle split buffers by that time. > > > > > > > You can't reproduce a crash or you can't reproduce getting contigious > > GPA with fragmented HVA? > > If you can see fragmentation that's enough to assume guest crash can > > be triggered, even if it doesn't with Linux. > I'll check it. > > > > > > > > > > Can't the patch be local to pc-dimm (except maybe the > > > > backwards compatibility thing)? > > > I think decision about using gaps and its size > > > should be done by board and not generic pc-dimm. > > > > > > > Well virtio is generic and can be used by all boards. > Still pc-dimm.addr is not allocation is not part of pc-dimm > device. it's just helper functions that happen to live in > the same file source file. > > But more importantly every target might have it's own > notion how it partitions hotplug address space so making > the same gap global might break them. > > It's safer to enable gaps per target, I think ppc guys > will make their own patch on top of this to taking > in account their target specific and compat stuff. I have never seen this issue that you mention at http://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00522.html in PowerPC. I have not been able to reproduce the QEMU crash with the commandline suggested there. (# ./ppc64-softmmu/qemu-system-ppc64 --enable-kvm --nographic -machine pseries -m 8G,slots=32,maxmem=32G -device virtio-blk-pci,drive=rootdisk -drive file=/home/bharata/F20-snap1,if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet:localhost:1235,server,nowait -vga none -bios /home/bharata/slof/slof.bin -smp 16,maxcpus=32 -netdev tap,id=foo,ifname=tap0,script=/home/bharata/qemu-ifup -device virtio-net-pci,id=n1,netdev=foo `for i in $(seq 0 15); do echo -n "-object memory-backend-ram,id=m$i,size=256M -device pc-dimm,id=dimm$i,memdev=m$i "; done` -snapshot) PowerPC sPAPR memory hotplug enforces memory alignment of 256MB for both boottime as well as hotplugged memory. So not sure if anything other than the default gap=0 which you have done in this patchset for PowerPC is necessary. Regards, Bharata.