Skip to contentSkip to conversation

hw: Clean up hw/i386 headers (and few alpha/hppa)

PATCH Applied Philippe Mathieu-Daudé 6 participants 29 messages Oct 14, 2019 – Mar 9, 2020

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover hw: Clean up hw/i386 headers (and few alpha/hppa)

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" hw/timer/hpet: Include "exec/address-spaces.h" hw/pci-host/q35: Include "qemu/range.h" hw/i2c/smbus_ich9: Include "qemu/range.h" hw/pci-host/piix: Include "qemu/range.h"
hw/acpi: Include "hw/mem/nvdimm.h"
hw/i386: Include "hw/mem/nvdimm.h"
hw/pci-host/q35: Remove unused includes
hw/i386/pc: Clean up includes

 hw/acpi/cpu_hotplug.c             |  1 +
 hw/acpi/ich9.c                    |  2 +-
 hw/acpi/piix4.c                   |  1 +
 hw/alpha/alpha_sys.h              |  1 -
 hw/alpha/dp264.c                  |  1 +
 hw/hppa/machine.c                 |  1 +
 hw/i2c/smbus_ich9.c               |  1 +
 hw/i386/acpi-build.c              |  1 +
 hw/i386/pc.c                      |  1 +
 hw/i386/pc_piix.c                 |  1 +
 hw/i386/pc_q35.c                  |  1 +
 hw/input/pckbd.c                  |  1 -
 hw/isa/lpc_ich9.c                 |  2 --
 hw/pci-host/piix.c                |  1 +
 hw/pci-host/q35.c                 |  1 +
 hw/timer/hpet.c                   |  2 +-
 hw/timer/twl92230.c               |  1 -
 hw/usb/dev-storage.c              |  1 -
 hw/xen/xen_pt_load_rom.c          |  4 ----
 include/hw/i386/ich9.h            |  1 -
 include/hw/i386/intel_iommu.h     |  4 ----
 include/hw/i386/ioapic_internal.h |  1 -
 include/hw/i386/pc.h              | 12 +++---------
 include/hw/pci-host/q35.h         |  8 +-------
 vl.c                              |  1 +
 25 files changed, 18 insertions(+), 34 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/20 vl: Add missing "hw/boards.h" include

vl.c calls machine_usb() declared in "hw/boards.h". Include it.

This fixes (when modifying unrelated headers):

vl.c:1283:10: error: implicit declaration of function 'machine_usb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

      if (!machine_usb(current_machine)) {
           ^
  vl.c:1283:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  vl.c:1283:22: error: use of undeclared identifier 'current_machine'
      if (!machine_usb(current_machine)) {
                       ^
---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +1 -0
index 002bf4919e..e85b31df1b 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/units.h"
+#include "hw/boards.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu-version.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

PATCH 2/20 hw/southbridge/ich9: Removed unused headers

In reply to Philippe Mathieu-Daudé

The ICH9 chipset is not X86/PC specific.

These files don't use anything declared by the "hw/i386/pc.h" or "hw/i386/ioapic.h" headers. Remove them.

---
 hw/acpi/ich9.c         | 1 -
 hw/isa/lpc_ich9.c      | 2 --
 include/hw/i386/ich9.h | 1 -
 3 files changed, 4 deletions(-)
hw/acpi/ich9.c +0 -1
index 2034dd749e..fdd0a6c79e 100644
@@ -27,7 +27,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
hw/isa/lpc_ich9.c +0 -2
index 17c292e306..61cee2ae3a 100644
@@ -35,10 +35,8 @@
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
 #include "hw/irq.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/i386/ich9.h"
include/hw/i386/ich9.h +0 -1
index 72e803f6e2..a98d10b252 100644
@@ -5,7 +5,6 @@
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pcie_host.h"
 #include "hw/pci/pci_bridge.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw

PATCH 3/20 hw/input/pckbd: Remove unused "hw/i386/pc.h" header

In reply to Philippe Mathieu-Daudé

The keyboard controller model don't need anything from "hw/i386/pc.h". Remove it.

---
 hw/input/pckbd.c | 1 -
 1 file changed, 1 deletion(-)
hw/input/pckbd.c +0 -1
index f0acfd86f7..2f09f780ba 100644
@@ -26,7 +26,6 @@
 #include "qemu/log.h"
 #include "hw/isa/isa.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
 #include "hw/irq.h"
 #include "hw/input/i8042.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw

PATCH 4/20 hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header

In reply to Philippe Mathieu-Daudé

The "ioapic_internal.h" does not use anything from "hw/i386/ioapic.h", remove it.

---
 include/hw/i386/ioapic_internal.h | 1 -
 1 file changed, 1 deletion(-)
include/hw/i386/ioapic_internal.h +0 -1
index d46c87c510..fe06938bda 100644
@@ -23,7 +23,6 @@
 #define QEMU_IOAPIC_INTERNAL_H
 
 #include "exec/memory.h"
-#include "hw/i386/ioapic.h"
 #include "hw/sysbus.h"
 #include "qemu/notify.h"
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw

PATCH 5/20 hw/timer: Remove unused "ui/console.h" header

In reply to Philippe Mathieu-Daudé

The timer models don't need anything from "ui/console.h". Remove it.

---
 hw/timer/hpet.c     | 1 -
 hw/timer/twl92230.c | 1 -
 2 files changed, 2 deletions(-)
hw/timer/hpet.c +0 -1
index 1ddae4e7d7..4772cccfe3 100644
@@ -27,7 +27,6 @@
 #include "qemu/osdep.h"
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
-#include "ui/console.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
hw/timer/twl92230.c +0 -1
index 63bd13d2ca..d0011be89e 100644
@@ -27,7 +27,6 @@
 #include "migration/qemu-file-types.h"
 #include "migration/vmstate.h"
 #include "sysemu/sysemu.h"
-#include "ui/console.h"
 #include "qemu/bcd.h"
 #include "qemu/module.h"
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw

PATCH 6/20 hw/usb/dev-storage: Remove unused "ui/console.h" header

In reply to Philippe Mathieu-Daudé

The USB models related to storage don't need anything from "ui/console.h". Remove it.

---
 hw/usb/dev-storage.c | 1 -
 1 file changed, 1 deletion(-)
hw/usb/dev-storage.c +0 -1
index 8545193488..a2ff52d3e5 100644
@@ -17,7 +17,6 @@
 #include "desc.h"
 #include "hw/qdev-properties.h"
 #include "hw/scsi/scsi.h"
-#include "ui/console.h"
 #include "migration/vmstate.h"
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#8 lore raw

PATCH 7/20 hw/i386/intel_iommu: Remove unused includes

In reply to Philippe Mathieu-Daudé

intel_iommu.h does not use any of these includes, remove them.

---
 include/hw/i386/intel_iommu.h | 4 ----
 1 file changed, 4 deletions(-)
include/hw/i386/intel_iommu.h +0 -4
index 66b931e526..a1c4afcda5 100644
@@ -22,11 +22,7 @@
 #ifndef INTEL_IOMMU_H
 #define INTEL_IOMMU_H
 
-#include "sysemu/dma.h"
 #include "hw/i386/x86-iommu.h"
-#include "hw/i386/ioapic.h"
-#include "hw/pci/msi.h"
-#include "hw/sysbus.h"
 #include "qemu/iova-tree.h"
 
 #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#9 lore raw

PATCH 8/20 hw/xen/xen_pt_load_rom: Remove unused includes

In reply to Philippe Mathieu-Daudé

xen_pt_load_rom.c does not use any of these includes, remove them.

---
 hw/xen/xen_pt_load_rom.c | 4 ----
 1 file changed, 4 deletions(-)
hw/xen/xen_pt_load_rom.c +0 -4
index 307a5c93e2..a50a80837e 100644
@@ -3,12 +3,8 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
-#include "ui/console.h"
 #include "hw/loader.h"
-#include "monitor/monitor.h"
-#include "qemu/range.h"
 #include "hw/pci/pci.h"
 #include "xen_pt.h"
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#12 lore raw

PATCH 9/20 hw/alpha/alpha_sys: Remove unused "hw/ide.h" header

In reply to Philippe Mathieu-Daudé

alpha_sys.h does not use anything from the "hw/ide.h" header. Remove it.

---
 hw/alpha/alpha_sys.h | 1 -
 1 file changed, 1 deletion(-)
hw/alpha/alpha_sys.h +0 -1
index 4e127a6de8..9991535c0d 100644
@@ -6,7 +6,6 @@
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 #include "hw/i386/pc.h"
 
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#13 lore raw

PATCH 10/20 hw/alpha/dp264: Include "net/net.h"

In reply to Philippe Mathieu-Daudé

hw/alpha/dp264.c uses NICInfo variables which are declared in "net/net.h". Include it.

This fixes (when modifying unrelated headers):

hw/alpha/dp264.c:89:21: error: use of undeclared identifier 'nb_nics'

      for (i = 0; i < nb_nics; i++) {
                      ^
  hw/alpha/dp264.c:90:30: error: use of undeclared identifier 'nd_table'
          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
                               ^
---
 hw/alpha/dp264.c | 1 +
 1 file changed, 1 insertion(+)
hw/alpha/dp264.c +1 -0
index 51feee8558..013a9d3510 100644
@@ -20,6 +20,7 @@
 #include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
 #include "qemu/cutils.h"
+#include "net/net.h"
 
 #define MAX_IDE_BUS 2
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#14 lore raw

PATCH 11/20 hw/hppa/machine: Include "net/net.h"

In reply to Philippe Mathieu-Daudé

hw/hppa/machine.c uses NICInfo variables which are declared in "net/net.h". Include it.

This fixes (when modifying unrelated headers):

hw/hppa/machine.c:126:21: error: use of undeclared identifier 'nb_nics'

      for (i = 0; i < nb_nics; i++) {
                      ^
  hw/hppa/machine.c:127:30: error: use of undeclared identifier 'nd_table'
          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
                               ^
---
 hw/hppa/machine.c | 1 +
 1 file changed, 1 insertion(+)
hw/hppa/machine.c +1 -0
index 7e23675429..6c55ed0af1 100644
@@ -20,6 +20,7 @@
 #include "qemu/units.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
+#include "net/net.h"
 
 #define MAX_IDE_BUS 2
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#15 lore raw

PATCH 12/20 hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"

In reply to Philippe Mathieu-Daudé

hw/acpi/cpu_hotplug.c calls pci_address_space_io(). Include "hw/pci/pci.h" which declares it.

This fixes (when modifying unrelated headers):

hw/acpi/cpu_hotplug.c:103:28: error: implicit declaration of function 'pci_address_space_io' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

      MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe_cpu->device));
                             ^
---
 hw/acpi/cpu_hotplug.c | 1 +
 1 file changed, 1 insertion(+)
hw/acpi/cpu_hotplug.c +1 -0
index 6e8293aac9..7fb65d9065 100644
@@ -14,6 +14,7 @@
 #include "qapi/error.h"
 #include "hw/core/cpu.h"
 #include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
 #include "qemu/error-report.h"
 
 #define CPU_EJECT_METHOD "CPEJ"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#16 lore raw

PATCH 13/20 hw/timer/hpet: Include "exec/address-spaces.h"

In reply to Philippe Mathieu-Daudé

hw/timer/hpet.c calls address_space_stl_le() declared in "exec/address-spaces.h". Include it.

This fixes (when modifying unrelated headers):

hw/timer/hpet.c:210:31: error: use of undeclared identifier 'address_space_memory'

          address_space_stl_le(&address_space_memory, timer->fsb >> 32,
                               ^~~~~~~~~~~~~~~~~~~~
---
 hw/timer/hpet.c | 1 +
 1 file changed, 1 insertion(+)
hw/timer/hpet.c +1 -0
index 4772cccfe3..6589d63ebb 100644
@@ -35,6 +35,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "migration/vmstate.h"
 #include "hw/timer/i8254.h"
+#include "exec/address-spaces.h"
 
 //#define HPET_DEBUG
 #ifdef HPET_DEBUG
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 8/20
#10 lore raw

Re: [PATCH 08/20] hw/xen/xen_pt_load_rom: Remove unused includes

In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

xen_pt_load_rom.c does not use any of these includes, remove them.

Quoted 22 lines
---
 hw/xen/xen_pt_load_rom.c | 4 ----
 1 file changed, 4 deletions(-)
hw/xen/xen_pt_load_rom.c +0 -5
index 307a5c93e2..a50a80837e 100644
@@ -3,12 +3,8 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
-#include "ui/console.h"
 #include "hw/loader.h"
-#include "monitor/monitor.h"
-#include "qemu/range.h"
 #include "hw/pci/pci.h"
 #include "xen_pt.h"
 
--
Quoted 2 lines

2.21.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#17 lore raw

PATCH 14/20 hw/pci-host/q35: Include "qemu/range.h"

In reply to Philippe Mathieu-Daudé

The MCHPCIState structure uses the Range type which is declared in "qemu/range.h". Include it.

This fixes (when modifying unrelated headers):

In file included from hw/pci-host/q35.c:32:
include/hw/pci-host/q35.h:57:11: error: field has incomplete type 'Range' (aka 'struct Range')

      Range pci_hole;
            ^
  include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range'
  typedef struct Range Range;
                 ^
---
 include/hw/pci-host/q35.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/pci-host/q35.h +1 -0
index b3bcf2e632..79a88d67b1 100644
@@ -32,6 +32,7 @@
 #include "hw/acpi/ich9.h"
 #include "hw/pci-host/pam.h"
 #include "hw/i386/intel_iommu.h"
+#include "qemu/range.h"
 
 #define TYPE_Q35_HOST_DEVICE "q35-pcihost"
 #define Q35_HOST_DEVICE(obj) \
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#18 lore raw

PATCH 15/20 hw/i2c/smbus_ich9: Include "qemu/range.h"

In reply to Philippe Mathieu-Daudé

hw/i2c/smbus_ich9.c calls range_covers_byte(). Include "qemu/range.h" which declares it.

This fixes (when modifying unrelated headers):

hw/i2c/smbus_ich9.c:66:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

      if (range_covers_byte(address, len, ICH9_SMB_HOSTC)) {
          ^
---
 hw/i2c/smbus_ich9.c | 1 +
 1 file changed, 1 insertion(+)
hw/i2c/smbus_ich9.c +1 -0
index fd50fb851a..48f1ff4191 100644
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/range.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#19 lore raw

PATCH 16/20 hw/pci-host/piix: Include "qemu/range.h"

In reply to Philippe Mathieu-Daudé

hw/pci-host/piix.c calls various functions from the Range API. Include "qemu/range.h" which declares them.

This fixes (when modifying unrelated headers):

hw/pci-host/i440fx.c:54:11: error: field has incomplete type 'Range' (aka 'struct Range')

      Range pci_hole;
           ^
  include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range'
  typedef struct Range Range;
                 ^
  hw/pci-host/i440fx.c:126:9: error: implicit declaration of function 'ranges_overlap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) ||
          ^
  hw/pci-host/i440fx.c:126:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  hw/pci-host/i440fx.c:127:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          range_covers_byte(address, len, I440FX_SMRAM)) {
          ^
  hw/pci-host/i440fx.c:127:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  hw/pci-host/i440fx.c:189:13: error: implicit declaration of function 'range_is_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      val64 = range_is_empty(&s->pci_hole) ? 0 : range_lob(&s->pci_hole);
              ^
---
 hw/pci-host/piix.c | 1 +
 1 file changed, 1 insertion(+)
hw/pci-host/piix.c +1 -0
index 135c645535..76ed252a60 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/range.h"
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
 #include "hw/pci/pci.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#20 lore raw

PATCH 17/20 hw/acpi: Include "hw/mem/nvdimm.h"

In reply to Philippe Mathieu-Daudé

Both ich9.c and piix4.c use methods/definitions declared in the NVDIMM device header. Include it.

This fixes (when modifying unrelated headers):

hw/acpi/ich9.c:507:46: error: use of undeclared identifier 'TYPE_NVDIMM'

        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                             ^
  hw/acpi/ich9.c:508:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            nvdimm_acpi_plug_cb(hotplug_dev, dev);
            ^
  hw/acpi/piix4.c:403:46: error: use of undeclared identifier 'TYPE_NVDIMM'
        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                             ^
  hw/acpi/piix4.c:404:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            nvdimm_acpi_plug_cb(hotplug_dev, dev);
            ^
---
 hw/acpi/ich9.c  | 1 +
 hw/acpi/piix4.c | 1 +
 2 files changed, 2 insertions(+)
hw/acpi/ich9.c +1 -0
index fdd0a6c79e..4e74284b65 100644
@@ -39,6 +39,7 @@
 
 #include "hw/i386/ich9.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 
 //#define DEBUG
 
hw/acpi/piix4.c +1 -0
index 5742c3df87..11a3e33e5b 100644
@@ -39,6 +39,7 @@
 #include "hw/acpi/cpu.h"
 #include "hw/hotplug.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#21 lore raw

PATCH 18/20 hw/i386: Include "hw/mem/nvdimm.h"

In reply to Philippe Mathieu-Daudé

All this files use methods/definitions declared in the NVDIMM device header. Include it.

This fixes (when modifying unrelated headers):

hw/i386/acpi-build.c:2733:9: error: implicit declaration of function 'nvdimm_build_acpi' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

        nvdimm_build_acpi(table_offsets, tables_blob, tables->linker,
        ^
  hw/i386/pc.c:1996:61: error: use of undeclared identifier 'TYPE_NVDIMM'
    const bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
                                                            ^
  hw/i386/pc.c:2032:55: error: use of undeclared identifier 'TYPE_NVDIMM'
    bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
                                                      ^
  hw/i386/pc.c:2040:9: error: implicit declaration of function 'nvdimm_plug' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_plug(ms->nvdimms_state);
        ^
  hw/i386/pc.c:2040:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        nvdimm_plug(ms->nvdimms_state);
        ^
  hw/i386/pc.c:2065:42: error: use of undeclared identifier 'TYPE_NVDIMM'
    if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                         ^
  hw/i386/pc_i440fx.c:307:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_init_acpi_state(machine->nvdimms_state, system_io,
        ^
  hw/i386/pc_q35.c:332:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_init_acpi_state(machine->nvdimms_state, system_io,
        ^
---
 hw/i386/acpi-build.c | 1 +
 hw/i386/pc.c         | 1 +
 hw/i386/pc_piix.c    | 1 +
 hw/i386/pc_q35.c     | 1 +
 4 files changed, 4 insertions(+)
hw/i386/acpi-build.c +1 -0
index 4e0f9f425a..ac46936f63 100644
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "hw/mem/memory-device.h"
+#include "hw/mem/nvdimm.h"
 #include "sysemu/numa.h"
 #include "sysemu/reset.h"
 
hw/i386/pc.c +1 -0
index bcda50efcc..cff330802d 100644
@@ -73,6 +73,7 @@
 #include "hw/boards.h"
 #include "acpi-build.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 #include "qapi/error.h"
 #include "qapi/qapi-visit-common.h"
 #include "qapi/visitor.h"
hw/i386/pc_piix.c +1 -0
index 6824b72124..8651b6e2ec 100644
@@ -58,6 +58,7 @@
 #include "migration/misc.h"
 #include "kvm_i386.h"
 #include "sysemu/numa.h"
+#include "hw/mem/nvdimm.h"
 
 #define MAX_IDE_BUS 2
 
hw/i386/pc_q35.c +1 -0
index 8fad20f314..91ba231ef1 100644
@@ -53,6 +53,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "sysemu/numa.h"
+#include "hw/mem/nvdimm.h"
 
 /* ICH9 AHCI has 6 ports */
 #define MAX_SATA_PORTS     6
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#22 lore raw

PATCH 19/20 hw/pci-host/q35: Remove unused includes

In reply to Philippe Mathieu-Daudé

Only q35.c requires declarations from "hw/i386/pc.h", move it there. Remove all the includes not used by "q35.h".

---
 hw/pci-host/q35.c         | 1 +
 include/hw/pci-host/q35.h | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)
hw/pci-host/q35.c +1 -0
index 158d270b9f..918843d373 100644
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/pci-host/q35.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
include/hw/pci-host/q35.h +0 -7
index 79a88d67b1..534d90dbaf 100644
@@ -22,16 +22,9 @@
 #ifndef HW_Q35_H
 #define HW_Q35_H
 
-#include "hw/isa/isa.h"
-#include "hw/sysbus.h"
-#include "hw/i386/pc.h"
-#include "hw/isa/apm.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pcie_host.h"
-#include "hw/acpi/acpi.h"
-#include "hw/acpi/ich9.h"
 #include "hw/pci-host/pam.h"
-#include "hw/i386/intel_iommu.h"
 #include "qemu/range.h"
 
 #define TYPE_Q35_HOST_DEVICE "q35-pcihost"
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#23 lore raw

PATCH 20/20 hw/i386/pc: Clean up includes

In reply to Philippe Mathieu-Daudé

Various headers are not required by hw/i386/pc.h:

- "qemu/range.h"
- "qemu/bitmap.h"
- "qemu/module.h"
- "exec/memory.h"
- "hw/pci/pci.h"
- "hw/mem/pc-dimm.h"
- "hw/mem/nvdimm.h"
- "net/net.h"

Remove them.

Add 3 headers that were missing:

- "hw/hotplug.h"

PCMachineState::acpi_dev is of type HotplugHandler

- "qemu/notify.h"

PCMachineState::machine_done is of type Notifier

- "qapi/qapi-types-common.h"

PCMachineState::vmport/smm is of type OnOffAuto

---
 include/hw/i386/pc.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
include/hw/i386/pc.h +3 -9
index 6df4f4b6fb..e5c2dc9081 100644
@@ -1,21 +1,15 @@
 #ifndef HW_PC_H
 #define HW_PC_H
 
-#include "exec/memory.h"
+#include "qemu/notify.h"
+#include "qapi/qapi-types-common.h"
 #include "hw/boards.h"
 #include "hw/isa/isa.h"
 #include "hw/block/fdc.h"
 #include "hw/block/flash.h"
-#include "net/net.h"
 #include "hw/i386/ioapic.h"
-
-#include "qemu/range.h"
-#include "qemu/bitmap.h"
-#include "qemu/module.h"
-#include "hw/pci/pci.h"
-#include "hw/mem/pc-dimm.h"
-#include "hw/mem/nvdimm.h"
 #include "hw/acpi/acpi_dev_interface.h"
+#include "hw/hotplug.h"
 
 #define HPET_INTCAP "hpet-intcap"
 
Signature · 7 lines
2.21.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 2/20
#3 lore raw

Re: [PATCH 02/20] hw/southbridge/ich9: Removed unused headers

In reply to Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé

The ICH9 chipset is not X86/PC specific.

These files don't use anything declared by the "hw/i386/pc.h" or "hw/i386/ioapic.h" headers. Remove them.

Quoted 46 lines
---
 hw/acpi/ich9.c         | 1 -
 hw/isa/lpc_ich9.c      | 2 --
 include/hw/i386/ich9.h | 1 -
 3 files changed, 4 deletions(-)
hw/acpi/ich9.c +0 -1
index 2034dd749e..fdd0a6c79e 100644
@@ -27,7 +27,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
hw/isa/lpc_ich9.c +0 -2
index 17c292e306..61cee2ae3a 100644
@@ -35,10 +35,8 @@
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
 #include "hw/irq.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/i386/ich9.h"
include/hw/i386/ich9.h +0 -1
index 72e803f6e2..a98d10b252 100644
@@ -5,7 +5,6 @@
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pcie_host.h"
 #include "hw/pci/pci_bridge.h"
Signature · 6 lines
—js

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on the v1 series
#24 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 55 lines · Philippe Mathieu-Daudé

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" hw/timer/hpet: Include "exec/address-spaces.h" hw/pci-host/q35: Include "qemu/range.h" hw/i2c/smbus_ich9: Include "qemu/range.h" hw/pci-host/piix: Include "qemu/range.h"
hw/acpi: Include "hw/mem/nvdimm.h"
hw/i386: Include "hw/mem/nvdimm.h"
hw/pci-host/q35: Remove unused includes
hw/i386/pc: Clean up includes

 hw/acpi/cpu_hotplug.c             |  1 +
 hw/acpi/ich9.c                    |  2 +-
 hw/acpi/piix4.c                   |  1 +
 hw/alpha/alpha_sys.h              |  1 -
 hw/alpha/dp264.c                  |  1 +
 hw/hppa/machine.c                 |  1 +
 hw/i2c/smbus_ich9.c               |  1 +
 hw/i386/acpi-build.c              |  1 +
 hw/i386/pc.c                      |  1 +
 hw/i386/pc_piix.c                 |  1 +
 hw/i386/pc_q35.c                  |  1 +
 hw/input/pckbd.c                  |  1 -
 hw/isa/lpc_ich9.c                 |  2 --
 hw/pci-host/piix.c                |  1 +
 hw/pci-host/q35.c                 |  1 +
 hw/timer/hpet.c                   |  2 +-
 hw/timer/twl92230.c               |  1 -
 hw/usb/dev-storage.c              |  1 -
Quoted 9 lines
 hw/xen/xen_pt_load_rom.c          |  4 ----
 include/hw/i386/ich9.h            |  1 -
 include/hw/i386/intel_iommu.h     |  4 ----
 include/hw/i386/ioapic_internal.h |  1 -
 include/hw/i386/pc.h              | 12 +++---------
 include/hw/pci-host/q35.h         |  8 +-------
 vl.c                              |  1 +
 25 files changed, 18 insertions(+), 34 deletions(-)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#25 lore raw
In reply to Philippe Mathieu-Daudé

Hi,

Quoted 28 lines · Philippe Mathieu-Daudé

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"

Quoted 8 lines

hw/timer/hpet: Include "exec/address-spaces.h"
hw/pci-host/q35: Include "qemu/range.h"
hw/i2c/smbus_ich9: Include "qemu/range.h"
hw/pci-host/piix: Include "qemu/range.h"
hw/acpi: Include "hw/mem/nvdimm.h"
hw/i386: Include "hw/mem/nvdimm.h"
hw/pci-host/q35: Remove unused includes
hw/i386/pc: Clean up includes

Laurent, since this series is fully reviewed, can it go via your qemu-trivial tree?

Thanks,

Phil.

#26 lore raw

Le 26/10/2019 à 14:20, Philippe Mathieu-Daudé a écrit :

Quoted 39 lines

Hi,

Quoted 28 lines · Philippe Mathieu-Daudé

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
   vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
   hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"

Quoted 8 lines

   hw/timer/hpet: Include "exec/address-spaces.h"
   hw/pci-host/q35: Include "qemu/range.h"
   hw/i2c/smbus_ich9: Include "qemu/range.h"
   hw/pci-host/piix: Include "qemu/range.h"
   hw/acpi: Include "hw/mem/nvdimm.h"
   hw/i386: Include "hw/mem/nvdimm.h"
   hw/pci-host/q35: Remove unused includes
   hw/i386/pc: Clean up includes

Quoted 2 lines

Laurent, since this series is fully reviewed, can it go via your qemu-trivial tree?

I'll try but I'm not sure to have the time to do that before the softfreeze.

Thanks,
Laurent

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#11 lore raw

Re: [PATCH 08/20] hw/xen/xen_pt_load_rom: Remove unused includes

In reply to Paul Durrant
Quoted 7 lines · Paul Durrant
Quoted 4 lines · Philippe Mathieu-Daudé

xen_pt_load_rom.c does not use any of these includes, remove them.

Hi,

I've added this patch to a pull requests for the xen.

Cheers,

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#27 lore raw
In reply to Laurent Vivier
Quoted 40 lines · Laurent Vivier

Le 26/10/2019 à 14:20, Philippe Mathieu-Daudé a écrit :

Quoted 39 lines

Hi,

Quoted 36 lines · Philippe Mathieu-Daudé

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
   vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
   hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" hw/timer/hpet: Include "exec/address-spaces.h" hw/pci-host/q35: Include "qemu/range.h" hw/i2c/smbus_ich9: Include "qemu/range.h" hw/pci-host/piix: Include "qemu/range.h"
   hw/acpi: Include "hw/mem/nvdimm.h"
   hw/i386: Include "hw/mem/nvdimm.h"
   hw/pci-host/q35: Remove unused includes
   hw/i386/pc: Clean up includes

Quoted 4 lines
Quoted 2 lines

Laurent, since this series is fully reviewed, can it go via your qemu-trivial tree?

I'll try but I'm not sure to have the time to do that before the softfreeze.

Ping :)

Paolo

#28 lore raw

Le 27/02/2020 à 14:28, Paolo Bonzini a écrit :

Quoted 41 lines · Laurent Vivier
Quoted 40 lines

Le 26/10/2019 à 14:20, Philippe Mathieu-Daudé a écrit :

Quoted 39 lines

Hi,

Quoted 36 lines · Philippe Mathieu-Daudé

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/[email protected]/msg635748.html

This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86 platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (20):
   vl: Add missing "hw/boards.h" include hw/southbridge/ich9: Removed unused headers hw/input/pckbd: Remove unused "hw/i386/pc.h" header hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header hw/timer: Remove unused "ui/console.h" header hw/usb/dev-storage: Remove unused "ui/console.h" header hw/i386/intel_iommu: Remove unused includes hw/xen/xen_pt_load_rom: Remove unused includes hw/alpha/alpha_sys: Remove unused "hw/ide.h" header hw/alpha/dp264: Include "net/net.h"
   hw/hppa/machine: Include "net/net.h" hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" hw/timer/hpet: Include "exec/address-spaces.h" hw/pci-host/q35: Include "qemu/range.h" hw/i2c/smbus_ich9: Include "qemu/range.h" hw/pci-host/piix: Include "qemu/range.h"
   hw/acpi: Include "hw/mem/nvdimm.h"
   hw/i386: Include "hw/mem/nvdimm.h"
   hw/pci-host/q35: Remove unused includes
   hw/i386/pc: Clean up includes

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Laurent, since this series is fully reviewed, can it go via your qemu-trivial tree?

I'll try but I'm not sure to have the time to do that before the softfreeze.

Ping :)

Applied v2 to my trivial-patches branch.

Thanks,
Laurent

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel