On Tue, Feb 28, 2012 at 02:25:42PM +0200, Avi Kivity wrote: > [repost with pull info, brain not yet back up to speed] > > This is the current memory queue (posted as two separate series before > my vacation). When applied, the overhead of 16 bytes/page is reduced to > basically nil. > > Please pull from: > > git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/core >
This seems to make things worse for me: I used to see a crash with kvm when using a 64 bit BAR, now it crashes very early, and without kvm as well: #0 0x00007ffff5fc4155 in malloc_consolidate () from /lib64/libc.so.6 #1 0x00007ffff5fc71c2 in _int_malloc () from /lib64/libc.so.6 #2 0x00007ffff5fc85ed in malloc () from /lib64/libc.so.6 #3 0x00007ffff7e00496 in malloc_and_trace (n_bytes=8392) at /home/mst/scm/qemu/vl.c:2156 #4 0x00007ffff73e834e in ?? () from /lib64/libglib-2.0.so.0 #5 0x00007ffff73e8708 in g_malloc0 () from /lib64/libglib-2.0.so.0 #6 0x00007ffff7e88d52 in subpage_init (section=0x7fffffffd9a0) at /home/mst/scm/qemu/exec.c:3483 #7 register_subpage (section=0x7fffffffd9a0) at /home/mst/scm/qemu/exec.c:2643 #8 0x00007ffff7e88fa6 in cpu_register_physical_memory_log (section=<value optimized out>, readonly=<value optimized out>) at /home/mst/scm/qemu/exec.c:2680 #9 0x00007ffff7eb2d68 in address_space_update_topology_pass (as=0x7ffff8ae4b80, old_view=..., new_view=..., adding= true) at /home/mst/scm/qemu/memory.c:679 #10 0x00007ffff7eb4c66 in address_space_update_topology (as=0x7ffff8ae4b80) at /home/mst/scm/qemu/memory.c:708 #11 0x00007ffff7eb5444 in memory_region_update_topology (mr=<value optimized out>) at /home/mst/scm/qemu/memory.c:729 #12 0x00007ffff7dc98d7 in bmdma_setup_bar (dev=0x7ffff8d52500) at /home/mst/scm/qemu/hw/ide/piix.c:97 #13 pci_piix_ide_initfn (dev=0x7ffff8d52500) at /home/mst/scm/qemu/hw/ide/piix.c:157 #14 0x00007ffff7dd998e in pci_qdev_init (qdev=0x7ffff8d52500) at /home/mst/scm/qemu/hw/pci.c:1492 #15 0x00007ffff7e277ba in qdev_init (dev=0x7ffff8d52500) at /home/mst/scm/qemu/hw/qdev.c:150 #16 0x00007ffff7e2789d in qdev_init_nofail (dev=0x7ffff8d52500) at /home/mst/scm/qemu/hw/qdev.c:243 #17 0x00007ffff7dd8d88 in pci_create_simple_multifunction (bus=<value optimized out>, devfn=<value optimized out>, multifunction=<value optimized out>, name=<value optimized out>) at /home/mst/scm/qemu/hw/pci.c:1552 #18 0x00007ffff7dc9c2f in pci_piix3_ide_init (bus=<value optimized out>, hd_table=0x7fffffffdfd0, devfn=<value optimized out>) at /home/mst/scm/qemu/hw/ide/piix.c:224 #19 0x00007ffff7eeafb7 in pc_init1 (system_memory=0x7ffff8d0e6c0, system_io=0x7ffff8b61d40, ram_size=1073741824, boot_device=0x7fffffffe320 "cad", kernel_filename=<value optimized out>, kernel_cmdline=<value optimized out>, initrd_filename=0x0, cpu_model=0x0, pci_enabled=1, kvmclock_enabled=1) at /home/mst/scm/qemu/hw/pc_piix.c:257 #20 0x00007ffff7eeb368 in pc_init_pci (ram_size=1073741824, boot_device=0x7fffffffe320 "cad", kernel_filename=0x0, kernel_cmdline=0x7ffff7f669e5 "", initrd_filename=0x0, cpu_model=<value optimized out>) at /home/mst/scm/qemu/hw/pc_piix.c:319 #21 0x00007ffff7e01fb8 in main (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at /home/mst/scm/qemu/vl.c:3397 How to reproduce: qemu-system-x86_64 -m 1G -drive file=/home/mst/rhel6.qcow2 -netdev user,id=bar -net nic,netdev=bar,model=e1000,macaddr=52:54:00:12:34:57 -redir tcp:8022::22 -device pci-bridge,id=bog,chassis_nr=1 -netdev tap,id=foo,ifname=msttap0,script=/home/mst/ifup,downscript=no,vhost=on -nographic The code for this can be found here: git://github.com/mstsirkin/qemu.git pci If I set a 32 bit region - no issue, the last patch to trigger this is: bridge: make BAR 64 bit This crashes kvm. Donnu why. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> diff --git a/hw/pci_bridge_dev.c b/hw/pci_bridge_dev.c index 9a4102a..60d9528 100644 --- a/hw/pci_bridge_dev.c +++ b/hw/pci_bridge_dev.c @@ -66,7 +66,8 @@ static int pci_bridge_dev_initfn(PCIDevice *dev) } /* TODO: spec recommends using 64 bit prefetcheable BAR. * Check whether that works well. */ - pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &bridge_dev->bar); + pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY | + PCI_BASE_ADDRESS_MEM_TYPE_64, &bridge_dev->bar); dev->config[PCI_INTERRUPT_PIN] = 0x1; return 0; slotid_error: -- MST