Re: [PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259

2019-12-13 Thread Paolo Bonzini
On 13/12/19 10:43, Philippe Mathieu-Daudé wrote:
> 
> 
> The MicroVM series introduced changes that outdated my work, and since
> having MicroVM was more important that global cleanup, I didn't insist a
> that time. Now GSI and IOAPIC are more exposed so my previous work
> doesn't apply at all. Well, current code diverged.
> I'll need some time to figure out if it is worthwhile salvaging, so
> don't wait for that.

Can you just point me to it?  (Patchew URL)

Paolo




Re: [PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259

2019-12-13 Thread Philippe Mathieu-Daudé

On 12/12/19 9:05 PM, Paolo Bonzini wrote:
Il gio 12 dic 2019, 20:04 Philippe Mathieu-Daudé > ha scritto:


On 12/12/19 6:29 PM, Paolo Bonzini wrote:
 > Remove the need to include i386/pc.h to get to the i8259 functions.
 > This is enough to remove the inclusion of hw/i386/pc.h from all
non-x86
 > files.

Eh this is very similar to the patch I'v staged for 5.0, now than the
Malta/PC split got merged.


Ok, these patches are not urgent so I will just wait for yours to go in 
and rebase.


Oh, I don't want to delay your series, this was more of a "comment to 
self" while reviewing your.


The MicroVM series introduced changes that outdated my work, and since 
having MicroVM was more important that global cleanup, I didn't insist a 
that time. Now GSI and IOAPIC are more exposed so my previous work 
doesn't apply at all. Well, current code diverged.
I'll need some time to figure out if it is worthwhile salvaging, so 
don't wait for that.





Re: [PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259

2019-12-12 Thread Paolo Bonzini
Il gio 12 dic 2019, 20:04 Philippe Mathieu-Daudé  ha
scritto:

> On 12/12/19 6:29 PM, Paolo Bonzini wrote:
> > Remove the need to include i386/pc.h to get to the i8259 functions.
> > This is enough to remove the inclusion of hw/i386/pc.h from all non-x86
> > files.
>
> Eh this is very similar to the patch I'v staged for 5.0, now than the
> Malta/PC split got merged.
>

Ok, these patches are not urgent so I will just wait for yours to go in and
rebase.

Paolo


Re: [PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259

2019-12-12 Thread Philippe Mathieu-Daudé

On 12/12/19 6:29 PM, Paolo Bonzini wrote:

Remove the need to include i386/pc.h to get to the i8259 functions.
This is enough to remove the inclusion of hw/i386/pc.h from all non-x86
files.


Eh this is very similar to the patch I'v staged for 5.0, now than the 
Malta/PC split got merged.




Signed-off-by: Paolo Bonzini 
---
  hw/alpha/alpha_sys.h|  3 ++-
  hw/alpha/dp264.c|  1 +
  hw/hppa/hppa_sys.h  |  3 ++-
  hw/hppa/machine.c   |  1 +
  hw/i386/kvm/i8259.c |  1 +
  hw/i386/microvm.c   |  1 +
  hw/i386/pc.c|  1 +
  hw/i386/x86.c   |  1 +
  hw/input/pckbd.c|  1 -
  hw/intc/Kconfig |  2 ++
  hw/intc/apic.c  |  2 +-
  hw/intc/i8259.c |  2 +-
  hw/intc/i8259_common.c  |  2 +-
  hw/intc/ioapic.c|  3 ++-
  hw/isa/i82378.c |  2 +-
  hw/isa/lpc_ich9.c   |  1 -
  hw/isa/piix4.c  |  2 +-
  hw/mips/gt64xxx_pci.c   |  2 +-
  hw/mips/mips_fulong2e.c |  2 +-
  hw/mips/mips_jazz.c |  2 +-
  hw/mips/mips_r4k.c  |  2 +-
  hw/pci-host/bonito.c|  1 -
  hw/pci-host/prep.c  |  2 +-
  include/hw/i386/pc.h|  8 
  include/hw/intc/i8259.h | 12 
  include/hw/isa/i8259_internal.h |  2 +-
  target/i386/monitor.c   |  1 -
  27 files changed, 37 insertions(+), 26 deletions(-)
  create mode 100644 include/hw/intc/i8259.h


Can you setup QEMU scripts/git.orderfile?



diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index 4e127a6..95033d7 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -7,7 +7,8 @@
  #include "hw/pci/pci.h"
  #include "hw/pci/pci_host.h"
  #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
  
  
  PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4],

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 4320497..5ed9a5a 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -20,6 +20,7 @@
  #include "hw/timer/i8254.h"
  #include "hw/isa/superio.h"
  #include "hw/dma/i8257.h"
+#include "net/net.h"
  #include "qemu/cutils.h"
  
  #define MAX_IDE_BUS 2

diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h
index 43d25d2..4e50196 100644
--- a/hw/hppa/hppa_sys.h
+++ b/hw/hppa/hppa_sys.h
@@ -6,7 +6,8 @@
  #include "hw/pci/pci.h"
  #include "hw/pci/pci_host.h"
  #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
  
  #include "hppa_hardware.h"
  
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c

index b30aba6..5d0de26 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -19,6 +19,7 @@
  #include "hppa_sys.h"
  #include "qemu/units.h"
  #include "qapi/error.h"
+#include "net/net.h"
  #include "qemu/log.h"
  
  #define MAX_IDE_BUS 2

diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c
index d0c1b1d..e404fdc 100644
--- a/hw/i386/kvm/i8259.c
+++ b/hw/i386/kvm/i8259.c
@@ -12,6 +12,7 @@
  
  #include "qemu/osdep.h"

  #include "hw/isa/i8259_internal.h"
+#include "hw/intc/i8259.h"
  #include "qemu/module.h"
  #include "hw/i386/apic_internal.h"
  #include "hw/irq.h"
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index def37e6..2068319 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -34,6 +34,7 @@
  #include "hw/i386/x86.h"
  #include "hw/i386/pc.h"
  #include "target/i386/cpu.h"
+#include "hw/intc/i8259.h"
  #include "hw/timer/i8254.h"
  #include "hw/rtc/mc146818rtc.h"
  #include "hw/char/serial.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3d2c5d8..fdbd2bf 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -44,6 +44,7 @@
  #include "migration/vmstate.h"
  #include "multiboot.h"
  #include "hw/rtc/mc146818rtc.h"
+#include "hw/intc/i8259.h"
  #include "hw/dma/i8257.h"
  #include "hw/timer/i8254.h"
  #include "hw/input/i8042.h"
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 394edc2..3e4aee5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -39,6 +39,7 @@
  #include "target/i386/cpu.h"
  #include "hw/i386/topology.h"
  #include "hw/i386/fw_cfg.h"
+#include "hw/intc/i8259.h"
  
  #include "hw/acpi/cpu_hotplug.h"

  #include "hw/nmi.h"
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index f0acfd8..2f09f78 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -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"
diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
index 5347f84..10a680b 100644
--- a/hw/intc/Kconfig
+++ b/hw/intc/Kconfig
@@ -9,6 +9,7 @@ config PL190
  
  config IOAPIC

  bool
+select I8259
  
  config ARM_GIC

  bool
@@ -21,6 +22,7 @@ config OPENPIC
  config APIC
  bool
  select MSI_NONBROKEN
+select I8259
  
  config ARM_GIC_KVM

  bool

[PATCH v2 3/8] hw: replace hw/i386/pc.h with a header just for the i8259

2019-12-12 Thread Paolo Bonzini
Remove the need to include i386/pc.h to get to the i8259 functions.
This is enough to remove the inclusion of hw/i386/pc.h from all non-x86
files.

Signed-off-by: Paolo Bonzini 
---
 hw/alpha/alpha_sys.h|  3 ++-
 hw/alpha/dp264.c|  1 +
 hw/hppa/hppa_sys.h  |  3 ++-
 hw/hppa/machine.c   |  1 +
 hw/i386/kvm/i8259.c |  1 +
 hw/i386/microvm.c   |  1 +
 hw/i386/pc.c|  1 +
 hw/i386/x86.c   |  1 +
 hw/input/pckbd.c|  1 -
 hw/intc/Kconfig |  2 ++
 hw/intc/apic.c  |  2 +-
 hw/intc/i8259.c |  2 +-
 hw/intc/i8259_common.c  |  2 +-
 hw/intc/ioapic.c|  3 ++-
 hw/isa/i82378.c |  2 +-
 hw/isa/lpc_ich9.c   |  1 -
 hw/isa/piix4.c  |  2 +-
 hw/mips/gt64xxx_pci.c   |  2 +-
 hw/mips/mips_fulong2e.c |  2 +-
 hw/mips/mips_jazz.c |  2 +-
 hw/mips/mips_r4k.c  |  2 +-
 hw/pci-host/bonito.c|  1 -
 hw/pci-host/prep.c  |  2 +-
 include/hw/i386/pc.h|  8 
 include/hw/intc/i8259.h | 12 
 include/hw/isa/i8259_internal.h |  2 +-
 target/i386/monitor.c   |  1 -
 27 files changed, 37 insertions(+), 26 deletions(-)
 create mode 100644 include/hw/intc/i8259.h

diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index 4e127a6..95033d7 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -7,7 +7,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
 
 
 PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4],
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 4320497..5ed9a5a 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -20,6 +20,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
+#include "net/net.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h
index 43d25d2..4e50196 100644
--- a/hw/hppa/hppa_sys.h
+++ b/hw/hppa/hppa_sys.h
@@ -6,7 +6,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
 
 #include "hppa_hardware.h"
 
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index b30aba6..5d0de26 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -19,6 +19,7 @@
 #include "hppa_sys.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
+#include "net/net.h"
 #include "qemu/log.h"
 
 #define MAX_IDE_BUS 2
diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c
index d0c1b1d..e404fdc 100644
--- a/hw/i386/kvm/i8259.c
+++ b/hw/i386/kvm/i8259.c
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/i8259_internal.h"
+#include "hw/intc/i8259.h"
 #include "qemu/module.h"
 #include "hw/i386/apic_internal.h"
 #include "hw/irq.h"
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index def37e6..2068319 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -34,6 +34,7 @@
 #include "hw/i386/x86.h"
 #include "hw/i386/pc.h"
 #include "target/i386/cpu.h"
+#include "hw/intc/i8259.h"
 #include "hw/timer/i8254.h"
 #include "hw/rtc/mc146818rtc.h"
 #include "hw/char/serial.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3d2c5d8..fdbd2bf 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -44,6 +44,7 @@
 #include "migration/vmstate.h"
 #include "multiboot.h"
 #include "hw/rtc/mc146818rtc.h"
+#include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 394edc2..3e4aee5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -39,6 +39,7 @@
 #include "target/i386/cpu.h"
 #include "hw/i386/topology.h"
 #include "hw/i386/fw_cfg.h"
+#include "hw/intc/i8259.h"
 
 #include "hw/acpi/cpu_hotplug.h"
 #include "hw/nmi.h"
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index f0acfd8..2f09f78 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -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"
diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
index 5347f84..10a680b 100644
--- a/hw/intc/Kconfig
+++ b/hw/intc/Kconfig
@@ -9,6 +9,7 @@ config PL190
 
 config IOAPIC
 bool
+select I8259
 
 config ARM_GIC
 bool
@@ -21,6 +22,7 @@ config OPENPIC
 config APIC
 bool
 select MSI_NONBROKEN
+select I8259
 
 config ARM_GIC_KVM
 bool
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 2a74f7b..bd40467 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -22,10 +22,10 @@
 #include "hw/i386/apic_internal.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
+#include "hw/intc/i8259.h"
 #include "hw/pci/msi.h"
 #include