diff --git a/21129-xen-hotplug-cleanup.patch b/21129-xen-hotplug-cleanup.patch new file mode 100644 index 0000000..9162685 --- /dev/null +++ b/21129-xen-hotplug-cleanup.patch @@ -0,0 +1,22 @@ +# HG changeset patch +# User Keir Fraser +# Date 1271053401 -3600 +# Node ID bf74d9c31674c9001a7c4aa8d93227552edf53b1 +# Parent b5f9c6274d917db5bbe6cb9cc0d59910cc07a8a6 +blktap2: a little fix to xen-hotplug-cleanup + +Signed-off-by: James (Song Wei) + +Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup +=================================================================== +--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-hotplug-cleanup ++++ xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup +@@ -21,7 +21,7 @@ if [ "$vm" != "" ]; then + + # if the vm path does not exist and the device class is 'vbd' then we may have + # a tap2 device +- if [ $(xenstore-read "$vm_dev" 2>/dev/null) != "" ] \ ++ if [ "$(xenstore-read "$vm_dev" 2>/dev/null)" != "" ] \ + && [ "${path_array[1]}" = "vbd" ]; then + vm_dev="$vm/device/tap2/${path_array[3]}" + fi diff --git a/passthrough-hotplug-segfault.patch b/passthrough-hotplug-segfault.patch new file mode 100644 index 0000000..818bc25 --- /dev/null +++ b/passthrough-hotplug-segfault.patch @@ -0,0 +1,90 @@ + +Subject: passthrough: fix segmentation fault after hotplug pass-through device +From: Ian Jackson ian.jackson@eu.citrix.com Tue Apr 13 12:07:33 2010 +0100 +Date: Tue Apr 13 12:07:33 2010 +0100: +Git: b5160622517fb2d16d0836172a2e34633c9d94bf + +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 + +Index: xen-4.0.0-testing/tools/ioemu-remote/hw/pt-msi.c +=================================================================== +--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/pt-msi.c ++++ xen-4.0.0-testing/tools/ioemu-remote/hw/pt-msi.c +@@ -623,5 +623,11 @@ void pt_msix_delete(struct pt_dev *dev) + dev->msix->table_offset_adjust); + } + ++ if (dev->msix->mmio_index > 0) ++ { ++ cpu_unregister_io_memory(dev->msix->mmio_index); ++ } ++ ++ + free(dev->msix); + } +Index: xen-4.0.0-testing/tools/ioemu-remote/i386-dm/exec-dm.c +=================================================================== +--- xen-4.0.0-testing.orig/tools/ioemu-remote/i386-dm/exec-dm.c ++++ xen-4.0.0-testing/tools/ioemu-remote/i386-dm/exec-dm.c +@@ -125,7 +125,7 @@ unsigned long qemu_host_page_mask; + CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4]; + CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4]; + void *io_mem_opaque[IO_MEM_NB_ENTRIES]; +-static int io_mem_nb = 1; ++char io_mem_used[IO_MEM_NB_ENTRIES]; + + /* log support */ + FILE *logfile; +@@ -310,6 +310,20 @@ void cpu_register_physical_memory(target + mmio[mmio_cnt++].size = size; + } + ++static int get_free_io_mem_idx(void) ++{ ++ int i; ++ ++ /* Leave 1st element empty */ ++ for (i = 1; i= IO_MEM_NB_ENTRIES) +- return -1; +- io_index = io_mem_nb++; ++ io_index = get_free_io_mem_idx(); ++ if (io_index == -1) ++ return io_index; + } else { + if (io_index >= IO_MEM_NB_ENTRIES) + return -1; +@@ -357,6 +371,7 @@ void cpu_unregister_io_memory(int io_tab + io_mem_write[io_index][i] = NULL; + } + io_mem_opaque[io_index] = NULL; ++ io_mem_used[io_index] = 0; + } + + void cpu_physical_memory_set_dirty(ram_addr_t addr) diff --git a/xen.changes b/xen.changes index 20fdecf..31c622b 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed May 12 08:43:20 MDT 2010 - carnold@novell.com + +- bnc#605182 - /etc/xen/scripts/xen-hotplug-cleanup: line 24: [: + !=: unary operator expected + 21129-xen-hotplug-cleanup.patch + +------------------------------------------------------------------- +Mon May 10 10:26:07 MDT 2010 - carnold@novell.com + +- bnc#599929 - Hot add/remove Kawela NIC device over 500 times will + cause guest domain crash + passthrough-hotplug-segfault.patch + ------------------------------------------------------------------- Fri May 7 09:00:12 MDT 2010 - jfehlig@novell.com diff --git a/xen.spec b/xen.spec index 13bddcc..24b917e 100644 --- a/xen.spec +++ b/xen.spec @@ -77,21 +77,23 @@ Source25: xen-updown.sh Patch0: 21089-x86-startup-irq-from-setup-gsi.patch Patch1: 21109-x86-cpu-hotplug.patch Patch2: 21128-domain-save-flush.patch -Patch3: 21150-shadow-race.patch -Patch4: 21160-sysctl-debug-keys.patch -Patch5: 21189-x86-emulate-clflush.patch -Patch6: 21193-blktap-script.patch -Patch7: 21194-ioemu-subtype.patch -Patch8: 21223-xend-preserve-devs.patch -Patch9: 21225-conring-iommu.patch -Patch10: 21234-x86-bad-srat-clear-pxm2node.patch -Patch11: 21235-crashkernel-advanced.patch -Patch12: 21266-vmx-disabled-check.patch -Patch13: 21271-x86-cache-flush-global.patch -Patch14: 21272-x86-dom0-alloc-performance.patch -Patch15: 21301-svm-lmsl.patch -Patch16: 21304-keyhandler-alternative.patch -Patch17: 21317-xend-blkif-util-tap2.patch +Patch3: 21129-xen-hotplug-cleanup.patch +Patch4: 21150-shadow-race.patch +Patch5: 21160-sysctl-debug-keys.patch +Patch6: 21189-x86-emulate-clflush.patch +Patch7: 21193-blktap-script.patch +Patch8: 21194-ioemu-subtype.patch +Patch9: 21223-xend-preserve-devs.patch +Patch10: 21225-conring-iommu.patch +Patch11: 21234-x86-bad-srat-clear-pxm2node.patch +Patch12: 21235-crashkernel-advanced.patch +Patch13: 21266-vmx-disabled-check.patch +Patch14: 21271-x86-cache-flush-global.patch +Patch15: 21272-x86-dom0-alloc-performance.patch +Patch16: 21301-svm-lmsl.patch +Patch17: 21304-keyhandler-alternative.patch +Patch18: 21317-xend-blkif-util-tap2.patch +Patch19: passthrough-hotplug-segfault.patch # Our patches Patch300: xen-config.diff Patch301: xend-config.diff @@ -550,6 +552,8 @@ Authors: %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 +%patch19 -p1 %patch300 -p1 %patch301 -p1 %patch302 -p1