Skip to content

ACPI refactoring: replace template patching with C AML API

Igor Mammedov qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest16 patches 1 replyIn review
  2. v442 patches 1 replySuperseded
  3. v352 patches 35 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v247 patches61 repliesSuperseded
v1 RFC47 patches10 repliesSuperseded

Changes in v5 from the cover letter

* split PCI0._CRS patch onto simple ones
* move _CRS into SSDT
* a series to drop manual hole punching in PIIX4 _CRS
* add test case for ACPI table with coldplugged bridge
* fixed up current algorithm rewrite fallout on Q35 machine, see for detailed changelog in
"pc: acpi-build: simplify PCI bus tree generation"
* fixed minor mst's notes on v4 in PCI patches

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16pc: acpi-build: create PCI0._CRS dynamicallyhw/i386/acpi-build.c hw/i386/acpi-dsdt-pci-crs.dsl hw/i386/acpi-dsdt.dsl +2 more+52 -2100 replies
2/16pc: acpi: drop manual hole punching for PCI hotplug resourceshw/i386/acpi-build.c+1 -50 replies
3/16pc: acpi: drop manual hole punching for CPU hotplug resourceshw/i386/acpi-build.c+1 -50 replies
4/16pc: acpi: drop manual hole punching for GPE0 resourceshw/i386/acpi-build.c+17 -150 replies
5/16pc: acpi-build: drop remaining ssdt_misc templatehw/i386/Makefile.objs hw/i386/acpi-build.c hw/i386/ssdt-misc.dsl+2 -270 replies
6/16acpi: add acpi_irq_no_flags() termhw/acpi/aml-build.c include/hw/acpi/aml-build.h+22 -00 replies
7/16pc: export applesmc IO port/lenhw/i386/acpi-build.c hw/misc/applesmc.c include/hw/isa/isa.h+12 -60 replies
8/16pc: acpi-build: drop template patching and create Device(SMC) dynamicallyhw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl hw/i386/acpi-dsdt.dsl +1 more+22 -201 reply
9/16tests: ACPI test blobs update due to PCI0._CRS changestests/acpi-test-data/pc/DSDT tests/acpi-test-data/pc/SSDT tests/acpi-test-data/q35/DSDT +1 more+0 -00 replies
10/16tests: bios-tables-test: add support for testing bridgestests/bios-tables-test.c+40 -50 replies
11/16tests: add ACPI blobs for qemu with bridge casestests/acpi-test-data/pc/SSDT.bridge tests/acpi-test-data/q35/SSDT.bridge+0 -00 replies
12/16pc: acpi-build: simplify PCI bus tree generationhw/i386/acpi-build.c+85 -1890 replies
13/16tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creationtests/acpi-test-data/pc/SSDT.bridge+0 -00 replies
14/16pc: acpi-build: drop template patching and create PCI bus tree dynamicallyhw/i386/Makefile.objs hw/i386/acpi-build.c hw/i386/ssdt-pcihp.dsl+80 -2560 replies
15/16pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobshw/i386/ssdt-misc.hex.generated hw/i386/ssdt-pcihp.hex.generated+0 -3900 replies
16/16acpi: make build_*() routines static to aml-build.chw/acpi/aml-build.c include/hw/acpi/aml-build.h+10 -260 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 00/16] ACPI refactoring: replace template patching with C AML API

NOTE to maintaner:
Needs updating DSDT hex.generated and ACPI tests blobs

Changes since v4:
* split PCI0._CRS patch onto simple ones
* move _CRS into SSDT
* a series to drop manual hole punching in PIIX4 _CRS
* add test case for ACPI table with coldplugged bridge
* fixed up current algorithm rewrite fallout on Q35 machine, see for detailed changelog in
"pc: acpi-build: simplify PCI bus tree generation"
* fixed minor mst's notes on v4 in PCI patches

Remaining pieces of refactoring PC/Q35 machines to AML API. There is no more template patching left.

There are TPM and DSDT table blobs left to convert but that's left for future.

Boot tested with XP3/WS2012R2, correctnes of resource reservation was checked with WS2012R2 help.

reference to previous iteration:
https://www.mail-archive.com/[email protected]/msg280791.html

tree for testing:
https://github.com/imammedo/qemu.git ASL_API_v5
for browsing:
https://github.com/imammedo/qemu/commits/ASL_API_v5

Igor Mammedov (16):
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

 hw/acpi/aml-build.c                  |  41 ++-
 hw/i386/Makefile.objs                |   2 -
 hw/i386/acpi-build.c                 | 491 ++++++++++++-----------------------
 hw/i386/acpi-dsdt-isa.dsl            |  11 -
 hw/i386/acpi-dsdt-pci-crs.dsl        |  92 -------
 hw/i386/acpi-dsdt.dsl                |  46 ----
 hw/i386/q35-acpi-dsdt.dsl            |  19 --
 hw/i386/ssdt-misc.dsl                |  40 ---
 hw/i386/ssdt-misc.hex.generated      | 139 ----------
 hw/i386/ssdt-pcihp.dsl               | 100 -------
 hw/i386/ssdt-pcihp.hex.generated     | 251 ------------------
 hw/misc/applesmc.c                   |   5 +-
 include/hw/acpi/aml-build.h          |  17 +-
 include/hw/isa/isa.h                 |  11 +-
 tests/acpi-test-data/pc/DSDT         | Bin 3415 -> 2970 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2374 -> 2480 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 0 -> 4351 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 8005 -> 7608 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 578 -> 685 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 0 -> 702 bytes
 tests/bios-tables-test.c             |  45 +++-
 21 files changed, 250 insertions(+), 1060 deletions(-)
 delete mode 100644 hw/i386/acpi-dsdt-pci-crs.dsl
 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
 create mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/SSDT.bridge
Signature · 1 line
1.8.3.1