All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups
@ 2015-03-02 10:58 Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 01/26] balloon: call qdev_alias_all_properties for proxy dev in balloon class init Michael S. Tsirkin
                   ` (26 more replies)
  0 siblings, 27 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

Hello, Peter!

This should be the last big pull as we are entering hard freeze.

This is an update of my previous pull request from
http://mid.gmane.org/20150226165911.GA20287@redhat.com
  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream_rebased
as the tree was not rebased since, you can either do both pulls or
only this latest pull, result will be exactly the same.

Note: I only included here the extra 26 patches, on top of what was previously posted
http://mid.gmane.org/1424295164-4774-1-git-send-email-mst@redhat.com
if you merge PULL v2 first, you will see just these 26 patches.

I hope all this helps reduce the amount of noise rather
than increase it.

Note: these patches remove some generated files that we previously
compiled. Our build system doesn't handle this well for incremental
builds, resulting in build errors. This is not new, incremental
builds aren't 100% reliable. You can find and remove the
stale .d files from the removed sources, this will fix it -
for example, if you get an error about a missing ssdt-misc.dsl,
find and remove ssdt-misc.d in output directory.

The following changes since commit 11d39a131020cc5c54ff9bc86d3259f7d32bf849:

  Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20150218' into staging (2015-02-26 09:08:54 +0000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to e32dccddb0b1fa335bf251c155e907f9d47accfd:

  acpi-test-data: update after pci rewrite (2015-03-01 19:41:50 +0100)

----------------------------------------------------------------
pci, pc, virtio fixes and cleanups

Last pull for hard freeze.

A bunch of fixes all over the place.
All of ACPI refactoring has been merged.
Legacy pci commands have been dropped.

Additionally, this includes patches from soft-freeze
(which apparently haven't been merged yet):

a bunch of fixes all over the place
virtio header cleanup
initial patches from virtio-1.0 branch

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Cornelia Huck (3):
      virtio: cull virtio_bus_set_vdev_features
      virtio: feature bit manipulation helpers
      virtio: add feature checking helpers

Denis V. Lunev (1):
      balloon: call qdev_alias_all_properties for proxy dev in balloon class init

Igor Mammedov (59):
      acpi: move generic aml building helpers into dedictated file
      acpi: add build_append_namestring() helper
      acpi: drop min-bytes in build_package()
      pc: acpi-build: update linker on guest access
      pc: acpi-build: migrate RSDP table
      pc: acpi: use local var for accessing ACPI tables blob in acpi_build()
      acpi: introduce AML composer aml_append()
      acpi: add aml_scope() term
      pc: acpi-build: use aml_scope() for \_SB scope
      acpi: add aml_device() term
      acpi: add aml_method() term
      acpi: add aml_if() term
      acpi: add aml_name() & aml_name_decl() term
      acpi: add aml_int() term
      acpi: add aml_return() term
      acpi: add aml_arg() term
      acpi: add aml_store() term
      acpi: add aml_and() term
      acpi: add aml_notify() term
      acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers
      acpi: add aml_package() term
      pc: acpi-build: generate _S[345] packages dynamically
      acpi: add aml_buffer() term
      acpi: add aml_resource_template() helper
      acpi: add aml_io() helper
      acpi: include PkgLength size only when requested
      acpi: add aml_operation_region() term
      acpi: add aml_field() & aml_named_field() terms
      acpi: add aml_local() term
      acpi: add aml_string() term
      pc: acpi-build: generate pvpanic device description dynamically
      acpi: add aml_varpackage() term
      acpi: add aml_equal() term
      acpi: add aml_processor() term
      acpi: add aml_eisaid() term
      pc: acpi-build: drop template patching and CPU hotplug objects dynamically
      pc: acpi-build: create CPU hotplug IO region dynamically
      acpi: add aml_reserved_field() term
      pc: acpi-build: drop template patching and memory hotplug objects dynamically
      pc: acpi-build: create memory hotplug IO region dynamically
      acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms
      pc: pcihp: expose MMIO base and len as properties
      pc: acpi-build: reserve PCIHP MMIO resources
      pc: acpi-build: create PCI0._CRS dynamically
      pc: acpi: drop manual hole punching for PCI hotplug resources
      pc: acpi: drop manual hole punching for CPU hotplug resources
      pc: acpi: drop manual hole punching for GPE0 resources
      pc: acpi-build: drop remaining ssdt_misc template
      acpi: add acpi_irq_no_flags() term
      pc: export applesmc IO port/len
      pc: acpi-build: drop template patching and create Device(SMC) dynamically
      tests: ACPI test blobs update due to PCI0._CRS changes
      tests: bios-tables-test: add support for testing bridges
      tests: add ACPI blobs for qemu with bridge cases
      pc: acpi-build: simplify PCI bus tree generation
      tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation
      pc: acpi-build: drop template patching and create PCI bus tree dynamically
      pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs
      acpi: make build_*() routines static to aml-build.c

Markus Armbruster (13):
      pci: Convert core to realize
      pci: Permit incremental conversion of device models to realize
      pci: Trivial device model conversions to realize
      pcnet: pcnet_common_init() always returns 0, change to void
      pcnet: Convert to realize
      serial-pci: Convert to realize
      ide/ich: Convert to realize
      cirrus-vga: Convert to realize
      qxl: Convert to realize
      pci-assign: Convert to realize
      qdev: Don't exit when running into bad -global
      pci: Give a few helpers internal linkage
      pci-hotplug-old: Has been dead for five major releases, bury

Michael S. Tsirkin (33):
      acpi-build: fix memory leak with bridge hp off
      bios linker: validate pointer within table
      acpi: update RSDP on guest access
      exec: round up size on MR resize
      acpi-build: fix ACPI RAM management
      acpi: has_immutable_rsdp->!rsdp_in_ram
      acpi-build: simplify rsdp management for legacy
      scripts/update-linux-headers.sh: pull virtio hdrs
      include: import virtio headers from linux 4.0
      virtio: use standard virtio_ring.h
      virtio: use standard-headers
      virtio-balloon: use standard headers
      virtio-9p: use standard headers
      virtio-blk: switch to standard-headers
      virtio-net,tap: use standard-headers
      virtio-rng: use standard-headers
      virtio-scsi: use standard-headers
      virtio-serial: switch to standard-headers
      update-linux-headers: use standard-headers
      linux-headers: use standard-headers
      virtio-pci: use standard headers
      scripts: add arch specific standard-headers
      standard-headers: add s390 virtio headers
      s390: use standard headers
      acpi-build: skip hotplugged bridges
      update-linux-headers.sh: s/__inline__/inline/
      virtio-serial-bus.c: drop virtio_ids.h
      standard-headers: include stdint.h
      virtio_ring.h: s/__inline__/inline/
      acpi: update generated hex files
      acpi: drop unused generated files
      acpi-test: update expected files
      acpi-test-data: update after pci rewrite

Peter Krempa (2):
      vl.c: Fix error messages when parsing maxmem parameters
      pc: memory: Validate alignment of maxram_size to page size

Stefan Berger (5):
      tpm: Extend sts register to 32 bit
      tpm: Allow 32 & 16 bit accesses to the registers
      tpm: Support for XFIFO register
      tpm: Support for TIS selftest done flag
      tpm: Support for capability flags of TIS 1.3

Tang Chen (6):
      acpi, pc: Add hotunplug request cb for pc machine.
      acpi, ich9: Add hotunplug request cb for ich9.
      acpi, pc: Add unplug cb for pc machine.
      acpi, ich9: Add unplug cb for ich9.
      acpi, piix4: Add unplug cb for piix4.
      acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

 hw/9pfs/virtio-9p.h                                |   18 +-
 hw/net/pcnet.h                                     |    2 +-
 hw/s390x/s390-virtio-bus.h                         |   36 +-
 hw/s390x/s390-virtio.h                             |    7 +-
 hw/tpm/tpm_int.h                                   |    1 +
 hw/tpm/tpm_tis.h                                   |    2 +-
 include/hw/acpi/aml-build.h                        |  191 ++++
 include/hw/acpi/ich9.h                             |    4 +
 include/hw/acpi/pc-hotplug.h                       |    1 +
 include/hw/acpi/pcihp.h                            |    7 +-
 include/hw/i386/pc.h                               |    1 +
 include/hw/isa/isa.h                               |   11 +-
 include/hw/pci/pci.h                               |   10 +-
 include/hw/qdev-properties.h                       |    4 +-
 include/hw/virtio/dataplane/vring-accessors.h      |    2 +-
 include/hw/virtio/dataplane/vring.h                |    2 +-
 include/hw/virtio/virtio-balloon.h                 |   35 +-
 include/hw/virtio/virtio-blk.h                     |   77 +-
 include/hw/virtio/virtio-bus.h                     |    3 -
 include/hw/virtio/virtio-net.h                     |  151 +--
 include/hw/virtio/virtio-rng.h                     |    4 +-
 include/hw/virtio/virtio-scsi.h                    |  120 +-
 include/hw/virtio/virtio-serial.h                  |   40 +-
 include/hw/virtio/virtio.h                         |   71 +-
 include/net/tap.h                                  |   24 +-
 include/standard-headers/asm-s390/kvm_virtio.h     |   64 ++
 include/standard-headers/asm-s390/virtio-ccw.h     |   21 +
 include/standard-headers/linux/if_ether.h          |    1 +
 include/standard-headers/linux/types.h             |    2 +
 include/standard-headers/linux/virtio_9p.h         |   44 +
 include/standard-headers/linux/virtio_balloon.h    |   59 +
 include/standard-headers/linux/virtio_blk.h        |  143 +++
 include/standard-headers/linux/virtio_config.h     |   64 ++
 include/standard-headers/linux/virtio_console.h    |   78 ++
 include/standard-headers/linux/virtio_ids.h        |   43 +
 include/standard-headers/linux/virtio_net.h        |  233 ++++
 include/standard-headers/linux/virtio_pci.h        |  193 ++++
 .../linux}/virtio_ring.h                           |  132 +--
 include/standard-headers/linux/virtio_rng.h        |    8 +
 include/standard-headers/linux/virtio_scsi.h       |  164 +++
 include/standard-headers/linux/virtio_types.h      |   46 +
 include/sysemu/blockdev.h                          |    2 -
 include/sysemu/sysemu.h                            |    5 -
 include/sysemu/tpm_backend.h                       |    2 +-
 linux-headers/linux/virtio_config.h                |   58 +-
 linux-headers/linux/virtio_ring.h                  |  164 +--
 device-hotplug.c                                   |    7 +-
 exec.c                                             |    2 +
 hw/9pfs/virtio-9p-device.c                         |    2 +-
 hw/acpi/aml-build.c                                |  888 +++++++++++++++
 hw/acpi/bios-linker-loader.c                       |    4 +-
 hw/acpi/ich9.c                                     |   14 +
 hw/acpi/memory_hotplug.c                           |    3 +-
 hw/acpi/pcihp.c                                    |   18 +-
 hw/acpi/piix4.c                                    |   15 +-
 hw/audio/ac97.c                                    |    5 +-
 hw/audio/es1370.c                                  |    5 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/block/virtio-blk.c                              |   31 +-
 hw/char/serial-pci.c                               |   22 +-
 hw/char/virtio-serial-bus.c                        |    4 +-
 hw/core/qdev-properties.c                          |   21 +-
 hw/core/qdev.c                                     |    8 +-
 hw/display/cirrus_vga.c                            |   11 +-
 hw/display/qxl.c                                   |   36 +-
 hw/display/vga-pci.c                               |   11 +-
 hw/display/vmware_vga.c                            |    6 +-
 hw/i2c/smbus_ich9.c                                |    5 +-
 hw/i386/acpi-build.c                               | 1179 +++++++++-----------
 hw/i386/kvm/pci-assign.c                           |   10 +-
 hw/i386/pc.c                                       |   23 +
 hw/i386/pc_piix.c                                  |    3 +
 hw/i386/pc_q35.c                                   |    3 +
 hw/ide/cmd646.c                                    |    5 +-
 hw/ide/ich.c                                       |   13 +-
 hw/ide/piix.c                                      |   10 +-
 hw/ide/via.c                                       |    6 +-
 hw/ipack/tpci200.c                                 |    6 +-
 hw/isa/i82378.c                                    |    6 +-
 hw/isa/lpc_ich9.c                                  |   14 +-
 hw/isa/piix4.c                                     |    5 +-
 hw/isa/vt82c686.c                                  |   24 +-
 hw/misc/applesmc.c                                 |    5 +-
 hw/misc/pci-testdev.c                              |    6 +-
 hw/net/e1000.c                                     |    6 +-
 hw/net/eepro100.c                                  |    6 +-
 hw/net/lance.c                                     |    3 +-
 hw/net/ne2000.c                                    |    6 +-
 hw/net/pcnet-pci.c                                 |    6 +-
 hw/net/pcnet.c                                     |    4 +-
 hw/net/rtl8139.c                                   |    6 +-
 hw/net/vhost_net.c                                 |    2 +-
 hw/net/virtio-net.c                                |   57 +-
 hw/net/vmxnet3.c                                   |    6 +-
 hw/pci-bridge/dec.c                                |    5 +-
 hw/pci-host/apb.c                                  |    5 +-
 hw/pci-host/bonito.c                               |    6 +-
 hw/pci-host/grackle.c                              |    5 +-
 hw/pci-host/piix.c                                 |   12 +-
 hw/pci-host/ppce500.c                              |    6 +-
 hw/pci-host/prep.c                                 |    6 +-
 hw/pci-host/q35.c                                  |    5 +-
 hw/pci-host/uninorth.c                             |   20 +-
 hw/pci-host/versatile.c                            |    5 +-
 hw/pci/pci-hotplug-old.c                           |  342 ------
 hw/pci/pci.c                                       |  127 ++-
 hw/s390x/virtio-ccw.c                              |   12 +-
 hw/scsi/virtio-scsi.c                              |    9 +-
 hw/sd/sdhci.c                                      |    5 +-
 hw/tpm/tpm_passthrough.c                           |   37 +-
 hw/tpm/tpm_tis.c                                   |  131 ++-
 hw/usb/hcd-ehci-pci.c                              |    6 +-
 hw/usb/hcd-xhci.c                                  |    6 +-
 hw/virtio/dataplane/vring.c                        |   10 +-
 hw/virtio/virtio-balloon.c                         |    2 +-
 hw/virtio/virtio-bus.c                             |   14 -
 hw/virtio/virtio-mmio.c                            |    2 +-
 hw/virtio/virtio-pci.c                             |   63 +-
 hw/virtio/virtio.c                                 |   33 +-
 hw/watchdog/wdt_i6300esb.c                         |    6 +-
 stubs/pci-drive-hot-add.c                          |   10 -
 tests/bios-tables-test.c                           |   45 +-
 vl.c                                               |   34 +-
 default-configs/i386-softmmu.mak                   |    1 -
 default-configs/x86_64-softmmu.mak                 |    1 -
 hmp-commands.hx                                    |   32 -
 hw/acpi/Makefile.objs                              |    1 +
 hw/i386/Makefile.objs                              |    4 +-
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |   17 +-
 hw/i386/acpi-dsdt-isa.dsl                          |   11 -
 hw/i386/acpi-dsdt-mem-hotplug.dsl                  |   36 +-
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 --
 hw/i386/acpi-dsdt.dsl                              |   46 -
 hw/i386/acpi-dsdt.hex.generated                    |  224 +---
 hw/i386/q35-acpi-dsdt.dsl                          |   19 -
 hw/i386/q35-acpi-dsdt.hex.generated                |  224 +---
 hw/i386/ssdt-mem.dsl                               |   77 --
 hw/i386/ssdt-mem.hex.generated                     |  213 ----
 hw/i386/ssdt-misc.dsl                              |  122 --
 hw/i386/ssdt-misc.hex.generated                    |  399 -------
 hw/i386/ssdt-pcihp.dsl                             |  100 --
 hw/i386/ssdt-pcihp.hex.generated                   |  251 -----
 hw/i386/ssdt-proc.dsl                              |   63 --
 hw/i386/ssdt-proc.hex.generated                    |  134 ---
 hw/pci/Makefile.objs                               |    2 -
 scripts/update-linux-headers.sh                    |   52 +-
 stubs/Makefile.objs                                |    1 -
 tests/acpi-test-data/pc/DSDT                       |  Bin 3621 -> 2970 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 2279 -> 2476 bytes
 tests/acpi-test-data/pc/SSDT.bridge                |  Bin 0 -> 4335 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 8211 -> 7608 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 560 -> 681 bytes
 tests/acpi-test-data/q35/SSDT.bridge               |  Bin 0 -> 698 bytes
 153 files changed, 3576 insertions(+), 4409 deletions(-)
 create mode 100644 include/hw/acpi/aml-build.h
 create mode 100644 include/standard-headers/asm-s390/kvm_virtio.h
 create mode 100644 include/standard-headers/asm-s390/virtio-ccw.h
 create mode 100644 include/standard-headers/linux/if_ether.h
 create mode 100644 include/standard-headers/linux/types.h
 create mode 100644 include/standard-headers/linux/virtio_9p.h
 create mode 100644 include/standard-headers/linux/virtio_balloon.h
 create mode 100644 include/standard-headers/linux/virtio_blk.h
 create mode 100644 include/standard-headers/linux/virtio_config.h
 create mode 100644 include/standard-headers/linux/virtio_console.h
 create mode 100644 include/standard-headers/linux/virtio_ids.h
 create mode 100644 include/standard-headers/linux/virtio_net.h
 create mode 100644 include/standard-headers/linux/virtio_pci.h
 rename include/{hw/virtio => standard-headers/linux}/virtio_ring.h (61%)
 create mode 100644 include/standard-headers/linux/virtio_rng.h
 create mode 100644 include/standard-headers/linux/virtio_scsi.h
 create mode 100644 include/standard-headers/linux/virtio_types.h
 create mode 100644 hw/acpi/aml-build.c
 delete mode 100644 hw/pci/pci-hotplug-old.c
 delete mode 100644 stubs/pci-drive-hot-add.c
 delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl
 delete mode 100644 hw/i386/ssdt-mem.dsl
 delete mode 100644 hw/i386/ssdt-mem.hex.generated
 delete mode 100644 hw/i386/ssdt-misc.dsl
 delete mode 100644 hw/i386/ssdt-misc.hex.generated
 delete mode 100644 hw/i386/ssdt-pcihp.dsl
 delete mode 100644 hw/i386/ssdt-pcihp.hex.generated
 delete mode 100644 hw/i386/ssdt-proc.dsl
 delete mode 100644 hw/i386/ssdt-proc.hex.generated
 create mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/SSDT.bridge

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

* [Qemu-devel] [PULL v3 01/26] balloon: call qdev_alias_all_properties for proxy dev in balloon class init
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 02/26] tpm: Extend sts register to 32 bit Michael S. Tsirkin
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Anthony Liguori, Alexander Graf,
	Christian Borntraeger, Raushaniya Maksudova, Cornelia Huck,
	Denis V. Lunev, Richard Henderson

From: "Denis V. Lunev" <den@openvz.org>

The idea is that all other virtio devices are calling this helper
to merge properties of the proxy device. This is the only difference
in between this helper and code in inside virtio_instance_init_common.
The patch should not cause any harm as property list in generic balloon
code is empty.

This also allows to avoid some dummy errors like fixed by this
    commit 91ba21208839643603e7f7fa5864723c3f371ebe
    Author: Gonglei <arei.gonglei@huawei.com>
    Date:   Tue Sep 30 14:10:35 2014 +0800
    virtio-balloon: fix virtio-balloon child refcount in transports

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Raushaniya Maksudova <rmaksudova@parallels.com>
Revieved-by: Cornelia Huck <cornelia.huck@de.ibm.com>
CC: Christian Borntraeger <borntraeger@de.ibm.com>
CC: Anthony Liguori <aliguori@amazon.com>
CC: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw.c  | 5 ++---
 hw/virtio/virtio-pci.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 3fee4aa..ffbb9c2 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -898,9 +898,8 @@ static void balloon_ccw_stats_set_poll_interval(Object *obj, struct Visitor *v,
 static void virtio_ccw_balloon_instance_init(Object *obj)
 {
     VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj);
-    object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
-    object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-    object_unref(OBJECT(&dev->vdev));
+    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+                                TYPE_VIRTIO_BALLOON);
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_ccw_stats_get_all, NULL, NULL, dev, NULL);
 
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6dd41b9..e7baf7b 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1274,9 +1274,8 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)
 static void virtio_balloon_pci_instance_init(Object *obj)
 {
     VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(obj);
-    object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
-    object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-    object_unref(OBJECT(&dev->vdev));
+    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+                                TYPE_VIRTIO_BALLOON);
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_pci_stats_get_all, NULL, NULL, dev,
                         NULL);
-- 
MST

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

* [Qemu-devel] [PULL v3 02/26] tpm: Extend sts register to 32 bit
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 01/26] balloon: call qdev_alias_all_properties for proxy dev in balloon class init Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 03/26] tpm: Allow 32 & 16 bit accesses to the registers Michael S. Tsirkin
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Stefan Berger

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

More recent TIS specs extend the STS register to 32 bit. While
we don't store the TIS interface state, yet, we can extend it
without sideeffects.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_tis.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h
index 1a0db23..db78d51 100644
--- a/hw/tpm/tpm_tis.h
+++ b/hw/tpm/tpm_tis.h
@@ -41,7 +41,7 @@ typedef enum {
 typedef struct TPMLocality {
     TPMTISState state;
     uint8_t access;
-    uint8_t sts;
+    uint32_t sts;
     uint32_t inte;
     uint32_t ints;
 
-- 
MST

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

* [Qemu-devel] [PULL v3 03/26] tpm: Allow 32 & 16 bit accesses to the registers
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 01/26] balloon: call qdev_alias_all_properties for proxy dev in balloon class init Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 02/26] tpm: Extend sts register to 32 bit Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 04/26] tpm: Support for XFIFO register Michael S. Tsirkin
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter Crosthwaite, Stefan Berger, Max Reitz,
	Anthony Liguori, Paolo Bonzini

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Improve the access to the registers with 32 and 16 bit reads and writes.
Also enable access to a non-base register address, such as reads of the
2nd byte of a register. Map the FIFO byte access to any byte within
its 4 byte register (following specs).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_tis.c | 60 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 47 insertions(+), 13 deletions(-)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index c0e7cd7..6170693 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -427,6 +427,7 @@ static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr,
     uint32_t val = 0xffffffff;
     uint8_t locty = tpm_tis_locality_from_addr(addr);
     uint32_t avail;
+    uint8_t v;
 
     if (tpm_backend_had_startup_error(s->be_driver)) {
         return val;
@@ -476,14 +477,26 @@ static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr,
         break;
     case TPM_TIS_REG_DATA_FIFO:
         if (tis->active_locty == locty) {
-            switch (tis->loc[locty].state) {
-            case TPM_TIS_STATE_COMPLETION:
-                val = tpm_tis_data_read(s, locty);
-                break;
-            default:
-                val = TPM_TIS_NO_DATA_BYTE;
-                break;
+            if (size > 4 - (addr & 0x3)) {
+                /* prevent access beyond FIFO */
+                size = 4 - (addr & 0x3);
+            }
+            val = 0;
+            shift = 0;
+            while (size > 0) {
+                switch (tis->loc[locty].state) {
+                case TPM_TIS_STATE_COMPLETION:
+                    v = tpm_tis_data_read(s, locty);
+                    break;
+                default:
+                    v = TPM_TIS_NO_DATA_BYTE;
+                    break;
+                }
+                val |= (v << shift);
+                shift += 8;
+                size--;
             }
+            shift = 0; /* no more adjustments */
         }
         break;
     case TPM_TIS_REG_DID_VID:
@@ -518,11 +531,13 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
 {
     TPMState *s = opaque;
     TPMTISEmuState *tis = &s->s.tis;
-    uint16_t off = addr & 0xfff;
+    uint16_t off = addr & 0xffc;
+    uint8_t shift = (addr & 0x3) * 8;
     uint8_t locty = tpm_tis_locality_from_addr(addr);
     uint8_t active_locty, l;
     int c, set_new_locty = 1;
     uint16_t len;
+    uint32_t mask = (size == 1) ? 0xff : ((size == 2) ? 0xffff : ~0);
 
     DPRINTF("tpm_tis: write.%u(%08x) = %08x\n", size, (int)addr, (uint32_t)val);
 
@@ -535,6 +550,15 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
         return;
     }
 
+    val &= mask;
+
+    if (shift) {
+        val <<= shift;
+        mask <<= shift;
+    }
+
+    mask ^= 0xffffffff;
+
     switch (off) {
     case TPM_TIS_REG_ACCESS:
 
@@ -646,9 +670,10 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
             break;
         }
 
-        tis->loc[locty].inte = (val & (TPM_TIS_INT_ENABLED |
-                                       TPM_TIS_INT_POLARITY_MASK |
-                                       TPM_TIS_INTERRUPTS_SUPPORTED));
+        tis->loc[locty].inte &= mask;
+        tis->loc[locty].inte |= (val & (TPM_TIS_INT_ENABLED |
+                                        TPM_TIS_INT_POLARITY_MASK |
+                                        TPM_TIS_INTERRUPTS_SUPPORTED));
         break;
     case TPM_TIS_REG_INT_VECTOR:
         /* hard wired -- ignore */
@@ -747,16 +772,25 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
             tis->loc[locty].state == TPM_TIS_STATE_COMPLETION) {
             /* drop the byte */
         } else {
-            DPRINTF("tpm_tis: Byte to send to TPM: %02x\n", (uint8_t)val);
+            DPRINTF("tpm_tis: Data to send to TPM: %08x (size=%d)\n",
+                    val, size);
             if (tis->loc[locty].state == TPM_TIS_STATE_READY) {
                 tis->loc[locty].state = TPM_TIS_STATE_RECEPTION;
                 tis->loc[locty].sts = TPM_TIS_STS_EXPECT | TPM_TIS_STS_VALID;
             }
 
-            if ((tis->loc[locty].sts & TPM_TIS_STS_EXPECT)) {
+            val >>= shift;
+            if (size > 4 - (addr & 0x3)) {
+                /* prevent access beyond FIFO */
+                size = 4 - (addr & 0x3);
+            }
+
+            while ((tis->loc[locty].sts & TPM_TIS_STS_EXPECT) && size > 0) {
                 if (tis->loc[locty].w_offset < tis->loc[locty].w_buffer.size) {
                     tis->loc[locty].w_buffer.
                         buffer[tis->loc[locty].w_offset++] = (uint8_t)val;
+                    val >>= 8;
+                    size--;
                 } else {
                     tis->loc[locty].sts = TPM_TIS_STS_VALID;
                 }
-- 
MST

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

* [Qemu-devel] [PULL v3 04/26] tpm: Support for XFIFO register
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 03/26] tpm: Allow 32 & 16 bit accesses to the registers Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 05/26] tpm: Support for TIS selftest done flag Michael S. Tsirkin
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter Crosthwaite, Stefan Berger, Max Reitz,
	Anthony Liguori, Paolo Bonzini

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Support for the XFIFO register (range) of the TIS 1.3 specification.
We support a range of 64 bytes.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_tis.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 6170693..a37c7ce 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -51,6 +51,8 @@
 #define TPM_TIS_REG_INTF_CAPABILITY       0x14
 #define TPM_TIS_REG_STS                   0x18
 #define TPM_TIS_REG_DATA_FIFO             0x24
+#define TPM_TIS_REG_DATA_XFIFO            0x80
+#define TPM_TIS_REG_DATA_XFIFO_END        0xbc
 #define TPM_TIS_REG_DID_VID               0xf00
 #define TPM_TIS_REG_RID                   0xf04
 
@@ -476,6 +478,7 @@ static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr,
         }
         break;
     case TPM_TIS_REG_DATA_FIFO:
+    case TPM_TIS_REG_DATA_XFIFO ... TPM_TIS_REG_DATA_XFIFO_END:
         if (tis->active_locty == locty) {
             if (size > 4 - (addr & 0x3)) {
                 /* prevent access beyond FIFO */
@@ -762,6 +765,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
         }
         break;
     case TPM_TIS_REG_DATA_FIFO:
+    case TPM_TIS_REG_DATA_XFIFO ... TPM_TIS_REG_DATA_XFIFO_END:
         /* data fifo */
         if (tis->active_locty != locty) {
             break;
-- 
MST

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

* [Qemu-devel] [PULL v3 05/26] tpm: Support for TIS selftest done flag
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (3 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 04/26] tpm: Support for XFIFO register Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 06/26] tpm: Support for capability flags of TIS 1.3 Michael S. Tsirkin
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter Crosthwaite, Fam Zheng, Stefan Berger,
	Michael Tokarev, Markus Armbruster, Anthony Liguori,
	Paolo Bonzini

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Extend the backend to check whether the TPM_ContinueSelfTest
finished successfully and provide a flag to the TIS front-end
if it successfully finished. The TIS then sets a flag in
all localities in the STS register and keeps it until the next
reset.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_int.h             |  1 +
 include/sysemu/tpm_backend.h |  2 +-
 hw/tpm/tpm_passthrough.c     | 37 ++++++++++++++++++++++++----
 hw/tpm/tpm_tis.c             | 58 ++++++++++++++++++++++++++++++++++----------
 4 files changed, 79 insertions(+), 19 deletions(-)

diff --git a/hw/tpm/tpm_int.h b/hw/tpm/tpm_int.h
index 2f582ca..2b35fe2 100644
--- a/hw/tpm/tpm_int.h
+++ b/hw/tpm/tpm_int.h
@@ -62,6 +62,7 @@ struct tpm_resp_hdr {
 
 #define TPM_FAIL                  9
 
+#define TPM_ORD_ContinueSelfTest  0x53
 #define TPM_ORD_GetTicks          0xf1
 
 #endif /* TPM_TPM_INT_H */
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index 825f33b..540ee25 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -56,7 +56,7 @@ struct TPMBackend {
     QLIST_ENTRY(TPMBackend) list;
 };
 
-typedef void (TPMRecvDataCB)(TPMState *, uint8_t locty);
+typedef void (TPMRecvDataCB)(TPMState *, uint8_t locty, bool selftest_done);
 
 typedef struct TPMSizedBuffer {
     uint32_t size;
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 2bf3c6f..a94c7c5 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -112,14 +112,31 @@ static void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len)
     }
 }
 
+static bool tpm_passthrough_is_selftest(const uint8_t *in, uint32_t in_len)
+{
+    struct tpm_req_hdr *hdr = (struct tpm_req_hdr *)in;
+
+    if (in_len >= sizeof(*hdr)) {
+        return (be32_to_cpu(hdr->ordinal) == TPM_ORD_ContinueSelfTest);
+    }
+
+    return false;
+}
+
 static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
                                         const uint8_t *in, uint32_t in_len,
-                                        uint8_t *out, uint32_t out_len)
+                                        uint8_t *out, uint32_t out_len,
+                                        bool *selftest_done)
 {
     int ret;
+    bool is_selftest;
+    const struct tpm_resp_hdr *hdr;
 
     tpm_pt->tpm_op_canceled = false;
     tpm_pt->tpm_executing = true;
+    *selftest_done = false;
+
+    is_selftest = tpm_passthrough_is_selftest(in, in_len);
 
     ret = tpm_passthrough_unix_write(tpm_pt->tpm_fd, in, in_len);
     if (ret != in_len) {
@@ -149,6 +166,11 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
                      "packet from TPM\n");
     }
 
+    if (is_selftest && (ret >= sizeof(struct tpm_resp_hdr))) {
+        hdr = (struct tpm_resp_hdr *)out;
+        *selftest_done = (be32_to_cpu(hdr->errcode) == 0);
+    }
+
 err_exit:
     if (ret < 0) {
         tpm_write_fatal_error_response(out, out_len);
@@ -160,13 +182,15 @@ err_exit:
 }
 
 static int tpm_passthrough_unix_transfer(TPMPassthruState *tpm_pt,
-                                         const TPMLocality *locty_data)
+                                         const TPMLocality *locty_data,
+                                         bool *selftest_done)
 {
     return tpm_passthrough_unix_tx_bufs(tpm_pt,
                                         locty_data->w_buffer.buffer,
                                         locty_data->w_offset,
                                         locty_data->r_buffer.buffer,
-                                        locty_data->r_buffer.size);
+                                        locty_data->r_buffer.size,
+                                        selftest_done);
 }
 
 static void tpm_passthrough_worker_thread(gpointer data,
@@ -175,16 +199,19 @@ static void tpm_passthrough_worker_thread(gpointer data,
     TPMPassthruThreadParams *thr_parms = user_data;
     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(thr_parms->tb);
     TPMBackendCmd cmd = (TPMBackendCmd)data;
+    bool selftest_done = false;
 
     DPRINTF("tpm_passthrough: processing command type %d\n", cmd);
 
     switch (cmd) {
     case TPM_BACKEND_CMD_PROCESS_CMD:
         tpm_passthrough_unix_transfer(tpm_pt,
-                                      thr_parms->tpm_state->locty_data);
+                                      thr_parms->tpm_state->locty_data,
+                                      &selftest_done);
 
         thr_parms->recv_data_callback(thr_parms->tpm_state,
-                                      thr_parms->tpm_state->locty_number);
+                                      thr_parms->tpm_state->locty_number,
+                                      selftest_done);
         break;
     case TPM_BACKEND_CMD_INIT:
     case TPM_BACKEND_CMD_END:
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index a37c7ce..61186c5 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -64,6 +64,7 @@
 #define TPM_TIS_STS_TPM_GO                (1 << 5)
 #define TPM_TIS_STS_DATA_AVAILABLE        (1 << 4)
 #define TPM_TIS_STS_EXPECT                (1 << 3)
+#define TPM_TIS_STS_SELFTEST_DONE         (1 << 2)
 #define TPM_TIS_STS_RESPONSE_RETRY        (1 << 1)
 
 #define TPM_TIS_BURST_COUNT_SHIFT         8
@@ -147,6 +148,24 @@ static void tpm_tis_show_buffer(const TPMSizedBuffer *sb, const char *string)
 }
 
 /*
+ * Set the given flags in the STS register by clearing the register but
+ * preserving the SELFTEST_DONE flag and then setting the new flags.
+ *
+ * The SELFTEST_DONE flag is acquired from the backend that determines it by
+ * peeking into TPM commands.
+ *
+ * A VM suspend/resume will preserve the flag by storing it into the VM
+ * device state, but the backend will not remember it when QEMU is started
+ * again. Therefore, we cache the flag here. Once set, it will not be unset
+ * except by a reset.
+ */
+static void tpm_tis_sts_set(TPMLocality *l, uint32_t flags)
+{
+    l->sts &= TPM_TIS_STS_SELFTEST_DONE;
+    l->sts |= flags;
+}
+
+/*
  * Send a request to the TPM.
  */
 static void tpm_tis_tpm_send(TPMState *s, uint8_t locty)
@@ -257,7 +276,8 @@ static void tpm_tis_abort(TPMState *s, uint8_t locty)
      */
     if (tis->aborting_locty == tis->next_locty) {
         tis->loc[tis->aborting_locty].state = TPM_TIS_STATE_READY;
-        tis->loc[tis->aborting_locty].sts = TPM_TIS_STS_COMMAND_READY;
+        tpm_tis_sts_set(&tis->loc[tis->aborting_locty],
+                        TPM_TIS_STS_COMMAND_READY);
         tpm_tis_raise_irq(s, tis->aborting_locty, TPM_TIS_INT_COMMAND_READY);
     }
 
@@ -302,7 +322,8 @@ static void tpm_tis_receive_bh(void *opaque)
     TPMTISEmuState *tis = &s->s.tis;
     uint8_t locty = s->locty_number;
 
-    tis->loc[locty].sts = TPM_TIS_STS_VALID | TPM_TIS_STS_DATA_AVAILABLE;
+    tpm_tis_sts_set(&tis->loc[locty],
+                    TPM_TIS_STS_VALID | TPM_TIS_STS_DATA_AVAILABLE);
     tis->loc[locty].state = TPM_TIS_STATE_COMPLETION;
     tis->loc[locty].r_offset = 0;
     tis->loc[locty].w_offset = 0;
@@ -322,12 +343,20 @@ static void tpm_tis_receive_bh(void *opaque)
 /*
  * Callback from the TPM to indicate that the response was received.
  */
-static void tpm_tis_receive_cb(TPMState *s, uint8_t locty)
+static void tpm_tis_receive_cb(TPMState *s, uint8_t locty,
+                               bool is_selftest_done)
 {
     TPMTISEmuState *tis = &s->s.tis;
+    uint8_t l;
 
     assert(s->locty_number == locty);
 
+    if (is_selftest_done) {
+        for (l = 0; l < TPM_TIS_NUM_LOCALITIES; l++) {
+            tis->loc[locty].sts |= TPM_TIS_STS_SELFTEST_DONE;
+        }
+    }
+
     qemu_bh_schedule(tis->bh);
 }
 
@@ -346,7 +375,7 @@ static uint32_t tpm_tis_data_read(TPMState *s, uint8_t locty)
         ret = tis->loc[locty].r_buffer.buffer[tis->loc[locty].r_offset++];
         if (tis->loc[locty].r_offset >= len) {
             /* got last byte */
-            tis->loc[locty].sts = TPM_TIS_STS_VALID;
+            tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
 #ifdef RAISE_STS_IRQ
             tpm_tis_raise_irq(s, locty, TPM_TIS_INT_STS_VALID);
 #endif
@@ -714,7 +743,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
             break;
 
             case TPM_TIS_STATE_IDLE:
-                tis->loc[locty].sts = TPM_TIS_STS_COMMAND_READY;
+                tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_COMMAND_READY);
                 tis->loc[locty].state = TPM_TIS_STATE_READY;
                 tpm_tis_raise_irq(s, locty, TPM_TIS_INT_COMMAND_READY);
             break;
@@ -733,7 +762,8 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
                 /* shortcut to ready state with C/R set */
                 tis->loc[locty].state = TPM_TIS_STATE_READY;
                 if (!(tis->loc[locty].sts & TPM_TIS_STS_COMMAND_READY)) {
-                    tis->loc[locty].sts   = TPM_TIS_STS_COMMAND_READY;
+                    tpm_tis_sts_set(&tis->loc[locty],
+                                    TPM_TIS_STS_COMMAND_READY);
                     tpm_tis_raise_irq(s, locty, TPM_TIS_INT_COMMAND_READY);
                 }
                 tis->loc[locty].sts &= ~(TPM_TIS_STS_DATA_AVAILABLE);
@@ -755,8 +785,9 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
             switch (tis->loc[locty].state) {
             case TPM_TIS_STATE_COMPLETION:
                 tis->loc[locty].r_offset = 0;
-                tis->loc[locty].sts = TPM_TIS_STS_VALID |
-                                      TPM_TIS_STS_DATA_AVAILABLE;
+                tpm_tis_sts_set(&tis->loc[locty],
+                                TPM_TIS_STS_VALID|
+                                TPM_TIS_STS_DATA_AVAILABLE);
                 break;
             default:
                 /* ignore */
@@ -780,7 +811,8 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
                     val, size);
             if (tis->loc[locty].state == TPM_TIS_STATE_READY) {
                 tis->loc[locty].state = TPM_TIS_STATE_RECEPTION;
-                tis->loc[locty].sts = TPM_TIS_STS_EXPECT | TPM_TIS_STS_VALID;
+                tpm_tis_sts_set(&tis->loc[locty],
+                                TPM_TIS_STS_EXPECT | TPM_TIS_STS_VALID);
             }
 
             val >>= shift;
@@ -796,7 +828,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
                     val >>= 8;
                     size--;
                 } else {
-                    tis->loc[locty].sts = TPM_TIS_STS_VALID;
+                    tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
                 }
             }
 
@@ -809,11 +841,11 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
 #endif
                 len = tpm_tis_get_size_from_buffer(&tis->loc[locty].w_buffer);
                 if (len > tis->loc[locty].w_offset) {
-                    tis->loc[locty].sts = TPM_TIS_STS_EXPECT |
-                                          TPM_TIS_STS_VALID;
+                    tpm_tis_sts_set(&tis->loc[locty],
+                                    TPM_TIS_STS_EXPECT | TPM_TIS_STS_VALID);
                 } else {
                     /* packet complete */
-                    tis->loc[locty].sts = TPM_TIS_STS_VALID;
+                    tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
                 }
 #ifdef RAISE_STS_IRQ
                 if (needIrq) {
-- 
MST

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

* [Qemu-devel] [PULL v3 06/26] tpm: Support for capability flags of TIS 1.3
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (4 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 05/26] tpm: Support for TIS selftest done flag Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 07/26] pc: acpi-build: create PCI0._CRS dynamically Michael S. Tsirkin
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Peter Crosthwaite, Stefan Berger,
	Anthony Liguori, Paolo Bonzini

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Provide the TIS 1.3 capability flags.
The interface now looks like a TIS 1.3 interface. It's fully
compatible with previous TIS 1.2 and drivers written for
TIS 1.2 continue to work.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_tis.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 61186c5..d0bb97f 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -14,7 +14,7 @@
  *
  * Implementation of the TIS interface according to specs found at
  * http://www.trustedcomputinggroup.org. This implementation currently
- * supports version 1.21, revision 1.0.
+ * supports version 1.3, 21 March 2013
  * In the developers menu choose the PC Client section then find the TIS
  * specification.
  */
@@ -103,8 +103,15 @@
 
 #endif
 
+#define TPM_TIS_CAP_INTERFACE_VERSION1_3 (2 << 28)
+#define TPM_TIS_CAP_DATA_TRANSFER_64B    (3 << 9)
+#define TPM_TIS_CAP_DATA_TRANSFER_LEGACY (0 << 9)
+#define TPM_TIS_CAP_BURST_COUNT_DYNAMIC  (0 << 8)
 #define TPM_TIS_CAP_INTERRUPT_LOW_LEVEL  (1 << 4) /* support is mandatory */
 #define TPM_TIS_CAPABILITIES_SUPPORTED   (TPM_TIS_CAP_INTERRUPT_LOW_LEVEL | \
+                                          TPM_TIS_CAP_BURST_COUNT_DYNAMIC | \
+                                          TPM_TIS_CAP_DATA_TRANSFER_64B | \
+                                          TPM_TIS_CAP_INTERFACE_VERSION1_3 | \
                                           TPM_TIS_INTERRUPTS_SUPPORTED)
 
 #define TPM_TIS_TPM_DID       0x0001
-- 
MST

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

* [Qemu-devel] [PULL v3 07/26] pc: acpi-build: create PCI0._CRS dynamically
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (5 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 06/26] tpm: Support for capability flags of TIS 1.3 Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 08/26] pc: acpi: drop manual hole punching for PCI hotplug resources Michael S. Tsirkin
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Replace template patching and runtime calculation
in _CRS() method with static _CRS defined in SSDT.
No functional change except of as mentined above
and _CRS being moved from DSDT to SSDT.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c          | 88 ++++++++++++++++++++++++-----------------
 hw/i386/acpi-dsdt-pci-crs.dsl | 92 -------------------------------------------
 hw/i386/acpi-dsdt.dsl         | 45 ---------------------
 hw/i386/q35-acpi-dsdt.dsl     | 18 ---------
 hw/i386/ssdt-misc.dsl         | 19 ---------
 5 files changed, 52 insertions(+), 210 deletions(-)
 delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 4d5d7e3..355f9b7 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -346,24 +346,6 @@ static void acpi_align_size(GArray *blob, unsigned align)
     g_array_set_size(blob, ROUND_UP(acpi_data_len(blob), align));
 }
 
-/* Set a value within table in a safe manner */
-#define ACPI_BUILD_SET_LE(table, size, off, bits, val) \
-    do { \
-        uint64_t ACPI_BUILD_SET_LE_val = cpu_to_le64(val); \
-        memcpy(acpi_data_get_ptr(table, size, off, \
-                                 (bits) / BITS_PER_BYTE), \
-               &ACPI_BUILD_SET_LE_val, \
-               (bits) / BITS_PER_BYTE); \
-    } while (0)
-
-static inline void *acpi_data_get_ptr(uint8_t *table_data, unsigned table_size,
-                                      unsigned off, unsigned size)
-{
-    assert(off + size > off);
-    assert(off + size <= table_size);
-    return table_data + off;
-}
-
 static inline void acpi_add_table(GArray *table_offsets, GArray *table_data)
 {
     uint32_t offset = cpu_to_le32(table_data->len);
@@ -860,22 +842,6 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
     g_free(child);
 }
 
-static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size)
-{
-    ACPI_BUILD_SET_LE(start, size, acpi_pci32_start[0], 32, pci->w32.begin);
-
-    ACPI_BUILD_SET_LE(start, size, acpi_pci32_end[0], 32, pci->w32.end - 1);
-
-    if (pci->w64.end || pci->w64.begin) {
-        ACPI_BUILD_SET_LE(start, size, acpi_pci64_valid[0], 8, 1);
-        ACPI_BUILD_SET_LE(start, size, acpi_pci64_start[0], 64, pci->w64.begin);
-        ACPI_BUILD_SET_LE(start, size, acpi_pci64_end[0], 64, pci->w64.end - 1);
-        ACPI_BUILD_SET_LE(start, size, acpi_pci64_length[0], 64, pci->w64.end - pci->w64.begin);
-    } else {
-        ACPI_BUILD_SET_LE(start, size, acpi_pci64_valid[0], 8, 0);
-    }
-}
-
 static void
 build_ssdt(GArray *table_data, GArray *linker,
            AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -898,9 +864,59 @@ build_ssdt(GArray *table_data, GArray *linker,
     ssdt_ptr = acpi_data_push(ssdt->buf, sizeof(ssdp_misc_aml));
     memcpy(ssdt_ptr, ssdp_misc_aml, sizeof(ssdp_misc_aml));
 
-    patch_pci_windows(pci, ssdt_ptr, sizeof(ssdp_misc_aml));
-
     scope = aml_scope("\\_SB.PCI0");
+    /* build PCI0._CRS */
+    crs = aml_resource_template();
+    aml_append(crs,
+        aml_word_bus_number(aml_min_fixed, aml_max_fixed, aml_pos_decode,
+                            0x0000, 0x0000, 0x00FF, 0x0000, 0x0100));
+    aml_append(crs, aml_io(aml_decode16, 0x0CF8, 0x0CF8, 0x01, 0x08));
+
+    aml_append(crs,
+        aml_word_io(aml_min_fixed, aml_max_fixed,
+                    aml_pos_decode, aml_entire_range,
+                    0x0000, 0x0000, 0x0CF7, 0x0000, 0x0CF8));
+    if (ich9_lpc_find()) { /* Q35 */
+        aml_append(crs,
+            aml_word_io(aml_min_fixed, aml_max_fixed,
+                        aml_pos_decode, aml_entire_range,
+                        0x0000, 0x0D00, 0xFFFF, 0x0000, 0xF300));
+    } else { /* piix4 */
+        aml_append(crs,
+            aml_word_io(aml_min_fixed, aml_max_fixed,
+                        aml_pos_decode, aml_entire_range,
+                        0x0000, 0x0D00, 0xADFF, 0x0000, 0xA100));
+        aml_append(crs,
+            aml_word_io(aml_min_fixed, aml_max_fixed,
+                        aml_pos_decode, aml_entire_range,
+                        0x0000, 0xAE0F, 0xAEFF, 0x0000, 0x00F1));
+        aml_append(crs,
+            aml_word_io(aml_min_fixed, aml_max_fixed,
+                        aml_pos_decode, aml_entire_range,
+                        0x0000, 0xAF20, 0xAFDF, 0x0000, 0x00C0));
+        aml_append(crs,
+            aml_word_io(aml_min_fixed, aml_max_fixed,
+                        aml_pos_decode, aml_entire_range,
+                        0x0000, 0xAFE4, 0xFFFF, 0x0000, 0x501C));
+    }
+    aml_append(crs,
+        aml_dword_memory(aml_pos_decode, aml_min_fixed, aml_max_fixed,
+                         aml_cacheable, aml_ReadWrite,
+                         0, 0x000A0000, 0x000BFFFF, 0, 0x00020000));
+    aml_append(crs,
+        aml_dword_memory(aml_pos_decode, aml_min_fixed, aml_max_fixed,
+                         aml_non_cacheable, aml_ReadWrite,
+                         0, pci->w32.begin, pci->w32.end - 1, 0,
+                         pci->w32.end - pci->w32.begin));
+    if (pci->w64.begin) {
+        aml_append(crs,
+            aml_qword_memory(aml_pos_decode, aml_min_fixed, aml_max_fixed,
+                             aml_cacheable, aml_ReadWrite,
+                             0, pci->w64.begin, pci->w64.end - 1, 0,
+                             pci->w64.end - pci->w64.begin));
+    }
+    aml_append(scope, aml_name_decl("_CRS", crs));
+
     /* reserve PCIHP resources */
     if (pm->pcihp_io_len) {
         dev = aml_device("PHPR");
diff --git a/hw/i386/acpi-dsdt-pci-crs.dsl b/hw/i386/acpi-dsdt-pci-crs.dsl
deleted file mode 100644
index 4648e90..0000000
--- a/hw/i386/acpi-dsdt-pci-crs.dsl
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/* PCI CRS (current resources) definition. */
-Scope(\_SB.PCI0) {
-
-    Name(CRES, ResourceTemplate() {
-        WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode,
-            0x0000,             // Address Space Granularity
-            0x0000,             // Address Range Minimum
-            0x00FF,             // Address Range Maximum
-            0x0000,             // Address Translation Offset
-            0x0100,             // Address Length
-            ,, )
-        IO(Decode16,
-            0x0CF8,             // Address Range Minimum
-            0x0CF8,             // Address Range Maximum
-            0x01,               // Address Alignment
-            0x08,               // Address Length
-            )
-        BOARD_SPECIFIC_PCI_RESOURSES
-        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
-            0x00000000,         // Address Space Granularity
-            0x000A0000,         // Address Range Minimum
-            0x000BFFFF,         // Address Range Maximum
-            0x00000000,         // Address Translation Offset
-            0x00020000,         // Address Length
-            ,, , AddressRangeMemory, TypeStatic)
-        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
-            0x00000000,         // Address Space Granularity
-            0xE0000000,         // Address Range Minimum
-            0xFEBFFFFF,         // Address Range Maximum
-            0x00000000,         // Address Translation Offset
-            0x1EC00000,         // Address Length
-            ,, PW32, AddressRangeMemory, TypeStatic)
-    })
-
-    Name(CR64, ResourceTemplate() {
-        QWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
-            0x00000000,          // Address Space Granularity
-            0x8000000000,        // Address Range Minimum
-            0xFFFFFFFFFF,        // Address Range Maximum
-            0x00000000,          // Address Translation Offset
-            0x8000000000,        // Address Length
-            ,, PW64, AddressRangeMemory, TypeStatic)
-    })
-
-    Method(_CRS, 0) {
-        /* Fields provided by dynamically created ssdt */
-        External(P0S, IntObj)
-        External(P0E, IntObj)
-        External(P1V, IntObj)
-        External(P1S, BuffObj)
-        External(P1E, BuffObj)
-        External(P1L, BuffObj)
-
-        /* fixup 32bit pci io window */
-        CreateDWordField(CRES, \_SB.PCI0.PW32._MIN, PS32)
-        CreateDWordField(CRES, \_SB.PCI0.PW32._MAX, PE32)
-        CreateDWordField(CRES, \_SB.PCI0.PW32._LEN, PL32)
-        Store(P0S, PS32)
-        Store(P0E, PE32)
-        Store(Add(Subtract(P0E, P0S), 1), PL32)
-
-        If (LEqual(P1V, Zero)) {
-            Return (CRES)
-        }
-
-        /* fixup 64bit pci io window */
-        CreateQWordField(CR64, \_SB.PCI0.PW64._MIN, PS64)
-        CreateQWordField(CR64, \_SB.PCI0.PW64._MAX, PE64)
-        CreateQWordField(CR64, \_SB.PCI0.PW64._LEN, PL64)
-        Store(P1S, PS64)
-        Store(P1E, PE64)
-        Store(P1L, PL64)
-        /* add window and return result */
-        ConcatenateResTemplate(CRES, CR64, Local0)
-        Return (Local0)
-    }
-}
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index a611e07..09b68f0 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -31,50 +31,6 @@ DefinitionBlock (
 
 #include "acpi-dsdt-dbug.dsl"
 
-
-/****************************************************************
- * PCI Bus definition
- ****************************************************************/
-#define BOARD_SPECIFIC_PCI_RESOURSES \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0x0000, \
-         0x0CF7, \
-         0x0000, \
-         0x0CF8, \
-         ,, , TypeStatic) \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0x0D00, \
-         0xADFF, \
-         0x0000, \
-         0xA100, \
-         ,, , TypeStatic) \
-     /* 0xae00-0xae0e hole for PCI hotplug, hw/acpi/piix4.c:PCI_HOTPLUG_ADDR */ \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0xAE0F, \
-         0xAEFF, \
-         0x0000, \
-         0x00F1, \
-         ,, , TypeStatic) \
-     /* 0xaf00-0xaf1f hole for CPU hotplug, hw/acpi/piix4.c:PIIX4_PROC_BASE */ \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0xAF20, \
-         0xAFDF, \
-         0x0000, \
-         0x00C0, \
-         ,, , TypeStatic) \
-     /* 0xafe0-0xafe3 hole for ACPI.GPE0, hw/acpi/piix4.c:GPE_BASE */ \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0xAFE4, \
-         0xFFFF, \
-         0x0000, \
-         0x501C, \
-         ,, , TypeStatic)
-
     Scope(\_SB) {
         Device(PCI0) {
             Name(_HID, EisaId("PNP0A03"))
@@ -85,7 +41,6 @@ DefinitionBlock (
         }
     }
 
-#include "acpi-dsdt-pci-crs.dsl"
 #include "acpi-dsdt-hpet.dsl"
 
 
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index e1cee5d..3fb4b2f 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -48,23 +48,6 @@ DefinitionBlock (
 /****************************************************************
  * PCI Bus definition
  ****************************************************************/
-#define BOARD_SPECIFIC_PCI_RESOURSES \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0x0000, \
-         0x0CD7, \
-         0x0000, \
-         0x0CD8, \
-         ,, , TypeStatic) \
-     /* 0xcd8-0xcf7 hole for CPU hotplug, hw/acpi/ich9.c:ICH9_PROC_BASE */ \
-     WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
-         0x0000, \
-         0x0D00, \
-         0xFFFF, \
-         0x0000, \
-         0xF300, \
-         ,, , TypeStatic)
-
     Scope(\_SB) {
         Device(PCI0) {
             Name(_HID, EisaId("PNP0A08"))
@@ -131,7 +114,6 @@ DefinitionBlock (
         }
     }
 
-#include "acpi-dsdt-pci-crs.dsl"
 #include "acpi-dsdt-hpet.dsl"
 
 
diff --git a/hw/i386/ssdt-misc.dsl b/hw/i386/ssdt-misc.dsl
index 2588e30..8d61f21 100644
--- a/hw/i386/ssdt-misc.dsl
+++ b/hw/i386/ssdt-misc.dsl
@@ -18,23 +18,4 @@ ACPI_EXTRACT_ALL_CODE ssdp_misc_aml
 
 DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
 {
-
-/****************************************************************
- * PCI memory ranges
- ****************************************************************/
-
-    Scope(\) {
-       ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_start
-       Name(P0S, 0x12345678)
-       ACPI_EXTRACT_NAME_DWORD_CONST acpi_pci32_end
-       Name(P0E, 0x12345678)
-       ACPI_EXTRACT_NAME_BYTE_CONST acpi_pci64_valid
-       Name(P1V, 0x12)
-       ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_start
-       Name(P1S, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
-       ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_end
-       Name(P1E, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
-       ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_length
-       Name(P1L, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
-    }
 }
-- 
MST

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

* [Qemu-devel] [PULL v3 08/26] pc: acpi: drop manual hole punching for PCI hotplug resources
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (6 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 07/26] pc: acpi-build: create PCI0._CRS dynamically Michael S. Tsirkin
@ 2015-03-02 10:58 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 09/26] pc: acpi: drop manual hole punching for CPU " Michael S. Tsirkin
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Drops manual hole punching in PCI0._CRS for PIIX4 machine type.
Resources will be consumed by Device(PHPR) that cwis attached
to PCI bus. The same way how it currently works for mem hotlpug.

Manual hole in PIIX4 _CRS wasn't correct anyway since it was
legacy size 0xF while current PCIHP MMIO region is of size 0x14.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 355f9b7..02e2597 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -885,11 +885,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(crs,
             aml_word_io(aml_min_fixed, aml_max_fixed,
                         aml_pos_decode, aml_entire_range,
-                        0x0000, 0x0D00, 0xADFF, 0x0000, 0xA100));
-        aml_append(crs,
-            aml_word_io(aml_min_fixed, aml_max_fixed,
-                        aml_pos_decode, aml_entire_range,
-                        0x0000, 0xAE0F, 0xAEFF, 0x0000, 0x00F1));
+                        0x0000, 0x0D00, 0xAEFF, 0x0000, 0xA200));
         aml_append(crs,
             aml_word_io(aml_min_fixed, aml_max_fixed,
                         aml_pos_decode, aml_entire_range,
-- 
MST

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

* [Qemu-devel] [PULL v3 09/26] pc: acpi: drop manual hole punching for CPU hotplug resources
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (7 preceding siblings ...)
  2015-03-02 10:58 ` [Qemu-devel] [PULL v3 08/26] pc: acpi: drop manual hole punching for PCI hotplug resources Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 10/26] pc: acpi: drop manual hole punching for GPE0 resources Michael S. Tsirkin
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Drops manual hole punching in PCI0._CRS on PIIX4 machine type
for CPU hotplug resources.
Resources will be consumed by Device(PRES) that is attached
to PCI bus. The same way how it currently works for mem hotlpug.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 02e2597..0de261a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -885,11 +885,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(crs,
             aml_word_io(aml_min_fixed, aml_max_fixed,
                         aml_pos_decode, aml_entire_range,
-                        0x0000, 0x0D00, 0xAEFF, 0x0000, 0xA200));
-        aml_append(crs,
-            aml_word_io(aml_min_fixed, aml_max_fixed,
-                        aml_pos_decode, aml_entire_range,
-                        0x0000, 0xAF20, 0xAFDF, 0x0000, 0x00C0));
+                        0x0000, 0x0D00, 0xAFDF, 0x0000, 0xA2E0));
         aml_append(crs,
             aml_word_io(aml_min_fixed, aml_max_fixed,
                         aml_pos_decode, aml_entire_range,
-- 
MST

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

* [Qemu-devel] [PULL v3 10/26] pc: acpi: drop manual hole punching for GPE0 resources
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (8 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 09/26] pc: acpi: drop manual hole punching for CPU " Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 11/26] pc: acpi-build: drop remaining ssdt_misc template Michael S. Tsirkin
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Drops manual hole punching in PCI0._CRS on PIIX4 machine type
for GPE0 resources. Resources will be consumed by Device(GPE0)
that is attached to PCI namespace.
There is GPE device with HID ACPI0006 since ACPI2.0
that should be used for this purpose but none of Windows
versions support it and show it as "unknown device",
so reserve resource in old fashioned way with PNP0A06
device to make windows happy and actually reserve resources.

Along with last hole _CRS layout of PIIX4 machine becomes
the same as Q35 one, so merge them together and use the same
_CRS for both machine types.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 0de261a..2700154 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -876,21 +876,10 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_word_io(aml_min_fixed, aml_max_fixed,
                     aml_pos_decode, aml_entire_range,
                     0x0000, 0x0000, 0x0CF7, 0x0000, 0x0CF8));
-    if (ich9_lpc_find()) { /* Q35 */
-        aml_append(crs,
-            aml_word_io(aml_min_fixed, aml_max_fixed,
-                        aml_pos_decode, aml_entire_range,
-                        0x0000, 0x0D00, 0xFFFF, 0x0000, 0xF300));
-    } else { /* piix4 */
-        aml_append(crs,
-            aml_word_io(aml_min_fixed, aml_max_fixed,
-                        aml_pos_decode, aml_entire_range,
-                        0x0000, 0x0D00, 0xAFDF, 0x0000, 0xA2E0));
-        aml_append(crs,
-            aml_word_io(aml_min_fixed, aml_max_fixed,
-                        aml_pos_decode, aml_entire_range,
-                        0x0000, 0xAFE4, 0xFFFF, 0x0000, 0x501C));
-    }
+    aml_append(crs,
+        aml_word_io(aml_min_fixed, aml_max_fixed,
+                    aml_pos_decode, aml_entire_range,
+                    0x0000, 0x0D00, 0xFFFF, 0x0000, 0xF300));
     aml_append(crs,
         aml_dword_memory(aml_pos_decode, aml_min_fixed, aml_max_fixed,
                          aml_cacheable, aml_ReadWrite,
@@ -909,6 +898,19 @@ build_ssdt(GArray *table_data, GArray *linker,
     }
     aml_append(scope, aml_name_decl("_CRS", crs));
 
+    /* reserve GPE0 block resources */
+    dev = aml_device("GPE0");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06")));
+    aml_append(dev, aml_name_decl("_UID", aml_string("GPE0 resources")));
+    /* device present, functioning, decoding, not shown in UI */
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
+    crs = aml_resource_template();
+    aml_append(crs,
+        aml_io(aml_decode16, pm->gpe0_blk, pm->gpe0_blk, 1, pm->gpe0_blk_len)
+    );
+    aml_append(dev, aml_name_decl("_CRS", crs));
+    aml_append(scope, dev);
+
     /* reserve PCIHP resources */
     if (pm->pcihp_io_len) {
         dev = aml_device("PHPR");
-- 
MST

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

* [Qemu-devel] [PULL v3 11/26] pc: acpi-build: drop remaining ssdt_misc template
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (9 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 10/26] pc: acpi: drop manual hole punching for GPE0 resources Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 12/26] acpi: add acpi_irq_no_flags() term Michael S. Tsirkin
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

It drops empty ssdt_misc templete. It also hides
from user almost all pointer arithmetic when building
SSDT which makes resulting code a bit cleaner
and concentrating only on composing ASL construct
/i.e. a task build_ssdt() should be doing/.

Also it makes one binary blob less stored in QEMU
source tree by removing need to keep and update
hw/i386/ssdt-misc.hex.generated file here in total
saving us ~430LOC.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c  |  7 ++-----
 hw/i386/Makefile.objs |  1 -
 hw/i386/ssdt-misc.dsl | 21 ---------------------
 3 files changed, 2 insertions(+), 27 deletions(-)
 delete mode 100644 hw/i386/ssdt-misc.dsl

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2700154..01d988c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -526,7 +526,6 @@ static inline char acpi_get_hex(uint32_t val)
 #define ACPI_SSDT_SIGNATURE 0x54445353 /* SSDT */
 #define ACPI_SSDT_HEADER_LENGTH 36
 
-#include "hw/i386/ssdt-misc.hex"
 #include "hw/i386/ssdt-pcihp.hex"
 #include "hw/i386/ssdt-tpm.hex"
 
@@ -850,7 +849,6 @@ build_ssdt(GArray *table_data, GArray *linker,
     MachineState *machine = MACHINE(qdev_get_machine());
     uint32_t nr_mem = machine->ram_slots;
     unsigned acpi_cpus = guest_info->apic_id_limit;
-    uint8_t *ssdt_ptr;
     Aml *ssdt, *sb_scope, *scope, *pkg, *dev, *method, *crs, *field, *ifctx;
     int i;
 
@@ -860,9 +858,8 @@ build_ssdt(GArray *table_data, GArray *linker,
     QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256);
     g_assert(acpi_cpus <= ACPI_CPU_HOTPLUG_ID_LIMIT);
 
-    /* Copy header and patch values in the S3_ / S4_ / S5_ packages */
-    ssdt_ptr = acpi_data_push(ssdt->buf, sizeof(ssdp_misc_aml));
-    memcpy(ssdt_ptr, ssdp_misc_aml, sizeof(ssdp_misc_aml));
+    /* Reserve space for header */
+    acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
 
     scope = aml_scope("\\_SB.PCI0");
     /* build PCI0._CRS */
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 45b90a8..9b00568 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -10,7 +10,6 @@ obj-y += acpi-build.o
 hw/i386/acpi-build.o: hw/i386/acpi-build.c \
 	hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex \
 	hw/i386/ssdt-pcihp.hex \
-	hw/i386/ssdt-misc.hex \
 	hw/i386/ssdt-tpm.hex
 
 iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
diff --git a/hw/i386/ssdt-misc.dsl b/hw/i386/ssdt-misc.dsl
deleted file mode 100644
index 8d61f21..0000000
--- a/hw/i386/ssdt-misc.dsl
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-#include "hw/acpi/pc-hotplug.h"
-
-ACPI_EXTRACT_ALL_CODE ssdp_misc_aml
-
-DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
-{
-}
-- 
MST

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

* [Qemu-devel] [PULL v3 12/26] acpi: add acpi_irq_no_flags() term
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (10 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 11/26] pc: acpi-build: drop remaining ssdt_misc template Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 13/26] pc: export applesmc IO port/len Michael S. Tsirkin
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/aml-build.h |  1 +
 hw/acpi/aml-build.c         | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index d2b2c35..1187197 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -146,6 +146,7 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
             uint8_t aln, uint8_t len);
 Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
                           uint32_t offset, uint32_t len);
+Aml *aml_irq_no_flags(uint8_t irq);
 Aml *aml_named_field(const char *name, unsigned length);
 Aml *aml_reserved_field(unsigned length);
 Aml *aml_local(int num);
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index d793775..60245e7 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -514,6 +514,27 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
     return var;
 }
 
+/*
+ * ACPI 1.0b: 6.4.2.1.1 ASL Macro for IRQ Descriptor
+ *
+ * More verbose description at:
+ * ACPI 5.0: 19.5.64 IRQNoFlags (Interrupt Resource Descriptor Macro)
+ *           6.4.2.1 IRQ Descriptor
+ */
+Aml *aml_irq_no_flags(uint8_t irq)
+{
+    uint16_t irq_mask;
+    Aml *var = aml_alloc();
+
+    assert(irq < 16);
+    build_append_byte(var->buf, 0x22); /* IRQ descriptor 2 byte form */
+
+    irq_mask = 1U << irq;
+    build_append_byte(var->buf, irq_mask & 0xFF); /* IRQ mask bits[7:0] */
+    build_append_byte(var->buf, irq_mask >> 8); /* IRQ mask bits[15:8] */
+    return var;
+}
+
 /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLEqual */
 Aml *aml_equal(Aml *arg1, Aml *arg2)
 {
-- 
MST

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

* [Qemu-devel] [PULL v3 13/26] pc: export applesmc IO port/len
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (11 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 12/26] acpi: add acpi_irq_no_flags() term Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 14/26] pc: acpi-build: drop template patching and create Device(SMC) dynamically Michael S. Tsirkin
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

IO port and length will be used in following patch
to correctly generate SMC ACPI device in SSDT.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/isa/isa.h | 11 +++++++++--
 hw/i386/acpi-build.c |  2 +-
 hw/misc/applesmc.c   |  5 ++---
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index cf7bd34..f21ceaa 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -21,10 +21,17 @@
 #define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS)
 
 #define TYPE_APPLE_SMC "isa-applesmc"
+#define APPLESMC_MAX_DATA_LENGTH       32
+#define APPLESMC_PROP_IO_BASE "iobase"
 
-static inline bool applesmc_find(void)
+static inline uint16_t applesmc_port(void)
 {
-    return object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
+    Object *obj = object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
+
+    if (obj) {
+        return object_property_get_int(obj, APPLESMC_PROP_IO_BASE, NULL);
+    }
+    return 0;
 }
 
 typedef struct ISADeviceClass {
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 01d988c..badfa73 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -145,7 +145,7 @@ static void acpi_get_dsdt(AcpiMiscInfo *info)
 
     /* Patch in appropriate value for AppleSMC _STA */
     *(uint8_t *)(info->dsdt_code + *applesmc_sta) =
-        applesmc_find() ? 0x0b : 0x00;
+        applesmc_port() ? 0x0b : 0x00;
 }
 
 static
diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
index 6a56b07..6bd61e7 100644
--- a/hw/misc/applesmc.c
+++ b/hw/misc/applesmc.c
@@ -43,7 +43,6 @@
 /* command/status port used by Apple SMC */
 #define APPLESMC_CMD_PORT              0x4
 #define APPLESMC_NR_PORTS              32
-#define APPLESMC_MAX_DATA_LENGTH       32
 
 #define APPLESMC_READ_CMD              0x10
 #define APPLESMC_WRITE_CMD             0x11
@@ -249,8 +248,8 @@ static void applesmc_isa_realize(DeviceState *dev, Error **errp)
 }
 
 static Property applesmc_isa_properties[] = {
-    DEFINE_PROP_UINT32("iobase", AppleSMCState, iobase,
-                      APPLESMC_DEFAULT_IOBASE),
+    DEFINE_PROP_UINT32(APPLESMC_PROP_IO_BASE, AppleSMCState, iobase,
+                       APPLESMC_DEFAULT_IOBASE),
     DEFINE_PROP_STRING("osk", AppleSMCState, osk),
     DEFINE_PROP_END_OF_LIST(),
 };
-- 
MST

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

* [Qemu-devel] [PULL v3 14/26] pc: acpi-build: drop template patching and create Device(SMC) dynamically
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (12 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 13/26] pc: export applesmc IO port/len Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 15/26] tests: ACPI test blobs update due to PCI0._CRS changes Michael S. Tsirkin
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, agraf, Anthony Liguori, Igor Mammedov,
	Paolo Bonzini, Richard Henderson

From: Igor Mammedov <imammedo@redhat.com>

patch moves SMC device into SSDT and creates it only
when device is present, which makes ACPI tables smaller
in default case when device is not present.

Also it fixes wrong IO range in CRS if "iobase"
property is set to a non default value.

PS:
Testing with XP shows that current default "iobase"
used SMC device conflicts with floppy controller IO,
but it's topic for another patch and I'd leave it
to SMC device author for resolving conflict.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
CC: agraf@suse.de
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c      | 29 ++++++++++++++++++++++-------
 hw/i386/acpi-dsdt-isa.dsl | 11 -----------
 hw/i386/acpi-dsdt.dsl     |  1 -
 hw/i386/q35-acpi-dsdt.dsl |  1 -
 4 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index badfa73..05eb80a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -116,6 +116,7 @@ typedef struct AcpiMiscInfo {
     const unsigned char *dsdt_code;
     unsigned dsdt_size;
     uint16_t pvpanic_port;
+    uint16_t applesmc_io_base;
 } AcpiMiscInfo;
 
 typedef struct AcpiBuildPciBusHotplugState {
@@ -127,7 +128,6 @@ typedef struct AcpiBuildPciBusHotplugState {
 
 static void acpi_get_dsdt(AcpiMiscInfo *info)
 {
-    uint16_t *applesmc_sta;
     Object *piix = piix4_pm_find();
     Object *lpc = ich9_lpc_find();
     assert(!!piix != !!lpc);
@@ -135,17 +135,11 @@ static void acpi_get_dsdt(AcpiMiscInfo *info)
     if (piix) {
         info->dsdt_code = AcpiDsdtAmlCode;
         info->dsdt_size = sizeof AcpiDsdtAmlCode;
-        applesmc_sta = piix_dsdt_applesmc_sta;
     }
     if (lpc) {
         info->dsdt_code = Q35AcpiDsdtAmlCode;
         info->dsdt_size = sizeof Q35AcpiDsdtAmlCode;
-        applesmc_sta = q35_dsdt_applesmc_sta;
     }
-
-    /* Patch in appropriate value for AppleSMC _STA */
-    *(uint8_t *)(info->dsdt_code + *applesmc_sta) =
-        applesmc_port() ? 0x0b : 0x00;
 }
 
 static
@@ -248,6 +242,7 @@ static void acpi_get_misc_info(AcpiMiscInfo *info)
     info->has_hpet = hpet_find();
     info->has_tpm = tpm_find();
     info->pvpanic_port = pvpanic_port();
+    info->applesmc_io_base = applesmc_port();
 }
 
 static void acpi_get_pci_info(PcPciInfo *info)
@@ -955,6 +950,26 @@ build_ssdt(GArray *table_data, GArray *linker,
     aml_append(scope, aml_name_decl("_S5", pkg));
     aml_append(ssdt, scope);
 
+    if (misc->applesmc_io_base) {
+        scope = aml_scope("\\_SB.PCI0.ISA");
+        dev = aml_device("SMC");
+
+        aml_append(dev, aml_name_decl("_HID", aml_eisaid("APP0001")));
+        /* device present, functioning, decoding, not shown in UI */
+        aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
+
+        crs = aml_resource_template();
+        aml_append(crs,
+            aml_io(aml_decode16, misc->applesmc_io_base, misc->applesmc_io_base,
+                   0x01, APPLESMC_MAX_DATA_LENGTH)
+        );
+        aml_append(crs, aml_irq_no_flags(6));
+        aml_append(dev, aml_name_decl("_CRS", crs));
+
+        aml_append(scope, dev);
+        aml_append(ssdt, scope);
+    }
+
     if (misc->pvpanic_port) {
         scope = aml_scope("\\_SB.PCI0.ISA");
 
diff --git a/hw/i386/acpi-dsdt-isa.dsl b/hw/i386/acpi-dsdt-isa.dsl
index deb37de..89caa16 100644
--- a/hw/i386/acpi-dsdt-isa.dsl
+++ b/hw/i386/acpi-dsdt-isa.dsl
@@ -16,17 +16,6 @@
 /* Common legacy ISA style devices. */
 Scope(\_SB.PCI0.ISA) {
 
-    Device (SMC) {
-        Name(_HID, EisaId("APP0001"))
-        /* _STA will be patched to 0x0B if AppleSMC is present */
-        ACPI_EXTRACT_NAME_BYTE_CONST DSDT_APPLESMC_STA
-        Name(_STA, 0xF0)
-        Name(_CRS, ResourceTemplate () {
-            IO (Decode16, 0x0300, 0x0300, 0x01, 0x20)
-            IRQNoFlags() { 6 }
-        })
-    }
-
     Device(RTC) {
         Name(_HID, EisaId("PNP0B00"))
         Name(_CRS, ResourceTemplate() {
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index 09b68f0..a2d84ec 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -85,7 +85,6 @@ DefinitionBlock (
         }
     }
 
-#define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
 #include "acpi-dsdt-isa.dsl"
 
 
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index 3fb4b2f..16eaca3 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -150,7 +150,6 @@ DefinitionBlock (
         }
     }
 
-#define DSDT_APPLESMC_STA q35_dsdt_applesmc_sta
 #include "acpi-dsdt-isa.dsl"
 
 
-- 
MST

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

* [Qemu-devel] [PULL v3 15/26] tests: ACPI test blobs update due to PCI0._CRS changes
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (13 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 14/26] pc: acpi-build: drop template patching and create Device(SMC) dynamically Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 16/26] tests: bios-tables-test: add support for testing bridges Michael S. Tsirkin
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

PCI0._CRS was moved into SSDT and became the same for
PIIX4/Q35 machines.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/DSDT  | Bin 3415 -> 2970 bytes
 tests/acpi-test-data/pc/SSDT  | Bin 2374 -> 2480 bytes
 tests/acpi-test-data/q35/DSDT | Bin 8005 -> 7608 bytes
 tests/acpi-test-data/q35/SSDT | Bin 578 -> 685 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT
index ad12cb35d9dafc4d50002873f5c4ca04552b36df..1693c3783b34cfb5473e7ef65ba6f8deee390898 100644
GIT binary patch
delta 45
zcmcaEHA|e!CD<io7B>R}W5h(Rj?Icp+>8P~()!Ht!A|i3&YlLI!H)5pvzXs<0ss&x
B3^@P*

delta 471
zcmX|;PfG$p7{=dmA=YWu6e24^q(i4D|FOqtT^BPf21n}9Vf+XZ5qMG}P$DSt5*?zz
zt4j0%@>_JQL)Q+S^3*i1+xi}6e$Vp^54_BM{B4yMM4@_Y0g&@9?KBUUx1`8R?v_%f
zTk%9JPw7L)f)E27g$F5;37artYM(Fztsfmv*i2h$pv|X1FAUWX;2Q#+9KDYK#xwmn
zQo4AJx8pW|UkE@!sd?<y6M}YJC&X9qq15ZI&*MY`Ot%*auQXfQQ8@pvf(!iyEIL%W
z6#-Yc6}{#noAL3Mdja0@ayC=vDIqb|;7JVYr)N{tJ`lh+kF3YjM-uv2cH>s;9E~_!
z*g2n<xEJ6CFWb2~Ph;g2uyP7ziP0rCU_q^4d+su_v!B>Df*&XeN1j}4iUU`ga<5ci
gb5S6s6jg_UiQB}Y)G87%z#z%>UA^VYfP97j0NTcIKL7v#

diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT
index d0103368a0b9e3d5410372f1f589df4eeeebaf03..dc5be2497b6c2015d7cbabb1ff0cd13e02b3e0e4 100644
GIT binary patch
delta 200
zcmX>mv_Y6FIM^j*11AFm<DZFK()F%_F?#XAPVoWGo(3H8&OyO~PV8KH9lQ)oJPaW4
zA4D*^GydTD!NbS_6ldgN1_^x!O8?-2^LhV+6n<_OXJCNHGca&5{Qu7lQVIl23}6{X
z2#<l||Ns5}z-(291K%ncqMMvq+yh*J4)E}F;SKN$FmN<5W8jDn1@b`R6IaV}JXrr=
NJtIpc!^W0F901$MEt&uT

delta 118
zcmdlWd`yTdIM^k`jgx_a(Pko-bi5O53<F1iL2x_|0|NsGkmVZB^Z)<;e;fgZVewo*
pDZ}7+L2fP%pez^w1zgbud{6`gJXmA&;)9*y1Drh#HoiN=0RVk=7KQ)-

diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT
index de430e2a68e203518384b1db75baaefc02f2aa33..e9ac11c38ff98c36ba0c06abfd6b01fcb94b4452 100644
GIT binary patch
delta 46
zcmX?Vx5JvtCD<iohb#jF<Ft)j@r;{KFmW>q_(<zB#|Jyb2RM5gcm_MhZx&=Rkp=)i
CoD7=)

delta 425
zcmX|-Jxc>Y5Qb-R5RY{u3HX5oqF7jo=Ho~s1TU8(Mxrd)V52Z8Q%Mk;R1pa%HWv8<
z7OCtcjh#0B1}*&$HmO{9?mVa1edc|Kmz{mtf3Jy#Zgj&90DO8Dgrk#{UD9<@L96Hn
zolxiM3*zD~11Skyh7WAwT+SuBR!8Zu^kMB!`QK*@4}RaS0mMFl0Am(;)K&^22jdRD
zjCuWuIsH}`f*VXIzdpLQlHvLrOD@)ju<Q#8IvVczmEv6KN;$@!3KQ(BcBMQ}MNMp5
z2#L+X<yC}M2LzsZloM4tC75#9L(r*uV#!y!>czaO!UVTfyXp;8i6bN6$OziR)|eAG
zpf~N!`Y5q>RM>NpFKua`&Te+}aX>B|wi+^>1$0SweE}}7lgo-s6TtxoH@6P#nzM1r
G%l`r~K4Uik

diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT
index f86643da45ad89a97a652233cb090516afde7b31..749f368e3034bfb491dcd8ced37936e0dcbba02a 100644
GIT binary patch
delta 200
zcmX@avX+%AIM^j*EfWI+<D!XN()FG^F?#XAPVoWGo(3H8&OyO~PV8KH9lQ)oJPaW4
zA4D*^GydTD!NbS_6ldgN1_^x!O8?-2^LhV+6n<_OXJCNHGca&5{Qu7lQVIl23}6{X
z2#?{w|Nr~{f!V4I2ka^tqMMvq+yh*J4)E}F;SKN$FmN<5W8jDn1@b`R6Yt1!D6lE8
NF$z>NY;4}o2modBDslh-

delta 117
zcmZ3>dWeN9IM^k`iHU)MaoI#J={P6W7zU02gWz}`1_p)$K$dGf&;S4X|8WEuhQ)IM
or3{1P1-ZF6fU;l!6mUfs@Ies};EvIY4|a+VaP~CV_-;QV0J~ckEdT%j

-- 
MST

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

* [Qemu-devel] [PULL v3 16/26] tests: bios-tables-test: add support for testing bridges
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (14 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 15/26] tests: ACPI test blobs update due to PCI0._CRS changes Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 17/26] tests: add ACPI blobs for qemu with bridge cases Michael S. Tsirkin
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Anthony Liguori, Marcel Apfelbaum, Gabriel Somlo,
	Stefan Hajnoczi, Igor Mammedov, Paolo Bonzini

From: Igor Mammedov <imammedo@redhat.com>

Adds alternative ACPI table blob selection for testing
non default QEMU configurations. If blob file for test
variant is not present, fallback to default blob.

With this change implement testing with a coldplugged
bridge.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/bios-tables-test.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 40 insertions(+), 5 deletions(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 4d0fa84..735ac61 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -40,6 +40,7 @@ typedef struct {
 
 typedef struct {
     const char *machine;
+    const char *variant;
     uint32_t rsdp_addr;
     AcpiRsdpDescriptor rsdp_table;
     AcpiRsdtDescriptorRev1 rsdt_table;
@@ -396,13 +397,14 @@ static void dump_aml_files(test_data *data, bool rebuild)
     int i;
 
     for (i = 0; i < data->tables->len; ++i) {
+        const char *ext = data->variant ? data->variant : "";
         sdt = &g_array_index(data->tables, AcpiSdtTable, i);
         g_assert(sdt->aml);
 
         if (rebuild) {
             uint32_t signature = cpu_to_le32(sdt->header.signature);
-            aml_file = g_strdup_printf("%s/%s/%.4s", data_dir, data->machine,
-                                       (gchar *)&signature);
+            aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+                                       (gchar *)&signature, ext);
             fd = g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT,
                         S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
         } else {
@@ -509,7 +511,7 @@ static GArray *load_expected_aml(test_data *data)
 {
     int i;
     AcpiSdtTable *sdt;
-    gchar *aml_file;
+    gchar *aml_file = NULL;
     GError *error = NULL;
     gboolean ret;
 
@@ -517,6 +519,7 @@ static GArray *load_expected_aml(test_data *data)
     for (i = 0; i < data->tables->len; ++i) {
         AcpiSdtTable exp_sdt;
         uint32_t signature;
+        const char *ext = data->variant ? data->variant : "";
 
         sdt = &g_array_index(data->tables, AcpiSdtTable, i);
 
@@ -524,8 +527,15 @@ static GArray *load_expected_aml(test_data *data)
         exp_sdt.header.signature = sdt->header.signature;
 
         signature = cpu_to_le32(sdt->header.signature);
-        aml_file = g_strdup_printf("%s/%s/%.4s", data_dir, data->machine,
-                                   (gchar *)&signature);
+
+try_again:
+        aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+                                   (gchar *)&signature, ext);
+        if (data->variant && !g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+            g_free(aml_file);
+            ext = "";
+            goto try_again;
+        }
         exp_sdt.aml_file = aml_file;
         g_assert(g_file_test(aml_file, G_FILE_TEST_EXISTS));
         ret = g_file_get_contents(aml_file, &exp_sdt.aml,
@@ -778,6 +788,17 @@ static void test_acpi_piix4_tcg(void)
     free_test_data(&data);
 }
 
+static void test_acpi_piix4_tcg_bridge(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".bridge";
+    test_acpi_one("-machine accel=tcg -device pci-bridge,chassis_nr=1", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_q35_tcg(void)
 {
     test_data data;
@@ -788,6 +809,18 @@ static void test_acpi_q35_tcg(void)
     free_test_data(&data);
 }
 
+static void test_acpi_q35_tcg_bridge(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".bridge";
+    test_acpi_one("-machine q35,accel=tcg -device pci-bridge,chassis_nr=1",
+                  &data);
+    free_test_data(&data);
+}
+
 int main(int argc, char *argv[])
 {
     const char *arch = qtest_get_arch();
@@ -805,7 +838,9 @@ int main(int argc, char *argv[])
 
     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
         qtest_add_func("acpi/piix4/tcg", test_acpi_piix4_tcg);
+        qtest_add_func("acpi/piix4/tcg/bridge", test_acpi_piix4_tcg_bridge);
         qtest_add_func("acpi/q35/tcg", test_acpi_q35_tcg);
+        qtest_add_func("acpi/q35/tcg/bridge", test_acpi_q35_tcg_bridge);
     }
     ret = g_test_run();
     unlink(disk);
-- 
MST

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

* [Qemu-devel] [PULL v3 17/26] tests: add ACPI blobs for qemu with bridge cases
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (15 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 16/26] tests: bios-tables-test: add support for testing bridges Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 18/26] pc: acpi-build: simplify PCI bus tree generation Michael S. Tsirkin
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 0 -> 4352 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 0 -> 702 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/SSDT.bridge

diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge
new file mode 100644
index 0000000000000000000000000000000000000000..b807ac92dde72719fe3861c710b555fe3dd62583
GIT binary patch
literal 4352
zcmeH}&2HO96ov0ljLlF~Ov!ZYIC0FayGZCbaon9GlCk_ln$S=|3K`*|2&w=@6C@3a
zz#H2I)b6`4vdB7mg!U2o2-)-r3bgK~>b<0{<b|f_vIV3CHHY`pnHkP-j-(7yr~-%|
zn@4_2y3HqvFY%rL0BX~>9afL;WU`qh{+?%Kep^<X^X6CIS3t9{3^1gN*cBJng(VEU
zFRT*X`UA@s)>v1D1pfBjGC)xWFkv_>6N(=V@(T4xA7eQD>93;s^Y3q=d+zJINr?To
z_JT?hCtkzb1|#dBqWkWvXRlwpdG-0T*LYK=4YOQ~v|^gO;^W}sK<H$$uP3dfJ<S9s
z=eAya{qoB<U;LvNe1H$ac?<T&G4-^S)#h}8gU0s#tY+w@W@@>5Koy#Reefqez3%ye
zeuo}m(hg-l0;}<hIaf@<Pdfju_W=xqi!(V*+A<Yo7?^JN%*q8`vbx><cFRvZuXu8f
zl|_vd-up?^02KIONXQhNN*3;W0!6qFJ*O6@k3Q4hm4D~~^y&A{4L>=GYb7CU-#ETo
z;`NVONnk`l+{OvhPRO4xuA>PnG^$n-wQ*FYxzasbCsB&p%|jP2Exa63>kwPXlMIKw
znA1=<qflld+KZ*=o-Gx>k|DB3;bXi=-*x698lT<xHQ$3xtm0xWNYBfRtP!;Heb_z!
zL~c%QXyD+QYzFW?Z`|X?7B#x(8}c5pvJ;y+d+6ZQ^2d_+;XZXj<s97^p;s8aqC&UW
z6<4+x*_;w(*Lg<gRp@<oH5fIND7#)|^r{Mdz^*2vrV?dWe6NaWl~w3AyIPD|N|aqI
zj8;_WLw3E!=rtwEt_zGVsL&mDwHdXQD7#h}t*X#Z*|o-KO^LGWBBP5cw85^puZtyc
zlqkC{F}kEeo9ud>(d$Z-U6&bMR-rz-t}wcyMA`KQqc>D&z^<!|t}0P>y~*fJ6&kYZ
zEk<uCQFdKpbWMdmV%OV@-d3XQy3XkOG}Jj*4Iam-_Rc!#nKtz40DGPbm&DFU)KTCe
zR8&q$P^EIxD}z9VC&@@@q{cNJ6`lv9nn7w@qt5WH9@VI~?QxB|!*_F3qy8RJZQ-Pc
zhcf13U*bE)8j}(Aq>lO6m-x1D-N^N%Zj;7+&viG~lX{&r?qIH;=6X`kXN-H1>-Z<5
zFa1k(nl<jKah>KJT&mN|aes{KF6m44I%-_$as8Au)}4*Sk5hOF&A1cMs$p(*#HbON
zrKk8$AWr4x4*o4T{D!`ZC@S#|D1ku%Bq)9Il%t@+%;m6C1eM1|f>AMTE0Jp+mE@{1
ziitTr{-zC2fzCp87OJyQorUWECRF3KB2>#KJ&H#>Ym4Nhq`=d(5EK)5UKWBf0#C$3
T%yO7={=b{U>qQO=MGpTBc|!Xx

literal 0
HcmV?d00001

diff --git a/tests/acpi-test-data/q35/SSDT.bridge b/tests/acpi-test-data/q35/SSDT.bridge
new file mode 100644
index 0000000000000000000000000000000000000000..c552782f5bcc57094a7d1375b67979b2efa48f1c
GIT binary patch
literal 702
zcmaJ<&2G~`5T12{vDO=5f)N!Le1$`C2}PVx?X`*1#?H#?q9RAy1F9%eMNvx+y^$aR
zcV2))p96RVj(HCb<b;`VXt}Y6+3%YleKWJGby9t`09YJPWTu07Pf3kF1^|TV_C{j5
zZggyv9EFaNrM@0t<*z^Wz!De+XvnZ3TZ*M%4*Hqskn0zQm*SH58cO{6@fN@;4#1&l
zTuQ}bK^q}OI^Ub-+wZ^d$r;ph*&V7B^|MjZQ-unn@DVs>7a943<NcGP)8iNWC+O5w
z#NAb=J<f+LumhWUXW-qPQgmSYc9)?L;)ka1bh*WG2go)lLZV)Jn<lR3JKc2}Ta~G9
zrA73E+bdbAc7yEb?VH2Xm;Y5?h=pJQj_^*Ex?=7^@SvWFmY^|PUj2R`RT!?O^@Yi!
z3eKg<BS3<~5YZL*J(F&S3`x2T2Y$b(o<6s}xStOIK2ZHDN2*ED?=a>`XL`SL@n(6Z
z5+_fJ5=W%hYj=XX=deayWhyV33!JajvpYmOc^QubG#Q#Pp)n%0XRz%XZ8mK2Jk^Hf
zqe8QKc5_vwQ_P*D&(LTY_;ybHc{^8Vf%W{F4nyOZC@I@tQ_t_|@bRUCfsgy&NZ`B$
U4=%uf02OciE4IM5l`Jaw0}NP~0RR91

literal 0
HcmV?d00001

-- 
MST

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

* [Qemu-devel] [PULL v3 18/26] pc: acpi-build: simplify PCI bus tree generation
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (16 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 17/26] tests: add ACPI blobs for qemu with bridge cases Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 19/26] tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation Michael S. Tsirkin
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

it basicaly does the same as original approach,
* just without bus/notify tables tracking (less obscure)
  which is easier to follow.
* drops unnecessary loops and bitmaps,
  creating devices and notification method in the same loop.
* saves us ~100LOC

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 274 ++++++++++++++++-----------------------------------
 1 file changed, 85 insertions(+), 189 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 05eb80a..ba056f0 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -112,7 +112,6 @@ typedef struct AcpiPmInfo {
 typedef struct AcpiMiscInfo {
     bool has_hpet;
     bool has_tpm;
-    DECLARE_BITMAP(slot_hotplug_enable, PCI_SLOT_MAX);
     const unsigned char *dsdt_code;
     unsigned dsdt_size;
     uint16_t pvpanic_port;
@@ -591,74 +590,37 @@ static void acpi_set_pci_info(void)
     }
 }
 
-static void build_pci_bus_state_init(AcpiBuildPciBusHotplugState *state,
-                                     AcpiBuildPciBusHotplugState *parent,
-                                     bool pcihp_bridge_en)
+static void build_append_pcihp_notify_entry(GArray *method, int slot)
 {
-    state->parent = parent;
-    state->device_table = build_alloc_array();
-    state->notify_table = build_alloc_array();
-    state->pcihp_bridge_en = pcihp_bridge_en;
+    GArray *ifctx;
+
+    ifctx = build_alloc_array();
+    build_append_byte(ifctx, 0x7B); /* AndOp */
+    build_append_byte(ifctx, 0x68); /* Arg0Op */
+    build_append_int(ifctx, 0x1U << slot);
+    build_append_byte(ifctx, 0x00); /* NullName */
+    build_append_byte(ifctx, 0x86); /* NotifyOp */
+    build_append_namestring(ifctx, "S%.02X", PCI_DEVFN(slot, 0));
+    build_append_byte(ifctx, 0x69); /* Arg1Op */
+
+    /* Pack it up */
+    build_package(ifctx, 0xA0 /* IfOp */);
+    build_append_array(method, ifctx);
+    build_free_array(ifctx);
 }
 
-static void build_pci_bus_state_cleanup(AcpiBuildPciBusHotplugState *state)
+static void build_append_pci_bus_devices(GArray *parent_scope, PCIBus *bus,
+                                         bool pcihp_bridge_en)
 {
-    build_free_array(state->device_table);
-    build_free_array(state->notify_table);
-}
-
-static void *build_pci_bus_begin(PCIBus *bus, void *parent_state)
-{
-    AcpiBuildPciBusHotplugState *parent = parent_state;
-    AcpiBuildPciBusHotplugState *child = g_malloc(sizeof *child);
-
-    build_pci_bus_state_init(child, parent, parent->pcihp_bridge_en);
-
-    return child;
-}
-
-static void build_pci_bus_end(PCIBus *bus, void *bus_state)
-{
-    AcpiBuildPciBusHotplugState *child = bus_state;
-    AcpiBuildPciBusHotplugState *parent = child->parent;
     GArray *bus_table = build_alloc_array();
-    DECLARE_BITMAP(slot_hotplug_enable, PCI_SLOT_MAX);
-    DECLARE_BITMAP(slot_device_present, PCI_SLOT_MAX);
-    DECLARE_BITMAP(slot_device_system, PCI_SLOT_MAX);
-    DECLARE_BITMAP(slot_device_vga, PCI_SLOT_MAX);
-    DECLARE_BITMAP(slot_device_qxl, PCI_SLOT_MAX);
-    uint8_t op;
-    int i;
+    GArray *method = NULL;
     QObject *bsel;
-    GArray *method;
-    bool bus_hotplug_support = false;
-
-    /*
-     * Skip bridge subtree creation if bridge hotplug is disabled
-     * to make acpi tables compatible with legacy machine types.
-     * Skip creation for hotplugged bridges as well.
-     */
-    if (bus->parent_dev && (!child->pcihp_bridge_en ||
-                            DEVICE(bus->parent_dev)->hotplugged)) {
-        build_free_array(bus_table);
-        build_pci_bus_state_cleanup(child);
-        g_free(child);
-        return;
-    }
+    PCIBus *sec;
+    int i;
 
     if (bus->parent_dev) {
-        op = 0x82; /* DeviceOp */
-        build_append_namestring(bus_table, "S%.02X",
-                             bus->parent_dev->devfn);
-        build_append_byte(bus_table, 0x08); /* NameOp */
-        build_append_namestring(bus_table, "_SUN");
-        build_append_int(bus_table, PCI_SLOT(bus->parent_dev->devfn));
-        build_append_byte(bus_table, 0x08); /* NameOp */
-        build_append_namestring(bus_table, "_ADR");
-        build_append_int(bus_table, (PCI_SLOT(bus->parent_dev->devfn) << 16) |
-                           PCI_FUNC(bus->parent_dev->devfn));
+        build_append_namestring(bus_table, "S%.02X_", bus->parent_dev->devfn);
     } else {
-        op = 0x10; /* ScopeOp */;
         build_append_namestring(bus_table, "PCI0");
     }
 
@@ -667,29 +629,28 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
         build_append_byte(bus_table, 0x08); /* NameOp */
         build_append_namestring(bus_table, "BSEL");
         build_append_int(bus_table, qint_get_int(qobject_to_qint(bsel)));
-        memset(slot_hotplug_enable, 0xff, sizeof slot_hotplug_enable);
-    } else {
-        /* No bsel - no slots are hot-pluggable */
-        memset(slot_hotplug_enable, 0x00, sizeof slot_hotplug_enable);
+        method = build_alloc_method("DVNT", 2);
     }
 
-    memset(slot_device_present, 0x00, sizeof slot_device_present);
-    memset(slot_device_system, 0x00, sizeof slot_device_present);
-    memset(slot_device_vga, 0x00, sizeof slot_device_vga);
-    memset(slot_device_qxl, 0x00, sizeof slot_device_qxl);
-
     for (i = 0; i < ARRAY_SIZE(bus->devices); i += PCI_FUNC_MAX) {
         DeviceClass *dc;
         PCIDeviceClass *pc;
         PCIDevice *pdev = bus->devices[i];
         int slot = PCI_SLOT(i);
+        bool hotplug_enabled_dev;
         bool bridge_in_acpi;
 
         if (!pdev) {
+            if (bsel) { /* add hotplug slots for non present devices */
+                void *pcihp = acpi_data_push(bus_table, ACPI_PCIHP_SIZEOF);
+                memcpy(pcihp, ACPI_PCIHP_AML, ACPI_PCIHP_SIZEOF);
+                patch_pcihp(slot, pcihp);
+
+                build_append_pcihp_notify_entry(method, slot);
+            }
             continue;
         }
 
-        set_bit(slot, slot_device_present);
         pc = PCI_DEVICE_GET_CLASS(pdev);
         dc = DEVICE_GET_CLASS(pdev);
 
@@ -698,142 +659,83 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
          * In this case they aren't themselves hot-pluggable.
          * Hotplugged bridges *are* hot-pluggable.
          */
-        bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en &&
-         !DEVICE(pdev)->hotplugged;
+        bridge_in_acpi = pc->is_bridge && pcihp_bridge_en &&
+            !DEVICE(pdev)->hotplugged;
 
-        if (pc->class_id == PCI_CLASS_BRIDGE_ISA || bridge_in_acpi) {
-            set_bit(slot, slot_device_system);
+        hotplug_enabled_dev = bsel && dc->hotpluggable && !bridge_in_acpi;
+
+        if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
+            continue;
         }
 
         if (pc->class_id == PCI_CLASS_DISPLAY_VGA) {
-            set_bit(slot, slot_device_vga);
-
             if (object_dynamic_cast(OBJECT(pdev), "qxl-vga")) {
-                set_bit(slot, slot_device_qxl);
+                void *pcihp = acpi_data_push(bus_table,
+                                             ACPI_PCIQXL_SIZEOF);
+                      memcpy(pcihp, ACPI_PCIQXL_AML, ACPI_PCIQXL_SIZEOF);
+                      patch_pciqxl(slot, pcihp);
+            } else {
+                void *pcihp = acpi_data_push(bus_table,
+                                             ACPI_PCIVGA_SIZEOF);
+                memcpy(pcihp, ACPI_PCIVGA_AML, ACPI_PCIVGA_SIZEOF);
+                patch_pcivga(slot, pcihp);
             }
-        }
-
-        if (!dc->hotpluggable || bridge_in_acpi) {
-            clear_bit(slot, slot_hotplug_enable);
-        }
-    }
+        } else if (hotplug_enabled_dev) {
+            void *pcihp = acpi_data_push(bus_table, ACPI_PCIHP_SIZEOF);
 
-    /* Append Device object for each slot */
-    for (i = 0; i < PCI_SLOT_MAX; i++) {
-        bool can_eject = test_bit(i, slot_hotplug_enable);
-        bool present = test_bit(i, slot_device_present);
-        bool vga = test_bit(i, slot_device_vga);
-        bool qxl = test_bit(i, slot_device_qxl);
-        bool system = test_bit(i, slot_device_system);
-        if (can_eject) {
-            void *pcihp = acpi_data_push(bus_table,
-                                         ACPI_PCIHP_SIZEOF);
             memcpy(pcihp, ACPI_PCIHP_AML, ACPI_PCIHP_SIZEOF);
-            patch_pcihp(i, pcihp);
-            bus_hotplug_support = true;
-        } else if (qxl) {
-            void *pcihp = acpi_data_push(bus_table,
-                                         ACPI_PCIQXL_SIZEOF);
-            memcpy(pcihp, ACPI_PCIQXL_AML, ACPI_PCIQXL_SIZEOF);
-            patch_pciqxl(i, pcihp);
-        } else if (vga) {
-            void *pcihp = acpi_data_push(bus_table,
-                                         ACPI_PCIVGA_SIZEOF);
-            memcpy(pcihp, ACPI_PCIVGA_AML, ACPI_PCIVGA_SIZEOF);
-            patch_pcivga(i, pcihp);
-        } else if (system) {
-            /* Nothing to do: system devices are in DSDT or in SSDT above. */
-        } else if (present) {
-            void *pcihp = acpi_data_push(bus_table,
-                                         ACPI_PCINOHP_SIZEOF);
+            patch_pcihp(slot, pcihp);
+            build_append_pcihp_notify_entry(method, slot);
+        } else if (bridge_in_acpi) {
+            PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(pdev));
+            void *pcihp = acpi_data_push(bus_table, ACPI_PCINOHP_SIZEOF);
+
+            memcpy(pcihp, ACPI_PCINOHP_AML, ACPI_PCINOHP_SIZEOF);
+            patch_pcinohp(slot, pcihp);
+            build_append_pci_bus_devices(bus_table, sec_bus, pcihp_bridge_en);
+        } else { /* non hotpluggable present devices */
+            void *pcihp = acpi_data_push(bus_table, ACPI_PCINOHP_SIZEOF);
+
             memcpy(pcihp, ACPI_PCINOHP_AML, ACPI_PCINOHP_SIZEOF);
-            patch_pcinohp(i, pcihp);
+            patch_pcinohp(slot, pcihp);
         }
     }
 
     if (bsel) {
-        method = build_alloc_method("DVNT", 2);
-
-        for (i = 0; i < PCI_SLOT_MAX; i++) {
-            GArray *notify;
-            uint8_t op;
-
-            if (!test_bit(i, slot_hotplug_enable)) {
-                continue;
-            }
-
-            notify = build_alloc_array();
-            op = 0xA0; /* IfOp */
-
-            build_append_byte(notify, 0x7B); /* AndOp */
-            build_append_byte(notify, 0x68); /* Arg0Op */
-            build_append_int(notify, 0x1U << i);
-            build_append_byte(notify, 0x00); /* NullName */
-            build_append_byte(notify, 0x86); /* NotifyOp */
-            build_append_namestring(notify, "S%.02X", PCI_DEVFN(i, 0));
-            build_append_byte(notify, 0x69); /* Arg1Op */
-
-            /* Pack it up */
-            build_package(notify, op);
-
-            build_append_array(method, notify);
-
-            build_free_array(notify);
-        }
-
         build_append_and_cleanup_method(bus_table, method);
     }
 
     /* Append PCNT method to notify about events on local and child buses.
      * Add unconditionally for root since DSDT expects it.
      */
-    if (bus_hotplug_support || child->notify_table->len || !bus->parent_dev) {
-        method = build_alloc_method("PCNT", 0);
-
-        /* If bus supports hotplug select it and notify about local events */
-        if (bsel) {
-            build_append_byte(method, 0x70); /* StoreOp */
-            build_append_int(method, qint_get_int(qobject_to_qint(bsel)));
-            build_append_namestring(method, "BNUM");
-            build_append_namestring(method, "DVNT");
-            build_append_namestring(method, "PCIU");
-            build_append_int(method, 1); /* Device Check */
-            build_append_namestring(method, "DVNT");
-            build_append_namestring(method, "PCID");
-            build_append_int(method, 3); /* Eject Request */
-        }
-
-        /* Notify about child bus events in any case */
-        build_append_array(method, child->notify_table);
-
-        build_append_and_cleanup_method(bus_table, method);
-
-        /* Append description of child buses */
-        build_append_array(bus_table, child->device_table);
-
-        /* Pack it up */
-        if (bus->parent_dev) {
-            build_extop_package(bus_table, op);
-        } else {
-            build_package(bus_table, op);
-        }
+    method = build_alloc_method("PCNT", 0);
 
-        /* Append our bus description to parent table */
-        build_append_array(parent->device_table, bus_table);
+    /* If bus supports hotplug select it and notify about local events */
+    if (bsel) {
+        build_append_byte(method, 0x70); /* StoreOp */
+        build_append_int(method, qint_get_int(qobject_to_qint(bsel)));
+        build_append_namestring(method, "BNUM");
+        build_append_namestring(method, "DVNT");
+        build_append_namestring(method, "PCIU");
+        build_append_int(method, 1); /* Device Check */
+        build_append_namestring(method, "DVNT");
+        build_append_namestring(method, "PCID");
+        build_append_int(method, 3); /* Eject Request */
+    }
 
-        /* Also tell parent how to notify us, invoking PCNT method.
-         * At the moment this is not needed for root as we have a single root.
-         */
-        if (bus->parent_dev) {
-            build_append_namestring(parent->notify_table, "^PCNT.S%.02X",
-                                    bus->parent_dev->devfn);
+    /* Notify about child bus events in any case */
+    if (pcihp_bridge_en) {
+        QLIST_FOREACH(sec, &bus->child, sibling) {
+            build_append_namestring(method, "^S%.02X.PCNT",
+                                    sec->parent_dev->devfn);
         }
     }
 
-    qobject_decref(bsel);
+    build_append_and_cleanup_method(bus_table, method);
+
+    build_package(bus_table, 0x10); /* ScopeOp */
+    build_append_array(parent_scope, bus_table);
     build_free_array(bus_table);
-    build_pci_bus_state_cleanup(child);
-    g_free(child);
 }
 
 static void
@@ -1175,7 +1077,6 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(sb_scope, method);
 
         {
-            AcpiBuildPciBusHotplugState hotplug_state;
             Object *pci_host;
             PCIBus *bus = NULL;
             bool ambiguous;
@@ -1185,16 +1086,11 @@ build_ssdt(GArray *table_data, GArray *linker,
                 bus = PCI_HOST_BRIDGE(pci_host)->bus;
             }
 
-            build_pci_bus_state_init(&hotplug_state, NULL, pm->pcihp_bridge_en);
-
             if (bus) {
                 /* Scan all PCI buses. Generate tables to support hotplug. */
-                pci_for_each_bus_depth_first(bus, build_pci_bus_begin,
-                                             build_pci_bus_end, &hotplug_state);
+                build_append_pci_bus_devices(sb_scope->buf, bus,
+                                             pm->pcihp_bridge_en);
             }
-
-            build_append_array(sb_scope->buf, hotplug_state.device_table);
-            build_pci_bus_state_cleanup(&hotplug_state);
         }
         aml_append(ssdt, sb_scope);
     }
-- 
MST

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

* [Qemu-devel] [PULL v3 19/26] tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (17 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 18/26] pc: acpi-build: simplify PCI bus tree generation Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 20/26] pc: acpi-build: drop template patching and create PCI bus tree dynamically Michael S. Tsirkin
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/SSDT.bridge | Bin 4352 -> 4351 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge
index b807ac92dde72719fe3861c710b555fe3dd62583..ca7f63cb4e48bd95418f68daf1b7e254d5bcf8c2 100644
GIT binary patch
delta 79
zcmZor`me|p9PASEUx0yu@ybT7Xhue_&1sCDjEoMGH!yjL@dq1P#B;<ux&-ksFfcO+
fc$a|$HqYivW#8<}wUuS_TK2Py93Zg(XTJ~taxE4S

delta 76
zcmeyb*r3D}9PARpAjrVLIBz3YG$W(;<}^l6Mn=cU8<@N{mvc3+DF!(Eg#;T~#78&z
dl!IuF_~1}KE@qB+N0%TT1_ow^%>vA+>;M#S6CwZr

-- 
MST

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

* [Qemu-devel] [PULL v3 20/26] pc: acpi-build: drop template patching and create PCI bus tree dynamically
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (18 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 19/26] tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation Michael S. Tsirkin
@ 2015-03-02 10:59 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 21/26] pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs Michael S. Tsirkin
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 10:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Anthony Liguori,
	Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Replace AML template patching with direct composing
of PCI device entries in C. It allows to simplify
PCI tree generation further and saves us about 400LOC
scattered through different files, confining tree
generation to one C function which is much easier
to deal with.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c   | 235 +++++++++++++++++--------------------------------
 hw/i386/Makefile.objs  |   1 -
 hw/i386/ssdt-pcihp.dsl | 100 ---------------------
 3 files changed, 80 insertions(+), 256 deletions(-)
 delete mode 100644 hw/i386/ssdt-pcihp.dsl

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ba056f0..b94e47e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -294,26 +294,6 @@ build_header(GArray *linker, GArray *table_data,
                                     table_data->data, h, len, &h->checksum);
 }
 
-static GArray *build_alloc_method(const char *name, uint8_t arg_count)
-{
-    GArray *method = build_alloc_array();
-
-    build_append_namestring(method, "%s", name);
-    build_append_byte(method, arg_count); /* MethodFlags: ArgCount */
-
-    return method;
-}
-
-static void build_append_and_cleanup_method(GArray *device, GArray *method)
-{
-    uint8_t op = 0x14; /* MethodOp */
-
-    build_package(method, op);
-
-    build_append_array(device, method);
-    build_free_array(method);
-}
-
 /* End here */
 #define ACPI_PORT_SMI_CMD           0x00b2 /* TODO: this is APM_CNT_IOPORT */
 
@@ -494,71 +474,12 @@ static inline char acpi_get_hex(uint32_t val)
     return (val <= 9) ? ('0' + val) : ('A' + val - 10);
 }
 
-/* 0x5B 0x82 DeviceOp PkgLength NameString */
-#define ACPI_PCIHP_OFFSET_HEX (*ssdt_pcihp_name - *ssdt_pcihp_start + 1)
-#define ACPI_PCIHP_OFFSET_ID (*ssdt_pcihp_id - *ssdt_pcihp_start)
-#define ACPI_PCIHP_OFFSET_ADR (*ssdt_pcihp_adr - *ssdt_pcihp_start)
-#define ACPI_PCIHP_OFFSET_EJ0 (*ssdt_pcihp_ej0 - *ssdt_pcihp_start)
-#define ACPI_PCIHP_SIZEOF (*ssdt_pcihp_end - *ssdt_pcihp_start)
-#define ACPI_PCIHP_AML (ssdp_pcihp_aml + *ssdt_pcihp_start)
-
-#define ACPI_PCINOHP_OFFSET_HEX (*ssdt_pcinohp_name - *ssdt_pcinohp_start + 1)
-#define ACPI_PCINOHP_OFFSET_ADR (*ssdt_pcinohp_adr - *ssdt_pcinohp_start)
-#define ACPI_PCINOHP_SIZEOF (*ssdt_pcinohp_end - *ssdt_pcinohp_start)
-#define ACPI_PCINOHP_AML (ssdp_pcihp_aml + *ssdt_pcinohp_start)
-
-#define ACPI_PCIVGA_OFFSET_HEX (*ssdt_pcivga_name - *ssdt_pcivga_start + 1)
-#define ACPI_PCIVGA_OFFSET_ADR (*ssdt_pcivga_adr - *ssdt_pcivga_start)
-#define ACPI_PCIVGA_SIZEOF (*ssdt_pcivga_end - *ssdt_pcivga_start)
-#define ACPI_PCIVGA_AML (ssdp_pcihp_aml + *ssdt_pcivga_start)
-
-#define ACPI_PCIQXL_OFFSET_HEX (*ssdt_pciqxl_name - *ssdt_pciqxl_start + 1)
-#define ACPI_PCIQXL_OFFSET_ADR (*ssdt_pciqxl_adr - *ssdt_pciqxl_start)
-#define ACPI_PCIQXL_SIZEOF (*ssdt_pciqxl_end - *ssdt_pciqxl_start)
-#define ACPI_PCIQXL_AML (ssdp_pcihp_aml + *ssdt_pciqxl_start)
 
 #define ACPI_SSDT_SIGNATURE 0x54445353 /* SSDT */
 #define ACPI_SSDT_HEADER_LENGTH 36
 
-#include "hw/i386/ssdt-pcihp.hex"
 #include "hw/i386/ssdt-tpm.hex"
 
-static void patch_pcihp(int slot, uint8_t *ssdt_ptr)
-{
-    unsigned devfn = PCI_DEVFN(slot, 0);
-
-    ssdt_ptr[ACPI_PCIHP_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
-    ssdt_ptr[ACPI_PCIHP_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCIHP_OFFSET_ID] = slot;
-    ssdt_ptr[ACPI_PCIHP_OFFSET_ADR + 2] = slot;
-}
-
-static void patch_pcinohp(int slot, uint8_t *ssdt_ptr)
-{
-    unsigned devfn = PCI_DEVFN(slot, 0);
-
-    ssdt_ptr[ACPI_PCINOHP_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
-    ssdt_ptr[ACPI_PCINOHP_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCINOHP_OFFSET_ADR + 2] = slot;
-}
-
-static void patch_pcivga(int slot, uint8_t *ssdt_ptr)
-{
-    unsigned devfn = PCI_DEVFN(slot, 0);
-
-    ssdt_ptr[ACPI_PCIVGA_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
-    ssdt_ptr[ACPI_PCIVGA_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCIVGA_OFFSET_ADR + 2] = slot;
-}
-
-static void patch_pciqxl(int slot, uint8_t *ssdt_ptr)
-{
-    unsigned devfn = PCI_DEVFN(slot, 0);
-
-    ssdt_ptr[ACPI_PCIQXL_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
-    ssdt_ptr[ACPI_PCIQXL_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCIQXL_OFFSET_ADR + 2] = slot;
-}
 
 /* Assign BSEL property to all buses.  In the future, this can be changed
  * to only assign to buses that support hotplug.
@@ -590,46 +511,30 @@ static void acpi_set_pci_info(void)
     }
 }
 
-static void build_append_pcihp_notify_entry(GArray *method, int slot)
+static void build_append_pcihp_notify_entry(Aml *method, int slot)
 {
-    GArray *ifctx;
-
-    ifctx = build_alloc_array();
-    build_append_byte(ifctx, 0x7B); /* AndOp */
-    build_append_byte(ifctx, 0x68); /* Arg0Op */
-    build_append_int(ifctx, 0x1U << slot);
-    build_append_byte(ifctx, 0x00); /* NullName */
-    build_append_byte(ifctx, 0x86); /* NotifyOp */
-    build_append_namestring(ifctx, "S%.02X", PCI_DEVFN(slot, 0));
-    build_append_byte(ifctx, 0x69); /* Arg1Op */
-
-    /* Pack it up */
-    build_package(ifctx, 0xA0 /* IfOp */);
-    build_append_array(method, ifctx);
-    build_free_array(ifctx);
+    Aml *if_ctx;
+    int32_t devfn = PCI_DEVFN(slot, 0);
+
+    if_ctx = aml_if(aml_and(aml_arg(0), aml_int(0x1U << slot)));
+    aml_append(if_ctx, aml_notify(aml_name("S%.02X", devfn), aml_arg(1)));
+    aml_append(method, if_ctx);
 }
 
-static void build_append_pci_bus_devices(GArray *parent_scope, PCIBus *bus,
+static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                                          bool pcihp_bridge_en)
 {
-    GArray *bus_table = build_alloc_array();
-    GArray *method = NULL;
+    Aml *dev, *notify_method, *method;
     QObject *bsel;
     PCIBus *sec;
     int i;
 
-    if (bus->parent_dev) {
-        build_append_namestring(bus_table, "S%.02X_", bus->parent_dev->devfn);
-    } else {
-        build_append_namestring(bus_table, "PCI0");
-    }
-
     bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL);
     if (bsel) {
-        build_append_byte(bus_table, 0x08); /* NameOp */
-        build_append_namestring(bus_table, "BSEL");
-        build_append_int(bus_table, qint_get_int(qobject_to_qint(bsel)));
-        method = build_alloc_method("DVNT", 2);
+        int64_t bsel_val = qint_get_int(qobject_to_qint(bsel));
+
+        aml_append(parent_scope, aml_name_decl("BSEL", aml_int(bsel_val)));
+        notify_method = aml_method("DVNT", 2);
     }
 
     for (i = 0; i < ARRAY_SIZE(bus->devices); i += PCI_FUNC_MAX) {
@@ -642,11 +547,17 @@ static void build_append_pci_bus_devices(GArray *parent_scope, PCIBus *bus,
 
         if (!pdev) {
             if (bsel) { /* add hotplug slots for non present devices */
-                void *pcihp = acpi_data_push(bus_table, ACPI_PCIHP_SIZEOF);
-                memcpy(pcihp, ACPI_PCIHP_AML, ACPI_PCIHP_SIZEOF);
-                patch_pcihp(slot, pcihp);
-
-                build_append_pcihp_notify_entry(method, slot);
+                dev = aml_device("S%.02X", PCI_DEVFN(slot, 0));
+                aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
+                aml_append(dev, aml_name_decl("_ADR", aml_int(slot << 16)));
+                method = aml_method("_EJ0", 1);
+                aml_append(method,
+                    aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
+                );
+                aml_append(dev, method);
+                aml_append(parent_scope, dev);
+
+                build_append_pcihp_notify_entry(notify_method, slot);
             }
             continue;
         }
@@ -668,74 +579,87 @@ static void build_append_pci_bus_devices(GArray *parent_scope, PCIBus *bus,
             continue;
         }
 
+        /* start to compose PCI slot descriptor */
+        dev = aml_device("S%.02X", PCI_DEVFN(slot, 0));
+        aml_append(dev, aml_name_decl("_ADR", aml_int(slot << 16)));
+
         if (pc->class_id == PCI_CLASS_DISPLAY_VGA) {
+            /* add VGA specific AML methods */
+            int s3d;
+
             if (object_dynamic_cast(OBJECT(pdev), "qxl-vga")) {
-                void *pcihp = acpi_data_push(bus_table,
-                                             ACPI_PCIQXL_SIZEOF);
-                      memcpy(pcihp, ACPI_PCIQXL_AML, ACPI_PCIQXL_SIZEOF);
-                      patch_pciqxl(slot, pcihp);
+                s3d = 3;
             } else {
-                void *pcihp = acpi_data_push(bus_table,
-                                             ACPI_PCIVGA_SIZEOF);
-                memcpy(pcihp, ACPI_PCIVGA_AML, ACPI_PCIVGA_SIZEOF);
-                patch_pcivga(slot, pcihp);
+                s3d = 0;
             }
+
+            method = aml_method("_S1D", 0);
+            aml_append(method, aml_return(aml_int(0)));
+            aml_append(dev, method);
+
+            method = aml_method("_S2D", 0);
+            aml_append(method, aml_return(aml_int(0)));
+            aml_append(dev, method);
+
+            method = aml_method("_S3D", 0);
+            aml_append(method, aml_return(aml_int(s3d)));
+            aml_append(dev, method);
         } else if (hotplug_enabled_dev) {
-            void *pcihp = acpi_data_push(bus_table, ACPI_PCIHP_SIZEOF);
+            /* add _SUN/_EJ0 to make slot hotpluggable  */
+            aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
 
-            memcpy(pcihp, ACPI_PCIHP_AML, ACPI_PCIHP_SIZEOF);
-            patch_pcihp(slot, pcihp);
-            build_append_pcihp_notify_entry(method, slot);
+            method = aml_method("_EJ0", 1);
+            aml_append(method,
+                aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
+            );
+            aml_append(dev, method);
+
+            if (bsel) {
+                build_append_pcihp_notify_entry(notify_method, slot);
+            }
         } else if (bridge_in_acpi) {
+            /*
+             * device is coldplugged bridge,
+             * add child device descriptions into its scope
+             */
             PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(pdev));
-            void *pcihp = acpi_data_push(bus_table, ACPI_PCINOHP_SIZEOF);
 
-            memcpy(pcihp, ACPI_PCINOHP_AML, ACPI_PCINOHP_SIZEOF);
-            patch_pcinohp(slot, pcihp);
-            build_append_pci_bus_devices(bus_table, sec_bus, pcihp_bridge_en);
-        } else { /* non hotpluggable present devices */
-            void *pcihp = acpi_data_push(bus_table, ACPI_PCINOHP_SIZEOF);
-
-            memcpy(pcihp, ACPI_PCINOHP_AML, ACPI_PCINOHP_SIZEOF);
-            patch_pcinohp(slot, pcihp);
+            build_append_pci_bus_devices(dev, sec_bus, pcihp_bridge_en);
         }
+        /* slot descriptor has been composed, add it into parent context */
+        aml_append(parent_scope, dev);
     }
 
     if (bsel) {
-        build_append_and_cleanup_method(bus_table, method);
+        aml_append(parent_scope, notify_method);
     }
 
     /* Append PCNT method to notify about events on local and child buses.
      * Add unconditionally for root since DSDT expects it.
      */
-    method = build_alloc_method("PCNT", 0);
+    method = aml_method("PCNT", 0);
 
     /* If bus supports hotplug select it and notify about local events */
     if (bsel) {
-        build_append_byte(method, 0x70); /* StoreOp */
-        build_append_int(method, qint_get_int(qobject_to_qint(bsel)));
-        build_append_namestring(method, "BNUM");
-        build_append_namestring(method, "DVNT");
-        build_append_namestring(method, "PCIU");
-        build_append_int(method, 1); /* Device Check */
-        build_append_namestring(method, "DVNT");
-        build_append_namestring(method, "PCID");
-        build_append_int(method, 3); /* Eject Request */
+        int64_t bsel_val = qint_get_int(qobject_to_qint(bsel));
+        aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
+        aml_append(method,
+            aml_call2("DVNT", aml_name("PCIU"), aml_int(1) /* Device Check */)
+        );
+        aml_append(method,
+            aml_call2("DVNT", aml_name("PCID"), aml_int(3)/* Eject Request */)
+        );
     }
 
     /* Notify about child bus events in any case */
     if (pcihp_bridge_en) {
         QLIST_FOREACH(sec, &bus->child, sibling) {
-            build_append_namestring(method, "^S%.02X.PCNT",
-                                    sec->parent_dev->devfn);
+            int32_t devfn = sec->parent_dev->devfn;
+
+            aml_append(method, aml_name("^S%.02X.PCNT", devfn));
         }
     }
-
-    build_append_and_cleanup_method(bus_table, method);
-
-    build_package(bus_table, 0x10); /* ScopeOp */
-    build_append_array(parent_scope, bus_table);
-    build_free_array(bus_table);
+    aml_append(parent_scope, method);
 }
 
 static void
@@ -1087,9 +1011,10 @@ build_ssdt(GArray *table_data, GArray *linker,
             }
 
             if (bus) {
+                Aml *scope = aml_scope("PCI0");
                 /* Scan all PCI buses. Generate tables to support hotplug. */
-                build_append_pci_bus_devices(sb_scope->buf, bus,
-                                             pm->pcihp_bridge_en);
+                build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en);
+                aml_append(sb_scope, scope);
             }
         }
         aml_append(ssdt, sb_scope);
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 9b00568..e058a39 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -9,7 +9,6 @@ obj-y += kvmvapic.o
 obj-y += acpi-build.o
 hw/i386/acpi-build.o: hw/i386/acpi-build.c \
 	hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex \
-	hw/i386/ssdt-pcihp.hex \
 	hw/i386/ssdt-tpm.hex
 
 iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
diff --git a/hw/i386/ssdt-pcihp.dsl b/hw/i386/ssdt-pcihp.dsl
deleted file mode 100644
index ac91c05..0000000
--- a/hw/i386/ssdt-pcihp.dsl
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-ACPI_EXTRACT_ALL_CODE ssdp_pcihp_aml
-
-DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", "BXSSDTPCIHP", 0x1)
-{
-
-/****************************************************************
- * PCI hotplug
- ****************************************************************/
-
-    /* Objects supplied by DSDT */
-    External(\_SB.PCI0, DeviceObj)
-    External(\_SB.PCI0.PCEJ, MethodObj)
-    External(BSEL, IntObj)
-
-    Scope(\_SB.PCI0) {
-
-        /* Bulk generated PCI hotplug devices */
-        ACPI_EXTRACT_DEVICE_START ssdt_pcihp_start
-        ACPI_EXTRACT_DEVICE_END ssdt_pcihp_end
-        ACPI_EXTRACT_DEVICE_STRING ssdt_pcihp_name
-
-        // Extract the offsets of the device name, address dword and the slot
-        // name byte - we fill them in for each device.
-        Device(SAA) {
-            ACPI_EXTRACT_NAME_BYTE_CONST ssdt_pcihp_id
-            Name(_SUN, 0xAA)
-            ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcihp_adr
-            Name(_ADR, 0xAA0000)
-            Method(_EJ0, 1) {
-                PCEJ(BSEL, _SUN)
-            }
-        }
-
-        ACPI_EXTRACT_DEVICE_START ssdt_pcinohp_start
-        ACPI_EXTRACT_DEVICE_END ssdt_pcinohp_end
-        ACPI_EXTRACT_DEVICE_STRING ssdt_pcinohp_name
-
-        // Extract the offsets of the device name, address dword and the slot
-        // name byte - we fill them in for each device.
-        Device(SBB) {
-            ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcinohp_adr
-            Name(_ADR, 0xAA0000)
-        }
-
-        ACPI_EXTRACT_DEVICE_START ssdt_pcivga_start
-        ACPI_EXTRACT_DEVICE_END ssdt_pcivga_end
-        ACPI_EXTRACT_DEVICE_STRING ssdt_pcivga_name
-
-        // Extract the offsets of the device name, address dword and the slot
-        // name byte - we fill them in for each device.
-        Device(SCC) {
-            ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcivga_adr
-            Name(_ADR, 0xAA0000)
-            Method(_S1D, 0, NotSerialized) {
-                Return (0x00)
-            }
-            Method(_S2D, 0, NotSerialized) {
-                Return (0x00)
-            }
-            Method(_S3D, 0, NotSerialized) {
-                Return (0x00)
-            }
-        }
-
-        ACPI_EXTRACT_DEVICE_START ssdt_pciqxl_start
-        ACPI_EXTRACT_DEVICE_END ssdt_pciqxl_end
-        ACPI_EXTRACT_DEVICE_STRING ssdt_pciqxl_name
-
-        // Extract the offsets of the device name, address dword and the slot
-        // name byte - we fill them in for each device.
-        Device(SDD) {
-            ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pciqxl_adr
-            Name(_ADR, 0xAA0000)
-            Method(_S1D, 0, NotSerialized) {
-                Return (0x00)
-            }
-            Method(_S2D, 0, NotSerialized) {
-                Return (0x00)
-            }
-            Method(_S3D, 0, NotSerialized) {
-                Return (0x03)           // QXL
-            }
-        }
-    }
-}
-- 
MST

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

* [Qemu-devel] [PULL v3 21/26] pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (19 preceding siblings ...)
  2015-03-02 10:59 ` [Qemu-devel] [PULL v3 20/26] pc: acpi-build: drop template patching and create PCI bus tree dynamically Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 22/26] acpi: make build_*() routines static to aml-build.c Michael S. Tsirkin
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/ssdt-misc.hex.generated  | 139 ----------------------
 hw/i386/ssdt-pcihp.hex.generated | 251 ---------------------------------------
 2 files changed, 390 deletions(-)
 delete mode 100644 hw/i386/ssdt-misc.hex.generated
 delete mode 100644 hw/i386/ssdt-pcihp.hex.generated

diff --git a/hw/i386/ssdt-misc.hex.generated b/hw/i386/ssdt-misc.hex.generated
deleted file mode 100644
index 0b77ed4..0000000
--- a/hw/i386/ssdt-misc.hex.generated
+++ /dev/null
@@ -1,139 +0,0 @@
-static unsigned char acpi_pci64_length[] = {
-0x6f
-};
-static unsigned char acpi_pci32_start[] = {
-0x2f
-};
-static unsigned char acpi_pci64_valid[] = {
-0x43
-};
-static unsigned char ssdp_misc_aml[] = {
-0x53,
-0x53,
-0x44,
-0x54,
-0x77,
-0x0,
-0x0,
-0x0,
-0x1,
-0x40,
-0x42,
-0x58,
-0x50,
-0x43,
-0x0,
-0x0,
-0x42,
-0x58,
-0x53,
-0x53,
-0x44,
-0x54,
-0x53,
-0x55,
-0x1,
-0x0,
-0x0,
-0x0,
-0x49,
-0x4e,
-0x54,
-0x4c,
-0x7,
-0x11,
-0x14,
-0x20,
-0x10,
-0x42,
-0x5,
-0x5c,
-0x0,
-0x8,
-0x50,
-0x30,
-0x53,
-0x5f,
-0xc,
-0x78,
-0x56,
-0x34,
-0x12,
-0x8,
-0x50,
-0x30,
-0x45,
-0x5f,
-0xc,
-0x78,
-0x56,
-0x34,
-0x12,
-0x8,
-0x50,
-0x31,
-0x56,
-0x5f,
-0xa,
-0x12,
-0x8,
-0x50,
-0x31,
-0x53,
-0x5f,
-0x11,
-0xb,
-0xa,
-0x8,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x8,
-0x50,
-0x31,
-0x45,
-0x5f,
-0x11,
-0xb,
-0xa,
-0x8,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x8,
-0x50,
-0x31,
-0x4c,
-0x5f,
-0x11,
-0xb,
-0xa,
-0x8,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0,
-0x0
-};
-static unsigned char acpi_pci64_start[] = {
-0x4d
-};
-static unsigned char acpi_pci64_end[] = {
-0x5e
-};
-static unsigned char acpi_pci32_end[] = {
-0x39
-};
diff --git a/hw/i386/ssdt-pcihp.hex.generated b/hw/i386/ssdt-pcihp.hex.generated
deleted file mode 100644
index 72ffa84..0000000
--- a/hw/i386/ssdt-pcihp.hex.generated
+++ /dev/null
@@ -1,251 +0,0 @@
-static unsigned char ssdt_pcihp_name[] = {
-0x34
-};
-static unsigned char ssdt_pcivga_end[] = {
-0x99
-};
-static unsigned char ssdt_pcivga_name[] = {
-0x70
-};
-static unsigned char ssdt_pcihp_adr[] = {
-0x45
-};
-static unsigned char ssdt_pcinohp_end[] = {
-0x6d
-};
-static unsigned char ssdt_pcihp_end[] = {
-0x5c
-};
-static unsigned char ssdt_pciqxl_start[] = {
-0x99
-};
-static unsigned char ssdt_pcinohp_name[] = {
-0x5f
-};
-static unsigned char ssdp_pcihp_aml[] = {
-0x53,
-0x53,
-0x44,
-0x54,
-0xc6,
-0x0,
-0x0,
-0x0,
-0x1,
-0x70,
-0x42,
-0x58,
-0x50,
-0x43,
-0x0,
-0x0,
-0x42,
-0x58,
-0x53,
-0x53,
-0x44,
-0x54,
-0x50,
-0x43,
-0x1,
-0x0,
-0x0,
-0x0,
-0x49,
-0x4e,
-0x54,
-0x4c,
-0x15,
-0x11,
-0x13,
-0x20,
-0x10,
-0x41,
-0xa,
-0x5c,
-0x2e,
-0x5f,
-0x53,
-0x42,
-0x5f,
-0x50,
-0x43,
-0x49,
-0x30,
-0x5b,
-0x82,
-0x29,
-0x53,
-0x41,
-0x41,
-0x5f,
-0x8,
-0x5f,
-0x53,
-0x55,
-0x4e,
-0xa,
-0xaa,
-0x8,
-0x5f,
-0x41,
-0x44,
-0x52,
-0xc,
-0x0,
-0x0,
-0xaa,
-0x0,
-0x14,
-0x12,
-0x5f,
-0x45,
-0x4a,
-0x30,
-0x1,
-0x50,
-0x43,
-0x45,
-0x4a,
-0x42,
-0x53,
-0x45,
-0x4c,
-0x5f,
-0x53,
-0x55,
-0x4e,
-0x5b,
-0x82,
-0xf,
-0x53,
-0x42,
-0x42,
-0x5f,
-0x8,
-0x5f,
-0x41,
-0x44,
-0x52,
-0xc,
-0x0,
-0x0,
-0xaa,
-0x0,
-0x5b,
-0x82,
-0x2a,
-0x53,
-0x43,
-0x43,
-0x5f,
-0x8,
-0x5f,
-0x41,
-0x44,
-0x52,
-0xc,
-0x0,
-0x0,
-0xaa,
-0x0,
-0x14,
-0x8,
-0x5f,
-0x53,
-0x31,
-0x44,
-0x0,
-0xa4,
-0x0,
-0x14,
-0x8,
-0x5f,
-0x53,
-0x32,
-0x44,
-0x0,
-0xa4,
-0x0,
-0x14,
-0x8,
-0x5f,
-0x53,
-0x33,
-0x44,
-0x0,
-0xa4,
-0x0,
-0x5b,
-0x82,
-0x2b,
-0x53,
-0x44,
-0x44,
-0x5f,
-0x8,
-0x5f,
-0x41,
-0x44,
-0x52,
-0xc,
-0x0,
-0x0,
-0xaa,
-0x0,
-0x14,
-0x8,
-0x5f,
-0x53,
-0x31,
-0x44,
-0x0,
-0xa4,
-0x0,
-0x14,
-0x8,
-0x5f,
-0x53,
-0x32,
-0x44,
-0x0,
-0xa4,
-0x0,
-0x14,
-0x9,
-0x5f,
-0x53,
-0x33,
-0x44,
-0x0,
-0xa4,
-0xa,
-0x3
-};
-static unsigned char ssdt_pciqxl_adr[] = {
-0xa6
-};
-static unsigned char ssdt_pcinohp_adr[] = {
-0x69
-};
-static unsigned char ssdt_pcivga_adr[] = {
-0x7a
-};
-static unsigned char ssdt_pciqxl_name[] = {
-0x9c
-};
-static unsigned char ssdt_pcivga_start[] = {
-0x6d
-};
-static unsigned char ssdt_pciqxl_end[] = {
-0xc6
-};
-static unsigned char ssdt_pcihp_start[] = {
-0x31
-};
-static unsigned char ssdt_pcihp_id[] = {
-0x3e
-};
-static unsigned char ssdt_pcinohp_start[] = {
-0x5c
-};
-- 
MST

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

* [Qemu-devel] [PULL v3 22/26] acpi: make build_*() routines static to aml-build.c
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (20 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 21/26] pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 23/26] pci: Give a few helpers internal linkage Michael S. Tsirkin
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

build_*() routines were used for composing AML
structures manually in acpi-build.c but after
conversion to AML API they are not used outside
of aml-build.c anymore, so hide them from external
users.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/aml-build.h | 16 ----------------
 hw/acpi/aml-build.c         | 20 ++++++++++----------
 2 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 1187197..f6735ea 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -188,20 +188,4 @@ Aml *aml_resource_template(void);
 Aml *aml_field(const char *name, AmlFieldFlags flags);
 Aml *aml_varpackage(uint32_t num_elements);
 
-/* other helpers */
-GArray *build_alloc_array(void);
-void build_free_array(GArray *array);
-void build_prepend_byte(GArray *array, uint8_t val);
-void build_append_byte(GArray *array, uint8_t val);
-void build_append_array(GArray *array, GArray *val);
-
-void GCC_FMT_ATTR(2, 3)
-build_append_namestring(GArray *array, const char *format, ...);
-
-void
-build_prepend_package_length(GArray *package, unsigned length, bool incl_self);
-void build_package(GArray *package, uint8_t op);
-void build_append_int(GArray *table, uint64_t value);
-void build_extop_package(GArray *package, uint8_t op);
-
 #endif
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 60245e7..3e5949b 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -27,27 +27,27 @@
 #include "hw/acpi/aml-build.h"
 #include "qemu/bswap.h"
 
-GArray *build_alloc_array(void)
+static GArray *build_alloc_array(void)
 {
     return g_array_new(false, true /* clear */, 1);
 }
 
-void build_free_array(GArray *array)
+static void build_free_array(GArray *array)
 {
     g_array_free(array, true);
 }
 
-void build_prepend_byte(GArray *array, uint8_t val)
+static void build_prepend_byte(GArray *array, uint8_t val)
 {
     g_array_prepend_val(array, val);
 }
 
-void build_append_byte(GArray *array, uint8_t val)
+static void build_append_byte(GArray *array, uint8_t val)
 {
     g_array_append_val(array, val);
 }
 
-void build_append_array(GArray *array, GArray *val)
+static void build_append_array(GArray *array, GArray *val)
 {
     g_array_append_vals(array, val->data, val->len);
 }
@@ -141,7 +141,7 @@ build_append_namestringv(GArray *array, const char *format, va_list ap)
     g_strfreev(segs);
 }
 
-void build_append_namestring(GArray *array, const char *format, ...)
+static void build_append_namestring(GArray *array, const char *format, ...)
 {
     va_list ap;
 
@@ -158,7 +158,7 @@ enum {
     PACKAGE_LENGTH_4BYTE_SHIFT = 20,
 };
 
-void
+static void
 build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
 {
     uint8_t byte;
@@ -226,13 +226,13 @@ build_append_pkg_length(GArray *array, unsigned length, bool incl_self)
     build_free_array(tmp);
 }
 
-void build_package(GArray *package, uint8_t op)
+static void build_package(GArray *package, uint8_t op)
 {
     build_prepend_package_length(package, package->len, true);
     build_prepend_byte(package, op);
 }
 
-void build_extop_package(GArray *package, uint8_t op)
+static void build_extop_package(GArray *package, uint8_t op)
 {
     build_package(package, op);
     build_prepend_byte(package, 0x5B); /* ExtOpPrefix */
@@ -248,7 +248,7 @@ static void build_append_int_noprefix(GArray *table, uint64_t value, int size)
     }
 }
 
-void build_append_int(GArray *table, uint64_t value)
+static void build_append_int(GArray *table, uint64_t value)
 {
     if (value == 0x00) {
         build_append_byte(table, 0x00); /* ZeroOp */
-- 
MST

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

* [Qemu-devel] [PULL v3 23/26] pci: Give a few helpers internal linkage
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (21 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 22/26] acpi: make build_*() routines static to aml-build.c Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 24/26] pci-hotplug-old: Has been dead for five major releases, bury Michael S. Tsirkin
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Markus Armbruster, Anthony Liguori

From: Markus Armbruster <armbru@redhat.com>

None of them should be used in new code.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/pci/pci.h |  7 -------
 hw/pci/pci.c         | 14 +++++++-------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 3164fc3..be2d9b8 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -371,9 +371,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                           PCIINTxRoutingNotifier notifier);
 void pci_device_reset(PCIDevice *dev);
 
-PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
-                        const char *default_model,
-                        const char *default_devaddr);
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
                                const char *default_devaddr);
@@ -403,12 +400,8 @@ PCIBus *pci_device_root_bus(const PCIDevice *d);
 const char *pci_root_bus_path(PCIDevice *dev);
 PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn);
 int pci_qdev_find_device(const char *id, PCIDevice **pdev);
-PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
 void pci_bus_get_w64_range(PCIBus *bus, Range *range);
 
-int pci_parse_devaddr(const char *addr, int *domp, int *busp,
-                      unsigned int *slotp, unsigned int *funcp);
-
 void pci_device_deassert_intx(PCIDevice *dev);
 
 typedef AddressSpace *(*PCIIOMMUFunc)(PCIBus *, void *, int);
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index b1f3cea..cc5d946 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -539,8 +539,8 @@ static void pci_set_default_subsystem_id(PCIDevice *pci_dev)
  * Parse [[<domain>:]<bus>:]<slot>, return -1 on error if funcp == NULL
  *       [[<domain>:]<bus>:]<slot>.<func>, return -1 on error
  */
-int pci_parse_devaddr(const char *addr, int *domp, int *busp,
-                      unsigned int *slotp, unsigned int *funcp)
+static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
+                             unsigned int *slotp, unsigned int *funcp)
 {
     const char *p;
     char *e;
@@ -598,7 +598,8 @@ int pci_parse_devaddr(const char *addr, int *domp, int *busp,
     return 0;
 }
 
-PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
+static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
+                                 const char *devaddr)
 {
     int dom, bus;
     unsigned slot;
@@ -1610,10 +1611,9 @@ static const char * const pci_nic_names[] = {
 };
 
 /* Initialize a PCI NIC.  */
-/* FIXME callers should check for failure, but don't */
-PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
-                        const char *default_model,
-                        const char *default_devaddr)
+static PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr)
 {
     const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
     PCIBus *bus;
-- 
MST

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

* [Qemu-devel] [PULL v3 24/26] pci-hotplug-old: Has been dead for five major releases, bury
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (22 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 23/26] pci: Give a few helpers internal linkage Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 25/26] acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb() Michael S. Tsirkin
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Markus Armbruster, Anthony Liguori, Luiz Capitulino

From: Markus Armbruster <armbru@redhat.com>

Commit 79ca616 (v1.6.0) accidentally disabled legacy x86-only HMP
commands pci_add, pci_del: it defined CONFIG_PCI_HOTPLUG only as make
variable, not as preprocessor macro, killing the code conditional on
defined(CONFIG_PCI_HOTPLUG_OLD).

In all this time, nobody reported the loss.  I only noticed it when I
tried to test some error reporting change that forced me to touch this
old crap again.

Fun: git-log hw/pci/pci-hotplug-old.c shows our faith in the backward
compatibility god has been strong enough to sacrifice at its altar
about a dozen times, but not strong enough to even once verify the
legacy feature's still there, let alone works.

Remove the commands along with the code backing them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/sysemu/blockdev.h          |   2 -
 include/sysemu/sysemu.h            |   5 -
 device-hotplug.c                   |   7 +-
 hw/pci/pci-hotplug-old.c           | 342 -------------------------------------
 stubs/pci-drive-hot-add.c          |  10 --
 default-configs/i386-softmmu.mak   |   1 -
 default-configs/x86_64-softmmu.mak |   1 -
 hmp-commands.hx                    |  32 ----
 hw/pci/Makefile.objs               |   2 -
 stubs/Makefile.objs                |   1 -
 10 files changed, 3 insertions(+), 400 deletions(-)
 delete mode 100644 hw/pci/pci-hotplug-old.c
 delete mode 100644 stubs/pci-drive-hot-add.c

diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index 0c62643..7ca59b5 100644
--- a/include/sysemu/blockdev.h
+++ b/include/sysemu/blockdev.h
@@ -63,8 +63,6 @@ DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type);
 
 /* device-hotplug */
 
-DriveInfo *add_init_drive(const char *opts);
-
 void qmp_change_blockdev(const char *device, const char *filename,
                          const char *format, Error **errp);
 void hmp_commit(Monitor *mon, const QDict *qdict);
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 1ab7063..e7135e1 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -174,11 +174,6 @@ extern int nb_option_roms;
 extern const char *prom_envs[MAX_PROM_ENVS];
 extern unsigned int nb_prom_envs;
 
-/* pci-hotplug */
-void hmp_pci_add(Monitor *mon, const QDict *qdict);
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo);
-void hmp_pci_del(Monitor *mon, const QDict *qdict);
-
 /* generic hotplug */
 void hmp_drive_add(Monitor *mon, const QDict *qdict);
 
diff --git a/device-hotplug.c b/device-hotplug.c
index 833d874..68b9496 100644
--- a/device-hotplug.c
+++ b/device-hotplug.c
@@ -30,7 +30,7 @@
 #include "sysemu/sysemu.h"
 #include "monitor/monitor.h"
 
-DriveInfo *add_init_drive(const char *optstr)
+static DriveInfo *add_init_drive(const char *optstr)
 {
     DriveInfo *dinfo;
     QemuOpts *opts;
@@ -69,9 +69,8 @@ void hmp_drive_add(Monitor *mon, const QDict *qdict)
         monitor_printf(mon, "OK\n");
         break;
     default:
-        if (pci_drive_hot_add(mon, qdict, dinfo)) {
-            goto err;
-        }
+        monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
+        goto err;
     }
     return;
 
diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
deleted file mode 100644
index beea6d2..0000000
--- a/hw/pci/pci-hotplug-old.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Deprecated PCI hotplug interface support
- * This covers the old pci_add / pci_del command, whereas the more general
- * device_add / device_del commands are now preferred.
- *
- * Copyright (c) 2004 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "hw/hw.h"
-#include "hw/boards.h"
-#include "hw/pci/pci.h"
-#include "net/net.h"
-#include "hw/i386/pc.h"
-#include "monitor/monitor.h"
-#include "hw/scsi/scsi.h"
-#include "hw/virtio/virtio-blk.h"
-#include "qemu/config-file.h"
-#include "sysemu/block-backend.h"
-#include "qapi/error.h"
-
-static int pci_read_devaddr(Monitor *mon, const char *addr,
-                            int *busp, unsigned *slotp)
-{
-    int dom;
-
-    /* strip legacy tag */
-    if (!strncmp(addr, "pci_addr=", 9)) {
-        addr += 9;
-    }
-    if (pci_parse_devaddr(addr, &dom, busp, slotp, NULL)) {
-        monitor_printf(mon, "Invalid pci address\n");
-        return -1;
-    }
-    if (dom != 0) {
-        monitor_printf(mon, "Multiple PCI domains not supported, use device_add\n");
-        return -1;
-    }
-    return 0;
-}
-
-static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
-                                       const char *devaddr,
-                                       const char *opts_str)
-{
-    Error *local_err = NULL;
-    QemuOpts *opts;
-    PCIBus *root = pci_find_primary_bus();
-    PCIBus *bus;
-    int ret, devfn;
-
-    if (!root) {
-        monitor_printf(mon, "no primary PCI bus (if there are multiple"
-                       " PCI roots, you must use device_add instead)");
-        return NULL;
-    }
-
-    bus = pci_get_bus_devfn(&devfn, root, devaddr);
-    if (!bus) {
-        monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
-        return NULL;
-    }
-    if (!qbus_is_hotpluggable(BUS(bus))) {
-        monitor_printf(mon, "PCI bus doesn't support hotplug\n");
-        return NULL;
-    }
-
-    opts = qemu_opts_parse(qemu_find_opts("net"), opts_str ? opts_str : "", 0);
-    if (!opts) {
-        return NULL;
-    }
-
-    qemu_opt_set(opts, "type", "nic");
-
-    ret = net_client_init(opts, 0, &local_err);
-    if (local_err) {
-        qerror_report_err(local_err);
-        error_free(local_err);
-        return NULL;
-    }
-    if (nd_table[ret].devaddr) {
-        monitor_printf(mon, "Parameter addr not supported\n");
-        return NULL;
-    }
-    return pci_nic_init(&nd_table[ret], root, "rtl8139", devaddr);
-}
-
-static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
-                        DriveInfo *dinfo, int printinfo)
-{
-    SCSIBus *scsibus;
-    SCSIDevice *scsidev;
-    Error *local_err = NULL;
-
-    scsibus = (SCSIBus *)
-        object_dynamic_cast(OBJECT(QLIST_FIRST(&adapter->child_bus)),
-                            TYPE_SCSI_BUS);
-    if (!scsibus) {
-	error_report("Device is not a SCSI adapter");
-	return -1;
-    }
-
-    /*
-     * drive_init() tries to find a default for dinfo->unit.  Doesn't
-     * work at all for hotplug though as we assign the device to a
-     * specific bus instead of the first bus with spare scsi ids.
-     *
-     * Ditch the calculated value and reload from option string (if
-     * specified).
-     */
-    dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1);
-    dinfo->bus = scsibus->busnr;
-    scsidev = scsi_bus_legacy_add_drive(scsibus,
-                                        blk_by_legacy_dinfo(dinfo),
-                                        dinfo->unit, false, -1, NULL,
-                                        &local_err);
-    if (!scsidev) {
-        error_report_err(local_err);
-        return -1;
-    }
-    dinfo->unit = scsidev->id;
-
-    if (printinfo)
-        monitor_printf(mon, "OK bus %d, unit %d\n",
-                       scsibus->busnr, scsidev->id);
-    return 0;
-}
-
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo)
-{
-    int pci_bus;
-    unsigned slot;
-    PCIBus *root = pci_find_primary_bus();
-    PCIDevice *dev;
-    const char *pci_addr = qdict_get_str(qdict, "pci_addr");
-
-    switch (dinfo->type) {
-    case IF_SCSI:
-        if (!root) {
-            monitor_printf(mon, "no primary PCI bus (if there are multiple"
-                           " PCI roots, you must use device_add instead)");
-            goto err;
-        }
-        if (pci_read_devaddr(mon, pci_addr, &pci_bus, &slot)) {
-            goto err;
-        }
-        dev = pci_find_device(root, pci_bus, PCI_DEVFN(slot, 0));
-        if (!dev) {
-            monitor_printf(mon, "no pci device with address %s\n", pci_addr);
-            goto err;
-        }
-        if (scsi_hot_add(mon, &dev->qdev, dinfo, 1) != 0) {
-            goto err;
-        }
-        break;
-    default:
-        monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
-        goto err;
-    }
-
-    return 0;
-err:
-    return -1;
-}
-
-static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
-                                           const char *devaddr,
-                                           const char *opts)
-{
-    PCIDevice *dev;
-    DriveInfo *dinfo = NULL;
-    int type = -1;
-    char buf[128];
-    PCIBus *root = pci_find_primary_bus();
-    PCIBus *bus;
-    int devfn;
-
-    if (get_param_value(buf, sizeof(buf), "if", opts)) {
-        if (!strcmp(buf, "scsi"))
-            type = IF_SCSI;
-        else if (!strcmp(buf, "virtio")) {
-            type = IF_VIRTIO;
-        } else {
-            monitor_printf(mon, "type %s not a hotpluggable PCI device.\n", buf);
-            return NULL;
-        }
-    } else {
-        monitor_printf(mon, "no if= specified\n");
-        return NULL;
-    }
-
-    if (get_param_value(buf, sizeof(buf), "file", opts)) {
-        dinfo = add_init_drive(opts);
-        if (!dinfo)
-            return NULL;
-        if (dinfo->devaddr) {
-            monitor_printf(mon, "Parameter addr not supported\n");
-            return NULL;
-        }
-    } else {
-        dinfo = NULL;
-    }
-
-    if (!root) {
-        monitor_printf(mon, "no primary PCI bus (if there are multiple"
-                       " PCI roots, you must use device_add instead)");
-        return NULL;
-    }
-    bus = pci_get_bus_devfn(&devfn, root, devaddr);
-    if (!bus) {
-        monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
-        return NULL;
-    }
-    if (!qbus_is_hotpluggable(BUS(bus))) {
-        monitor_printf(mon, "PCI bus doesn't support hotplug\n");
-        return NULL;
-    }
-
-    switch (type) {
-    case IF_SCSI:
-        dev = pci_create(bus, devfn, "lsi53c895a");
-        if (qdev_init(&dev->qdev) < 0)
-            dev = NULL;
-        if (dev && dinfo) {
-            if (scsi_hot_add(mon, &dev->qdev, dinfo, 0) != 0) {
-                qdev_unplug(&dev->qdev, NULL);
-                dev = NULL;
-            }
-        }
-        break;
-    case IF_VIRTIO:
-        if (!dinfo) {
-            monitor_printf(mon, "virtio requires a backing file/device.\n");
-            return NULL;
-        }
-        dev = pci_create(bus, devfn, "virtio-blk-pci");
-        if (qdev_prop_set_drive(&dev->qdev, "drive",
-                                blk_by_legacy_dinfo(dinfo)) < 0) {
-            object_unparent(OBJECT(dev));
-            dev = NULL;
-            break;
-        }
-        if (qdev_init(&dev->qdev) < 0)
-            dev = NULL;
-        break;
-    default:
-        dev = NULL;
-    }
-    return dev;
-}
-
-void hmp_pci_add(Monitor *mon, const QDict *qdict)
-{
-    PCIDevice *dev = NULL;
-    const char *pci_addr = qdict_get_str(qdict, "pci_addr");
-    const char *type = qdict_get_str(qdict, "type");
-    const char *opts = qdict_get_try_str(qdict, "opts");
-
-    /* strip legacy tag */
-    if (!strncmp(pci_addr, "pci_addr=", 9)) {
-        pci_addr += 9;
-    }
-
-    if (!opts) {
-        opts = "";
-    }
-
-    if (!strcmp(pci_addr, "auto"))
-        pci_addr = NULL;
-
-    if (strcmp(type, "nic") == 0) {
-        dev = qemu_pci_hot_add_nic(mon, pci_addr, opts);
-    } else if (strcmp(type, "storage") == 0) {
-        dev = qemu_pci_hot_add_storage(mon, pci_addr, opts);
-    } else {
-        monitor_printf(mon, "invalid type: %s\n", type);
-    }
-
-    if (dev) {
-        monitor_printf(mon, "OK root bus %s, bus %d, slot %d, function %d\n",
-                       pci_root_bus_path(dev),
-                       pci_bus_num(dev->bus), PCI_SLOT(dev->devfn),
-                       PCI_FUNC(dev->devfn));
-    } else
-        monitor_printf(mon, "failed to add %s\n", opts);
-}
-
-static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
-{
-    PCIBus *root = pci_find_primary_bus();
-    PCIDevice *d;
-    int bus;
-    unsigned slot;
-    Error *local_err = NULL;
-
-    if (!root) {
-        monitor_printf(mon, "no primary PCI bus (if there are multiple"
-                       " PCI roots, you must use device_del instead)");
-        return -1;
-    }
-
-    if (pci_read_devaddr(mon, pci_addr, &bus, &slot)) {
-        return -1;
-    }
-
-    d = pci_find_device(root, bus, PCI_DEVFN(slot, 0));
-    if (!d) {
-        monitor_printf(mon, "slot %d empty\n", slot);
-        return -1;
-    }
-
-    qdev_unplug(&d->qdev, &local_err);
-    if (local_err) {
-        monitor_printf(mon, "%s\n", error_get_pretty(local_err));
-        error_free(local_err);
-        return -1;
-    }
-
-    return 0;
-}
-
-void hmp_pci_del(Monitor *mon, const QDict *qdict)
-{
-    pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
-}
diff --git a/stubs/pci-drive-hot-add.c b/stubs/pci-drive-hot-add.c
deleted file mode 100644
index 1d98145..0000000
--- a/stubs/pci-drive-hot-add.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <monitor/monitor.h>
-#include <sysemu/sysemu.h>
-#include <sysemu/blockdev.h>
-
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo)
-{
-    /* On non-x86 we don't do PCI hotplug */
-    monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
-    return -1;
-}
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index bd99af9..f5634bf 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -26,7 +26,6 @@ CONFIG_APPLESMC=y
 CONFIG_I8259=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_PCI_HOTPLUG_OLD=y
 CONFIG_MC146818RTC=y
 CONFIG_PAM=y
 CONFIG_PCI_PIIX=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index e7c2734..41990f7 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -26,7 +26,6 @@ CONFIG_APPLESMC=y
 CONFIG_I8259=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_PCI_HOTPLUG_OLD=y
 CONFIG_MC146818RTC=y
 CONFIG_PAM=y
 CONFIG_PCI_PIIX=y
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 81f276b..d5022d8 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1149,38 +1149,6 @@ STEXI
 Add drive to PCI storage controller.
 ETEXI
 
-#if defined(CONFIG_PCI_HOTPLUG_OLD)
-    {
-        .name       = "pci_add",
-        .args_type  = "pci_addr:s,type:s,opts:s?",
-        .params     = "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
-        .help       = "hot-add PCI device",
-        .mhandler.cmd = hmp_pci_add,
-    },
-#endif
-
-STEXI
-@item pci_add
-@findex pci_add
-Hot-add PCI device.
-ETEXI
-
-#if defined(CONFIG_PCI_HOTPLUG_OLD)
-    {
-        .name       = "pci_del",
-        .args_type  = "pci_addr:s",
-        .params     = "[[<domain>:]<bus>:]<slot>",
-        .help       = "hot remove PCI device",
-        .mhandler.cmd = hmp_pci_del,
-    },
-#endif
-
-STEXI
-@item pci_del
-@findex pci_del
-Hot remove PCI device.
-ETEXI
-
     {
         .name       = "pcie_aer_inject_error",
         .args_type  = "advisory_non_fatal:-a,correctable:-c,"
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index 80f8aa6..9f905e6 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -7,5 +7,3 @@ common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
 
 common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
 common-obj-$(CONFIG_ALL) += pci-stub.o
-
-common-obj-$(CONFIG_PCI_HOTPLUG_OLD) += pci-hotplug-old.o
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 5e347d0..8beff4c 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -24,7 +24,6 @@ stub-obj-y += mon-printf.o
 stub-obj-y += mon-set-error.o
 stub-obj-y += monitor-init.o
 stub-obj-y += notify-event.o
-stub-obj-y += pci-drive-hot-add.o
 stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
 stub-obj-y += qtest.o
 stub-obj-y += reset.o
-- 
MST

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

* [Qemu-devel] [PULL v3 25/26] acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (23 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 24/26] pci-hotplug-old: Has been dead for five major releases, bury Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 26/26] acpi-test-data: update after pci rewrite Michael S. Tsirkin
  2015-03-02 14:32 ` [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mammedov, Zhu Guihua, Anthony Liguori, Tang Chen

From: Tang Chen <tangchen@cn.fujitsu.com>

Replace string "slot" in acpi_memory_plug_cb() with macro PC_DIMM_SLOT_PROP.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/acpi/memory_hotplug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index ed39241..c6580da 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -168,7 +168,8 @@ void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
 {
     MemStatus *mdev;
     Error *local_err = NULL;
-    int slot = object_property_get_int(OBJECT(dev), "slot", &local_err);
+    int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
+                                       &local_err);
 
     if (local_err) {
         error_propagate(errp, local_err);
-- 
MST

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

* [Qemu-devel] [PULL v3 26/26] acpi-test-data: update after pci rewrite
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (24 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 25/26] acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb() Michael S. Tsirkin
@ 2015-03-02 11:00 ` Michael S. Tsirkin
  2015-03-02 14:32 ` [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
  26 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 11:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori

more trivial changes as more code has been rewritten in C.
we also got rid of extra Scope operators.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/SSDT         | Bin 2480 -> 2476 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4351 -> 4335 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 685 -> 681 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 702 -> 698 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT
index dc5be2497b6c2015d7cbabb1ff0cd13e02b3e0e4..87c3e9fc0271f2b5826877a9f931c2428838f8a7 100644
GIT binary patch
delta 56
zcmdlWyhfNSIM^j*4JQKwBj-l0Xhuf&&1sCDj1s>20nVNV98STmJ`B-K+`$G0@f`7v
ME<u}5Gd*Pk0F%WI{r~^~

delta 60
zcmZ1@yg`^NIM^j*11AFm<DZRO(Tt4Vo6{IQ8D$&`0-QY!IGloAeHfyf_=61$;yL0S
QU4nQR7#KDmXL`y80P^Dx{r~^~

diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge
index ca7f63cb4e48bd95418f68daf1b7e254d5bcf8c2..325899a757221b732ec94101301d782b577b28a3 100644
GIT binary patch
delta 115
zcmeyb_+F7KIM^lRy#NCPW6(yf7)Hh)o6{LR8O5IjIC~m!I0d`<Fhn<T2OAi~bHqEk
z1Wi88q_5#$7Hnt%;qx#sFf)LaF-AA3K$HcC`Y}Kh8?uUVX#^X9)B*)J`!R3i1pr(r
B9=QMj

delta 129
zcmaE__+ODLIM^lRzW@UR<CTqEF^r5qH>WdtGD<%UaP~Cda0+(yVTf+x4>mA}=ZJT7
z3F2X3V3>TIN#B@1*w6wl#LOVzT?Q5aX<&?Q(u8OT4)x<=K<HCsmEbf0=>mywwqxGN
F3jplmASnO<

diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT
index 749f368e3034bfb491dcd8ced37936e0dcbba02a..6a5c0423b93dd9eda038dc4fd4af283f6bba9745 100644
GIT binary patch
delta 49
zcmZ3>x{{SEIM^j*B@+V!<Gzht{EUnao23{%8HL<f0-QY!qMNvb4GiKr;vHRrCRZ|<
F001vN3>g3b

delta 53
zcmZ3<x|WqIIM^j*EfWI+<D!jR{EUn)o23{%8O6L<0-QY!qMP`G4GiKr;vHRrco-NM
JCYLgq003C=3>g3b

diff --git a/tests/acpi-test-data/q35/SSDT.bridge b/tests/acpi-test-data/q35/SSDT.bridge
index c552782f5bcc57094a7d1375b67979b2efa48f1c..5fc83a034002df64500970fa64f07b58bc15f3ea 100644
GIT binary patch
delta 49
zcmdnTx{H-7IM^j*7ZU>mW86kAenv*e%~Fh>j6&|L0nVNV(M{aJ1_tpQ@s2J*lPj5A
E0V{qC00000

delta 53
zcmdnRx{sABIM^j*9}@!uqtiw%env*u%~Fh>jAGub0nVNV(M|lp1_tpQ@s2J*JPZsB
IlS`Rg0aS_%00000

-- 
MST

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

* Re: [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups
  2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
                   ` (25 preceding siblings ...)
  2015-03-02 11:00 ` [Qemu-devel] [PULL v3 26/26] acpi-test-data: update after pci rewrite Michael S. Tsirkin
@ 2015-03-02 14:32 ` Michael S. Tsirkin
  2015-03-02 19:03   ` Michael S. Tsirkin
  26 siblings, 1 reply; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 14:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

Igor noticed a problem on hosts without iasl.
I will redo this later.

On Mon, Mar 02, 2015 at 11:58:09AM +0100, Michael S. Tsirkin wrote:
> Hello, Peter!
> 
> This should be the last big pull as we are entering hard freeze.
> 
> This is an update of my previous pull request from
> http://mid.gmane.org/20150226165911.GA20287@redhat.com
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream_rebased
> as the tree was not rebased since, you can either do both pulls or
> only this latest pull, result will be exactly the same.
> 
> Note: I only included here the extra 26 patches, on top of what was previously posted
> http://mid.gmane.org/1424295164-4774-1-git-send-email-mst@redhat.com
> if you merge PULL v2 first, you will see just these 26 patches.
> 
> I hope all this helps reduce the amount of noise rather
> than increase it.
> 
> Note: these patches remove some generated files that we previously
> compiled. Our build system doesn't handle this well for incremental
> builds, resulting in build errors. This is not new, incremental
> builds aren't 100% reliable. You can find and remove the
> stale .d files from the removed sources, this will fix it -
> for example, if you get an error about a missing ssdt-misc.dsl,
> find and remove ssdt-misc.d in output directory.
> 
> The following changes since commit 11d39a131020cc5c54ff9bc86d3259f7d32bf849:
> 
>   Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20150218' into staging (2015-02-26 09:08:54 +0000)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> 
> for you to fetch changes up to e32dccddb0b1fa335bf251c155e907f9d47accfd:
> 
>   acpi-test-data: update after pci rewrite (2015-03-01 19:41:50 +0100)
> 
> ----------------------------------------------------------------
> pci, pc, virtio fixes and cleanups
> 
> Last pull for hard freeze.
> 
> A bunch of fixes all over the place.
> All of ACPI refactoring has been merged.
> Legacy pci commands have been dropped.
> 
> Additionally, this includes patches from soft-freeze
> (which apparently haven't been merged yet):
> 
> a bunch of fixes all over the place
> virtio header cleanup
> initial patches from virtio-1.0 branch
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> ----------------------------------------------------------------
> Cornelia Huck (3):
>       virtio: cull virtio_bus_set_vdev_features
>       virtio: feature bit manipulation helpers
>       virtio: add feature checking helpers
> 
> Denis V. Lunev (1):
>       balloon: call qdev_alias_all_properties for proxy dev in balloon class init
> 
> Igor Mammedov (59):
>       acpi: move generic aml building helpers into dedictated file
>       acpi: add build_append_namestring() helper
>       acpi: drop min-bytes in build_package()
>       pc: acpi-build: update linker on guest access
>       pc: acpi-build: migrate RSDP table
>       pc: acpi: use local var for accessing ACPI tables blob in acpi_build()
>       acpi: introduce AML composer aml_append()
>       acpi: add aml_scope() term
>       pc: acpi-build: use aml_scope() for \_SB scope
>       acpi: add aml_device() term
>       acpi: add aml_method() term
>       acpi: add aml_if() term
>       acpi: add aml_name() & aml_name_decl() term
>       acpi: add aml_int() term
>       acpi: add aml_return() term
>       acpi: add aml_arg() term
>       acpi: add aml_store() term
>       acpi: add aml_and() term
>       acpi: add aml_notify() term
>       acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers
>       acpi: add aml_package() term
>       pc: acpi-build: generate _S[345] packages dynamically
>       acpi: add aml_buffer() term
>       acpi: add aml_resource_template() helper
>       acpi: add aml_io() helper
>       acpi: include PkgLength size only when requested
>       acpi: add aml_operation_region() term
>       acpi: add aml_field() & aml_named_field() terms
>       acpi: add aml_local() term
>       acpi: add aml_string() term
>       pc: acpi-build: generate pvpanic device description dynamically
>       acpi: add aml_varpackage() term
>       acpi: add aml_equal() term
>       acpi: add aml_processor() term
>       acpi: add aml_eisaid() term
>       pc: acpi-build: drop template patching and CPU hotplug objects dynamically
>       pc: acpi-build: create CPU hotplug IO region dynamically
>       acpi: add aml_reserved_field() term
>       pc: acpi-build: drop template patching and memory hotplug objects dynamically
>       pc: acpi-build: create memory hotplug IO region dynamically
>       acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms
>       pc: pcihp: expose MMIO base and len as properties
>       pc: acpi-build: reserve PCIHP MMIO resources
>       pc: acpi-build: create PCI0._CRS dynamically
>       pc: acpi: drop manual hole punching for PCI hotplug resources
>       pc: acpi: drop manual hole punching for CPU hotplug resources
>       pc: acpi: drop manual hole punching for GPE0 resources
>       pc: acpi-build: drop remaining ssdt_misc template
>       acpi: add acpi_irq_no_flags() term
>       pc: export applesmc IO port/len
>       pc: acpi-build: drop template patching and create Device(SMC) dynamically
>       tests: ACPI test blobs update due to PCI0._CRS changes
>       tests: bios-tables-test: add support for testing bridges
>       tests: add ACPI blobs for qemu with bridge cases
>       pc: acpi-build: simplify PCI bus tree generation
>       tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation
>       pc: acpi-build: drop template patching and create PCI bus tree dynamically
>       pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs
>       acpi: make build_*() routines static to aml-build.c
> 
> Markus Armbruster (13):
>       pci: Convert core to realize
>       pci: Permit incremental conversion of device models to realize
>       pci: Trivial device model conversions to realize
>       pcnet: pcnet_common_init() always returns 0, change to void
>       pcnet: Convert to realize
>       serial-pci: Convert to realize
>       ide/ich: Convert to realize
>       cirrus-vga: Convert to realize
>       qxl: Convert to realize
>       pci-assign: Convert to realize
>       qdev: Don't exit when running into bad -global
>       pci: Give a few helpers internal linkage
>       pci-hotplug-old: Has been dead for five major releases, bury
> 
> Michael S. Tsirkin (33):
>       acpi-build: fix memory leak with bridge hp off
>       bios linker: validate pointer within table
>       acpi: update RSDP on guest access
>       exec: round up size on MR resize
>       acpi-build: fix ACPI RAM management
>       acpi: has_immutable_rsdp->!rsdp_in_ram
>       acpi-build: simplify rsdp management for legacy
>       scripts/update-linux-headers.sh: pull virtio hdrs
>       include: import virtio headers from linux 4.0
>       virtio: use standard virtio_ring.h
>       virtio: use standard-headers
>       virtio-balloon: use standard headers
>       virtio-9p: use standard headers
>       virtio-blk: switch to standard-headers
>       virtio-net,tap: use standard-headers
>       virtio-rng: use standard-headers
>       virtio-scsi: use standard-headers
>       virtio-serial: switch to standard-headers
>       update-linux-headers: use standard-headers
>       linux-headers: use standard-headers
>       virtio-pci: use standard headers
>       scripts: add arch specific standard-headers
>       standard-headers: add s390 virtio headers
>       s390: use standard headers
>       acpi-build: skip hotplugged bridges
>       update-linux-headers.sh: s/__inline__/inline/
>       virtio-serial-bus.c: drop virtio_ids.h
>       standard-headers: include stdint.h
>       virtio_ring.h: s/__inline__/inline/
>       acpi: update generated hex files
>       acpi: drop unused generated files
>       acpi-test: update expected files
>       acpi-test-data: update after pci rewrite
> 
> Peter Krempa (2):
>       vl.c: Fix error messages when parsing maxmem parameters
>       pc: memory: Validate alignment of maxram_size to page size
> 
> Stefan Berger (5):
>       tpm: Extend sts register to 32 bit
>       tpm: Allow 32 & 16 bit accesses to the registers
>       tpm: Support for XFIFO register
>       tpm: Support for TIS selftest done flag
>       tpm: Support for capability flags of TIS 1.3
> 
> Tang Chen (6):
>       acpi, pc: Add hotunplug request cb for pc machine.
>       acpi, ich9: Add hotunplug request cb for ich9.
>       acpi, pc: Add unplug cb for pc machine.
>       acpi, ich9: Add unplug cb for ich9.
>       acpi, piix4: Add unplug cb for piix4.
>       acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().
> 
>  hw/9pfs/virtio-9p.h                                |   18 +-
>  hw/net/pcnet.h                                     |    2 +-
>  hw/s390x/s390-virtio-bus.h                         |   36 +-
>  hw/s390x/s390-virtio.h                             |    7 +-
>  hw/tpm/tpm_int.h                                   |    1 +
>  hw/tpm/tpm_tis.h                                   |    2 +-
>  include/hw/acpi/aml-build.h                        |  191 ++++
>  include/hw/acpi/ich9.h                             |    4 +
>  include/hw/acpi/pc-hotplug.h                       |    1 +
>  include/hw/acpi/pcihp.h                            |    7 +-
>  include/hw/i386/pc.h                               |    1 +
>  include/hw/isa/isa.h                               |   11 +-
>  include/hw/pci/pci.h                               |   10 +-
>  include/hw/qdev-properties.h                       |    4 +-
>  include/hw/virtio/dataplane/vring-accessors.h      |    2 +-
>  include/hw/virtio/dataplane/vring.h                |    2 +-
>  include/hw/virtio/virtio-balloon.h                 |   35 +-
>  include/hw/virtio/virtio-blk.h                     |   77 +-
>  include/hw/virtio/virtio-bus.h                     |    3 -
>  include/hw/virtio/virtio-net.h                     |  151 +--
>  include/hw/virtio/virtio-rng.h                     |    4 +-
>  include/hw/virtio/virtio-scsi.h                    |  120 +-
>  include/hw/virtio/virtio-serial.h                  |   40 +-
>  include/hw/virtio/virtio.h                         |   71 +-
>  include/net/tap.h                                  |   24 +-
>  include/standard-headers/asm-s390/kvm_virtio.h     |   64 ++
>  include/standard-headers/asm-s390/virtio-ccw.h     |   21 +
>  include/standard-headers/linux/if_ether.h          |    1 +
>  include/standard-headers/linux/types.h             |    2 +
>  include/standard-headers/linux/virtio_9p.h         |   44 +
>  include/standard-headers/linux/virtio_balloon.h    |   59 +
>  include/standard-headers/linux/virtio_blk.h        |  143 +++
>  include/standard-headers/linux/virtio_config.h     |   64 ++
>  include/standard-headers/linux/virtio_console.h    |   78 ++
>  include/standard-headers/linux/virtio_ids.h        |   43 +
>  include/standard-headers/linux/virtio_net.h        |  233 ++++
>  include/standard-headers/linux/virtio_pci.h        |  193 ++++
>  .../linux}/virtio_ring.h                           |  132 +--
>  include/standard-headers/linux/virtio_rng.h        |    8 +
>  include/standard-headers/linux/virtio_scsi.h       |  164 +++
>  include/standard-headers/linux/virtio_types.h      |   46 +
>  include/sysemu/blockdev.h                          |    2 -
>  include/sysemu/sysemu.h                            |    5 -
>  include/sysemu/tpm_backend.h                       |    2 +-
>  linux-headers/linux/virtio_config.h                |   58 +-
>  linux-headers/linux/virtio_ring.h                  |  164 +--
>  device-hotplug.c                                   |    7 +-
>  exec.c                                             |    2 +
>  hw/9pfs/virtio-9p-device.c                         |    2 +-
>  hw/acpi/aml-build.c                                |  888 +++++++++++++++
>  hw/acpi/bios-linker-loader.c                       |    4 +-
>  hw/acpi/ich9.c                                     |   14 +
>  hw/acpi/memory_hotplug.c                           |    3 +-
>  hw/acpi/pcihp.c                                    |   18 +-
>  hw/acpi/piix4.c                                    |   15 +-
>  hw/audio/ac97.c                                    |    5 +-
>  hw/audio/es1370.c                                  |    5 +-
>  hw/audio/intel-hda.c                               |    6 +-
>  hw/block/virtio-blk.c                              |   31 +-
>  hw/char/serial-pci.c                               |   22 +-
>  hw/char/virtio-serial-bus.c                        |    4 +-
>  hw/core/qdev-properties.c                          |   21 +-
>  hw/core/qdev.c                                     |    8 +-
>  hw/display/cirrus_vga.c                            |   11 +-
>  hw/display/qxl.c                                   |   36 +-
>  hw/display/vga-pci.c                               |   11 +-
>  hw/display/vmware_vga.c                            |    6 +-
>  hw/i2c/smbus_ich9.c                                |    5 +-
>  hw/i386/acpi-build.c                               | 1179 +++++++++-----------
>  hw/i386/kvm/pci-assign.c                           |   10 +-
>  hw/i386/pc.c                                       |   23 +
>  hw/i386/pc_piix.c                                  |    3 +
>  hw/i386/pc_q35.c                                   |    3 +
>  hw/ide/cmd646.c                                    |    5 +-
>  hw/ide/ich.c                                       |   13 +-
>  hw/ide/piix.c                                      |   10 +-
>  hw/ide/via.c                                       |    6 +-
>  hw/ipack/tpci200.c                                 |    6 +-
>  hw/isa/i82378.c                                    |    6 +-
>  hw/isa/lpc_ich9.c                                  |   14 +-
>  hw/isa/piix4.c                                     |    5 +-
>  hw/isa/vt82c686.c                                  |   24 +-
>  hw/misc/applesmc.c                                 |    5 +-
>  hw/misc/pci-testdev.c                              |    6 +-
>  hw/net/e1000.c                                     |    6 +-
>  hw/net/eepro100.c                                  |    6 +-
>  hw/net/lance.c                                     |    3 +-
>  hw/net/ne2000.c                                    |    6 +-
>  hw/net/pcnet-pci.c                                 |    6 +-
>  hw/net/pcnet.c                                     |    4 +-
>  hw/net/rtl8139.c                                   |    6 +-
>  hw/net/vhost_net.c                                 |    2 +-
>  hw/net/virtio-net.c                                |   57 +-
>  hw/net/vmxnet3.c                                   |    6 +-
>  hw/pci-bridge/dec.c                                |    5 +-
>  hw/pci-host/apb.c                                  |    5 +-
>  hw/pci-host/bonito.c                               |    6 +-
>  hw/pci-host/grackle.c                              |    5 +-
>  hw/pci-host/piix.c                                 |   12 +-
>  hw/pci-host/ppce500.c                              |    6 +-
>  hw/pci-host/prep.c                                 |    6 +-
>  hw/pci-host/q35.c                                  |    5 +-
>  hw/pci-host/uninorth.c                             |   20 +-
>  hw/pci-host/versatile.c                            |    5 +-
>  hw/pci/pci-hotplug-old.c                           |  342 ------
>  hw/pci/pci.c                                       |  127 ++-
>  hw/s390x/virtio-ccw.c                              |   12 +-
>  hw/scsi/virtio-scsi.c                              |    9 +-
>  hw/sd/sdhci.c                                      |    5 +-
>  hw/tpm/tpm_passthrough.c                           |   37 +-
>  hw/tpm/tpm_tis.c                                   |  131 ++-
>  hw/usb/hcd-ehci-pci.c                              |    6 +-
>  hw/usb/hcd-xhci.c                                  |    6 +-
>  hw/virtio/dataplane/vring.c                        |   10 +-
>  hw/virtio/virtio-balloon.c                         |    2 +-
>  hw/virtio/virtio-bus.c                             |   14 -
>  hw/virtio/virtio-mmio.c                            |    2 +-
>  hw/virtio/virtio-pci.c                             |   63 +-
>  hw/virtio/virtio.c                                 |   33 +-
>  hw/watchdog/wdt_i6300esb.c                         |    6 +-
>  stubs/pci-drive-hot-add.c                          |   10 -
>  tests/bios-tables-test.c                           |   45 +-
>  vl.c                                               |   34 +-
>  default-configs/i386-softmmu.mak                   |    1 -
>  default-configs/x86_64-softmmu.mak                 |    1 -
>  hmp-commands.hx                                    |   32 -
>  hw/acpi/Makefile.objs                              |    1 +
>  hw/i386/Makefile.objs                              |    4 +-
>  hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |   17 +-
>  hw/i386/acpi-dsdt-isa.dsl                          |   11 -
>  hw/i386/acpi-dsdt-mem-hotplug.dsl                  |   36 +-
>  hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 --
>  hw/i386/acpi-dsdt.dsl                              |   46 -
>  hw/i386/acpi-dsdt.hex.generated                    |  224 +---
>  hw/i386/q35-acpi-dsdt.dsl                          |   19 -
>  hw/i386/q35-acpi-dsdt.hex.generated                |  224 +---
>  hw/i386/ssdt-mem.dsl                               |   77 --
>  hw/i386/ssdt-mem.hex.generated                     |  213 ----
>  hw/i386/ssdt-misc.dsl                              |  122 --
>  hw/i386/ssdt-misc.hex.generated                    |  399 -------
>  hw/i386/ssdt-pcihp.dsl                             |  100 --
>  hw/i386/ssdt-pcihp.hex.generated                   |  251 -----
>  hw/i386/ssdt-proc.dsl                              |   63 --
>  hw/i386/ssdt-proc.hex.generated                    |  134 ---
>  hw/pci/Makefile.objs                               |    2 -
>  scripts/update-linux-headers.sh                    |   52 +-
>  stubs/Makefile.objs                                |    1 -
>  tests/acpi-test-data/pc/DSDT                       |  Bin 3621 -> 2970 bytes
>  tests/acpi-test-data/pc/SSDT                       |  Bin 2279 -> 2476 bytes
>  tests/acpi-test-data/pc/SSDT.bridge                |  Bin 0 -> 4335 bytes
>  tests/acpi-test-data/q35/DSDT                      |  Bin 8211 -> 7608 bytes
>  tests/acpi-test-data/q35/SSDT                      |  Bin 560 -> 681 bytes
>  tests/acpi-test-data/q35/SSDT.bridge               |  Bin 0 -> 698 bytes
>  153 files changed, 3576 insertions(+), 4409 deletions(-)
>  create mode 100644 include/hw/acpi/aml-build.h
>  create mode 100644 include/standard-headers/asm-s390/kvm_virtio.h
>  create mode 100644 include/standard-headers/asm-s390/virtio-ccw.h
>  create mode 100644 include/standard-headers/linux/if_ether.h
>  create mode 100644 include/standard-headers/linux/types.h
>  create mode 100644 include/standard-headers/linux/virtio_9p.h
>  create mode 100644 include/standard-headers/linux/virtio_balloon.h
>  create mode 100644 include/standard-headers/linux/virtio_blk.h
>  create mode 100644 include/standard-headers/linux/virtio_config.h
>  create mode 100644 include/standard-headers/linux/virtio_console.h
>  create mode 100644 include/standard-headers/linux/virtio_ids.h
>  create mode 100644 include/standard-headers/linux/virtio_net.h
>  create mode 100644 include/standard-headers/linux/virtio_pci.h
>  rename include/{hw/virtio => standard-headers/linux}/virtio_ring.h (61%)
>  create mode 100644 include/standard-headers/linux/virtio_rng.h
>  create mode 100644 include/standard-headers/linux/virtio_scsi.h
>  create mode 100644 include/standard-headers/linux/virtio_types.h
>  create mode 100644 hw/acpi/aml-build.c
>  delete mode 100644 hw/pci/pci-hotplug-old.c
>  delete mode 100644 stubs/pci-drive-hot-add.c
>  delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl
>  delete mode 100644 hw/i386/ssdt-mem.dsl
>  delete mode 100644 hw/i386/ssdt-mem.hex.generated
>  delete mode 100644 hw/i386/ssdt-misc.dsl
>  delete mode 100644 hw/i386/ssdt-misc.hex.generated
>  delete mode 100644 hw/i386/ssdt-pcihp.dsl
>  delete mode 100644 hw/i386/ssdt-pcihp.hex.generated
>  delete mode 100644 hw/i386/ssdt-proc.dsl
>  delete mode 100644 hw/i386/ssdt-proc.hex.generated
>  create mode 100644 tests/acpi-test-data/pc/SSDT.bridge
>  create mode 100644 tests/acpi-test-data/q35/SSDT.bridge
> 

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

* Re: [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups
  2015-03-02 14:32 ` [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
@ 2015-03-02 19:03   ` Michael S. Tsirkin
  0 siblings, 0 replies; 29+ messages in thread
From: Michael S. Tsirkin @ 2015-03-02 19:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

On Mon, Mar 02, 2015 at 03:32:29PM +0100, Michael S. Tsirkin wrote:
> Igor noticed a problem on hosts without iasl.
> I will redo this later.

It's ok now - generated hex files were missing.
I updated the same for_upstream tag.

The following changes since commit 11d39a131020cc5c54ff9bc86d3259f7d32bf849:

  Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20150218' into staging (2015-02-26 09:08:54 +0000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 48ce35b7645154eff6b685b3178aacf33f2ff871:

  acpi: update generated files (2015-03-02 16:14:33 +0100)

----------------------------------------------------------------
pci, pc, virtio fixes and cleanups

Last pull for hard freeze.

A bunch of fixes all over the place.
All of ACPI refactoring has been merged.
Legacy pci commands have been dropped.

Additionally, this includes patches from soft-freeze
(which apparently haven't been merged yet):

a bunch of fixes all over the place
virtio header cleanup
initial patches from virtio-1.0 branch

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Cornelia Huck (3):
      virtio: cull virtio_bus_set_vdev_features
      virtio: feature bit manipulation helpers
      virtio: add feature checking helpers

Denis V. Lunev (1):
      balloon: call qdev_alias_all_properties for proxy dev in balloon class init

Igor Mammedov (59):
      acpi: move generic aml building helpers into dedictated file
      acpi: add build_append_namestring() helper
      acpi: drop min-bytes in build_package()
      pc: acpi-build: update linker on guest access
      pc: acpi-build: migrate RSDP table
      pc: acpi: use local var for accessing ACPI tables blob in acpi_build()
      acpi: introduce AML composer aml_append()
      acpi: add aml_scope() term
      pc: acpi-build: use aml_scope() for \_SB scope
      acpi: add aml_device() term
      acpi: add aml_method() term
      acpi: add aml_if() term
      acpi: add aml_name() & aml_name_decl() term
      acpi: add aml_int() term
      acpi: add aml_return() term
      acpi: add aml_arg() term
      acpi: add aml_store() term
      acpi: add aml_and() term
      acpi: add aml_notify() term
      acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers
      acpi: add aml_package() term
      pc: acpi-build: generate _S[345] packages dynamically
      acpi: add aml_buffer() term
      acpi: add aml_resource_template() helper
      acpi: add aml_io() helper
      acpi: include PkgLength size only when requested
      acpi: add aml_operation_region() term
      acpi: add aml_field() & aml_named_field() terms
      acpi: add aml_local() term
      acpi: add aml_string() term
      pc: acpi-build: generate pvpanic device description dynamically
      acpi: add aml_varpackage() term
      acpi: add aml_equal() term
      acpi: add aml_processor() term
      acpi: add aml_eisaid() term
      pc: acpi-build: drop template patching and CPU hotplug objects dynamically
      pc: acpi-build: create CPU hotplug IO region dynamically
      acpi: add aml_reserved_field() term
      pc: acpi-build: drop template patching and memory hotplug objects dynamically
      pc: acpi-build: create memory hotplug IO region dynamically
      acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms
      pc: pcihp: expose MMIO base and len as properties
      pc: acpi-build: reserve PCIHP MMIO resources
      pc: acpi-build: create PCI0._CRS dynamically
      pc: acpi: drop manual hole punching for PCI hotplug resources
      pc: acpi: drop manual hole punching for CPU hotplug resources
      pc: acpi: drop manual hole punching for GPE0 resources
      pc: acpi-build: drop remaining ssdt_misc template
      acpi: add acpi_irq_no_flags() term
      pc: export applesmc IO port/len
      pc: acpi-build: drop template patching and create Device(SMC) dynamically
      tests: ACPI test blobs update due to PCI0._CRS changes
      tests: bios-tables-test: add support for testing bridges
      tests: add ACPI blobs for qemu with bridge cases
      pc: acpi-build: simplify PCI bus tree generation
      tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation
      pc: acpi-build: drop template patching and create PCI bus tree dynamically
      pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs
      acpi: make build_*() routines static to aml-build.c

Markus Armbruster (13):
      pci: Convert core to realize
      pci: Permit incremental conversion of device models to realize
      pci: Trivial device model conversions to realize
      pcnet: pcnet_common_init() always returns 0, change to void
      pcnet: Convert to realize
      serial-pci: Convert to realize
      ide/ich: Convert to realize
      cirrus-vga: Convert to realize
      qxl: Convert to realize
      pci-assign: Convert to realize
      qdev: Don't exit when running into bad -global
      pci: Give a few helpers internal linkage
      pci-hotplug-old: Has been dead for five major releases, bury

Michael S. Tsirkin (35):
      acpi-build: fix memory leak with bridge hp off
      bios linker: validate pointer within table
      acpi: update RSDP on guest access
      exec: round up size on MR resize
      acpi-build: fix ACPI RAM management
      acpi: has_immutable_rsdp->!rsdp_in_ram
      acpi-build: simplify rsdp management for legacy
      scripts/update-linux-headers.sh: pull virtio hdrs
      include: import virtio headers from linux 4.0
      virtio: use standard virtio_ring.h
      virtio: use standard-headers
      virtio-balloon: use standard headers
      virtio-9p: use standard headers
      virtio-blk: switch to standard-headers
      virtio-net,tap: use standard-headers
      virtio-rng: use standard-headers
      virtio-scsi: use standard-headers
      virtio-serial: switch to standard-headers
      update-linux-headers: use standard-headers
      linux-headers: use standard-headers
      virtio-pci: use standard headers
      scripts: add arch specific standard-headers
      standard-headers: add s390 virtio headers
      s390: use standard headers
      acpi-build: skip hotplugged bridges
      update-linux-headers.sh: s/__inline__/inline/
      virtio-serial-bus.c: drop virtio_ids.h
      standard-headers: include stdint.h
      virtio_ring.h: s/__inline__/inline/
      acpi: update generated hex files
      acpi: drop unused generated files
      acpi-test: update expected files
      acpi-test-data: update after pci rewrite
      Makefile.target: binary depends on config-devices
      acpi: update generated files

Peter Krempa (2):
      vl.c: Fix error messages when parsing maxmem parameters
      pc: memory: Validate alignment of maxram_size to page size

Stefan Berger (5):
      tpm: Extend sts register to 32 bit
      tpm: Allow 32 & 16 bit accesses to the registers
      tpm: Support for XFIFO register
      tpm: Support for TIS selftest done flag
      tpm: Support for capability flags of TIS 1.3

Tang Chen (6):
      acpi, pc: Add hotunplug request cb for pc machine.
      acpi, ich9: Add hotunplug request cb for ich9.
      acpi, pc: Add unplug cb for pc machine.
      acpi, ich9: Add unplug cb for ich9.
      acpi, piix4: Add unplug cb for piix4.
      acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

 Makefile.target                                    |    4 +-
 hw/9pfs/virtio-9p.h                                |   18 +-
 hw/net/pcnet.h                                     |    2 +-
 hw/s390x/s390-virtio-bus.h                         |   36 +-
 hw/s390x/s390-virtio.h                             |    7 +-
 hw/tpm/tpm_int.h                                   |    1 +
 hw/tpm/tpm_tis.h                                   |    2 +-
 include/hw/acpi/aml-build.h                        |  191 ++++
 include/hw/acpi/ich9.h                             |    4 +
 include/hw/acpi/pc-hotplug.h                       |    1 +
 include/hw/acpi/pcihp.h                            |    7 +-
 include/hw/i386/pc.h                               |    1 +
 include/hw/isa/isa.h                               |   11 +-
 include/hw/pci/pci.h                               |   10 +-
 include/hw/qdev-properties.h                       |    4 +-
 include/hw/virtio/dataplane/vring-accessors.h      |    2 +-
 include/hw/virtio/dataplane/vring.h                |    2 +-
 include/hw/virtio/virtio-balloon.h                 |   35 +-
 include/hw/virtio/virtio-blk.h                     |   77 +-
 include/hw/virtio/virtio-bus.h                     |    3 -
 include/hw/virtio/virtio-net.h                     |  151 +--
 include/hw/virtio/virtio-rng.h                     |    4 +-
 include/hw/virtio/virtio-scsi.h                    |  120 +-
 include/hw/virtio/virtio-serial.h                  |   40 +-
 include/hw/virtio/virtio.h                         |   71 +-
 include/net/tap.h                                  |   24 +-
 include/standard-headers/asm-s390/kvm_virtio.h     |   64 ++
 include/standard-headers/asm-s390/virtio-ccw.h     |   21 +
 include/standard-headers/linux/if_ether.h          |    1 +
 include/standard-headers/linux/types.h             |    2 +
 include/standard-headers/linux/virtio_9p.h         |   44 +
 include/standard-headers/linux/virtio_balloon.h    |   59 +
 include/standard-headers/linux/virtio_blk.h        |  143 +++
 include/standard-headers/linux/virtio_config.h     |   64 ++
 include/standard-headers/linux/virtio_console.h    |   78 ++
 include/standard-headers/linux/virtio_ids.h        |   43 +
 include/standard-headers/linux/virtio_net.h        |  233 ++++
 include/standard-headers/linux/virtio_pci.h        |  193 ++++
 .../linux}/virtio_ring.h                           |  132 +--
 include/standard-headers/linux/virtio_rng.h        |    8 +
 include/standard-headers/linux/virtio_scsi.h       |  164 +++
 include/standard-headers/linux/virtio_types.h      |   46 +
 include/sysemu/blockdev.h                          |    2 -
 include/sysemu/sysemu.h                            |    5 -
 include/sysemu/tpm_backend.h                       |    2 +-
 linux-headers/linux/virtio_config.h                |   58 +-
 linux-headers/linux/virtio_ring.h                  |  164 +--
 device-hotplug.c                                   |    7 +-
 exec.c                                             |    2 +
 hw/9pfs/virtio-9p-device.c                         |    2 +-
 hw/acpi/aml-build.c                                |  888 +++++++++++++++
 hw/acpi/bios-linker-loader.c                       |    4 +-
 hw/acpi/ich9.c                                     |   14 +
 hw/acpi/memory_hotplug.c                           |    3 +-
 hw/acpi/pcihp.c                                    |   18 +-
 hw/acpi/piix4.c                                    |   15 +-
 hw/audio/ac97.c                                    |    5 +-
 hw/audio/es1370.c                                  |    5 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/block/virtio-blk.c                              |   31 +-
 hw/char/serial-pci.c                               |   22 +-
 hw/char/virtio-serial-bus.c                        |    4 +-
 hw/core/qdev-properties.c                          |   21 +-
 hw/core/qdev.c                                     |    8 +-
 hw/display/cirrus_vga.c                            |   11 +-
 hw/display/qxl.c                                   |   36 +-
 hw/display/vga-pci.c                               |   11 +-
 hw/display/vmware_vga.c                            |    6 +-
 hw/i2c/smbus_ich9.c                                |    5 +-
 hw/i386/acpi-build.c                               | 1179 +++++++++-----------
 hw/i386/kvm/pci-assign.c                           |   10 +-
 hw/i386/pc.c                                       |   23 +
 hw/i386/pc_piix.c                                  |    3 +
 hw/i386/pc_q35.c                                   |    3 +
 hw/ide/cmd646.c                                    |    5 +-
 hw/ide/ich.c                                       |   13 +-
 hw/ide/piix.c                                      |   10 +-
 hw/ide/via.c                                       |    6 +-
 hw/ipack/tpci200.c                                 |    6 +-
 hw/isa/i82378.c                                    |    6 +-
 hw/isa/lpc_ich9.c                                  |   14 +-
 hw/isa/piix4.c                                     |    5 +-
 hw/isa/vt82c686.c                                  |   24 +-
 hw/misc/applesmc.c                                 |    5 +-
 hw/misc/pci-testdev.c                              |    6 +-
 hw/net/e1000.c                                     |    6 +-
 hw/net/eepro100.c                                  |    6 +-
 hw/net/lance.c                                     |    3 +-
 hw/net/ne2000.c                                    |    6 +-
 hw/net/pcnet-pci.c                                 |    6 +-
 hw/net/pcnet.c                                     |    4 +-
 hw/net/rtl8139.c                                   |    6 +-
 hw/net/vhost_net.c                                 |    2 +-
 hw/net/virtio-net.c                                |   57 +-
 hw/net/vmxnet3.c                                   |    6 +-
 hw/pci-bridge/dec.c                                |    5 +-
 hw/pci-host/apb.c                                  |    5 +-
 hw/pci-host/bonito.c                               |    6 +-
 hw/pci-host/grackle.c                              |    5 +-
 hw/pci-host/piix.c                                 |   12 +-
 hw/pci-host/ppce500.c                              |    6 +-
 hw/pci-host/prep.c                                 |    6 +-
 hw/pci-host/q35.c                                  |    5 +-
 hw/pci-host/uninorth.c                             |   20 +-
 hw/pci-host/versatile.c                            |    5 +-
 hw/pci/pci-hotplug-old.c                           |  342 ------
 hw/pci/pci.c                                       |  127 ++-
 hw/s390x/virtio-ccw.c                              |   12 +-
 hw/scsi/virtio-scsi.c                              |    9 +-
 hw/sd/sdhci.c                                      |    5 +-
 hw/tpm/tpm_passthrough.c                           |   37 +-
 hw/tpm/tpm_tis.c                                   |  131 ++-
 hw/usb/hcd-ehci-pci.c                              |    6 +-
 hw/usb/hcd-xhci.c                                  |    6 +-
 hw/virtio/dataplane/vring.c                        |   10 +-
 hw/virtio/virtio-balloon.c                         |    2 +-
 hw/virtio/virtio-bus.c                             |   14 -
 hw/virtio/virtio-mmio.c                            |    2 +-
 hw/virtio/virtio-pci.c                             |   63 +-
 hw/virtio/virtio.c                                 |   33 +-
 hw/watchdog/wdt_i6300esb.c                         |    6 +-
 stubs/pci-drive-hot-add.c                          |   10 -
 tests/bios-tables-test.c                           |   45 +-
 vl.c                                               |   34 +-
 default-configs/i386-softmmu.mak                   |    1 -
 default-configs/x86_64-softmmu.mak                 |    1 -
 hmp-commands.hx                                    |   32 -
 hw/acpi/Makefile.objs                              |    1 +
 hw/i386/Makefile.objs                              |    4 +-
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |   17 +-
 hw/i386/acpi-dsdt-isa.dsl                          |   11 -
 hw/i386/acpi-dsdt-mem-hotplug.dsl                  |   36 +-
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 --
 hw/i386/acpi-dsdt.dsl                              |   46 -
 hw/i386/acpi-dsdt.hex.generated                    |   39 +-
 hw/i386/q35-acpi-dsdt.dsl                          |   19 -
 hw/i386/q35-acpi-dsdt.hex.generated                |   41 +-
 hw/i386/ssdt-mem.dsl                               |   77 --
 hw/i386/ssdt-mem.hex.generated                     |  213 ----
 hw/i386/ssdt-misc.dsl                              |  122 --
 hw/i386/ssdt-misc.hex.generated                    |  399 -------
 hw/i386/ssdt-pcihp.dsl                             |  100 --
 hw/i386/ssdt-pcihp.hex.generated                   |  251 -----
 hw/i386/ssdt-proc.dsl                              |   63 --
 hw/i386/ssdt-proc.hex.generated                    |  134 ---
 hw/i386/ssdt-tpm.hex.generated                     |    6 +-
 hw/pci/Makefile.objs                               |    2 -
 scripts/update-linux-headers.sh                    |   52 +-
 stubs/Makefile.objs                                |    1 -
 tests/acpi-test-data/pc/DSDT                       |  Bin 3621 -> 2970 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 2279 -> 2476 bytes
 tests/acpi-test-data/pc/SSDT.bridge                |  Bin 0 -> 4335 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 8211 -> 7608 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 560 -> 681 bytes
 tests/acpi-test-data/q35/SSDT.bridge               |  Bin 0 -> 698 bytes
 155 files changed, 3575 insertions(+), 4052 deletions(-)
 create mode 100644 include/hw/acpi/aml-build.h
 create mode 100644 include/standard-headers/asm-s390/kvm_virtio.h
 create mode 100644 include/standard-headers/asm-s390/virtio-ccw.h
 create mode 100644 include/standard-headers/linux/if_ether.h
 create mode 100644 include/standard-headers/linux/types.h
 create mode 100644 include/standard-headers/linux/virtio_9p.h
 create mode 100644 include/standard-headers/linux/virtio_balloon.h
 create mode 100644 include/standard-headers/linux/virtio_blk.h
 create mode 100644 include/standard-headers/linux/virtio_config.h
 create mode 100644 include/standard-headers/linux/virtio_console.h
 create mode 100644 include/standard-headers/linux/virtio_ids.h
 create mode 100644 include/standard-headers/linux/virtio_net.h
 create mode 100644 include/standard-headers/linux/virtio_pci.h
 rename include/{hw/virtio => standard-headers/linux}/virtio_ring.h (61%)
 create mode 100644 include/standard-headers/linux/virtio_rng.h
 create mode 100644 include/standard-headers/linux/virtio_scsi.h
 create mode 100644 include/standard-headers/linux/virtio_types.h
 create mode 100644 hw/acpi/aml-build.c
 delete mode 100644 hw/pci/pci-hotplug-old.c
 delete mode 100644 stubs/pci-drive-hot-add.c
 delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl
 delete mode 100644 hw/i386/ssdt-mem.dsl
 delete mode 100644 hw/i386/ssdt-mem.hex.generated
 delete mode 100644 hw/i386/ssdt-misc.dsl
 delete mode 100644 hw/i386/ssdt-misc.hex.generated
 delete mode 100644 hw/i386/ssdt-pcihp.dsl
 delete mode 100644 hw/i386/ssdt-pcihp.hex.generated
 delete mode 100644 hw/i386/ssdt-proc.dsl
 delete mode 100644 hw/i386/ssdt-proc.hex.generated
 create mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/SSDT.bridge

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

end of thread, other threads:[~2015-03-02 19:03 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02 10:58 [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 01/26] balloon: call qdev_alias_all_properties for proxy dev in balloon class init Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 02/26] tpm: Extend sts register to 32 bit Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 03/26] tpm: Allow 32 & 16 bit accesses to the registers Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 04/26] tpm: Support for XFIFO register Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 05/26] tpm: Support for TIS selftest done flag Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 06/26] tpm: Support for capability flags of TIS 1.3 Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 07/26] pc: acpi-build: create PCI0._CRS dynamically Michael S. Tsirkin
2015-03-02 10:58 ` [Qemu-devel] [PULL v3 08/26] pc: acpi: drop manual hole punching for PCI hotplug resources Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 09/26] pc: acpi: drop manual hole punching for CPU " Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 10/26] pc: acpi: drop manual hole punching for GPE0 resources Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 11/26] pc: acpi-build: drop remaining ssdt_misc template Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 12/26] acpi: add acpi_irq_no_flags() term Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 13/26] pc: export applesmc IO port/len Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 14/26] pc: acpi-build: drop template patching and create Device(SMC) dynamically Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 15/26] tests: ACPI test blobs update due to PCI0._CRS changes Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 16/26] tests: bios-tables-test: add support for testing bridges Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 17/26] tests: add ACPI blobs for qemu with bridge cases Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 18/26] pc: acpi-build: simplify PCI bus tree generation Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 19/26] tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation Michael S. Tsirkin
2015-03-02 10:59 ` [Qemu-devel] [PULL v3 20/26] pc: acpi-build: drop template patching and create PCI bus tree dynamically Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 21/26] pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 22/26] acpi: make build_*() routines static to aml-build.c Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 23/26] pci: Give a few helpers internal linkage Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 24/26] pci-hotplug-old: Has been dead for five major releases, bury Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 25/26] acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb() Michael S. Tsirkin
2015-03-02 11:00 ` [Qemu-devel] [PULL v3 26/26] acpi-test-data: update after pci rewrite Michael S. Tsirkin
2015-03-02 14:32 ` [Qemu-devel] [PULL v3 00/26] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-03-02 19:03   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.