All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/18] Trivial branch for 5.2 patches
@ 2020-09-11 19:33 Laurent Vivier
  2020-09-11 19:33 ` [PULL 01/18] hw/mips/fuloong2e: Convert pointless error message to an assert() Laurent Vivier
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier

The following changes since commit 9435a8b3dd35f1f926f1b9127e8a906217a5518a:

  Merge remote-tracking branch 'remotes/kraxel/tags/sirius/ipxe-20200908-pull=
-request' into staging (2020-09-08 21:21:13 +0100)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/trivial-branch-for-5.2-pull-request

for you to fetch changes up to 8821e21414468b1810f0ccf38bcbfa5c0bd1d56b:

  target/i386/kvm: Add missing fallthrough comment (2020-09-11 21:25:59 +0200)

----------------------------------------------------------------
trivial patches pull request 20200911

----------------------------------------------------------------

Greg Kurz (2):
  Makefile: Drop extra phony cscope
  Makefile: Skip the meson subdir in cscope/TAGS/ctags

Jon Doron (1):
  hw: hyperv: vmbus: Fix 32bit compilation

Pan Nengyuan (1):
  test-vmstate: remove unnecessary code in match_interval_mapping_node

Paolo Bonzini (1):
  kconfig: fix comment referring to old Makefiles

Philippe Mathieu-Daud=C3=A9 (10):
  hw/mips/fuloong2e: Convert pointless error message to an assert()
  hw/isa/isa-bus: Replace hw_error() by assert()
  hw/acpi/tco: Remove unused definitions
  hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR)
  hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP)
  hw/net/e1000e: Remove overwritten read handler for STATUS register
  hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
  target/i386/kvm: Rename host_tsx_blacklisted() as host_tsx_broken()
  util/hexdump: Convert to take a void pointer argument
  util/hexdump: Reorder qemu_hexdump() arguments

Sergei Trofimovich (1):
  meson.build: tweak sdl-image error message

Thomas Huth (2):
  hw/arm/pxa2xx: Add missing fallthrough comment
  target/i386/kvm: Add missing fallthrough comment

 Kconfig.host             |  4 ++--
 Makefile                 | 10 ++++++----
 hw/acpi/tco.c            | 11 -----------
 hw/arm/pxa2xx.c          |  2 +-
 hw/dma/xlnx_dpdma.c      |  2 +-
 hw/gpio/max7310.c        | 11 +++++------
 hw/gpio/omap_gpio.c      |  6 ++++--
 hw/hyperv/vmbus.c        |  3 ++-
 hw/isa/isa-bus.c         |  9 ++-------
 hw/mips/fuloong2e.c      |  5 +----
 hw/net/e1000e_core.c     |  2 --
 hw/net/fsl_etsec/etsec.c |  2 +-
 hw/net/fsl_etsec/rings.c |  2 +-
 hw/sd/sd.c               |  2 +-
 hw/usb/redirect.c        |  2 +-
 include/qemu-common.h    |  3 ++-
 meson.build              |  4 ++--
 net/colo-compare.c       | 24 ++++++++++++------------
 net/net.c                |  2 +-
 target/i386/kvm.c        |  5 +++--
 tests/test-vmstate.c     |  3 ---
 util/hexdump.c           |  4 +++-
 util/iov.c               |  2 +-
 23 files changed, 52 insertions(+), 68 deletions(-)

--=20
2.26.2



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PULL 01/18] hw/mips/fuloong2e: Convert pointless error message to an assert()
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 02/18] hw/isa/isa-bus: Replace hw_error() by assert() Laurent Vivier
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Huacai Chen, Richard Henderson, Laurent Vivier,
	Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Displaying "vt82c686b_init error" doesn't give any hint about why
this call failed. As this message targets developers and not users,
replace the pointless error message by a call to assert() which
will provide more useful information.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200901104043.91383-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/mips/fuloong2e.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 8ca31e5162c4..f28609976bf4 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -240,10 +240,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     PCIDevice *dev;
 
     isa_bus = vt82c686b_isa_init(pci_bus, PCI_DEVFN(slot, 0));
-    if (!isa_bus) {
-        fprintf(stderr, "vt82c686b_init error\n");
-        exit(1);
-    }
+    assert(isa_bus);
     *p_isa_bus = isa_bus;
     /* Interrupt controller */
     /* The 8259 -> IP5  */
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 02/18] hw/isa/isa-bus: Replace hw_error() by assert()
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
  2020-09-11 19:33 ` [PULL 01/18] hw/mips/fuloong2e: Convert pointless error message to an assert() Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 03/18] hw/acpi/tco: Remove unused definitions Laurent Vivier
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Richard Henderson, Laurent Vivier,
	Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

As we can never have more than ISA_NUM_IRQS (16) ISA IRQs,
replace the not very interesting hw_error() call by an
assert() which is more useful to debug condition that can
not happen.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200901104043.91383-6-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/isa/isa-bus.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 58fde178f92a..10bb7ffa43ae 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -21,7 +21,6 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qapi/error.h"
-#include "hw/hw.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
@@ -85,18 +84,14 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
 qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
 {
     assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus);
-    if (isairq >= ISA_NUM_IRQS) {
-        hw_error("isa irq %d invalid", isairq);
-    }
+    assert(isairq < ISA_NUM_IRQS);
     return isabus->irqs[isairq];
 }
 
 void isa_init_irq(ISADevice *dev, qemu_irq *p, unsigned isairq)
 {
     assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
-    if (isairq >= ISA_NUM_IRQS) {
-        hw_error("isa irq %d invalid", isairq);
-    }
+    assert(isairq < ISA_NUM_IRQS);
     dev->isairq[dev->nirqs] = isairq;
     *p = isa_get_irq(dev, isairq);
     dev->nirqs++;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 03/18] hw/acpi/tco: Remove unused definitions
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
  2020-09-11 19:33 ` [PULL 01/18] hw/mips/fuloong2e: Convert pointless error message to an assert() Laurent Vivier
  2020-09-11 19:33 ` [PULL 02/18] hw/isa/isa-bus: Replace hw_error() by assert() Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 04/18] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR) Laurent Vivier
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

TCO_DEBUG() and DEBUG definitions are not used, remove them.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901101951.85892-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/acpi/tco.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c
index fb9052dbca2a..cf1e68a5393b 100644
--- a/hw/acpi/tco.c
+++ b/hw/acpi/tco.c
@@ -15,17 +15,6 @@
 #include "hw/acpi/tco.h"
 #include "trace.h"
 
-//#define DEBUG
-
-#ifdef DEBUG
-#define TCO_DEBUG(fmt, ...)                                     \
-    do {                                                        \
-        fprintf(stderr, "%s "fmt, __func__, ## __VA_ARGS__);    \
-    } while (0)
-#else
-#define TCO_DEBUG(fmt, ...) do { } while (0)
-#endif
-
 enum {
     TCO_RLD_DEFAULT         = 0x0000,
     TCO_DAT_IN_DEFAULT      = 0x00,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 04/18] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR)
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (2 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 03/18] hw/acpi/tco: Remove unused definitions Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 05/18] hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP) Laurent Vivier
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Replace fprintf() by qemu_log_mask(LOG_GUEST_ERROR).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901104234.92159-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/gpio/omap_gpio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index f662c4cb9588..e25084b40c95 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -392,8 +392,10 @@ static void omap2_gpio_module_write(void *opaque, hwaddr addr,
         break;
 
     case 0x10:	/* GPIO_SYSCONFIG */
-        if (((value >> 3) & 3) == 3)
-            fprintf(stderr, "%s: bad IDLEMODE value\n", __func__);
+        if (((value >> 3) & 3) == 3) {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: Illegal IDLEMODE value: 3\n", __func__);
+        }
         if (value & 2)
             omap2_gpio_module_reset(s);
         s->config[0] = value & 0x1d;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 05/18] hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP)
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (3 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 04/18] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR) Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 06/18] Makefile: Drop extra phony cscope Laurent Vivier
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Replace disabled printf() by qemu_log_mask(UNIMP).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901104234.92159-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/gpio/max7310.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c
index 4f78774dc8f2..3e298c2d349c 100644
--- a/hw/gpio/max7310.c
+++ b/hw/gpio/max7310.c
@@ -13,6 +13,7 @@
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
+#include "qemu/log.h"
 #include "qemu/module.h"
 
 #define TYPE_MAX7310 "max7310"
@@ -68,9 +69,8 @@ static uint8_t max7310_rx(I2CSlave *i2c)
         return 0xff;
 
     default:
-#ifdef VERBOSE
-        printf("%s: unknown register %02x\n", __func__, s->command);
-#endif
+        qemu_log_mask(LOG_UNIMP, "%s: Unsupported register 0x02%" PRIx8 "\n",
+                      __func__, s->command);
         break;
     }
     return 0xff;
@@ -122,9 +122,8 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data)
     case 0x00:	/* Input port - ignore writes */
         break;
     default:
-#ifdef VERBOSE
-        printf("%s: unknown register %02x\n", __func__, s->command);
-#endif
+        qemu_log_mask(LOG_UNIMP, "%s: Unsupported register 0x02%" PRIx8 "\n",
+                      __func__, s->command);
         return 1;
     }
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 06/18] Makefile: Drop extra phony cscope
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (4 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 05/18] hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP) Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 07/18] Makefile: Skip the meson subdir in cscope/TAGS/ctags Laurent Vivier
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Greg Kurz

From: Greg Kurz <groug@kaod.org>

Commit d79864058a64 added a dedicated phony line for cscope.

Fixes: d79864058a64 ("Makefile: Add back TAGS/ctags/cscope rules")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <159916246865.691541.16619858522304817323.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d6c5c9fdef1a..83bc40b255db 100644
--- a/Makefile
+++ b/Makefile
@@ -128,7 +128,7 @@ build.ninja: config-host.mak
 Makefile: ;
 configure: ;
 
-.PHONY: all clean cscope distclean install \
+.PHONY: all clean distclean install \
 	recurse-all dist msi FORCE
 
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 07/18] Makefile: Skip the meson subdir in cscope/TAGS/ctags
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (5 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 06/18] Makefile: Drop extra phony cscope Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 08/18] hw/net/e1000e: Remove overwritten read handler for STATUS register Laurent Vivier
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Laurent Vivier, Greg Kurz

From: Greg Kurz <groug@kaod.org>

If the meson submodule is present, we don't really want to index its
source code. Consolidate the find command in a single place and use
it for cscope, ctags and etags. Note that this now causes ctags and
etags to also index assembly files, but this is okay since they both
have been supporting assembly since 2001 at least.

Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <159916247553.691541.10480293747685886851.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 83bc40b255db..2ed19310cf74 100644
--- a/Makefile
+++ b/Makefile
@@ -221,20 +221,22 @@ distclean: clean ninja-distclean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
+find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o -name "*.[chsS]"
+
 .PHONY: ctags
 ctags:
 	rm -f tags
-	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
+	$(find-src-path) -exec ctags --append {} +
 
 .PHONY: TAGS
 TAGS:
 	rm -f TAGS
-	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
+	$(find-src-path) -exec etags --append {} +
 
 .PHONY: cscope
 cscope:
 	rm -f "$(SRC_PATH)"/cscope.*
-	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
+	$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
 	cscope -b -i"$(SRC_PATH)/cscope.files"
 
 # Needed by "meson install"
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 08/18] hw/net/e1000e: Remove overwritten read handler for STATUS register
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (6 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 07/18] Makefile: Skip the meson subdir in cscope/TAGS/ctags Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 09/18] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register Laurent Vivier
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Li Qiang, Laurent Vivier, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

The STATUS register readop handler is initialized first with
the generic e1000e_mac_readreg() handler:

  2861 #define e1000e_getreg(x)    [x] = e1000e_mac_readreg
  2862 typedef uint32_t (*readops)(E1000ECore *, int);
  2863 static const readops e1000e_macreg_readops[] = {
  ....
  2919     e1000e_getreg(STATUS),

Then overwritten with the specific e1000e_get_status handler:

  3018     [STATUS]  = e1000e_get_status,

To avoid confusion, remove the overwritten initialization.

6f3fbe4ed0 ("net: Introduce e1000e device emulation")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200904131402.590055-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/net/e1000e_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index bcd186cac524..5170e6a45633 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2916,7 +2916,6 @@ static const readops e1000e_macreg_readops[] = {
     e1000e_getreg(TSYNCRXCTL),
     e1000e_getreg(TDH),
     e1000e_getreg(LEDCTL),
-    e1000e_getreg(STATUS),
     e1000e_getreg(TCTL),
     e1000e_getreg(TDBAL),
     e1000e_getreg(TDLEN),
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 09/18] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (7 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 08/18] hw/net/e1000e: Remove overwritten read handler for STATUS register Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 10/18] meson.build: tweak sdl-image error message Laurent Vivier
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Li Qiang, Laurent Vivier, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

The FLSWDATA register writeop handler is initialized twice:

  3067 #define e1000e_putreg(x)    [x] = e1000e_mac_writereg
  3068 typedef void (*writeops)(E1000ECore *, int, uint32_t);
  3069 static const writeops e1000e_macreg_writeops[] = {
  ....
  3102     e1000e_putreg(FLSWDATA),
  ....
  3145     e1000e_putreg(FLSWDATA),

To avoid confusion, remove the duplicated initialization.

Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200904131402.590055-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/net/e1000e_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 5170e6a45633..bcfd46696ff7 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -3141,7 +3141,6 @@ static const writeops e1000e_macreg_writeops[] = {
     e1000e_putreg(RXCFGL),
     e1000e_putreg(TSYNCRXCTL),
     e1000e_putreg(TSYNCTXCTL),
-    e1000e_putreg(FLSWDATA),
     e1000e_putreg(EXTCNF_SIZE),
     e1000e_putreg(EEMNGCTL),
     e1000e_putreg(RA),
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 10/18] meson.build: tweak sdl-image error message
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (8 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 09/18] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 11/18] kconfig: fix comment referring to old Makefiles Laurent Vivier
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Rafael Kitover, qemu-trivial, Laurent Vivier, Sergei Trofimovich,
	Marc-André Lureau, Paolo Bonzini,
	Philippe Mathieu-Daudé

From: Sergei Trofimovich <slyfox@gentoo.org>

Before the change missing SDL was reported as:

    ../meson.build:253:4: ERROR: Expected 1 arguments, got 2.

After the error as:

    ../meson.build:258:4: ERROR: Problem encountered: sdl-image required, but SDL was not found

CC: Paolo Bonzini <pbonzini@redhat.com>
CC: "Marc-André Lureau" <marcandre.lureau@redhat.com>
CC: "Philippe Mathieu-Daudé" <philmd@redhat.com>
CC: Rafael Kitover <rkitover@gmail.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200908074016.2593596-1-slyfox@gentoo.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 5421eca66a02..9dec3f5b2d4f 100644
--- a/meson.build
+++ b/meson.build
@@ -273,8 +273,8 @@ if sdl.found()
                          method: 'pkg-config', static: enable_static)
 else
   if get_option('sdl_image').enabled()
-    error('sdl-image required, but SDL was @0@',
-          get_option('sdl').disabled() ? 'disabled' : 'not found')
+    error('sdl-image required, but SDL was @0@'.format(
+          get_option('sdl').disabled() ? 'disabled' : 'not found'))
   endif
   sdl_image = not_found
 endif
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 11/18] kconfig: fix comment referring to old Makefiles
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (9 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 10/18] meson.build: tweak sdl-image error message Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 12/18] hw: hyperv: vmbus: Fix 32bit compilation Laurent Vivier
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé, Laurent Vivier

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200908094244.26327-1-pbonzini@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 Kconfig.host | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Kconfig.host b/Kconfig.host
index a6d871c399d0..4af19bf70ef9 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -1,6 +1,6 @@
 # These are "proxy" symbols used to pass config-host.mak values
-# down to Kconfig.  See also MINIKCONF_ARGS in the Makefile:
-# these two need to be kept in sync.
+# down to Kconfig.  See also kconfig_external_symbols in
+# meson.build: these two need to be kept in sync.
 
 config LINUX
     bool
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 12/18] hw: hyperv: vmbus: Fix 32bit compilation
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (10 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 11/18] kconfig: fix comment referring to old Makefiles Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 13/18] test-vmstate: remove unnecessary code in match_interval_mapping_node Laurent Vivier
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Aleksandar Markovic, Laurent Vivier, Jon Doron

From: Jon Doron <arilou@gmail.com>

Fix 32-bit build error for vmbus:

  hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
  hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  383 |         p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
      |             ^
  cc1: all warnings being treated as errors

Fixes: 0d71f7082d7 ("vmbus: vmbus implementation")
Signed-off-by: Jon Doron <arilou@gmail.com>
Tested-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Message-Id: <20200715084326.678715-3-arilou@gmail.com>
[lv: updated with commit description from <20200906050113.2783642-1-richard.henderson@linaro.org>]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 75af6b83dde7..6ef895bc352b 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -380,7 +380,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 13/18] test-vmstate: remove unnecessary code in match_interval_mapping_node
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (11 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 12/18] hw: hyperv: vmbus: Fix 32bit compilation Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 14/18] target/i386/kvm: Rename host_tsx_blacklisted() as host_tsx_broken() Laurent Vivier
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Li Qiang, Thomas Huth, Pan Nengyuan, Laurent Vivier

From: Pan Nengyuan <pannengyuan@huawei.com>

'str' is not used in match_interval_mapping_node(), remove it.

Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200910023818.11880-1-pannengyuan@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 tests/test-vmstate.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index f8de709a0b2b..1c763015d03c 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -1055,9 +1055,6 @@ static gboolean match_interval_mapping_node(gpointer key,
     TestGTreeMapping *map_a, *map_b;
     TestGTreeInterval *a, *b;
     struct match_node_data *d = (struct match_node_data *)data;
-    char *str = g_strdup_printf("dest");
-
-    g_free(str);
     a = (TestGTreeInterval *)key;
     b = (TestGTreeInterval *)d->key;
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 14/18] target/i386/kvm: Rename host_tsx_blacklisted() as host_tsx_broken()
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (12 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 13/18] test-vmstate: remove unnecessary code in match_interval_mapping_node Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 15/18] hw/arm/pxa2xx: Add missing fallthrough comment Laurent Vivier
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Thomas Huth,
	Philippe Mathieu-Daudé,
	Laurent Vivier

From: Philippe Mathieu-Daudé <philmd@redhat.com>

In order to use inclusive terminology, rename host_tsx_blacklisted()
as host_tsx_broken().

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200910070131.435543-7-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/i386/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 205b68bc0ce8..3d640a8decf6 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -302,7 +302,7 @@ static int get_para_features(KVMState *s)
     return features;
 }
 
-static bool host_tsx_blacklisted(void)
+static bool host_tsx_broken(void)
 {
     int family, model, stepping;\
     char vendor[CPUID_VENDOR_SZ + 1];
@@ -408,7 +408,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
     } else if (function == 6 && reg == R_EAX) {
         ret |= CPUID_6_EAX_ARAT; /* safe to allow because of emulated APIC */
     } else if (function == 7 && index == 0 && reg == R_EBX) {
-        if (host_tsx_blacklisted()) {
+        if (host_tsx_broken()) {
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
         }
     } else if (function == 7 && index == 0 && reg == R_EDX) {
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 15/18] hw/arm/pxa2xx: Add missing fallthrough comment
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (13 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 14/18] target/i386/kvm: Rename host_tsx_blacklisted() as host_tsx_broken() Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 16/18] util/hexdump: Convert to take a void pointer argument Laurent Vivier
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Thomas Huth, Laurent Vivier, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here,
so we should add the corresponding "/* fallthrough */" comment here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200911121844.404434-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 76975d17a461..c1f45b2adfa0 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -443,7 +443,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
             s->mm_regs[addr >> 2] = value;
             break;
         }
-
+        /* fallthrough */
     default:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Bad write offset 0x%"HWADDR_PRIx"\n",
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 16/18] util/hexdump: Convert to take a void pointer argument
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (14 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 15/18] hw/arm/pxa2xx: Add missing fallthrough comment Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 17/18] util/hexdump: Reorder qemu_hexdump() arguments Laurent Vivier
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Edgar E . Iglesias, qemu-trivial, Li Qiang, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Stefano Garzarella

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Most uses of qemu_hexdump() do not take an array of char
as input, forcing use of cast. Since we can use this
helper to dump any kind of buffer, use a pointer to void
argument instead.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200822180950.1343963-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/dma/xlnx_dpdma.c      |  2 +-
 hw/net/fsl_etsec/etsec.c |  2 +-
 hw/sd/sd.c               |  2 +-
 hw/usb/redirect.c        |  2 +-
 include/qemu-common.h    |  3 ++-
 net/colo-compare.c       | 12 ++++++------
 net/net.c                |  2 +-
 util/hexdump.c           |  4 +++-
 8 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/hw/dma/xlnx_dpdma.c b/hw/dma/xlnx_dpdma.c
index b40c897de2c7..d75a8069426f 100644
--- a/hw/dma/xlnx_dpdma.c
+++ b/hw/dma/xlnx_dpdma.c
@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc)
 {
     if (DEBUG_DPDMA) {
         qemu_log("DUMP DESCRIPTOR:\n");
-        qemu_hexdump((char *)desc, stdout, "", sizeof(DPDMADescriptor));
+        qemu_hexdump(desc, stdout, "", sizeof(DPDMADescriptor));
     }
 }
 
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index ad20b22cdd26..5c40303f93c1 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -357,7 +357,7 @@ static ssize_t etsec_receive(NetClientState *nc,
 
 #if defined(HEX_DUMP)
     fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
-    qemu_hexdump((void *)buf, stderr, "", size);
+    qemu_hexdump(buf, stderr, "", size);
 #endif
     /* Flush is unnecessary as are already in receiving path */
     etsec->need_flush = false;
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 483c4f172045..1c8f8529ea88 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1785,7 +1785,7 @@ send_response:
     }
 
 #ifdef DEBUG_SD
-    qemu_hexdump((const char *)response, stderr, "Response", rsplen);
+    qemu_hexdump(response, stderr, "Response", rsplen);
 #endif
 
     return rsplen;
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 417a60a2e680..09edb0d81c07 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
     if (dev->debug < usbredirparser_debug_data) {
         return;
     }
-    qemu_hexdump((char *)data, stderr, desc, len);
+    qemu_hexdump(data, stderr, desc, len);
 }
 
 /*
diff --git a/include/qemu-common.h b/include/qemu-common.h
index bb9496bd80fe..6834883822f1 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -138,7 +138,8 @@ int os_parse_cmd_args(int index, const char *optarg);
  * Hexdump a buffer to a file. An optional string prefix is added to every line
  */
 
-void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
+void qemu_hexdump(const void *bufptr, FILE *fp,
+                  const char *prefix, size_t size);
 
 /*
  * helper to parse debug environment variables
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 2c20de1537d4..550272b3baa6 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -494,9 +494,9 @@ sec:
         g_queue_push_head(&conn->secondary_list, spkt);
 
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump((char *)ppkt->data, stderr,
+            qemu_hexdump(ppkt->data, stderr,
                         "colo-compare ppkt", ppkt->size);
-            qemu_hexdump((char *)spkt->data, stderr,
+            qemu_hexdump(spkt->data, stderr,
                         "colo-compare spkt", spkt->size);
         }
 
@@ -535,9 +535,9 @@ static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt)
         trace_colo_compare_udp_miscompare("primary pkt size", ppkt->size);
         trace_colo_compare_udp_miscompare("Secondary pkt size", spkt->size);
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt",
+            qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
                          ppkt->size);
-            qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt",
+            qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
                          spkt->size);
         }
         return -1;
@@ -578,9 +578,9 @@ static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)
         trace_colo_compare_icmp_miscompare("Secondary pkt size",
                                            spkt->size);
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt",
+            qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
                          ppkt->size);
-            qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt",
+            qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
                          spkt->size);
         }
         return -1;
diff --git a/net/net.c b/net/net.c
index bbaedb3c7a6d..f3e5d533fd74 100644
--- a/net/net.c
+++ b/net/net.c
@@ -636,7 +636,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
 
 #ifdef DEBUG_NET
     printf("qemu_send_packet_async:\n");
-    qemu_hexdump((const char *)buf, stdout, "net", size);
+    qemu_hexdump(buf, stdout, "net", size);
 #endif
 
     if (sender->link_down || !sender->peer) {
diff --git a/util/hexdump.c b/util/hexdump.c
index f879ff0ad6b6..053f05d41603 100644
--- a/util/hexdump.c
+++ b/util/hexdump.c
@@ -16,8 +16,10 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
+void qemu_hexdump(const void *bufptr, FILE *fp,
+                  const char *prefix, size_t size)
 {
+    const char *buf = bufptr;
     unsigned int b, len, i, c;
 
     for (b = 0; b < size; b += 16) {
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 17/18] util/hexdump: Reorder qemu_hexdump() arguments
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (15 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 16/18] util/hexdump: Convert to take a void pointer argument Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-11 19:33 ` [PULL 18/18] target/i386/kvm: Add missing fallthrough comment Laurent Vivier
  2020-09-12 20:16 ` [PULL 00/18] Trivial branch for 5.2 patches Peter Maydell
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Edgar E . Iglesias, Peter Maydell, qemu-trivial, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Stefano Garzarella

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

qemu_hexdump()'s pointer to the buffer and length of the
buffer are closely related arguments but are widely separated
in the argument list order (also, the format of <stdio.h>
function prototypes is usually to have the FILE* argument
coming first).

Reorder the arguments as "fp, prefix, buf, size" which is
more logical.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200822180950.1343963-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/dma/xlnx_dpdma.c      |  2 +-
 hw/net/fsl_etsec/etsec.c |  2 +-
 hw/net/fsl_etsec/rings.c |  2 +-
 hw/sd/sd.c               |  2 +-
 hw/usb/redirect.c        |  2 +-
 include/qemu-common.h    |  4 ++--
 net/colo-compare.c       | 24 ++++++++++++------------
 net/net.c                |  2 +-
 util/hexdump.c           |  4 ++--
 util/iov.c               |  2 +-
 10 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/hw/dma/xlnx_dpdma.c b/hw/dma/xlnx_dpdma.c
index d75a8069426f..967548abd315 100644
--- a/hw/dma/xlnx_dpdma.c
+++ b/hw/dma/xlnx_dpdma.c
@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc)
 {
     if (DEBUG_DPDMA) {
         qemu_log("DUMP DESCRIPTOR:\n");
-        qemu_hexdump(desc, stdout, "", sizeof(DPDMADescriptor));
+        qemu_hexdump(stdout, "", desc, sizeof(DPDMADescriptor));
     }
 }
 
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index 5c40303f93c1..93886bba60fc 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -357,7 +357,7 @@ static ssize_t etsec_receive(NetClientState *nc,
 
 #if defined(HEX_DUMP)
     fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
-    qemu_hexdump(buf, stderr, "", size);
+    qemu_hexdump(stderr, "", buf, size);
 #endif
     /* Flush is unnecessary as are already in receiving path */
     etsec->need_flush = false;
diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c
index 337a55fc957c..628648a9c37f 100644
--- a/hw/net/fsl_etsec/rings.c
+++ b/hw/net/fsl_etsec/rings.c
@@ -269,7 +269,7 @@ static void process_tx_bd(eTSEC         *etsec,
 
 #if defined(HEX_DUMP)
             qemu_log("eTSEC Send packet size:%d\n", etsec->tx_buffer_len);
-            qemu_hexdump(etsec->tx_buffer, stderr, "", etsec->tx_buffer_len);
+            qemu_hexdump(stderr, "", etsec->tx_buffer, etsec->tx_buffer_len);
 #endif  /* ETSEC_RING_DEBUG */
 
             if (etsec->first_bd.flags & BD_TX_TOEUN) {
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1c8f8529ea88..00128822224d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1785,7 +1785,7 @@ send_response:
     }
 
 #ifdef DEBUG_SD
-    qemu_hexdump(response, stderr, "Response", rsplen);
+    qemu_hexdump(stderr, "Response", response, rsplen);
 #endif
 
     return rsplen;
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 09edb0d81c07..48f38d339124 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
     if (dev->debug < usbredirparser_debug_data) {
         return;
     }
-    qemu_hexdump(data, stderr, desc, len);
+    qemu_hexdump(stderr, desc, data, len);
 }
 
 /*
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 6834883822f1..9cfd62669bf8 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -138,8 +138,8 @@ int os_parse_cmd_args(int index, const char *optarg);
  * Hexdump a buffer to a file. An optional string prefix is added to every line
  */
 
-void qemu_hexdump(const void *bufptr, FILE *fp,
-                  const char *prefix, size_t size);
+void qemu_hexdump(FILE *fp, const char *prefix,
+                  const void *bufptr, size_t size);
 
 /*
  * helper to parse debug environment variables
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 550272b3baa6..4a5ed642e9a5 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -494,10 +494,10 @@ sec:
         g_queue_push_head(&conn->secondary_list, spkt);
 
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump(ppkt->data, stderr,
-                        "colo-compare ppkt", ppkt->size);
-            qemu_hexdump(spkt->data, stderr,
-                        "colo-compare spkt", spkt->size);
+            qemu_hexdump(stderr, "colo-compare ppkt",
+                         ppkt->data, ppkt->size);
+            qemu_hexdump(stderr, "colo-compare spkt",
+                         spkt->data, spkt->size);
         }
 
         colo_compare_inconsistency_notify(s);
@@ -535,10 +535,10 @@ static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt)
         trace_colo_compare_udp_miscompare("primary pkt size", ppkt->size);
         trace_colo_compare_udp_miscompare("Secondary pkt size", spkt->size);
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
-                         ppkt->size);
-            qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
-                         spkt->size);
+            qemu_hexdump(stderr, "colo-compare pri pkt",
+                         ppkt->data, ppkt->size);
+            qemu_hexdump(stderr, "colo-compare sec pkt",
+                         spkt->data, spkt->size);
         }
         return -1;
     } else {
@@ -578,10 +578,10 @@ static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)
         trace_colo_compare_icmp_miscompare("Secondary pkt size",
                                            spkt->size);
         if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
-            qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
-                         ppkt->size);
-            qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
-                         spkt->size);
+            qemu_hexdump(stderr, "colo-compare pri pkt",
+                         ppkt->data, ppkt->size);
+            qemu_hexdump(stderr, "colo-compare sec pkt",
+                         spkt->data, spkt->size);
         }
         return -1;
     } else {
diff --git a/net/net.c b/net/net.c
index f3e5d533fd74..7a2a0fb5ac67 100644
--- a/net/net.c
+++ b/net/net.c
@@ -636,7 +636,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
 
 #ifdef DEBUG_NET
     printf("qemu_send_packet_async:\n");
-    qemu_hexdump(buf, stdout, "net", size);
+    qemu_hexdump(stdout, "net", buf, size);
 #endif
 
     if (sender->link_down || !sender->peer) {
diff --git a/util/hexdump.c b/util/hexdump.c
index 053f05d41603..0b4662e701d8 100644
--- a/util/hexdump.c
+++ b/util/hexdump.c
@@ -16,8 +16,8 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-void qemu_hexdump(const void *bufptr, FILE *fp,
-                  const char *prefix, size_t size)
+void qemu_hexdump(FILE *fp, const char *prefix,
+                  const void *bufptr, size_t size)
 {
     const char *buf = bufptr;
     unsigned int b, len, i, c;
diff --git a/util/iov.c b/util/iov.c
index 45ef3043eec6..ae61d696aae2 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -237,7 +237,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt,
     size = size > limit ? limit : size;
     buf = g_malloc(size);
     iov_to_buf(iov, iov_cnt, 0, buf, size);
-    qemu_hexdump(buf, fp, prefix, size);
+    qemu_hexdump(fp, prefix, buf, size);
     g_free(buf);
 }
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PULL 18/18] target/i386/kvm: Add missing fallthrough comment
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (16 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 17/18] util/hexdump: Reorder qemu_hexdump() arguments Laurent Vivier
@ 2020-09-11 19:33 ` Laurent Vivier
  2020-09-12 20:16 ` [PULL 00/18] Trivial branch for 5.2 patches Peter Maydell
  18 siblings, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2020-09-11 19:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Thomas Huth, Laurent Vivier

From: Thomas Huth <thuth@redhat.com>

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here,
so we should add the corresponding "/* fallthrough */" comment here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200911125301.413081-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/i386/kvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 3d640a8decf6..d87af57a23ce 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1568,6 +1568,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
             if (env->nr_dies < 2) {
                 break;
             }
+            /* fallthrough */
         case 4:
         case 0xb:
         case 0xd:
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PULL 00/18] Trivial branch for 5.2 patches
  2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
                   ` (17 preceding siblings ...)
  2020-09-11 19:33 ` [PULL 18/18] target/i386/kvm: Add missing fallthrough comment Laurent Vivier
@ 2020-09-12 20:16 ` Peter Maydell
  18 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2020-09-12 20:16 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Trivial, QEMU Developers

On Fri, 11 Sep 2020 at 20:35, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit 9435a8b3dd35f1f926f1b9127e8a906217a5518a:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/sirius/ipxe-20200908-pull=
> -request' into staging (2020-09-08 21:21:13 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/trivial-branch-for-5.2-pull-request
>
> for you to fetch changes up to 8821e21414468b1810f0ccf38bcbfa5c0bd1d56b:
>
>   target/i386/kvm: Add missing fallthrough comment (2020-09-11 21:25:59 +0200)
>
> ----------------------------------------------------------------
> trivial patches pull request 20200911
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-09-12 20:17 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 19:33 [PULL 00/18] Trivial branch for 5.2 patches Laurent Vivier
2020-09-11 19:33 ` [PULL 01/18] hw/mips/fuloong2e: Convert pointless error message to an assert() Laurent Vivier
2020-09-11 19:33 ` [PULL 02/18] hw/isa/isa-bus: Replace hw_error() by assert() Laurent Vivier
2020-09-11 19:33 ` [PULL 03/18] hw/acpi/tco: Remove unused definitions Laurent Vivier
2020-09-11 19:33 ` [PULL 04/18] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR) Laurent Vivier
2020-09-11 19:33 ` [PULL 05/18] hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP) Laurent Vivier
2020-09-11 19:33 ` [PULL 06/18] Makefile: Drop extra phony cscope Laurent Vivier
2020-09-11 19:33 ` [PULL 07/18] Makefile: Skip the meson subdir in cscope/TAGS/ctags Laurent Vivier
2020-09-11 19:33 ` [PULL 08/18] hw/net/e1000e: Remove overwritten read handler for STATUS register Laurent Vivier
2020-09-11 19:33 ` [PULL 09/18] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register Laurent Vivier
2020-09-11 19:33 ` [PULL 10/18] meson.build: tweak sdl-image error message Laurent Vivier
2020-09-11 19:33 ` [PULL 11/18] kconfig: fix comment referring to old Makefiles Laurent Vivier
2020-09-11 19:33 ` [PULL 12/18] hw: hyperv: vmbus: Fix 32bit compilation Laurent Vivier
2020-09-11 19:33 ` [PULL 13/18] test-vmstate: remove unnecessary code in match_interval_mapping_node Laurent Vivier
2020-09-11 19:33 ` [PULL 14/18] target/i386/kvm: Rename host_tsx_blacklisted() as host_tsx_broken() Laurent Vivier
2020-09-11 19:33 ` [PULL 15/18] hw/arm/pxa2xx: Add missing fallthrough comment Laurent Vivier
2020-09-11 19:33 ` [PULL 16/18] util/hexdump: Convert to take a void pointer argument Laurent Vivier
2020-09-11 19:33 ` [PULL 17/18] util/hexdump: Reorder qemu_hexdump() arguments Laurent Vivier
2020-09-11 19:33 ` [PULL 18/18] target/i386/kvm: Add missing fallthrough comment Laurent Vivier
2020-09-12 20:16 ` [PULL 00/18] Trivial branch for 5.2 patches Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.