Skip to content

pc: acpi: convert DSDT to AML API and drop ASL templates support

Igor Mammedov qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest51 patches 0 repliesNew
  2. v174 patches 73 repliesSuperseded

Changes in v2 from the cover letter

- rebase on top of PCI tree skipping AML API patches
as they are already applied there
- drop a_ prefix for AML variables
- use DIFF env. var. to specify diff utility to show ASL difference
- build ISA device with a function pre device type
at expence of some code duplication it makes code a little bit more readable. Later refactoring will remove duplicated code folding all of it into one simple function for all ISA devices.
- unfold GPE stub handlers loop and opencode it, it adds ~10 extra LOC that will be removed at refactoring stage since stubs are not required by spec/guest leaving only GPE handlers that are actually doing something.
- minor cleanups to make code more readble/clear,
based on Marcel's and Michael's review.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/51tests: acpi: print ASL diff in verbose modetests/bios-tables-test.c+16 -00 replies
2/51pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT codehw/acpi/Makefile.objs hw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-build.c +1 more+38 -10 replies
3/51pc: acpi: memhp: move MHPD._STA method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+14 -80 replies
4/51pc: acpi: memhp: move MHPD.MLCK mutex into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+3 -20 replies
5/51pc: acpi: memhp: move MHPD.MSCN method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+61 -260 replies
6/51pc: acpi: memhp: move MHPD.MRST method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+23 -150 replies
7/51pc: acpi: memhp: move MHPD.MPXM method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+14 -90 replies
8/51pc: acpi: memhp: move MHPD.MOST method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+15 -100 replies
9/51pc: acpi: memhp: move MHPD.MEJ0 method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+13 -80 replies
10/51pc: acpi: memhp: move MHPD.MCRS method into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+92 -720 replies
11/51pc: acpi: memhp: move MHPD Device into SSDThw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-dsdt-mem-hotplug.dsl+5 -80 replies
12/51pc: acpi: factor out memhp code from build_ssdt() into separate functionhw/i386/acpi-build.c+126 -1130 replies
13/51pc: acpi: memhp: move \_GPE._E03 into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-mem-hotplug.dsl hw/i386/acpi-dsdt.dsl +3 more+11 -280 replies
14/51pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usagehw/acpi/memory_hotplug_acpi_table.c hw/i386/acpi-build.c include/hw/acpi/memory_hotplug.h +1 more+74 -790 replies
15/51pc: acpi: drop unused CPU_STATUS_LEN from DSDThw/i386/acpi-dsdt-cpu-hotplug.dsl+0 -10 replies
16/51pc: acpi: cpuhp: move CPEJ() method to SSDThw/acpi/Makefile.objs hw/acpi/cpu_hotplug_acpi_table.c hw/i386/acpi-build.c +2 more+36 -60 replies
17/51pc: acpi: cpuhp: move CPMA() method into SSDThw/acpi/cpu_hotplug_acpi_table.c hw/i386/acpi-build.c hw/i386/acpi-dsdt-cpu-hotplug.dsl +1 more+28 -150 replies
18/51pc: acpi: cpuhp: move CPST() method into SSDThw/acpi/cpu_hotplug_acpi_table.c hw/i386/acpi-build.c hw/i386/acpi-dsdt-cpu-hotplug.dsl +1 more+25 -130 replies
19/51pc: acpi: cpuhp: move PRSC() method into SSDThw/acpi/cpu_hotplug_acpi_table.c hw/i386/acpi-build.c hw/i386/acpi-dsdt-cpu-hotplug.dsl +5 more+71 -420 replies
20/51pc: acpi: cpuhp: move \_GPE._E02() into SSDThw/acpi/cpu_hotplug_acpi_table.c hw/i386/acpi-build.c hw/i386/acpi-dsdt-cpu-hotplug.dsl +4 more+11 -460 replies
21/51pc: acpi: factor out cpu hotplug code from build_ssdt() into separate functionhw/i386/acpi-build.c+94 -800 replies
22/51pc: acpi: move HPET from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-hpet.dsl hw/i386/acpi-dsdt.dsl +3 more+55 -540 replies
23/51pc: acpi: move DBUG() from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-dbug.dsl hw/i386/acpi-dsdt.dsl +1 more+36 -450 replies
24/51pc: acpi: move RTC device from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl+26 -90 replies
25/51pc: acpi: move KBD device from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl+22 -120 replies
26/51pc: acpi: move MOU device from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl+21 -100 replies
27/51pc: acpi: move FDC0 device from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl+40 -180 replies
28/51pc: acpi: move LPT device from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl+36 -160 replies
29/51pc: acpi: move COM devices from DSDT to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt-isa.dsl hw/i386/acpi-dsdt.dsl +1 more+48 -580 replies
30/51pc: acpi: move PIIX4 isa-bridge and pm devices into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl include/hw/acpi/aml-build.h+81 -490 replies
31/51pc: acpi: move remaining GPE handlers into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl hw/i386/q35-acpi-dsdt.dsl+29 -770 replies
32/51pc: acpi: pci: move link devices into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+82 -440 replies
33/51pc: acpi: piix4: move IQCR() into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+20 -110 replies
34/51pc: acpi: piix4: move IQST() into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+10 -90 replies
35/51pc: acpi: piix4: move PCI0._PRT() into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+47 -680 replies
36/51pc: acpi: piix4: move remaining PCI hotplug bits into SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+43 -400 replies
37/51pc: acpi: piix4: acpi move PCI0 device to SSDThw/i386/acpi-build.c hw/i386/acpi-dsdt.dsl+8 -80 replies
38/51pc: acpi: q35: move GSI links to SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+55 -260 replies
39/51pc: acpi: q35: move link devices to SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+17 -320 replies
40/51pc: acpi: q35: move IQCR() into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+33 -270 replies
41/51pc: acpi: q35: move IQST() into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+15 -190 replies
42/51pc: acpi: q35: move ISA bridge into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+54 -460 replies
43/51pc: acpi: q35: move _PRT() into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+21 -120 replies
44/51pc: acpi: q35: move PRTA routing table into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+61 -570 replies
45/51pc: acpi: q35: move PRTP routing table into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+2 -790 replies
46/51pc: acpi: q35: move _PIC() method into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+8 -100 replies
47/51pc: acpi: q35: move PCI0._OSC() method into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+56 -570 replies
48/51pc: acpi: q35: move PCI0 device definition into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+9 -180 replies
49/51pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDThw/i386/acpi-build.c hw/i386/q35-acpi-dsdt.dsl+10 -50 replies
50/51pc: acpi: switch to AML API composed DSDThw/i386/acpi-build.c+115 -1200 replies
51/51pc: acpi: remove unused ASL templates and related blobs/utilshw/i386/Makefile.objs hw/i386/acpi-dsdt.dsl hw/i386/acpi-dsdt.hex.generated +5 more+0 -111070 replies

Reviews trailers per patch

1 of 51 patches has a Reviewed-by or Acked-by.

PatchMarcel Apfelbaum
1/51
2/51
3/51
4/51
5/51
6/51
7/51
8/51
9/51
10/51
11/51
12/51
13/51
14/51
15/51
16/51
17/51
18/51
19/51
20/51
21/51
22/51
23/51
24/51
25/51
26/51
27/51
28/51
29/51
30/51
31/51
32/51
33/51
34/51
35/51R-b
36/51
37/51
38/51
39/51
40/51
41/51
42/51
43/51
44/51
45/51
46/51
47/51
48/51
49/51
50/51
51/51

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/51] pc: acpi: convert DSDT to AML API and drop ASL templates support

Changelog:
v1->v2:
- rebase on top of PCI tree skipping AML API patches
as they are already applied there
- drop a_ prefix for AML variables
- use DIFF env. var. to specify diff utility to show ASL difference
- build ISA device with a function pre device type
at expence of some code duplication it makes code a little bit more readable. Later refactoring will remove duplicated code folding all of it into one simple function for all ISA devices.
- unfold GPE stub handlers loop and opencode it, it adds ~10 extra LOC that will be removed at refactoring stage since stubs are not required by spec/guest leaving only GPE handlers that are actually doing something.
- minor cleanups to make code more readble/clear,
based on Marcel's and Michael's review.

Due to huge size, CCing only cover letter instead of individual patches.

Series converts DSDT using existing and new AML API.

Series does exact byte by byte conversion and passes ACPI tables 'make check' tests.
The conversion first moves common for PIIX4/Q35 parts, getting rid of *.dsl includes and then converts PIIX4 and Q35 parts of DSDT.

Diff-stat looks nice but actual code base is reduced by ~2000LOC while the rest of 10000 removals is dropping precompiled AML templates from the tree.

There are some AML parts that could be optimized/simplified and shared between PIIX4/Q35/ARM but doing it will break exact match with original tests, hence it's left out for later refactoring.

git tree for testing:
https://github.com/imammedo/qemu/tree/drop_ASL_support_v2
or
github.com:imammedo/qemu.git drop_ASL_support_v2

Igor Mammedov (51):
tests: acpi: print ASL diff in verbose mode
pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code
pc: acpi: memhp: move MHPD._STA method into SSDT
pc: acpi: memhp: move MHPD.MLCK mutex into SSDT
pc: acpi: memhp: move MHPD.MSCN method into SSDT
pc: acpi: memhp: move MHPD.MRST method into SSDT
pc: acpi: memhp: move MHPD.MPXM method into SSDT
pc: acpi: memhp: move MHPD.MOST method into SSDT
pc: acpi: memhp: move MHPD.MEJ0 method into SSDT
pc: acpi: memhp: move MHPD.MCRS method into SSDT
pc: acpi: memhp: move MHPD Device into SSDT
pc: acpi: factor out memhp code from build_ssdt() into separate
function
pc: acpi: memhp: move \_GPE._E03 into SSDT
pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage
pc: acpi: drop unused CPU_STATUS_LEN from DSDT
pc: acpi: cpuhp: move CPEJ() method to SSDT
pc: acpi: cpuhp: move CPMA() method into SSDT
pc: acpi: cpuhp: move CPST() method into SSDT
pc: acpi: cpuhp: move PRSC() method into SSDT
pc: acpi: cpuhp: move \_GPE._E02() into SSDT
pc: acpi: factor out cpu hotplug code from build_ssdt() into separate
function
pc: acpi: move HPET from DSDT to SSDT
pc: acpi: move DBUG() from DSDT to SSDT
pc: acpi: move RTC device from DSDT to SSDT
pc: acpi: move KBD device from DSDT to SSDT
pc: acpi: move MOU device from DSDT to SSDT
pc: acpi: move FDC0 device from DSDT to SSDT
pc: acpi: move LPT device from DSDT to SSDT
pc: acpi: move COM devices from DSDT to SSDT
pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT
pc: acpi: move remaining GPE handlers into SSDT
pc: acpi: pci: move link devices into SSDT
pc: acpi: piix4: move IQCR() into SSDT
pc: acpi: piix4: move IQST() into SSDT
pc: acpi: piix4: move PCI0._PRT() into SSDT
pc: acpi: piix4: move remaining PCI hotplug bits into SSDT
pc: acpi: piix4: acpi move PCI0 device to SSDT
pc: acpi: q35: move GSI links to SSDT
pc: acpi: q35: move link devices to SSDT
pc: acpi: q35: move IQCR() into SSDT
pc: acpi: q35: move IQST() into SSDT
pc: acpi: q35: move ISA bridge into SSDT
pc: acpi: q35: move _PRT() into SSDT
pc: acpi: q35: move PRTA routing table into SSDT
pc: acpi: q35: move PRTP routing table into SSDT
pc: acpi: q35: move _PIC() method into SSDT
pc: acpi: q35: move PCI0._OSC() method into SSDT
pc: acpi: q35: move PCI0 device definition into SSDT
pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT
pc: acpi: switch to AML API composed DSDT
pc: acpi: remove unused ASL templates and related blobs/utils

 hw/acpi/Makefile.objs               |    4 +-
 hw/acpi/cpu_hotplug_acpi_table.c    |  135 +
 hw/acpi/memory_hotplug_acpi_table.c |  262 ++
 hw/i386/Makefile.objs               |   30 -
 hw/i386/acpi-build.c                | 1367 +++++--
 hw/i386/acpi-dsdt-cpu-hotplug.dsl   |   90 -
 hw/i386/acpi-dsdt-dbug.dsl          |   41 -
 hw/i386/acpi-dsdt-hpet.dsl          |   48 -
 hw/i386/acpi-dsdt-isa.dsl           |  117 -
 hw/i386/acpi-dsdt-mem-hotplug.dsl   |  171 -
 hw/i386/acpi-dsdt.dsl               |  303 --
 hw/i386/acpi-dsdt.hex.generated     | 2972 --------------
 hw/i386/q35-acpi-dsdt.dsl           |  436 --
 hw/i386/q35-acpi-dsdt.hex.generated | 7610 -----------------------------------
 hw/timer/hpet.c                     |    2 +-
 include/hw/acpi/aml-build.h         |    3 +
 include/hw/acpi/cpu_hotplug.h       |   10 +
 include/hw/acpi/memory_hotplug.h    |    9 +
 include/hw/acpi/pc-hotplug.h        |   44 +-
 include/hw/timer/hpet.h             |    1 +
 scripts/acpi_extract.py             |  367 --
 scripts/acpi_extract_preprocess.py  |   51 -
 scripts/update-acpi.sh              |    4 -
 tests/bios-tables-test.c            |   16 +
 24 files changed, 1599 insertions(+), 12494 deletions(-)
 create mode 100644 hw/acpi/cpu_hotplug_acpi_table.c
 create mode 100644 hw/acpi/memory_hotplug_acpi_table.c
 delete mode 100644 hw/i386/acpi-dsdt-cpu-hotplug.dsl
 delete mode 100644 hw/i386/acpi-dsdt-dbug.dsl
 delete mode 100644 hw/i386/acpi-dsdt-hpet.dsl
 delete mode 100644 hw/i386/acpi-dsdt-isa.dsl
 delete mode 100644 hw/i386/acpi-dsdt-mem-hotplug.dsl
 delete mode 100644 hw/i386/acpi-dsdt.dsl
 delete mode 100644 hw/i386/acpi-dsdt.hex.generated
 delete mode 100644 hw/i386/q35-acpi-dsdt.dsl
 delete mode 100644 hw/i386/q35-acpi-dsdt.hex.generated
 delete mode 100755 scripts/acpi_extract.py
 delete mode 100755 scripts/acpi_extract_preprocess.py
 delete mode 100644 scripts/update-acpi.sh
Signature · 1 line
1.8.3.1