]> xenbits.xensource.com Git - qemu-xen-3.4-testing.git/commit
passthrough: fix segmentation fault after hotplug pass-through device xen-3.4.3-rc5-broken
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 13 Apr 2010 11:07:33 +0000 (12:07 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 13 Apr 2010 11:07:33 +0000 (12:07 +0100)
commitb5160622517fb2d16d0836172a2e34633c9d94bf
tree3466d845c61414f88d633e522745134f6061fc4c
parent7b4b8f46343223f67d952f6284d65de4d79e40f0
passthrough: fix segmentation fault after hotplug pass-through device

This patch fixed the QEMU segmentation fault after hotplug
pass-through devices with MSI-X for many times.

There is a wrong boundary check in cpu_register_io_memory that uses
io_index rather than io_mem_nb. After many times of hotplug of MSI-X
pass-through device, io_mem_read[] got extended to overwrite mmio_cnt,
then cause QEMU segmentation fault.

This fix sync with upstream QEMU code in exec.c, and free unused
io_mem_XXX element after hot removal.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
hw/pt-msi.c
i386-dm/exec-dm.c