From 44f192f364b71683379e104157b15b0685d24394 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Wed, 13 May 2015 13:15:28 +0000 Subject: [PATCH 01/30] iscsi: Remove pointless runtime check of macro value raw_bsd already has QEMU_BUILD_BUG_ON(BDRV_SECTOR_SIZE != 512), so iscsi should relax. Signed-off-by: Fam Zheng Signed-off-by: Michael Tokarev --- block/iscsi.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index 8fca1d32cb..14e97a6b48 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1323,13 +1323,6 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, const char *filename; int i, ret = 0; - if ((BDRV_SECTOR_SIZE % 512) != 0) { - error_setg(errp, "iSCSI: Invalid BDRV_SECTOR_SIZE. " - "BDRV_SECTOR_SIZE(%lld) is not a multiple " - "of 512", BDRV_SECTOR_SIZE); - return -EINVAL; - } - opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, options, &local_err); if (local_err) { From a2f533da00f7278788afcf10f325f636805077dc Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 14 May 2015 22:33:39 -0700 Subject: [PATCH 02/30] microblaze: cpu: Delete MMAP_SHIFT definition Just fallback on the default of 12 like other architectures. This allows changing the system-mode-affecting definition of TARGET_PAGE_BITS without affecting microblaze linux-user. Signed-off-by: Peter Crosthwaite Reviewed-by: Edgar E. Iglesias Signed-off-by: Michael Tokarev --- target-microblaze/cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index 4ea04acc4d..d73e1c7286 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -285,7 +285,6 @@ int cpu_mb_signal_handler(int host_signum, void *pinfo, /* FIXME: MB uses variable pages down to 1K but linux only uses 4k. */ #define TARGET_PAGE_BITS 12 -#define MMAP_SHIFT TARGET_PAGE_BITS #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 From b8981dc9aae25fa79e5f35609e63f50f078a572d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 15 May 2015 11:31:43 +0200 Subject: [PATCH 03/30] util: socket: Add missing localaddr and localport option for DGRAM socket The 'socket_optslist' structure does not contain the 'localaddr' and 'localport' options that are parsed in case you are creating a 'connect' type UDP character device. I've noticed it happening after commit f43e47dbf6de24db20ec9b588bb6cc762 made qemu abort() after seeing the invalid option. A minimal reproducer for the case is: $ qemu-system-x86_64 -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234 qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr' Aborted (core dumped) Prior to the commit mentioned above the error would be printed but the value for localaddr and localport was simply ignored. I did not go through the code to find out when it was broken. Add the two fields so that the options can again be parsed correctly and qemu doesn't abort(). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1220252 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- util/qemu-sockets.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 22c8c4c5d5..f9ad34e40c 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -44,6 +44,12 @@ QemuOptsList socket_optslist = { },{ .name = "port", .type = QEMU_OPT_STRING, + },{ + .name = "localaddr", + .type = QEMU_OPT_STRING, + },{ + .name = "localport", + .type = QEMU_OPT_STRING, },{ .name = "to", .type = QEMU_OPT_NUMBER, From 5708b2b736ebec6e3af04b9b249faadf896791cd Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Tue, 26 May 2015 05:25:41 -0400 Subject: [PATCH 04/30] docs/writing-qmp-commands: fix a typo s/interation/iteration Signed-off-by: Chen Hanxiao Signed-off-by: Michael Tokarev --- docs/writing-qmp-commands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-qmp-commands.txt b/docs/writing-qmp-commands.txt index f3df2066a4..ab1fdd36b4 100644 --- a/docs/writing-qmp-commands.txt +++ b/docs/writing-qmp-commands.txt @@ -598,7 +598,7 @@ stored in its "value" member. In our example, the "value" member is a pointer to an TimerAlarmMethod instance. Notice that the "current" variable is used as "true" only in the first -interation of the loop. That's because the alarm timer method in use is the +iteration of the loop. That's because the alarm timer method in use is the first element of the alarm_timers array. Also notice that QAPI lists are handled by hand and we return the head of the list. From 2ba154cf4eb8636cdd3aa90f392ca9e77206ca39 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Tue, 26 May 2015 09:46:05 +0800 Subject: [PATCH 05/30] hw/i386/pc_piix: Fix memory leak valgrind complains about: ==16447== 8 bytes in 1 blocks are definitely lost in loss record 552 of 3,310 ==16447== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16447== by 0x36FB47: qemu_extend_irqs (irq.c:55) ==16447== by 0x36FBD3: qemu_allocate_irqs (irq.c:64) ==16447== by 0x24E622: pc_init1 (pc_piix.c:287) ==16447== by 0x24E76A: pc_init_pci (pc_piix.c:310) ==16447== by 0x2E9360: main (vl.c:4226) ==16447== 128 bytes in 1 blocks are definitely lost in loss record 2,569 of 3,310 ==16447== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16447== by 0x36FB47: qemu_extend_irqs (irq.c:55) ==16447== by 0x36FBD3: qemu_allocate_irqs (irq.c:64) ==16447== by 0x25BEB2: kvm_i8259_init (i8259.c:133) ==16447== by 0x24E1F1: pc_init1 (pc_piix.c:219) ==16447== by 0x24E76A: pc_init_pci (pc_piix.c:310) ==16447== by 0x2E9360: main (vl.c:4226) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Marcel Apfelbaum Signed-off-by: Michael Tokarev --- hw/i386/pc_piix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 6e7fa424b1..8d949a3ac5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -89,7 +89,7 @@ static void pc_init1(MachineState *machine) qemu_irq *cpu_irq; qemu_irq *gsi; qemu_irq *i8259; - qemu_irq *smi_irq; + qemu_irq smi_irq; GSIState *gsi_state; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BusState *idebus[MAX_IDE_BUS]; @@ -227,6 +227,7 @@ static void pc_init1(MachineState *machine) for (i = 0; i < ISA_NUM_IRQS; i++) { gsi_state->i8259_irq[i] = i8259[i]; } + g_free(i8259); if (pci_enabled) { ioapic_init_gsi(gsi_state, "i440fx"); } @@ -284,10 +285,10 @@ static void pc_init1(MachineState *machine) DeviceState *piix4_pm; I2CBus *smbus; - smi_irq = qemu_allocate_irqs(pc_acpi_smi_interrupt, first_cpu, 1); + smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); /* TODO: Populate SPD eeprom data. */ smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, - gsi[9], *smi_irq, + gsi[9], smi_irq, kvm_enabled(), fw_cfg, &piix4_pm); smbus_eeprom_init(smbus, 8, NULL, 0); From 6e38a4ba7889083b65729db2144cdbcefbaa303a Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Tue, 26 May 2015 09:46:06 +0800 Subject: [PATCH 06/30] hw/ide/pci: Fix memory leak valgrind complains about: ==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of 3,310 ==16447== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16447== by 0x36FB47: qemu_extend_irqs (irq.c:55) ==16447== by 0x36FBD3: qemu_allocate_irqs (irq.c:64) ==16447== by 0x3B4B44: bmdma_init (pci.c:464) ==16447== by 0x3B547B: pci_piix_init_ports (piix.c:144) ==16447== by 0x3B55D2: pci_piix_ide_realize (piix.c:164) ==16447== by 0x3EAEC6: pci_qdev_realize (pci.c:1790) ==16447== by 0x36C685: device_set_realized (qdev.c:1058) ==16447== by 0x47179E: property_set_bool (object.c:1514) ==16447== by 0x470098: object_property_set (object.c:837) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Marcel Apfelbaum Signed-off-by: Michael Tokarev --- hw/ide/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 1b3d1c12ad..4b5e32dcbe 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -452,8 +452,6 @@ static const struct IDEDMAOps bmdma_ops = { void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) { - qemu_irq *irq; - if (bus->dma == &bm->dma) { return; } @@ -461,8 +459,7 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) bm->dma.ops = &bmdma_ops; bus->dma = &bm->dma; bm->irq = bus->irq; - irq = qemu_allocate_irqs(bmdma_irq, bm, 1); - bus->irq = *irq; + bus->irq = qemu_allocate_irq(bmdma_irq, bm, 0); bm->pci_dev = d; } From d370dfa9f3703cf0af07d96d50ed567413e8ec65 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Tue, 26 May 2015 09:46:07 +0800 Subject: [PATCH 07/30] hw/i386/acpi-build: decref after use valgrind complains about: ==16447== 48 bytes in 2 blocks are definitely lost in loss record 2,033 of 3,310 ==16447== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16447== by 0x53EC3F: qint_from_int (qint.c:33) ==16447== by 0x53B426: qmp_output_type_int (qmp-output-visitor.c:162) ==16447== by 0x539257: visit_type_uint32 (qapi-visit-core.c:147) ==16447== by 0x471D07: property_get_uint32_ptr (object.c:1651) ==16447== by 0x47000C: object_property_get (object.c:822) ==16447== by 0x472428: object_property_get_qobject (qom-qobject.c:37) ==16447== by 0x25701A: build_append_pci_bus_devices (acpi-build.c:520) ==16447== by 0x25902E: build_ssdt (acpi-build.c:1004) ==16447== by 0x25A0A8: acpi_build (acpi-build.c:1420) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Michael Tokarev --- hw/i386/acpi-build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2c7399b9db..15fd4c551e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -596,6 +596,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, } } aml_append(parent_scope, method); + qobject_decref(bsel); } static void From 7df057bac3734ee3c2c052fd0807479602ab5583 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Sun, 24 May 2015 13:20:14 -0700 Subject: [PATCH 08/30] device-tree: Make a common-obj MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no reason for device tree API to be built per-target. common-obj it. There is an extraneous inclusion of config.h that needs to be removed. Cc: Alexander Graf Reviewed-by: Andreas Färber Signed-off-by: Peter Crosthwaite Signed-off-by: Michael Tokarev --- Makefile.objs | 2 ++ Makefile.target | 1 - device_tree.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 28999d39c4..4881d2c2a6 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -76,6 +76,8 @@ common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) +common-obj-$(CONFIG_FDT) += device_tree.o + ###################################################################### # qapi diff --git a/Makefile.target b/Makefile.target index be01dd39c1..3e861c8413 100644 --- a/Makefile.target +++ b/Makefile.target @@ -129,7 +129,6 @@ ifdef CONFIG_SOFTMMU obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o obj-y += qtest.o bootdevice.o obj-y += hw/ -obj-$(CONFIG_FDT) += device_tree.o obj-$(CONFIG_KVM) += kvm-all.o obj-y += memory.o savevm.o cputlb.o obj-y += memory_mapping.o diff --git a/device_tree.c b/device_tree.c index 3d119ef0bd..d2de580947 100644 --- a/device_tree.c +++ b/device_tree.c @@ -18,7 +18,6 @@ #include #include -#include "config.h" #include "qemu-common.h" #include "qemu/error-report.h" #include "sysemu/device_tree.h" From bd4baf6eebff75c7e0c67a729d1bdb5b0b36fe72 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Mon, 25 May 2015 14:47:25 +0800 Subject: [PATCH 09/30] vl: fix memory leak spotted by valgrind valgrind complains about: ==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673 ==9276== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556) ==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==9276== by 0x4A28BD: addr_to_string (vnc.c:123) ==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139) ==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240) ==9276== by 0x2EF4FE: main (vl.c:4321) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- vl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 1d4c0890f2..3893c84594 100644 --- a/vl.c +++ b/vl.c @@ -4312,8 +4312,9 @@ int main(int argc, char **argv, char **envp) /* init remote displays */ qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, 0); if (show_vnc_port) { - printf("VNC server running on `%s'\n", - vnc_display_local_addr("default")); + char *ret = vnc_display_local_addr("default"); + printf("VNC server running on `%s'\n", ret); + g_free(ret); } #endif #ifdef CONFIG_SPICE From c18f855697ab6b64a895f37cf47fd7061ce9e798 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Thu, 28 May 2015 20:39:42 +0800 Subject: [PATCH 10/30] hw/alpha/dp264.c: Fix memory leak spotted by valgrind valgrind complains about: ==7055== 58 bytes in 1 blocks are definitely lost in loss record 1,471 of 2,192 ==7055== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7055== by 0x24410F: malloc_and_trace (vl.c:2556) ==7055== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x64DEFD7: g_strndup (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x650181A: g_vasprintf (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x64DF0CC: g_strdup_vprintf (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x64DF188: g_strdup_printf (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x242F81: qemu_find_file (vl.c:2121) ==7055== by 0x217A32: clipper_init (dp264.c:105) ==7055== by 0x2484DA: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/alpha/dp264.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 9fe7e8b5cb..f86e7bb830 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -55,7 +55,7 @@ static void clipper_init(MachineState *machine) ISABus *isa_bus; qemu_irq rtc_irq; long size, i; - const char *palcode_filename; + char *palcode_filename; uint64_t palcode_entry, palcode_low, palcode_high; uint64_t kernel_entry, kernel_low, kernel_high; @@ -101,8 +101,8 @@ static void clipper_init(MachineState *machine) /* Load PALcode. Given that this is not "real" cpu palcode, but one explicitly written for the emulation, we might as well load it directly from and ELF image. */ - palcode_filename = (bios_name ? bios_name : "palcode-clipper"); - palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, palcode_filename); + palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, + bios_name ? bios_name : "palcode-clipper"); if (palcode_filename == NULL) { hw_error("no palcode provided\n"); exit(1); @@ -114,6 +114,7 @@ static void clipper_init(MachineState *machine) hw_error("could not load palcode '%s'\n", palcode_filename); exit(1); } + g_free(palcode_filename); /* Start all cpus at the PALcode RESET entry point. */ for (i = 0; i < smp_cpus; ++i) { From f19377bf234a3359b0a03844822e97de80ad4f30 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Thu, 28 May 2015 20:39:43 +0800 Subject: [PATCH 11/30] hw/ppc/e500.c: Fix memory leak Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/ppc/e500.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index c10e1b57b6..d300846c3d 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -1030,6 +1030,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) exit(1); } } + g_free(filename); /* Reserve space for dtb */ dt_base = (loadaddr + bios_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK; From 9f9b026dc60398224fb035eb27ae0ed083d2d66f Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:38:34 +0800 Subject: [PATCH 12/30] hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/arm/omap_sx1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 671e02c4ed..4b0f7f9c42 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -103,7 +103,6 @@ static void sx1_init(MachineState *machine, const int version) struct omap_mpu_state_s *mpu; MemoryRegion *address_space = get_system_memory(); MemoryRegion *flash = g_new(MemoryRegion, 1); - MemoryRegion *flash_1 = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); static uint32_t cs0val = 0x00213090; static uint32_t cs1val = 0x00215070; @@ -165,6 +164,7 @@ static void sx1_init(MachineState *machine, const int version) if ((version == 1) && (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { + MemoryRegion *flash_1 = g_new(MemoryRegion, 1); memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0", flash1_size, &error_abort); vmstate_register_ram_global(flash_1); From 9ff7f5bddbe5814bafe5e798d2cf1087b58dc7b6 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:03 +0800 Subject: [PATCH 13/30] hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/intc/exynos4210_gic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index 0590d5dfb8..b2a4950bc3 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -213,9 +213,6 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s) uint32_t grp, bit, irq_id, n; for (n = 0; n < EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ; n++) { - s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], - s->ext_combiner_irq[n]); - irq_id = 0; if (n == EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 4) || n == EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 4)) { @@ -230,8 +227,10 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s) if (irq_id) { s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], s->ext_gic_irq[irq_id-32]); + } else { + s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], + s->ext_combiner_irq[n]); } - } for (; n < EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; n++) { /* these IDs are passed to Internal Combiner and External GIC */ From 0b0cc076b78976b30360dd7c6ed994f864424779 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:26:59 +0800 Subject: [PATCH 14/30] hw/i386/pc: Fix misusing qemu_allocate_irqs for single irq Since pc_allocate_cpu_irq only requests one irq, so let it just call qemu_allocate_irq. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/i386/pc.c | 4 ++-- hw/i386/pc_piix.c | 4 +--- hw/i386/pc_q35.c | 4 +--- include/hw/i386/pc.h | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1eb1db0372..886151bde4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1345,9 +1345,9 @@ FWCfgState *pc_memory_init(MachineState *machine, return fw_cfg; } -qemu_irq *pc_allocate_cpu_irq(void) +qemu_irq pc_allocate_cpu_irq(void) { - return qemu_allocate_irqs(pic_irq_request, NULL, 1); + return qemu_allocate_irq(pic_irq_request, NULL, 0); } DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 8d949a3ac5..768b09be3b 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -86,7 +86,6 @@ static void pc_init1(MachineState *machine) ISABus *isa_bus; PCII440FXState *i440fx_state; int piix3_devfn = -1; - qemu_irq *cpu_irq; qemu_irq *gsi; qemu_irq *i8259; qemu_irq smi_irq; @@ -220,8 +219,7 @@ static void pc_init1(MachineState *machine) } else if (xen_enabled()) { i8259 = xen_interrupt_controller_init(); } else { - cpu_irq = pc_allocate_cpu_irq(); - i8259 = i8259_init(isa_bus, cpu_irq[0]); + i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); } for (i = 0; i < ISA_NUM_IRQS; i++) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 66220b352b..110dfb78a8 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -79,7 +79,6 @@ static void pc_q35_init(MachineState *machine) GSIState *gsi_state; ISABus *isa_bus; int pci_enabled = 1; - qemu_irq *cpu_irq; qemu_irq *gsi; qemu_irq *i8259; int i; @@ -230,8 +229,7 @@ static void pc_q35_init(MachineState *machine) } else if (xen_enabled()) { i8259 = xen_interrupt_controller_init(); } else { - cpu_irq = pc_allocate_cpu_irq(); - i8259 = i8259_init(isa_bus, cpu_irq[0]); + i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); } for (i = 0; i < ISA_NUM_IRQS; i++) { diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 27bd748eab..261155fe1a 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -193,7 +193,7 @@ FWCfgState *pc_memory_init(MachineState *machine, MemoryRegion *rom_memory, MemoryRegion **ram_memory, PcGuestInfo *guest_info); -qemu_irq *pc_allocate_cpu_irq(void); +qemu_irq pc_allocate_cpu_irq(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, From aff0d5e57a71260885d54c07cef5f4a486c8336b Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:00 +0800 Subject: [PATCH 15/30] hw/isa/lpc_ich9.c: Fix misusing qemu_allocate_irqs for single irq Since ich9_lpc_pm_init only requests one irq, so let it just call qemu_allocate_irq. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/isa/lpc_ich9.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index dba758595f..144b210081 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -360,11 +360,8 @@ static void ich9_set_sci(void *opaque, int irq_num, int level) void ich9_lpc_pm_init(PCIDevice *lpc_pci) { ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci); - qemu_irq *sci_irq; - - sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1); - ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0]); + ich9_pm_init(lpc_pci, &lpc->pm, qemu_allocate_irq(ich9_set_sci, lpc, 0)); ich9_lpc_reset(&lpc->d.qdev); } From 5105505e65ba6bc3e1dc549bcd0d1d33f3546e60 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:01 +0800 Subject: [PATCH 16/30] hw/isa/i82378.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/isa/i82378.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 9da9dfc4da..fcf97d86ac 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -65,7 +65,6 @@ static void i82378_realize(PCIDevice *pci, Error **errp) uint8_t *pci_conf; ISABus *isabus; ISADevice *isa; - qemu_irq *out0_irq; pci_conf = pci->config; pci_set_word(pci_conf + PCI_COMMAND, @@ -88,11 +87,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) All devices accept byte access only, except timer */ - /* Workaround the fact that i8259 is not qdev'ified... */ - out0_irq = qemu_allocate_irqs(i82378_request_out0_irq, s, 1); - /* 2 82C59 (irq) */ - s->i8259 = i8259_init(isabus, *out0_irq); + s->i8259 = i8259_init(isabus, + qemu_allocate_irq(i82378_request_out0_irq, s, 0)); isa_bus_irqs(isabus, s->i8259); /* 1 82C54 (pit) */ From b64127244d669c33a4ffdcc47e076559497785af Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:02 +0800 Subject: [PATCH 17/30] hw/timer/arm_timer.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/timer/arm_timer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 145291016b..d53f39ad62 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -280,14 +280,12 @@ static int sp804_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); SP804State *s = SP804(dev); - qemu_irq *qi; - qi = qemu_allocate_irqs(sp804_set_irq, s, 2); sysbus_init_irq(sbd, &s->irq); s->timer[0] = arm_timer_init(s->freq0); s->timer[1] = arm_timer_init(s->freq1); - s->timer[0]->irq = qi[0]; - s->timer[1]->irq = qi[1]; + s->timer[0]->irq = qemu_allocate_irq(sp804_set_irq, s, 0); + s->timer[1]->irq = qemu_allocate_irq(sp804_set_irq, s, 1); memory_region_init_io(&s->iomem, OBJECT(s), &sp804_ops, s, "sp804", 0x1000); sysbus_init_mmio(sbd, &s->iomem); From ca43b97b5f6fa57e79adc7f167b12d3e0545c7e1 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:04 +0800 Subject: [PATCH 18/30] hw/sparc/sun4m.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/sparc/sun4m.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index a69bf2da45..8a3599c403 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -897,7 +897,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, espdma_irq, ledma_irq; qemu_irq esp_reset, dma_enable; qemu_irq fdc_tc; - qemu_irq *cpu_halt; unsigned long kernel_size; DriveInfo *fd[MAX_FD]; FWCfgState *fw_cfg; @@ -1024,9 +1023,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, escc_init(hwdef->serial_base, slavio_irq[15], slavio_irq[15], serial_hds[0], serial_hds[1], ESCC_CLOCK, 1); - cpu_halt = qemu_allocate_irqs(cpu_halt_signal, NULL, 1); if (hwdef->apc_base) { - apc_init(hwdef->apc_base, cpu_halt[0]); + apc_init(hwdef->apc_base, qemu_allocate_irq(cpu_halt_signal, NULL, 0)); } if (hwdef->fd_base) { @@ -1036,7 +1034,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, sun4m_fdctrl_init(slavio_irq[22], hwdef->fd_base, fd, &fdc_tc); } else { - fdc_tc = *qemu_allocate_irqs(dummy_fdc_tc, NULL, 1); + fdc_tc = qemu_allocate_irq(dummy_fdc_tc, NULL, 0); } slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_base, From aaaee0b273082ee2836dcc2f61a878ee291a8d9b Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:05 +0800 Subject: [PATCH 19/30] hw/ppc/prep.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/ppc/prep.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 7f52662d76..998ee2d16b 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -528,7 +528,6 @@ static void ppc_prep_init(MachineState *machine) PCIDevice *pci; ISABus *isa_bus; ISADevice *isa; - qemu_irq *cpu_exit_irq; int ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; @@ -625,11 +624,11 @@ static void ppc_prep_init(MachineState *machine) /* PCI -> ISA bridge */ pci = pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "i82378"); - cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1); cpu = POWERPC_CPU(first_cpu); qdev_connect_gpio_out(&pci->qdev, 0, cpu->env.irq_inputs[PPC6xx_INPUT_INT]); - qdev_connect_gpio_out(&pci->qdev, 1, *cpu_exit_irq); + qdev_connect_gpio_out(&pci->qdev, 1, + qemu_allocate_irq(cpu_request_exit, NULL, 0)); sysbus_connect_irq(&pcihost->busdev, 0, qdev_get_gpio_in(&pci->qdev, 9)); sysbus_connect_irq(&pcihost->busdev, 1, qdev_get_gpio_in(&pci->qdev, 11)); sysbus_connect_irq(&pcihost->busdev, 2, qdev_get_gpio_in(&pci->qdev, 9)); From d4ef00af2598fef06affbd42608e570237a7b276 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:06 +0800 Subject: [PATCH 20/30] hw/lm32/lm32_boards.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/lm32/lm32_boards.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 14d0efcdd9..70f48d3b1d 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -78,7 +78,7 @@ static void lm32_evr_init(MachineState *machine) DriveInfo *dinfo; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *phys_ram = g_new(MemoryRegion, 1); - qemu_irq *cpu_irq, irq[32]; + qemu_irq irq[32]; ResetInfo *reset_info; int i; @@ -123,8 +123,7 @@ static void lm32_evr_init(MachineState *machine) 1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1); /* create irq lines */ - cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1); - env->pic_state = lm32_pic_init(*cpu_irq); + env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, cpu, 0)); for (i = 0; i < 32; i++) { irq[i] = qdev_get_gpio_in(env->pic_state, i); } @@ -173,7 +172,7 @@ static void lm32_uclinux_init(MachineState *machine) DriveInfo *dinfo; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *phys_ram = g_new(MemoryRegion, 1); - qemu_irq *cpu_irq, irq[32]; + qemu_irq irq[32]; HWSetup *hw; ResetInfo *reset_info; int i; @@ -225,8 +224,7 @@ static void lm32_uclinux_init(MachineState *machine) 1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1); /* create irq lines */ - cpu_irq = qemu_allocate_irqs(cpu_irq_handler, env, 1); - env->pic_state = lm32_pic_init(*cpu_irq); + env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, env, 0)); for (i = 0; i < 32; i++) { irq[i] = qdev_get_gpio_in(env->pic_state, i); } From a9c8a0d8d4217754648decc5921e4b0fcd00ce7f Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:07 +0800 Subject: [PATCH 21/30] hw/lm32/milkymist.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/lm32/milkymist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index e0cec7dc41..e755f5b24f 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -86,7 +86,7 @@ milkymist_init(MachineState *machine) DriveInfo *dinfo; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *phys_sdram = g_new(MemoryRegion, 1); - qemu_irq irq[32], *cpu_irq; + qemu_irq irq[32]; int i; char *bios_filename; ResetInfo *reset_info; @@ -130,8 +130,7 @@ milkymist_init(MachineState *machine) 2, 0x00, 0x89, 0x00, 0x1d, 1); /* create irq lines */ - cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1); - env->pic_state = lm32_pic_init(*cpu_irq); + env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, cpu, 0)); for (i = 0; i < 32; i++) { irq[i] = qdev_get_gpio_in(env->pic_state, i); } From 2c85fad022a5c23b835d7c78b653763ae1e3f6eb Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:08 +0800 Subject: [PATCH 22/30] hw/unicore32/puv3.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/unicore32/puv3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index cc9a21a712..703e29d6d3 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -40,15 +40,15 @@ static void puv3_intc_cpu_handler(void *opaque, int irq, int level) static void puv3_soc_init(CPUUniCore32State *env) { - qemu_irq *cpu_intc, irqs[PUV3_IRQS_NR]; + qemu_irq cpu_intc, irqs[PUV3_IRQS_NR]; DeviceState *dev; MemoryRegion *i8042 = g_new(MemoryRegion, 1); int i; /* Initialize interrupt controller */ - cpu_intc = qemu_allocate_irqs(puv3_intc_cpu_handler, - uc32_env_get_cpu(env), 1); - dev = sysbus_create_simple("puv3_intc", PUV3_INTC_BASE, *cpu_intc); + cpu_intc = qemu_allocate_irq(puv3_intc_cpu_handler, + uc32_env_get_cpu(env), 0); + dev = sysbus_create_simple("puv3_intc", PUV3_INTC_BASE, cpu_intc); for (i = 0; i < PUV3_IRQS_NR; i++) { irqs[i] = qdev_get_gpio_in(dev, i); } From 5429273615e7b412402a7b22738737c09ab9f488 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:09 +0800 Subject: [PATCH 23/30] hw/alpha/typhoon.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/alpha/typhoon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 7df842dff7..421162e1d4 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -841,7 +841,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, } } - *p_rtc_irq = *qemu_allocate_irqs(typhoon_set_timer_irq, s, 1); + *p_rtc_irq = qemu_allocate_irq(typhoon_set_timer_irq, s, 0); /* Main memory region, 0x00.0000.0000. Real hardware supports 32GB, but the address space hole reserved at this point is 8TB. */ @@ -918,11 +918,11 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, /* Init the ISA bus. */ /* ??? Technically there should be a cy82c693ub pci-isa bridge. */ { - qemu_irq isa_pci_irq, *isa_irqs; + qemu_irq *isa_irqs; *isa_bus = isa_bus_new(NULL, get_system_memory(), &s->pchip.reg_io); - isa_pci_irq = *qemu_allocate_irqs(typhoon_set_isa_irq, s, 1); - isa_irqs = i8259_init(*isa_bus, isa_pci_irq); + isa_irqs = i8259_init(*isa_bus, + qemu_allocate_irq(typhoon_set_isa_irq, s, 0)); isa_bus_irqs(*isa_bus, isa_irqs); } From 294972ce546107f2215b3b162994b47f08aab7a4 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:10 +0800 Subject: [PATCH 24/30] hw/arm/nseries.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/arm/nseries.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index d243159664..a659e8525d 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -133,9 +133,8 @@ static void n800_mmc_cs_cb(void *opaque, int line, int level) static void n8x0_gpio_setup(struct n800_s *s) { - qemu_irq *mmc_cs = qemu_allocate_irqs(n800_mmc_cs_cb, s->mpu->mmc, 1); - qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO, mmc_cs[0]); - + qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO, + qemu_allocate_irq(n800_mmc_cs_cb, s->mpu->mmc, 0)); qemu_irq_lower(qdev_get_gpio_in(s->mpu->gpio, N800_BAT_COVER_GPIO)); } From 26c8acb3f326166bf9dc60c3e8184f4b862e8451 Mon Sep 17 00:00:00 2001 From: Shannon Zhao Date: Fri, 29 May 2015 13:27:11 +0800 Subject: [PATCH 25/30] hw/display/tc6393xb.c: Fix misusing qemu_allocate_irqs for single irq Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/display/tc6393xb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 66b7ade8da..f5f3f3e69d 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -571,7 +571,7 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq) s->irq = irq; s->gpio_in = qemu_allocate_irqs(tc6393xb_gpio_set, s, TC6393XB_GPIOS); - s->l3v = *qemu_allocate_irqs(tc6393xb_l3v, s, 1); + s->l3v = qemu_allocate_irq(tc6393xb_l3v, s, 0); s->blanked = 1; s->sub_irqs = qemu_allocate_irqs(tc6393xb_sub_irq, s, TC6393XB_NR_IRQS); From 1597051b84b816c9608e1ee0947f8e6dc9876b56 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Fri, 29 May 2015 19:52:52 +0100 Subject: [PATCH 26/30] Add -incoming help text The help/man text for -incoming defer didn't make it through the merge of the code that implemented it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- qemu-options.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 7edd1f18ce..b3db6cbe86 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3239,7 +3239,9 @@ DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ "-incoming fd:fd\n" \ "-incoming exec:cmdline\n" \ " accept incoming migration on given file descriptor\n" \ - " or from given external command\n", + " or from given external command\n" \ + "-incoming defer\n" \ + " wait for the URI to be specified via migrate_incoming\n", QEMU_ARCH_ALL) STEXI @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6] @@ -3255,6 +3257,11 @@ Accept incoming migration from a given filedescriptor. @item -incoming exec:@var{cmdline} Accept incoming migration as an output from specified external command. + +@item -incoming defer +Wait for the URI to be specified via migrate_incoming. The monitor can +be used to change settings (such as migration parameters) prior to issuing +the migrate_incoming to allow the migration to begin. ETEXI DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ From b6b099541d6cf3c50b0fb5af916fff0db6508805 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 1 Jun 2015 09:53:55 +0200 Subject: [PATCH 27/30] translate-all: delete prototype for non-existent function Missed in commit 3a808cc40 Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Peter Crosthwaite Signed-off-by: Michael Tokarev --- translate-all.h | 1 - 1 file changed, 1 deletion(-) diff --git a/translate-all.h b/translate-all.h index 02832b2718..b6a07bd5d3 100644 --- a/translate-all.h +++ b/translate-all.h @@ -21,7 +21,6 @@ /* translate-all.c */ void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len); -void cpu_unlink_tb(CPUState *cpu); void tb_check_watchpoint(CPUState *cpu); #endif /* TRANSLATE_ALL_H */ From 8b8f1c7e9ddb2e88a144638f6527bf70e32343e3 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Thu, 28 May 2015 14:12:26 +0300 Subject: [PATCH 28/30] slirp: use less predictable directory name in /tmp for smb config (CVE-2015-4037) In this version I used mkdtemp(3) which is: _BSD_SOURCE || /* Since glibc 2.10: */ (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) (POSIX.1-2008), so should be available on systems we care about. While at it, reset the resulting directory name within smb structure on error so cleanup function wont try to remove directory which we failed to create. Signed-off-by: Michael Tokarev Reviewed-by: Markus Armbruster --- net/slirp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 0e15cf6750..35338376f7 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -481,7 +481,6 @@ static void slirp_smb_cleanup(SlirpState *s) static int slirp_smb(SlirpState* s, const char *exported_dir, struct in_addr vserver_addr) { - static int instance; char smb_conf[128]; char smb_cmdline[128]; struct passwd *passwd; @@ -505,10 +504,10 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, return -1; } - snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d", - (long)getpid(), instance++); - if (mkdir(s->smb_dir, 0700) < 0) { + snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.XXXXXX"); + if (!mkdtemp(s->smb_dir)) { error_report("could not create samba server dir '%s'", s->smb_dir); + s->smb_dir[0] = 0; return -1; } snprintf(smb_conf, sizeof(smb_conf), "%s/%s", s->smb_dir, "smb.conf"); From 2801339f2fb2534ccf01561d274398328bdd446d Mon Sep 17 00:00:00 2001 From: Sai Pavan Boddu Date: Fri, 29 May 2015 11:52:35 +0530 Subject: [PATCH 29/30] cadence_gem: Fix Rx buffer size field mask This patch corrects the Rx buffer size field mask to mask bits 23 to 16 to match Xilinx UG585 documentation. Signed-off-by: Sai Pavan Boddu Reviewed-by: Alistair Francis Reviewed-by: Peter Crosthwaite Signed-off-by: Michael Tokarev --- hw/net/cadence_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index dafe91421b..494a346cf6 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -155,7 +155,7 @@ #define GEM_NWCFG_BCAST_REJ 0x00000020 /* Reject broadcast packets */ #define GEM_NWCFG_PROMISC 0x00000010 /* Accept all packets */ -#define GEM_DMACFG_RBUFSZ_M 0x007F0000 /* DMA RX Buffer Size mask */ +#define GEM_DMACFG_RBUFSZ_M 0x00FF0000 /* DMA RX Buffer Size mask */ #define GEM_DMACFG_RBUFSZ_S 16 /* DMA RX Buffer Size shift */ #define GEM_DMACFG_RBUFSZ_MUL 64 /* DMA RX Buffer Size multiplier */ #define GEM_DMACFG_TXCSUM_OFFL 0x00000800 /* Transmit checksum offload */ From de3852877f1e452321352fdb7e678f079876a41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Wed, 3 Jun 2015 09:56:37 +0100 Subject: [PATCH 30/30] configure: postfix --extra-cflags to QEMU_CFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It makes sense that extra-cflags should be appended after the normal CFLAGS so they don't get overridden by default behaviour. This way if you specify something like: ./configure --extra-cflags="-O0" You will see the requested behaviour. Signed-off-by: Alex Bennée Signed-off-by: Michael Tokarev --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 4e2f78a173..69190d2793 100755 --- a/configure +++ b/configure @@ -353,7 +353,7 @@ for opt do ;; --cpu=*) cpu="$optarg" ;; - --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" + --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg" EXTRA_CFLAGS="$optarg" ;; --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"