[Qemu-devel] [PATCH v4 00/14] Add Q35 base support

2012-11-14 Thread Jason Baron
Hi,

These patches are intened to give us a base set of patches for Q35 upon which
to build. The major change in this series is to add the memory controller hub,
or 'mch' as proper member of the q35 host structure. This change refactors the
code a bit, and moves more intialization out of pc_q35.c and into q35.c. We
probably could go further and introduce a generic north bridge class and make
the 'mch' a child of it, but I'm not proposing that kind of change this late in
the development cycle.

I've also dropped as many non-essential bits as possible, such as if=ahci from
the patch series. Patches 13-14 allow the use of the '-L' option to specify
the directory of the q35 dsdt table. These aren't strictly necessary. As one
could pass:

-bios /root/seabios/seabios/out/bios.bin
-acpitable file=/root/seabios/seabios/out/q35-acpi-dsdt.aml

But its rather cumbersome, and including the automatic load of the dsdt table,
is the future direction. That is, once the seabios bits are included we can
pull the q35 dsdt table into the qemu tree, and avoid extra options altogether.

Testing:

I've booted f16, f17, Windows7, Windows 8. (BSDs and Win xp work with a
piix3-ide controller). And Gabriel Somlo has reported success with Mac OS X.
I'm also going to look at writing qtest cases.

Thanks,

-Jason

Git trees:

git://github.com/jibaron/q35-qemu.git
git://github.com/jibaron/q35-seabios.git

Todo:

-add ahci migration back (need to cover more fields, but basically works)
-add ACPI hotplug support (pcie hotplug is currently working)
-add qtest test cases

Changes from v3:
 -Compose 'mch' as part of the q35 host strucuture
 -cleanup naming
 -drop if=ahci

Changes from v2:
 -Patch restructure (broke out ich9 chips + data structures separately)
 -added passthrough support
 -add support for -usb to fill out host pci bus
 -Dropped automatic load of dsdt table for piix
 -cleanups
 -dropped wmask on smbus (mst)
 -sparse host bus

Changes from v1:
 -Updated end of low mem from 0xe000 -> 0xb000 (Gerd Hoffmann)
-so 0xb00-0xc00 is memconfig
-0xc00-0xfec0 is 32-bit pci window
 -style/various cleanups
 -introduced IF_AHCI
 -introduced mach_if
 -split dsdt out of bios, now passed for piix4 as well (Paolo, Gerd)
 -Removed add opaque argument to pci_map_irq_fn (Michael S. Tsirkin)
 -removed patches that were merged in v1

Isaku Yamahata (3):
  pc, pc_piix: split out pc nic initialization
  pc/piix_pci: factor out smram/pam logic
  q35: Introduce q35 pc based chipset emulator

Jan Kiszka (3):
  q35: Suppress SMM BIOS initialization under KVM
  q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic
  q35: Add kvmclock support

Jason Baron (8):
  pc: Move ioapic_init() from pc_piix.c to pc.c
  pc_piix: Move kvm irq routing functions out of pc_piix.c
  ich9: Add acpi support and definitions
  ich9: Add the lpc chip
  ich9: Add smbus
  ich9: Add i82801b11 dmi-to-pci bridge
  Add a fallback bios file search, if -L fails.
  q35: automatically load the q35 dsdt table

 hw/Makefile.objs  |3 +
 hw/acpi_ich9.c|  322 ++
 hw/acpi_ich9.h|   47 +
 hw/i386/Makefile.objs |1 +
 hw/i82801b11.c|  125 
 hw/ich9.h |  207 +++
 hw/kvm/ioapic.c   |   40 
 hw/lpc_ich9.c |  525 +
 hw/pam.c  |   87 
 hw/pam.h  |   97 +
 hw/pc.c   |   58 ++
 hw/pc.h   |5 +
 hw/pc_piix.c  |   79 +---
 hw/pc_q35.c   |  230 +
 hw/pci_ids.h  |   14 ++
 hw/piix_pci.c |   68 ++-
 hw/q35.c  |  309 +
 hw/q35.h  |  150 ++
 hw/smbus_ich9.c   |  159 +++
 kvm.h |2 +
 vl.c  |   36 +++-
 21 files changed, 2425 insertions(+), 139 deletions(-)
 create mode 100644 hw/acpi_ich9.c
 create mode 100644 hw/acpi_ich9.h
 create mode 100644 hw/i82801b11.c
 create mode 100644 hw/ich9.h
 create mode 100644 hw/lpc_ich9.c
 create mode 100644 hw/pam.c
 create mode 100644 hw/pam.h
 create mode 100644 hw/pc_q35.c
 create mode 100644 hw/q35.c
 create mode 100644 hw/q35.h
 create mode 100644 hw/smbus_ich9.c




Re: [Qemu-devel] [PATCH v4 00/14] Add Q35 base support

2012-11-21 Thread Gerd Hoffmann
On 11/14/12 21:53, Jason Baron wrote:
> Hi,
> 
> These patches are intened to give us a base set of patches for Q35 upon which
> to build. The major change in this series is to add the memory controller hub,
> or 'mch' as proper member of the q35 host structure. This change refactors the
> code a bit, and moves more intialization out of pc_q35.c and into q35.c. We
> probably could go further and introduce a generic north bridge class and make
> the 'mch' a child of it, but I'm not proposing that kind of change this late 
> in
> the development cycle.

Tested the patches while hacking on q35 seabios support last days.

> I've also dropped as many non-essential bits as possible, such as if=ahci from
> the patch series. Patches 13-14 allow the use of the '-L' option to specify
> the directory of the q35 dsdt table. These aren't strictly necessary. As one
> could pass:
> 
> -bios /root/seabios/seabios/out/bios.bin
> -acpitable file=/root/seabios/seabios/out/q35-acpi-dsdt.aml
> 
> But its rather cumbersome, and including the automatic load of the dsdt table,
> is the future direction. That is, once the seabios bits are included we can
> pull the q35 dsdt table into the qemu tree, and avoid extra options 
> altogether.

I'd prefer to not include patches 13+14.

Patch 13 is not needed long-term for q35, it is just a temporary testing
convinience.  Having a search path instead of a single directory might
be a useful feature independent of q35 support, but I think for this we
should simply allow to explicitly specify a search path, i.e. something
like -L "/path/to/dir/one:/path/to/dir/two".

Patch 14 should wait until we've merged seabios with q35 support.  It
also needs to be fixed to allow overriding the acpi table via command
line, i.e. only automatically load the default dsdt in case no dsdt was
specified via -acpitable.

Patches 1-12 are fine (and they still apply to master).

cheers,
  Gerd




Re: [Qemu-devel] [PATCH v4 00/14] Add Q35 base support

2012-11-22 Thread Gerd Hoffmann
On 11/14/12 21:53, Jason Baron wrote:
> These patches are intened to give us a base set of patches for Q35 upon which
> to build. The major change in this series is to add the memory controller hub,
> or 'mch' as proper member of the q35 host structure. This change refactors the

Fails to build with all targets enabled:

[ ... ]

  LINK  alpha-softmmu/qemu-system-alpha
../hw/acpi_ich9.o: In function `ich9_pm_init':
acpi_ich9.c:(.text+0x5d): undefined reference to `acpi_pm_tmr_init'
acpi_ich9.c:(.text+0x65): undefined reference to `acpi_pm1_cnt_init'
acpi_ich9.c:(.text+0x72): undefined reference to `acpi_gpe_init'

[ ... ]

cheers,
  Gerd



Re: [Qemu-devel] [PATCH v4 00/14] Add Q35 base support

2012-11-22 Thread Jason Baron
On Thu, Nov 22, 2012 at 12:24:43PM +0100, Gerd Hoffmann wrote:
> > These patches are intened to give us a base set of patches for Q35 upon 
> > which
> > to build. The major change in this series is to add the memory controller 
> > hub,
> > or 'mch' as proper member of the q35 host structure. This change refactors 
> > the
> 
> Fails to build with all targets enabled:
> 
> [ ... ]
> 
>   LINK  alpha-softmmu/qemu-system-alpha
> ../hw/acpi_ich9.o: In function `ich9_pm_init':
> acpi_ich9.c:(.text+0x5d): undefined reference to `acpi_pm_tmr_init'
> acpi_ich9.c:(.text+0x65): undefined reference to `acpi_pm1_cnt_init'
> acpi_ich9.c:(.text+0x72): undefined reference to `acpi_gpe_init'
> 
> [ ... ]
> 
> cheers,
>   Gerd
> 

Adding the patch below fixes this:


diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 0e17fbe..6c4cf09 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,7 +28,7 @@ common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_PCKBD) += pckbd.o
 common-obj-$(CONFIG_FDC) += fdc.o
-common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
+common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o smbus_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 common-obj-$(CONFIG_DMA) += dma.o
 common-obj-$(CONFIG_I82374) += i82374.o
@@ -39,7 +39,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
 common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-y += fifo.o
 common-obj-y += pam.o
-common-obj-y += acpi_ich9.o smbus_ich9.o
 
 # PPC devices
 common-obj-$(CONFIG_PREP_PCI) += prep_pci.o



I've also re-posted patches 5 & 7, to reflect this update. Thanks for
pointing this out.

Thanks,

-Jason