From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgV9L-0007pW-Rc for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgV9G-0008Pr-NR for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:55:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgV9G-0008OB-HJ for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:55:06 -0400 From: Igor Mammedov Date: Mon, 28 Sep 2015 11:54:57 +0200 Message-Id: <1443434099-120581-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/2] pc: memhp: enforce gaps between DIMMs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, bharata@linux.vnet.ibm.com, ehabkost@redhat.com, david@gibson.dropbear.id.au, mst@redhat.com v2: make inter_dimm_gap a boolean and inster gap in 1 byte instead of 2Mb, due to alignment that gap would be extended up to natural backend alignment value. it's a simplier way suggested by Michael S. Tsirkin to workaround virtio bug reported earlier: http://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00522.html where virtio can't handle buffer that crosses border between 2 DIMM's (i.e. 2 MemoryRegions). idea is to leave gaps between DIMMs, making their GPAs non contiguous, which effectively forces kmalloc to not use DIMM if buffer doesn't fit inside of it. Simpler reproducer: qemu-system-x86_64 -enable-kvm -m 256,slots=250,maxmem=32G -drive if=virtio,file=/dev/slow/rhel72 \ `for i in $(seq 0 58); do echo -n "-object memory-backend-ram,id=m$i,size=10M -device pc-dimm,id=dimm$i,memdev=m$i "; done` \ -nodefaults -snapshot -serial stdio -nographic -M pc-i440fx-2.4 if guest manages to boot just login and do: dd if=/dev/vda of=/dev/null bs=128M it will crash QEMU in 99% cases with following message: qemu-system-x86_64: virtio: error trying to map MMIO memory Igor Mammedov (2): memhp: extend address auto assignment to support gaps pc: memhp: force gaps between DIMM's GPA hw/i386/pc.c | 4 +++- hw/i386/pc_piix.c | 3 +++ hw/i386/pc_q35.c | 3 +++ hw/mem/pc-dimm.c | 13 +++++++------ hw/ppc/spapr.c | 2 +- include/hw/i386/pc.h | 1 + include/hw/mem/pc-dimm.h | 7 ++++--- 7 files changed, 22 insertions(+), 11 deletions(-) -- 1.8.3.1