]> xenbits.xensource.com Git - qemu-xen-3.4-testing.git/commit
passthrough: fix segmentation fault after hotplug pass-through device master xen-3.4.3 xen-3.4.3-rc6 xen-3.4.3-rc7
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>
Wed, 14 Apr 2010 14:34:59 +0000 (15:34 +0100)
commit62539a7d5974cdc0a448d469cda458761940cd33
treeef1b53251938d5261f5a326809234afebcca8e6a
parent1e704908329b9cfc9fd653b977671629cfab22a8
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