Skip to contentSkip to conversation

ACPI related fixes to comform the spec better

PATCH In review Isaku Yamahata 4 participants 21 messages Feb 11, 2021 – Feb 16, 2021 Checkpatch

lore
Share & tools
lore
#0 lore raw

v3 cover ACPI related fixes to comform the spec better

Miscellaneous bug fixes related to ACPI to play nice with guest BIOSes/OSes by conforming to ACPI spec better.

Changes from v2:
- improved commit message
- introduced compat property x-smm-compat-5
- _CRS for MMCONFIG resource, read MMCONFIG info from qemu, generate resource instead of dynamically reading chipset configuration.

Changes from v1:
- fixed style issue with fixes to checkpatch.pl
- fixed make check breakage
- added ACPI table tests
- update comment message to include acpi table diff

Isaku Yamahata (9):
checkpatch: don't emit warning on newly created acpi data files
qtest: update tests/qtest/bios-tables-test-allowed-diff.h
i386: add properoty, x-smm-compat-5, to keep compatibility of SMM acpi/core: always set SCI_EN when SMM isn't supported
acpi: set fadt.smi_cmd to zero when SMM is not supported
acpi: add test case for smm unsupported -machine smm=off hw/i386: declare ACPI mother board resource for MMCONFIG region
acpi: add test case for -no-hpet qtest/acpi/bios-tables-test: update acpi tables

Sean Christopherson (1):
i386: acpi: Don't build HPET ACPI entry if HPET is disabled

 hw/acpi/core.c                    |  20 ++++++++-
 hw/acpi/ich9.c                    |   2 +-
 hw/acpi/piix4.c                   |   3 +-
 hw/i386/acpi-build.c              |  72 +++++++++++++++++++++++++++---
 hw/i386/pc_piix.c                 |  10 +++--
 hw/i386/pc_q35.c                  |   1 +
 hw/i386/x86.c                     |  18 ++++++++
 hw/isa/vt82c686.c                 |   2 +-
 include/hw/acpi/acpi.h            |   4 +-
 include/hw/i386/x86.h             |   2 +
 scripts/checkpatch.pl             |   4 +-
 tests/data/acpi/q35/DSDT          | Bin 7801 -> 7892 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9126 -> 9217 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7819 -> 7910 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8265 -> 8356 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9455 -> 9546 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7876 -> 7967 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9160 -> 9251 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8932 -> 9023 bytes
 tests/data/acpi/q35/DSDT.nohpet   | Bin 0 -> 7750 bytes
 tests/data/acpi/q35/DSDT.nosmm    | Bin 0 -> 7892 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7807 -> 7898 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8407 -> 8498 bytes
 tests/data/acpi/q35/FACP.nosmm    | Bin 0 -> 244 bytes
 tests/qtest/bios-tables-test.c    |  24 ++++++++++
 25 files changed, 146 insertions(+), 16 deletions(-)
 create mode 100644 tests/data/acpi/q35/DSDT.nohpet
 create mode 100644 tests/data/acpi/q35/DSDT.nosmm
 create mode 100644 tests/data/acpi/q35/FACP.nosmm
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/10 checkpatch: don't emit warning on newly created acpi data files

Newly created acpi data files(tests/data/acpi/) cause false positive warning.
If file names are acpi expected file, don't emit warning.

Fixes e625ba2a41 ("checkpatch: fix acpi check with multiple file name")
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +3 -1
index e47ad878d8..40c9cc7def 100755
@@ -1530,7 +1530,9 @@ sub process {
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
 		     $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
 		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
-		      (defined($1) || defined($2))))) {
+		      (defined($1) || defined($2)))) &&
+                      !(($realfile ne '') &&
+                        ($realfile eq $acpi_testexpected))) {
 			$reported_maintainer_file = 1;
 			WARN("added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
 		}
Signature · 1 line
2.17.1
#2 lore raw

PATCH v3 2/10 qtest: update tests/qtest/bios-tables-test-allowed-diff.h

In reply to Isaku Yamahata

The following tests will modify acpi tables.
prepare qtests to allow acpi table change.
add new tables for new tests.
- tests/data/acpi/q35/DSDT.nosmm
- tests/data/acpi/q35/FACP.nosmm
- tests/data/acpi/q35/DSDT.nohpet

---
 tests/data/acpi/q35/DSDT.nohpet             |  0
 tests/data/acpi/q35/DSDT.nosmm              |  0
 tests/data/acpi/q35/FACP.nosmm              |  0
 tests/qtest/bios-tables-test-allowed-diff.h | 13 +++++++++++++
 4 files changed, 13 insertions(+)
 create mode 100644 tests/data/acpi/q35/DSDT.nohpet
 create mode 100644 tests/data/acpi/q35/DSDT.nosmm
 create mode 100644 tests/data/acpi/q35/FACP.nosmm
tests/data/acpi/q35/DSDT.nohpet new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/q35/DSDT.nosmm new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/q35/FACP.nosmm new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/qtest/bios-tables-test-allowed-diff.h +13 -0
index dfb8523c8b..b79ac495c2 100644
@@ -1 +1,14 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/DSDT",
+"tests/data/acpi/q35/DSDT.tis",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.ipmibt",
+"tests/data/acpi/q35/DSDT.cphp",
+"tests/data/acpi/q35/DSDT.memhp",
+"tests/data/acpi/q35/DSDT.numamem",
+"tests/data/acpi/q35/DSDT.dimmpxm",
+"tests/data/acpi/q35/DSDT.acpihmat",
+"tests/data/acpi/q35/DSDT.mmio64",
+"tests/data/acpi/q35/DSDT.nosmm",
+"tests/data/acpi/q35/FACP.nosmm",
+"tests/data/acpi/q35/DSDT.nohpet",
Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 3/10 i386: add properoty, x-smm-compat-5, to keep compatibility of SMM

In reply to Isaku Yamahata

The following patch will introduce incompatible behavior of SMM. Introduce a property to keep the old behavior for compatibility. To enable smm compat, use "-machine x-smm-compat-5=on"

---
 hw/i386/pc_piix.c     | 10 ++++++----
 hw/i386/pc_q35.c      |  1 +
 hw/i386/x86.c         | 18 ++++++++++++++++++
 include/hw/i386/x86.h |  2 ++
 4 files changed, 27 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +6 -4
index 6188c3e97e..87269e170e 100644
@@ -441,6 +441,7 @@ DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
 static void pc_i440fx_5_2_machine_options(MachineClass *m)
 {
     pc_i440fx_6_0_machine_options(m);
+    m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";
     m->alias = NULL;
     m->is_default = false;
     compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
@@ -664,7 +665,8 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m)
 
     pc_i440fx_2_3_machine_options(m);
     m->hw_version = "2.2.0";
-    m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on";
+    m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on"
+        ",x-smm-compat-5=on";
     compat_props_add(m->compat_props, hw_compat_2_2, hw_compat_2_2_len);
     compat_props_add(m->compat_props, pc_compat_2_2, pc_compat_2_2_len);
     pcmc->rsdp_in_ram = false;
@@ -727,7 +729,7 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m)
 
     pc_i440fx_2_0_machine_options(m);
     m->hw_version = "1.7.0";
-    m->default_machine_opts = NULL;
+    m->default_machine_opts = "x-smm-compat-5=on";
     m->option_rom_has_mr = true;
     compat_props_add(m->compat_props, pc_compat_1_7, pc_compat_1_7_len);
     pcmc->smbios_defaults = false;
@@ -999,7 +1001,7 @@ static void xenfv_4_2_machine_options(MachineClass *m)
     pc_i440fx_4_2_machine_options(m);
     m->desc = "Xen Fully-virtualized PC";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
 }
 
 DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
@@ -1011,7 +1013,7 @@ static void xenfv_3_1_machine_options(MachineClass *m)
     m->desc = "Xen Fully-virtualized PC";
     m->alias = "xenfv";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
 }
 
 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
hw/i386/pc_q35.c +1 -0
index 0a212443aa..14974b7255 100644
@@ -358,6 +358,7 @@ DEFINE_Q35_MACHINE(v6_0, "pc-q35-6.0", NULL,
 static void pc_q35_5_2_machine_options(MachineClass *m)
 {
     pc_q35_6_0_machine_options(m);
+    m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";
     m->alias = NULL;
     compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
     compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
hw/i386/x86.c +18 -0
index 6329f90ef9..00eb2253d3 100644
@@ -1174,6 +1174,18 @@ static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name,
     visit_type_OnOffAuto(v, name, &x86ms->smm, errp);
 }
 
+static bool x86_machine_get_smm_compat_5(Object *obj, Error **errp)
+{
+    X86MachineState *x86ms = X86_MACHINE(obj);
+    return  x86ms->smm_compat_5;
+}
+
+static void x86_machine_set_smm_compat_5(Object *obj, bool value, Error **errp)
+{
+    X86MachineState *x86ms = X86_MACHINE(obj);
+    x86ms->smm_compat_5 = value;
+}
+
 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)
 {
     if (x86ms->acpi == ON_OFF_AUTO_OFF) {
@@ -1204,6 +1216,7 @@ static void x86_machine_initfn(Object *obj)
     X86MachineState *x86ms = X86_MACHINE(obj);
 
     x86ms->smm = ON_OFF_AUTO_AUTO;
+    x86ms->smm_compat_5 = false;
     x86ms->acpi = ON_OFF_AUTO_AUTO;
     x86ms->smp_dies = 1;
     x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS;
@@ -1228,6 +1241,11 @@ static void x86_machine_class_init(ObjectClass *oc, void *data)
     object_class_property_set_description(oc, X86_MACHINE_SMM,
         "Enable SMM");
 
+    object_class_property_add_bool(oc, X86_MACHINE_SMM_COMPAT_5,
+        x86_machine_get_smm_compat_5, x86_machine_set_smm_compat_5);
+    object_class_property_set_description(oc, X86_MACHINE_SMM_COMPAT_5,
+        "Enable SMM compatible behavior");
+
     object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto",
         x86_machine_get_acpi, x86_machine_set_acpi,
         NULL, NULL);
include/hw/i386/x86.h +2 -0
index 56080bd1fb..3dbe19a335 100644
@@ -65,6 +65,7 @@ struct X86MachineState {
     unsigned smp_dies;
 
     OnOffAuto smm;
+    bool smm_compat_5;
     OnOffAuto acpi;
 
     /*
@@ -75,6 +76,7 @@ struct X86MachineState {
 };
 
 #define X86_MACHINE_SMM              "smm"
+#define X86_MACHINE_SMM_COMPAT_5     "x-smm-compat-5"
 #define X86_MACHINE_ACPI             "acpi"
 
 #define TYPE_X86_MACHINE   MACHINE_TYPE_NAME("x86")
Signature · 1 line
2.17.1
#4 lore raw

Re: [PATCH v3 03/10] i386: add properoty, x-smm-compat-5, to keep compatibility of SMM

Quoted 3 lines · On Wed, 10 Feb 2021 22:46:39 -0800 Isaku Yamahata <[email protected]>…

The following patch will introduce incompatible behavior of SMM. Introduce a property to keep the old behavior for compatibility. To enable smm compat, use "-machine x-smm-compat-5=on"

just curious, why it has "-5" suffix
also I'd drop x- prefix.

Quoted 13 lines
---
 hw/i386/pc_piix.c     | 10 ++++++----
 hw/i386/pc_q35.c      |  1 +
 hw/i386/x86.c         | 18 ++++++++++++++++++
 include/hw/i386/x86.h |  2 ++
 4 files changed, 27 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +0 -0
index 6188c3e97e..87269e170e 100644

hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL, · line 444

Quoted 4 lines
hw/i386/pc_piix.c +1 -0
@@ -441,6 +441,7 @@ DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
 static void pc_i440fx_5_2_machine_options(MachineClass *m)
 {
     pc_i440fx_6_0_machine_options(m);
+    m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";

did I point to a wrong example :/

smm machinery is part of ich9/piix4 devices, so it would be simpler by adding 'smm-compat' property to them

hw/core/machine.c +1 -1
index 970046f438..bcb0333ddf 100644
@@ -36,7 +36,9 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-pci.h"
 
-GlobalProperty hw_compat_5_2[] = {};
+GlobalProperty hw_compat_5_2[] = {
 

it turns on compat mode on 5.2 and older machines types

+ { "ICH9-LPC", "smm-compat", "on"},
+};
const size_t hw_compat_5_2_len = G_N_ELEMENTS(hw_compat_5_2);

GlobalProperty hw_compat_5_1[] = {

hw/isa/lpc_ich9.c +0 -0
index d3145bf014..13003b2ac2 100644
@@ -774,6 +774,7 @@ static const VMStateDescription vmstate_ich9_lpc = {
 };
 
 static Property ich9_lpc_properties[] = {
 

default would be used on new and later machine types

+ DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat , false),
DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features,
ICH9_LPC_SMI_F_BROADCAST_BIT, true),

then do the same for piix4 pm device

Quoted 115 lines
hw/i386/pc_piix.c +5 -4
     m->alias = NULL;
     m->is_default = false;
     compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
@@ -664,7 +665,8 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m)
 
     pc_i440fx_2_3_machine_options(m);
     m->hw_version = "2.2.0";
-    m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on";
+    m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on"
+        ",x-smm-compat-5=on";
     compat_props_add(m->compat_props, hw_compat_2_2, hw_compat_2_2_len);
     compat_props_add(m->compat_props, pc_compat_2_2, pc_compat_2_2_len);
     pcmc->rsdp_in_ram = false;
@@ -727,7 +729,7 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m)
 
     pc_i440fx_2_0_machine_options(m);
     m->hw_version = "1.7.0";
-    m->default_machine_opts = NULL;
+    m->default_machine_opts = "x-smm-compat-5=on";
     m->option_rom_has_mr = true;
     compat_props_add(m->compat_props, pc_compat_1_7, pc_compat_1_7_len);
     pcmc->smbios_defaults = false;
@@ -999,7 +1001,7 @@ static void xenfv_4_2_machine_options(MachineClass *m)
     pc_i440fx_4_2_machine_options(m);
     m->desc = "Xen Fully-virtualized PC";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
 }
 
 DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
@@ -1011,7 +1013,7 @@ static void xenfv_3_1_machine_options(MachineClass *m)
     m->desc = "Xen Fully-virtualized PC";
     m->alias = "xenfv";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
 }
 
 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
hw/i386/pc_q35.c +1 -0
index 0a212443aa..14974b7255 100644
@@ -358,6 +358,7 @@ DEFINE_Q35_MACHINE(v6_0, "pc-q35-6.0", NULL,
 static void pc_q35_5_2_machine_options(MachineClass *m)
 {
     pc_q35_6_0_machine_options(m);
+    m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";
     m->alias = NULL;
     compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
     compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
hw/i386/x86.c +18 -0
index 6329f90ef9..00eb2253d3 100644
@@ -1174,6 +1174,18 @@ static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name,
     visit_type_OnOffAuto(v, name, &x86ms->smm, errp);
 }
 
+static bool x86_machine_get_smm_compat_5(Object *obj, Error **errp)
+{
+    X86MachineState *x86ms = X86_MACHINE(obj);
+    return  x86ms->smm_compat_5;
+}
+
+static void x86_machine_set_smm_compat_5(Object *obj, bool value, Error **errp)
+{
+    X86MachineState *x86ms = X86_MACHINE(obj);
+    x86ms->smm_compat_5 = value;
+}
+
 bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)
 {
     if (x86ms->acpi == ON_OFF_AUTO_OFF) {
@@ -1204,6 +1216,7 @@ static void x86_machine_initfn(Object *obj)
     X86MachineState *x86ms = X86_MACHINE(obj);
 
     x86ms->smm = ON_OFF_AUTO_AUTO;
+    x86ms->smm_compat_5 = false;
     x86ms->acpi = ON_OFF_AUTO_AUTO;
     x86ms->smp_dies = 1;
     x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS;
@@ -1228,6 +1241,11 @@ static void x86_machine_class_init(ObjectClass *oc, void *data)
     object_class_property_set_description(oc, X86_MACHINE_SMM,
         "Enable SMM");
 
+    object_class_property_add_bool(oc, X86_MACHINE_SMM_COMPAT_5,
+        x86_machine_get_smm_compat_5, x86_machine_set_smm_compat_5);
+    object_class_property_set_description(oc, X86_MACHINE_SMM_COMPAT_5,
+        "Enable SMM compatible behavior");
+
     object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto",
         x86_machine_get_acpi, x86_machine_set_acpi,
         NULL, NULL);
include/hw/i386/x86.h +2 -0
index 56080bd1fb..3dbe19a335 100644
@@ -65,6 +65,7 @@ struct X86MachineState {
     unsigned smp_dies;
 
     OnOffAuto smm;
+    bool smm_compat_5;
     OnOffAuto acpi;
 
     /*
@@ -75,6 +76,7 @@ struct X86MachineState {
 };
 
 #define X86_MACHINE_SMM              "smm"
+#define X86_MACHINE_SMM_COMPAT_5     "x-smm-compat-5"
 #define X86_MACHINE_ACPI             "acpi"
 
 #define TYPE_X86_MACHINE   MACHINE_TYPE_NAME("x86")
#5 lore raw

PATCH v3 4/10 acpi/core: always set SCI_EN when SMM isn't supported

In reply to Isaku Yamahata

If SMM is not supported, ACPI fixed hardware doesn't support legacy-mode. ACPI-only platform. Where SCI_EN in PM1_CNT register is always set.
The bit tells OS legacy mode(SCI_EN cleared) or ACPI mode(SCI_EN set).

With the next patch (setting fadt.smi_cmd = 0 when smm isn't enabled), guest Linux tries to switch to ACPI mode, finds smi_cmd = 0, and then fails to initialize acpi subsystem. This patch proactively fixes it.

This patch changes guest ABI. To keep compatibility, use "x-smm-compat-5" introduced by earlier patch. If the property is true, disable new behavior.

ACPI spec 4.8.10.1 PM1 Event Grouping
PM1 Eanble Registers

Quoted 1 line

For ACPI-only platforms (where SCI_EN is always set)

---
 hw/acpi/core.c         | 20 +++++++++++++++++++-
 hw/acpi/ich9.c         |  2 +-
 hw/acpi/piix4.c        |  3 ++-
 hw/isa/vt82c686.c      |  2 +-
 include/hw/acpi/acpi.h |  4 +++-
 5 files changed, 26 insertions(+), 5 deletions(-)
hw/acpi/core.c +19 -1
index 7170bff657..03a6e949e8 100644
@@ -579,6 +579,10 @@ void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable)
 {
     /* ACPI specs 3.0, 4.7.2.5 */
+    if (ar->pm1.cnt.acpi_only) {
+        return;
+    }
+
     if (sci_enable) {
         ar->pm1.cnt.cnt |= ACPI_BITMASK_SCI_ENABLE;
     } else if (sci_disable) {
@@ -608,11 +612,22 @@ static const MemoryRegionOps acpi_pm_cnt_ops = {
 };
 
 void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
-                       bool disable_s3, bool disable_s4, uint8_t s4_val)
+                       bool disable_s3, bool disable_s4, uint8_t s4_val,
+                       bool acpi_only)
 {
     FWCfgState *fw_cfg;
 
+    /*
+     * Until v5, pm1 cnt allows to change mode (legacy vs acpi)
+     * even SMM isn't enabled.
+     * Keep the old behavior for compatibility.
+     */
+    if (object_property_get_bool(qdev_get_machine(), "x-smm-compat-5", NULL)) {
+        acpi_only = false;
+    }
+
     ar->pm1.cnt.s4_val = s4_val;
+    ar->pm1.cnt.acpi_only = acpi_only;
     ar->wakeup.notify = acpi_notify_wakeup;
     qemu_register_wakeup_notifier(&ar->wakeup);
 
@@ -638,6 +653,9 @@ void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
 void acpi_pm1_cnt_reset(ACPIREGS *ar)
 {
     ar->pm1.cnt.cnt = 0;
+    if (ar->pm1.cnt.acpi_only) {
+        ar->pm1.cnt.cnt |= ACPI_BITMASK_SCI_ENABLE;
+    }
 }
 
 /* ACPI GPE */
hw/acpi/ich9.c +1 -1
index 5ff4e01c36..1a34d7f621 100644
@@ -282,7 +282,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
     acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable_s4,
-                      pm->s4_val);
+                      pm->s4_val, !smm_enabled);
 
     acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);
     memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm,
hw/acpi/piix4.c +2 -1
index 669be5bbf6..0cddf91de5 100644
@@ -496,7 +496,8 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io, s->disable_s3, s->disable_s4, s->s4_val);
+    acpi_pm1_cnt_init(&s->ar, &s->io, s->disable_s3, s->disable_s4, s->s4_val,
+                      !s->smm_enabled);
     acpi_gpe_init(&s->ar, GPE_LEN);
 
     s->powerdown_notifier.notify = piix4_pm_powerdown_req;
hw/isa/vt82c686.c +1 -1
index a6f5a0843d..071b64b497 100644
@@ -240,7 +240,7 @@ static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io, false, false, 2);
+    acpi_pm1_cnt_init(&s->ar, &s->io, false, false, 2, false);
 }
 
 static Property via_pm_properties[] = {
include/hw/acpi/acpi.h +3 -1
index 22b0b65bb2..9e8a76f2e2 100644
@@ -128,6 +128,7 @@ struct ACPIPM1CNT {
     MemoryRegion io;
     uint16_t cnt;
     uint8_t s4_val;
+    bool acpi_only;
 };
 
 struct ACPIGPE {
@@ -163,7 +164,8 @@ void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
 
 /* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
 void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
-                       bool disable_s3, bool disable_s4, uint8_t s4_val);
+                       bool disable_s3, bool disable_s4, uint8_t s4_val,
+                       bool acpi_only);
 void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable);
 void acpi_pm1_cnt_reset(ACPIREGS *ar);
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v3 04/10] acpi/core: always set SCI_EN when SMM isn't supported

Quoted 80 lines · On Wed, 10 Feb 2021 22:46:40 -0800 Isaku Yamahata <[email protected]>…

If SMM is not supported, ACPI fixed hardware doesn't support legacy-mode. ACPI-only platform. Where SCI_EN in PM1_CNT register is always set.
The bit tells OS legacy mode(SCI_EN cleared) or ACPI mode(SCI_EN set).

With the next patch (setting fadt.smi_cmd = 0 when smm isn't enabled), guest Linux tries to switch to ACPI mode, finds smi_cmd = 0, and then fails to initialize acpi subsystem. This patch proactively fixes it.

This patch changes guest ABI. To keep compatibility, use "x-smm-compat-5" introduced by earlier patch. If the property is true, disable new behavior.

ACPI spec 4.8.10.1 PM1 Event Grouping
PM1 Eanble Registers

Quoted 1 line

For ACPI-only platforms (where SCI_EN is always set)

---
 hw/acpi/core.c         | 20 +++++++++++++++++++-
 hw/acpi/ich9.c         |  2 +-
 hw/acpi/piix4.c        |  3 ++-
 hw/isa/vt82c686.c      |  2 +-
 include/hw/acpi/acpi.h |  4 +++-
 5 files changed, 26 insertions(+), 5 deletions(-)
hw/acpi/core.c +19 -1
index 7170bff657..03a6e949e8 100644
@@ -579,6 +579,10 @@ void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable)
 {
     /* ACPI specs 3.0, 4.7.2.5 */
+    if (ar->pm1.cnt.acpi_only) {
+        return;
+    }
+
     if (sci_enable) {
         ar->pm1.cnt.cnt |= ACPI_BITMASK_SCI_ENABLE;
     } else if (sci_disable) {
@@ -608,11 +612,22 @@ static const MemoryRegionOps acpi_pm_cnt_ops = {
 };
 
 void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
-                       bool disable_s3, bool disable_s4, uint8_t s4_val)
+                       bool disable_s3, bool disable_s4, uint8_t s4_val,
+                       bool acpi_only)
 {
     FWCfgState *fw_cfg;
 
+    /*
+     * Until v5, pm1 cnt allows to change mode (legacy vs acpi)
+     * even SMM isn't enabled.
+     * Keep the old behavior for compatibility.
+     */
+    if (object_property_get_bool(qdev_get_machine(), "x-smm-compat-5", NULL)) {
+        acpi_only = false;
+    }
+
     ar->pm1.cnt.s4_val = s4_val;
+    ar->pm1.cnt.acpi_only = acpi_only;
     ar->wakeup.notify = acpi_notify_wakeup;
     qemu_register_wakeup_notifier(&ar->wakeup);
 
@@ -638,6 +653,9 @@ void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
 void acpi_pm1_cnt_reset(ACPIREGS *ar)
 {
     ar->pm1.cnt.cnt = 0;
+    if (ar->pm1.cnt.acpi_only) {
+        ar->pm1.cnt.cnt |= ACPI_BITMASK_SCI_ENABLE;
+    }
 }
 
 /* ACPI GPE */
hw/acpi/ich9.c +0 -0
index 5ff4e01c36..1a34d7f621 100644

hw/acpi/ich9.c void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, · line 285

Quoted 5 lines
hw/acpi/ich9.c +1 -1
@@ -282,7 +282,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
     acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable_s4,
-                      pm->s4_val);
+                      pm->s4_val, !smm_enabled);

with device compat prop as suggested on 3/10 it will look like s/!smm_enabled/!pm->smm_compat && !smm_enabled/

Quoted 52 lines
hw/acpi/ich9.c +0 -0
     acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);
     memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm,
hw/acpi/piix4.c +2 -1
index 669be5bbf6..0cddf91de5 100644
@@ -496,7 +496,8 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io, s->disable_s3, s->disable_s4, s->s4_val);
+    acpi_pm1_cnt_init(&s->ar, &s->io, s->disable_s3, s->disable_s4, s->s4_val,
+                      !s->smm_enabled);
     acpi_gpe_init(&s->ar, GPE_LEN);
 
     s->powerdown_notifier.notify = piix4_pm_powerdown_req;
hw/isa/vt82c686.c +1 -1
index a6f5a0843d..071b64b497 100644
@@ -240,7 +240,7 @@ static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io, false, false, 2);
+    acpi_pm1_cnt_init(&s->ar, &s->io, false, false, 2, false);
 }
 
 static Property via_pm_properties[] = {
include/hw/acpi/acpi.h +3 -1
index 22b0b65bb2..9e8a76f2e2 100644
@@ -128,6 +128,7 @@ struct ACPIPM1CNT {
     MemoryRegion io;
     uint16_t cnt;
     uint8_t s4_val;
+    bool acpi_only;
 };
 
 struct ACPIGPE {
@@ -163,7 +164,8 @@ void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
 
 /* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
 void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
-                       bool disable_s3, bool disable_s4, uint8_t s4_val);
+                       bool disable_s3, bool disable_s4, uint8_t s4_val,
+                       bool acpi_only);
 void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable);
 void acpi_pm1_cnt_reset(ACPIREGS *ar);
#7 lore raw

PATCH v3 5/10 acpi: set fadt.smi_cmd to zero when SMM is not supported

In reply to Isaku Yamahata

From table 5.9 SMI_CMD of ACPI spec

Quoted 2 lines

This field is reserved and must be zero on system
that does not support System Management mode.

When smm is not enabled, set it to zero to comform to the spec. When -machine smm=off is passed, the change to FACP is as follows.

@@ -1,46 +1,46 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20180105 (64-bit version)
* Copyright (c) 2000 - 2018 Intel Corporation
*
- * Disassembly of tests/data/acpi/q35/FACP, Fri Feb 5 16:57:04 2021
+ * Disassembly of /tmp/aml-1OQYX0, Fri Feb 5 16:57:04 2021 *
* ACPI Data Table [FACP]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */

 [000h 0000   4]                    Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
 [004h 0004   4]                 Table Length : 000000F4
 [008h 0008   1]                     Revision : 03
-[009h 0009   1]                     Checksum : 1F
+[009h 0009   1]                     Checksum : D6
 [00Ah 0010   6]                       Oem ID : "BOCHS "
 [010h 0016   8]                 Oem Table ID : "BXPCFACP"
 [018h 0024   4]                 Oem Revision : 00000001
 [01Ch 0028   4]              Asl Compiler ID : "BXPC"
 [020h 0032   4]        Asl Compiler Revision : 00000001
 [024h 0036   4]                 FACS Address : 00000000
 [028h 0040   4]                 DSDT Address : 00000000
 [02Ch 0044   1]                        Model : 01
 [02Dh 0045   1]                   PM Profile : 00 [Unspecified]
 [02Eh 0046   2]                SCI Interrupt : 0009
-[030h 0048   4]             SMI Command Port : 000000B2
-[034h 0052   1]            ACPI Enable Value : 02
-[035h 0053   1]           ACPI Disable Value : 03
+[030h 0048   4]             SMI Command Port : 00000000
+[034h 0052   1]            ACPI Enable Value : 00
+[035h 0053   1]           ACPI Disable Value : 00
 [036h 0054   1]               S4BIOS Command : 00
 [037h 0055   1]              P-State Control : 00
 [038h 0056   4]     PM1A Event Block Address : 00000600
 [03Ch 0060   4]     PM1B Event Block Address : 00000000
 [040h 0064   4]   PM1A Control Block Address : 00000604
 [044h 0068   4]   PM1B Control Block Address : 00000000
 [048h 0072   4]    PM2 Control Block Address : 00000000
 [04Ch 0076   4]       PM Timer Block Address : 00000608
 [050h 0080   4]           GPE0 Block Address : 00000620
 [054h 0084   4]           GPE1 Block Address : 00000000
 [058h 0088   1]       PM1 Event Block Length : 04
 [059h 0089   1]     PM1 Control Block Length : 02
 [05Ah 0090   1]     PM2 Control Block Length : 00
 [05Bh 0091   1]        PM Timer Block Length : 04
 [05Ch 0092   1]            GPE0 Block Length : 10
 [05Dh 0093   1]            GPE1 Block Length : 00
---
 hw/i386/acpi-build.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
hw/i386/acpi-build.c +15 -3
index f56d699c7f..00cc119362 100644
@@ -139,6 +139,14 @@ const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio = {
 static void init_common_fadt_data(MachineState *ms, Object *o,
                                   AcpiFadtData *data)
 {
+    X86MachineState *x86ms = X86_MACHINE(ms);
+    /*
+     * Until v5, smi_cmd/acpi_enable_cmd/acpi_disable_cmd were always set
+     * irrelevant to smm_enabled, which doesn't comforms to ACPI spec.
+     * Keep guest ABI compatibility when smm_compat_5 is true.
+     */
+    bool smm_enabled = x86ms->smm_compat_5 ?
+        true : x86_machine_is_smm_enabled(x86ms);
     uint32_t io = object_property_get_uint(o, ACPI_PM_PROP_PM_IO_BASE, NULL);
     AmlAddressSpace as = AML_AS_SYSTEM_IO;
     AcpiFadtData fadt = {
@@ -159,12 +167,16 @@ static void init_common_fadt_data(MachineState *ms, Object *o,
         .rtc_century = RTC_CENTURY,
         .plvl2_lat = 0xfff /* C2 state not supported */,
         .plvl3_lat = 0xfff /* C3 state not supported */,
-        .smi_cmd = ACPI_PORT_SMI_CMD,
+        .smi_cmd = smm_enabled ? ACPI_PORT_SMI_CMD : 0,
         .sci_int = object_property_get_uint(o, ACPI_PM_PROP_SCI_INT, NULL),
         .acpi_enable_cmd =
-            object_property_get_uint(o, ACPI_PM_PROP_ACPI_ENABLE_CMD, NULL),
+            smm_enabled ?
+            object_property_get_uint(o, ACPI_PM_PROP_ACPI_ENABLE_CMD, NULL) :
+            0,
         .acpi_disable_cmd =
-            object_property_get_uint(o, ACPI_PM_PROP_ACPI_DISABLE_CMD, NULL),
+            smm_enabled ?
+            object_property_get_uint(o, ACPI_PM_PROP_ACPI_DISABLE_CMD, NULL) :
+            0,
         .pm1a_evt = { .space_id = as, .bit_width = 4 * 8, .address = io },
         .pm1a_cnt = { .space_id = as, .bit_width = 2 * 8,
                       .address = io + 0x04 },
Signature · 1 line
2.17.1
#8 lore raw

Re: [PATCH v3 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported

Quoted 86 lines · On Wed, 10 Feb 2021 22:46:41 -0800 Isaku Yamahata <[email protected]>…

From table 5.9 SMI_CMD of ACPI spec

Quoted 2 lines

This field is reserved and must be zero on system
that does not support System Management mode.

When smm is not enabled, set it to zero to comform to the spec. When -machine smm=off is passed, the change to FACP is as follows.

(quoted diff) +5 -5
@@ -1,46 +1,46 @@
 /*
  * Intel ACPI Component Architecture
  * AML/ASL+ Disassembler version 20180105 (64-bit version)
  * Copyright (c) 2000 - 2018 Intel Corporation
  *
- * Disassembly of tests/data/acpi/q35/FACP, Fri Feb  5 16:57:04 2021
+ * Disassembly of /tmp/aml-1OQYX0, Fri Feb  5 16:57:04 2021
  *
  * ACPI Data Table [FACP]
  *
  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
  */
 
 [000h 0000   4]                    Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
 [004h 0004   4]                 Table Length : 000000F4
 [008h 0008   1]                     Revision : 03
-[009h 0009   1]                     Checksum : 1F
+[009h 0009   1]                     Checksum : D6
 [00Ah 0010   6]                       Oem ID : "BOCHS "
 [010h 0016   8]                 Oem Table ID : "BXPCFACP"
 [018h 0024   4]                 Oem Revision : 00000001
 [01Ch 0028   4]              Asl Compiler ID : "BXPC"
 [020h 0032   4]        Asl Compiler Revision : 00000001
 
 [024h 0036   4]                 FACS Address : 00000000
 [028h 0040   4]                 DSDT Address : 00000000
 [02Ch 0044   1]                        Model : 01
 [02Dh 0045   1]                   PM Profile : 00 [Unspecified]
 [02Eh 0046   2]                SCI Interrupt : 0009
-[030h 0048   4]             SMI Command Port : 000000B2
-[034h 0052   1]            ACPI Enable Value : 02
-[035h 0053   1]           ACPI Disable Value : 03
+[030h 0048   4]             SMI Command Port : 00000000
+[034h 0052   1]            ACPI Enable Value : 00
+[035h 0053   1]           ACPI Disable Value : 00
 [036h 0054   1]               S4BIOS Command : 00
 [037h 0055   1]              P-State Control : 00
 [038h 0056   4]     PM1A Event Block Address : 00000600
 [03Ch 0060   4]     PM1B Event Block Address : 00000000
 [040h 0064   4]   PM1A Control Block Address : 00000604
 [044h 0068   4]   PM1B Control Block Address : 00000000
 [048h 0072   4]    PM2 Control Block Address : 00000000
 [04Ch 0076   4]       PM Timer Block Address : 00000608
 [050h 0080   4]           GPE0 Block Address : 00000620
 [054h 0084   4]           GPE1 Block Address : 00000000
 [058h 0088   1]       PM1 Event Block Length : 04
 [059h 0089   1]     PM1 Control Block Length : 02
 [05Ah 0090   1]     PM2 Control Block Length : 00
 [05Bh 0091   1]        PM Timer Block Length : 04
 [05Ch 0092   1]            GPE0 Block Length : 10
 [05Dh 0093   1]            GPE1 Block Length : 00
---
 hw/i386/acpi-build.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
hw/i386/acpi-build.c +8 -0
index f56d699c7f..00cc119362 100644
@@ -139,6 +139,14 @@ const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio = {
 static void init_common_fadt_data(MachineState *ms, Object *o,
                                   AcpiFadtData *data)
 {
+    X86MachineState *x86ms = X86_MACHINE(ms);
+    /*
+     * Until v5, smi_cmd/acpi_enable_cmd/acpi_disable_cmd were always set
+     * irrelevant to smm_enabled, which doesn't comforms to ACPI spec.
+     * Keep guest ABI compatibility when smm_compat_5 is true.
+     */
+    bool smm_enabled = x86ms->smm_compat_5 ?
+        true : x86_machine_is_smm_enabled(x86ms);
     uint32_t io = object_property_get_uint(o, ACPI_PM_PROP_PM_IO_BASE, NULL);
     AmlAddressSpace as = AML_AS_SYSTEM_IO;
     AcpiFadtData fadt = {

hw/i386/acpi-build.c static void init_common_fadt_data(MachineState *ms, Object *o, · line 170

Quoted 5 lines
hw/i386/acpi-build.c +1 -1
@@ -159,12 +167,16 @@ static void init_common_fadt_data(MachineState *ms, Object *o,
         .rtc_century = RTC_CENTURY,
         .plvl2_lat = 0xfff /* C2 state not supported */,
         .plvl3_lat = 0xfff /* C3 state not supported */,
-        .smi_cmd = ACPI_PORT_SMI_CMD,
+        .smi_cmd = smm_enabled ? ACPI_PORT_SMI_CMD : 0,

I'd fetch smm-compat property from 'o' object (assuming per device compat property)

hw/i386/acpi-build.c static void init_common_fadt_data(MachineState *ms, Object *o, · line 179

Quoted 11 lines
hw/i386/acpi-build.c +6 -2
         .sci_int = object_property_get_uint(o, ACPI_PM_PROP_SCI_INT, NULL),
         .acpi_enable_cmd =
-            object_property_get_uint(o, ACPI_PM_PROP_ACPI_ENABLE_CMD, NULL),
+            smm_enabled ?
+            object_property_get_uint(o, ACPI_PM_PROP_ACPI_ENABLE_CMD, NULL) :
+            0,
         .acpi_disable_cmd =
-            object_property_get_uint(o, ACPI_PM_PROP_ACPI_DISABLE_CMD, NULL),
+            smm_enabled ?
+            object_property_get_uint(o, ACPI_PM_PROP_ACPI_DISABLE_CMD, NULL) :
+            0,

for both ACPI_PM_PROP_ACPI_[EN|DIS]ABLE_CMD can return 0 when ich9/piix4 in acpi_only mode

Quoted 3 lines
hw/i386/acpi-build.c +0 -0
         .pm1a_evt = { .space_id = as, .bit_width = 4 * 8, .address = io },
         .pm1a_cnt = { .space_id = as, .bit_width = 2 * 8,
                       .address = io + 0x04 },
#9 lore raw

PATCH v3 6/10 acpi: add test case for smm unsupported -machine smm=off

In reply to Isaku Yamahata
---
 tests/qtest/bios-tables-test.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/qtest/bios-tables-test.c +12 -0
index 669202fc95..096d15db68 100644
@@ -969,6 +969,17 @@ static void test_acpi_q35_tcg_numamem(void)
     free_test_data(&data);
 }
 
+static void test_acpi_q35_tcg_nosmm(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".nosmm";
+    test_acpi_one("-machine smm=off", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_piix4_tcg_numamem(void)
 {
     test_data data;
@@ -1325,6 +1336,7 @@ int main(int argc, char *argv[])
         qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
         qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
         qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
+        qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
         qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm);
         qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
         qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat);
Signature · 1 line
2.17.1
#10 lore raw

PATCH v3 7/10 hw/i386: declare ACPI mother board resource for MMCONFIG region

In reply to Isaku Yamahata

Declare PNP0C01 device to reserve MMCONFIG region to conform to the spec better and play nice with guest BIOSes/OSes.

According to PCI Firmware Specification[0], MMCONFIG region must be reserved by declaring a motherboard resource. It's optional to reserve the region in memory map by Int 15 E820h or EFIGetMemoryMap. Guest Linux checks if the MMCFG region is reserved by bios memory map or ACPI resource. If it's not reserved, Linux falls back to legacy PCI configuration access.

TDVF [1] [2] doesn't reserve MMCONFIG the region in memory map. On the other hand OVMF reserves it in memory map without declaring a motherboard resource. With memory map reservation, linux guest uses MMCONFIG region. However it doesn't comply to PCI Firmware specification.

[0] PCI Firmware specification Revision 3.2
4.1.2 MCFG Table Description table 4-2 NOTE 2
If the operating system does not natively comprehend reserving the MMCFG region, The MMCFG region must e reserved by firmware. ... For most systems, the mortheroard resource would appear at the root of the ACPI namespace (under \_SB)...
The resource can optionally be returned in Int15 E820h or EFIGetMemoryMap as reserved memory but must always be reported through ACPI as a motherboard resource

[1] TDX: Intel Trust Domain Extension
https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html
[2] TDX Virtual Firmware
https://github.com/tianocore/edk2-staging/tree/TDVF

The change to DSDT is as follows.
@@ -68,32 +68,51 @@

                     If ((CDW3 != Local0))
                     {
                         CDW1 |= 0x10
                     }

                     CDW3 = Local0
                 }
                 Else
                 {
                     CDW1 |= 0x04
                 }

                 Return (Arg3)
             }
         }
+
+        Device (DRAC)
+        {
+            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
+            Name (RBUF, ResourceTemplate ()
+            {
+                QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x0000000000000000, // Granularity
+                    0x00000000B0000000, // Range Minimum
+                    0x00000000BFFFFFFF, // Range Maximum
+                    0x0000000000000000, // Translation Offset
+                    0x0000000010000000, // Length
+                    ,, , AddressRangeMemory, TypeStatic)
+            })
+            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
+            {
+                Return (RBUF) /* \_SB_.DRAC.RBUF */
+            }
+        }
     }

     Scope (_SB)
     {
         Device (HPET)
         {
             Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
             Name (_UID, Zero)  // _UID: Unique ID
             OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
             Field (HPTM, DWordAcc, Lock, Preserve)
             {
                 VEND,   32,
                 PRD,    32
             }

             Method (_STA, 0, NotSerialized)  // _STA: Status
---
 hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +45 -1
index 00cc119362..e369908b1a 100644
@@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
+static Aml *build_q35_dram_controller(void)
+{
+    AcpiMcfgInfo mcfg;
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,
+                                0x0000000000000000,
+                                mcfg.size));
+    rbuf = aml_name_decl("RBUF", resource_template);
+    aml_append(dev, rbuf);
+
+    crs = aml_method("_CRS", 0, AML_SERIALIZED);
+    rbuf_name = aml_name("RBUF");
+    aml_append(crs, aml_return(rbuf_name));
+    aml_append(dev, crs);
+
+    return dev;
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -1212,7 +1252,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
            Range *pci_hole, Range *pci_hole64, MachineState *machine)
 {
     CrsRangeEntry *entry;
-    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
+    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *drac;
     CrsRangeSet crs_range_set;
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
@@ -1256,6 +1296,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(dev, aml_name_decl("_UID", aml_int(0)));
         aml_append(dev, build_q35_osc_method());
         aml_append(sb_scope, dev);
+        drac = build_q35_dram_controller();
+        if (drac) {
+            aml_append(sb_scope, drac);
+        }
 
         if (pm->smi_on_cpuhp) {
             /* reserve SMI block resources, IO ports 0xB2, 0xB3 */
Signature · 1 line
2.17.1
#11 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 95 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…

Declare PNP0C01 device to reserve MMCONFIG region to conform to the spec better and play nice with guest BIOSes/OSes.

According to PCI Firmware Specification[0], MMCONFIG region must be reserved by declaring a motherboard resource. It's optional to reserve the region in memory map by Int 15 E820h or EFIGetMemoryMap. Guest Linux checks if the MMCFG region is reserved by bios memory map or ACPI resource. If it's not reserved, Linux falls back to legacy PCI configuration access.

TDVF [1] [2] doesn't reserve MMCONFIG the region in memory map. On the other hand OVMF reserves it in memory map without declaring a motherboard resource. With memory map reservation, linux guest uses MMCONFIG region. However it doesn't comply to PCI Firmware specification.

[0] PCI Firmware specification Revision 3.2
4.1.2 MCFG Table Description table 4-2 NOTE 2
If the operating system does not natively comprehend reserving the MMCFG region, The MMCFG region must e reserved by firmware. ... For most systems, the mortheroard resource would appear at the root of the ACPI namespace (under \_SB)...
The resource can optionally be returned in Int15 E820h or EFIGetMemoryMap as reserved memory but must always be reported through ACPI as a motherboard resource

[1] TDX: Intel Trust Domain Extension
https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html
[2] TDX Virtual Firmware
https://github.com/tianocore/edk2-staging/tree/TDVF

The change to DSDT is as follows.

(quoted diff) +19 -0
@@ -68,32 +68,51 @@
 
                     If ((CDW3 != Local0))
                     {
                         CDW1 |= 0x10
                     }
 
                     CDW3 = Local0
                 }
                 Else
                 {
                     CDW1 |= 0x04
                 }
 
                 Return (Arg3)
             }
         }
+
+        Device (DRAC)
+        {
+            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
+            Name (RBUF, ResourceTemplate ()
+            {
+                QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x0000000000000000, // Granularity
+                    0x00000000B0000000, // Range Minimum
+                    0x00000000BFFFFFFF, // Range Maximum
+                    0x0000000000000000, // Translation Offset
+                    0x0000000010000000, // Length
+                    ,, , AddressRangeMemory, TypeStatic)
+            })
+            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
+            {
+                Return (RBUF) /* \_SB_.DRAC.RBUF */
+            }
+        }
     }
 
     Scope (_SB)
     {
         Device (HPET)
         {
             Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
             Name (_UID, Zero)  // _UID: Unique ID
             OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
             Field (HPTM, DWordAcc, Lock, Preserve)
             {
                 VEND,   32,
                 PRD,    32
             }
 
             Method (_STA, 0, NotSerialized)  // _STA: Status
---
 hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +0 -0
index 00cc119362..e369908b1a 100644

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1077

Quoted 6 lines
hw/i386/acpi-build.c +3 -0
@@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
+static Aml *build_q35_dram_controller(void)
+{
+    AcpiMcfgInfo mcfg;

build_dsdt() already calls acpi_get_mcfg(),
I suggest to cache it there and pass to build_q35_dram_controller as an argument.

Quoted 14 lines
hw/i386/acpi-build.c +14 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 10 lines
hw/i386/acpi-build.c +10 -0
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 17 lines
hw/i386/acpi-build.c +13 -0
+                                0x0000000000000000,
+                                mcfg.size));
+    rbuf = aml_name_decl("RBUF", resource_template);
+    aml_append(dev, rbuf);
+
+    crs = aml_method("_CRS", 0, AML_SERIALIZED);
+    rbuf_name = aml_name("RBUF");
+    aml_append(crs, aml_return(rbuf_name));
+    aml_append(dev, crs);
+
+    return dev;
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1255

Quoted 5 lines
hw/i386/acpi-build.c +1 -1
@@ -1212,7 +1252,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
            Range *pci_hole, Range *pci_hole64, MachineState *machine)
 {
     CrsRangeEntry *entry;
-    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
+    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *drac;

maybe limit drac to
if (misc->is_piix4) {
... } else {
Aml *drac
scope

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1302

Quoted 11 lines
hw/i386/acpi-build.c +4 -0
     CrsRangeSet crs_range_set;
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
@@ -1256,6 +1296,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(dev, aml_name_decl("_UID", aml_int(0)));
         aml_append(dev, build_q35_osc_method());
         aml_append(sb_scope, dev);
+        drac = build_q35_dram_controller();
+        if (drac) {
+            aml_append(sb_scope, drac);
+        }

mmcfg isn't optional for q35, is it?
I'd simplify to:

    aml_append(sb_scope, build_q35_dram_controller(mmcfg_info));

or put all of it under condition if it's optional
if(foo) aml_append(sb_scope, build_q35_dram_controller(mmcfg_info))

Quoted 2 lines
hw/i386/acpi-build.c +0 -0
         if (pm->smi_on_cpuhp) {
             /* reserve SMI block resources, IO ports 0xB2, 0xB3 */
#12 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 101 lines · Igor Mammedov
Quoted 98 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…

Declare PNP0C01 device to reserve MMCONFIG region to conform to the spec better and play nice with guest BIOSes/OSes.

According to PCI Firmware Specification[0], MMCONFIG region must be reserved by declaring a motherboard resource. It's optional to reserve the region in memory map by Int 15 E820h or EFIGetMemoryMap. Guest Linux checks if the MMCFG region is reserved by bios memory map or ACPI resource. If it's not reserved, Linux falls back to legacy PCI configuration access.

TDVF [1] [2] doesn't reserve MMCONFIG the region in memory map. On the other hand OVMF reserves it in memory map without declaring a motherboard resource. With memory map reservation, linux guest uses MMCONFIG region. However it doesn't comply to PCI Firmware specification.

[0] PCI Firmware specification Revision 3.2
4.1.2 MCFG Table Description table 4-2 NOTE 2
If the operating system does not natively comprehend reserving the MMCFG region, The MMCFG region must e reserved by firmware. ... For most systems, the mortheroard resource would appear at the root of the ACPI namespace (under \_SB)...
The resource can optionally be returned in Int15 E820h or EFIGetMemoryMap as reserved memory but must always be reported through ACPI as a motherboard resource

[1] TDX: Intel Trust Domain Extension
https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html
[2] TDX Virtual Firmware
https://github.com/tianocore/edk2-staging/tree/TDVF

The change to DSDT is as follows.

(quoted diff) +19 -0
@@ -68,32 +68,51 @@
 
                     If ((CDW3 != Local0))
                     {
                         CDW1 |= 0x10
                     }
 
                     CDW3 = Local0
                 }
                 Else
                 {
                     CDW1 |= 0x04
                 }
 
                 Return (Arg3)
             }
         }
+
+        Device (DRAC)
+        {
+            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
+            Name (RBUF, ResourceTemplate ()
+            {
+                QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x0000000000000000, // Granularity
+                    0x00000000B0000000, // Range Minimum
+                    0x00000000BFFFFFFF, // Range Maximum
+                    0x0000000000000000, // Translation Offset
+                    0x0000000010000000, // Length
+                    ,, , AddressRangeMemory, TypeStatic)
+            })
+            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
+            {
+                Return (RBUF) /* \_SB_.DRAC.RBUF */
+            }
+        }
     }
 
     Scope (_SB)
     {
         Device (HPET)
         {
             Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
             Name (_UID, Zero)  // _UID: Unique ID
             OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
             Field (HPTM, DWordAcc, Lock, Preserve)
             {
                 VEND,   32,
                 PRD,    32
             }
 
             Method (_STA, 0, NotSerialized)  // _STA: Status
---
 hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +0 -0
index 00cc119362..e369908b1a 100644
@@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
Quoted 6 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1077

Quoted 3 lines
hw/i386/acpi-build.c +3 -0
+static Aml *build_q35_dram_controller(void)
+{
+    AcpiMcfgInfo mcfg;

build_dsdt() already calls acpi_get_mcfg(),
I suggest to cache it there and pass to build_q35_dram_controller as an argument.

Sure.

Quoted 17 lines
Quoted 17 lines
hw/i386/acpi-build.c +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,

s/mcfg.base + mcfg.size - 1/mcfg.base/

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

iasl drm-1.dsl

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20190509 Copyright (c) 2000 - 2019 Intel Corporation

drm-1.dsl 23: 0x10000000, // Length = 256M
Error 6049 - ^ Length is larger than Min/Max window

ASL Input: drm-1.dsl - 1000 bytes 6 keywords 37 source lines

Compilation failed. 1 Errors, 0 Warnings, 0 Remarks No AML files were generated due to compiler error(s)

Quoted 19 lines
Quoted 19 lines
hw/i386/acpi-build.c +13 -0
+                                0x0000000000000000,
+                                mcfg.size));
+    rbuf = aml_name_decl("RBUF", resource_template);
+    aml_append(dev, rbuf);
+
+    crs = aml_method("_CRS", 0, AML_SERIALIZED);
+    rbuf_name = aml_name("RBUF");
+    aml_append(crs, aml_return(rbuf_name));
+    aml_append(dev, crs);
+
+    return dev;
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -1212,7 +1252,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
            Range *pci_hole, Range *pci_hole64, MachineState *machine)
 {
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1255

Quoted 3 lines
hw/i386/acpi-build.c +1 -1
     CrsRangeEntry *entry;
-    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
+    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *drac;

maybe limit drac to
if (misc->is_piix4) {
... } else {
Aml *drac
scope

ok.

Quoted 13 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1302

Quoted 11 lines
hw/i386/acpi-build.c +4 -0
     CrsRangeSet crs_range_set;
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
@@ -1256,6 +1296,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(dev, aml_name_decl("_UID", aml_int(0)));
         aml_append(dev, build_q35_osc_method());
         aml_append(sb_scope, dev);
+        drac = build_q35_dram_controller();
+        if (drac) {
+            aml_append(sb_scope, drac);
+        }

mmcfg isn't optional for q35, is it?
I'd simplify to:

Quoted 3 lines
    aml_append(sb_scope, build_q35_dram_controller(mmcfg_info));

or put all of it under condition if it's optional
if(foo) aml_append(sb_scope, build_q35_dram_controller(mmcfg_info))

It's optional. If MCFG isn't setup after reset, PCIE_BASE_ADDR_UNMAPPED is returned.

Signature · 1 line
Isaku Yamahata <[email protected]>
#13 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 140 lines · On Fri, 12 Feb 2021 12:51:57 -0800 Isaku Yamahata <[email protected]>…
Quoted 101 lines · Igor Mammedov
Quoted 98 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…

Declare PNP0C01 device to reserve MMCONFIG region to conform to the spec better and play nice with guest BIOSes/OSes.

According to PCI Firmware Specification[0], MMCONFIG region must be reserved by declaring a motherboard resource. It's optional to reserve the region in memory map by Int 15 E820h or EFIGetMemoryMap. Guest Linux checks if the MMCFG region is reserved by bios memory map or ACPI resource. If it's not reserved, Linux falls back to legacy PCI configuration access.

TDVF [1] [2] doesn't reserve MMCONFIG the region in memory map. On the other hand OVMF reserves it in memory map without declaring a motherboard resource. With memory map reservation, linux guest uses MMCONFIG region. However it doesn't comply to PCI Firmware specification.

[0] PCI Firmware specification Revision 3.2
4.1.2 MCFG Table Description table 4-2 NOTE 2
If the operating system does not natively comprehend reserving the MMCFG region, The MMCFG region must e reserved by firmware. ... For most systems, the mortheroard resource would appear at the root of the ACPI namespace (under \_SB)...
The resource can optionally be returned in Int15 E820h or EFIGetMemoryMap as reserved memory but must always be reported through ACPI as a motherboard resource

[1] TDX: Intel Trust Domain Extension
https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html
[2] TDX Virtual Firmware
https://github.com/tianocore/edk2-staging/tree/TDVF

The change to DSDT is as follows.

(quoted diff) +19 -0
@@ -68,32 +68,51 @@
 
                     If ((CDW3 != Local0))
                     {
                         CDW1 |= 0x10
                     }
 
                     CDW3 = Local0
                 }
                 Else
                 {
                     CDW1 |= 0x04
                 }
 
                 Return (Arg3)
             }
         }
+
+        Device (DRAC)
+        {
+            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
+            Name (RBUF, ResourceTemplate ()
+            {
+                QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x0000000000000000, // Granularity
+                    0x00000000B0000000, // Range Minimum
+                    0x00000000BFFFFFFF, // Range Maximum
+                    0x0000000000000000, // Translation Offset
+                    0x0000000010000000, // Length
+                    ,, , AddressRangeMemory, TypeStatic)
+            })
+            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
+            {
+                Return (RBUF) /* \_SB_.DRAC.RBUF */
+            }
+        }
     }
 
     Scope (_SB)
     {
         Device (HPET)
         {
             Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
             Name (_UID, Zero)  // _UID: Unique ID
             OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
             Field (HPTM, DWordAcc, Lock, Preserve)
             {
                 VEND,   32,
                 PRD,    32
             }
 
             Method (_STA, 0, NotSerialized)  // _STA: Status
---
 hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +0 -0
index 00cc119362..e369908b1a 100644
@@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
Quoted 6 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1077

Quoted 3 lines
hw/i386/acpi-build.c +3 -0
+static Aml *build_q35_dram_controller(void)
+{
+    AcpiMcfgInfo mcfg;  

build_dsdt() already calls acpi_get_mcfg(),
I suggest to cache it there and pass to build_q35_dram_controller as an argument.

Sure.

Quoted 17 lines
Quoted 17 lines
hw/i386/acpi-build.c +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,  

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 3 lines

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

I mostly clean up all places to use the same base address for min/max, but probably something were left behind.

spec says:

acpi 6.3: 19.6.110 QWordMemory

AddressMaximum evaluates to a 64-bit integer that specifies the highest possible base address of the Memory range. The value must have ‘0’ in all bits where the corresponding bit in AddressGranularity is ‘1’. For bridge devices which translate addresses, this is the address on the secondary bus. The 64-bit field DescriptorName ._MAX is automatically created to refer to this portion of the resource descriptor.

Quoted 63 lines

iasl drm-1.dsl

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20190509 Copyright (c) 2000 - 2019 Intel Corporation

drm-1.dsl 23: 0x10000000, // Length = 256M
Error 6049 - ^ Length is larger than Min/Max window

ASL Input: drm-1.dsl - 1000 bytes 6 keywords 37 source lines

Compilation failed. 1 Errors, 0 Warnings, 0 Remarks No AML files were generated due to compiler error(s)

Quoted 19 lines
Quoted 19 lines
hw/i386/acpi-build.c +13 -0
+                                0x0000000000000000,
+                                mcfg.size));
+    rbuf = aml_name_decl("RBUF", resource_template);
+    aml_append(dev, rbuf);
+
+    crs = aml_method("_CRS", 0, AML_SERIALIZED);
+    rbuf_name = aml_name("RBUF");
+    aml_append(crs, aml_return(rbuf_name));
+    aml_append(dev, crs);
+
+    return dev;
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -1212,7 +1252,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
            Range *pci_hole, Range *pci_hole64, MachineState *machine)
 {
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1255

Quoted 3 lines
hw/i386/acpi-build.c +1 -1
     CrsRangeEntry *entry;
-    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
+    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *drac;  

maybe limit drac to
if (misc->is_piix4) {
... } else {
Aml *drac
scope

ok.

Quoted 13 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1302

Quoted 11 lines
hw/i386/acpi-build.c +4 -0
     CrsRangeSet crs_range_set;
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
@@ -1256,6 +1296,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(dev, aml_name_decl("_UID", aml_int(0)));
         aml_append(dev, build_q35_osc_method());
         aml_append(sb_scope, dev);
+        drac = build_q35_dram_controller();
+        if (drac) {
+            aml_append(sb_scope, drac);
+        }  

mmcfg isn't optional for q35, is it?
I'd simplify to:

Quoted 3 lines
    aml_append(sb_scope, build_q35_dram_controller(mmcfg_info));

or put all of it under condition if it's optional
if(foo) aml_append(sb_scope, build_q35_dram_controller(mmcfg_info))

Quoted 2 lines

It's optional. If MCFG isn't setup after reset, PCIE_BASE_ADDR_UNMAPPED is returned.

ok

#14 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 41 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Feb 2021 12:51:57 -0800 Isaku Yamahata <[email protected]>…
Quoted 20 lines · Igor Mammedov
Quoted 17 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…
hw/i386/acpi-build.c +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,  

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 3 lines

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

I mostly clean up all places to use the same base address for min/max, but probably something were left behind.

Quoted 8 lines

spec says:

acpi 6.3: 19.6.110 QWordMemory

AddressMaximum evaluates to a 64-bit integer that specifies the highest possible base address of the Memory range. The value must have ‘0’ in all bits where the corresponding bit in AddressGranularity is ‘1’. For bridge devices which translate addresses, this is the address on the secondary bus. The 64-bit field DescriptorName ._MAX is automatically created to refer to this portion of the resource descriptor.

Ok, Linux guest is happy with min=max.
I conlude that it's iasl issue.

Thanks,

Signature · 1 line
Isaku Yamahata <[email protected]>
#15 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 53 lines · Isaku Yamahata
Quoted 41 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Feb 2021 12:51:57 -0800 Isaku Yamahata <[email protected]>…
Quoted 20 lines · Igor Mammedov
Quoted 17 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…
hw/i386/acpi-build.c +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,  

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 3 lines

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

I mostly clean up all places to use the same base address for min/max, but probably something were left behind.

Quoted 8 lines

spec says:

acpi 6.3: 19.6.110 QWordMemory

AddressMaximum evaluates to a 64-bit integer that specifies the highest possible base address of the Memory range. The value must have ‘0’ in all bits where the corresponding bit in AddressGranularity is ‘1’. For bridge devices which translate addresses, this is the address on the secondary bus. The 64-bit field DescriptorName ._MAX is automatically created to refer to this portion of the resource descriptor.

Quoted 4 lines

Ok, Linux guest is happy with min=max.
I conlude that it's iasl issue.

Thanks,

OK but what about all the other places in the code that seem to use this field differently?

Signature · 1 line
MST
#16 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 54 lines · Michael S. Tsirkin
Quoted 53 lines · Isaku Yamahata
Quoted 49 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Feb 2021 12:51:57 -0800 Isaku Yamahata <[email protected]>…
Quoted 20 lines · Igor Mammedov
Quoted 17 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…
hw/i386/acpi-build.c +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

hw/i386/acpi-build.c static void build_q35_pci0_int(Aml *table) · line 1101

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,  

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 3 lines

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

I mostly clean up all places to use the same base address for min/max, but probably something were left behind.

spec says:

acpi 6.3: 19.6.110 QWordMemory

AddressMaximum evaluates to a 64-bit integer that specifies the highest possible base address of the Memory range. The value must have ‘0’ in all bits where the corresponding bit in AddressGranularity is ‘1’. For bridge devices which translate addresses, this is the address on the secondary bus. The 64-bit field DescriptorName ._MAX is automatically created to refer to this portion of the resource descriptor.

Quoted 7 lines
Quoted 4 lines

Ok, Linux guest is happy with min=max.
I conlude that it's iasl issue.

Thanks,

OK but what about all the other places in the code that seem to use this field differently?

Igor, what do you think?
The followings are the summary of the situation.

- acpi 6.4: 19.6.110 QWordMemory
_MAX: maximum of base address.

- acpi 6.4: 6.4.3.5 Address Space Resource Descriptors table 6.44
If _LEN > 0 and _MIF = 1 and _MAF = 1, then _LEN = _MAX - _MIN + 1 This doesn't match with the above description

- iasl
If _LEN > 0 and _MIF = 1 and _MAF = 1,
it emits warning on _LEN != _MAX - _MIN + 1

- Linux Guest MMCONFIG check check_mcfg_resoure() uses only _MIN. doesn't use _MAX. _MAX value doesn't matter

- Linux acpi code
acpi_decode_space() uses _MAX to calulate range [start, end], not use _LEN. i.e. It assumes _LEN = _MAX - _MIN + 1 if _LEN > 0, _MIF = 1, _MAF = 1

- qemu code sets for [qd]word_memory_resource (except this patch) If _LEN > 0 and _MIF = 1 and _MAF = 1, then set _LEN = _MAX - _MIN + 1

Signature · 1 line
Isaku Yamahata <[email protected]>
#17 lore raw

Re: [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region

Quoted 68 lines · On Tue, 16 Feb 2021 10:13:25 -0800 Isaku Yamahata <[email protected]>…
Quoted 54 lines · Michael S. Tsirkin
Quoted 53 lines · Isaku Yamahata
Quoted 49 lines · Igor Mammedov
Quoted 32 lines · On Fri, 12 Feb 2021 12:51:57 -0800 Isaku Yamahata <[email protected]>…
Quoted 20 lines · Igor Mammedov
Quoted 17 lines · On Wed, 10 Feb 2021 22:46:43 -0800 Isaku Yamahata <[email protected]>…
(quoted diff) +17 -0
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    if (!acpi_get_mcfg(&mcfg)) {
+        return NULL;
+    }
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    aml_append(resource_template,
+               aml_qword_memory(AML_POS_DECODE,
Quoted 8 lines

Review

Quoted 7 lines
(quoted diff) +7 -0
+                                AML_MIN_FIXED,
+                                AML_MAX_FIXED,
+                                AML_NON_CACHEABLE,
+                                AML_READ_WRITE,
+                                0x0000000000000000,
+                                mcfg.base,
+                                mcfg.base + mcfg.size - 1,    

s/mcfg.base + mcfg.size - 1/mcfg.base/

Quoted 3 lines

AddressMaximum needs to be the highest address of the region. Not base address. By disassemble/assembl it, iasl complains as follows. Also there are similar examples in acpi-build.c.

I mostly clean up all places to use the same base address for min/max, but probably something were left behind.

spec says:

acpi 6.3: 19.6.110 QWordMemory

AddressMaximum evaluates to a 64-bit integer that specifies the highest possible base address of the Memory range. The value must have ‘0’ in all bits where the corresponding bit in AddressGranularity is ‘1’. For bridge devices which translate addresses, this is the address on the secondary bus. The 64-bit field DescriptorName ._MAX is automatically created to refer to this portion of the resource descriptor.

Quoted 7 lines
Quoted 4 lines

Ok, Linux guest is happy with min=max.
I conlude that it's iasl issue.

Thanks,

OK but what about all the other places in the code that seem to use this field differently?

Igor, what do you think?
The followings are the summary of the situation.

Quoted 7 lines

- acpi 6.4: 19.6.110 QWordMemory
_MAX: maximum of base address.

- acpi 6.4: 6.4.3.5 Address Space Resource Descriptors table 6.44
If _LEN > 0 and _MIF = 1 and _MAF = 1, then _LEN = _MAX - _MIN + 1 This doesn't match with the above description

I'd say it 19.6.110 doesn't describes whole possibilities of resource, but only subset in its current phrasing.

Quoted 3 lines

- iasl
If _LEN > 0 and _MIF = 1 and _MAF = 1,
it emits warning on _LEN != _MAX - _MIN + 1

so IASL is right and follows spec.

Anyways, My apologies for misleading and your patch is correct.

I need to add similar checks to QEMU code plus comments to avoid confusion in future.

Quoted 10 lines

- Linux Guest MMCONFIG check check_mcfg_resoure() uses only _MIN. doesn't use _MAX. _MAX value doesn't matter

- Linux acpi code
acpi_decode_space() uses _MAX to calulate range [start, end], not use _LEN. i.e. It assumes _LEN = _MAX - _MIN + 1 if _LEN > 0, _MIF = 1, _MAF = 1

- qemu code sets for [qd]word_memory_resource (except this patch) If _LEN > 0 and _MIF = 1 and _MAF = 1, then set _LEN = _MAX - _MIN + 1

#18 lore raw

PATCH v3 8/10 i386: acpi: Don't build HPET ACPI entry if HPET is disabled

In reply to Isaku Yamahata

From: Sean Christopherson <[email protected]>

Omit HPET AML if the HPET is disabled, QEMU is not emulating it and the guest may get confused by seeing HPET in the ACPI tables without a "physical" device present.

The change of DSDT when -no-hpet is as follows.

@@ -141,47 +141,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "

         }
     }

- Scope (_SB)
- {
- Device (HPET)
- {

-            Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
-            Name (_UID, Zero)  // _UID: Unique ID
-            OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
-            Field (HPTM, DWordAcc, Lock, Preserve)
-            {
-                VEND,   32,
-                PRD,    32

- }
-
- Method (_STA, 0, NotSerialized) // _STA: Status
- {

-                Local0 = VEND /* \_SB_.HPET.VEND */
-                Local1 = PRD /* \_SB_.HPET.PRD_ */
-                Local0 >>= 0x10
-                If (((Local0 == Zero) || (Local0 == 0xFFFF)))
-                {

- Return (Zero)
- }
-
- If (((Local1 == Zero) || (Local1 > 0x05F5E100)))
- {
- Return (Zero)
- }
-
- Return (0x0F)
- }
-
- Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
- {
- Memory32Fixed (ReadOnly,

-                    0xFED00000,         // Address Base
-                    0x00000400,         // Address Length
-                    )

- })
- }
- }
-

     Scope (_SB.PCI0)
     {
         Device (ISA)
---
 hw/i386/acpi-build.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +6 -2
index e369908b1a..bfdadd7907 100644
@@ -1280,7 +1280,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(sb_scope, dev);
         aml_append(dsdt, sb_scope);
 
-        build_hpet_aml(dsdt);
+        if (misc->has_hpet) {
+            build_hpet_aml(dsdt);
+        }
         build_piix4_isa_bridge(dsdt);
         build_isa_devices_aml(dsdt);
         if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
@@ -1328,7 +1330,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
         aml_append(dsdt, sb_scope);
 
-        build_hpet_aml(dsdt);
+        if (misc->has_hpet) {
+            build_hpet_aml(dsdt);
+        }
         build_q35_isa_bridge(dsdt);
         build_isa_devices_aml(dsdt);
         build_q35_pci0_int(dsdt);
Signature · 1 line
2.17.1
#19 lore raw

PATCH v3 9/10 acpi: add test case for -no-hpet

In reply to Isaku Yamahata
---
 tests/qtest/bios-tables-test.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/qtest/bios-tables-test.c +12 -0
index 096d15db68..72c8765baf 100644
@@ -980,6 +980,17 @@ static void test_acpi_q35_tcg_nosmm(void)
     free_test_data(&data);
 }
 
+static void test_acpi_q35_tcg_nohpet(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".nohpet";
+    test_acpi_one(" -no-hpet", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_piix4_tcg_numamem(void)
 {
     test_data data;
@@ -1337,6 +1348,7 @@ int main(int argc, char *argv[])
         qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
         qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
         qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
+        qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet);
         qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm);
         qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
         qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat);
Signature · 1 line
2.17.1
#20 lore raw

PATCH v3 10/10 qtest/acpi/bios-tables-test: update acpi tables

In reply to Isaku Yamahata

update golden master acpi tables and empty
bios-tables-test-allowed-diff.h.

---
 tests/data/acpi/q35/DSDT                    | Bin 7801 -> 7892 bytes
 tests/data/acpi/q35/DSDT.acpihmat           | Bin 9126 -> 9217 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 7819 -> 7910 bytes
 tests/data/acpi/q35/DSDT.cphp               | Bin 8265 -> 8356 bytes
 tests/data/acpi/q35/DSDT.dimmpxm            | Bin 9455 -> 9546 bytes
 tests/data/acpi/q35/DSDT.ipmibt             | Bin 7876 -> 7967 bytes
 tests/data/acpi/q35/DSDT.memhp              | Bin 9160 -> 9251 bytes
 tests/data/acpi/q35/DSDT.mmio64             | Bin 8932 -> 9023 bytes
 tests/data/acpi/q35/DSDT.nohpet             | Bin 0 -> 7750 bytes
 tests/data/acpi/q35/DSDT.nosmm              | Bin 0 -> 7892 bytes
 tests/data/acpi/q35/DSDT.numamem            | Bin 7807 -> 7898 bytes
 tests/data/acpi/q35/DSDT.tis                | Bin 8407 -> 8498 bytes
 tests/data/acpi/q35/FACP.nosmm              | Bin 0 -> 244 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  13 -------------
 14 files changed, 13 deletions(-)
tests/data/acpi/q35/DSDT binary +0 -0
index d25cd7072932886d6967f4023faac1e1fa6e836c..6d3097f30420049230a42706208f6013e22dce2f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index 722e06af83abcde203a2b96a8ec81fd3bab9fc98..7112fac785602bc559888d2e94447e4b4ce1c171 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 06bac139d668ddfc7914e258b471a303c9dbd192..d3bbfcaa504f9c877de2a725e8e488023b6a75bb 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index 2b933ac482e6883efccbd7d6c96089602f2c0b4d..8cf1fbe3cb04f02c9a12a835e9235303ab2169f3 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index bd8f8305b028ef20f9b6d1a0c69ac428d027e3d1..78a018140ff41e84b6ea93683cd0444f216ecded 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index a8f868e23c25688ab1c0371016c071f23e9d732f..f27e355455b207e6336e14f33bb8a57c31f91604 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index 9a802e4c67022386442976d5cb997ea3fc57b58f..97fe90178ad4ff250bea8e815706e26cc7cc2ac6 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index 948c2dc7264c31932b490ca00691a7c4d9aefdb0..c744f209d4c8c3dd7ad31b2c9d800c22c2cba37e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.nohpet binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b19f8c6bee66c187a707eb9b1b94cd7e1a7265da 100644
GIT binary patch
tests/data/acpi/q35/DSDT.nosmm binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6d3097f30420049230a42706208f6013e22dce2f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index 44ec1b0af400da6d298284aa959aa38add7e6dd5..99c34bd71abf680261dd5047f63b91641d0ba02d 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis binary +0 -0
index 30da3ec27958881801dacc954a343321ba26a2ae..f2461ecd90da760852806aadf2fe9e49940707c9 100644
GIT binary patch
tests/data/acpi/q35/FACP.nosmm binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..891450367cbd1aca397d296831ebeb5cc0788f0f 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -13
index b79ac495c2..dfb8523c8b 100644
@@ -1,14 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/DSDT",
-"tests/data/acpi/q35/DSDT.tis",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.ipmibt",
-"tests/data/acpi/q35/DSDT.cphp",
-"tests/data/acpi/q35/DSDT.memhp",
-"tests/data/acpi/q35/DSDT.numamem",
-"tests/data/acpi/q35/DSDT.dimmpxm",
-"tests/data/acpi/q35/DSDT.acpihmat",
-"tests/data/acpi/q35/DSDT.mmio64",
-"tests/data/acpi/q35/DSDT.nosmm",
-"tests/data/acpi/q35/FACP.nosmm",
-"tests/data/acpi/q35/DSDT.nohpet",
Signature · 1 line
2.17.1