From a0cf4297d6b8d88047ab00c467f14aecf9c2a8eb Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Wed, 4 Mar 2020 14:23:05 +1100 Subject: [PATCH 01/33] dp8393x: Mask EOL bit from descriptor addresses, take 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A portion of a recent patch got lost due to a merge snafu. That patch is now commit 88f632fbb1 ("dp8393x: Mask EOL bit from descriptor addresses"). This patch restores the portion that got lost. Signed-off-by: Finn Thain Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Laurent Vivier --- hw/net/dp8393x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 8a3504d962..81fc13ee9f 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -525,8 +525,8 @@ static void dp8393x_do_transmit_packets(dp8393xState *s) * (4 + 3 * s->regs[SONIC_TFC]), MEMTXATTRS_UNSPECIFIED, s->data, size); - s->regs[SONIC_CTDA] = dp8393x_get(s, width, 0) & ~0x1; - if (dp8393x_get(s, width, 0) & SONIC_DESC_EOL) { + s->regs[SONIC_CTDA] = dp8393x_get(s, width, 0); + if (s->regs[SONIC_CTDA] & SONIC_DESC_EOL) { /* EOL detected */ break; } From bab694faedf17c2ea95d6c739b0792ec52d64cb9 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 20 Feb 2020 10:22:13 -0600 Subject: [PATCH 02/33] maint: Include top-level *.rst files early in git diff We are converting more doc files to *.rst rather than *.texi. Most doc files are already listed early in diffs due to our catchall docs/*, but a few top-level files get missed by that glob. Signed-off-by: Eric Blake Reviewed-by: Stefano Garzarella Message-Id: <20200220162214.3474280-1-eblake@redhat.com> Signed-off-by: Laurent Vivier --- scripts/git.orderfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/git.orderfile b/scripts/git.orderfile index 7cf22e0bf5..73fd818d7f 100644 --- a/scripts/git.orderfile +++ b/scripts/git.orderfile @@ -11,6 +11,7 @@ # Documentation docs/* +*.rst *.texi # build system From 1a28f878b50f55cd5965dfb61d1e5e8009a59197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 6 Mar 2020 18:04:56 +0100 Subject: [PATCH 03/33] build-sys: Move the print-variable rule to rules.mak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the print-variable rule can only be used in the root directory: $ make print-vhost-user-json-y vhost-user-json-y= contrib/vhost-user-gpu/50-qemu-gpu.json tools/virtiofsd/50-qemu-virtiofsd.json $ make -C i386-softmmu print-obj-y make: Entering directory 'build/i386-softmmu' make: *** No rule to make target 'print-obj-y'. Stop. make: Leaving directory 'build/i386-softmmu' Move it to rules.mak so we can use it from other directories: $ make -C i386-softmmu print-obj-y make: Entering directory 'build/i386-softmmu' obj-y=qapi-introspect.o qapi-types-machine-target.o qapi-types-misc-target.o qapi-types.o qapi-visit-machine-target.o qapi-visit-misc-target.o qapi-visit.o qapi-events-machine-target.o qapi-events-misc-target.o qapi-events.o qapi-commands-machine-target.o qapi-commands-misc-target.o qapi-commands.o qapi-init-commands.o make: Leaving directory 'build/i386-softmmu' Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20200306170456.21977-1-philmd@redhat.com> Signed-off-by: Laurent Vivier --- Makefile | 3 --- rules.mak | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2e93068894..37aed4a244 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,6 @@ UNCHECKED_GOALS := %clean TAGS cscope ctags dist \ help check-help print-% \ docker docker-% vm-help vm-test vm-build-% -print-%: - @echo '$*=$($*)' - # All following code might depend on configuration variables ifneq ($(wildcard config-host.mak),) # Put the all: rule here so that config-host.mak can contain dependencies. diff --git a/rules.mak b/rules.mak index e39b073d46..694865b63e 100644 --- a/rules.mak +++ b/rules.mak @@ -435,3 +435,6 @@ sentinel = .$(subst $(SPACE),_,$(subst /,_,$1)).sentinel. atomic = $(eval $1: $(call sentinel,$1) ; @:) \ $(call sentinel,$1) : $2 ; @touch $$@ \ $(foreach t,$1,$(if $(wildcard $t),,$(shell rm -f $(call sentinel,$1)))) + +print-%: + @echo '$*=$($*)' From 02f7a1644dd140d0036de054cafa62b90bcff9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 5 Mar 2020 13:45:17 +0100 Subject: [PATCH 04/33] hw/audio/fmopl: Fix a typo twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefano Garzarella Message-Id: <20200305124525.14555-2-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/audio/fmopl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 9f50a89b4a..173a7521f2 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -1066,7 +1066,7 @@ static void OPLResetChip(FM_OPL *OPL) } } -/* ---------- Create one of vietual YM3812 ---------- */ +/* ---------- Create one of virtual YM3812 ---------- */ /* 'rate' is sampling rate and 'bufsiz' is the size of the */ FM_OPL *OPLCreate(int clock, int rate) { @@ -1115,7 +1115,7 @@ FM_OPL *OPLCreate(int clock, int rate) return OPL; } -/* ---------- Destroy one of vietual YM3812 ---------- */ +/* ---------- Destroy one of virtual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { #ifdef OPL_OUTPUT_LOG From 3b6b3a279ad3c32903b0c0fdf3cacf24b02541f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 5 Mar 2020 02:04:44 +0100 Subject: [PATCH 05/33] hw/net/e1000: Add readops/writeops typedefs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Express the macreg[] arrays using typedefs. No logical changes introduced here. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Paolo Bonzini Reviewed-by: Dmitry Fleytman Reviewed-by: Stefano Garzarella Message-Id: <20200305010446.17029-2-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/net/e1000.c | 6 ++++-- hw/net/e1000e_core.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 0b833d5a15..972d9b5083 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1150,7 +1150,8 @@ set_ims(E1000State *s, int index, uint32_t val) } #define getreg(x) [x] = mac_readreg -static uint32_t (*macreg_readops[])(E1000State *, int) = { +typedef uint32_t (*readops)(E1000State *, int); +static readops macreg_readops[] = { getreg(PBA), getreg(RCTL), getreg(TDH), getreg(TXDCTL), getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL), getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS), @@ -1205,7 +1206,8 @@ static uint32_t (*macreg_readops[])(E1000State *, int) = { enum { NREADOPS = ARRAY_SIZE(macreg_readops) }; #define putreg(x) [x] = mac_writereg -static void (*macreg_writeops[])(E1000State *, int, uint32_t) = { +typedef void (*writeops)(E1000State *, int, uint32_t); +static writeops macreg_writeops[] = { putreg(PBA), putreg(EERD), putreg(SWSM), putreg(WUFC), putreg(TDBAL), putreg(TDBAH), putreg(TXDCTL), putreg(RDBAH), putreg(RDBAL), putreg(LEDCTL), putreg(VET), putreg(FCRUC), diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 94ea34dca5..38bdb90114 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2855,7 +2855,8 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t val) } #define e1000e_getreg(x) [x] = e1000e_mac_readreg -static uint32_t (*e1000e_macreg_readops[])(E1000ECore *, int) = { +typedef uint32_t (*readops)(E1000ECore *, int); +static readops e1000e_macreg_readops[] = { e1000e_getreg(PBA), e1000e_getreg(WUFC), e1000e_getreg(MANC), @@ -3061,7 +3062,8 @@ static uint32_t (*e1000e_macreg_readops[])(E1000ECore *, int) = { enum { E1000E_NREADOPS = ARRAY_SIZE(e1000e_macreg_readops) }; #define e1000e_putreg(x) [x] = e1000e_mac_writereg -static void (*e1000e_macreg_writeops[])(E1000ECore *, int, uint32_t) = { +typedef void (*writeops)(E1000ECore *, int, uint32_t); +static writeops e1000e_macreg_writeops[] = { e1000e_putreg(PBA), e1000e_putreg(SWSM), e1000e_putreg(WUFC), From da5cf9a4fef1e04608501605b4697f39ea56e0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 5 Mar 2020 02:04:45 +0100 Subject: [PATCH 06/33] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each array consumes 256KiB of .data. As we do not reassign entries, we can move it to the .rodata section, and save a total of 1MiB of .data (size reported on x86_64 host). Signed-off-by: Philippe Mathieu-Daudé Acked-by: Paolo Bonzini Reviewed-by: Dmitry Fleytman Reviewed-by: Stefano Garzarella Message-Id: <20200305010446.17029-3-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/net/e1000.c | 4 ++-- hw/net/e1000e_core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 972d9b5083..9233248c9a 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1151,7 +1151,7 @@ set_ims(E1000State *s, int index, uint32_t val) #define getreg(x) [x] = mac_readreg typedef uint32_t (*readops)(E1000State *, int); -static readops macreg_readops[] = { +static const readops macreg_readops[] = { getreg(PBA), getreg(RCTL), getreg(TDH), getreg(TXDCTL), getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL), getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS), @@ -1207,7 +1207,7 @@ enum { NREADOPS = ARRAY_SIZE(macreg_readops) }; #define putreg(x) [x] = mac_writereg typedef void (*writeops)(E1000State *, int, uint32_t); -static writeops macreg_writeops[] = { +static const writeops macreg_writeops[] = { putreg(PBA), putreg(EERD), putreg(SWSM), putreg(WUFC), putreg(TDBAL), putreg(TDBAH), putreg(TXDCTL), putreg(RDBAH), putreg(RDBAL), putreg(LEDCTL), putreg(VET), putreg(FCRUC), diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 38bdb90114..df957e0c1a 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2856,7 +2856,7 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t val) #define e1000e_getreg(x) [x] = e1000e_mac_readreg typedef uint32_t (*readops)(E1000ECore *, int); -static readops e1000e_macreg_readops[] = { +static const readops e1000e_macreg_readops[] = { e1000e_getreg(PBA), e1000e_getreg(WUFC), e1000e_getreg(MANC), @@ -3063,7 +3063,7 @@ enum { E1000E_NREADOPS = ARRAY_SIZE(e1000e_macreg_readops) }; #define e1000e_putreg(x) [x] = e1000e_mac_writereg typedef void (*writeops)(E1000ECore *, int, uint32_t); -static writeops e1000e_macreg_writeops[] = { +static const writeops e1000e_macreg_writeops[] = { e1000e_putreg(PBA), e1000e_putreg(SWSM), e1000e_putreg(WUFC), From b8ccfadc1f95b73766bf1ff33ea3549e37bd7c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 5 Mar 2020 02:04:46 +0100 Subject: [PATCH 07/33] virtfs-proxy-helper: Make the helper_opts[] array const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce a bit the memory footprint by making the helper_opts[] array const. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Greg Kurz Acked-by: Paolo Bonzini Reviewed-by: Stefano Garzarella Message-Id: <20200305010446.17029-4-philmd@redhat.com> Signed-off-by: Laurent Vivier --- fsdev/virtfs-proxy-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index aa1ab2590d..de061a8a0e 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -43,7 +43,7 @@ #define BTRFS_SUPER_MAGIC 0x9123683E #endif -static struct option helper_opts[] = { +static const struct option helper_opts[] = { {"fd", required_argument, NULL, 'f'}, {"path", required_argument, NULL, 'p'}, {"nodaemon", no_argument, NULL, 'n'}, From fe48442fd6bb57614049ad08d2cf3fcf7a2e46bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:32 +0100 Subject: [PATCH 08/33] vl: Add missing "hw/boards.h" include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vl.c calls machine_usb() declared in "hw/boards.h". Include it. This fixes (when modifying unrelated headers): vl.c:1283:10: error: implicit declaration of function 'machine_usb' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!machine_usb(current_machine)) { ^ vl.c:1283:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] vl.c:1283:22: error: use of undeclared identifier 'current_machine' if (!machine_usb(current_machine)) { ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-2-philmd@redhat.com> Signed-off-by: Laurent Vivier --- softmmu/vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/vl.c b/softmmu/vl.c index 5549f4b619..ff2685dff8 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/units.h" +#include "hw/boards.h" #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu-version.h" From a1c4a3de2ecbd89b3643da51a59f3d80a0c0e73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:33 +0100 Subject: [PATCH 09/33] hw/southbridge/ich9: Removed unused headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ICH9 chipset is not X86/PC specific. These files don't use anything declared by the "hw/i386/pc.h" or "hw/i386/ioapic.h" headers. Remove them. Reviewed-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-3-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/acpi/ich9.c | 1 - hw/isa/lpc_ich9.c | 1 - include/hw/i386/ich9.h | 1 - 3 files changed, 3 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 2034dd749e..fdd0a6c79e 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -27,7 +27,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/timer.h" diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index f85b484eac..cb79616ced 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -37,7 +37,6 @@ #include "migration/vmstate.h" #include "hw/irq.h" #include "hw/isa/apm.h" -#include "hw/i386/ioapic.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" #include "hw/i386/ich9.h" diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 72e803f6e2..a98d10b252 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -5,7 +5,6 @@ #include "hw/sysbus.h" #include "hw/i386/pc.h" #include "hw/isa/apm.h" -#include "hw/i386/ioapic.h" #include "hw/pci/pci.h" #include "hw/pci/pcie_host.h" #include "hw/pci/pci_bridge.h" From 1b5c0b5dc642927116be2f52f88be2ccf3474d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:34 +0100 Subject: [PATCH 10/33] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "ioapic_internal.h" does not use anything from "hw/i386/ioapic.h", remove it. Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-4-philmd@redhat.com> Signed-off-by: Laurent Vivier --- include/hw/i386/ioapic_internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h index d46c87c510..fe06938bda 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -23,7 +23,6 @@ #define QEMU_IOAPIC_INTERNAL_H #include "exec/memory.h" -#include "hw/i386/ioapic.h" #include "hw/sysbus.h" #include "qemu/notify.h" From 4e24b59a3d80870e23e7e6e6812d2774a46f0ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:35 +0100 Subject: [PATCH 11/33] hw/timer: Remove unused "ui/console.h" header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The timer models don't need anything from "ui/console.h". Remove it. Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-5-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/rtc/twl92230.c | 1 - hw/timer/hpet.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c index 63bd13d2ca..d0011be89e 100644 --- a/hw/rtc/twl92230.c +++ b/hw/rtc/twl92230.c @@ -27,7 +27,6 @@ #include "migration/qemu-file-types.h" #include "migration/vmstate.h" #include "sysemu/sysemu.h" -#include "ui/console.h" #include "qemu/bcd.h" #include "qemu/module.h" diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 8dbcbdca16..4f30dd50a4 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -27,7 +27,6 @@ #include "qemu/osdep.h" #include "hw/i386/pc.h" #include "hw/irq.h" -#include "ui/console.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" From d797c3013463c0e89eb05038e156275255797441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:36 +0100 Subject: [PATCH 12/33] hw/usb/dev-storage: Remove unused "ui/console.h" header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The USB models related to storage don't need anything from "ui/console.h". Remove it. Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Acked-by: Gerd Hoffmann Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-6-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/usb/dev-storage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 90da008df1..4883c1d89e 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -17,7 +17,6 @@ #include "desc.h" #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" -#include "ui/console.h" #include "migration/vmstate.h" #include "monitor/monitor.h" #include "sysemu/sysemu.h" From 2479300674249ff4a2d08709e28bf5f6482da030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:37 +0100 Subject: [PATCH 13/33] hw/i386/intel_iommu: Remove unused includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit intel_iommu.h does not use any of these includes, remove them. Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-7-philmd@redhat.com> Signed-off-by: Laurent Vivier --- include/hw/i386/intel_iommu.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 66b931e526..a1c4afcda5 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -22,11 +22,7 @@ #ifndef INTEL_IOMMU_H #define INTEL_IOMMU_H -#include "sysemu/dma.h" #include "hw/i386/x86-iommu.h" -#include "hw/i386/ioapic.h" -#include "hw/pci/msi.h" -#include "hw/sysbus.h" #include "qemu/iova-tree.h" #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu" From 540818bbb491cb1a5f46bcda7409827594109fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:38 +0100 Subject: [PATCH 14/33] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alpha_sys.h does not use anything from the "hw/ide.h" header. Remove it. Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-8-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/alpha/alpha_sys.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index bc0a286226..e2c02e2bbe 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -6,7 +6,6 @@ #include "target/alpha/cpu-qom.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" -#include "hw/ide.h" #include "hw/boards.h" #include "hw/intc/i8259.h" From b58337ffee04cc62b66c6117285f2ea404658ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:39 +0100 Subject: [PATCH 15/33] hw/alpha/dp264: Include "net/net.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/alpha/dp264.c uses NICInfo variables which are declared in "net/net.h". Include it. This fixes (when modifying unrelated headers): hw/alpha/dp264.c:89:21: error: use of undeclared identifier 'nb_nics' for (i = 0; i < nb_nics; i++) { ^ hw/alpha/dp264.c:90:30: error: use of undeclared identifier 'nd_table' pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-9-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/alpha/dp264.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index d28f57199f..e5350a287f 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -21,6 +21,7 @@ #include "hw/dma/i8257.h" #include "net/net.h" #include "qemu/cutils.h" +#include "net/net.h" #define MAX_IDE_BUS 2 From e07c4f44b0d5c80577cb00421a5370d2dbbcfa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:40 +0100 Subject: [PATCH 16/33] hw/hppa/machine: Include "net/net.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/hppa/machine.c uses NICInfo variables which are declared in "net/net.h". Include it. This fixes (when modifying unrelated headers): hw/hppa/machine.c:126:21: error: use of undeclared identifier 'nb_nics' for (i = 0; i < nb_nics; i++) { ^ hw/hppa/machine.c:127:30: error: use of undeclared identifier 'nd_table' pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-10-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/hppa/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index bf18767e24..9175f4b790 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -22,6 +22,7 @@ #include "qapi/error.h" #include "net/net.h" #include "qemu/log.h" +#include "net/net.h" #define MAX_IDE_BUS 2 From 38e131d2e2fa6e9b17782d7ce96e7207fa276562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:41 +0100 Subject: [PATCH 17/33] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/acpi/cpu_hotplug.c calls pci_address_space_io(). Include "hw/pci/pci.h" which declares it. This fixes (when modifying unrelated headers): hw/acpi/cpu_hotplug.c:103:28: error: implicit declaration of function 'pci_address_space_io' is invalid in C99 [-Werror,-Wimplicit-function-declaration] MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe_cpu->device)); ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-11-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/acpi/cpu_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 9c3bcc84de..3e687d227a 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -14,6 +14,7 @@ #include "qapi/error.h" #include "hw/core/cpu.h" #include "hw/i386/pc.h" +#include "hw/pci/pci.h" #include "qemu/error-report.h" #define CPU_EJECT_METHOD "CPEJ" From 858be92357ec195978b7ccb599fa8067f4b91849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:42 +0100 Subject: [PATCH 18/33] hw/timer/hpet: Include "exec/address-spaces.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/timer/hpet.c calls address_space_stl_le() declared in "exec/address-spaces.h". Include it. This fixes (when modifying unrelated headers): hw/timer/hpet.c:210:31: error: use of undeclared identifier 'address_space_memory' address_space_stl_le(&address_space_memory, timer->fsb >> 32, ^~~~~~~~~~~~~~~~~~~~ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-12-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/timer/hpet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 4f30dd50a4..380acfa7c8 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -36,6 +36,7 @@ #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" #include "hw/timer/i8254.h" +#include "exec/address-spaces.h" //#define HPET_DEBUG #ifdef HPET_DEBUG From 577aa4895a138782d426be592aa3c41ecf28a2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:43 +0100 Subject: [PATCH 19/33] hw/pci-host/q35: Include "qemu/range.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MCHPCIState structure uses the Range type which is declared in "qemu/range.h". Include it. This fixes (when modifying unrelated headers): In file included from hw/pci-host/q35.c:32: include/hw/pci-host/q35.h:57:11: error: field has incomplete type 'Range' (aka 'struct Range') Range pci_hole; ^ include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range' typedef struct Range Range; ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-13-philmd@redhat.com> Signed-off-by: Laurent Vivier --- include/hw/pci-host/q35.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 976fbae599..47086c645e 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -33,6 +33,7 @@ #include "hw/pci-host/pam.h" #include "hw/i386/intel_iommu.h" #include "qemu/units.h" +#include "qemu/range.h" #define TYPE_Q35_HOST_DEVICE "q35-pcihost" #define Q35_HOST_DEVICE(obj) \ From 5588a58ce2eccc946f1227f3acae97cb28c0013d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:44 +0100 Subject: [PATCH 20/33] hw/i2c/smbus_ich9: Include "qemu/range.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/i2c/smbus_ich9.c calls range_covers_byte(). Include "qemu/range.h" which declares it. This fixes (when modifying unrelated headers): hw/i2c/smbus_ich9.c:66:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (range_covers_byte(address, len, ICH9_SMB_HOSTC)) { ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-14-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/i2c/smbus_ich9.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index fd50fb851a..48f1ff4191 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -21,6 +21,7 @@ */ #include "qemu/osdep.h" +#include "qemu/range.h" #include "hw/i2c/pm_smbus.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" From 9a5711613527a4dd7b57289bbbb8892b69d328b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:45 +0100 Subject: [PATCH 21/33] hw/pci-host/piix: Include "qemu/range.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw/pci-host/piix.c calls various functions from the Range API. Include "qemu/range.h" which declares them. This fixes (when modifying unrelated headers): hw/pci-host/i440fx.c:54:11: error: field has incomplete type 'Range' (aka 'struct Range') Range pci_hole; ^ include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range' typedef struct Range Range; ^ hw/pci-host/i440fx.c:126:9: error: implicit declaration of function 'ranges_overlap' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) || ^ hw/pci-host/i440fx.c:126:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] hw/pci-host/i440fx.c:127:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration] range_covers_byte(address, len, I440FX_SMRAM)) { ^ hw/pci-host/i440fx.c:127:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] hw/pci-host/i440fx.c:189:13: error: implicit declaration of function 'range_is_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration] val64 = range_is_empty(&s->pci_hole) ? 0 : range_lob(&s->pci_hole); ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-15-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/pci-host/i440fx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 11050a0f8b..d980c97049 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/range.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" From 132a908bc4fd12f4d6d24661eff44b927450c8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:46 +0100 Subject: [PATCH 22/33] hw/acpi: Include "hw/mem/nvdimm.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both ich9.c and piix4.c use methods/definitions declared in the NVDIMM device header. Include it. This fixes (when modifying unrelated headers): hw/acpi/ich9.c:507:46: error: use of undeclared identifier 'TYPE_NVDIMM' if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) { ^ hw/acpi/ich9.c:508:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_acpi_plug_cb(hotplug_dev, dev); ^ hw/acpi/piix4.c:403:46: error: use of undeclared identifier 'TYPE_NVDIMM' if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) { ^ hw/acpi/piix4.c:404:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_acpi_plug_cb(hotplug_dev, dev); ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-16-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/acpi/ich9.c | 1 + hw/acpi/piix4.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index fdd0a6c79e..4e74284b65 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -39,6 +39,7 @@ #include "hw/i386/ich9.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/nvdimm.h" //#define DEBUG diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 6d621c31e7..b84dbba2c3 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -38,6 +38,7 @@ #include "hw/acpi/cpu.h" #include "hw/hotplug.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/nvdimm.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/xen/xen.h" From 4b997690c60ba21135323d2db54a03495232acd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:47 +0100 Subject: [PATCH 23/33] hw/i386: Include "hw/mem/nvdimm.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All this files use methods/definitions declared in the NVDIMM device header. Include it. This fixes (when modifying unrelated headers): hw/i386/acpi-build.c:2733:9: error: implicit declaration of function 'nvdimm_build_acpi' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_build_acpi(table_offsets, tables_blob, tables->linker, ^ hw/i386/pc.c:1996:61: error: use of undeclared identifier 'TYPE_NVDIMM' const bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); ^ hw/i386/pc.c:2032:55: error: use of undeclared identifier 'TYPE_NVDIMM' bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); ^ hw/i386/pc.c:2040:9: error: implicit declaration of function 'nvdimm_plug' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_plug(ms->nvdimms_state); ^ hw/i386/pc.c:2040:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] nvdimm_plug(ms->nvdimms_state); ^ hw/i386/pc.c:2065:42: error: use of undeclared identifier 'TYPE_NVDIMM' if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) { ^ hw/i386/pc_i440fx.c:307:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_init_acpi_state(machine->nvdimms_state, system_io, ^ hw/i386/pc_q35.c:332:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nvdimm_init_acpi_state(machine->nvdimms_state, system_io, ^ Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-17-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/i386/acpi-build.c | 1 + hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + 4 files changed, 4 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 26777f8828..9a19c14e66 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -47,6 +47,7 @@ #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" #include "hw/mem/memory-device.h" +#include "hw/mem/nvdimm.h" #include "sysemu/numa.h" #include "sysemu/reset.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6ab4acb0c6..362eb2a180 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -76,6 +76,7 @@ #include "hw/boards.h" #include "acpi-build.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/nvdimm.h" #include "qapi/error.h" #include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9088db8fb6..e2d98243bc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -60,6 +60,7 @@ #include "migration/global_state.h" #include "migration/misc.h" #include "sysemu/numa.h" +#include "hw/mem/nvdimm.h" #define MAX_IDE_BUS 2 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 84cf925cf4..d37c425e22 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -53,6 +53,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "sysemu/numa.h" +#include "hw/mem/nvdimm.h" /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 From 71adf91a82ac3a34dbbbfc77ae9f06764bbb8553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:48 +0100 Subject: [PATCH 24/33] hw/pci-host/q35: Remove unused includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only q35.c requires declarations from "hw/i386/pc.h", move it there. Remove all the includes not used by "q35.h". Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-18-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/pci-host/q35.c | 1 + include/hw/pci-host/q35.h | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index a9b9ccc876..993f467668 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -29,6 +29,7 @@ */ #include "qemu/osdep.h" +#include "hw/i386/pc.h" #include "hw/pci-host/q35.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 47086c645e..070305f83d 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -22,16 +22,9 @@ #ifndef HW_Q35_H #define HW_Q35_H -#include "hw/isa/isa.h" -#include "hw/sysbus.h" -#include "hw/i386/pc.h" -#include "hw/isa/apm.h" #include "hw/pci/pci.h" #include "hw/pci/pcie_host.h" -#include "hw/acpi/acpi.h" -#include "hw/acpi/ich9.h" #include "hw/pci-host/pam.h" -#include "hw/i386/intel_iommu.h" #include "qemu/units.h" #include "qemu/range.h" From fe8ce968c13ab58f42068eb0a7d557b1d209cd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 28 Feb 2020 12:46:49 +0100 Subject: [PATCH 25/33] hw/i386/pc: Clean up includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Various headers are not required by hw/i386/pc.h: - "qemu/range.h" - "qemu/bitmap.h" - "qemu/module.h" - "exec/memory.h" - "hw/pci/pci.h" - "hw/mem/pc-dimm.h" - "hw/mem/nvdimm.h" - "net/net.h" Remove them. Add 3 headers that were missing: - "hw/hotplug.h" PCMachineState::acpi_dev is of type HotplugHandler - "qemu/notify.h" PCMachineState::machine_done is of type Notifier - "qapi/qapi-types-common.h" PCMachineState::vmport/smm is of type OnOffAuto Acked-by: John Snow Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200228114649.12818-19-philmd@redhat.com> Signed-off-by: Laurent Vivier --- include/hw/i386/pc.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d5ac76d54e..6ab6eda046 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -1,20 +1,15 @@ #ifndef HW_PC_H #define HW_PC_H -#include "exec/memory.h" +#include "qemu/notify.h" +#include "qapi/qapi-types-common.h" #include "hw/boards.h" #include "hw/block/fdc.h" #include "hw/block/flash.h" -#include "net/net.h" #include "hw/i386/x86.h" -#include "qemu/range.h" -#include "qemu/bitmap.h" -#include "qemu/module.h" -#include "hw/pci/pci.h" -#include "hw/mem/pc-dimm.h" -#include "hw/mem/nvdimm.h" #include "hw/acpi/acpi_dev_interface.h" +#include "hw/hotplug.h" #define HPET_INTCAP "hpet-intcap" From 2244f2335ea8f3b92cbecbb123dc392570b06e6c Mon Sep 17 00:00:00 2001 From: Pan Nengyuan Date: Sat, 7 Mar 2020 11:07:56 +0800 Subject: [PATCH 26/33] core/qdev: fix memleak in qdev_get_gpio_out_connector() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a memory leak in qdev_get_gpio_out_connector(). Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Marc-André Lureau Message-Id: <20200307030756.5913-1-pannengyuan@huawei.com> Signed-off-by: Laurent Vivier --- hw/core/qdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3937d1eb1a..85f062def7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -557,7 +557,7 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n) { - char *propname = g_strdup_printf("%s[%d]", + g_autofree char *propname = g_strdup_printf("%s[%d]", name ? name : "unnamed-gpio-out", n); qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname, From 35c9453592944c46bc4f8cd273b9ed54362a50e5 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:04 +0800 Subject: [PATCH 27/33] block/stream: Remove redundant statement in stream_run() Clang static code analyzer show warning: block/stream.c:186:9: warning: Value stored to 'ret' is never read ret = 0; ^ ~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200302130715.29440-3-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- block/stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/stream.c b/block/stream.c index 5562ccbf57..aa2e7af98e 100644 --- a/block/stream.c +++ b/block/stream.c @@ -114,7 +114,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp) int64_t offset = 0; uint64_t delay_ns = 0; int error = 0; - int ret = 0; int64_t n = 0; /* bytes */ if (bs == s->bottom) { @@ -139,6 +138,7 @@ static int coroutine_fn stream_run(Job *job, Error **errp) for ( ; offset < len; offset += n) { bool copy; + int ret; /* Note that even when no rate limit is applied we need to yield * with no pending I/O here so that bdrv_drain_all() returns. @@ -183,7 +183,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp) break; } } - ret = 0; /* Publish progress */ job_progress_update(&s->common.job, n); From 76e91cda07d783c4dca50df3cd87156bd14b692c Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:06 +0800 Subject: [PATCH 28/33] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Clang static code analyzer show warning: block/file-posix.c:891:9: warning: Value stored to 'op' is never read op = RAW_PL_ABORT; ^ ~~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Kevin Wolf Message-Id: <20200302130715.29440-5-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- block/file-posix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 6345477112..0f77447a25 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -888,7 +888,6 @@ static int raw_handle_perm_lock(BlockDriverState *bs, "Is another process using the image [%s]?\n", bs->filename); } - op = RAW_PL_ABORT; /* fall through to unlock bytes. */ case RAW_PL_ABORT: raw_apply_lock_bytes(s, s->fd, s->perm, ~s->shared_perm, From 780c7dad17374592d202098b083376c70342356e Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:12 +0800 Subject: [PATCH 29/33] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clang static code analyzer show warning: hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never read dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Francisco Iglesias Reviewed-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Message-Id: <20200302130715.29440-11-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- hw/dma/xlnx-zdma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c index 1c1b142293..2d9c0a0d5e 100644 --- a/hw/dma/xlnx-zdma.c +++ b/hw/dma/xlnx-zdma.c @@ -372,7 +372,7 @@ static uint64_t zdma_update_descr_addr(XlnxZDMA *s, bool type, static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len) { uint32_t dst_size, dlen; - bool dst_intr, dst_type; + bool dst_intr; unsigned int ptype = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, POINT_TYPE); unsigned int rw_mode = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, MODE); unsigned int burst_type = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_DATA_ATTR, @@ -386,17 +386,17 @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len) while (len) { dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2, SIZE); - dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3, - TYPE); if (dst_size == 0 && ptype == PT_MEM) { uint64_t next; + bool dst_type = FIELD_EX32(s->dsc_dst.words[3], + ZDMA_CH_DST_DSCR_WORD3, + TYPE); + next = zdma_update_descr_addr(s, dst_type, R_ZDMA_CH_DST_CUR_DSCR_LSB); zdma_load_descriptor(s, next, &s->dsc_dst); dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2, SIZE); - dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3, - TYPE); } /* Match what hardware does by ignoring the dst_size and only using From 88492745a50372f81d4af7fd35aca26b41603776 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:08 +0800 Subject: [PATCH 30/33] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Clang static code analyzer show warning: scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read buflen = req->cmd.xfer; ^ ~~~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Laurent Vivier Message-Id: <20200302130715.29440-7-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- hw/scsi/scsi-disk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 10d0794d60..1c0cb63a6f 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1915,7 +1915,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf) r->iov.iov_base = blk_blockalign(s->qdev.conf.blk, r->buflen); } - buflen = req->cmd.xfer; outbuf = r->iov.iov_base; memset(outbuf, 0, r->buflen); switch (req->cmd.buf[0]) { From 4e34d82eee9233d2b210391365b4b84ad78284cd Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:09 +0800 Subject: [PATCH 31/33] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Clang static code analyzer show warning: hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read format = 0; ^ ~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Laurent Vivier Message-Id: <20200302130715.29440-8-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- hw/display/pxa2xx_lcd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index 05f5f84671..464e93161a 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -593,7 +593,6 @@ static void pxa2xx_palette_parse(PXA2xxLCDState *s, int ch, int bpp) n = 256; break; default: - format = 0; return; } From 488a0ddae2de036af902f98b5b1a0c2dc0bd90b5 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:10 +0800 Subject: [PATCH 32/33] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Clang static code analyzer show warning: hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is never read is_dirty = false; Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Laurent Vivier Message-Id: <20200302130715.29440-9-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- hw/display/exynos4210_fimd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index ec6776680e..1c0266ce9f 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -1311,7 +1311,6 @@ static void exynos4210_fimd_update(void *opaque) } host_fb_addr += inc_size; fb_line_addr += inc_size; - is_dirty = false; } g_free(snap); blend = true; From 916c92503bd5348a33e561db600d8894bde636bb Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Mon, 2 Mar 2020 21:07:15 +0800 Subject: [PATCH 33/33] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clang static code analyzer show warning: monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read set = true; ^ ~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20200302130715.29440-14-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- monitor/hmp-cmds.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index fb4c2fd2a8..6fd7aca500 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -2842,7 +2842,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict) const char *name = qdict_get_str(qdict, "name"); uint8_t type = qdict_get_try_int(qdict, "type", 9); Error *err = NULL; - bool set = false; list = qmp_query_rocker_of_dpa_groups(name, type != 9, type, &err); if (err != NULL) { @@ -2854,6 +2853,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict) for (g = list; g; g = g->next) { RockerOfDpaGroup *group = g->value; + bool set = false; monitor_printf(mon, "0x%08x", group->id); @@ -2898,14 +2898,11 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict) if (group->has_set_eth_dst) { if (!set) { - set = true; monitor_printf(mon, " set"); } monitor_printf(mon, " dst %s", group->set_eth_dst); } - set = false; - if (group->has_ttl_check && group->ttl_check) { monitor_printf(mon, " check TTL"); }