All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Random cleanup patches
@ 2022-05-05 16:17 Bernhard Beschow
  2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bernhard Beschow

This patch series contains random cleanups that I made while studying the code.

Bernhard Beschow (11):
  hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
  hw: Reuse TYPE_I8042 define
  hw/audio/cs4231a: Const'ify global tables
  hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro
  hw/i386/pc: Unexport functions used only internally
  hw/i386/pc: Remove orphan declarations
  hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE
  hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create()
  accel/tcg/cpu-exec: Unexport dump_drift_info()
  accel/tcg: Inline dump_opcount_info() and remove it
  docs/devel: Fix link to developer mailing lists

 accel/tcg/cpu-exec.c              |  4 ++--
 accel/tcg/translate-all.c         |  5 -----
 docs/devel/submitting-a-patch.rst |  6 +++---
 hw/audio/cs4231a.c                |  8 ++++----
 hw/i386/pc.c                      | 17 +++++++++++++----
 hw/isa/isa-bus.c                  |  6 ------
 hw/net/fsl_etsec/etsec.c          | 23 -----------------------
 hw/net/fsl_etsec/etsec.h          |  7 -------
 hw/ppc/e500.c                     |  1 -
 hw/rtc/mc146818rtc.c              |  3 ++-
 hw/sparc64/sun4u.c                |  2 +-
 include/exec/cpu-all.h            |  3 ---
 include/hw/i386/pc.h              | 14 --------------
 include/hw/isa/isa.h              |  1 -
 14 files changed, 25 insertions(+), 75 deletions(-)

-- 
2.36.0



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

* [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
@ 2022-05-05 16:17 ` Bernhard Beschow
  2022-05-09 12:09   ` Philippe Mathieu-Daudé
  2022-05-11 10:24   ` Mark Cave-Ayland
  2022-05-05 16:17 ` [PATCH 02/11] hw: Reuse TYPE_I8042 define Bernhard Beschow
                   ` (10 subsequent siblings)
  11 siblings, 2 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Michael S. Tsirkin, Paolo Bonzini

Commit 250263033c5343012b2cd6f01210ffb5b908a159 'isa: introduce wrapper
isa_connect_gpio_out' introduced it in 2016. Since then, its only user
remained mc146818rtc. Remove this one-off solution.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/isa/isa-bus.c     | 6 ------
 hw/rtc/mc146818rtc.c | 3 ++-
 include/hw/isa/isa.h | 1 -
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 0ad1c5fd65..59eb1af9e3 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -85,12 +85,6 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
     return isabus->irqs[isairq];
 }
 
-void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq)
-{
-    qemu_irq irq = isa_get_irq(isadev, isairq);
-    qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq);
-}
-
 void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16)
 {
     assert(bus && dma8 && dma16);
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index f235c2ddbe..79c43391cb 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -972,7 +972,8 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
     if (intercept_irq) {
         qdev_connect_gpio_out(dev, 0, intercept_irq);
     } else {
-        isa_connect_gpio_out(isadev, 0, s->isairq);
+        qemu_irq irq = isa_get_irq(isadev, s->isairq);
+        qdev_connect_gpio_out(dev, 0, irq);
     }
 
     object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isadev),
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 034d706ba1..1b758ae1ab 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -90,7 +90,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space,
                     MemoryRegion *address_space_io, Error **errp);
 void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
 qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq);
-void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq);
 void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
 IsaDma *isa_get_dma(ISABus *bus, int nchan);
 MemoryRegion *isa_address_space(ISADevice *dev);
-- 
2.36.0



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

* [PATCH 02/11] hw: Reuse TYPE_I8042 define
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
  2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
@ 2022-05-05 16:17 ` Bernhard Beschow
  2022-05-09 12:12   ` Philippe Mathieu-Daudé via
  2022-05-05 16:17 ` [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables Bernhard Beschow
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost, Mark Cave-Ayland, Artyom Tarasenko

TYPE_I8042 is exported, so reuse it for consistency.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/i386/pc.c       | 4 ++--
 hw/sparc64/sun4u.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 23bba9d82c..649511a49b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1042,7 +1042,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
         return;
     }
 
-    i8042 = isa_create_simple(isa_bus, "i8042");
+    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
     if (!no_vmport) {
         isa_create_simple(isa_bus, TYPE_VMPORT);
         vmmouse = isa_try_new("vmmouse");
@@ -1050,7 +1050,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
         vmmouse = NULL;
     }
     if (vmmouse) {
-        object_property_set_link(OBJECT(vmmouse), "i8042", OBJECT(i8042),
+        object_property_set_link(OBJECT(vmmouse), TYPE_I8042, OBJECT(i8042),
                                  &error_abort);
         isa_realize_and_unref(vmmouse, isa_bus, &error_fatal);
     }
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 6fd08e2298..77687dc649 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -334,7 +334,7 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp)
     parallel_hds_isa_init(s->isa_bus, MAX_PARALLEL_PORTS);
 
     /* Keyboard */
-    isa_create_simple(s->isa_bus, "i8042");
+    isa_create_simple(s->isa_bus, TYPE_I8042);
 
     /* Floppy */
     for (i = 0; i < MAX_FD; i++) {
-- 
2.36.0



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

* [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
  2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
  2022-05-05 16:17 ` [PATCH 02/11] hw: Reuse TYPE_I8042 define Bernhard Beschow
@ 2022-05-05 16:17 ` Bernhard Beschow
  2022-05-09 12:13   ` Philippe Mathieu-Daudé via
  2022-05-05 16:17 ` [PATCH 04/11] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro Bernhard Beschow
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bernhard Beschow, Gerd Hoffmann

The tables contain spcifically crafted constants for algorithms, so make
them immutable.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/audio/cs4231a.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 0723e39430..7f17a72a9c 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -84,7 +84,7 @@ struct CSState {
     int transferred;
     int aci_counter;
     SWVoiceOut *voice;
-    int16_t *tab;
+    const int16_t *tab;
 };
 
 #define MODE2 (1 << 6)
@@ -142,13 +142,13 @@ enum {
     Capture_Lower_Base_Count
 };
 
-static int freqs[2][8] = {
+static const int freqs[2][8] = {
     { 8000, 16000, 27420, 32000,    -1,    -1, 48000, 9000 },
     { 5510, 11025, 18900, 22050, 37800, 44100, 33075, 6620 }
 };
 
 /* Tables courtesy http://hazelware.luggle.com/tutorials/mulawcompression.html */
-static int16_t MuLawDecompressTable[256] =
+static const int16_t MuLawDecompressTable[256] =
 {
      -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,
      -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,
@@ -184,7 +184,7 @@ static int16_t MuLawDecompressTable[256] =
          56,    48,    40,    32,    24,    16,     8,     0
 };
 
-static int16_t ALawDecompressTable[256] =
+static const int16_t ALawDecompressTable[256] =
 {
      -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736,
      -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784,
-- 
2.36.0



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

* [PATCH 04/11] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (2 preceding siblings ...)
  2022-05-05 16:17 ` [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables Bernhard Beschow
@ 2022-05-05 16:17 ` Bernhard Beschow
  2022-05-05 16:17 ` [PATCH 05/11] hw/i386/pc: Unexport functions used only internally Bernhard Beschow
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost

The macro seems to be used only internally, so remove it.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/i386/pc.c         | 9 +++++++++
 include/hw/i386/pc.h | 8 --------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 649511a49b..c2975d7de5 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -95,6 +95,15 @@
 #include "trace.h"
 #include CONFIG_DEVICES
 
+/*
+ * Helper for setting model-id for CPU models that changed model-id
+ * depending on QEMU versions up to QEMU 2.4.
+ */
+#define PC_CPU_MODEL_IDS(v) \
+    { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\
+    { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\
+    { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },
+
 GlobalProperty pc_compat_7_0[] = {};
 const size_t pc_compat_7_0_len = G_N_ELEMENTS(pc_compat_7_0);
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 637367dc5f..b34c664ff5 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -289,14 +289,6 @@ extern const size_t pc_compat_1_5_len;
 extern GlobalProperty pc_compat_1_4[];
 extern const size_t pc_compat_1_4_len;
 
-/* Helper for setting model-id for CPU models that changed model-id
- * depending on QEMU versions up to QEMU 2.4.
- */
-#define PC_CPU_MODEL_IDS(v) \
-    { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\
-    { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\
-    { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },
-
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
     { \
-- 
2.36.0



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

* [PATCH 05/11] hw/i386/pc: Unexport functions used only internally
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (3 preceding siblings ...)
  2022-05-05 16:17 ` [PATCH 04/11] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro Bernhard Beschow
@ 2022-05-05 16:17 ` Bernhard Beschow
  2022-05-09 12:14   ` Philippe Mathieu-Daudé via
  2022-05-05 16:18 ` [PATCH 06/11] hw/i386/pc: Remove orphan declarations Bernhard Beschow
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/i386/pc.c         | 4 ++--
 include/hw/i386/pc.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c2975d7de5..789fe9afdc 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -569,7 +569,7 @@ static const char * const fdc_container_path[] = {
  * Locate the FDC at IO address 0x3f0, in order to configure the CMOS registers
  * and ACPI objects.
  */
-ISADevice *pc_find_fdc0(void)
+static ISADevice *pc_find_fdc0(void)
 {
     int i;
     Object *container;
@@ -713,7 +713,7 @@ static const int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360,
                                               0x280, 0x380 };
 static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };
 
-void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd)
+static void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd)
 {
     static int nb_ne2k = 0;
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index b34c664ff5..a087ea7598 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -168,7 +168,6 @@ void pc_basic_device_init(struct PCMachineState *pcms,
                           ISADevice **rtc_state,
                           bool create_fdctrl,
                           uint32_t hpet_irqs);
-void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
 void pc_cmos_init(PCMachineState *pcms,
                   BusState *ide0, BusState *ide1,
                   ISADevice *s);
@@ -179,8 +178,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg);
 
 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs);
 
-ISADevice *pc_find_fdc0(void);
-
 /* port92.c */
 #define PORT92_A20_LINE "a20"
 
-- 
2.36.0



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

* [PATCH 06/11] hw/i386/pc: Remove orphan declarations
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (4 preceding siblings ...)
  2022-05-05 16:17 ` [PATCH 05/11] hw/i386/pc: Unexport functions used only internally Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-05 16:18 ` [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE Bernhard Beschow
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Michael S. Tsirkin, Marcel Apfelbaum

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/i386/pc.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index a087ea7598..2cd58ee0c6 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -172,9 +172,6 @@ void pc_cmos_init(PCMachineState *pcms,
                   BusState *ide0, BusState *ide1,
                   ISADevice *s);
 void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus);
-void pc_pci_device_init(PCIBus *pci_bus);
-
-typedef void (*cpu_set_smm_t)(int smm, void *arg);
 
 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs);
 
-- 
2.36.0



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

* [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (5 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 06/11] hw/i386/pc: Remove orphan declarations Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-05 16:59   ` Daniel Henrique Barboza
  2022-05-05 16:18 ` [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create() Bernhard Beschow
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bernhard Beschow, open list:e500

Commit 28290f37e20cda27574f15be9e9499493e3d0fe8 'PPC: E500: Generate
device tree on reset' improved device tree generation and made
BINARY_DEVICE_TREE_FILE obsolete.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/ppc/e500.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 2bc3dce1fb..7f7f5b3452 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -47,7 +47,6 @@
 #include "hw/irq.h"
 
 #define EPAPR_MAGIC                (0x45504150)
-#define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
 #define DTC_LOAD_PAD               0x1800000
 #define DTC_PAD_MASK               0xFFFFF
 #define DTB_MAX_SIZE               (8 * MiB)
-- 
2.36.0



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

* [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create()
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (6 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-09 12:15   ` Philippe Mathieu-Daudé via
  2022-05-05 16:18 ` [PATCH 09/11] accel/tcg/cpu-exec: Unexport dump_drift_info() Bernhard Beschow
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bernhard Beschow, Jason Wang, open list:e500

etsec_create() wraps qdev API which is outdated. It is also unused,
so remove it.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/net/fsl_etsec/etsec.c | 23 -----------------------
 hw/net/fsl_etsec/etsec.h |  7 -------
 2 files changed, 30 deletions(-)

diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index 6d50c39543..24deb47cff 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -443,26 +443,3 @@ static void etsec_register_types(void)
 }
 
 type_init(etsec_register_types)
-
-DeviceState *etsec_create(hwaddr         base,
-                          MemoryRegion * mr,
-                          NICInfo      * nd,
-                          qemu_irq       tx_irq,
-                          qemu_irq       rx_irq,
-                          qemu_irq       err_irq)
-{
-    DeviceState *dev;
-
-    dev = qdev_new("eTSEC");
-    qdev_set_nic_properties(dev, nd);
-    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
-
-    sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, tx_irq);
-    sysbus_connect_irq(SYS_BUS_DEVICE(dev), 1, rx_irq);
-    sysbus_connect_irq(SYS_BUS_DEVICE(dev), 2, err_irq);
-
-    memory_region_add_subregion(mr, base,
-                                SYS_BUS_DEVICE(dev)->mmio[0].memory);
-
-    return dev;
-}
diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h
index fddf551544..3c625c955c 100644
--- a/hw/net/fsl_etsec/etsec.h
+++ b/hw/net/fsl_etsec/etsec.h
@@ -155,13 +155,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(eTSEC, ETSEC_COMMON)
 #define eTSEC_TRANSMIT 1
 #define eTSEC_RECEIVE  2
 
-DeviceState *etsec_create(hwaddr        base,
-                          MemoryRegion *mr,
-                          NICInfo      *nd,
-                          qemu_irq      tx_irq,
-                          qemu_irq      rx_irq,
-                          qemu_irq      err_irq);
-
 void etsec_update_irq(eTSEC *etsec);
 
 void etsec_walk_tx_ring(eTSEC *etsec, int ring_nbr);
-- 
2.36.0



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

* [PATCH 09/11] accel/tcg/cpu-exec: Unexport dump_drift_info()
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (7 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create() Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-05 16:18 ` [PATCH 10/11] accel/tcg: Inline dump_opcount_info() and remove it Bernhard Beschow
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Richard Henderson, Paolo Bonzini

Commit 3a841ab53f165910224dc4bebabf1a8f1d04200c 'qapi: introduce
x-query-jit QMP command' basically moved the only function using
dump_drift_info() to cpu-exec.c. Therefore, dump_drift_info() doesn't
need to be exported any longer.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 accel/tcg/cpu-exec.c   | 2 +-
 include/exec/cpu-all.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 635aeecc0a..7cbf9996b7 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -1048,7 +1048,7 @@ void tcg_exec_unrealizefn(CPUState *cpu)
 
 #ifndef CONFIG_USER_ONLY
 
-void dump_drift_info(GString *buf)
+static void dump_drift_info(GString *buf)
 {
     if (!icount_enabled()) {
         return;
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 5d5290deb5..9a716be80d 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -419,8 +419,6 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr)
 }
 
 #ifdef CONFIG_TCG
-/* accel/tcg/cpu-exec.c */
-void dump_drift_info(GString *buf);
 /* accel/tcg/translate-all.c */
 void dump_exec_info(GString *buf);
 void dump_opcount_info(GString *buf);
-- 
2.36.0



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

* [PATCH 10/11] accel/tcg: Inline dump_opcount_info() and remove it
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (8 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 09/11] accel/tcg/cpu-exec: Unexport dump_drift_info() Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-05 16:18 ` [PATCH 11/11] docs/devel: Fix link to developer mailing lists Bernhard Beschow
  2022-05-13 11:27 ` [PATCH 00/11] Random cleanup patches Michael S. Tsirkin
  11 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Bernhard Beschow, Richard Henderson, Paolo Bonzini

dump_opcount_info() is a one-line wrapper around tcg_dump_op_count()
which is also exported. So use the latter directly.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 accel/tcg/cpu-exec.c      | 2 +-
 accel/tcg/translate-all.c | 5 -----
 include/exec/cpu-all.h    | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 7cbf9996b7..a565a3f8ec 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -1091,7 +1091,7 @@ HumanReadableText *qmp_x_query_opcount(Error **errp)
         return NULL;
     }
 
-    dump_opcount_info(buf);
+    tcg_dump_op_count(buf);
 
     return human_readable_text_from_str(buf);
 }
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 291034cb09..8fd23a9d05 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2124,11 +2124,6 @@ void dump_exec_info(GString *buf)
     tcg_dump_info(buf);
 }
 
-void dump_opcount_info(GString *buf)
-{
-    tcg_dump_op_count(buf);
-}
-
 #else /* CONFIG_USER_ONLY */
 
 void cpu_interrupt(CPUState *cpu, int mask)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 9a716be80d..f5bda2c3ca 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -421,7 +421,6 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr)
 #ifdef CONFIG_TCG
 /* accel/tcg/translate-all.c */
 void dump_exec_info(GString *buf);
-void dump_opcount_info(GString *buf);
 #endif /* CONFIG_TCG */
 
 #endif /* !CONFIG_USER_ONLY */
-- 
2.36.0



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

* [PATCH 11/11] docs/devel: Fix link to developer mailing lists
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (9 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 10/11] accel/tcg: Inline dump_opcount_info() and remove it Bernhard Beschow
@ 2022-05-05 16:18 ` Bernhard Beschow
  2022-05-13 11:27 ` [PATCH 00/11] Random cleanup patches Michael S. Tsirkin
  11 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-05 16:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bernhard Beschow, qemu-stable

Ammends commit 9f73de8df0335c9387f4ee39e207a65a1615676f 'docs: rSTify
the "SubmitAPatch" wiki'.

Cc: qemu-stable@nongnu.org
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 docs/devel/submitting-a-patch.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/devel/submitting-a-patch.rst b/docs/devel/submitting-a-patch.rst
index e51259eb9c..21ed52bd82 100644
--- a/docs/devel/submitting-a-patch.rst
+++ b/docs/devel/submitting-a-patch.rst
@@ -18,9 +18,9 @@ one-shot fix, the bare minimum we ask is that:
    <http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297>`__
    policy.) ``git commit -s`` or ``git format-patch -s`` will add one.
 -  All contributions to QEMU must be **sent as patches** to the
-   qemu-devel `mailing list <MailingLists>`__. Patch contributions
-   should not be posted on the bug tracker, posted on forums, or
-   externally hosted and linked to. (We have other mailing lists too,
+   qemu-devel `mailing list <https://wiki.qemu.org/Contribute/MailingLists>`__.
+   Patch contributions should not be posted on the bug tracker, posted on
+   forums, or externally hosted and linked to. (We have other mailing lists too,
    but all patches must go to qemu-devel, possibly with a Cc: to another
    list.) ``git send-email`` (`step-by-step setup
    guide <https://git-send-email.io/>`__ and `hints and
-- 
2.36.0



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

* Re: [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE
  2022-05-05 16:18 ` [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE Bernhard Beschow
@ 2022-05-05 16:59   ` Daniel Henrique Barboza
  0 siblings, 0 replies; 21+ messages in thread
From: Daniel Henrique Barboza @ 2022-05-05 16:59 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel; +Cc: qemu-trivial, open list:e500



On 5/5/22 13:18, Bernhard Beschow wrote:
> Commit 28290f37e20cda27574f15be9e9499493e3d0fe8 'PPC: E500: Generate
> device tree on reset' improved device tree generation and made
> BINARY_DEVICE_TREE_FILE obsolete.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   hw/ppc/e500.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index 2bc3dce1fb..7f7f5b3452 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -47,7 +47,6 @@
>   #include "hw/irq.h"
>   
>   #define EPAPR_MAGIC                (0x45504150)
> -#define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
>   #define DTC_LOAD_PAD               0x1800000
>   #define DTC_PAD_MASK               0xFFFFF
>   #define DTB_MAX_SIZE               (8 * MiB)


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

* Re: [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
  2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
@ 2022-05-09 12:09   ` Philippe Mathieu-Daudé
  2022-05-11 10:24   ` Mark Cave-Ayland
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-05-09 12:09 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel
  Cc: qemu-trivial, Michael S. Tsirkin, Paolo Bonzini

On 5/5/22 18:17, Bernhard Beschow wrote:
> Commit 250263033c5343012b2cd6f01210ffb5b908a159 'isa: introduce wrapper
> isa_connect_gpio_out' introduced it in 2016. Since then, its only user
> remained mc146818rtc. Remove this one-off solution.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/isa/isa-bus.c     | 6 ------
>   hw/rtc/mc146818rtc.c | 3 ++-
>   include/hw/isa/isa.h | 1 -
>   3 files changed, 2 insertions(+), 8 deletions(-)

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


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

* Re: [PATCH 02/11] hw: Reuse TYPE_I8042 define
  2022-05-05 16:17 ` [PATCH 02/11] hw: Reuse TYPE_I8042 define Bernhard Beschow
@ 2022-05-09 12:12   ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-05-09 12:12 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel
  Cc: qemu-trivial, Michael S. Tsirkin, Marcel Apfelbaum,
	Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Mark Cave-Ayland, Artyom Tarasenko

On 5/5/22 18:17, Bernhard Beschow wrote:
> TYPE_I8042 is exported, so reuse it for consistency.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/i386/pc.c       | 4 ++--
>   hw/sparc64/sun4u.c | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)

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


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

* Re: [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables
  2022-05-05 16:17 ` [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables Bernhard Beschow
@ 2022-05-09 12:13   ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-05-09 12:13 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel; +Cc: qemu-trivial, Gerd Hoffmann

On 5/5/22 18:17, Bernhard Beschow wrote:
> The tables contain spcifically crafted constants for algorithms, so make
> them immutable.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/audio/cs4231a.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

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


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

* Re: [PATCH 05/11] hw/i386/pc: Unexport functions used only internally
  2022-05-05 16:17 ` [PATCH 05/11] hw/i386/pc: Unexport functions used only internally Bernhard Beschow
@ 2022-05-09 12:14   ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-05-09 12:14 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel
  Cc: qemu-trivial, Michael S. Tsirkin, Marcel Apfelbaum,
	Paolo Bonzini, Richard Henderson, Eduardo Habkost

On 5/5/22 18:17, Bernhard Beschow wrote:
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/i386/pc.c         | 4 ++--
>   include/hw/i386/pc.h | 3 ---
>   2 files changed, 2 insertions(+), 5 deletions(-)

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


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

* Re: [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create()
  2022-05-05 16:18 ` [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create() Bernhard Beschow
@ 2022-05-09 12:15   ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-05-09 12:15 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel; +Cc: qemu-trivial, Jason Wang, open list:e500

On 5/5/22 18:18, Bernhard Beschow wrote:
> etsec_create() wraps qdev API which is outdated. It is also unused,
> so remove it.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/net/fsl_etsec/etsec.c | 23 -----------------------
>   hw/net/fsl_etsec/etsec.h |  7 -------
>   2 files changed, 30 deletions(-)

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


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

* Re: [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
  2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
  2022-05-09 12:09   ` Philippe Mathieu-Daudé
@ 2022-05-11 10:24   ` Mark Cave-Ayland
  2022-05-13 10:34     ` Bernhard Beschow
  1 sibling, 1 reply; 21+ messages in thread
From: Mark Cave-Ayland @ 2022-05-11 10:24 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel
  Cc: qemu-trivial, Michael S. Tsirkin, Paolo Bonzini,
	Philippe Mathieu-Daudé

On 05/05/2022 17:17, Bernhard Beschow wrote:

> Commit 250263033c5343012b2cd6f01210ffb5b908a159 'isa: introduce wrapper
> isa_connect_gpio_out' introduced it in 2016. Since then, its only user
> remained mc146818rtc. Remove this one-off solution.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/isa/isa-bus.c     | 6 ------
>   hw/rtc/mc146818rtc.c | 3 ++-
>   include/hw/isa/isa.h | 1 -
>   3 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
> index 0ad1c5fd65..59eb1af9e3 100644
> --- a/hw/isa/isa-bus.c
> +++ b/hw/isa/isa-bus.c
> @@ -85,12 +85,6 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
>       return isabus->irqs[isairq];
>   }
>   
> -void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq)
> -{
> -    qemu_irq irq = isa_get_irq(isadev, isairq);
> -    qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq);
> -}
> -
>   void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16)
>   {
>       assert(bus && dma8 && dma16);
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index f235c2ddbe..79c43391cb 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -972,7 +972,8 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
>       if (intercept_irq) {
>           qdev_connect_gpio_out(dev, 0, intercept_irq);
>       } else {
> -        isa_connect_gpio_out(isadev, 0, s->isairq);
> +        qemu_irq irq = isa_get_irq(isadev, s->isairq);
> +        qdev_connect_gpio_out(dev, 0, irq);
>       }
>   
>       object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isadev),
> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> index 034d706ba1..1b758ae1ab 100644
> --- a/include/hw/isa/isa.h
> +++ b/include/hw/isa/isa.h
> @@ -90,7 +90,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space,
>                       MemoryRegion *address_space_io, Error **errp);
>   void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
>   qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq);
> -void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq);
>   void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
>   IsaDma *isa_get_dma(ISABus *bus, int nchan);
>   MemoryRegion *isa_address_space(ISADevice *dev);

Hi Bernhard,

I've been tinkering again with trying to improve QEMU's ISA implementation to use 
gpios, and actually I believe as per the comment in isa-bus.c that 
isa_connect_gpio_out() will be the preferred way to wire up ISA devices. So really we 
should be trying to use this function more rather than removing it.

BTW if you are interested in helping to work on ISA bus improvements, I can certainly 
come up with a TODO list of useful tasks :)


ATB,

Mark.


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

* Re: [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
  2022-05-11 10:24   ` Mark Cave-Ayland
@ 2022-05-13 10:34     ` Bernhard Beschow
  0 siblings, 0 replies; 21+ messages in thread
From: Bernhard Beschow @ 2022-05-13 10:34 UTC (permalink / raw)
  To: Mark Cave-Ayland, QEMU Developers
  Cc: qemu-trivial, Michael S. Tsirkin, Paolo Bonzini,
	Philippe Mathieu-Daudé

Am 11. Mai 2022 10:24:58 UTC schrieb Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk>:
>On 05/05/2022 17:17, Bernhard Beschow wrote:
>
>> Commit 250263033c5343012b2cd6f01210ffb5b908a159 'isa: introduce wrapper
>> isa_connect_gpio_out' introduced it in 2016. Since then, its only user
>> remained mc146818rtc. Remove this one-off solution.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>>   hw/isa/isa-bus.c     | 6 ------
>>   hw/rtc/mc146818rtc.c | 3 ++-
>>   include/hw/isa/isa.h | 1 -
>>   3 files changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
>> index 0ad1c5fd65..59eb1af9e3 100644
>> --- a/hw/isa/isa-bus.c
>> +++ b/hw/isa/isa-bus.c
>> @@ -85,12 +85,6 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
>>       return isabus->irqs[isairq];
>>   }
>>   -void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq)
>> -{
>> -    qemu_irq irq = isa_get_irq(isadev, isairq);
>> -    qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq);
>> -}
>> -
>>   void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16)
>>   {
>>       assert(bus && dma8 && dma16);
>> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
>> index f235c2ddbe..79c43391cb 100644
>> --- a/hw/rtc/mc146818rtc.c
>> +++ b/hw/rtc/mc146818rtc.c
>> @@ -972,7 +972,8 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
>>       if (intercept_irq) {
>>           qdev_connect_gpio_out(dev, 0, intercept_irq);
>>       } else {
>> -        isa_connect_gpio_out(isadev, 0, s->isairq);
>> +        qemu_irq irq = isa_get_irq(isadev, s->isairq);
>> +        qdev_connect_gpio_out(dev, 0, irq);
>>       }
>>         object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isadev),
>> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
>> index 034d706ba1..1b758ae1ab 100644
>> --- a/include/hw/isa/isa.h
>> +++ b/include/hw/isa/isa.h
>> @@ -90,7 +90,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space,
>>                       MemoryRegion *address_space_io, Error **errp);
>>   void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
>>   qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq);
>> -void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq);
>>   void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
>>   IsaDma *isa_get_dma(ISABus *bus, int nchan);
>>   MemoryRegion *isa_address_space(ISADevice *dev);
>
>Hi Bernhard,

Hi Mark,

>I've been tinkering again with trying to improve QEMU's ISA implementation to use gpios, and actually I believe as per the comment in isa-bus.c that isa_connect_gpio_out() will be the preferred way to wire up ISA devices. So really we should be trying to use this function more rather than removing it.
>
>BTW if you are interested in helping to work on ISA bus improvements, I can certainly come up with a TODO list of useful tasks :)

Yes, that'd be great!

As expressed earlier [1] I'd like to remove the isabus global in
isa-bus.c. Meanwhile, I implemented a POC [2]. While the result seems
to work for the PC and Malta boards, some of the changes required
don't seem quite clean. So yeah, I'd be interested in the bigger
picture regarding ISA improvements and would like to help out as time
permits, too.

Best regards,
Bernhard

[1] https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg05955.html
[2] https://github.com/shentok/qemu/commits/isa

>
>ATB,
>
>Mark.


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

* Re: [PATCH 00/11] Random cleanup patches
  2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
                   ` (10 preceding siblings ...)
  2022-05-05 16:18 ` [PATCH 11/11] docs/devel: Fix link to developer mailing lists Bernhard Beschow
@ 2022-05-13 11:27 ` Michael S. Tsirkin
  11 siblings, 0 replies; 21+ messages in thread
From: Michael S. Tsirkin @ 2022-05-13 11:27 UTC (permalink / raw)
  To: Bernhard Beschow; +Cc: qemu-devel, qemu-trivial

On Thu, May 05, 2022 at 06:17:54PM +0200, Bernhard Beschow wrote:
> This patch series contains random cleanups that I made while studying the code.
> 
> Bernhard Beschow (11):
>   hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it
>   hw: Reuse TYPE_I8042 define
>   hw/audio/cs4231a: Const'ify global tables
>   hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro
>   hw/i386/pc: Unexport functions used only internally
>   hw/i386/pc: Remove orphan declarations
>   hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE
>   hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create()
>   accel/tcg/cpu-exec: Unexport dump_drift_info()
>   accel/tcg: Inline dump_opcount_info() and remove it
>   docs/devel: Fix link to developer mailing lists

pc changes looks like trivial tree material.
Acked-by: Michael S. Tsirkin <mst@redhat.com>


>  accel/tcg/cpu-exec.c              |  4 ++--
>  accel/tcg/translate-all.c         |  5 -----
>  docs/devel/submitting-a-patch.rst |  6 +++---
>  hw/audio/cs4231a.c                |  8 ++++----
>  hw/i386/pc.c                      | 17 +++++++++++++----
>  hw/isa/isa-bus.c                  |  6 ------
>  hw/net/fsl_etsec/etsec.c          | 23 -----------------------
>  hw/net/fsl_etsec/etsec.h          |  7 -------
>  hw/ppc/e500.c                     |  1 -
>  hw/rtc/mc146818rtc.c              |  3 ++-
>  hw/sparc64/sun4u.c                |  2 +-
>  include/exec/cpu-all.h            |  3 ---
>  include/hw/i386/pc.h              | 14 --------------
>  include/hw/isa/isa.h              |  1 -
>  14 files changed, 25 insertions(+), 75 deletions(-)
> 
> -- 
> 2.36.0
> 
> 
> 



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

end of thread, other threads:[~2022-05-13 11:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 16:17 [PATCH 00/11] Random cleanup patches Bernhard Beschow
2022-05-05 16:17 ` [PATCH 01/11] hw/rtc/mc146818rtc: Inline isa_connect_gpio_out() and remove it Bernhard Beschow
2022-05-09 12:09   ` Philippe Mathieu-Daudé
2022-05-11 10:24   ` Mark Cave-Ayland
2022-05-13 10:34     ` Bernhard Beschow
2022-05-05 16:17 ` [PATCH 02/11] hw: Reuse TYPE_I8042 define Bernhard Beschow
2022-05-09 12:12   ` Philippe Mathieu-Daudé via
2022-05-05 16:17 ` [PATCH 03/11] hw/audio/cs4231a: Const'ify global tables Bernhard Beschow
2022-05-09 12:13   ` Philippe Mathieu-Daudé via
2022-05-05 16:17 ` [PATCH 04/11] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro Bernhard Beschow
2022-05-05 16:17 ` [PATCH 05/11] hw/i386/pc: Unexport functions used only internally Bernhard Beschow
2022-05-09 12:14   ` Philippe Mathieu-Daudé via
2022-05-05 16:18 ` [PATCH 06/11] hw/i386/pc: Remove orphan declarations Bernhard Beschow
2022-05-05 16:18 ` [PATCH 07/11] hw/ppc/e500: Remove unused BINARY_DEVICE_TREE_FILE Bernhard Beschow
2022-05-05 16:59   ` Daniel Henrique Barboza
2022-05-05 16:18 ` [PATCH 08/11] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create() Bernhard Beschow
2022-05-09 12:15   ` Philippe Mathieu-Daudé via
2022-05-05 16:18 ` [PATCH 09/11] accel/tcg/cpu-exec: Unexport dump_drift_info() Bernhard Beschow
2022-05-05 16:18 ` [PATCH 10/11] accel/tcg: Inline dump_opcount_info() and remove it Bernhard Beschow
2022-05-05 16:18 ` [PATCH 11/11] docs/devel: Fix link to developer mailing lists Bernhard Beschow
2022-05-13 11:27 ` [PATCH 00/11] Random cleanup patches Michael S. Tsirkin

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.