]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commit
passthrough: fix segmentation fault after hotplug pass-through device
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>
Fri, 21 May 2010 16:31:50 +0000 (17:31 +0100)
commit883b932b33400ef3c44a8ae3b74b540810a466ae
tree3466d845c61414f88d633e522745134f6061fc4c
parentaf9f14a8e30ac6b9805932e8bcb84b8fb6a051c7
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>
(cherry picked from commit b5160622517fb2d16d0836172a2e34633c9d94bf)
hw/pt-msi.c
i386-dm/exec-dm.c