[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 00/47] ACPI refactoring: replace template patchin

From: Igor Mammedov
Subject: [Qemu-devel] [PATCH v2 00/47] ACPI refactoring: replace template patching with C ASL API
Date: Thu, 22 Jan 2015 14:49:44 +0000

changes since RFC:
  * conflicts with vmgenid (broken) patches, so it's not based on PCI tree
  * rebased on top of today's master +
    [PATCH v5 0/5] pc: acpi: various fixes and cleanups +
    some patches from PCI tree that above series depends on
  * small cleanups
  * droped [42/47] acpi: make tables linker-loader available to other targets
    since Michael has a cleaner similar patch(es) in PCI tree,
    so reuse them (not included in here)
  * move SMC device from DSDT to SSDT and create it only when
    applesmc device is present.

This series refactors SSDT runtime composing and gets rid of:
    * patching AML templates, with related pointer arithmetic magic
    * manual AML composition, i.e. creating AML terms practically
      byte by byte
    * using AML templates for SSDT creation, reducing dependency on IASL.
      as result of above, QEMU source tree doesn't have to carry
      'binary' template blobs that used to be part of SSDT.
    * hand-crafted PCI0._CRSes for pc/q35 machines in DSDT with
      manual hole punching of reserved resources
and adds following:
    * introduces ASL like API for creating AML objects using ASL
      like constructs/terms. API: 
          * provides a necessary minimum set of terms/helpers to
            replace currently used SSDT templates.
          * simplifies AML composition and keeps track of AML
            object contexts, transparently managing their 
            (de)allocation and merging into parent context,
            making composition of SSDT 'almost' like writing
            native ASL definition of the table.
          * hides pointer arithmetic from user when composing
    * dynamically creates unified PCI0._CRS in SSDT for pc/q35
      machines allowing to reserve resources at runtime vs
      current compile time
    * while adding new API, make it target independed CONFIG_ACPI
      and also make some other utilities for composing ACPI tables
      target independed (i.e. utils on which API depends) so that
      they could be reused for ARM target later without moving
      stuff around uncessarily.
    * trims SSDT by not creating objects that are not present
      (S[34] Package if disabled, pvpanic, applesmc)

As result of replacing AML templates with ASL API, codebase
reduces on ~1800LOC even with net addition of API 1050LOC counted in.

Tested with XPsp3, WS2012R2, RHEL6/7 guests. 

Git tree for playing with:

Igor Mammedov (47):
  acpi: introduce AML composer aml_append()
  acpi: add acpi_scope() term
  acpi: add acpi_device() term
  acpi: add acpi_method() term
  acpi: add acpi_if() term
  acpi: add acpi_name() & acpi_name_decl() term
  acpi: factor out ACPI const int packing out build_append_value()
  acpi: extend build_append_{value|int}() to support 64-bit values
  acpi: add acpi_int() term
  acpi: add acpi_return() term
  acpi: add acpi_arg0(), acpi_arg1(), acpi_arg2(), acpi_arg3() terms
  acpi: add acpi_store() term
  acpi: add acpi_and() term
  acpi: add acpi_notify() term
  acpi: add acpi_call1(), acpi_call2(), acpi_call3(), acpi_call4()
  pc: acpi-build: drop template patching and create PCI bus tree
  acpi: add acpi_package() term
  pc: acpi-build: drop unsupported PM1b_CNT.SLP_TYP
  pc: acpi-build: generate _S[345] packages dynamically
  acpi: add acpi_buffer() term
  acpi: add acpi_resource_template() helper
  acpi: add acpi_io() helper
  acpi: include PkgLength size only when requested
  acpi: add acpi_operation_region() term
  acpi: add acpi_field() & acpi_named_field() terms
  acpi: add acpi_local0() term
  acpi: add acpi_string() term
  pc: acpi-build: generate pvpanic device description dynamically
  acpi: add acpi_varpackage() term
  acpi: add acpi_equal() term
  acpi: add acpi_processor() term
  acpi: add acpi_eisaid() term
  pc: acpi-build: drop template patching and CPU hotplug objects
  pc: acpi-build: create CPU hotplug IO region dynamically
  acpi: add acpi_reserved_field() term
  pc: acpi-build: drop template patching and memory hotplug objects
  pc: acpi-build: create memory hotplug IO region dynamically
  acpi: add acpi_word_bus_number(), acpi_word_io(), acpi_dword_memory(),
    acpi_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
  acpi: add acpi_def_block() term
  pc: acpi-build: prepare to make ACPI tables blob opaque for table
    building functions
  pc: acpi-build: drop remaining ssdt_misc template and use
  acpi: add acpi_iqr_no_flags() term
  pc: export applesmc IO port/len
  pc: acpi-build: drop template patching and create Device(SMC)

 hw/acpi/acpi-build-utils.c         | 689 +++++++++++++++++++++++++++++--
 hw/acpi/pcihp.c                    |  18 +-
 hw/acpi/piix4.c                    |   2 +-
 hw/i386/Makefile.objs              |   4 +-
 hw/i386/acpi-build.c               | 824 +++++++++++++++++++------------------
 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              |  45 --
 hw/i386/q35-acpi-dsdt.dsl          |  18 -
 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/misc/applesmc.c                 |   5 +-
 include/hw/acpi/acpi-build-utils.h | 168 +++++++-
 include/hw/acpi/pc-hotplug.h       |   1 +
 include/hw/acpi/pcihp.h            |   7 +-
 include/hw/isa/isa.h               |  11 +-
 24 files changed, 1304 insertions(+), 2003 deletions(-)
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]