qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 00/47] ACPI refactoring: replace template patching with C ASL API
@ 2014-12-19  2:01 Igor Mammedov
  2014-12-19  2:01 ` [Qemu-devel] [RFC 01/47] acpi: introduce AML composer aml_append() Igor Mammedov
                   ` (46 more replies)
  0 siblings, 47 replies; 58+ messages in thread
From: Igor Mammedov @ 2014-12-19  2:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, drjones, claudio.fontana, mst

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
            SSDT.
    * 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.

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. 

Depends on:
    [PATCH V2 0/8] pc: acpi: various fixes and cleanups
    http://lists.gnu.org/archive/html/qemu-devel/2014-12/msg02454.html

Git tree for playing with:
    https://github.com/imammedo/qemu/commits/ASL_API_RFC_v1

 
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()
    helpers
  pc: acpi-build: drop template patching and create PCI bus tree
    dinamically
  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
    dynamically
  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
    dynamically
  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: make tables linker-loader available to other targets
  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_def_block()
  pc: acpi: update DSTD blobs
  tests: acpi: update reference DSDT/SSDT tables

 hw/acpi/Makefile.objs                |   2 +-
 hw/acpi/acpi_gen_utils.c             | 670 ++++++++++++++++++++++++++++--
 hw/acpi/bios-linker-loader.c         | 157 +++++++
 hw/acpi/pcihp.c                      |  18 +-
 hw/acpi/piix4.c                      |   2 +-
 hw/i386/Makefile.objs                |   5 +-
 hw/i386/acpi-build.c                 | 785 ++++++++++++++++++-----------------
 hw/i386/acpi-dsdt-cpu-hotplug.dsl    |  17 +-
 hw/i386/acpi-dsdt-mem-hotplug.dsl    |  36 +-
 hw/i386/acpi-dsdt-pci-crs.dsl        |  92 ----
 hw/i386/acpi-dsdt.dsl                |  45 --
 hw/i386/acpi-dsdt.hex.generated      | 678 +++---------------------------
 hw/i386/bios-linker-loader.c         | 157 -------
 hw/i386/bios-linker-loader.h         |  27 --
 hw/i386/q35-acpi-dsdt.dsl            |  18 -
 hw/i386/q35-acpi-dsdt.hex.generated  | 616 ++-------------------------
 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 ------
 include/hw/acpi/acpi_gen_utils.h     | 167 +++++++-
 include/hw/acpi/bios-linker-loader.h |  27 ++
 include/hw/acpi/pc-hotplug.h         |   1 +
 include/hw/acpi/pcihp.h              |   7 +-
 tests/acpi-test-data/pc/DSDT         | Bin 3592 -> 3016 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2279 -> 2406 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 8182 -> 7654 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 560 -> 635 bytes
 32 files changed, 1527 insertions(+), 3359 deletions(-)
 create mode 100644 hw/acpi/bios-linker-loader.c
 delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl
 delete mode 100644 hw/i386/bios-linker-loader.c
 delete mode 100644 hw/i386/bios-linker-loader.h
 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 include/hw/acpi/bios-linker-loader.h

-- 
1.8.3.1

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

end of thread, other threads:[~2015-01-20  9:43 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19  2:01 [Qemu-devel] [RFC 00/47] ACPI refactoring: replace template patching with C ASL API Igor Mammedov
2014-12-19  2:01 ` [Qemu-devel] [RFC 01/47] acpi: introduce AML composer aml_append() Igor Mammedov
2014-12-19  2:01 ` [Qemu-devel] [RFC 02/47] acpi: add acpi_scope() term Igor Mammedov
2014-12-19  2:01 ` [Qemu-devel] [RFC 03/47] acpi: add acpi_device() term Igor Mammedov
2014-12-19  2:01 ` [Qemu-devel] [RFC 04/47] acpi: add acpi_method() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 05/47] acpi: add acpi_if() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 06/47] acpi: add acpi_name() & acpi_name_decl() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 07/47] acpi: factor out ACPI const int packing out build_append_value() Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 08/47] acpi: extend build_append_{value|int}() to support 64-bit values Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 09/47] acpi: add acpi_int() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 10/47] acpi: add acpi_return() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 11/47] acpi: add acpi_arg0(), acpi_arg1(), acpi_arg2(), acpi_arg3() terms Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 12/47] acpi: add acpi_store() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 13/47] acpi: add acpi_and() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 14/47] acpi: add acpi_notify() term Igor Mammedov
2015-01-19 12:32   ` Paolo Bonzini
2015-01-20  9:40     ` Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 15/47] acpi: add acpi_call1(), acpi_call2(), acpi_call3(), acpi_call4() helpers Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 16/47] pc: acpi-build: drop template patching and create PCI bus tree dinamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 17/47] acpi: add acpi_package() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 18/47] pc: acpi-build: drop unsupported PM1b_CNT.SLP_TYP Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 19/47] pc: acpi-build: generate _S[345] packages dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 20/47] acpi: add acpi_buffer() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 21/47] acpi: add acpi_resource_template() helper Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 22/47] acpi: add acpi_io() helper Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 23/47] acpi: include PkgLength size only when requested Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 24/47] acpi: add acpi_operation_region() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 25/47] acpi: add acpi_field() & acpi_named_field() terms Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 26/47] acpi: add acpi_local0() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 27/47] acpi: add acpi_string() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 28/47] pc: acpi-build: generate pvpanic device description dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 29/47] acpi: add acpi_varpackage() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 30/47] acpi: add acpi_equal() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 31/47] acpi: add acpi_processor() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 32/47] acpi: add acpi_eisaid() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 33/47] pc: acpi-build: drop template patching and CPU hotplug objects dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 34/47] pc: acpi-build: create CPU hotplug IO region dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 35/47] acpi: add acpi_reserved_field() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 36/47] pc: acpi-build: drop template patching and memory hotplug objects dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 37/47] pc: acpi-build: create memory hotplug IO region dynamically Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 38/47] acpi: add acpi_word_bus_number(), acpi_word_io(), acpi_dword_memory(), acpi_qword_memory() terms Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 39/47] pc: pcihp: expose MMIO base and len as properties Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 40/47] pc: acpi-build: reserve PCIHP MMIO resources Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 41/47] pc: acpi-build: create PCI0._CRS dynamically Igor Mammedov
2015-01-19 12:42   ` Paolo Bonzini
2015-01-19 21:55     ` Michael S. Tsirkin
2015-01-20  9:37       ` Marcel Apfelbaum
2015-01-20  9:42       ` Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 42/47] acpi: make tables linker-loader available to other targets Igor Mammedov
2015-01-19 12:36   ` Paolo Bonzini
2015-01-19 21:54     ` Michael S. Tsirkin
2015-01-19 22:05   ` Michael S. Tsirkin
2015-01-20  9:43     ` Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 43/47] acpi: add acpi_def_block() term Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 44/47] pc: acpi-build: prepare to make ACPI tables blob opaque for table building functions Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 45/47] pc: acpi-build: drop remaining ssdt_misc template and use acpi_def_block() Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 46/47] pc: acpi: update DSTD blobs Igor Mammedov
2014-12-19  2:02 ` [Qemu-devel] [RFC 47/47] tests: acpi: update reference DSDT/SSDT tables Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).