All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1)
@ 2017-09-22 15:39 Philippe Mathieu-Daudé
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
                   ` (34 more replies)
  0 siblings, 35 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Eduardo Habkost, Hervé Poussineau, Aurelien Jarno,
	Yongbok Kim, Marc-André Lureau
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Hi,

quite a bunch of patches and files modified, but the diffstat is not that big.

First part is from clean-includes script,
Then comes code movement, about no logical changes.

Now some non-x86 builds and cocci spatch run a bit faster :)

I updated some MAINTAINERS entries while here.

Also I couldn't test the KVM/XEN/HAX part.

Regards,

Phil.

Philippe Mathieu-Daudé (34):
  hw: use "qemu/osdep.h" as first #include in source files
  hw: remove "qemu/osdep.h" from header files
  block: remove "qemu/osdep.h" from header file
  misc: remove headers implicitly included
  misc: remove duplicated includes
  ppc: remove duplicated includes
  i386/hax: remove duplicated includes
  nios2: remove duplicated includes
  misc: avoid "include/" in include path
  amd_iommu: avoid needless includes in header file
  i386/pc: use TYPE_PORT92
  misc: remove old i386 dependency
  hw/ide: remove old i386 dependency
  hw/ipmi: remove old i386 dependency
  hw/i2c: remove old i386 dependency
  hw/tpm: remove old i386 dependency
  hw/virtio-balloon: remove old i386 dependency
  hw/unicore32: restrict hw addr defines to source file
  hw/acpi: ACPI_PM_* defines are not restricted to i386 arch
  hw/timer/i8254: rename pit_init() -> i8254_pit_init()
  hw/display/vga: remove the old i386/pc dependency
  hw/input/i8042: extract API from hw/i386/pc.h
  hw/dma/i8257: rename DMA_init() to i8257_dma_init()
  hw/timer/mc146818: rename rtc_init() -> mc146818_init()
  hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
  hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
  hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  hw/net/e1000: use TYPE_PCI_E1000
  hw/net/e1000e: use TYPE_PCI_E1000E
  hw/net/pcnet: use TYPE_PCI_PCNET
  hw/net/rtl8139: use TYPE_PCI_RTL8139
  hw/net/ne2000: use TYPE_PCI_NE2000
  hw/alpha: remove old i386 dependency
  misc: drop old i386 dependency

 block/dmg.h                                 |  1 -
 hw/alpha/alpha_sys.h                        |  2 -
 hw/audio/fmopl.h                            |  1 -
 hw/display/vga_int.h                        |  3 +-
 hw/display/{vga.h => vga_int_regs.h}        |  0
 hw/i386/amd_iommu.h                         |  5 --
 hw/net/ne2000.h                             |  3 ++
 hw/pci/pci_internal.h                       | 16 ++++++
 include/hw/acpi/acpi.h                      | 12 +++++
 include/hw/acpi/ipmi.h                      |  1 -
 include/hw/cpu/core.h                       |  1 -
 include/hw/display/vga.h                    | 25 ++++++++++
 include/hw/{isa/i8257.h => dma/i8257_dma.h} |  6 +++
 include/hw/i2c/ppc4xx_i2c.h                 |  1 -
 include/hw/i386/pc.h                        | 56 ---------------------
 include/hw/input/i8042.h                    | 30 +++++++++++
 include/hw/isa/isa.h                        |  2 -
 include/hw/net/ne2000-isa.h                 | 33 +++++++++++++
 include/hw/net/pci.h                        | 26 ++++++++++
 include/hw/pci/pci.h                        |  4 --
 include/hw/timer/i8254.h                    |  5 +-
 include/hw/timer/i8254_internal.h           |  2 +-
 include/hw/timer/m48t59.h                   |  2 +
 include/hw/timer/mc146818rtc.h              |  3 +-
 include/hw/unicore32/puv3.h                 | 10 ----
 include/sysemu/hax.h                        |  1 -
 target/i386/hax-darwin.h                    |  3 --
 target/i386/hax-windows.h                   |  2 -
 target/nios2/cpu.h                          |  1 -
 accel/tcg/translate-all.c                   |  1 -
 bsd-user/main.c                             |  1 -
 chardev/wctablet.c                          |  4 --
 disas/nios2.c                               |  3 --
 exec.c                                      |  3 --
 hw/acpi/ipmi-stub.c                         |  1 +
 hw/alpha/dp264.c                            | 10 ++--
 hw/alpha/pci.c                              |  2 +
 hw/alpha/typhoon.c                          |  2 +-
 hw/arm/realview.c                           |  3 +-
 hw/arm/spitz.c                              |  1 -
 hw/arm/versatilepb.c                        |  3 +-
 hw/arm/virt.c                               |  1 +
 hw/audio/fmopl.c                            |  1 -
 hw/audio/pcspk.c                            |  1 -
 hw/char/debugcon.c                          |  1 -
 hw/char/xen_console.c                       |  1 -
 hw/core/machine.c                           |  1 -
 hw/cpu/core.c                               |  1 +
 hw/display/vga-isa-mm.c                     |  4 +-
 hw/display/vga-isa.c                        |  2 +-
 hw/display/vga.c                            |  4 +-
 hw/dma/i82374.c                             |  3 +-
 hw/dma/i8257.c                              |  4 +-
 hw/i2c/pm_smbus.c                           |  1 -
 hw/i2c/smbus_ich9.c                         |  1 -
 hw/i386/amd_iommu.c                         |  5 +-
 hw/i386/kvm/pci-assign.c                    |  1 -
 hw/i386/pc.c                                | 18 ++++---
 hw/i386/pci-assign-load-rom.c               |  1 -
 hw/i386/xen/xen_platform.c                  |  1 -
 hw/ide/ahci.c                               |  1 -
 hw/ide/cmd646.c                             |  1 -
 hw/ide/core.c                               |  3 +-
 hw/ide/ich.c                                |  1 -
 hw/ide/isa.c                                |  1 -
 hw/ide/microdrive.c                         |  1 -
 hw/ide/pci.c                                |  1 -
 hw/ide/piix.c                               |  2 +-
 hw/ide/via.c                                |  1 -
 hw/input/adb.c                              |  2 +-
 hw/input/pckbd.c                            |  2 +-
 hw/input/vmmouse.c                          |  3 +-
 hw/intc/lm32_pic.c                          |  1 -
 hw/ipmi/isa_ipmi_bt.c                       |  1 -
 hw/ipmi/isa_ipmi_kcs.c                      |  1 -
 hw/isa/i82378.c                             |  5 +-
 hw/isa/vt82c686.c                           |  1 -
 hw/mips/mips_fulong2e.c                     | 13 +++--
 hw/mips/mips_jazz.c                         |  9 ++--
 hw/mips/mips_malta.c                        | 13 +++--
 hw/mips/mips_r4k.c                          |  8 +--
 hw/misc/ivshmem.c                           |  1 -
 hw/misc/sga.c                               |  1 -
 hw/misc/vmport.c                            |  1 +
 hw/moxie/moxiesim.c                         |  1 -
 hw/net/e1000e.c                             |  6 +--
 hw/net/ne2000-isa.c                         |  6 +--
 hw/net/ne2000.c                             |  5 +-
 hw/net/pcnet-pci.c                          |  3 +-
 hw/net/rtl8139.c                            |  7 ++-
 hw/nios2/boot.c                             |  1 -
 hw/pci-bridge/pci_expander_bridge.c         |  1 -
 hw/pci/pci.c                                | 67 +------------------------
 hw/pci/pci_nic.c                            | 77 +++++++++++++++++++++++++++++
 hw/ppc/e500.c                               |  1 +
 hw/ppc/mac_newworld.c                       |  3 +-
 hw/ppc/mac_oldworld.c                       |  3 +-
 hw/ppc/pnv.c                                |  2 +-
 hw/ppc/ppc440_bamboo.c                      |  3 +-
 hw/ppc/prep.c                               | 13 +++--
 hw/ppc/spapr.c                              |  1 +
 hw/ppc/spapr_cpu_core.c                     |  1 +
 hw/ppc/spapr_hcall.c                        |  1 -
 hw/s390x/css.c                              |  1 -
 hw/scsi/vhost-user-scsi.c                   |  1 -
 hw/sh4/r2d.c                                |  5 +-
 hw/smbios/smbios_type_38-stub.c             |  1 +
 hw/sparc/sun4m.c                            |  5 --
 hw/sparc64/sun4u.c                          | 10 ++--
 hw/ssi/aspeed_smc.c                         |  3 +-
 hw/timer/i8254.c                            |  1 -
 hw/timer/i8254_common.c                     |  1 -
 hw/timer/m48t59-isa.c                       |  2 +-
 hw/timer/mc146818rtc.c                      |  2 +-
 hw/tpm/tpm_passthrough.c                    |  1 -
 hw/tpm/tpm_tis.c                            |  1 -
 hw/unicore32/puv3.c                         | 17 ++++---
 hw/vfio/ccw.c                               |  2 +-
 hw/virtio/vhost-vsock.c                     |  2 +-
 hw/virtio/virtio-balloon.c                  |  2 +-
 hw/watchdog/wdt_ib700.c                     |  1 -
 linux-user/main.c                           |  1 -
 monitor.c                                   |  1 -
 net/colo-compare.c                          |  1 -
 numa.c                                      |  1 -
 target/i386/hax-darwin.c                    |  8 +--
 target/nios2/helper.c                       |  7 +--
 target/nios2/op_helper.c                    |  1 +
 target/nios2/translate.c                    |  1 +
 target/openrisc/exception_helper.c          |  1 -
 target/ppc/kvm.c                            |  3 --
 tests/test-aio-multithread.c                |  1 -
 tests/test-clone-visitor.c                  |  1 -
 tests/vhost-user-test.c                     |  1 -
 tests/vmgenid-test.c                        |  3 --
 util/qemu-sockets.c                         |  1 -
 vl.c                                        |  3 +-
 hw/pci/Makefile.objs                        |  1 +
 MAINTAINERS                                 | 13 ++++-
 139 files changed, 389 insertions(+), 337 deletions(-)
 rename hw/display/{vga.h => vga_int_regs.h} (100%)
 create mode 100644 hw/pci/pci_internal.h
 create mode 100644 include/hw/display/vga.h
 rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)
 create mode 100644 include/hw/input/i8042.h
 create mode 100644 include/hw/net/ne2000-isa.h
 create mode 100644 include/hw/net/pci.h
 create mode 100644 hw/pci/pci_nic.c

-- 
2.14.1

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

* [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:06   ` Peter Maydell
                     ` (2 more replies)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files Philippe Mathieu-Daudé
                   ` (33 subsequent siblings)
  34 siblings, 3 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Michael S. Tsirkin, Igor Mammedov, Eduardo Habkost, David Gibson,
	Alexander Graf, Cornelia Huck, Alex Williamson
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/acpi/ipmi-stub.c             | 1 +
 hw/audio/fmopl.c                | 1 -
 hw/cpu/core.c                   | 1 +
 hw/ppc/spapr_cpu_core.c         | 1 +
 hw/smbios/smbios_type_38-stub.c | 1 +
 hw/vfio/ccw.c                   | 2 +-
 hw/virtio/vhost-vsock.c         | 2 +-
 7 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/ipmi-stub.c b/hw/acpi/ipmi-stub.c
index 98b6dcee0d..f525f71c2d 100644
--- a/hw/acpi/ipmi-stub.c
+++ b/hw/acpi/ipmi-stub.c
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/acpi/ipmi.h"
 
 void build_acpi_ipmi_devices(Aml *table, BusState *bus)
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index 5cfb6a96dd..9f50a89b4a 100644
--- a/hw/audio/fmopl.c
+++ b/hw/audio/fmopl.c
@@ -34,7 +34,6 @@
 #include <math.h>
 //#include "driver.h"		/* use M.A.M.E. */
 #include "fmopl.h"
-#include "qemu/osdep.h"
 #ifndef PI
 #define PI 3.14159265358979323846
 #endif
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index bd578ab80c..7e42e2c87a 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "qapi/visitor.h"
 #include "qapi/error.h"
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index c08ee7571a..4a4f0c60fe 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "target/ppc/cpu.h"
diff --git a/hw/smbios/smbios_type_38-stub.c b/hw/smbios/smbios_type_38-stub.c
index 9528c2c28e..5b83c9b1f1 100644
--- a/hw/smbios/smbios_type_38-stub.c
+++ b/hw/smbios/smbios_type_38-stub.c
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/smbios/ipmi.h"
 
 void smbios_build_type_38_table(void)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index a8baadf57a..4810fa0b50 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -11,11 +11,11 @@
  * directory.
  */
 
+#include "qemu/osdep.h"
 #include <linux/vfio.h>
 #include <linux/vfio_ccw.h>
 #include <sys/ioctl.h>
 
-#include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/vfio/vfio.h"
diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 49e0022533..c11c1eb83e 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -11,8 +11,8 @@
  * top-level directory.
  */
 
-#include <sys/ioctl.h>
 #include "qemu/osdep.h"
+#include <sys/ioctl.h>
 #include "standard-headers/linux/virtio_vsock.h"
 #include "qapi/error.h"
 #include "hw/virtio/virtio-bus.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:07   ` Peter Maydell
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file Philippe Mathieu-Daudé
                   ` (32 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Igor Mammedov, Corey Minyard, Balaton Zoltan, Alexander Graf
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

while here, add entries for ppc4xx_i2c in MAINTAINERS

applied using ./scripts/clean-includes

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

Zoltán you might want to add yourself a reviewer entry on ppc4xx :)

R: Balaton Zoltan <balaton@eik.bme.hu>

 include/hw/acpi/ipmi.h      | 1 -
 include/hw/cpu/core.h       | 1 -
 include/hw/i2c/ppc4xx_i2c.h | 1 -
 MAINTAINERS                 | 2 ++
 4 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/hw/acpi/ipmi.h b/include/hw/acpi/ipmi.h
index ab2bb29048..c38483565c 100644
--- a/include/hw/acpi/ipmi.h
+++ b/include/hw/acpi/ipmi.h
@@ -9,7 +9,6 @@
 #ifndef HW_ACPI_IPMI_H
 #define HW_ACPI_IPMI_H
 
-#include "qemu/osdep.h"
 #include "hw/acpi/aml-build.h"
 
 /*
diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h
index 79ac79c29c..b7470644d8 100644
--- a/include/hw/cpu/core.h
+++ b/include/hw/cpu/core.h
@@ -9,7 +9,6 @@
 #ifndef HW_CPU_CORE_H
 #define HW_CPU_CORE_H
 
-#include "qemu/osdep.h"
 #include "hw/qdev.h"
 
 #define TYPE_CPU_CORE "cpu-core"
diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h
index e53042f6d4..3450bda577 100644
--- a/include/hw/i2c/ppc4xx_i2c.h
+++ b/include/hw/i2c/ppc4xx_i2c.h
@@ -25,7 +25,6 @@
 #ifndef PPC4XX_I2C_H
 #define PPC4XX_I2C_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "hw/i2c/i2c.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index 762e37bfd6..7f49f1d046 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -945,7 +945,9 @@ M: Alexander Graf <agraf@suse.de>
 L: qemu-ppc@nongnu.org
 S: Odd Fixes
 F: hw/ppc/ppc4*.c
+F: hw/i2c/ppc4xx_i2c.c
 F: include/hw/ppc/ppc4xx.h
+F: include/hw/i2c/ppc4xx_i2c.h
 
 ppce500
 M: Alexander Graf <agraf@suse.de>
-- 
2.14.1

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

* [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:32   ` Peter Maydell
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included Philippe Mathieu-Daudé
                   ` (31 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Kevin Wolf, Max Reitz
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-block, qemu-trivial

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 block/dmg.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/dmg.h b/block/dmg.h
index b592d6fa8b..2ecf239ba5 100644
--- a/block/dmg.h
+++ b/block/dmg.h
@@ -26,7 +26,6 @@
 #ifndef BLOCK_DMG_H
 #define BLOCK_DMG_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include <zlib.h>
-- 
2.14.1

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

* [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:31   ` Peter Maydell
  2017-09-25  9:01   ` Stefan Hajnoczi
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
                   ` (30 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Stefan Hajnoczi, Marc-André Lureau, Michael S. Tsirkin,
	Zhang Chen, Li Zhijian, Jason Wang, Markus Armbruster,
	Michael Roth, Ben Warren
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/audio/fmopl.h             | 1 -
 bsd-user/main.c              | 1 -
 chardev/wctablet.c           | 4 ----
 hw/scsi/vhost-user-scsi.c    | 1 -
 linux-user/main.c            | 1 -
 net/colo-compare.c           | 1 -
 tests/test-aio-multithread.c | 1 -
 tests/test-clone-visitor.c   | 1 -
 tests/vmgenid-test.c         | 3 ---
 9 files changed, 14 deletions(-)

diff --git a/hw/audio/fmopl.h b/hw/audio/fmopl.h
index f4065f425c..e7e578a48e 100644
--- a/hw/audio/fmopl.h
+++ b/hw/audio/fmopl.h
@@ -1,7 +1,6 @@
 #ifndef FMOPL_H
 #define FMOPL_H
 
-#include <stdint.h>
 
 typedef void (*OPL_TIMERHANDLER)(void *param, int channel, double interval_Sec);
 
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 836daac15c..bf27a5b44f 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -32,7 +32,6 @@
 #include "qemu/envlist.h"
 #include "exec/log.h"
 #include "trace/control.h"
-#include "glib-compat.h"
 
 int singlestep;
 unsigned long mmap_min_addr;
diff --git a/chardev/wctablet.c b/chardev/wctablet.c
index 6c13c2c58a..969d014574 100644
--- a/chardev/wctablet.c
+++ b/chardev/wctablet.c
@@ -25,10 +25,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 500fa6a067..9efa26da7d 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -18,7 +18,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "qemu/typedefs.h"
 #include "qom/object.h"
 #include "hw/fw-path-provider.h"
 #include "hw/qdev-core.h"
diff --git a/linux-user/main.c b/linux-user/main.c
index 829f974662..85d7f6d3f7 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -35,7 +35,6 @@
 #include "elf.h"
 #include "exec/log.h"
 #include "trace/control.h"
-#include "glib-compat.h"
 
 char *exec_path;
 
diff --git a/net/colo-compare.c b/net/colo-compare.c
index b3f35d729a..27ea7d4de9 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -23,7 +23,6 @@
 #include "qom/object_interfaces.h"
 #include "qemu/iov.h"
 #include "qom/object.h"
-#include "qemu/typedefs.h"
 #include "net/queue.h"
 #include "chardev/char-fe.h"
 #include "qemu/sockets.h"
diff --git a/tests/test-aio-multithread.c b/tests/test-aio-multithread.c
index 549d784915..ad78c6b28b 100644
--- a/tests/test-aio-multithread.c
+++ b/tests/test-aio-multithread.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "block/aio.h"
 #include "qapi/error.h"
 #include "qemu/coroutine.h"
diff --git a/tests/test-clone-visitor.c b/tests/test-clone-visitor.c
index 96982163e4..ac6afc562e 100644
--- a/tests/test-clone-visitor.c
+++ b/tests/test-clone-visitor.c
@@ -8,7 +8,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <glib.h>
 
 #include "qemu-common.h"
 #include "qapi/clone-visitor.h"
diff --git a/tests/vmgenid-test.c b/tests/vmgenid-test.c
index 918c82c82a..2f96ad453e 100644
--- a/tests/vmgenid-test.c
+++ b/tests/vmgenid-test.c
@@ -8,9 +8,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-#include <unistd.h>
 #include "qemu/osdep.h"
 #include "qemu/bitmap.h"
 #include "qemu/uuid.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:39   ` Peter Maydell
                     ` (2 more replies)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 06/34] ppc: " Philippe Mathieu-Daudé
                   ` (29 subsequent siblings)
  34 siblings, 3 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, Stefano Stabellini, Anthony Perard,
	Eduardo Habkost, Marcel Apfelbaum, Cornelia Huck,
	Christian Borntraeger, Alexander Graf, Stafford Horne,
	Marc-André Lureau, Daniel P. Berrange, Gerd Hoffmann
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-arm, qemu-trivial

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 accel/tcg/translate-all.c          | 1 -
 exec.c                             | 3 ---
 hw/arm/spitz.c                     | 1 -
 hw/char/xen_console.c              | 1 -
 hw/core/machine.c                  | 1 -
 hw/s390x/css.c                     | 1 -
 target/openrisc/exception_helper.c | 1 -
 tests/vhost-user-test.c            | 1 -
 util/qemu-sockets.c                | 1 -
 vl.c                               | 1 -
 10 files changed, 12 deletions(-)

diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 2d1ed06065..fb2ad21092 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -31,7 +31,6 @@
 #include "tcg.h"
 #if defined(CONFIG_USER_ONLY)
 #include "qemu.h"
-#include "exec/exec-all.h"
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/param.h>
 #if __FreeBSD_version >= 700104
diff --git a/exec.c b/exec.c
index a25a4c6018..a1fe82189c 100644
--- a/exec.c
+++ b/exec.c
@@ -18,8 +18,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#ifndef _WIN32
-#endif
 
 #include "qemu/cutils.h"
 #include "cpu.h"
@@ -51,7 +49,6 @@
 #include "trace-root.h"
 
 #ifdef CONFIG_FALLOCATE_PUNCH_HOLE
-#include <fcntl.h>
 #include <linux/falloc.h>
 #endif
 
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index feccdb00d3..ac1e15cbbc 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -29,7 +29,6 @@
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
-#include "sysemu/sysemu.h"
 #include "cpu.h"
 
 #undef REG_FMT
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 3643dfe067..5e68326c19 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -27,7 +27,6 @@
 #include "hw/hw.h"
 #include "chardev/char-fe.h"
 #include "hw/xen/xen_backend.h"
-#include "qapi/error.h"
 
 #include <xen/io/console.h>
 
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 80647edc2a..4ad0e9a082 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -20,7 +20,6 @@
 #include "sysemu/numa.h"
 #include "qemu/error-report.h"
 #include "qemu/cutils.h"
-#include "sysemu/numa.h"
 #include "sysemu/qtest.h"
 
 static char *machine_get_accel(Object *obj, Error **errp)
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 75d4f301fb..3938fa5909 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -13,7 +13,6 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "hw/qdev.h"
-#include "qemu/error-report.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
diff --git a/target/openrisc/exception_helper.c b/target/openrisc/exception_helper.c
index a8a5f69b05..6073a5b21c 100644
--- a/target/openrisc/exception_helper.c
+++ b/target/openrisc/exception_helper.c
@@ -21,7 +21,6 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
-#include "exec/exec-all.h"
 #include "exception.h"
 
 void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 4b98018478..e2c89ed376 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -21,7 +21,6 @@
 #include "libqos/libqos.h"
 #include "libqos/pci-pc.h"
 #include "libqos/virtio-pci.h"
-#include "qapi/error.h"
 
 #include "libqos/malloc-pc.h"
 #include "hw/virtio/virtio-net.h"
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index d149383bb9..d700caef45 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -26,7 +26,6 @@
 #include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
-#include "qapi/clone-visitor.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/qobject-output-visitor.h"
 #include "qapi-visit.h"
diff --git a/vl.c b/vl.c
index 88ae727486..d6cb6751e6 100644
--- a/vl.c
+++ b/vl.c
@@ -95,7 +95,6 @@ int main(int argc, char **argv)
 #include "sysemu/kvm.h"
 #include "sysemu/hax.h"
 #include "qapi/qobject-input-visitor.h"
-#include "qapi/qobject-input-visitor.h"
 #include "qapi-visit.h"
 #include "qapi/qmp/qjson.h"
 #include "qemu/option.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 06/34] ppc: remove duplicated includes
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:39   ` Peter Maydell
  2017-09-23  5:31   ` David Gibson
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 07/34] i386/hax: " Philippe Mathieu-Daudé
                   ` (28 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Alexander Graf, David Gibson
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

applied using ./scripts/clean-includes

not needed since 7ebaf795560

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/ppc/spapr_hcall.c | 1 -
 target/ppc/kvm.c     | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 57bb411394..2aeee28fe6 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -13,7 +13,6 @@
 #include "trace.h"
 #include "kvm_ppc.h"
 #include "hw/ppc/spapr_ovec.h"
-#include "qemu/error-report.h"
 #include "mmu-book3s-v3.h"
 
 struct SPRSyncState {
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 1deaf106d2..c9105af393 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -47,9 +47,6 @@
 #include "sysemu/hostmem.h"
 #include "qemu/cutils.h"
 #include "qemu/mmap-alloc.h"
-#if defined(TARGET_PPC64)
-#include "hw/ppc/spapr_cpu_core.h"
-#endif
 #include "elf.h"
 #include "sysemu/kvm_int.h"
 
-- 
2.14.1

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

* [Qemu-devel] [PATCH 07/34] i386/hax: remove duplicated includes
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 06/34] ppc: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:42   ` Peter Maydell
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 08/34] nios2: " Philippe Mathieu-Daudé
                   ` (27 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost, Yu Ning, Vincent Palatin
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/sysemu/hax.h      | 1 -
 target/i386/hax-darwin.h  | 3 ---
 target/i386/hax-windows.h | 2 --
 target/i386/hax-darwin.c  | 8 ++------
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/include/sysemu/hax.h b/include/sysemu/hax.h
index 232a68ab1b..f252399623 100644
--- a/include/sysemu/hax.h
+++ b/include/sysemu/hax.h
@@ -22,7 +22,6 @@
 #ifndef QEMU_HAX_H
 #define QEMU_HAX_H
 
-#include "config-host.h"
 #include "qemu-common.h"
 
 int hax_sync_vcpus(void);
diff --git a/target/i386/hax-darwin.h b/target/i386/hax-darwin.h
index 0c0968b77d..fb8e25a096 100644
--- a/target/i386/hax-darwin.h
+++ b/target/i386/hax-darwin.h
@@ -15,10 +15,7 @@
 #ifndef TARGET_I386_HAX_DARWIN_H
 #define TARGET_I386_HAX_DARWIN_H
 
-#include <sys/types.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <stdarg.h>
 
 #define HAX_INVALID_FD  (-1)
 static inline int hax_invalid_fd(hax_fd fd)
diff --git a/target/i386/hax-windows.h b/target/i386/hax-windows.h
index 1d8f68de91..f7c3e99246 100644
--- a/target/i386/hax-windows.h
+++ b/target/i386/hax-windows.h
@@ -24,8 +24,6 @@
 #include <memory.h>
 #include <malloc.h>
 #include <winioctl.h>
-#include <string.h>
-#include <stdio.h>
 #include <windef.h>
 
 #define HAX_INVALID_FD INVALID_HANDLE_VALUE
diff --git a/target/i386/hax-darwin.c b/target/i386/hax-darwin.c
index 1c5bbd0a2d..ee9417454c 100644
--- a/target/i386/hax-darwin.c
+++ b/target/i386/hax-darwin.c
@@ -11,13 +11,9 @@
  */
 
 /* HAX module interface - darwin version */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-
 #include "qemu/osdep.h"
+#include <sys/ioctl.h>
+
 #include "target/i386/hax-i386.h"
 
 hax_fd hax_mod_open(void)
-- 
2.14.1

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

* [Qemu-devel] [PATCH 08/34] nios2: remove duplicated includes
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 07/34] i386/hax: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:44   ` Peter Maydell
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path Philippe Mathieu-Daudé
                   ` (26 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Chris Wulff, Marek Vasut
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/nios2/cpu.h       | 1 -
 disas/nios2.c            | 3 ---
 hw/nios2/boot.c          | 1 -
 target/nios2/helper.c    | 7 ++-----
 target/nios2/op_helper.c | 1 +
 target/nios2/translate.c | 1 +
 6 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 50d803a217..fda02c39b9 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -20,7 +20,6 @@
 #ifndef CPU_NIOS2_H
 #define CPU_NIOS2_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
diff --git a/disas/nios2.c b/disas/nios2.c
index b342936d21..de11f04cc4 100644
--- a/disas/nios2.c
+++ b/disas/nios2.c
@@ -1756,7 +1756,6 @@ extern const int nios2_num_r2_reg_range_mappings;
 #endif /* _NIOS2_H */
 
 /*#include "sysdep.h"
-#include <stdio.h>
 #include "opcode/nios2.h"
 */
 /* Register string table */
@@ -2521,8 +2520,6 @@ const int nios2_num_r2_reg_range_mappings = 8;
 #include "dis-asm.h"
 #include "opcode/nios2.h"
 #include "libiberty.h"
-#include <string.h>
-#include <assert.h>
 */
 /* No symbol table is available when this code runs out in an embedded
    system as when it is used for disassembler support in a monitor.  */
diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
index 2b31f5b844..94f436e7fb 100644
--- a/hw/nios2/boot.c
+++ b/hw/nios2/boot.c
@@ -34,7 +34,6 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "qemu-common.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
diff --git a/target/nios2/helper.c b/target/nios2/helper.c
index ef9ee05798..9f741a8f19 100644
--- a/target/nios2/helper.c
+++ b/target/nios2/helper.c
@@ -18,12 +18,9 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "cpu.h"
 #include "qemu/osdep.h"
+
+#include "cpu.h"
 #include "qemu/host-utils.h"
 #include "qapi/error.h"
 #include "exec/exec-all.h"
diff --git a/target/nios2/op_helper.c b/target/nios2/op_helper.c
index efb1c489c9..c853aeae02 100644
--- a/target/nios2/op_helper.c
+++ b/target/nios2/op_helper.c
@@ -18,6 +18,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 6b0961837d..796d399bd1 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -21,6 +21,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "tcg-op.h"
 #include "exec/exec-all.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 08/34] nios2: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:46   ` Peter Maydell
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file Philippe Mathieu-Daudé
                   ` (25 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Peter Crosthwaite,
	Eduardo Habkost
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

while here, remove unused #include from aspeed_smc.h

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/input/adb.c      | 2 +-
 hw/ssi/aspeed_smc.c | 3 +--
 numa.c              | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/input/adb.c b/hw/input/adb.c
index fcca3a8eb9..924a3f9fd5 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -24,8 +24,8 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/input/adb.h"
+#include "hw/input/adb-keys.h"
 #include "ui/console.h"
-#include "include/hw/input/adb-keys.h"
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index cb515730c5..5059396bc6 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -26,8 +26,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
-#include "include/qemu/error-report.h"
-#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
 
 #include "hw/ssi/aspeed_smc.h"
 
diff --git a/numa.c b/numa.c
index 100a67febf..ebc553b5d9 100644
--- a/numa.c
+++ b/numa.c
@@ -29,7 +29,6 @@
 #include "qemu/bitmap.h"
 #include "qom/cpu.h"
 #include "qemu/error-report.h"
-#include "include/exec/cpu-common.h" /* for RAM_ADDR_FMT */
 #include "qapi-visit.h"
 #include "qapi/opts-visitor.h"
 #include "hw/boards.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:13   ` Thomas Huth
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92 Philippe Mathieu-Daudé
                   ` (24 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost, Michael S. Tsirkin
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

instead move them to the source file

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/i386/amd_iommu.h | 5 -----
 hw/i386/amd_iommu.c | 5 ++++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h
index d370ae3549..aeef802364 100644
--- a/hw/i386/amd_iommu.h
+++ b/hw/i386/amd_iommu.h
@@ -23,11 +23,6 @@
 
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/msi.h"
-#include "hw/sysbus.h"
-#include "sysemu/dma.h"
-#include "hw/i386/pc.h"
-#include "hw/pci/pci_bus.h"
 #include "hw/i386/x86-iommu.h"
 
 /* Capability registers */
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 334938a280..e1bf9c5329 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -20,7 +20,10 @@
  * Cache implementation inspired by hw/i386/intel_iommu.c
  */
 #include "qemu/osdep.h"
-#include "hw/i386/amd_iommu.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/msi.h"
+#include "hw/pci/pci_bus.h"
+#include "amd_iommu.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "trace.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:16   ` Thomas Huth
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency Philippe Mathieu-Daudé
                   ` (23 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost, Michael S. Tsirkin
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 05985d4927..f116cede91 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1577,7 +1577,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
         qdev_init_nofail(dev);
     }
-    port92 = isa_create_simple(isa_bus, "port92");
+    port92 = isa_create_simple(isa_bus, TYPE_PORT92);
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
 
-- 
2.14.1

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

* [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92 Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:15   ` Thomas Huth
  2017-10-10 15:37   ` Anthony PERARD
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 13/34] hw/ide: " Philippe Mathieu-Daudé
                   ` (22 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Michael S. Tsirkin, Marcel Apfelbaum, Markus Armbruster,
	Dr. David Alan Gilbert, Richard Henderson, Eduardo Habkost,
	Anthony Perard
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/audio/pcspk.c                    | 1 -
 hw/i386/kvm/pci-assign.c            | 1 -
 hw/i386/pci-assign-load-rom.c       | 1 -
 hw/i386/xen/xen_platform.c          | 1 -
 hw/isa/vt82c686.c                   | 1 -
 hw/misc/ivshmem.c                   | 1 -
 hw/misc/sga.c                       | 1 -
 hw/pci-bridge/pci_expander_bridge.c | 1 -
 monitor.c                           | 1 -
 9 files changed, 9 deletions(-)

diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 0206f7399b..908696d483 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "hw/audio/soundhw.h"
 #include "audio/audio.h"
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 33e20cb3e8..3f103a99db 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -25,7 +25,6 @@
 #include <linux/kvm.h>
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/loader.h"
diff --git a/hw/i386/pci-assign-load-rom.c b/hw/i386/pci-assign-load-rom.c
index 43429b66be..2c3a60392e 100644
--- a/hw/i386/pci-assign-load-rom.c
+++ b/hw/i386/pci-assign-load-rom.c
@@ -4,7 +4,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/loader.h"
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 9ba7474566..880926f442 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -26,7 +26,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/ide.h"
 #include "hw/pci/pci.h"
 #include "hw/irq.h"
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 50dc83df77..2484a956c7 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -12,7 +12,6 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/vt82c686.h"
 #include "hw/i2c/i2c.h"
 #include "hw/i2c/smbus.h"
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index b3ef3ec1e3..971bd759f4 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -20,7 +20,6 @@
 #include "qapi/error.h"
 #include "qemu/cutils.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
diff --git a/hw/misc/sga.c b/hw/misc/sga.c
index 03b006d6f0..97fd63f176 100644
--- a/hw/misc/sga.c
+++ b/hw/misc/sga.c
@@ -26,7 +26,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
-#include "hw/i386/pc.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
 
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ff59abf208..3295af3d20 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -16,7 +16,6 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pci_bridge.h"
-#include "hw/i386/pc.h"
 #include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "sysemu/numa.h"
diff --git a/monitor.c b/monitor.c
index 058045b3cb..a1ae6a26f2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -28,7 +28,6 @@
 #include "hw/hw.h"
 #include "monitor/qdev.h"
 #include "hw/usb.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/watchdog.h"
 #include "hw/loader.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 13/34] hw/ide: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 18:03   ` John Snow
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 14/34] hw/ipmi: " Philippe Mathieu-Daudé
                   ` (21 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, John Snow
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-block, qemu-trivial

and remove a duplicated include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/ide/ahci.c       | 1 -
 hw/ide/cmd646.c     | 1 -
 hw/ide/core.c       | 3 +--
 hw/ide/ich.c        | 1 -
 hw/ide/isa.c        | 1 -
 hw/ide/microdrive.c | 1 -
 hw/ide/pci.c        | 1 -
 hw/ide/piix.c       | 2 +-
 hw/ide/via.c        | 1 -
 9 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 32d1296a64..2634f8db3d 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -24,7 +24,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 
 #include "qemu/error-report.h"
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 86b2a8f504..65aff518ec 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
diff --git a/hw/ide/core.c b/hw/ide/core.c
index d63eb4a72e..6438efa8f4 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -24,17 +24,16 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
 #include "hw/block/block.h"
 #include "sysemu/block-backend.h"
 #include "qemu/cutils.h"
-#include "qemu/error-report.h"
 
 #include "hw/ide/internal.h"
 #include "trace.h"
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 9472a60cab..48513c7e9d 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -63,7 +63,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index 40213d662c..9fb24fc92b 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c
index 17917c0b30..fde4d4645e 100644
--- a/hw/ide/microdrive.c
+++ b/hw/ide/microdrive.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pcmcia.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index f2dcc0ed77..34237c92fc 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index dfb21f65fa..a3afe1fd29 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -25,11 +25,11 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
 
 #include "hw/ide/pci.h"
diff --git a/hw/ide/via.c b/hw/ide/via.c
index 35c3059325..117ac4d95e 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -25,7 +25,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 14/34] hw/ipmi: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 13/34] hw/ide: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:58   ` Corey Minyard
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 15/34] hw/i2c: " Philippe Mathieu-Daudé
                   ` (20 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Corey Minyard
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/ipmi/isa_ipmi_bt.c  | 1 -
 hw/ipmi/isa_ipmi_kcs.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
index 2fcc3d2e7c..e098fd5206 100644
--- a/hw/ipmi/isa_ipmi_bt.c
+++ b/hw/ipmi/isa_ipmi_bt.c
@@ -26,7 +26,6 @@
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 /* Control register */
 #define IPMI_BT_CLR_WR_BIT         0
diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c
index 80444977a0..689587b65d 100644
--- a/hw/ipmi/isa_ipmi_kcs.c
+++ b/hw/ipmi/isa_ipmi_kcs.c
@@ -26,7 +26,6 @@
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 #define IPMI_KCS_OBF_BIT        0
 #define IPMI_KCS_IBF_BIT        1
-- 
2.14.1

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

* [Qemu-devel] [PATCH 15/34] hw/i2c: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 14/34] hw/ipmi: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:17   ` Thomas Huth
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 16/34] hw/tpm: " Philippe Mathieu-Daudé
                   ` (19 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/i2c/pm_smbus.c   | 1 -
 hw/i2c/smbus_ich9.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c
index 6fc3923f56..a044dd1b27 100644
--- a/hw/i2c/pm_smbus.c
+++ b/hw/i2c/pm_smbus.c
@@ -19,7 +19,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/i2c/smbus.h"
 
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index ea51e09186..082cdecba9 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -26,7 +26,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "sysemu/sysemu.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 16/34] hw/tpm: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 15/34] hw/i2c: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 16:05   ` Stefan Berger
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: " Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Stefan Berger,
	Amarnath Valluri
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/tpm/tpm_passthrough.c | 1 -
 hw/tpm/tpm_tis.c         | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 9234eb3459..461f551a0c 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -29,7 +29,6 @@
 #include "sysemu/tpm_backend.h"
 #include "tpm_int.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "sysemu/tpm_backend_int.h"
 #include "tpm_tis.h"
 #include "tpm_util.h"
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index a6440fef91..a3a93f7229 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -28,7 +28,6 @@
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci_ids.h"
 #include "tpm_tis.h"
 #include "qapi/error.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 16/34] hw/tpm: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:23   ` Thomas Huth
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/virtio/virtio-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 37cde38982..14e08d20d0 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -18,7 +18,7 @@
 #include "qemu/timer.h"
 #include "qemu-common.h"
 #include "hw/virtio/virtio.h"
-#include "hw/i386/pc.h"
+#include "hw/mem/pc-dimm.h"
 #include "sysemu/balloon.h"
 #include "hw/virtio/virtio-balloon.h"
 #include "sysemu/kvm.h"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: " Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-25  5:19   ` Thomas Huth
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 19/34] hw/acpi: ACPI_PM_* defines are not restricted to i386 arch Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Guan Xuetao
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

and drop unused #includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/unicore32/puv3.h | 10 ----------
 hw/unicore32/puv3.c         | 16 ++++++++++------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/include/hw/unicore32/puv3.h b/include/hw/unicore32/puv3.h
index 5a4839f8df..f587a1f622 100644
--- a/include/hw/unicore32/puv3.h
+++ b/include/hw/unicore32/puv3.h
@@ -14,16 +14,6 @@
 
 #define PUV3_REGS_OFFSET        (0x1000) /* 4K is reasonable */
 
-/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
-#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
-
-/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
-#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
-#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
-#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
-#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
-#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
-
 /* Hardware interrupts */
 #define PUV3_IRQS_NR            (32)
 
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 504ea46211..6849bac59c 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -11,16 +11,10 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "ui/console.h"
-#include "elf.h"
-#include "exec/address-spaces.h"
-#include "hw/sysbus.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
-#include "hw/i386/pc.h"
-#include "qemu/error-report.h"
 #include "sysemu/qtest.h"
 
 #undef DEBUG_PUV3
@@ -29,6 +23,16 @@
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
 
+/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
+#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
+
+/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
+#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
+#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
+#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
+#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
+#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
+
 static void puv3_intc_cpu_handler(void *opaque, int irq, int level)
 {
     UniCore32CPU *cpu = opaque;
-- 
2.14.1

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

* [Qemu-devel] [PATCH 19/34] hw/acpi: ACPI_PM_* defines are not restricted to i386 arch
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file Philippe Mathieu-Daudé
@ 2017-09-22 15:39 ` Philippe Mathieu-Daudé
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init() Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:39 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Igor Mammedov
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/acpi/acpi.h | 12 ++++++++++++
 include/hw/i386/pc.h   | 13 -------------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 7b3d93cf0d..30013b0464 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -39,6 +39,18 @@
 #define ACPI_PM2_REGISTER_WIDTH         8
 #define ACPI_PM_TIMER_WIDTH             32
 
+/* PC-style peripherals (also used by other machines).  */
+#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
+#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
+#define ACPI_PM_PROP_S4_VAL "s4_val"
+#define ACPI_PM_PROP_SCI_INT "sci_int"
+#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
+#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
+#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
+#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
+#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
+#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
+
 /* PM Timer ticks per second (HZ) */
 #define PM_TIMER_FREQUENCY  3579545
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 087d184ef5..b1b4c918af 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -151,19 +151,6 @@ struct PCMachineClass {
 #define PC_MACHINE_CLASS(klass) \
     OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
 
-/* PC-style peripherals (also used by other machines).  */
-
-#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
-#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
-#define ACPI_PM_PROP_S4_VAL "s4_val"
-#define ACPI_PM_PROP_SCI_INT "sci_int"
-#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
-#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
-#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
-#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
-#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
-#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
-
 /* parallel.c */
 
 void parallel_hds_isa_init(ISABus *bus, int n);
-- 
2.14.1

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

* [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init()
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 19/34] hw/acpi: ACPI_PM_* defines are not restricted to i386 arch Philippe Mathieu-Daudé
@ 2017-09-22 15:40 ` Philippe Mathieu-Daudé
  2017-09-22 20:09   ` Hervé Poussineau
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:40 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Hervé Poussineau, Aurelien Jarno, Yongbok Kim,
	Richard Henderson
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial, qemu-ppc

- add entry for i82378 in MAINTAINERS
- remove the old i386/pc dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/timer/i8254.h          | 5 +++--
 include/hw/timer/i8254_internal.h | 2 +-
 hw/alpha/dp264.c                  | 2 +-
 hw/i386/pc.c                      | 2 +-
 hw/isa/i82378.c                   | 2 +-
 hw/mips/mips_fulong2e.c           | 2 +-
 hw/mips/mips_jazz.c               | 2 +-
 hw/mips/mips_malta.c              | 2 +-
 hw/mips/mips_r4k.c                | 2 +-
 hw/timer/i8254.c                  | 1 -
 hw/timer/i8254_common.c           | 1 -
 MAINTAINERS                       | 1 +
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 5adae9fa44..5b12eb918e 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -26,6 +26,7 @@
 #define HW_I8254_H
 
 #include "hw/hw.h"
+#include "hw/qdev.h"
 #include "hw/isa/isa.h"
 
 #define PIT_FREQ 1193182
@@ -48,8 +49,8 @@ typedef struct PITChannelInfo {
 #define TYPE_I8254 "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
 
-static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
-                                  qemu_irq alt_irq)
+static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
+                                        qemu_irq alt_irq)
 {
     DeviceState *dev;
     ISADevice *d;
diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h
index dc09cc0467..c37a438f82 100644
--- a/include/hw/timer/i8254_internal.h
+++ b/include/hw/timer/i8254_internal.h
@@ -26,8 +26,8 @@
 #define QEMU_I8254_INTERNAL_H
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "qemu/timer.h"
 
 typedef struct PITChannelState {
     int count; /* can be 65536 */
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 1b121306c2..1bd5243648 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -81,7 +81,7 @@ static void clipper_init(MachineState *machine)
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
     rtc_init(isa_bus, 1900, rtc_irq);
 
-    pit_init(isa_bus, 0x40, 0, NULL);
+    i8254_pit_init(isa_bus, 0x40, 0, NULL);
     isa_create_simple(isa_bus, "i8042");
 
     /* VGA setup.  Don't bother loading the bios.  */
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f116cede91..5cb0ae67cd 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1551,7 +1551,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         if (kvm_pit_in_kernel()) {
             pit = kvm_pit_init(isa_bus, 0x40);
         } else {
-            pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq);
+            pit = i8254_pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq);
         }
         if (hpet) {
             /* connect PIT to output control line of the HPET */
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 4d29a9900c..7a8baef23c 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -97,7 +97,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     isa_bus_irqs(isabus, s->i8259);
 
     /* 1 82C54 (pit) */
-    isa = pit_init(isabus, 0x40, 0, NULL);
+    isa = i8254_pit_init(isabus, 0x40, 0, NULL);
 
     /* speaker */
     pcspk_init(isabus, isa);
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 75318680e1..22e6c05fb5 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -363,7 +363,7 @@ static void mips_fulong2e_init(MachineState *machine)
     smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd));
 
     /* init other devices */
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 7e6626dc88..5f37852499 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -222,7 +222,7 @@ static void mips_jazz_init(MachineState *machine,
     i8259 = i8259_init(isa_bus, env->irq[4]);
     isa_bus_irqs(isa_bus, i8259);
     DMA_init(isa_bus, 0);
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     pcspk_init(isa_bus, pit);
 
     /* Video card */
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 2adb9bcf89..de547d732f 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -1217,7 +1217,7 @@ void mips_malta_init(MachineState *machine)
                           isa_get_irq(NULL, 9), NULL, 0, NULL);
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 1272d4ef9d..48fad52540 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -280,7 +280,7 @@ void mips_r4k_init(MachineState *machine)
 
     rtc_init(isa_bus, 2000, NULL);
 
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
 
     serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
 
diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c
index 5e61ad50a8..dbc4a0baec 100644
--- a/hw/timer/i8254.c
+++ b/hw/timer/i8254.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index ee064aa819..c850950699 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index 7f49f1d046..f7d377ead9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -705,6 +705,7 @@ F: hw/ppc/prep.c
 F: hw/ppc/prep_systemio.c
 F: hw/ppc/rs6000_mc.c
 F: hw/pci-host/prep.[hc]
+F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
 F: pc-bios/ppc_rom.bin
 
-- 
2.14.1

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

* [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (19 preceding siblings ...)
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init() Philippe Mathieu-Daudé
@ 2017-09-22 15:40 ` Philippe Mathieu-Daudé
  2017-09-22 20:10   ` Hervé Poussineau
  2017-09-23  5:09   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 15:40 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson,
	Hervé Poussineau, David Gibson, Alexander Graf, Guan Xuetao,
	Mark Cave-Ayland, Artyom Tarasenko
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc

- include vmmouse
- add entries in MAINTAINERS (pckbd.c, i8042.h)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/i386/pc.h     | 11 -----------
 include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
 hw/alpha/dp264.c         |  3 ++-
 hw/i386/pc.c             |  5 +++--
 hw/input/pckbd.c         |  2 +-
 hw/input/vmmouse.c       |  3 +--
 hw/mips/mips_fulong2e.c  |  3 ++-
 hw/mips/mips_jazz.c      |  1 +
 hw/mips/mips_malta.c     |  3 ++-
 hw/mips/mips_r4k.c       |  3 ++-
 hw/misc/vmport.c         |  1 +
 hw/ppc/prep.c            |  5 +++--
 hw/sparc64/sun4u.c       |  3 ++-
 hw/unicore32/puv3.c      |  1 +
 MAINTAINERS              |  4 +++-
 15 files changed, 54 insertions(+), 24 deletions(-)
 create mode 100644 include/hw/input/i8042.h

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 25ba378bd8..6a2e947332 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -193,17 +193,6 @@ static inline void vmport_init(ISABus *bus)
 }
 
 void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
-void vmmouse_get_data(uint32_t *data);
-void vmmouse_set_data(const uint32_t *data);
-
-/* pckbd.c */
-#define I8042_A20_LINE "a20"
-
-void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
-                   MemoryRegion *region, ram_addr_t size,
-                   hwaddr mask);
-void i8042_isa_mouse_fake_event(void *opaque);
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
 
 /* pc.c */
 extern int fd_bootchk;
diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
new file mode 100644
index 0000000000..836417304b
--- /dev/null
+++ b/include/hw/input/i8042.h
@@ -0,0 +1,30 @@
+/*
+ * QEMU PS/2 Controller
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef HW_INPUT_I8042_H
+#define HW_INPUT_I8042_H
+
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+
+#define TYPE_I8042 "i8042"
+
+#define I8042_A20_LINE "a20"
+
+void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
+                   MemoryRegion *region, ram_addr_t size,
+                   hwaddr mask);
+void i8042_isa_mouse_fake_event(void *opaque);
+void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
+
+#define TYPE_VMMOUSE "vmmouse"
+
+void vmmouse_get_data(uint32_t *data);
+void vmmouse_set_data(const uint32_t *data);
+
+#endif /* HW_INPUT_I8042_H */
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 1bd5243648..2253990654 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -19,6 +19,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "qemu/cutils.h"
 
@@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine)
     rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* VGA setup.  Don't bother loading the bios.  */
     pci_vga_init(pci_bus);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5cb0ae67cd..3aa10c780b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -40,6 +40,7 @@
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
@@ -1564,11 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
-    i8042 = isa_create_simple(isa_bus, "i8042");
+    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
     i8042_setup_a20_line(i8042, a20_line[0]);
     if (!no_vmport) {
         vmport_init(isa_bus);
-        vmmouse = isa_try_create(isa_bus, "vmmouse");
+        vmmouse = isa_try_create(isa_bus, TYPE_VMMOUSE);
     } else {
         vmmouse = NULL;
     }
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index c479f827b6..f17f18e51b 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -26,6 +26,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "sysemu/sysemu.h"
 
 /* debug PC keyboard */
@@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
     qemu_register_reset(kbd_reset, s);
 }
 
-#define TYPE_I8042 "i8042"
 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
 
 typedef struct ISAKBDState {
diff --git a/hw/input/vmmouse.c b/hw/input/vmmouse.c
index b6d22086f4..c48c07c564 100644
--- a/hw/input/vmmouse.c
+++ b/hw/input/vmmouse.c
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "ui/console.h"
-#include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "hw/i386/pc.h"
 #include "hw/qdev.h"
 
@@ -52,7 +52,6 @@
 #define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
-#define TYPE_VMMOUSE "vmmouse"
 #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)
 
 typedef struct VMMouseState
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 22e6c05fb5..a35745a407 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -42,6 +42,7 @@
 #include "hw/isa/vt82c686.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -367,7 +368,7 @@ static void mips_fulong2e_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
 
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 25f0294236..1bbef7eeb5 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -41,6 +41,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/display/vga.h"
 #include "hw/audio/pcspk.h"
+#include "hw/input/i8042.h"
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index de547d732f..45c7f589aa 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -45,6 +45,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -1221,7 +1222,7 @@ void mips_malta_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 48fad52540..946097a31f 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -27,6 +27,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -295,7 +296,7 @@ void mips_r4k_init(MachineState *machine)
                      hd[MAX_IDE_DEVS * i],
 		     hd[MAX_IDE_DEVS * i + 1]);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 }
 
 static void mips_machine_init(MachineClass *mc)
diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c
index 165500223f..bc078eb20a 100644
--- a/hw/misc/vmport.c
+++ b/hw/misc/vmport.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
+#include "hw/input/i8042.h"
 #include "sysemu/hw_accel.h"
 #include "hw/qdev.h"
 
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 94138a4e8c..16f4537093 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -41,6 +41,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
@@ -643,7 +644,7 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
 		     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
@@ -775,7 +776,7 @@ static void ibm_40p_init(MachineState *machine)
 
     /* add some more devices */
     if (defaults_enabled()) {
-        isa_create_simple(isa_bus, "i8042");
+        isa_create_simple(isa_bus, TYPE_I8042);
         m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index c3280aaf38..973daed977 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -31,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
+#include "hw/input/i8042.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -488,7 +489,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
     pci_cmd646_ide_init(pci_bus, hd, 1);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* Floppy */
     for(i = 0; i < MAX_FD; i++) {
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 6849bac59c..cf79c89f12 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -19,6 +19,7 @@
 
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
+#include "hw/input/i8042.h"
 
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
diff --git a/MAINTAINERS b/MAINTAINERS
index f7d377ead9..cc1f8bb66b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -834,12 +834,13 @@ F: hw/misc/sga.c
 PC Chipset
 M: Michael S. Tsirkin <mst@redhat.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
-S: Support
+S: Supported
 F: hw/char/debugcon.c
 F: hw/char/parallel.c
 F: hw/char/serial*
 F: hw/dma/i8257*
 F: hw/i2c/pm_smbus.c
+F: hw/input/pckbd.c
 F: hw/intc/apic*
 F: hw/intc/ioapic*
 F: hw/intc/i8259*
@@ -849,6 +850,7 @@ F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
 F: include/hw/i2c/pm_smbus.h
+F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
 F: include/hw/timer/mc146818rtc*
-- 
2.14.1

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

* [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (20 preceding siblings ...)
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 17:43   ` Hervé Poussineau
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init() Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson,
	Hervé Poussineau, David Gibson, Alexander Graf,
	Mark Cave-Ayland, Artyom Tarasenko
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

- move the header from hw/isa/ to hw/dma/
- add entry for i82374 in MAINTAINERS
- remove the old i386/pc dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/{isa/i8257.h => dma/i8257_dma.h} | 6 ++++++
 include/hw/isa/isa.h                        | 2 --
 hw/dma/i82374.c                             | 3 ++-
 hw/dma/i8257.c                              | 4 ++--
 hw/i386/pc.c                                | 3 ++-
 hw/mips/mips_fulong2e.c                     | 3 ++-
 hw/mips/mips_jazz.c                         | 3 ++-
 hw/mips/mips_malta.c                        | 3 ++-
 hw/sparc/sun4m.c                            | 4 ----
 hw/sparc64/sun4u.c                          | 4 ----
 MAINTAINERS                                 | 2 ++
 11 files changed, 20 insertions(+), 17 deletions(-)
 rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)

diff --git a/include/hw/isa/i8257.h b/include/hw/dma/i8257_dma.h
similarity index 86%
rename from include/hw/isa/i8257.h
rename to include/hw/dma/i8257_dma.h
index 88a2766a3f..0041565177 100644
--- a/include/hw/isa/i8257.h
+++ b/include/hw/dma/i8257_dma.h
@@ -1,6 +1,10 @@
 #ifndef HW_I8257_H
 #define HW_I8257_H
 
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+#include "exec/ioport.h"
+
 #define TYPE_I8257 "i8257"
 
 typedef struct I8257Regs {
@@ -40,4 +44,6 @@ typedef struct I8257State {
     PortioList portio_pageh;
 } I8257State;
 
+void i8257_dma_init(ISABus *bus, int high_page_enable);
+
 #endif
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 95593408ef..b9dbab24b4 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d)
     return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
-/* i8257.c */
-void DMA_init(ISABus *bus, int high_page_enable);
 #endif
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
index 6c0f975df0..4048bedcf2 100644
--- a/hw/dma/i82374.c
+++ b/hw/dma/i82374.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
+#include "hw/dma/i8257_dma.h"
 
 #define TYPE_I82374 "i82374"
 #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374)
@@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp)
     portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
                     s->iobase);
 
-    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
+    i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
     memset(s->commands, 0, sizeof(s->commands));
 }
 
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index bd23e893bf..a8f26b003b 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
-#include "hw/isa/i8257.h"
+#include "hw/dma/i8257_dma.h"
 #include "qemu/main-loop.h"
 #include "trace.h"
 
@@ -622,7 +622,7 @@ static void i8257_register_types(void)
 
 type_init(i8257_register_types)
 
-void DMA_init(ISABus *bus, int high_page_enable)
+void i8257_dma_init(ISABus *bus, int high_page_enable)
 {
     ISADevice *isa1, *isa2;
     DeviceState *d;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3aa10c780b..76d4be5991 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -39,6 +39,7 @@
 #include "elf.h"
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
@@ -1582,7 +1583,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
 
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     for(i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index a35745a407..6dc6a0ac18 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
@@ -365,7 +366,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
     /* init other devices */
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 1bbef7eeb5..1b54602c1d 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -27,6 +27,7 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "hw/block/fdc.h"
@@ -223,7 +224,7 @@ static void mips_jazz_init(MachineState *machine,
     /* ISA devices */
     i8259 = i8259_init(isa_bus, env->irq[4]);
     isa_bus_irqs(isa_bus, i8259);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     pcspk_init(isa_bus, pit);
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 45c7f589aa..050da36f1d 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -27,6 +27,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
@@ -1219,7 +1220,7 @@ void mips_malta_init(MachineState *machine)
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index e1bdd4828d..a4ba3d2917 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -101,10 +101,6 @@ struct sun4m_hwdef {
     uint8_t nvram_machine_id;
 };
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 973daed977..fd10741607 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -86,10 +86,6 @@ typedef struct EbusState {
     MemoryRegion bar1;
 } EbusState;
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
diff --git a/MAINTAINERS b/MAINTAINERS
index cc1f8bb66b..a79723601c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -707,6 +707,7 @@ F: hw/ppc/rs6000_mc.c
 F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
+F: hw/dma/i82374.c
 F: pc-bios/ppc_rom.bin
 
 sPAPR
@@ -849,6 +850,7 @@ F: hw/misc/pc-testdev.c
 F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
+F: include/hw/dma/i8257_dma.h
 F: include/hw/i2c/pm_smbus.h
 F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
-- 
2.14.1

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

* [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init()
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (21 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 20:11   ` Hervé Poussineau
  2017-09-23  5:10   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson,
	Hervé Poussineau, David Gibson, Alexander Graf
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

and remove the old i386/pc dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/timer/mc146818rtc.h | 3 ++-
 hw/alpha/dp264.c               | 2 +-
 hw/i386/pc.c                   | 2 +-
 hw/isa/i82378.c                | 3 ++-
 hw/mips/mips_fulong2e.c        | 2 +-
 hw/mips/mips_jazz.c            | 2 +-
 hw/mips/mips_malta.c           | 2 +-
 hw/mips/mips_r4k.c             | 2 +-
 hw/ppc/pnv.c                   | 2 +-
 hw/timer/mc146818rtc.c         | 2 +-
 10 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
index 7c8e64b203..fe6ed63f71 100644
--- a/include/hw/timer/mc146818rtc.h
+++ b/include/hw/timer/mc146818rtc.h
@@ -6,7 +6,8 @@
 
 #define TYPE_MC146818_RTC "mc146818rtc"
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
+                             qemu_irq intercept_irq);
 void rtc_set_memory(ISADevice *dev, int addr, int val);
 int rtc_get_memory(ISADevice *dev, int addr);
 
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 2253990654..df6dadf13f 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -80,7 +80,7 @@ static void clipper_init(MachineState *machine)
                            clipper_pci_map_irq);
 
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
-    rtc_init(isa_bus, 1900, rtc_irq);
+    mc146818_rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
     isa_create_simple(isa_bus, TYPE_I8042);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 76d4be5991..788844e0de 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1545,7 +1545,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
             rtc_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_RTC_INT);
         }
     }
-    *rtc_state = rtc_init(isa_bus, 2000, rtc_irq);
+    *rtc_state = mc146818_rtc_init(isa_bus, 2000, rtc_irq);
 
     qemu_register_boot_set(pc_boot_set, *rtc_state);
 
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 7a8baef23c..14b006cadc 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -21,6 +21,7 @@
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
 #include "hw/timer/i8254.h"
+#include "hw/timer/mc146818rtc.h"
 #include "hw/audio/pcspk.h"
 
 #define TYPE_I82378 "i82378"
@@ -106,7 +107,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     isa = isa_create_simple(isabus, "i82374");
 
     /* timer */
-    isa_create_simple(isabus, "mc146818rtc");
+    isa_create_simple(isabus, TYPE_MC146818_RTC);
 }
 
 static void i82378_init(Object *obj)
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 6dc6a0ac18..7ebbffa8f2 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -371,7 +371,7 @@ static void mips_fulong2e_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
     parallel_hds_isa_init(isa_bus, 1);
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 1b54602c1d..439bbd71fe 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -295,7 +295,7 @@ static void mips_jazz_init(MachineState *machine,
     fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), -1, 0x80003000, fds);
 
     /* Real time clock */
-    rtc_init(isa_bus, 1980, NULL);
+    mc146818_rtc_init(isa_bus, 1980, NULL);
     memory_region_init_io(rtc, NULL, &rtc_ops, NULL, "rtc", 0x1000);
     memory_region_add_subregion(address_space, 0x80004000, rtc);
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 050da36f1d..6945fa47c3 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -1225,7 +1225,7 @@ void mips_malta_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
     parallel_hds_isa_init(isa_bus, 1);
 
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 946097a31f..349da59912 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -279,7 +279,7 @@ void mips_r4k_init(MachineState *machine)
     i8259 = i8259_init(isa_bus, env->irq[2]);
     isa_bus_irqs(isa_bus, i8259);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
 
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 47221158d4..d188b899c5 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -647,7 +647,7 @@ static void ppc_powernv_init(MachineState *machine)
     serial_hds_isa_init(pnv->isa_bus, 0, MAX_SERIAL_PORTS);
 
     /* Create an RTC ISA device too */
-    rtc_init(pnv->isa_bus, 2000, NULL);
+    mc146818_rtc_init(pnv->isa_bus, 2000, NULL);
 
     /* OpenPOWER systems use a IPMI SEL Event message to notify the
      * host to powerdown */
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 82843ed03f..f7d8c4bae4 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -997,7 +997,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     qdev_init_gpio_out(dev, &s->irq, 1);
 }
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 {
     DeviceState *dev;
     ISADevice *isadev;
-- 
2.14.1

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

* [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (22 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init() Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 20:12   ` Hervé Poussineau
  2017-09-23  5:11   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Hervé Poussineau,
	David Gibson, Alexander Graf
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/timer/m48t59.h | 2 ++
 hw/ppc/prep.c             | 2 +-
 hw/timer/m48t59-isa.c     | 2 +-
 MAINTAINERS               | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
index db5e43a8da..069bb045d7 100644
--- a/include/hw/timer/m48t59.h
+++ b/include/hw/timer/m48t59.h
@@ -25,6 +25,8 @@ typedef struct NvramClass {
     void (*toggle_lock)(Nvram *obj, int lock);
 } NvramClass;
 
+#define TYPE_M48T59_ISA "isa-m48t59"
+
 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
                        int base_year, int type);
 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 16f4537093..1f8ef4819b 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -777,7 +777,7 @@ static void ibm_40p_init(MachineState *machine)
     /* add some more devices */
     if (defaults_enabled()) {
         isa_create_simple(isa_bus, TYPE_I8042);
-        m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
+        m48t59 = NVRAM(isa_create_simple(isa_bus, TYPE_M48T59_ISA));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
         qdev_prop_set_uint32(dev, "iobase", 0x830);
diff --git a/hw/timer/m48t59-isa.c b/hw/timer/m48t59-isa.c
index ea1ba703d7..077346f7ca 100644
--- a/hw/timer/m48t59-isa.c
+++ b/hw/timer/m48t59-isa.c
@@ -49,7 +49,7 @@ typedef struct M48txxISADeviceClass {
 
 static M48txxInfo m48txx_isa_info[] = {
     {
-        .bus_name = "isa-m48t59",
+        .bus_name = TYPE_M48T59_ISA,
         .model = 59,
         .size = 0x2000,
     }
diff --git a/MAINTAINERS b/MAINTAINERS
index a79723601c..3cb6bc190c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -708,6 +708,8 @@ F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
 F: hw/dma/i82374.c
+F: hw/timer/m48t59-isa.c
+F: include/hw/timer/m48t59.h
 F: pc-bios/ppc_rom.bin
 
 sPAPR
-- 
2.14.1

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

* [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (23 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 20:13   ` Hervé Poussineau
  2017-09-23  5:11   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Hervé Poussineau,
	David Gibson, Alexander Graf, Jason Wang
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

- add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
- remove the old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/net/ne2000.h             |  3 +++
 include/hw/i386/pc.h        | 20 --------------------
 include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
 hw/i386/pc.c                |  1 +
 hw/mips/mips_r4k.c          |  1 +
 hw/net/ne2000-isa.c         |  6 ++----
 hw/net/ne2000.c             |  2 --
 hw/ppc/prep.c               |  1 +
 MAINTAINERS                 |  1 +
 9 files changed, 42 insertions(+), 26 deletions(-)
 create mode 100644 include/hw/net/ne2000-isa.h

diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h
index d213dccae3..adb8021bd1 100644
--- a/hw/net/ne2000.h
+++ b/hw/net/ne2000.h
@@ -1,6 +1,9 @@
 #ifndef HW_NE2000_H
 #define HW_NE2000_H
 
+#include "hw/hw.h"
+#include "net/net.h"
+
 #define NE2000_PMEM_SIZE    (32*1024)
 #define NE2000_PMEM_START   (16*1024)
 #define NE2000_PMEM_END     (NE2000_PMEM_SIZE+NE2000_PMEM_START)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 6a2e947332..020792c2e8 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -291,26 +291,6 @@ PCIBus *find_i440fx(void);
 extern PCIDevice *piix4_dev;
 int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
 
-/* ne2000.c */
-static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
-{
-    DeviceState *dev;
-    ISADevice *isadev;
-
-    qemu_check_nic_model(nd, "ne2k_isa");
-
-    isadev = isa_try_create(bus, "ne2k_isa");
-    if (!isadev) {
-        return false;
-    }
-    dev = DEVICE(isadev);
-    qdev_prop_set_uint32(dev, "iobase", base);
-    qdev_prop_set_uint32(dev, "irq",    irq);
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-    return true;
-}
-
 /* pc_sysfw.c */
 void pc_system_firmware_init(MemoryRegion *rom_memory,
                              bool isapc_ram_fw);
diff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h
new file mode 100644
index 0000000000..ff2bed9c95
--- /dev/null
+++ b/include/hw/net/ne2000-isa.h
@@ -0,0 +1,33 @@
+/*
+ * QEMU NE2000 emulation -- isa bus windup
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "hw/hw.h"
+#include "hw/qdev.h"
+#include "hw/isa/isa.h"
+#include "net/net.h"
+
+#define TYPE_ISA_NE2000 "ne2k_isa"
+
+static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
+                                         NICInfo *nd)
+{
+    ISADevice *d;
+
+    qemu_check_nic_model(nd, "ne2k_isa");
+
+    d = isa_try_create(bus, TYPE_ISA_NE2000);
+    if (d) {
+        DeviceState *dev = DEVICE(d);
+
+        qdev_prop_set_uint32(dev, "iobase", base);
+        qdev_prop_set_uint32(dev, "irq",    irq);
+        qdev_set_nic_properties(dev, nd);
+        qdev_init_nofail(dev);
+    }
+    return d;
+}
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 788844e0de..085577e066 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -71,6 +71,7 @@
 #include "qom/cpu.h"
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
+#include "hw/net/ne2000-isa.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 349da59912..33ff89f02c 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -18,6 +18,7 @@
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/block/flash.h"
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index f3455339ee..70e5c1d3d4 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -22,17 +22,15 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "hw/net/ne2000-isa.h"
 #include "hw/qdev.h"
-#include "net/net.h"
 #include "ne2000.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 
-#define TYPE_ISA_NE2000 "ne2k_isa"
 #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)
 
 typedef struct ISANE2000State {
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 798d681e25..29bd4adb3f 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -22,9 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
 #include "hw/pci/pci.h"
-#include "net/net.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 1f8ef4819b..fb330a1769 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -43,6 +43,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index 3cb6bc190c..37917af0f0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -973,6 +973,7 @@ Network devices
 M: Jason Wang <jasowang@redhat.com>
 S: Odd Fixes
 F: hw/net/
+F: include/hw/net/
 F: tests/virtio-net-test.c
 T: git git://github.com/jasowang/qemu.git net
 
-- 
2.14.1

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

* [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (24 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-23  5:12   ` David Gibson
  2017-09-25 14:30   ` Marcel Apfelbaum
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000 Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Yongbok Kim, Alexander Graf,
	David Gibson, Jason Wang
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, qemu-arm, qemu-ppc, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/pci/pci_internal.h | 16 +++++++++++
 include/hw/net/pci.h  | 20 +++++++++++++
 include/hw/pci/pci.h  |  4 ---
 hw/arm/virt.c         |  1 +
 hw/mips/mips_malta.c  |  1 +
 hw/pci/pci.c          | 67 ++------------------------------------------
 hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/e500.c         |  1 +
 hw/ppc/spapr.c        |  1 +
 hw/pci/Makefile.objs  |  1 +
 10 files changed, 120 insertions(+), 69 deletions(-)
 create mode 100644 hw/pci/pci_internal.h
 create mode 100644 include/hw/net/pci.h
 create mode 100644 hw/pci/pci_nic.c

diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h
new file mode 100644
index 0000000000..d967468767
--- /dev/null
+++ b/hw/pci/pci_internal.h
@@ -0,0 +1,16 @@
+/*
+ * QEMU PCI internal
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_PCI_INTERNAL_H
+#define QEMU_HW_PCI_INTERNAL_H
+
+#include "hw/pci/pci_bus.h"
+
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
+
+#endif
diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
new file mode 100644
index 0000000000..529591b7f3
--- /dev/null
+++ b/include/hw/net/pci.h
@@ -0,0 +1,20 @@
+/*
+ * QEMU network devices
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_NET_PCI_H
+#define QEMU_HW_NET_PCI_H
+
+#include "net/net.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr);
+
+#endif
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index aa7ef9cf69..6a0f7b5472 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                           PCIINTxRoutingNotifier notifier);
 void pci_device_reset(PCIDevice *dev);
 
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr);
-
 PCIDevice *pci_vga_init(PCIBus *bus);
 
 int pci_bus_num(PCIBus *s);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9e18b410d7..39fab3acb9 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -35,6 +35,7 @@
 #include "hw/arm/primecell.h"
 #include "hw/arm/virt.h"
 #include "hw/devices.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/device_tree.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 6945fa47c3..fb6a2f9363 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
+#include "hw/net/pci.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"             /* SysBusDevice */
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1e6fb88eba..9b678c8fd0 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -28,7 +28,6 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "monitor/monitor.h"
-#include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "qemu/error-report.h"
@@ -41,6 +40,7 @@
 #include "hw/hotplug.h"
 #include "hw/boards.h"
 #include "qemu/cutils.h"
+#include "pci_internal.h"
 
 //#define DEBUG_PCI
 #ifdef DEBUG_PCI
@@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
     return 0;
 }
 
-static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
-                                 const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
 {
     int dom, bus;
     unsigned slot;
@@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
     return head;
 }
 
-static const char * const pci_nic_models[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio",
-    "sungem",
-    NULL
-};
-
-static const char * const pci_nic_names[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio-net-pci",
-    "sungem",
-    NULL
-};
-
-/* Initialize a PCI NIC.  */
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
-    PCIBus *bus;
-    PCIDevice *pci_dev;
-    DeviceState *dev;
-    int devfn;
-    int i;
-
-    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
-        exit(0);
-    }
-
-    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
-    if (i < 0) {
-        exit(1);
-    }
-
-    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
-    if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
-    }
-
-    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
-    dev = &pci_dev->qdev;
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-
-    return pci_dev;
-}
-
 PCIDevice *pci_vga_init(PCIBus *bus)
 {
     switch (vga_interface_type) {
diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c
new file mode 100644
index 0000000000..fb1a10ff12
--- /dev/null
+++ b/hw/pci/pci_nic.c
@@ -0,0 +1,77 @@
+/*
+ * QEMU PCI network interface
+ *
+ * Copyright (c) 2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/net/pci.h"
+#include "net/net.h"
+#include "pci_internal.h"
+
+static const char *const pci_nic_models[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio",
+    "sungem",
+    NULL
+};
+
+static const char *const pci_nic_names[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio-net-pci",
+    "sungem",
+    NULL
+};
+
+/* Initialize a PCI NIC.  */
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr)
+{
+    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
+    PCIBus *bus;
+    PCIDevice *pci_dev;
+    DeviceState *dev;
+    int devfn;
+    int i;
+
+    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
+        exit(0);
+    }
+
+    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
+    if (i < 0) {
+        exit(1);
+    }
+
+    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
+    if (!bus) {
+        error_report("Invalid PCI device address %s for device %s",
+                     devaddr, pci_nic_names[i]);
+        exit(1);
+    }
+
+    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
+    dev = &pci_dev->qdev;
+    qdev_set_nic_properties(dev, nd);
+    qdev_init_nofail(dev);
+
+    return pci_dev;
+}
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index db0e49ab8f..482757ca7b 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "hw/char/serial.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 17ea77618c..96007051e2 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -56,6 +56,7 @@
 #include "hw/pci-host/spapr.h"
 #include "hw/ppc/xics.h"
 #include "hw/pci/msi.h"
+#include "hw/net/pci.h"
 
 #include "hw/pci/pci.h"
 #include "hw/scsi/scsi.h"
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index 9f905e6344..125428fd54 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -1,4 +1,5 @@
 common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
+common-obj-$(CONFIG_PCI) += pci_nic.o
 common-obj-$(CONFIG_PCI) += msix.o msi.o
 common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
-- 
2.14.1

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

* [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (25 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-23  5:13   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Richard Henderson, Alexander Graf, David Gibson, Balaton Zoltan,
	Jason Wang
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/net/pci.h   | 2 ++
 hw/alpha/dp264.c       | 3 ++-
 hw/i386/pc.c           | 3 ++-
 hw/ppc/ppc440_bamboo.c | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index 529591b7f3..b24b5257a5 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -13,6 +13,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 
+#define TYPE_PCI_E1000      "e1000"
+
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
                                const char *default_devaddr);
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index df6dadf13f..65947fe1bf 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -21,6 +21,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
@@ -93,7 +94,7 @@ static void clipper_init(MachineState *machine)
 
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_E1000, NULL);
     }
 
     /* IDE disk setup.  */
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 085577e066..3cdeb148aa 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -72,6 +72,7 @@
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -1606,7 +1607,7 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
         if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
             pc_init_ne2k_isa(isa_bus, nd);
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "e1000", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_E1000, NULL);
         }
     }
     rom_reset_order_override();
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index f92d47f28d..6387dbda9f 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -24,6 +24,7 @@
 #include "elf.h"
 #include "exec/address-spaces.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "hw/ppc/ppc.h"
 #include "ppc405.h"
 #include "sysemu/sysemu.h"
@@ -248,7 +249,7 @@ static void bamboo_init(MachineState *machine)
         for (i = 0; i < nb_nics; i++) {
             /* There are no PCI NICs on the Bamboo board, but there are
              * PCI slots, so we can pick whatever default model we want. */
-            pci_nic_init_nofail(&nd_table[i], pcibus, "e1000", NULL);
+            pci_nic_init_nofail(&nd_table[i], pcibus, TYPE_PCI_E1000, NULL);
         }
     }
 
-- 
2.14.1

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

* [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (26 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000 Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-25  5:34   ` Thomas Huth
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Jason Wang
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/net/pci.h | 1 +
 hw/net/e1000e.c      | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index b24b5257a5..92111f86f3 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -14,6 +14,7 @@
 #include "hw/pci/pci_bus.h"
 
 #define TYPE_PCI_E1000      "e1000"
+#define TYPE_PCI_E1000E     "e1000e"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 6c42b4478c..494f8cced6 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -40,6 +40,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
+#include "hw/net/pci.h"
 
 #include "hw/net/e1000_regs.h"
 
@@ -49,8 +50,7 @@
 #include "trace.h"
 #include "qapi/error.h"
 
-#define TYPE_E1000E "e1000e"
-#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E)
+#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_PCI_E1000E)
 
 typedef struct E1000EState {
     PCIDevice parent_obj;
@@ -703,7 +703,7 @@ static void e1000e_instance_init(Object *obj)
 }
 
 static const TypeInfo e1000e_info = {
-    .name = TYPE_E1000E,
+    .name =   TYPE_PCI_E1000E,
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(E1000EState),
     .class_init = e1000e_class_init,
-- 
2.14.1

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

* [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (27 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 20:13   ` Hervé Poussineau
  2017-09-23  5:14   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139 Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Hervé Poussineau, Aurelien Jarno,
	Yongbok Kim, Alexander Graf, David Gibson, Jason Wang
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/net/pci.h | 1 +
 hw/mips/mips_malta.c | 2 +-
 hw/net/pcnet-pci.c   | 3 +--
 hw/ppc/prep.c        | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index 92111f86f3..5ad5487a91 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_PCNET      "pcnet"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index fb6a2f9363..921678fdb0 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -597,7 +597,7 @@ static void network_init(PCIBus *pci_bus)
             /* The malta board has a PCNet card using PCI SLOT 11 */
             default_devaddr = "0b";
 
-        pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr);
+        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_PCNET, default_devaddr);
     }
 }
 
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 0acf8a4879..878e2c89c1 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -29,6 +29,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "hw/loader.h"
 #include "qemu/timer.h"
@@ -46,8 +47,6 @@
 //#define PCNET_DEBUG_TMD
 //#define PCNET_DEBUG_MATCH
 
-#define TYPE_PCI_PCNET "pcnet"
-
 #define PCI_PCNET(obj) \
      OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET)
 
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index fb330a1769..b2c7a62ebc 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -44,6 +44,7 @@
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
@@ -800,7 +801,7 @@ static void ibm_40p_init(MachineState *machine)
         pci_vga_init(pci_bus);
 
         for (i = 0; i < nb_nics; i++) {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet",
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_PCNET,
                                 i == 0 ? "3" : NULL);
         }
     }
-- 
2.14.1

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

* [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (28 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-25  5:36   ` Thomas Huth
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000 Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Yongbok Kim, Magnus Damm,
	Jason Wang
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-arm, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/net/pci.h    | 1 +
 hw/arm/realview.c       | 3 ++-
 hw/arm/versatilepb.c    | 3 ++-
 hw/mips/mips_fulong2e.c | 3 ++-
 hw/net/rtl8139.c        | 7 +++----
 hw/sh4/r2d.c            | 5 +++--
 6 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index 5ad5487a91..43ed3b0145 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -16,6 +16,7 @@
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
 #define TYPE_PCI_PCNET      "pcnet"
+#define TYPE_PCI_RTL8139    "rtl8139"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 87cd1e583c..35f0da28e4 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -20,6 +20,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
@@ -269,7 +270,7 @@ static void realview_init(MachineState *machine,
             done_nic = 1;
         } else {
             if (pci_bus) {
-                pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+                pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
             }
         }
     }
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 418792cd02..297aad78e1 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -18,6 +18,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -271,7 +272,7 @@ static void versatile_init(MachineState *machine, int board_id)
             smc91c111_init(nd, 0x10010000, sic[25]);
             done_smc = 1;
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
         }
     }
     if (machine_usb(machine)) {
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 7ebbffa8f2..fe618953c9 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -44,6 +44,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
+#include "hw/net/pci.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -253,7 +254,7 @@ static void network_init (PCIBus *pci_bus)
             default_devaddr = "07";
         }
 
-        pci_nic_init_nofail(nd, pci_bus, "rtl8139", default_devaddr);
+        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, default_devaddr);
     }
 }
 
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3be24bbee7..0f952eceba 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -59,6 +59,7 @@
 #include "net/net.h"
 #include "net/eth.h"
 #include "hw/loader.h"
+#include "hw/net/pci.h"
 #include "sysemu/sysemu.h"
 #include "qemu/iov.h"
 
@@ -90,10 +91,8 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
 }
 #endif
 
-#define TYPE_RTL8139 "rtl8139"
-
 #define RTL8139(obj) \
-     OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139)
+     OBJECT_CHECK(RTL8139State, (obj), TYPE_PCI_RTL8139)
 
 /* Symbolic offsets to registers. */
 enum RTL8139_registers {
@@ -3437,7 +3436,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo rtl8139_info = {
-    .name          = TYPE_RTL8139,
+    .name          = TYPE_PCI_RTL8139,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(RTL8139State),
     .class_init    = rtl8139_class_init,
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 16b9ed2db2..dde60b2bc2 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -39,6 +39,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/usb.h"
+#include "hw/net/pci.h"
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -303,8 +304,8 @@ static void r2d_init(MachineState *machine)
 
     /* NIC: rtl8139 on-board, and 2 slots. */
     for (i = 0; i < nb_nics; i++)
-        pci_nic_init_nofail(&nd_table[i], pci_bus,
-                            "rtl8139", i==0 ? "2" : NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_RTL8139,
+                            i == 0 ? "2" : NULL);
 
     /* USB keyboard */
     usb_create_simple(usb_bus_find(-1), "usb-kbd");
-- 
2.14.1

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

* [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (29 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139 Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-22 20:14   ` Hervé Poussineau
  2017-09-23  5:14   ` David Gibson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Hervé Poussineau, Aurelien Jarno,
	Alexander Graf, David Gibson, Jason Wang, Mark Cave-Ayland,
	Artyom Tarasenko
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-ppc, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/net/pci.h  | 1 +
 hw/net/ne2000.c       | 3 ++-
 hw/ppc/mac_newworld.c | 3 ++-
 hw/ppc/mac_oldworld.c | 3 ++-
 hw/ppc/prep.c         | 2 +-
 hw/sparc64/sun4u.c    | 3 ++-
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index 43ed3b0145..da733dd1d9 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_NE2000     "ne2k_pci"
 #define TYPE_PCI_PCNET      "pcnet"
 #define TYPE_PCI_RTL8139    "rtl8139"
 
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 29bd4adb3f..b0a664d302 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -23,6 +23,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
@@ -779,7 +780,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ne2000_info = {
-    .name          = "ne2k_pci",
+    .name          = TYPE_PCI_NE2000,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 33b46cb50b..2afc35c27f 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -55,6 +55,7 @@
 #include "hw/ppc/mac_dbdma.h"
 #include "hw/timer/m48t59.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
@@ -435,7 +436,7 @@ static void ppc_core99_init(MachineState *machine)
     }
 
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
     }
 
     /* The NewWorld NVRAM is not located in the MacIO device */
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 193b9047d9..8096e5a126 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -34,6 +34,7 @@
 #include "net/net.h"
 #include "hw/isa/isa.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
@@ -278,7 +279,7 @@ static void ppc_heathrow_init(MachineState *machine)
                              escc_mem, 0, memory_region_size(escc_mem));
 
     for(i = 0; i < nb_nics; i++)
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
 
 
     ide_drive_get(hd, ARRAY_SIZE(hd));
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index b2c7a62ebc..103beafef3 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -636,7 +636,7 @@ static void ppc_prep_init(MachineState *machine)
             isa_ne2000_init(isa_bus, ne2000_io[i], ne2000_irq[i],
                             &nd_table[i]);
         } else {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
 
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index fd10741607..67879c5135 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -32,6 +32,7 @@
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
 #include "hw/input/i8042.h"
+#include "hw/net/pci.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -476,7 +477,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
             onboard_nic_idx = i;
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
     onboard_nic_idx = MAX(onboard_nic_idx, 0);
-- 
2.14.1

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

* [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (30 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000 Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-25  5:38   ` Thomas Huth
  2017-10-02 19:03   ` Richard Henderson
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 34/34] misc: drop " Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  34 siblings, 2 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/alpha/alpha_sys.h | 2 --
 hw/alpha/pci.c       | 2 ++
 hw/alpha/typhoon.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index b6d8369ed7..ac685c1c46 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -5,8 +5,6 @@
 
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
 
diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c
index 8dde637bfe..c370762ea6 100644
--- a/hw/alpha/pci.c
+++ b/hw/alpha/pci.c
@@ -8,6 +8,8 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 #include "alpha_sys.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c
index ae11e012c7..75ac4ed354 100644
--- a/hw/alpha/typhoon.c
+++ b/hw/alpha/typhoon.c
@@ -11,9 +11,9 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
+#include "hw/pci/pci_host.h"
 #include "sysemu/sysemu.h"
 #include "alpha_sys.h"
-#include "exec/address-spaces.h"
 
 
 #define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost"
-- 
2.14.1

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

* [Qemu-devel] [PATCH 34/34] misc: drop old i386 dependency
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (31 preceding siblings ...)
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency Philippe Mathieu-Daudé
@ 2017-09-22 16:01 ` Philippe Mathieu-Daudé
  2017-09-25  5:40   ` Thomas Huth
       [not found] ` <20170922154014.29350-22-f4bug@amsat.org>
  2017-10-16 19:44 ` [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Michael Tokarev
  34 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 16:01 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Paolo Bonzini, Anton Nefedov,
	Anthony Green, Mark Cave-Ayland, Artyom Tarasenko,
	Kirill Batuzov
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial

while here, add an entry for wdt_ib700 in MAINTAINERS

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/char/debugcon.c      | 1 -
 hw/intc/lm32_pic.c      | 1 -
 hw/moxie/moxiesim.c     | 1 -
 hw/sparc/sun4m.c        | 1 -
 hw/watchdog/wdt_ib700.c | 1 -
 MAINTAINERS             | 1 +
 6 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 95ccec6f8b..e2abc61b04 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -29,7 +29,6 @@
 #include "hw/hw.h"
 #include "chardev/char-fe.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 #define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
 #define ISA_DEBUGCON_DEVICE(obj) \
diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c
index 09e15115fb..db6c7afc2f 100644
--- a/hw/intc/lm32_pic.c
+++ b/hw/intc/lm32_pic.c
@@ -20,7 +20,6 @@
 #include "qemu/osdep.h"
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
 #include "trace.h"
diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c
index 5ea8dd3a93..5c9a4211ac 100644
--- a/hw/moxie/moxiesim.c
+++ b/hw/moxie/moxiesim.c
@@ -30,7 +30,6 @@
 #include "cpu.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index a4ba3d2917..f6fda6eb13 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -36,7 +36,6 @@
 #include "net/net.h"
 #include "hw/boards.h"
 #include "hw/scsi/esp.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "hw/nvram/sun_nvram.h"
 #include "hw/nvram/chrp_nvram.h"
diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c
index 532afe89e7..d045032bf4 100644
--- a/hw/watchdog/wdt_ib700.c
+++ b/hw/watchdog/wdt_ib700.c
@@ -25,7 +25,6 @@
 #include "sysemu/watchdog.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 /*#define IB700_DEBUG 1*/
 
diff --git a/MAINTAINERS b/MAINTAINERS
index 37917af0f0..3b767e4012 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -852,6 +852,7 @@ F: hw/misc/pc-testdev.c
 F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
+F: hw/watchdog/wdt_ib700.c
 F: include/hw/dma/i8257_dma.h
 F: include/hw/i2c/pm_smbus.h
 F: include/hw/input/i8042.h
-- 
2.14.1

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

* Re: [Qemu-devel] [PATCH 16/34] hw/tpm: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 16/34] hw/tpm: " Philippe Mathieu-Daudé
@ 2017-09-22 16:05   ` Stefan Berger
  0 siblings, 0 replies; 92+ messages in thread
From: Stefan Berger @ 2017-09-22 16:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Amarnath Valluri
  Cc: qemu-devel, qemu-trivial

On 09/22/2017 11:39 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

> ---
>   hw/tpm/tpm_passthrough.c | 1 -
>   hw/tpm/tpm_tis.c         | 1 -
>   2 files changed, 2 deletions(-)
>
> diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
> index 9234eb3459..461f551a0c 100644
> --- a/hw/tpm/tpm_passthrough.c
> +++ b/hw/tpm/tpm_passthrough.c
> @@ -29,7 +29,6 @@
>   #include "sysemu/tpm_backend.h"
>   #include "tpm_int.h"
>   #include "hw/hw.h"
> -#include "hw/i386/pc.h"
>   #include "sysemu/tpm_backend_int.h"
>   #include "tpm_tis.h"
>   #include "tpm_util.h"
> diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
> index a6440fef91..a3a93f7229 100644
> --- a/hw/tpm/tpm_tis.c
> +++ b/hw/tpm/tpm_tis.c
> @@ -28,7 +28,6 @@
>   #include "sysemu/block-backend.h"
>   #include "exec/address-spaces.h"
>   #include "hw/hw.h"
> -#include "hw/i386/pc.h"
>   #include "hw/pci/pci_ids.h"
>   #include "tpm_tis.h"
>   #include "qapi/error.h"

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

* Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
@ 2017-09-22 16:06   ` Peter Maydell
  2017-09-23  5:08   ` David Gibson
  2017-09-25  8:10   ` Cornelia Huck
  2 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Gerd Hoffmann, Michael S. Tsirkin,
	Igor Mammedov, Eduardo Habkost, David Gibson, Alexander Graf,
	Cornelia Huck, Alex Williamson, QEMU Developers, qemu-ppc,
	QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/acpi/ipmi-stub.c             | 1 +
>  hw/audio/fmopl.c                | 1 -
>  hw/cpu/core.c                   | 1 +
>  hw/ppc/spapr_cpu_core.c         | 1 +
>  hw/smbios/smbios_type_38-stub.c | 1 +
>  hw/vfio/ccw.c                   | 2 +-
>  hw/virtio/vhost-vsock.c         | 2 +-
>  7 files changed, 6 insertions(+), 3 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files Philippe Mathieu-Daudé
@ 2017-09-22 16:07   ` Peter Maydell
  2017-09-22 16:54     ` Corey Minyard
  2017-09-22 17:58     ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
	Corey Minyard, Balaton Zoltan, Alexander Graf, QEMU Developers,
	qemu-ppc, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> while here, add entries for ppc4xx_i2c in MAINTAINERS
>
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

This is doing two things at once and would ideally be
two patches. Still,

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included Philippe Mathieu-Daudé
@ 2017-09-22 16:31   ` Peter Maydell
  2017-09-25  9:01   ` Stefan Hajnoczi
  1 sibling, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Gerd Hoffmann, Stefan Hajnoczi,
	Marc-André Lureau, Michael S. Tsirkin, Zhang Chen,
	Li Zhijian, Jason Wang, Markus Armbruster, Michael Roth,
	Ben Warren, QEMU Developers, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file Philippe Mathieu-Daudé
@ 2017-09-22 16:32   ` Peter Maydell
  0 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Kevin Wolf, Max Reitz,
	QEMU Developers, Qemu-block, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  block/dmg.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/block/dmg.h b/block/dmg.h
> index b592d6fa8b..2ecf239ba5 100644
> --- a/block/dmg.h
> +++ b/block/dmg.h
> @@ -26,7 +26,6 @@
>  #ifndef BLOCK_DMG_H
>  #define BLOCK_DMG_H
>
> -#include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "block/block_int.h"
>  #include <zlib.h>
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
@ 2017-09-22 16:39   ` Peter Maydell
  2017-09-25  8:12   ` Cornelia Huck
  2017-10-10 15:37   ` Anthony PERARD
  2 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Peter Crosthwaite, Richard Henderson,
	Stefano Stabellini, Anthony Perard, Eduardo Habkost,
	Marcel Apfelbaum, Cornelia Huck, Christian Borntraeger,
	Alexander Graf, Stafford Horne, Marc-André Lureau,
	Daniel P. Berrange, Gerd Hoffmann, QEMU Developers, qemu-arm,
	QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> exec: housekeeping (funny since 02d0e095031)
>
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  accel/tcg/translate-all.c          | 1 -
>  exec.c                             | 3 ---
>  hw/arm/spitz.c                     | 1 -
>  hw/char/xen_console.c              | 1 -
>  hw/core/machine.c                  | 1 -
>  hw/s390x/css.c                     | 1 -
>  target/openrisc/exception_helper.c | 1 -
>  tests/vhost-user-test.c            | 1 -
>  util/qemu-sockets.c                | 1 -
>  vl.c                               | 1 -
>  10 files changed, 12 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 06/34] ppc: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 06/34] ppc: " Philippe Mathieu-Daudé
@ 2017-09-22 16:39   ` Peter Maydell
  2017-09-23  5:31   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Alexander Graf, David Gibson,
	QEMU Developers, qemu-ppc, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> not needed since 7ebaf795560
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/ppc/spapr_hcall.c | 1 -
>  target/ppc/kvm.c     | 3 ---
>  2 files changed, 4 deletions(-)
>
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 57bb411394..2aeee28fe6 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -13,7 +13,6 @@
>  #include "trace.h"
>  #include "kvm_ppc.h"
>  #include "hw/ppc/spapr_ovec.h"
> -#include "qemu/error-report.h"
>  #include "mmu-book3s-v3.h"
>
>  struct SPRSyncState {
> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> index 1deaf106d2..c9105af393 100644
> --- a/target/ppc/kvm.c
> +++ b/target/ppc/kvm.c
> @@ -47,9 +47,6 @@
>  #include "sysemu/hostmem.h"
>  #include "qemu/cutils.h"
>  #include "qemu/mmap-alloc.h"
> -#if defined(TARGET_PPC64)
> -#include "hw/ppc/spapr_cpu_core.h"
> -#endif
>  #include "elf.h"
>  #include "sysemu/kvm_int.h"
>
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 07/34] i386/hax: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 07/34] i386/hax: " Philippe Mathieu-Daudé
@ 2017-09-22 16:42   ` Peter Maydell
  0 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Yu Ning, Vincent Palatin, QEMU Developers, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/sysemu/hax.h      | 1 -
>  target/i386/hax-darwin.h  | 3 ---
>  target/i386/hax-windows.h | 2 --
>  target/i386/hax-darwin.c  | 8 ++------
>  4 files changed, 2 insertions(+), 12 deletions(-)

I suspect the includes in hax-windows.h could be trimmed a bit
more (since we're guaranteed that if CONFIG_WIN32 then we've
included sysemu/os-win32.h), but this is fine as it stands.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 08/34] nios2: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 08/34] nios2: " Philippe Mathieu-Daudé
@ 2017-09-22 16:44   ` Peter Maydell
  0 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Chris Wulff, Marek Vasut, QEMU Developers, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> applied using ./scripts/clean-includes
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/nios2/cpu.h       | 1 -
>  disas/nios2.c            | 3 ---
>  hw/nios2/boot.c          | 1 -
>  target/nios2/helper.c    | 7 ++-----
>  target/nios2/op_helper.c | 1 +
>  target/nios2/translate.c | 1 +
>  6 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
> index 50d803a217..fda02c39b9 100644
> --- a/target/nios2/cpu.h
> +++ b/target/nios2/cpu.h
> @@ -20,7 +20,6 @@
>  #ifndef CPU_NIOS2_H
>  #define CPU_NIOS2_H
>
> -#include "qemu/osdep.h"
>  #include "qemu-common.h"
>
>  #define TARGET_LONG_BITS 32
> diff --git a/disas/nios2.c b/disas/nios2.c
> index b342936d21..de11f04cc4 100644
> --- a/disas/nios2.c
> +++ b/disas/nios2.c
> @@ -1756,7 +1756,6 @@ extern const int nios2_num_r2_reg_range_mappings;
>  #endif /* _NIOS2_H */
>
>  /*#include "sysdep.h"
> -#include <stdio.h>
>  #include "opcode/nios2.h"
>  */
>  /* Register string table */
> @@ -2521,8 +2520,6 @@ const int nios2_num_r2_reg_range_mappings = 8;
>  #include "dis-asm.h"
>  #include "opcode/nios2.h"
>  #include "libiberty.h"
> -#include <string.h>
> -#include <assert.h>
>  */

These are in commented out bits of code anyway, but I guess it doesn't
hurt and it'll prevent the script complaining later.

>  /* No symbol table is available when this code runs out in an embedded
>     system as when it is used for disassembler support in a monitor.  */
> diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
> index 2b31f5b844..94f436e7fb 100644
> --- a/hw/nios2/boot.c
> +++ b/hw/nios2/boot.c
> @@ -34,7 +34,6 @@
>  #include "qemu/option.h"
>  #include "qemu/config-file.h"
>  #include "qemu/error-report.h"
> -#include "qemu-common.h"
>  #include "sysemu/device_tree.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/loader.h"
> diff --git a/target/nios2/helper.c b/target/nios2/helper.c
> index ef9ee05798..9f741a8f19 100644
> --- a/target/nios2/helper.c
> +++ b/target/nios2/helper.c
> @@ -18,12 +18,9 @@
>   * <http://www.gnu.org/licenses/lgpl-2.1.html>
>   */
>
> -#include <stdio.h>
> -#include <string.h>
> -#include <assert.h>
> -
> -#include "cpu.h"
>  #include "qemu/osdep.h"
> +
> +#include "cpu.h"
>  #include "qemu/host-utils.h"
>  #include "qapi/error.h"
>  #include "exec/exec-all.h"
> diff --git a/target/nios2/op_helper.c b/target/nios2/op_helper.c
> index efb1c489c9..c853aeae02 100644
> --- a/target/nios2/op_helper.c
> +++ b/target/nios2/op_helper.c
> @@ -18,6 +18,7 @@
>   * <http://www.gnu.org/licenses/lgpl-2.1.html>
>   */
>
> +#include "qemu/osdep.h"
>  #include "cpu.h"
>  #include "exec/helper-proto.h"
>  #include "exec/cpu_ldst.h"
> diff --git a/target/nios2/translate.c b/target/nios2/translate.c
> index 6b0961837d..796d399bd1 100644
> --- a/target/nios2/translate.c
> +++ b/target/nios2/translate.c
> @@ -21,6 +21,7 @@
>   * <http://www.gnu.org/licenses/lgpl-2.1.html>
>   */
>
> +#include "qemu/osdep.h"
>  #include "cpu.h"
>  #include "tcg-op.h"
>  #include "exec/exec-all.h"

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path Philippe Mathieu-Daudé
@ 2017-09-22 16:46   ` Peter Maydell
  0 siblings, 0 replies; 92+ messages in thread
From: Peter Maydell @ 2017-09-22 16:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Paolo Bonzini, Peter Crosthwaite, Eduardo Habkost,
	QEMU Developers, QEMU Trivial

On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> while here, remove unused #include from aspeed_smc.h
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/input/adb.c      | 2 +-
>  hw/ssi/aspeed_smc.c | 3 +--
>  numa.c              | 1 -
>  3 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/input/adb.c b/hw/input/adb.c
> index fcca3a8eb9..924a3f9fd5 100644
> --- a/hw/input/adb.c
> +++ b/hw/input/adb.c
> @@ -24,8 +24,8 @@
>  #include "qemu/osdep.h"
>  #include "hw/hw.h"
>  #include "hw/input/adb.h"
> +#include "hw/input/adb-keys.h"
>  #include "ui/console.h"
> -#include "include/hw/input/adb-keys.h"
>  #include "ui/input.h"
>  #include "sysemu/sysemu.h"
>
> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
> index cb515730c5..5059396bc6 100644
> --- a/hw/ssi/aspeed_smc.c
> +++ b/hw/ssi/aspeed_smc.c
> @@ -26,8 +26,7 @@
>  #include "hw/sysbus.h"
>  #include "sysemu/sysemu.h"
>  #include "qemu/log.h"
> -#include "include/qemu/error-report.h"
> -#include "exec/address-spaces.h"
> +#include "qemu/error-report.h"
>
>  #include "hw/ssi/aspeed_smc.h"
>
> diff --git a/numa.c b/numa.c
> index 100a67febf..ebc553b5d9 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -29,7 +29,6 @@
>  #include "qemu/bitmap.h"
>  #include "qom/cpu.h"
>  #include "qemu/error-report.h"
> -#include "include/exec/cpu-common.h" /* for RAM_ADDR_FMT */
>  #include "qapi-visit.h"
>  #include "qapi/opts-visitor.h"
>  #include "hw/boards.h"
> --
> 2.14.1

"while here" usually indicates a patch should be split.

Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files
  2017-09-22 16:07   ` Peter Maydell
@ 2017-09-22 16:54     ` Corey Minyard
  2017-09-22 17:58     ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 92+ messages in thread
From: Corey Minyard @ 2017-09-22 16:54 UTC (permalink / raw)
  To: qemu-devel

On 09/22/2017 11:07 AM, Peter Maydell wrote:
> On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> while here, add entries for ppc4xx_i2c in MAINTAINERS
>>
>> applied using ./scripts/clean-includes
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
> This is doing two things at once and would ideally be
> two patches. Still,

I agree.

> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

I applied this series and did some basic testing, so

Reviewed-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Corey Minyard <cminyard@mvista.com>

> thanks
> -- PMM
>

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

* Re: [Qemu-devel] [PATCH 14/34] hw/ipmi: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 14/34] hw/ipmi: " Philippe Mathieu-Daudé
@ 2017-09-22 16:58   ` Corey Minyard
  0 siblings, 0 replies; 92+ messages in thread
From: Corey Minyard @ 2017-09-22 16:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Corey Minyard
  Cc: qemu-trivial, qemu-devel

On 09/22/2017 10:39 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

As mentioned before, I applied this series and did some basic testing, so

Reviewed-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Corey Minyard <cminyard@mvista.com>

> ---
>   hw/ipmi/isa_ipmi_bt.c  | 1 -
>   hw/ipmi/isa_ipmi_kcs.c | 1 -
>   2 files changed, 2 deletions(-)
>
> diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
> index 2fcc3d2e7c..e098fd5206 100644
> --- a/hw/ipmi/isa_ipmi_bt.c
> +++ b/hw/ipmi/isa_ipmi_bt.c
> @@ -26,7 +26,6 @@
>   #include "hw/hw.h"
>   #include "hw/ipmi/ipmi.h"
>   #include "hw/isa/isa.h"
> -#include "hw/i386/pc.h"
>   
>   /* Control register */
>   #define IPMI_BT_CLR_WR_BIT         0
> diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c
> index 80444977a0..689587b65d 100644
> --- a/hw/ipmi/isa_ipmi_kcs.c
> +++ b/hw/ipmi/isa_ipmi_kcs.c
> @@ -26,7 +26,6 @@
>   #include "hw/hw.h"
>   #include "hw/ipmi/ipmi.h"
>   #include "hw/isa/isa.h"
> -#include "hw/i386/pc.h"
>   
>   #define IPMI_KCS_OBF_BIT        0
>   #define IPMI_KCS_IBF_BIT        1

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

* Re: [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
@ 2017-09-22 17:43   ` Hervé Poussineau
  2017-09-22 18:08     ` [Qemu-devel] [Qemu-trivial] " Philippe Mathieu-Daudé
  0 siblings, 1 reply; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 17:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson, David Gibson,
	Alexander Graf, Mark Cave-Ayland, Artyom Tarasenko
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Hi,

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> - move the header from hw/isa/ to hw/dma/
> - add entry for i82374 in MAINTAINERS
> - remove the old i386/pc dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/{isa/i8257.h => dma/i8257_dma.h} | 6 ++++++
>   include/hw/isa/isa.h                        | 2 --
>   hw/dma/i82374.c                             | 3 ++-
>   hw/dma/i8257.c                              | 4 ++--
>   hw/i386/pc.c                                | 3 ++-
>   hw/mips/mips_fulong2e.c                     | 3 ++-
>   hw/mips/mips_jazz.c                         | 3 ++-
>   hw/mips/mips_malta.c                        | 3 ++-
>   hw/sparc/sun4m.c                            | 4 ----
>   hw/sparc64/sun4u.c                          | 4 ----
>   MAINTAINERS                                 | 2 ++
>   11 files changed, 20 insertions(+), 17 deletions(-)
>   rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)
> 
> diff --git a/include/hw/isa/i8257.h b/include/hw/dma/i8257_dma.h
> similarity index 86%
> rename from include/hw/isa/i8257.h
> rename to include/hw/dma/i8257_dma.h
> index 88a2766a3f..0041565177 100644
> --- a/include/hw/isa/i8257.h
> +++ b/include/hw/dma/i8257_dma.h
> @@ -1,6 +1,10 @@
>   #ifndef HW_I8257_H
>   #define HW_I8257_H
>   
> +#include "hw/hw.h"
> +#include "hw/isa/isa.h"
> +#include "exec/ioport.h"
> +
>   #define TYPE_I8257 "i8257"
>   
>   typedef struct I8257Regs {
> @@ -40,4 +44,6 @@ typedef struct I8257State {
>       PortioList portio_pageh;
>   } I8257State;
>   
> +void i8257_dma_init(ISABus *bus, int high_page_enable);
> +

As you're changing the DMA_init prototype, can you add an Error **errp parameter,
and pass &error_abort in each caller?

See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html for more details

Hervé

>   #endif
> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> index 95593408ef..b9dbab24b4 100644
> --- a/include/hw/isa/isa.h
> +++ b/include/hw/isa/isa.h
> @@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d)
>       return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
>   }
>   
> -/* i8257.c */
> -void DMA_init(ISABus *bus, int high_page_enable);
>   #endif
> diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
> index 6c0f975df0..4048bedcf2 100644
> --- a/hw/dma/i82374.c
> +++ b/hw/dma/i82374.c
> @@ -24,6 +24,7 @@
>   
>   #include "qemu/osdep.h"
>   #include "hw/isa/isa.h"
> +#include "hw/dma/i8257_dma.h"
>   
>   #define TYPE_I82374 "i82374"
>   #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374)
> @@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp)
>       portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
>                       s->iobase);
>   
> -    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
> +    i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
>       memset(s->commands, 0, sizeof(s->commands));
>   }
>   
> diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
> index bd23e893bf..a8f26b003b 100644
> --- a/hw/dma/i8257.c
> +++ b/hw/dma/i8257.c
> @@ -24,7 +24,7 @@
>   #include "qemu/osdep.h"
>   #include "hw/hw.h"
>   #include "hw/isa/isa.h"
> -#include "hw/isa/i8257.h"
> +#include "hw/dma/i8257_dma.h"
>   #include "qemu/main-loop.h"
>   #include "trace.h"
>   
> @@ -622,7 +622,7 @@ static void i8257_register_types(void)
>   
>   type_init(i8257_register_types)
>   
> -void DMA_init(ISABus *bus, int high_page_enable)
> +void i8257_dma_init(ISABus *bus, int high_page_enable)
>   {
>       ISADevice *isa1, *isa2;
>       DeviceState *d;
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 3aa10c780b..76d4be5991 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -39,6 +39,7 @@
>   #include "elf.h"
>   #include "multiboot.h"
>   #include "hw/timer/mc146818rtc.h"
> +#include "hw/dma/i8257_dma.h"
>   #include "hw/timer/i8254.h"
>   #include "hw/input/i8042.h"
>   #include "hw/audio/pcspk.h"
> @@ -1582,7 +1583,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
>       port92_init(port92, a20_line[1]);
>       g_free(a20_line);
>   
> -    DMA_init(isa_bus, 0);
> +    i8257_dma_init(isa_bus, 0);
>   
>       for(i = 0; i < MAX_FD; i++) {
>           fd[i] = drive_get(IF_FLOPPY, 0, i);
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index a35745a407..6dc6a0ac18 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -22,6 +22,7 @@
>   #include "qapi/error.h"
>   #include "hw/hw.h"
>   #include "hw/i386/pc.h"
> +#include "hw/dma/i8257_dma.h"
>   #include "hw/char/serial.h"
>   #include "hw/block/fdc.h"
>   #include "net/net.h"
> @@ -365,7 +366,7 @@ static void mips_fulong2e_init(MachineState *machine)
>   
>       /* init other devices */
>       pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -    DMA_init(isa_bus, 0);
> +    i8257_dma_init(isa_bus, 0);
>   
>       /* Super I/O */
>       isa_create_simple(isa_bus, TYPE_I8042);
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 1bbef7eeb5..1b54602c1d 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -27,6 +27,7 @@
>   #include "hw/mips/mips.h"
>   #include "hw/mips/cpudevs.h"
>   #include "hw/i386/pc.h"
> +#include "hw/dma/i8257_dma.h"
>   #include "hw/char/serial.h"
>   #include "hw/isa/isa.h"
>   #include "hw/block/fdc.h"
> @@ -223,7 +224,7 @@ static void mips_jazz_init(MachineState *machine,
>       /* ISA devices */
>       i8259 = i8259_init(isa_bus, env->irq[4]);
>       isa_bus_irqs(isa_bus, i8259);
> -    DMA_init(isa_bus, 0);
> +    i8257_dma_init(isa_bus, 0);
>       pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
>       pcspk_init(isa_bus, pit);
>   
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 45c7f589aa..050da36f1d 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -27,6 +27,7 @@
>   #include "cpu.h"
>   #include "hw/hw.h"
>   #include "hw/i386/pc.h"
> +#include "hw/dma/i8257_dma.h"
>   #include "hw/char/serial.h"
>   #include "hw/block/fdc.h"
>   #include "net/net.h"
> @@ -1219,7 +1220,7 @@ void mips_malta_init(MachineState *machine)
>       smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
>       g_free(smbus_eeprom_buf);
>       pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -    DMA_init(isa_bus, 0);
> +    i8257_dma_init(isa_bus, 0);
>   
>       /* Super I/O */
>       isa_create_simple(isa_bus, TYPE_I8042);
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index e1bdd4828d..a4ba3d2917 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -101,10 +101,6 @@ struct sun4m_hwdef {
>       uint8_t nvram_machine_id;
>   };
>   
> -void DMA_init(ISABus *bus, int high_page_enable)
> -{
> -}
> -
>   static void fw_cfg_boot_set(void *opaque, const char *boot_device,
>                               Error **errp)
>   {
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index 973daed977..fd10741607 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -86,10 +86,6 @@ typedef struct EbusState {
>       MemoryRegion bar1;
>   } EbusState;
>   
> -void DMA_init(ISABus *bus, int high_page_enable)
> -{
> -}
> -
>   static void fw_cfg_boot_set(void *opaque, const char *boot_device,
>                               Error **errp)
>   {
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cc1f8bb66b..a79723601c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -707,6 +707,7 @@ F: hw/ppc/rs6000_mc.c
>   F: hw/pci-host/prep.[hc]
>   F: hw/isa/i82378.c
>   F: hw/isa/pc87312.[hc]
> +F: hw/dma/i82374.c
>   F: pc-bios/ppc_rom.bin
>   
>   sPAPR
> @@ -849,6 +850,7 @@ F: hw/misc/pc-testdev.c
>   F: hw/timer/hpet*
>   F: hw/timer/i8254*
>   F: hw/timer/mc146818rtc*
> +F: include/hw/dma/i8257_dma.h
>   F: include/hw/i2c/pm_smbus.h
>   F: include/hw/input/i8042.h
>   F: include/hw/timer/hpet.h
> 

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

* Re: [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files
  2017-09-22 16:07   ` Peter Maydell
  2017-09-22 16:54     ` Corey Minyard
@ 2017-09-22 17:58     ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 17:58 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Thomas Huth, Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
	Corey Minyard, Balaton Zoltan, Alexander Graf, QEMU Developers,
	qemu-ppc, QEMU Trivial

On 09/22/2017 01:07 PM, Peter Maydell wrote:
> On 22 September 2017 at 16:39, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> while here, add entries for ppc4xx_i2c in MAINTAINERS
>>
>> applied using ./scripts/clean-includes
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
> 
> This is doing two things at once and would ideally be
> two patches. Still,

OK I'll split "while here" patches.

> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Thanks!

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

* Re: [Qemu-devel] [PATCH 13/34] hw/ide: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 13/34] hw/ide: " Philippe Mathieu-Daudé
@ 2017-09-22 18:03   ` John Snow
  0 siblings, 0 replies; 92+ messages in thread
From: John Snow @ 2017-09-22 18:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, Thomas Huth, Paolo Bonzini
  Cc: qemu-trivial, qemu-block, qemu-devel



On 09/22/2017 11:39 AM, Philippe Mathieu-Daudé wrote:
> and remove a duplicated include
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Acked-by: John Snow <jsnow@redhat.com>

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()
  2017-09-22 17:43   ` Hervé Poussineau
@ 2017-09-22 18:08     ` Philippe Mathieu-Daudé
  2017-10-06 12:09       ` Eduardo Otubo"
  0 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-22 18:08 UTC (permalink / raw)
  To: Hervé Poussineau, Peter Maydell, Thomas Huth, Paolo Bonzini,
	Michael S. Tsirkin, Aurelien Jarno, Yongbok Kim,
	Richard Henderson, David Gibson, Alexander Graf,
	Mark Cave-Ayland, Artyom Tarasenko, Eduardo Otubo"
  Cc: qemu-trivial, qemu-ppc, qemu-devel

On 09/22/2017 02:43 PM, Hervé Poussineau wrote:
> Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
[...]
>> +void i8257_dma_init(ISABus *bus, int high_page_enable);
>> +
> 
> As you're changing the DMA_init prototype, can you add an Error **errp 
> parameter, and pass &error_abort in each caller?
> 
> See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html 
> for more details

If Eduardo doesn't have a patch ready I can do it.

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

* Re: [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init()
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init() Philippe Mathieu-Daudé
@ 2017-09-22 20:09   ` Hervé Poussineau
  0 siblings, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson
  Cc: qemu-devel, qemu-trivial, qemu-ppc

Le 22/09/2017 à 17:40, Philippe Mathieu-Daudé a écrit :
> - add entry for i82378 in MAINTAINERS
> - remove the old i386/pc dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/timer/i8254.h          | 5 +++--
>   include/hw/timer/i8254_internal.h | 2 +-
>   hw/alpha/dp264.c                  | 2 +-
>   hw/i386/pc.c                      | 2 +-
>   hw/isa/i82378.c                   | 2 +-
>   hw/mips/mips_fulong2e.c           | 2 +-
>   hw/mips/mips_jazz.c               | 2 +-
>   hw/mips/mips_malta.c              | 2 +-
>   hw/mips/mips_r4k.c                | 2 +-
>   hw/timer/i8254.c                  | 1 -
>   hw/timer/i8254_common.c           | 1 -
>   MAINTAINERS                       | 1 +
>   12 files changed, 12 insertions(+), 12 deletions(-)
> 

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 21/34] hw/display/vga: remove the old i386/pc dependency
       [not found] ` <20170922154014.29350-22-f4bug@amsat.org>
@ 2017-09-22 20:10   ` Hervé Poussineau
  0 siblings, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim
  Cc: qemu-devel, qemu-trivial

Le 22/09/2017 à 17:40, Philippe Mathieu-Daudé a écrit :
> move public API to "hw/display/vga.h" and private registers
> to "hw/display/vga_int_regs.h"
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> ./scripts/get_maintainer.pl -f hw/display/vga*
> get_maintainer.pl: No maintainers found...
> 
>   hw/display/vga_int.h                 |  3 ++-
>   hw/display/{vga.h => vga_int_regs.h} |  0
>   include/hw/display/vga.h             | 25 +++++++++++++++++++++++++
>   include/hw/i386/pc.h                 | 12 ------------
>   hw/display/vga-isa-mm.c              |  4 +---
>   hw/display/vga-isa.c                 |  2 +-
>   hw/display/vga.c                     |  4 ++--
>   hw/mips/mips_jazz.c                  |  1 +
>   vl.c                                 |  2 +-
>   9 files changed, 33 insertions(+), 20 deletions(-)
>   rename hw/display/{vga.h => vga_int_regs.h} (100%)
>   create mode 100644 include/hw/display/vga.h
> 

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h Philippe Mathieu-Daudé
@ 2017-09-22 20:10   ` Hervé Poussineau
  2017-09-23  5:09   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson, David Gibson,
	Alexander Graf, Guan Xuetao, Mark Cave-Ayland, Artyom Tarasenko
  Cc: qemu-devel, qemu-ppc

Le 22/09/2017 à 17:40, Philippe Mathieu-Daudé a écrit :
> - include vmmouse
> - add entries in MAINTAINERS (pckbd.c, i8042.h)
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/i386/pc.h     | 11 -----------
>   include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
>   hw/alpha/dp264.c         |  3 ++-
>   hw/i386/pc.c             |  5 +++--
>   hw/input/pckbd.c         |  2 +-
>   hw/input/vmmouse.c       |  3 +--
>   hw/mips/mips_fulong2e.c  |  3 ++-
>   hw/mips/mips_jazz.c      |  1 +
>   hw/mips/mips_malta.c     |  3 ++-
>   hw/mips/mips_r4k.c       |  3 ++-
>   hw/misc/vmport.c         |  1 +
>   hw/ppc/prep.c            |  5 +++--
>   hw/sparc64/sun4u.c       |  3 ++-
>   hw/unicore32/puv3.c      |  1 +
>   MAINTAINERS              |  4 +++-
>   15 files changed, 54 insertions(+), 24 deletions(-)
>   create mode 100644 include/hw/input/i8042.h

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init()
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init() Philippe Mathieu-Daudé
@ 2017-09-22 20:11   ` Hervé Poussineau
  2017-09-23  5:10   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson, David Gibson,
	Alexander Graf
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> and remove the old i386/pc dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/timer/mc146818rtc.h | 3 ++-
>   hw/alpha/dp264.c               | 2 +-
>   hw/i386/pc.c                   | 2 +-
>   hw/isa/i82378.c                | 3 ++-
>   hw/mips/mips_fulong2e.c        | 2 +-
>   hw/mips/mips_jazz.c            | 2 +-
>   hw/mips/mips_malta.c           | 2 +-
>   hw/mips/mips_r4k.c             | 2 +-
>   hw/ppc/pnv.c                   | 2 +-
>   hw/timer/mc146818rtc.c         | 2 +-
>   10 files changed, 12 insertions(+), 10 deletions(-)

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS Philippe Mathieu-Daudé
@ 2017-09-22 20:12   ` Hervé Poussineau
  2017-09-23  5:11   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, David Gibson,
	Alexander Graf
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/timer/m48t59.h | 2 ++
>   hw/ppc/prep.c             | 2 +-
>   hw/timer/m48t59-isa.c     | 2 +-
>   MAINTAINERS               | 2 ++
>   4 files changed, 6 insertions(+), 2 deletions(-)

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
@ 2017-09-22 20:13   ` Hervé Poussineau
  2017-09-23  5:11   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, David Gibson,
	Alexander Graf, Jason Wang
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> - add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
> - remove the old i386 dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   hw/net/ne2000.h             |  3 +++
>   include/hw/i386/pc.h        | 20 --------------------
>   include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
>   hw/i386/pc.c                |  1 +
>   hw/mips/mips_r4k.c          |  1 +
>   hw/net/ne2000-isa.c         |  6 ++----
>   hw/net/ne2000.c             |  2 --
>   hw/ppc/prep.c               |  1 +
>   MAINTAINERS                 |  1 +
>   9 files changed, 42 insertions(+), 26 deletions(-)
>   create mode 100644 include/hw/net/ne2000-isa.h

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET Philippe Mathieu-Daudé
@ 2017-09-22 20:13   ` Hervé Poussineau
  2017-09-23  5:14   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Yongbok Kim, Alexander Graf,
	David Gibson, Jason Wang
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/net/pci.h | 1 +
>   hw/mips/mips_malta.c | 2 +-
>   hw/net/pcnet-pci.c   | 3 +--
>   hw/ppc/prep.c        | 3 ++-
>   4 files changed, 5 insertions(+), 4 deletions(-)

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000 Philippe Mathieu-Daudé
@ 2017-09-22 20:14   ` Hervé Poussineau
  2017-09-23  5:14   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: Hervé Poussineau @ 2017-09-22 20:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Alexander Graf, David Gibson,
	Jason Wang, Mark Cave-Ayland, Artyom Tarasenko
  Cc: qemu-devel, qemu-ppc, qemu-trivial

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/hw/net/pci.h  | 1 +
>   hw/net/ne2000.c       | 3 ++-
>   hw/ppc/mac_newworld.c | 3 ++-
>   hw/ppc/mac_oldworld.c | 3 ++-
>   hw/ppc/prep.c         | 2 +-
>   hw/sparc64/sun4u.c    | 3 ++-
>   6 files changed, 10 insertions(+), 5 deletions(-)

Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

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

* Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
  2017-09-22 16:06   ` Peter Maydell
@ 2017-09-23  5:08   ` David Gibson
  2017-09-25  8:10   ` Cornelia Huck
  2 siblings, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Michael S. Tsirkin, Igor Mammedov, Eduardo Habkost,
	Alexander Graf, Cornelia Huck, Alex Williamson, qemu-devel,
	qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 3643 bytes --]

On Fri, Sep 22, 2017 at 12:39:41PM -0300, Philippe Mathieu-Daudé wrote:
> applied using ./scripts/clean-includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portion

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  hw/acpi/ipmi-stub.c             | 1 +
>  hw/audio/fmopl.c                | 1 -
>  hw/cpu/core.c                   | 1 +
>  hw/ppc/spapr_cpu_core.c         | 1 +
>  hw/smbios/smbios_type_38-stub.c | 1 +
>  hw/vfio/ccw.c                   | 2 +-
>  hw/virtio/vhost-vsock.c         | 2 +-
>  7 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/acpi/ipmi-stub.c b/hw/acpi/ipmi-stub.c
> index 98b6dcee0d..f525f71c2d 100644
> --- a/hw/acpi/ipmi-stub.c
> +++ b/hw/acpi/ipmi-stub.c
> @@ -7,6 +7,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include "hw/acpi/ipmi.h"
>  
>  void build_acpi_ipmi_devices(Aml *table, BusState *bus)
> diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
> index 5cfb6a96dd..9f50a89b4a 100644
> --- a/hw/audio/fmopl.c
> +++ b/hw/audio/fmopl.c
> @@ -34,7 +34,6 @@
>  #include <math.h>
>  //#include "driver.h"		/* use M.A.M.E. */
>  #include "fmopl.h"
> -#include "qemu/osdep.h"
>  #ifndef PI
>  #define PI 3.14159265358979323846
>  #endif
> diff --git a/hw/cpu/core.c b/hw/cpu/core.c
> index bd578ab80c..7e42e2c87a 100644
> --- a/hw/cpu/core.c
> +++ b/hw/cpu/core.c
> @@ -6,6 +6,7 @@
>   * This work is licensed under the terms of the GNU GPL, version 2 or later.
>   * See the COPYING file in the top-level directory.
>   */
> +#include "qemu/osdep.h"
>  #include "hw/cpu/core.h"
>  #include "qapi/visitor.h"
>  #include "qapi/error.h"
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index c08ee7571a..4a4f0c60fe 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -6,6 +6,7 @@
>   * This work is licensed under the terms of the GNU GPL, version 2 or later.
>   * See the COPYING file in the top-level directory.
>   */
> +#include "qemu/osdep.h"
>  #include "hw/cpu/core.h"
>  #include "hw/ppc/spapr_cpu_core.h"
>  #include "target/ppc/cpu.h"
> diff --git a/hw/smbios/smbios_type_38-stub.c b/hw/smbios/smbios_type_38-stub.c
> index 9528c2c28e..5b83c9b1f1 100644
> --- a/hw/smbios/smbios_type_38-stub.c
> +++ b/hw/smbios/smbios_type_38-stub.c
> @@ -7,6 +7,7 @@
>   * See the COPYING file in the top-level directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include "hw/smbios/ipmi.h"
>  
>  void smbios_build_type_38_table(void)
> diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> index a8baadf57a..4810fa0b50 100644
> --- a/hw/vfio/ccw.c
> +++ b/hw/vfio/ccw.c
> @@ -11,11 +11,11 @@
>   * directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include <linux/vfio.h>
>  #include <linux/vfio_ccw.h>
>  #include <sys/ioctl.h>
>  
> -#include "qemu/osdep.h"
>  #include "qapi/error.h"
>  #include "hw/sysbus.h"
>  #include "hw/vfio/vfio.h"
> diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
> index 49e0022533..c11c1eb83e 100644
> --- a/hw/virtio/vhost-vsock.c
> +++ b/hw/virtio/vhost-vsock.c
> @@ -11,8 +11,8 @@
>   * top-level directory.
>   */
>  
> -#include <sys/ioctl.h>
>  #include "qemu/osdep.h"
> +#include <sys/ioctl.h>
>  #include "standard-headers/linux/virtio_vsock.h"
>  #include "qapi/error.h"
>  #include "hw/virtio/virtio-bus.h"

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h
  2017-09-22 15:40 ` [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h Philippe Mathieu-Daudé
  2017-09-22 20:10   ` Hervé Poussineau
@ 2017-09-23  5:09   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson,
	Hervé Poussineau, Alexander Graf, Guan Xuetao,
	Mark Cave-Ayland, Artyom Tarasenko, qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 11780 bytes --]

On Fri, Sep 22, 2017 at 12:40:02PM -0300, Philippe Mathieu-Daudé wrote:
> - include vmmouse
> - add entries in MAINTAINERS (pckbd.c, i8042.h)
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portions

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/i386/pc.h     | 11 -----------
>  include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
>  hw/alpha/dp264.c         |  3 ++-
>  hw/i386/pc.c             |  5 +++--
>  hw/input/pckbd.c         |  2 +-
>  hw/input/vmmouse.c       |  3 +--
>  hw/mips/mips_fulong2e.c  |  3 ++-
>  hw/mips/mips_jazz.c      |  1 +
>  hw/mips/mips_malta.c     |  3 ++-
>  hw/mips/mips_r4k.c       |  3 ++-
>  hw/misc/vmport.c         |  1 +
>  hw/ppc/prep.c            |  5 +++--
>  hw/sparc64/sun4u.c       |  3 ++-
>  hw/unicore32/puv3.c      |  1 +
>  MAINTAINERS              |  4 +++-
>  15 files changed, 54 insertions(+), 24 deletions(-)
>  create mode 100644 include/hw/input/i8042.h
> 
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 25ba378bd8..6a2e947332 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -193,17 +193,6 @@ static inline void vmport_init(ISABus *bus)
>  }
>  
>  void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
> -void vmmouse_get_data(uint32_t *data);
> -void vmmouse_set_data(const uint32_t *data);
> -
> -/* pckbd.c */
> -#define I8042_A20_LINE "a20"
> -
> -void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> -                   MemoryRegion *region, ram_addr_t size,
> -                   hwaddr mask);
> -void i8042_isa_mouse_fake_event(void *opaque);
> -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
>  
>  /* pc.c */
>  extern int fd_bootchk;
> diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
> new file mode 100644
> index 0000000000..836417304b
> --- /dev/null
> +++ b/include/hw/input/i8042.h
> @@ -0,0 +1,30 @@
> +/*
> + * QEMU PS/2 Controller
> + *
> + * Copyright (c) 2003 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef HW_INPUT_I8042_H
> +#define HW_INPUT_I8042_H
> +
> +#include "hw/hw.h"
> +#include "hw/isa/isa.h"
> +
> +#define TYPE_I8042 "i8042"
> +
> +#define I8042_A20_LINE "a20"
> +
> +void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> +                   MemoryRegion *region, ram_addr_t size,
> +                   hwaddr mask);
> +void i8042_isa_mouse_fake_event(void *opaque);
> +void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
> +
> +#define TYPE_VMMOUSE "vmmouse"
> +
> +void vmmouse_get_data(uint32_t *data);
> +void vmmouse_set_data(const uint32_t *data);
> +
> +#endif /* HW_INPUT_I8042_H */
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 1bd5243648..2253990654 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -19,6 +19,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "hw/char/serial.h"
>  #include "qemu/cutils.h"
>  
> @@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine)
>      rtc_init(isa_bus, 1900, rtc_irq);
>  
>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      /* VGA setup.  Don't bother loading the bios.  */
>      pci_vga_init(pci_bus);
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 5cb0ae67cd..3aa10c780b 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -40,6 +40,7 @@
>  #include "multiboot.h"
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "hw/audio/pcspk.h"
>  #include "hw/pci/msi.h"
>  #include "hw/sysbus.h"
> @@ -1564,11 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
>      parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
>  
>      a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
> -    i8042 = isa_create_simple(isa_bus, "i8042");
> +    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
>      i8042_setup_a20_line(i8042, a20_line[0]);
>      if (!no_vmport) {
>          vmport_init(isa_bus);
> -        vmmouse = isa_try_create(isa_bus, "vmmouse");
> +        vmmouse = isa_try_create(isa_bus, TYPE_VMMOUSE);
>      } else {
>          vmmouse = NULL;
>      }
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index c479f827b6..f17f18e51b 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -26,6 +26,7 @@
>  #include "hw/isa/isa.h"
>  #include "hw/i386/pc.h"
>  #include "hw/input/ps2.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/sysemu.h"
>  
>  /* debug PC keyboard */
> @@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
>      qemu_register_reset(kbd_reset, s);
>  }
>  
> -#define TYPE_I8042 "i8042"
>  #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
>  
>  typedef struct ISAKBDState {
> diff --git a/hw/input/vmmouse.c b/hw/input/vmmouse.c
> index b6d22086f4..c48c07c564 100644
> --- a/hw/input/vmmouse.c
> +++ b/hw/input/vmmouse.c
> @@ -24,7 +24,7 @@
>  #include "qemu/osdep.h"
>  #include "hw/hw.h"
>  #include "ui/console.h"
> -#include "hw/input/ps2.h"
> +#include "hw/input/i8042.h"
>  #include "hw/i386/pc.h"
>  #include "hw/qdev.h"
>  
> @@ -52,7 +52,6 @@
>  #define DPRINTF(fmt, ...) do { } while (0)
>  #endif
>  
> -#define TYPE_VMMOUSE "vmmouse"
>  #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)
>  
>  typedef struct VMMouseState
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 22e6c05fb5..a35745a407 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -42,6 +42,7 @@
>  #include "hw/isa/vt82c686.h"
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/qtest.h"
> @@ -367,7 +368,7 @@ static void mips_fulong2e_init(MachineState *machine)
>      DMA_init(isa_bus, 0);
>  
>      /* Super I/O */
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      rtc_init(isa_bus, 2000, NULL);
>  
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 25f0294236..1bbef7eeb5 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -41,6 +41,7 @@
>  #include "hw/timer/i8254.h"
>  #include "hw/display/vga.h"
>  #include "hw/audio/pcspk.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/block-backend.h"
>  #include "hw/sysbus.h"
>  #include "exec/address-spaces.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index de547d732f..45c7f589aa 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -45,6 +45,7 @@
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
> @@ -1221,7 +1222,7 @@ void mips_malta_init(MachineState *machine)
>      DMA_init(isa_bus, 0);
>  
>      /* Super I/O */
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      rtc_init(isa_bus, 2000, NULL);
>      serial_hds_isa_init(isa_bus, 0, 2);
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 48fad52540..946097a31f 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -27,6 +27,7 @@
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "sysemu/block-backend.h"
>  #include "exec/address-spaces.h"
> @@ -295,7 +296,7 @@ void mips_r4k_init(MachineState *machine)
>                       hd[MAX_IDE_DEVS * i],
>  		     hd[MAX_IDE_DEVS * i + 1]);
>  
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  }
>  
>  static void mips_machine_init(MachineClass *mc)
> diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c
> index 165500223f..bc078eb20a 100644
> --- a/hw/misc/vmport.c
> +++ b/hw/misc/vmport.c
> @@ -25,6 +25,7 @@
>  #include "hw/hw.h"
>  #include "hw/isa/isa.h"
>  #include "hw/i386/pc.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/hw_accel.h"
>  #include "hw/qdev.h"
>  
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 94138a4e8c..16f4537093 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -41,6 +41,7 @@
>  #include "hw/ide.h"
>  #include "hw/loader.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/isa/pc87312.h"
>  #include "sysemu/block-backend.h"
>  #include "sysemu/arch_init.h"
> @@ -643,7 +644,7 @@ static void ppc_prep_init(MachineState *machine)
>                       hd[2 * i],
>  		     hd[2 * i + 1]);
>      }
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      cpu = POWERPC_CPU(first_cpu);
>      sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
> @@ -775,7 +776,7 @@ static void ibm_40p_init(MachineState *machine)
>  
>      /* add some more devices */
>      if (defaults_enabled()) {
> -        isa_create_simple(isa_bus, "i8042");
> +        isa_create_simple(isa_bus, TYPE_I8042);
>          m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
>  
>          dev = DEVICE(isa_create(isa_bus, "cs4231a"));
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index c3280aaf38..973daed977 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -31,6 +31,7 @@
>  #include "hw/i386/pc.h"
>  #include "hw/char/serial.h"
>  #include "hw/timer/m48t59.h"
> +#include "hw/input/i8042.h"
>  #include "hw/block/fdc.h"
>  #include "net/net.h"
>  #include "qemu/timer.h"
> @@ -488,7 +489,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
>  
>      pci_cmd646_ide_init(pci_bus, hd, 1);
>  
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      /* Floppy */
>      for(i = 0; i < MAX_FD; i++) {
> diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
> index 6849bac59c..cf79c89f12 100644
> --- a/hw/unicore32/puv3.c
> +++ b/hw/unicore32/puv3.c
> @@ -19,6 +19,7 @@
>  
>  #undef DEBUG_PUV3
>  #include "hw/unicore32/puv3.h"
> +#include "hw/input/i8042.h"
>  
>  #define KERNEL_LOAD_ADDR        0x03000000
>  #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f7d377ead9..cc1f8bb66b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -834,12 +834,13 @@ F: hw/misc/sga.c
>  PC Chipset
>  M: Michael S. Tsirkin <mst@redhat.com>
>  M: Paolo Bonzini <pbonzini@redhat.com>
> -S: Support
> +S: Supported
>  F: hw/char/debugcon.c
>  F: hw/char/parallel.c
>  F: hw/char/serial*
>  F: hw/dma/i8257*
>  F: hw/i2c/pm_smbus.c
> +F: hw/input/pckbd.c
>  F: hw/intc/apic*
>  F: hw/intc/ioapic*
>  F: hw/intc/i8259*
> @@ -849,6 +850,7 @@ F: hw/timer/hpet*
>  F: hw/timer/i8254*
>  F: hw/timer/mc146818rtc*
>  F: include/hw/i2c/pm_smbus.h
> +F: include/hw/input/i8042.h
>  F: include/hw/timer/hpet.h
>  F: include/hw/timer/i8254*
>  F: include/hw/timer/mc146818rtc*

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init()
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init() Philippe Mathieu-Daudé
  2017-09-22 20:11   ` Hervé Poussineau
@ 2017-09-23  5:10   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Richard Henderson,
	Hervé Poussineau, Alexander Graf, qemu-devel, qemu-ppc,
	qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 6286 bytes --]

On Fri, Sep 22, 2017 at 01:01:01PM -0300, Philippe Mathieu-Daudé wrote:
> and remove the old i386/pc dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/timer/mc146818rtc.h | 3 ++-
>  hw/alpha/dp264.c               | 2 +-
>  hw/i386/pc.c                   | 2 +-
>  hw/isa/i82378.c                | 3 ++-
>  hw/mips/mips_fulong2e.c        | 2 +-
>  hw/mips/mips_jazz.c            | 2 +-
>  hw/mips/mips_malta.c           | 2 +-
>  hw/mips/mips_r4k.c             | 2 +-
>  hw/ppc/pnv.c                   | 2 +-
>  hw/timer/mc146818rtc.c         | 2 +-
>  10 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
> index 7c8e64b203..fe6ed63f71 100644
> --- a/include/hw/timer/mc146818rtc.h
> +++ b/include/hw/timer/mc146818rtc.h
> @@ -6,7 +6,8 @@
>  
>  #define TYPE_MC146818_RTC "mc146818rtc"
>  
> -ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
> +ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
> +                             qemu_irq intercept_irq);
>  void rtc_set_memory(ISADevice *dev, int addr, int val);
>  int rtc_get_memory(ISADevice *dev, int addr);
>  
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 2253990654..df6dadf13f 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -80,7 +80,7 @@ static void clipper_init(MachineState *machine)
>                             clipper_pci_map_irq);
>  
>      /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
> -    rtc_init(isa_bus, 1900, rtc_irq);
> +    mc146818_rtc_init(isa_bus, 1900, rtc_irq);
>  
>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
>      isa_create_simple(isa_bus, TYPE_I8042);
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 76d4be5991..788844e0de 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1545,7 +1545,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
>              rtc_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_RTC_INT);
>          }
>      }
> -    *rtc_state = rtc_init(isa_bus, 2000, rtc_irq);
> +    *rtc_state = mc146818_rtc_init(isa_bus, 2000, rtc_irq);
>  
>      qemu_register_boot_set(pc_boot_set, *rtc_state);
>  
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index 7a8baef23c..14b006cadc 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -21,6 +21,7 @@
>  #include "hw/pci/pci.h"
>  #include "hw/i386/pc.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/timer/mc146818rtc.h"
>  #include "hw/audio/pcspk.h"
>  
>  #define TYPE_I82378 "i82378"
> @@ -106,7 +107,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
>      isa = isa_create_simple(isabus, "i82374");
>  
>      /* timer */
> -    isa_create_simple(isabus, "mc146818rtc");
> +    isa_create_simple(isabus, TYPE_MC146818_RTC);
>  }
>  
>  static void i82378_init(Object *obj)
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 6dc6a0ac18..7ebbffa8f2 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -371,7 +371,7 @@ static void mips_fulong2e_init(MachineState *machine)
>      /* Super I/O */
>      isa_create_simple(isa_bus, TYPE_I8042);
>  
> -    rtc_init(isa_bus, 2000, NULL);
> +    mc146818_rtc_init(isa_bus, 2000, NULL);
>  
>      serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
>      parallel_hds_isa_init(isa_bus, 1);
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 1b54602c1d..439bbd71fe 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -295,7 +295,7 @@ static void mips_jazz_init(MachineState *machine,
>      fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), -1, 0x80003000, fds);
>  
>      /* Real time clock */
> -    rtc_init(isa_bus, 1980, NULL);
> +    mc146818_rtc_init(isa_bus, 1980, NULL);
>      memory_region_init_io(rtc, NULL, &rtc_ops, NULL, "rtc", 0x1000);
>      memory_region_add_subregion(address_space, 0x80004000, rtc);
>  
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 050da36f1d..6945fa47c3 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -1225,7 +1225,7 @@ void mips_malta_init(MachineState *machine)
>      /* Super I/O */
>      isa_create_simple(isa_bus, TYPE_I8042);
>  
> -    rtc_init(isa_bus, 2000, NULL);
> +    mc146818_rtc_init(isa_bus, 2000, NULL);
>      serial_hds_isa_init(isa_bus, 0, 2);
>      parallel_hds_isa_init(isa_bus, 1);
>  
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 946097a31f..349da59912 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -279,7 +279,7 @@ void mips_r4k_init(MachineState *machine)
>      i8259 = i8259_init(isa_bus, env->irq[2]);
>      isa_bus_irqs(isa_bus, i8259);
>  
> -    rtc_init(isa_bus, 2000, NULL);
> +    mc146818_rtc_init(isa_bus, 2000, NULL);
>  
>      pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
>  
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 47221158d4..d188b899c5 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -647,7 +647,7 @@ static void ppc_powernv_init(MachineState *machine)
>      serial_hds_isa_init(pnv->isa_bus, 0, MAX_SERIAL_PORTS);
>  
>      /* Create an RTC ISA device too */
> -    rtc_init(pnv->isa_bus, 2000, NULL);
> +    mc146818_rtc_init(pnv->isa_bus, 2000, NULL);
>  
>      /* OpenPOWER systems use a IPMI SEL Event message to notify the
>       * host to powerdown */
> diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
> index 82843ed03f..f7d8c4bae4 100644
> --- a/hw/timer/mc146818rtc.c
> +++ b/hw/timer/mc146818rtc.c
> @@ -997,7 +997,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
>      qdev_init_gpio_out(dev, &s->irq, 1);
>  }
>  
> -ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
> +ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
>  {
>      DeviceState *dev;
>      ISADevice *isadev;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS Philippe Mathieu-Daudé
  2017-09-22 20:12   ` Hervé Poussineau
@ 2017-09-23  5:11   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Hervé Poussineau,
	Alexander Graf, qemu-devel, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 2498 bytes --]

On Fri, Sep 22, 2017 at 01:01:02PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portion

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/timer/m48t59.h | 2 ++
>  hw/ppc/prep.c             | 2 +-
>  hw/timer/m48t59-isa.c     | 2 +-
>  MAINTAINERS               | 2 ++
>  4 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
> index db5e43a8da..069bb045d7 100644
> --- a/include/hw/timer/m48t59.h
> +++ b/include/hw/timer/m48t59.h
> @@ -25,6 +25,8 @@ typedef struct NvramClass {
>      void (*toggle_lock)(Nvram *obj, int lock);
>  } NvramClass;
>  
> +#define TYPE_M48T59_ISA "isa-m48t59"
> +
>  Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
>                         int base_year, int type);
>  Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 16f4537093..1f8ef4819b 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -777,7 +777,7 @@ static void ibm_40p_init(MachineState *machine)
>      /* add some more devices */
>      if (defaults_enabled()) {
>          isa_create_simple(isa_bus, TYPE_I8042);
> -        m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
> +        m48t59 = NVRAM(isa_create_simple(isa_bus, TYPE_M48T59_ISA));
>  
>          dev = DEVICE(isa_create(isa_bus, "cs4231a"));
>          qdev_prop_set_uint32(dev, "iobase", 0x830);
> diff --git a/hw/timer/m48t59-isa.c b/hw/timer/m48t59-isa.c
> index ea1ba703d7..077346f7ca 100644
> --- a/hw/timer/m48t59-isa.c
> +++ b/hw/timer/m48t59-isa.c
> @@ -49,7 +49,7 @@ typedef struct M48txxISADeviceClass {
>  
>  static M48txxInfo m48txx_isa_info[] = {
>      {
> -        .bus_name = "isa-m48t59",
> +        .bus_name = TYPE_M48T59_ISA,
>          .model = 59,
>          .size = 0x2000,
>      }
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a79723601c..3cb6bc190c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -708,6 +708,8 @@ F: hw/pci-host/prep.[hc]
>  F: hw/isa/i82378.c
>  F: hw/isa/pc87312.[hc]
>  F: hw/dma/i82374.c
> +F: hw/timer/m48t59-isa.c
> +F: include/hw/timer/m48t59.h
>  F: pc-bios/ppc_rom.bin
>  
>  sPAPR

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
  2017-09-22 20:13   ` Hervé Poussineau
@ 2017-09-23  5:11   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Hervé Poussineau,
	Alexander Graf, Jason Wang, qemu-devel, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 6160 bytes --]

On Fri, Sep 22, 2017 at 01:01:03PM -0300, Philippe Mathieu-Daudé wrote:
> - add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
> - remove the old i386 dependency
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portion

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  hw/net/ne2000.h             |  3 +++
>  include/hw/i386/pc.h        | 20 --------------------
>  include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
>  hw/i386/pc.c                |  1 +
>  hw/mips/mips_r4k.c          |  1 +
>  hw/net/ne2000-isa.c         |  6 ++----
>  hw/net/ne2000.c             |  2 --
>  hw/ppc/prep.c               |  1 +
>  MAINTAINERS                 |  1 +
>  9 files changed, 42 insertions(+), 26 deletions(-)
>  create mode 100644 include/hw/net/ne2000-isa.h
> 
> diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h
> index d213dccae3..adb8021bd1 100644
> --- a/hw/net/ne2000.h
> +++ b/hw/net/ne2000.h
> @@ -1,6 +1,9 @@
>  #ifndef HW_NE2000_H
>  #define HW_NE2000_H
>  
> +#include "hw/hw.h"
> +#include "net/net.h"
> +
>  #define NE2000_PMEM_SIZE    (32*1024)
>  #define NE2000_PMEM_START   (16*1024)
>  #define NE2000_PMEM_END     (NE2000_PMEM_SIZE+NE2000_PMEM_START)
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 6a2e947332..020792c2e8 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -291,26 +291,6 @@ PCIBus *find_i440fx(void);
>  extern PCIDevice *piix4_dev;
>  int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
>  
> -/* ne2000.c */
> -static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
> -{
> -    DeviceState *dev;
> -    ISADevice *isadev;
> -
> -    qemu_check_nic_model(nd, "ne2k_isa");
> -
> -    isadev = isa_try_create(bus, "ne2k_isa");
> -    if (!isadev) {
> -        return false;
> -    }
> -    dev = DEVICE(isadev);
> -    qdev_prop_set_uint32(dev, "iobase", base);
> -    qdev_prop_set_uint32(dev, "irq",    irq);
> -    qdev_set_nic_properties(dev, nd);
> -    qdev_init_nofail(dev);
> -    return true;
> -}
> -
>  /* pc_sysfw.c */
>  void pc_system_firmware_init(MemoryRegion *rom_memory,
>                               bool isapc_ram_fw);
> diff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h
> new file mode 100644
> index 0000000000..ff2bed9c95
> --- /dev/null
> +++ b/include/hw/net/ne2000-isa.h
> @@ -0,0 +1,33 @@
> +/*
> + * QEMU NE2000 emulation -- isa bus windup
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "hw/hw.h"
> +#include "hw/qdev.h"
> +#include "hw/isa/isa.h"
> +#include "net/net.h"
> +
> +#define TYPE_ISA_NE2000 "ne2k_isa"
> +
> +static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
> +                                         NICInfo *nd)
> +{
> +    ISADevice *d;
> +
> +    qemu_check_nic_model(nd, "ne2k_isa");
> +
> +    d = isa_try_create(bus, TYPE_ISA_NE2000);
> +    if (d) {
> +        DeviceState *dev = DEVICE(d);
> +
> +        qdev_prop_set_uint32(dev, "iobase", base);
> +        qdev_prop_set_uint32(dev, "irq",    irq);
> +        qdev_set_nic_properties(dev, nd);
> +        qdev_init_nofail(dev);
> +    }
> +    return d;
> +}
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 788844e0de..085577e066 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -71,6 +71,7 @@
>  #include "qom/cpu.h"
>  #include "hw/nmi.h"
>  #include "hw/i386/intel_iommu.h"
> +#include "hw/net/ne2000-isa.h"
>  
>  /* debug PC/ISA interrupts */
>  //#define DEBUG_IRQ
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 349da59912..33ff89f02c 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -18,6 +18,7 @@
>  #include "hw/char/serial.h"
>  #include "hw/isa/isa.h"
>  #include "net/net.h"
> +#include "hw/net/ne2000-isa.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/boards.h"
>  #include "hw/block/flash.h"
> diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
> index f3455339ee..70e5c1d3d4 100644
> --- a/hw/net/ne2000-isa.c
> +++ b/hw/net/ne2000-isa.c
> @@ -22,17 +22,15 @@
>   * THE SOFTWARE.
>   */
>  #include "qemu/osdep.h"
> -#include "hw/hw.h"
> -#include "hw/i386/pc.h"
>  #include "hw/isa/isa.h"
> +#include "hw/net/ne2000-isa.h"
>  #include "hw/qdev.h"
> -#include "net/net.h"
>  #include "ne2000.h"
> +#include "sysemu/sysemu.h"
>  #include "exec/address-spaces.h"
>  #include "qapi/error.h"
>  #include "qapi/visitor.h"
>  
> -#define TYPE_ISA_NE2000 "ne2k_isa"
>  #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)
>  
>  typedef struct ISANE2000State {
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 798d681e25..29bd4adb3f 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -22,9 +22,7 @@
>   * THE SOFTWARE.
>   */
>  #include "qemu/osdep.h"
> -#include "hw/hw.h"
>  #include "hw/pci/pci.h"
> -#include "net/net.h"
>  #include "ne2000.h"
>  #include "hw/loader.h"
>  #include "sysemu/sysemu.h"
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 1f8ef4819b..fb330a1769 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -43,6 +43,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/input/i8042.h"
>  #include "hw/isa/pc87312.h"
> +#include "hw/net/ne2000-isa.h"
>  #include "sysemu/block-backend.h"
>  #include "sysemu/arch_init.h"
>  #include "sysemu/kvm.h"
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3cb6bc190c..37917af0f0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -973,6 +973,7 @@ Network devices
>  M: Jason Wang <jasowang@redhat.com>
>  S: Odd Fixes
>  F: hw/net/
> +F: include/hw/net/
>  F: tests/virtio-net-test.c
>  T: git git://github.com/jasowang/qemu.git net
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" Philippe Mathieu-Daudé
@ 2017-09-23  5:12   ` David Gibson
  2017-09-25 14:30   ` Marcel Apfelbaum
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Yongbok Kim, Alexander Graf,
	Jason Wang, qemu-devel, qemu-arm, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 9869 bytes --]

On Fri, Sep 22, 2017 at 01:01:04PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portions

Acked-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  hw/pci/pci_internal.h | 16 +++++++++++
>  include/hw/net/pci.h  | 20 +++++++++++++
>  include/hw/pci/pci.h  |  4 ---
>  hw/arm/virt.c         |  1 +
>  hw/mips/mips_malta.c  |  1 +
>  hw/pci/pci.c          | 67 ++------------------------------------------
>  hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/ppc/e500.c         |  1 +
>  hw/ppc/spapr.c        |  1 +
>  hw/pci/Makefile.objs  |  1 +
>  10 files changed, 120 insertions(+), 69 deletions(-)
>  create mode 100644 hw/pci/pci_internal.h
>  create mode 100644 include/hw/net/pci.h
>  create mode 100644 hw/pci/pci_nic.c
> 
> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h
> new file mode 100644
> index 0000000000..d967468767
> --- /dev/null
> +++ b/hw/pci/pci_internal.h
> @@ -0,0 +1,16 @@
> +/*
> + * QEMU PCI internal
> + *
> + * Copyright (c) 2005 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef QEMU_HW_PCI_INTERNAL_H
> +#define QEMU_HW_PCI_INTERNAL_H
> +
> +#include "hw/pci/pci_bus.h"
> +
> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
> +
> +#endif
> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> new file mode 100644
> index 0000000000..529591b7f3
> --- /dev/null
> +++ b/include/hw/net/pci.h
> @@ -0,0 +1,20 @@
> +/*
> + * QEMU network devices
> + *
> + * Copyright (c) 2005 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef QEMU_HW_NET_PCI_H
> +#define QEMU_HW_NET_PCI_H
> +
> +#include "net/net.h"
> +#include "hw/pci/pci.h"
> +#include "hw/pci/pci_bus.h"
> +
> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> +                               const char *default_model,
> +                               const char *default_devaddr);
> +
> +#endif
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index aa7ef9cf69..6a0f7b5472 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
>                                            PCIINTxRoutingNotifier notifier);
>  void pci_device_reset(PCIDevice *dev);
>  
> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> -                               const char *default_model,
> -                               const char *default_devaddr);
> -
>  PCIDevice *pci_vga_init(PCIBus *bus);
>  
>  int pci_bus_num(PCIBus *s);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9e18b410d7..39fab3acb9 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -35,6 +35,7 @@
>  #include "hw/arm/primecell.h"
>  #include "hw/arm/virt.h"
>  #include "hw/devices.h"
> +#include "hw/net/pci.h"
>  #include "net/net.h"
>  #include "sysemu/block-backend.h"
>  #include "sysemu/device_tree.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 6945fa47c3..fb6a2f9363 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -48,6 +48,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/net/pci.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
>  #include "hw/sysbus.h"             /* SysBusDevice */
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1e6fb88eba..9b678c8fd0 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -28,7 +28,6 @@
>  #include "hw/pci/pci_bus.h"
>  #include "hw/pci/pci_host.h"
>  #include "monitor/monitor.h"
> -#include "net/net.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/loader.h"
>  #include "qemu/error-report.h"
> @@ -41,6 +40,7 @@
>  #include "hw/hotplug.h"
>  #include "hw/boards.h"
>  #include "qemu/cutils.h"
> +#include "pci_internal.h"
>  
>  //#define DEBUG_PCI
>  #ifdef DEBUG_PCI
> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
>      return 0;
>  }
>  
> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
> -                                 const char *devaddr)
> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
>  {
>      int dom, bus;
>      unsigned slot;
> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
>      return head;
>  }
>  
> -static const char * const pci_nic_models[] = {
> -    "ne2k_pci",
> -    "i82551",
> -    "i82557b",
> -    "i82559er",
> -    "rtl8139",
> -    "e1000",
> -    "pcnet",
> -    "virtio",
> -    "sungem",
> -    NULL
> -};
> -
> -static const char * const pci_nic_names[] = {
> -    "ne2k_pci",
> -    "i82551",
> -    "i82557b",
> -    "i82559er",
> -    "rtl8139",
> -    "e1000",
> -    "pcnet",
> -    "virtio-net-pci",
> -    "sungem",
> -    NULL
> -};
> -
> -/* Initialize a PCI NIC.  */
> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> -                               const char *default_model,
> -                               const char *default_devaddr)
> -{
> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
> -    PCIBus *bus;
> -    PCIDevice *pci_dev;
> -    DeviceState *dev;
> -    int devfn;
> -    int i;
> -
> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
> -        exit(0);
> -    }
> -
> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
> -    if (i < 0) {
> -        exit(1);
> -    }
> -
> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
> -    if (!bus) {
> -        error_report("Invalid PCI device address %s for device %s",
> -                     devaddr, pci_nic_names[i]);
> -        exit(1);
> -    }
> -
> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
> -    dev = &pci_dev->qdev;
> -    qdev_set_nic_properties(dev, nd);
> -    qdev_init_nofail(dev);
> -
> -    return pci_dev;
> -}
> -
>  PCIDevice *pci_vga_init(PCIBus *bus)
>  {
>      switch (vga_interface_type) {
> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c
> new file mode 100644
> index 0000000000..fb1a10ff12
> --- /dev/null
> +++ b/hw/pci/pci_nic.c
> @@ -0,0 +1,77 @@
> +/*
> + * QEMU PCI network interface
> + *
> + * Copyright (c) 2004 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "hw/pci/pci.h"
> +#include "hw/pci/pci_bus.h"
> +#include "hw/net/pci.h"
> +#include "net/net.h"
> +#include "pci_internal.h"
> +
> +static const char *const pci_nic_models[] = {
> +    "ne2k_pci",
> +    "i82551",
> +    "i82557b",
> +    "i82559er",
> +    "rtl8139",
> +    "e1000",
> +    "pcnet",
> +    "virtio",
> +    "sungem",
> +    NULL
> +};
> +
> +static const char *const pci_nic_names[] = {
> +    "ne2k_pci",
> +    "i82551",
> +    "i82557b",
> +    "i82559er",
> +    "rtl8139",
> +    "e1000",
> +    "pcnet",
> +    "virtio-net-pci",
> +    "sungem",
> +    NULL
> +};
> +
> +/* Initialize a PCI NIC.  */
> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> +                               const char *default_model,
> +                               const char *default_devaddr)
> +{
> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
> +    PCIBus *bus;
> +    PCIDevice *pci_dev;
> +    DeviceState *dev;
> +    int devfn;
> +    int i;
> +
> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
> +        exit(0);
> +    }
> +
> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
> +    if (i < 0) {
> +        exit(1);
> +    }
> +
> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
> +    if (!bus) {
> +        error_report("Invalid PCI device address %s for device %s",
> +                     devaddr, pci_nic_names[i]);
> +        exit(1);
> +    }
> +
> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
> +    dev = &pci_dev->qdev;
> +    qdev_set_nic_properties(dev, nd);
> +    qdev_init_nofail(dev);
> +
> +    return pci_dev;
> +}
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index db0e49ab8f..482757ca7b 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -24,6 +24,7 @@
>  #include "hw/hw.h"
>  #include "hw/char/serial.h"
>  #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>  #include "hw/boards.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/kvm.h"
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 17ea77618c..96007051e2 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -56,6 +56,7 @@
>  #include "hw/pci-host/spapr.h"
>  #include "hw/ppc/xics.h"
>  #include "hw/pci/msi.h"
> +#include "hw/net/pci.h"
>  
>  #include "hw/pci/pci.h"
>  #include "hw/scsi/scsi.h"
> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
> index 9f905e6344..125428fd54 100644
> --- a/hw/pci/Makefile.objs
> +++ b/hw/pci/Makefile.objs
> @@ -1,4 +1,5 @@
>  common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
> +common-obj-$(CONFIG_PCI) += pci_nic.o
>  common-obj-$(CONFIG_PCI) += msix.o msi.o
>  common-obj-$(CONFIG_PCI) += shpc.o
>  common-obj-$(CONFIG_PCI) += slotid_cap.o

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000 Philippe Mathieu-Daudé
@ 2017-09-23  5:13   ` David Gibson
  0 siblings, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Richard Henderson, Alexander Graf, Balaton Zoltan, Jason Wang,
	qemu-devel, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 3419 bytes --]

On Fri, Sep 22, 2017 at 01:01:05PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portion

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/net/pci.h   | 2 ++
>  hw/alpha/dp264.c       | 3 ++-
>  hw/i386/pc.c           | 3 ++-
>  hw/ppc/ppc440_bamboo.c | 3 ++-
>  4 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> index 529591b7f3..b24b5257a5 100644
> --- a/include/hw/net/pci.h
> +++ b/include/hw/net/pci.h
> @@ -13,6 +13,8 @@
>  #include "hw/pci/pci.h"
>  #include "hw/pci/pci_bus.h"
>  
> +#define TYPE_PCI_E1000      "e1000"
> +
>  PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>                                 const char *default_model,
>                                 const char *default_devaddr);
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index df6dadf13f..65947fe1bf 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -21,6 +21,7 @@
>  #include "hw/timer/i8254.h"
>  #include "hw/input/i8042.h"
>  #include "hw/char/serial.h"
> +#include "hw/net/pci.h"
>  #include "qemu/cutils.h"
>  
>  #define MAX_IDE_BUS 2
> @@ -93,7 +94,7 @@ static void clipper_init(MachineState *machine)
>  
>      /* Network setup.  e1000 is good enough, failing Tulip support.  */
>      for (i = 0; i < nb_nics; i++) {
> -        pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
> +        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_E1000, NULL);
>      }
>  
>      /* IDE disk setup.  */
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 085577e066..3cdeb148aa 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -72,6 +72,7 @@
>  #include "hw/nmi.h"
>  #include "hw/i386/intel_iommu.h"
>  #include "hw/net/ne2000-isa.h"
> +#include "hw/net/pci.h"
>  
>  /* debug PC/ISA interrupts */
>  //#define DEBUG_IRQ
> @@ -1606,7 +1607,7 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
>          if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
>              pc_init_ne2k_isa(isa_bus, nd);
>          } else {
> -            pci_nic_init_nofail(nd, pci_bus, "e1000", NULL);
> +            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_E1000, NULL);
>          }
>      }
>      rom_reset_order_override();
> diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
> index f92d47f28d..6387dbda9f 100644
> --- a/hw/ppc/ppc440_bamboo.c
> +++ b/hw/ppc/ppc440_bamboo.c
> @@ -24,6 +24,7 @@
>  #include "elf.h"
>  #include "exec/address-spaces.h"
>  #include "hw/char/serial.h"
> +#include "hw/net/pci.h"
>  #include "hw/ppc/ppc.h"
>  #include "ppc405.h"
>  #include "sysemu/sysemu.h"
> @@ -248,7 +249,7 @@ static void bamboo_init(MachineState *machine)
>          for (i = 0; i < nb_nics; i++) {
>              /* There are no PCI NICs on the Bamboo board, but there are
>               * PCI slots, so we can pick whatever default model we want. */
> -            pci_nic_init_nofail(&nd_table[i], pcibus, "e1000", NULL);
> +            pci_nic_init_nofail(&nd_table[i], pcibus, TYPE_PCI_E1000, NULL);
>          }
>      }
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET Philippe Mathieu-Daudé
  2017-09-22 20:13   ` Hervé Poussineau
@ 2017-09-23  5:14   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Hervé Poussineau, Aurelien Jarno,
	Yongbok Kim, Alexander Graf, Jason Wang, qemu-devel, qemu-ppc,
	qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 2868 bytes --]

On Fri, Sep 22, 2017 at 01:01:07PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portion

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/net/pci.h | 1 +
>  hw/mips/mips_malta.c | 2 +-
>  hw/net/pcnet-pci.c   | 3 +--
>  hw/ppc/prep.c        | 3 ++-
>  4 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> index 92111f86f3..5ad5487a91 100644
> --- a/include/hw/net/pci.h
> +++ b/include/hw/net/pci.h
> @@ -15,6 +15,7 @@
>  
>  #define TYPE_PCI_E1000      "e1000"
>  #define TYPE_PCI_E1000E     "e1000e"
> +#define TYPE_PCI_PCNET      "pcnet"
>  
>  PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>                                 const char *default_model,
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index fb6a2f9363..921678fdb0 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -597,7 +597,7 @@ static void network_init(PCIBus *pci_bus)
>              /* The malta board has a PCNet card using PCI SLOT 11 */
>              default_devaddr = "0b";
>  
> -        pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr);
> +        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_PCNET, default_devaddr);
>      }
>  }
>  
> diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
> index 0acf8a4879..878e2c89c1 100644
> --- a/hw/net/pcnet-pci.c
> +++ b/hw/net/pcnet-pci.c
> @@ -29,6 +29,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>  #include "net/net.h"
>  #include "hw/loader.h"
>  #include "qemu/timer.h"
> @@ -46,8 +47,6 @@
>  //#define PCNET_DEBUG_TMD
>  //#define PCNET_DEBUG_MATCH
>  
> -#define TYPE_PCI_PCNET "pcnet"
> -
>  #define PCI_PCNET(obj) \
>       OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET)
>  
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index fb330a1769..b2c7a62ebc 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -44,6 +44,7 @@
>  #include "hw/input/i8042.h"
>  #include "hw/isa/pc87312.h"
>  #include "hw/net/ne2000-isa.h"
> +#include "hw/net/pci.h"
>  #include "sysemu/block-backend.h"
>  #include "sysemu/arch_init.h"
>  #include "sysemu/kvm.h"
> @@ -800,7 +801,7 @@ static void ibm_40p_init(MachineState *machine)
>          pci_vga_init(pci_bus);
>  
>          for (i = 0; i < nb_nics; i++) {
> -            pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet",
> +            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_PCNET,
>                                  i == 0 ? "3" : NULL);
>          }
>      }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000 Philippe Mathieu-Daudé
  2017-09-22 20:14   ` Hervé Poussineau
@ 2017-09-23  5:14   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Hervé Poussineau, Aurelien Jarno,
	Alexander Graf, Jason Wang, Mark Cave-Ayland, Artyom Tarasenko,
	qemu-devel, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 4559 bytes --]

On Fri, Sep 22, 2017 at 01:01:09PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

ppc portions

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/net/pci.h  | 1 +
>  hw/net/ne2000.c       | 3 ++-
>  hw/ppc/mac_newworld.c | 3 ++-
>  hw/ppc/mac_oldworld.c | 3 ++-
>  hw/ppc/prep.c         | 2 +-
>  hw/sparc64/sun4u.c    | 3 ++-
>  6 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> index 43ed3b0145..da733dd1d9 100644
> --- a/include/hw/net/pci.h
> +++ b/include/hw/net/pci.h
> @@ -15,6 +15,7 @@
>  
>  #define TYPE_PCI_E1000      "e1000"
>  #define TYPE_PCI_E1000E     "e1000e"
> +#define TYPE_PCI_NE2000     "ne2k_pci"
>  #define TYPE_PCI_PCNET      "pcnet"
>  #define TYPE_PCI_RTL8139    "rtl8139"
>  
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 29bd4adb3f..b0a664d302 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -23,6 +23,7 @@
>   */
>  #include "qemu/osdep.h"
>  #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>  #include "ne2000.h"
>  #include "hw/loader.h"
>  #include "sysemu/sysemu.h"
> @@ -779,7 +780,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static const TypeInfo ne2000_info = {
> -    .name          = "ne2k_pci",
> +    .name          = TYPE_PCI_NE2000,
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCINE2000State),
>      .class_init    = ne2000_class_init,
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 33b46cb50b..2afc35c27f 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -55,6 +55,7 @@
>  #include "hw/ppc/mac_dbdma.h"
>  #include "hw/timer/m48t59.h"
>  #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>  #include "net/net.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/boards.h"
> @@ -435,7 +436,7 @@ static void ppc_core99_init(MachineState *machine)
>      }
>  
>      for (i = 0; i < nb_nics; i++) {
> -        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
> +        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
>      }
>  
>      /* The NewWorld NVRAM is not located in the MacIO device */
> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
> index 193b9047d9..8096e5a126 100644
> --- a/hw/ppc/mac_oldworld.c
> +++ b/hw/ppc/mac_oldworld.c
> @@ -34,6 +34,7 @@
>  #include "net/net.h"
>  #include "hw/isa/isa.h"
>  #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>  #include "hw/boards.h"
>  #include "hw/nvram/fw_cfg.h"
>  #include "hw/char/escc.h"
> @@ -278,7 +279,7 @@ static void ppc_heathrow_init(MachineState *machine)
>                               escc_mem, 0, memory_region_size(escc_mem));
>  
>      for(i = 0; i < nb_nics; i++)
> -        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
> +        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
>  
>  
>      ide_drive_get(hd, ARRAY_SIZE(hd));
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index b2c7a62ebc..103beafef3 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -636,7 +636,7 @@ static void ppc_prep_init(MachineState *machine)
>              isa_ne2000_init(isa_bus, ne2000_io[i], ne2000_irq[i],
>                              &nd_table[i]);
>          } else {
> -            pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
> +            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
>          }
>      }
>  
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index fd10741607..67879c5135 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -32,6 +32,7 @@
>  #include "hw/char/serial.h"
>  #include "hw/timer/m48t59.h"
>  #include "hw/input/i8042.h"
> +#include "hw/net/pci.h"
>  #include "hw/block/fdc.h"
>  #include "net/net.h"
>  #include "qemu/timer.h"
> @@ -476,7 +477,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
>  
>              onboard_nic_idx = i;
>          } else {
> -            pci_nic_init_nofail(nd, pci_bus, "ne2k_pci", NULL);
> +            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_NE2000, NULL);
>          }
>      }
>      onboard_nic_idx = MAX(onboard_nic_idx, 0);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 06/34] ppc: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 06/34] ppc: " Philippe Mathieu-Daudé
  2017-09-22 16:39   ` Peter Maydell
@ 2017-09-23  5:31   ` David Gibson
  1 sibling, 0 replies; 92+ messages in thread
From: David Gibson @ 2017-09-23  5:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Alexander Graf,
	qemu-devel, qemu-ppc, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

On Fri, Sep 22, 2017 at 12:39:46PM -0300, Philippe Mathieu-Daudé wrote:
> applied using ./scripts/clean-includes
> 
> not needed since 7ebaf795560
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  hw/ppc/spapr_hcall.c | 1 -
>  target/ppc/kvm.c     | 3 ---
>  2 files changed, 4 deletions(-)
> 
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 57bb411394..2aeee28fe6 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -13,7 +13,6 @@
>  #include "trace.h"
>  #include "kvm_ppc.h"
>  #include "hw/ppc/spapr_ovec.h"
> -#include "qemu/error-report.h"
>  #include "mmu-book3s-v3.h"
>  
>  struct SPRSyncState {
> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> index 1deaf106d2..c9105af393 100644
> --- a/target/ppc/kvm.c
> +++ b/target/ppc/kvm.c
> @@ -47,9 +47,6 @@
>  #include "sysemu/hostmem.h"
>  #include "qemu/cutils.h"
>  #include "qemu/mmap-alloc.h"
> -#if defined(TARGET_PPC64)
> -#include "hw/ppc/spapr_cpu_core.h"
> -#endif
>  #include "elf.h"
>  #include "sysemu/kvm_int.h"
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file Philippe Mathieu-Daudé
@ 2017-09-25  5:13   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Michael S. Tsirkin
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> instead move them to the source file
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/i386/amd_iommu.h | 5 -----
>  hw/i386/amd_iommu.c | 5 ++++-
>  2 files changed, 4 insertions(+), 6 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency Philippe Mathieu-Daudé
@ 2017-09-25  5:15   ` Thomas Huth
  2017-10-10 15:37   ` Anthony PERARD
  1 sibling, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Gerd Hoffmann, Michael S. Tsirkin,
	Marcel Apfelbaum, Markus Armbruster, Dr. David Alan Gilbert,
	Richard Henderson, Eduardo Habkost, Anthony Perard
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/audio/pcspk.c                    | 1 -
>  hw/i386/kvm/pci-assign.c            | 1 -
>  hw/i386/pci-assign-load-rom.c       | 1 -
>  hw/i386/xen/xen_platform.c          | 1 -
>  hw/isa/vt82c686.c                   | 1 -
>  hw/misc/ivshmem.c                   | 1 -
>  hw/misc/sga.c                       | 1 -
>  hw/pci-bridge/pci_expander_bridge.c | 1 -
>  monitor.c                           | 1 -
>  9 files changed, 9 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92 Philippe Mathieu-Daudé
@ 2017-09-25  5:16   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Michael S. Tsirkin
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/i386/pc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 05985d4927..f116cede91 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1577,7 +1577,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
>          qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
>          qdev_init_nofail(dev);
>      }
> -    port92 = isa_create_simple(isa_bus, "port92");
> +    port92 = isa_create_simple(isa_bus, TYPE_PORT92);
>      port92_init(port92, a20_line[1]);
>      g_free(a20_line);

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 15/34] hw/i2c: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 15/34] hw/i2c: " Philippe Mathieu-Daudé
@ 2017-09-25  5:17   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Michael S. Tsirkin
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/i2c/pm_smbus.c   | 1 -
>  hw/i2c/smbus_ich9.c | 1 -
>  2 files changed, 2 deletions(-)
>

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file Philippe Mathieu-Daudé
@ 2017-09-25  5:19   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, Paolo Bonzini, Guan Xuetao
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> and drop unused #includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/unicore32/puv3.h | 10 ----------
>  hw/unicore32/puv3.c         | 16 ++++++++++------
>  2 files changed, 10 insertions(+), 16 deletions(-)
> 
> diff --git a/include/hw/unicore32/puv3.h b/include/hw/unicore32/puv3.h
> index 5a4839f8df..f587a1f622 100644
> --- a/include/hw/unicore32/puv3.h
> +++ b/include/hw/unicore32/puv3.h
> @@ -14,16 +14,6 @@
>  
>  #define PUV3_REGS_OFFSET        (0x1000) /* 4K is reasonable */
>  
> -/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
> -#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
> -
> -/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
> -#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
> -#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
> -#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
> -#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
> -#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
> -
>  /* Hardware interrupts */
>  #define PUV3_IRQS_NR            (32)
>  
> diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
> index 504ea46211..6849bac59c 100644
> --- a/hw/unicore32/puv3.c
> +++ b/hw/unicore32/puv3.c
> @@ -11,16 +11,10 @@
>  
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> -#include "qemu-common.h"
>  #include "cpu.h"
>  #include "ui/console.h"
> -#include "elf.h"
> -#include "exec/address-spaces.h"
> -#include "hw/sysbus.h"
>  #include "hw/boards.h"
>  #include "hw/loader.h"
> -#include "hw/i386/pc.h"
> -#include "qemu/error-report.h"
>  #include "sysemu/qtest.h"
>  
>  #undef DEBUG_PUV3
> @@ -29,6 +23,16 @@
>  #define KERNEL_LOAD_ADDR        0x03000000
>  #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
>  
> +/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
> +#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
> +
> +/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
> +#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
> +#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
> +#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
> +#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
> +#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
> +
>  static void puv3_intc_cpu_handler(void *opaque, int irq, int level)
>  {
>      UniCore32CPU *cpu = opaque;
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: " Philippe Mathieu-Daudé
@ 2017-09-25  5:23   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Michael S. Tsirkin
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 17:39, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/virtio/virtio-balloon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
> index 37cde38982..14e08d20d0 100644
> --- a/hw/virtio/virtio-balloon.c
> +++ b/hw/virtio/virtio-balloon.c
> @@ -18,7 +18,7 @@
>  #include "qemu/timer.h"
>  #include "qemu-common.h"
>  #include "hw/virtio/virtio.h"
> -#include "hw/i386/pc.h"
> +#include "hw/mem/pc-dimm.h"
>  #include "sysemu/balloon.h"
>  #include "hw/virtio/virtio-balloon.h"
>  #include "sysemu/kvm.h"
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E Philippe Mathieu-Daudé
@ 2017-09-25  5:34   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Jason Wang
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 18:01, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/net/pci.h | 1 +
>  hw/net/e1000e.c      | 6 +++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> index b24b5257a5..92111f86f3 100644
> --- a/include/hw/net/pci.h
> +++ b/include/hw/net/pci.h
> @@ -14,6 +14,7 @@
>  #include "hw/pci/pci_bus.h"
>  
>  #define TYPE_PCI_E1000      "e1000"
> +#define TYPE_PCI_E1000E     "e1000e"
>  
>  PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>                                 const char *default_model,
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index 6c42b4478c..494f8cced6 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -40,6 +40,7 @@
>  #include "sysemu/sysemu.h"
>  #include "hw/pci/msi.h"
>  #include "hw/pci/msix.h"
> +#include "hw/net/pci.h"
>  
>  #include "hw/net/e1000_regs.h"
>  
> @@ -49,8 +50,7 @@
>  #include "trace.h"
>  #include "qapi/error.h"
>  
> -#define TYPE_E1000E "e1000e"
> -#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E)
> +#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_PCI_E1000E)
>  
>  typedef struct E1000EState {
>      PCIDevice parent_obj;
> @@ -703,7 +703,7 @@ static void e1000e_instance_init(Object *obj)
>  }
>  
>  static const TypeInfo e1000e_info = {
> -    .name = TYPE_E1000E,
> +    .name =   TYPE_PCI_E1000E,
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(E1000EState),
>      .class_init = e1000e_class_init,
> 

That seems unnecessary to me, since it's not used anywhere outside of
e1000e.c. I'd suggest to drop this patch.

 Thomas

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

* Re: [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139 Philippe Mathieu-Daudé
@ 2017-09-25  5:36   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Michael S. Tsirkin,
	Marcel Apfelbaum, Aurelien Jarno, Yongbok Kim, Magnus Damm,
	Jason Wang
  Cc: qemu-devel, qemu-arm, qemu-trivial

On 22.09.2017 18:01, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/net/pci.h    | 1 +
>  hw/arm/realview.c       | 3 ++-
>  hw/arm/versatilepb.c    | 3 ++-
>  hw/mips/mips_fulong2e.c | 3 ++-
>  hw/net/rtl8139.c        | 7 +++----
>  hw/sh4/r2d.c            | 5 +++--
>  6 files changed, 13 insertions(+), 9 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency Philippe Mathieu-Daudé
@ 2017-09-25  5:38   ` Thomas Huth
  2017-10-02 18:52     ` Philippe Mathieu-Daudé
  2017-10-02 19:03   ` Richard Henderson
  1 sibling, 1 reply; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Richard Henderson
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 18:01, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/alpha/alpha_sys.h | 2 --
>  hw/alpha/pci.c       | 2 ++
>  hw/alpha/typhoon.c   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
> index b6d8369ed7..ac685c1c46 100644
> --- a/hw/alpha/alpha_sys.h
> +++ b/hw/alpha/alpha_sys.h
> @@ -5,8 +5,6 @@
>  
>  #include "target/alpha/cpu-qom.h"
>  #include "hw/pci/pci.h"
> -#include "hw/pci/pci_host.h"
> -#include "hw/ide.h"
>  #include "hw/i386/pc.h"

Didn't you want to remove that pc.h line according to the patch description?

 Thomas

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

* Re: [Qemu-devel] [PATCH 34/34] misc: drop old i386 dependency
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 34/34] misc: drop " Philippe Mathieu-Daudé
@ 2017-09-25  5:40   ` Thomas Huth
  0 siblings, 0 replies; 92+ messages in thread
From: Thomas Huth @ 2017-09-25  5:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Paolo Bonzini, Anton Nefedov, Anthony Green,
	Mark Cave-Ayland, Artyom Tarasenko, Kirill Batuzov
  Cc: qemu-devel, qemu-trivial

On 22.09.2017 18:01, Philippe Mathieu-Daudé wrote:
> while here, add an entry for wdt_ib700 in MAINTAINERS
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/char/debugcon.c      | 1 -
>  hw/intc/lm32_pic.c      | 1 -
>  hw/moxie/moxiesim.c     | 1 -
>  hw/sparc/sun4m.c        | 1 -
>  hw/watchdog/wdt_ib700.c | 1 -
>  MAINTAINERS             | 1 +
>  6 files changed, 1 insertion(+), 5 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
  2017-09-22 16:06   ` Peter Maydell
  2017-09-23  5:08   ` David Gibson
@ 2017-09-25  8:10   ` Cornelia Huck
  2 siblings, 0 replies; 92+ messages in thread
From: Cornelia Huck @ 2017-09-25  8:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Michael S. Tsirkin, Igor Mammedov, Eduardo Habkost, David Gibson,
	Alexander Graf, Alex Williamson, qemu-devel, qemu-ppc,
	qemu-trivial

On Fri, 22 Sep 2017 12:39:41 -0300
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> applied using ./scripts/clean-includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/acpi/ipmi-stub.c             | 1 +
>  hw/audio/fmopl.c                | 1 -
>  hw/cpu/core.c                   | 1 +
>  hw/ppc/spapr_cpu_core.c         | 1 +
>  hw/smbios/smbios_type_38-stub.c | 1 +
>  hw/vfio/ccw.c                   | 2 +-
>  hw/virtio/vhost-vsock.c         | 2 +-
>  7 files changed, 6 insertions(+), 3 deletions(-)
> 

> diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> index a8baadf57a..4810fa0b50 100644
> --- a/hw/vfio/ccw.c
> +++ b/hw/vfio/ccw.c
> @@ -11,11 +11,11 @@
>   * directory.
>   */
>  
> +#include "qemu/osdep.h"
>  #include <linux/vfio.h>
>  #include <linux/vfio_ccw.h>
>  #include <sys/ioctl.h>
>  
> -#include "qemu/osdep.h"
>  #include "qapi/error.h"
>  #include "hw/sysbus.h"
>  #include "hw/vfio/vfio.h"

Acked-by: Cornelia Huck <cohuck@redhat.com>

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

* Re: [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
  2017-09-22 16:39   ` Peter Maydell
@ 2017-09-25  8:12   ` Cornelia Huck
  2017-10-10 15:37   ` Anthony PERARD
  2 siblings, 0 replies; 92+ messages in thread
From: Cornelia Huck @ 2017-09-25  8:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, Stefano Stabellini, Anthony Perard,
	Eduardo Habkost, Marcel Apfelbaum, Christian Borntraeger,
	Alexander Graf, Stafford Horne, Marc-André Lureau,
	Daniel P. Berrange, Gerd Hoffmann, qemu-devel, qemu-arm,
	qemu-trivial

On Fri, 22 Sep 2017 12:39:45 -0300
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> exec: housekeeping (funny since 02d0e095031)
> 
> applied using ./scripts/clean-includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  accel/tcg/translate-all.c          | 1 -
>  exec.c                             | 3 ---
>  hw/arm/spitz.c                     | 1 -
>  hw/char/xen_console.c              | 1 -
>  hw/core/machine.c                  | 1 -
>  hw/s390x/css.c                     | 1 -
>  target/openrisc/exception_helper.c | 1 -
>  tests/vhost-user-test.c            | 1 -
>  util/qemu-sockets.c                | 1 -
>  vl.c                               | 1 -
>  10 files changed, 12 deletions(-)

> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> index 75d4f301fb..3938fa5909 100644
> --- a/hw/s390x/css.c
> +++ b/hw/s390x/css.c
> @@ -13,7 +13,6 @@
>  #include "qapi/error.h"
>  #include "qapi/visitor.h"
>  #include "hw/qdev.h"
> -#include "qemu/error-report.h"
>  #include "qemu/bitops.h"
>  #include "qemu/error-report.h"
>  #include "exec/address-spaces.h"

Acked-by: Cornelia Huck <cohuck@redhat.com>

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

* Re: [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included Philippe Mathieu-Daudé
  2017-09-22 16:31   ` Peter Maydell
@ 2017-09-25  9:01   ` Stefan Hajnoczi
  1 sibling, 0 replies; 92+ messages in thread
From: Stefan Hajnoczi @ 2017-09-25  9:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Marc-André Lureau, Michael S. Tsirkin, Zhang Chen,
	Li Zhijian, Jason Wang, Markus Armbruster, Michael Roth,
	Ben Warren, qemu-devel, qemu-trivial

On Fri, Sep 22, 2017 at 12:39:44PM -0300, Philippe Mathieu-Daudé wrote:
> applied using ./scripts/clean-includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/audio/fmopl.h             | 1 -
>  bsd-user/main.c              | 1 -
>  chardev/wctablet.c           | 4 ----
>  hw/scsi/vhost-user-scsi.c    | 1 -
>  linux-user/main.c            | 1 -
>  net/colo-compare.c           | 1 -
>  tests/test-aio-multithread.c | 1 -
>  tests/test-clone-visitor.c   | 1 -
>  tests/vmgenid-test.c         | 3 ---
>  9 files changed, 14 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

* Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" Philippe Mathieu-Daudé
  2017-09-23  5:12   ` David Gibson
@ 2017-09-25 14:30   ` Marcel Apfelbaum
  2017-10-02 18:38     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 92+ messages in thread
From: Marcel Apfelbaum @ 2017-09-25 14:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Alexander Graf, David Gibson,
	Jason Wang
  Cc: qemu-devel, qemu-arm, qemu-ppc, qemu-trivial

Hi Philippe,

It seems the patch is doing much more than
what is mentioned in the subject.

On 22/09/2017 19:01, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   hw/pci/pci_internal.h | 16 +++++++++++
>   include/hw/net/pci.h  | 20 +++++++++++++
>   include/hw/pci/pci.h  |  4 ---
>   hw/arm/virt.c         |  1 +
>   hw/mips/mips_malta.c  |  1 +
>   hw/pci/pci.c          | 67 ++------------------------------------------
>   hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   hw/ppc/e500.c         |  1 +
>   hw/ppc/spapr.c        |  1 +
>   hw/pci/Makefile.objs  |  1 +
>   10 files changed, 120 insertions(+), 69 deletions(-)
>   create mode 100644 hw/pci/pci_internal.h
>   create mode 100644 include/hw/net/pci.h
>   create mode 100644 hw/pci/pci_nic.c
> 
> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h
> new file mode 100644
> index 0000000000..d967468767
> --- /dev/null
> +++ b/hw/pci/pci_internal.h
> @@ -0,0 +1,16 @@
> +/*
> + * QEMU PCI internal
> + *
> + * Copyright (c) 2005 Fabrice Bellard
> + * > + * This work is licensed under the terms of the GNU GPL, version 2 
or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef QEMU_HW_PCI_INTERNAL_H
> +#define QEMU_HW_PCI_INTERNAL_H
> +
> +#include "hw/pci/pci_bus.h"
> +
> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
> +
> +#endif

Why don't add the function directly to hw/pci/pci_nic.c ?
We have only one calling site anyway.

I have nothing against adding an internal H file, but then
we would need to add there *all* the functions used
only by the pci sub-system. And that may be out of the scope
of your series.




> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
> new file mode 100644
> index 0000000000..529591b7f3
> --- /dev/null
> +++ b/include/hw/net/pci.h
> @@ -0,0 +1,20 @@
> +/*
> + * QEMU network devices
> + *
> + * Copyright (c) 2005 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef QEMU_HW_NET_PCI_H
> +#define QEMU_HW_NET_PCI_H
> +
> +#include "net/net.h"
> +#include "hw/pci/pci.h"
> +#include "hw/pci/pci_bus.h"
> +
> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> +                               const char *default_model,
> +                               const char *default_devaddr);
> +

Can you add a short explanation on how the split
helps removing i386/pc dependency from non-PC world?
- it is not straight forward, at least for me.


Thanks,
Marcel

> +#endif
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index aa7ef9cf69..6a0f7b5472 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
>                                             PCIINTxRoutingNotifier notifier);
>   void pci_device_reset(PCIDevice *dev);
>   
> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> -                               const char *default_model,
> -                               const char *default_devaddr);
> -
>   PCIDevice *pci_vga_init(PCIBus *bus);
>   
>   int pci_bus_num(PCIBus *s);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9e18b410d7..39fab3acb9 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -35,6 +35,7 @@
>   #include "hw/arm/primecell.h"
>   #include "hw/arm/virt.h"
>   #include "hw/devices.h"
> +#include "hw/net/pci.h"
>   #include "net/net.h"
>   #include "sysemu/block-backend.h"
>   #include "sysemu/device_tree.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 6945fa47c3..fb6a2f9363 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -48,6 +48,7 @@
>   #include "hw/timer/mc146818rtc.h"
>   #include "hw/input/i8042.h"
>   #include "hw/timer/i8254.h"
> +#include "hw/net/pci.h"
>   #include "sysemu/blockdev.h"
>   #include "exec/address-spaces.h"
>   #include "hw/sysbus.h"             /* SysBusDevice */
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1e6fb88eba..9b678c8fd0 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -28,7 +28,6 @@
>   #include "hw/pci/pci_bus.h"
>   #include "hw/pci/pci_host.h"
>   #include "monitor/monitor.h"
> -#include "net/net.h"
>   #include "sysemu/sysemu.h"
>   #include "hw/loader.h"
>   #include "qemu/error-report.h"
> @@ -41,6 +40,7 @@
>   #include "hw/hotplug.h"
>   #include "hw/boards.h"
>   #include "qemu/cutils.h"
> +#include "pci_internal.h"
>   
>   //#define DEBUG_PCI
>   #ifdef DEBUG_PCI
> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
>       return 0;
>   }
>   
> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
> -                                 const char *devaddr)
> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
>   {
>       int dom, bus;
>       unsigned slot;
> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
>       return head;
>   }
>   
> -static const char * const pci_nic_models[] = {
> -    "ne2k_pci",
> -    "i82551",
> -    "i82557b",
> -    "i82559er",
> -    "rtl8139",
> -    "e1000",
> -    "pcnet",
> -    "virtio",
> -    "sungem",
> -    NULL
> -};
> -
> -static const char * const pci_nic_names[] = {
> -    "ne2k_pci",
> -    "i82551",
> -    "i82557b",
> -    "i82559er",
> -    "rtl8139",
> -    "e1000",
> -    "pcnet",
> -    "virtio-net-pci",
> -    "sungem",
> -    NULL
> -};
> -
> -/* Initialize a PCI NIC.  */
> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> -                               const char *default_model,
> -                               const char *default_devaddr)
> -{
> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
> -    PCIBus *bus;
> -    PCIDevice *pci_dev;
> -    DeviceState *dev;
> -    int devfn;
> -    int i;
> -
> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
> -        exit(0);
> -    }
> -
> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
> -    if (i < 0) {
> -        exit(1);
> -    }
> -
> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
> -    if (!bus) {
> -        error_report("Invalid PCI device address %s for device %s",
> -                     devaddr, pci_nic_names[i]);
> -        exit(1);
> -    }
> -
> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
> -    dev = &pci_dev->qdev;
> -    qdev_set_nic_properties(dev, nd);
> -    qdev_init_nofail(dev);
> -
> -    return pci_dev;
> -}
> -
>   PCIDevice *pci_vga_init(PCIBus *bus)
>   {
>       switch (vga_interface_type) {
> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c
> new file mode 100644
> index 0000000000..fb1a10ff12
> --- /dev/null
> +++ b/hw/pci/pci_nic.c
> @@ -0,0 +1,77 @@
> +/*
> + * QEMU PCI network interface
> + *
> + * Copyright (c) 2004 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "hw/pci/pci.h"
> +#include "hw/pci/pci_bus.h"
> +#include "hw/net/pci.h"
> +#include "net/net.h"
> +#include "pci_internal.h"
> +
> +static const char *const pci_nic_models[] = {
> +    "ne2k_pci",
> +    "i82551",
> +    "i82557b",
> +    "i82559er",
> +    "rtl8139",
> +    "e1000",
> +    "pcnet",
> +    "virtio",
> +    "sungem",
> +    NULL
> +};
> +
> +static const char *const pci_nic_names[] = {
> +    "ne2k_pci",
> +    "i82551",
> +    "i82557b",
> +    "i82559er",
> +    "rtl8139",
> +    "e1000",
> +    "pcnet",
> +    "virtio-net-pci",
> +    "sungem",
> +    NULL
> +};
> +
> +/* Initialize a PCI NIC.  */
> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
> +                               const char *default_model,
> +                               const char *default_devaddr)
> +{
> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
> +    PCIBus *bus;
> +    PCIDevice *pci_dev;
> +    DeviceState *dev;
> +    int devfn;
> +    int i;
> +
> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
> +        exit(0);
> +    }
> +
> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
> +    if (i < 0) {
> +        exit(1);
> +    }
> +
> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
> +    if (!bus) {
> +        error_report("Invalid PCI device address %s for device %s",
> +                     devaddr, pci_nic_names[i]);
> +        exit(1);
> +    }
> +
> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
> +    dev = &pci_dev->qdev;
> +    qdev_set_nic_properties(dev, nd);
> +    qdev_init_nofail(dev);
> +
> +    return pci_dev;
> +}
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index db0e49ab8f..482757ca7b 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -24,6 +24,7 @@
>   #include "hw/hw.h"
>   #include "hw/char/serial.h"
>   #include "hw/pci/pci.h"
> +#include "hw/net/pci.h"
>   #include "hw/boards.h"
>   #include "sysemu/sysemu.h"
>   #include "sysemu/kvm.h"
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 17ea77618c..96007051e2 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -56,6 +56,7 @@
>   #include "hw/pci-host/spapr.h"
>   #include "hw/ppc/xics.h"
>   #include "hw/pci/msi.h"
> +#include "hw/net/pci.h"
>   
>   #include "hw/pci/pci.h"
>   #include "hw/scsi/scsi.h"
> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
> index 9f905e6344..125428fd54 100644
> --- a/hw/pci/Makefile.objs
> +++ b/hw/pci/Makefile.objs
> @@ -1,4 +1,5 @@
>   common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
> +common-obj-$(CONFIG_PCI) += pci_nic.o
>   common-obj-$(CONFIG_PCI) += msix.o msi.o
>   common-obj-$(CONFIG_PCI) += shpc.o
>   common-obj-$(CONFIG_PCI) += slotid_cap.o
> 

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

* Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  2017-09-25 14:30   ` Marcel Apfelbaum
@ 2017-10-02 18:38     ` Philippe Mathieu-Daudé
  2017-10-17  0:24       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-02 18:38 UTC (permalink / raw)
  To: Marcel Apfelbaum
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Alexander Graf, David Gibson,
	Jason Wang, qemu-devel, qemu-arm, qemu-ppc, qemu-trivial

Hi Marcel,

On 09/25/2017 11:30 AM, Marcel Apfelbaum wrote:
> Hi Philippe,
> 
> It seems the patch is doing much more than
> what is mentioned in the subject.
> 
> On 22/09/2017 19:01, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>   hw/pci/pci_internal.h | 16 +++++++++++
>>   include/hw/net/pci.h  | 20 +++++++++++++
>>   include/hw/pci/pci.h  |  4 ---
>>   hw/arm/virt.c         |  1 +
>>   hw/mips/mips_malta.c  |  1 +
>>   hw/pci/pci.c          | 67 ++------------------------------------------
>>   hw/pci/pci_nic.c      | 77 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++
>>   hw/ppc/e500.c         |  1 +
>>   hw/ppc/spapr.c        |  1 +
>>   hw/pci/Makefile.objs  |  1 +
>>   10 files changed, 120 insertions(+), 69 deletions(-)
>>   create mode 100644 hw/pci/pci_internal.h
>>   create mode 100644 include/hw/net/pci.h
>>   create mode 100644 hw/pci/pci_nic.c
>>
>> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h
>> new file mode 100644
>> index 0000000000..d967468767
>> --- /dev/null
>> +++ b/hw/pci/pci_internal.h
>> @@ -0,0 +1,16 @@
>> +/*
>> + * QEMU PCI internal
>> + *
>> + * Copyright (c) 2005 Fabrice Bellard
>> + * > + * This work is licensed under the terms of the GNU GPL, version 2 
> or later.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +#ifndef QEMU_HW_PCI_INTERNAL_H
>> +#define QEMU_HW_PCI_INTERNAL_H
>> +
>> +#include "hw/pci/pci_bus.h"
>> +
>> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char 
>> *devaddr);
>> +
>> +#endif
> 
> Why don't add the function directly to hw/pci/pci_nic.c ?
> We have only one calling site anyway.

You right!

> 
> I have nothing against adding an internal H file, but then
> we would need to add there *all* the functions used
> only by the pci sub-system. And that may be out of the scope
> of your series.
> 
> 
> 
> 
>> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
>> new file mode 100644
>> index 0000000000..529591b7f3
>> --- /dev/null
>> +++ b/include/hw/net/pci.h
>> @@ -0,0 +1,20 @@
>> +/*
>> + * QEMU network devices
>> + *
>> + * Copyright (c) 2005 Fabrice Bellard
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or 
>> later.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +#ifndef QEMU_HW_NET_PCI_H
>> +#define QEMU_HW_NET_PCI_H
>> +
>> +#include "net/net.h"
>> +#include "hw/pci/pci.h"
>> +#include "hw/pci/pci_bus.h"
>> +
>> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>> +                               const char *default_model,
>> +                               const char *default_devaddr);
>> +
> 
> Can you add a short explanation on how the split
> helps removing i386/pc dependency from non-PC world?
> - it is not straight forward, at least for me.

I thought there was an old dependency on "hw/pci/pci.h" to something 
from i386/pc, so every machine using a PCI NIC would have this 
dependency. Extracting the NIC part as "hw/net/pci.h" would solve this 
issue. I didn't check attentively but it seems I was wrong, so I'll 
either drop this patch or reword it.

Regards,

Phil.

> 
> 
> Thanks,
> Marcel
> 
>> +#endif
>> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
>> index aa7ef9cf69..6a0f7b5472 100644
>> --- a/include/hw/pci/pci.h
>> +++ b/include/hw/pci/pci.h
>> @@ -422,10 +422,6 @@ void 
>> pci_device_set_intx_routing_notifier(PCIDevice *dev,
>>                                             PCIINTxRoutingNotifier 
>> notifier);
>>   void pci_device_reset(PCIDevice *dev);
>> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>> -                               const char *default_model,
>> -                               const char *default_devaddr);
>> -
>>   PCIDevice *pci_vga_init(PCIBus *bus);
>>   int pci_bus_num(PCIBus *s);
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 9e18b410d7..39fab3acb9 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -35,6 +35,7 @@
>>   #include "hw/arm/primecell.h"
>>   #include "hw/arm/virt.h"
>>   #include "hw/devices.h"
>> +#include "hw/net/pci.h"
>>   #include "net/net.h"
>>   #include "sysemu/block-backend.h"
>>   #include "sysemu/device_tree.h"
>> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
>> index 6945fa47c3..fb6a2f9363 100644
>> --- a/hw/mips/mips_malta.c
>> +++ b/hw/mips/mips_malta.c
>> @@ -48,6 +48,7 @@
>>   #include "hw/timer/mc146818rtc.h"
>>   #include "hw/input/i8042.h"
>>   #include "hw/timer/i8254.h"
>> +#include "hw/net/pci.h"
>>   #include "sysemu/blockdev.h"
>>   #include "exec/address-spaces.h"
>>   #include "hw/sysbus.h"             /* SysBusDevice */
>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>> index 1e6fb88eba..9b678c8fd0 100644
>> --- a/hw/pci/pci.c
>> +++ b/hw/pci/pci.c
>> @@ -28,7 +28,6 @@
>>   #include "hw/pci/pci_bus.h"
>>   #include "hw/pci/pci_host.h"
>>   #include "monitor/monitor.h"
>> -#include "net/net.h"
>>   #include "sysemu/sysemu.h"
>>   #include "hw/loader.h"
>>   #include "qemu/error-report.h"
>> @@ -41,6 +40,7 @@
>>   #include "hw/hotplug.h"
>>   #include "hw/boards.h"
>>   #include "qemu/cutils.h"
>> +#include "pci_internal.h"
>>   //#define DEBUG_PCI
>>   #ifdef DEBUG_PCI
>> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int 
>> *domp, int *busp,
>>       return 0;
>>   }
>> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
>> -                                 const char *devaddr)
>> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char 
>> *devaddr)
>>   {
>>       int dom, bus;
>>       unsigned slot;
>> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
>>       return head;
>>   }
>> -static const char * const pci_nic_models[] = {
>> -    "ne2k_pci",
>> -    "i82551",
>> -    "i82557b",
>> -    "i82559er",
>> -    "rtl8139",
>> -    "e1000",
>> -    "pcnet",
>> -    "virtio",
>> -    "sungem",
>> -    NULL
>> -};
>> -
>> -static const char * const pci_nic_names[] = {
>> -    "ne2k_pci",
>> -    "i82551",
>> -    "i82557b",
>> -    "i82559er",
>> -    "rtl8139",
>> -    "e1000",
>> -    "pcnet",
>> -    "virtio-net-pci",
>> -    "sungem",
>> -    NULL
>> -};
>> -
>> -/* Initialize a PCI NIC.  */
>> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>> -                               const char *default_model,
>> -                               const char *default_devaddr)
>> -{
>> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
>> -    PCIBus *bus;
>> -    PCIDevice *pci_dev;
>> -    DeviceState *dev;
>> -    int devfn;
>> -    int i;
>> -
>> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
>> -        exit(0);
>> -    }
>> -
>> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
>> -    if (i < 0) {
>> -        exit(1);
>> -    }
>> -
>> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
>> -    if (!bus) {
>> -        error_report("Invalid PCI device address %s for device %s",
>> -                     devaddr, pci_nic_names[i]);
>> -        exit(1);
>> -    }
>> -
>> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
>> -    dev = &pci_dev->qdev;
>> -    qdev_set_nic_properties(dev, nd);
>> -    qdev_init_nofail(dev);
>> -
>> -    return pci_dev;
>> -}
>> -
>>   PCIDevice *pci_vga_init(PCIBus *bus)
>>   {
>>       switch (vga_interface_type) {
>> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c
>> new file mode 100644
>> index 0000000000..fb1a10ff12
>> --- /dev/null
>> +++ b/hw/pci/pci_nic.c
>> @@ -0,0 +1,77 @@
>> +/*
>> + * QEMU PCI network interface
>> + *
>> + * Copyright (c) 2004 Fabrice Bellard
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or 
>> later.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +#include "qemu/osdep.h"
>> +#include "qemu/error-report.h"
>> +#include "hw/pci/pci.h"
>> +#include "hw/pci/pci_bus.h"
>> +#include "hw/net/pci.h"
>> +#include "net/net.h"
>> +#include "pci_internal.h"
>> +
>> +static const char *const pci_nic_models[] = {
>> +    "ne2k_pci",
>> +    "i82551",
>> +    "i82557b",
>> +    "i82559er",
>> +    "rtl8139",
>> +    "e1000",
>> +    "pcnet",
>> +    "virtio",
>> +    "sungem",
>> +    NULL
>> +};
>> +
>> +static const char *const pci_nic_names[] = {
>> +    "ne2k_pci",
>> +    "i82551",
>> +    "i82557b",
>> +    "i82559er",
>> +    "rtl8139",
>> +    "e1000",
>> +    "pcnet",
>> +    "virtio-net-pci",
>> +    "sungem",
>> +    NULL
>> +};
>> +
>> +/* Initialize a PCI NIC.  */
>> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>> +                               const char *default_model,
>> +                               const char *default_devaddr)
>> +{
>> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
>> +    PCIBus *bus;
>> +    PCIDevice *pci_dev;
>> +    DeviceState *dev;
>> +    int devfn;
>> +    int i;
>> +
>> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
>> +        exit(0);
>> +    }
>> +
>> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
>> +    if (i < 0) {
>> +        exit(1);
>> +    }
>> +
>> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
>> +    if (!bus) {
>> +        error_report("Invalid PCI device address %s for device %s",
>> +                     devaddr, pci_nic_names[i]);
>> +        exit(1);
>> +    }
>> +
>> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
>> +    dev = &pci_dev->qdev;
>> +    qdev_set_nic_properties(dev, nd);
>> +    qdev_init_nofail(dev);
>> +
>> +    return pci_dev;
>> +}
>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
>> index db0e49ab8f..482757ca7b 100644
>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -24,6 +24,7 @@
>>   #include "hw/hw.h"
>>   #include "hw/char/serial.h"
>>   #include "hw/pci/pci.h"
>> +#include "hw/net/pci.h"
>>   #include "hw/boards.h"
>>   #include "sysemu/sysemu.h"
>>   #include "sysemu/kvm.h"
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index 17ea77618c..96007051e2 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -56,6 +56,7 @@
>>   #include "hw/pci-host/spapr.h"
>>   #include "hw/ppc/xics.h"
>>   #include "hw/pci/msi.h"
>> +#include "hw/net/pci.h"
>>   #include "hw/pci/pci.h"
>>   #include "hw/scsi/scsi.h"
>> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
>> index 9f905e6344..125428fd54 100644
>> --- a/hw/pci/Makefile.objs
>> +++ b/hw/pci/Makefile.objs
>> @@ -1,4 +1,5 @@
>>   common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
>> +common-obj-$(CONFIG_PCI) += pci_nic.o
>>   common-obj-$(CONFIG_PCI) += msix.o msi.o
>>   common-obj-$(CONFIG_PCI) += shpc.o
>>   common-obj-$(CONFIG_PCI) += slotid_cap.o
>>
> 

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

* Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency
  2017-09-25  5:38   ` Thomas Huth
@ 2017-10-02 18:52     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-02 18:52 UTC (permalink / raw)
  To: Thomas Huth, Richard Henderson
  Cc: Peter Maydell, Paolo Bonzini, qemu-devel, qemu-trivial

Hi Thomas,

On 09/25/2017 02:38 AM, Thomas Huth wrote:
> On 22.09.2017 18:01, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>   hw/alpha/alpha_sys.h | 2 --
>>   hw/alpha/pci.c       | 2 ++
>>   hw/alpha/typhoon.c   | 2 +-
>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
>> index b6d8369ed7..ac685c1c46 100644
>> --- a/hw/alpha/alpha_sys.h
>> +++ b/hw/alpha/alpha_sys.h
>> @@ -5,8 +5,6 @@
>>   
>>   #include "target/alpha/cpu-qom.h"
>>   #include "hw/pci/pci.h"
>> -#include "hw/pci/pci_host.h"
>> -#include "hw/ide.h"
>>   #include "hw/i386/pc.h"
> 
> Didn't you want to remove that pc.h line according to the patch description?

Not yet :( This include is still needed for the i8259 PIC. This change 
is done in the part 2 (following series).

That said, I should improve the patch description :)

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

* Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency
  2017-09-22 16:01 ` [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency Philippe Mathieu-Daudé
  2017-09-25  5:38   ` Thomas Huth
@ 2017-10-02 19:03   ` Richard Henderson
  2017-10-06 12:27     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 92+ messages in thread
From: Richard Henderson @ 2017-10-02 19:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson,
	qemu-trivial, qemu-devel@nongnu.org Developers

2017-09-22 12:01 GMT-04:00 Philippe Mathieu-Daudé <f4bug@amsat.org>:

> diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
> index b6d8369ed7..ac685c1c46 100644
> --- a/hw/alpha/alpha_sys.h
> +++ b/hw/alpha/alpha_sys.h
> @@ -5,8 +5,6 @@
>
>  #include "target/alpha/cpu-qom.h"
>  #include "hw/pci/pci.h"
> -#include "hw/pci/pci_host.h"
> -#include "hw/ide.h"
>

Why are you deleting pci/pci_host.h here?
Alternately, why are you leaving pci/pci.h?


> diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c
> index 8dde637bfe..c370762ea6 100644
> --- a/hw/alpha/pci.c
> +++ b/hw/alpha/pci.c
> @@ -8,6 +8,8 @@
>
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "hw/pci/pci.h"
> +#include "hw/pci/pci_host.h"
>

One way we have a double-include of pci/pci.h here,
the other way we shouldn't re-include either.


r~

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()
  2017-09-22 18:08     ` [Qemu-devel] [Qemu-trivial] " Philippe Mathieu-Daudé
@ 2017-10-06 12:09       ` Eduardo Otubo"
  0 siblings, 0 replies; 92+ messages in thread
From: Eduardo Otubo" @ 2017-10-06 12:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Hervé Poussineau, Peter Maydell, Thomas Huth, Paolo Bonzini,
	Michael S. Tsirkin, Aurelien Jarno, Yongbok Kim,
	Richard Henderson, David Gibson, Alexander Graf,
	Mark Cave-Ayland, Artyom Tarasenko, qemu-trivial, qemu-ppc,
	qemu-devel

On Fri, Sep 22, 2017 at 03:08:03PM -0300, Philippe Mathieu-Daudé wrote:
> On 09/22/2017 02:43 PM, Hervé Poussineau wrote:
> > Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :
> [...]
> > > +void i8257_dma_init(ISABus *bus, int high_page_enable);
> > > +
> > 
> > As you're changing the DMA_init prototype, can you add an Error **errp
> > parameter, and pass &error_abort in each caller?
> > 
> > See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html
> > for more details
> 
> If Eduardo doesn't have a patch ready I can do it.

Please go ahead.
You can also use my patch set (v2) for that as a base if you want.
https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg08007.html

-- 
Eduardo Otubo
Senior Software Engineer @ RedHat

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

* Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency
  2017-10-02 19:03   ` Richard Henderson
@ 2017-10-06 12:27     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-06 12:27 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Richard Henderson,
	qemu-trivial, qemu-devel@nongnu.org Developers

On 10/02/2017 04:03 PM, Richard Henderson wrote:
> 2017-09-22 12:01 GMT-04:00 Philippe Mathieu-Daudé <f4bug@amsat.org>:
> 
>> diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
>> index b6d8369ed7..ac685c1c46 100644
>> --- a/hw/alpha/alpha_sys.h
>> +++ b/hw/alpha/alpha_sys.h
>> @@ -5,8 +5,6 @@
>>
>>  #include "target/alpha/cpu-qom.h"
>>  #include "hw/pci/pci.h"
>> -#include "hw/pci/pci_host.h"
>> -#include "hw/ide.h"
>>
> 
> Why are you deleting pci/pci_host.h here?

Indeed it is required since PCIBus is defined there.

> Alternately, why are you leaving pci/pci.h?
> 
> 
>> diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c
>> index 8dde637bfe..c370762ea6 100644
>> --- a/hw/alpha/pci.c
>> +++ b/hw/alpha/pci.c
>> @@ -8,6 +8,8 @@
>>
>>  #include "qemu/osdep.h"
>>  #include "qemu-common.h"
>> +#include "hw/pci/pci.h"
>> +#include "hw/pci/pci_host.h"
>>
> 
> One way we have a double-include of pci/pci.h here,
> the other way we shouldn't re-include either.

Please ignore this patch.

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

* Re: [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
  2017-09-22 16:39   ` Peter Maydell
  2017-09-25  8:12   ` Cornelia Huck
@ 2017-10-10 15:37   ` Anthony PERARD
  2 siblings, 0 replies; 92+ messages in thread
From: Anthony PERARD @ 2017-10-10 15:37 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, Stefano Stabellini, Eduardo Habkost,
	Marcel Apfelbaum, Cornelia Huck, Christian Borntraeger,
	Alexander Graf, Stafford Horne, Marc-André Lureau,
	Daniel P. Berrange, Gerd Hoffmann, qemu-devel, qemu-arm,
	qemu-trivial

On Fri, Sep 22, 2017 at 12:39:45PM -0300, Philippe Mathieu-Daudé wrote:
> exec: housekeeping (funny since 02d0e095031)
> 
> applied using ./scripts/clean-includes
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  accel/tcg/translate-all.c          | 1 -
>  exec.c                             | 3 ---
>  hw/arm/spitz.c                     | 1 -
>  hw/char/xen_console.c              | 1 -
>  hw/core/machine.c                  | 1 -
>  hw/s390x/css.c                     | 1 -
>  target/openrisc/exception_helper.c | 1 -
>  tests/vhost-user-test.c            | 1 -
>  util/qemu-sockets.c                | 1 -
>  vl.c                               | 1 -
>  10 files changed, 12 deletions(-)
> 

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

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

* Re: [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency
  2017-09-22 15:39 ` [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency Philippe Mathieu-Daudé
  2017-09-25  5:15   ` Thomas Huth
@ 2017-10-10 15:37   ` Anthony PERARD
  1 sibling, 0 replies; 92+ messages in thread
From: Anthony PERARD @ 2017-10-10 15:37 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Gerd Hoffmann,
	Michael S. Tsirkin, Marcel Apfelbaum, Markus Armbruster,
	Dr. David Alan Gilbert, Richard Henderson, Eduardo Habkost,
	qemu-devel, qemu-trivial

On Fri, Sep 22, 2017 at 12:39:52PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/audio/pcspk.c                    | 1 -
>  hw/i386/kvm/pci-assign.c            | 1 -
>  hw/i386/pci-assign-load-rom.c       | 1 -
>  hw/i386/xen/xen_platform.c          | 1 -
>  hw/isa/vt82c686.c                   | 1 -
>  hw/misc/ivshmem.c                   | 1 -
>  hw/misc/sga.c                       | 1 -
>  hw/pci-bridge/pci_expander_bridge.c | 1 -
>  monitor.c                           | 1 -
>  9 files changed, 9 deletions(-)
> 

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

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

* Re: [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1)
  2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
                   ` (33 preceding siblings ...)
       [not found] ` <20170922154014.29350-22-f4bug@amsat.org>
@ 2017-10-16 19:44 ` Michael Tokarev
  2017-10-16 22:49   ` Philippe Mathieu-Daudé
  34 siblings, 1 reply; 92+ messages in thread
From: Michael Tokarev @ 2017-10-16 19:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Eduardo Habkost, Hervé Poussineau, Aurelien Jarno,
	Yongbok Kim, Marc-André Lureau
  Cc: qemu-trivial, qemu-devel

This was an old(ish) patchset. Aplying it now.

22.09.2017 18:39, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> quite a bunch of patches and files modified, but the diffstat is not that big.
> 
> First part is from clean-includes script,
> Then comes code movement, about no logical changes.
> 
> Now some non-x86 builds and cocci spatch run a bit faster :)
> 
> I updated some MAINTAINERS entries while here.
> 
> Also I couldn't test the KVM/XEN/HAX part.
> 
> Regards,
> 
> Phil.
> 
> Philippe Mathieu-Daudé (34):
>   hw: use "qemu/osdep.h" as first #include in source files
applied
>   hw: remove "qemu/osdep.h" from header files
not applied, doing two things, suggested split-up
(I'm fine with it as it is)
>   block: remove "qemu/osdep.h" from header file
applied
>   misc: remove headers implicitly included
applied
>   misc: remove duplicated includes
applied
>   ppc: remove duplicated includes
applied
>   i386/hax: remove duplicated includes
applied (note it can be trimmed more)
>   nios2: remove duplicated includes
applied
>   misc: avoid "include/" in include path
not applied, probably should be split, but I'm fine with it as it is
>   amd_iommu: avoid needless includes in header file
applied
>   i386/pc: use TYPE_PORT92
applied
>   misc: remove old i386 dependency
applied
>   hw/ide: remove old i386 dependency
applied
>   hw/ipmi: remove old i386 dependency
applied
>   hw/i2c: remove old i386 dependency
applied
>   hw/tpm: remove old i386 dependency
applied
>   hw/virtio-balloon: remove old i386 dependency
applied
>   hw/unicore32: restrict hw addr defines to source file
applied
>   hw/acpi: ACPI_PM_* defines are not restricted to i386 arch
applied
>   hw/timer/i8254: rename pit_init() -> i8254_pit_init()
not applied, split?
>   hw/display/vga: remove the old i386/pc dependency
somehow I can't find this patch, neither in my inbox nor in patchwork
>   hw/input/i8042: extract API from hw/i386/pc.h
CHECK
>   hw/dma/i8257: rename DMA_init() to i8257_dma_init()
not applied, pending **errp addition
>   hw/timer/mc146818: rename rtc_init() -> mc146818_init()
applied
>   hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
not applied, it went out of context without i8257_dma_init rename
btw, why do we prefer these TYPE_XXX things instead of simple "xxx" stuff?
>   hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
applied
>   hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
not applied, it does more than mentioned

>   hw/net/e1000: use TYPE_PCI_E1000
>   hw/net/e1000e: use TYPE_PCI_E1000E
>   hw/net/pcnet: use TYPE_PCI_PCNET
>   hw/net/rtl8139: use TYPE_PCI_RTL8139
>   hw/net/ne2000: use TYPE_PCI_NE2000

Not applied, at least not yet, why do we use these TYPE_XX stuff to
start with?

>   hw/alpha: remove old i386 dependency
not applied

>   misc: drop old i386 dependency
applied, except of the MAINTAINERS part.

Applying these series is quite a bit boring task I'd say :)

Thanks,

/mjt

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

* Re: [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1)
  2017-10-16 19:44 ` [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Michael Tokarev
@ 2017-10-16 22:49   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-16 22:49 UTC (permalink / raw)
  To: Michael Tokarev, Eduardo Habkost, Eduardo Otubo
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Hervé Poussineau, Aurelien Jarno, Yongbok Kim,
	Marc-André Lureau, qemu-trivial, qemu-devel

Hi Michael,

Thanks for your comments!

>>   hw: remove "qemu/osdep.h" from header files
> not applied, doing two things, suggested split-up
> (I'm fine with it as it is)

split out MAINTAINERS entry

>>   i386/hax: remove duplicated includes
> applied (note it can be trimmed more)

done in another patch.

>>   misc: avoid "include/" in include path
> not applied, probably should be split, but I'm fine with it as it is

split out numa.c

>>   hw/timer/i8254: rename pit_init() -> i8254_pit_init()
> not applied, split?

split out MAINTAINERS entry

>>   hw/display/vga: remove the old i386/pc dependency
> somehow I can't find this patch, neither in my inbox nor in patchwork

weird...

>>   hw/input/i8042: extract API from hw/i386/pc.h
> CHECK

split out MAINTAINERS entry

>>   hw/dma/i8257: rename DMA_init() to i8257_dma_init()
> not applied, pending **errp addition

attempt to fix it...

>>   hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS
> not applied, it went out of context without i8257_dma_init rename
> btw, why do we prefer these TYPE_XXX things instead of simple "xxx" stuff?

split out MAINTAINERS entry, dropped out TYPE_M48T59_ISA use.

>>   hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
> not applied, it does more than mentioned

dropped from this series.

>>   hw/net/e1000: use TYPE_PCI_E1000
>>   hw/net/e1000e: use TYPE_PCI_E1000E
>>   hw/net/pcnet: use TYPE_PCI_PCNET
>>   hw/net/rtl8139: use TYPE_PCI_RTL8139
>>   hw/net/ne2000: use TYPE_PCI_NE2000
> 
> Not applied, at least not yet, why do we use these TYPE_XX stuff to
> start with?

TYPE_XX is the interface, having the devices using TYPE_XX instead of
hardcoded name guarantee safe rename/refactor.

anyway, dropped.

> Applying these series is quite a bit boring task I'd say :)

separating them from the whole branch too! but they are required for the
final objective which I'll send in 3 or 4 parts.

Regards,

Phil.

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

* Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"
  2017-10-02 18:38     ` Philippe Mathieu-Daudé
@ 2017-10-17  0:24       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 92+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-17  0:24 UTC (permalink / raw)
  To: Marcel Apfelbaum, Jason Wang, Michael Tokarev
  Cc: Peter Maydell, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	Aurelien Jarno, Yongbok Kim, Alexander Graf, David Gibson,
	qemu-devel, qemu-arm, qemu-ppc, qemu-trivial

Hi Marcel,

>> It seems the patch is doing much more than
>> what is mentioned in the subject.
>>
[...]
>> Can you add a short explanation on how the split
>> helps removing i386/pc dependency from non-PC world?
>> - it is not straight forward, at least for me.
> 
> I thought there was an old dependency on "hw/pci/pci.h" to something
> from i386/pc, so every machine using a PCI NIC would have this
> dependency. Extracting the NIC part as "hw/net/pci.h" would solve this
> issue. I didn't check attentively but it seems I was wrong, so I'll
> either drop this patch or reword it.

I finally opted to drop it for this series and include it reworded in
part 2 which include more PCI-related patches.

Regards,

Phil.

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

end of thread, other threads:[~2017-10-17  0:24 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 15:39 [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Philippe Mathieu-Daudé
2017-09-22 15:39 ` [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files Philippe Mathieu-Daudé
2017-09-22 16:06   ` Peter Maydell
2017-09-23  5:08   ` David Gibson
2017-09-25  8:10   ` Cornelia Huck
2017-09-22 15:39 ` [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files Philippe Mathieu-Daudé
2017-09-22 16:07   ` Peter Maydell
2017-09-22 16:54     ` Corey Minyard
2017-09-22 17:58     ` Philippe Mathieu-Daudé
2017-09-22 15:39 ` [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file Philippe Mathieu-Daudé
2017-09-22 16:32   ` Peter Maydell
2017-09-22 15:39 ` [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included Philippe Mathieu-Daudé
2017-09-22 16:31   ` Peter Maydell
2017-09-25  9:01   ` Stefan Hajnoczi
2017-09-22 15:39 ` [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes Philippe Mathieu-Daudé
2017-09-22 16:39   ` Peter Maydell
2017-09-25  8:12   ` Cornelia Huck
2017-10-10 15:37   ` Anthony PERARD
2017-09-22 15:39 ` [Qemu-devel] [PATCH 06/34] ppc: " Philippe Mathieu-Daudé
2017-09-22 16:39   ` Peter Maydell
2017-09-23  5:31   ` David Gibson
2017-09-22 15:39 ` [Qemu-devel] [PATCH 07/34] i386/hax: " Philippe Mathieu-Daudé
2017-09-22 16:42   ` Peter Maydell
2017-09-22 15:39 ` [Qemu-devel] [PATCH 08/34] nios2: " Philippe Mathieu-Daudé
2017-09-22 16:44   ` Peter Maydell
2017-09-22 15:39 ` [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path Philippe Mathieu-Daudé
2017-09-22 16:46   ` Peter Maydell
2017-09-22 15:39 ` [Qemu-devel] [PATCH 10/34] amd_iommu: avoid needless includes in header file Philippe Mathieu-Daudé
2017-09-25  5:13   ` Thomas Huth
2017-09-22 15:39 ` [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92 Philippe Mathieu-Daudé
2017-09-25  5:16   ` Thomas Huth
2017-09-22 15:39 ` [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency Philippe Mathieu-Daudé
2017-09-25  5:15   ` Thomas Huth
2017-10-10 15:37   ` Anthony PERARD
2017-09-22 15:39 ` [Qemu-devel] [PATCH 13/34] hw/ide: " Philippe Mathieu-Daudé
2017-09-22 18:03   ` John Snow
2017-09-22 15:39 ` [Qemu-devel] [PATCH 14/34] hw/ipmi: " Philippe Mathieu-Daudé
2017-09-22 16:58   ` Corey Minyard
2017-09-22 15:39 ` [Qemu-devel] [PATCH 15/34] hw/i2c: " Philippe Mathieu-Daudé
2017-09-25  5:17   ` Thomas Huth
2017-09-22 15:39 ` [Qemu-devel] [PATCH 16/34] hw/tpm: " Philippe Mathieu-Daudé
2017-09-22 16:05   ` Stefan Berger
2017-09-22 15:39 ` [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: " Philippe Mathieu-Daudé
2017-09-25  5:23   ` Thomas Huth
2017-09-22 15:39 ` [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file Philippe Mathieu-Daudé
2017-09-25  5:19   ` Thomas Huth
2017-09-22 15:39 ` [Qemu-devel] [PATCH 19/34] hw/acpi: ACPI_PM_* defines are not restricted to i386 arch Philippe Mathieu-Daudé
2017-09-22 15:40 ` [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init() Philippe Mathieu-Daudé
2017-09-22 20:09   ` Hervé Poussineau
2017-09-22 15:40 ` [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h Philippe Mathieu-Daudé
2017-09-22 20:10   ` Hervé Poussineau
2017-09-23  5:09   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
2017-09-22 17:43   ` Hervé Poussineau
2017-09-22 18:08     ` [Qemu-devel] [Qemu-trivial] " Philippe Mathieu-Daudé
2017-10-06 12:09       ` Eduardo Otubo"
2017-09-22 16:01 ` [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init() Philippe Mathieu-Daudé
2017-09-22 20:11   ` Hervé Poussineau
2017-09-23  5:10   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS Philippe Mathieu-Daudé
2017-09-22 20:12   ` Hervé Poussineau
2017-09-23  5:11   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c Philippe Mathieu-Daudé
2017-09-22 20:13   ` Hervé Poussineau
2017-09-23  5:11   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" Philippe Mathieu-Daudé
2017-09-23  5:12   ` David Gibson
2017-09-25 14:30   ` Marcel Apfelbaum
2017-10-02 18:38     ` Philippe Mathieu-Daudé
2017-10-17  0:24       ` Philippe Mathieu-Daudé
2017-09-22 16:01 ` [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000 Philippe Mathieu-Daudé
2017-09-23  5:13   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E Philippe Mathieu-Daudé
2017-09-25  5:34   ` Thomas Huth
2017-09-22 16:01 ` [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET Philippe Mathieu-Daudé
2017-09-22 20:13   ` Hervé Poussineau
2017-09-23  5:14   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139 Philippe Mathieu-Daudé
2017-09-25  5:36   ` Thomas Huth
2017-09-22 16:01 ` [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000 Philippe Mathieu-Daudé
2017-09-22 20:14   ` Hervé Poussineau
2017-09-23  5:14   ` David Gibson
2017-09-22 16:01 ` [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency Philippe Mathieu-Daudé
2017-09-25  5:38   ` Thomas Huth
2017-10-02 18:52     ` Philippe Mathieu-Daudé
2017-10-02 19:03   ` Richard Henderson
2017-10-06 12:27     ` Philippe Mathieu-Daudé
2017-09-22 16:01 ` [Qemu-devel] [PATCH 34/34] misc: drop " Philippe Mathieu-Daudé
2017-09-25  5:40   ` Thomas Huth
     [not found] ` <20170922154014.29350-22-f4bug@amsat.org>
2017-09-22 20:10   ` [Qemu-devel] [PATCH 21/34] hw/display/vga: remove the old i386/pc dependency Hervé Poussineau
2017-10-16 19:44 ` [Qemu-devel] [PATCH 00/34] remove i386/pc dependency from non-PC world (part 1) Michael Tokarev
2017-10-16 22:49   ` Philippe Mathieu-Daudé

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.