All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/10] ACPI related fixes to comform the spec better
@ 2021-02-18  5:51 isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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

Changes from v4:
- rebased to 1af5629673
- move compat property from 3/10 to 4/10
- use the end of the address for rage maximum of memory region
- code simplification to generate _CRS

Changes from v3:
- rename compat property name to smm-compat and add it to ICH9-LPC and PIIX4_PM
- MMCFG memory region to use dword memory region when possible
- fix max base address of MMCFG memory region
- add more test cases with smm-compat=on and/or piix4

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
  ich9, piix4: add properoty, smm-compat, 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                    |  11 +++-
 hw/acpi/ich9.c                    |   2 +-
 hw/acpi/piix4.c                   |   5 +-
 hw/core/machine.c                 |   5 +-
 hw/i386/acpi-build.c              |  72 +++++++++++++++++++--
 hw/isa/lpc_ich9.c                 |   1 +
 hw/isa/vt82c686.c                 |   2 +-
 include/hw/acpi/acpi.h            |   4 +-
 include/hw/acpi/ich9.h            |   1 +
 scripts/checkpatch.pl             |   4 +-
 tests/data/acpi/pc/DSDT.nohpet    | Bin 0 -> 4923 bytes
 tests/data/acpi/pc/FACP.nosmm     | Bin 0 -> 116 bytes
 tests/data/acpi/q35/DSDT          | Bin 7801 -> 7859 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9126 -> 9184 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7819 -> 7877 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8265 -> 8323 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9455 -> 9513 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7876 -> 7934 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9160 -> 9218 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8932 -> 8990 bytes
 tests/data/acpi/q35/DSDT.nohpet   | Bin 0 -> 7717 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7807 -> 7865 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8407 -> 8465 bytes
 tests/data/acpi/q35/FACP.nosmm    | Bin 0 -> 244 bytes
 tests/qtest/bios-tables-test.c    | 100 ++++++++++++++++++++++++++++++
 25 files changed, 194 insertions(+), 13 deletions(-)
 create mode 100644 tests/data/acpi/pc/DSDT.nohpet
 create mode 100644 tests/data/acpi/pc/FACP.nosmm
 create mode 100644 tests/data/acpi/q35/DSDT.nohpet
 create mode 100644 tests/data/acpi/q35/FACP.nosmm

-- 
2.17.1



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

* [PATCH v5 01/10] checkpatch: don't emit warning on newly created acpi data files
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h isaku.yamahata
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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")
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e47ad878d8..40c9cc7def 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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);
 		}
-- 
2.17.1



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

* [PATCH v5 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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

Acked-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 tests/data/acpi/pc/DSDT.nohpet              |  0
 tests/data/acpi/pc/FACP.nosmm               |  0
 tests/data/acpi/q35/DSDT.nohpet             |  0
 tests/data/acpi/q35/FACP.nosmm              |  0
 tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++
 5 files changed, 14 insertions(+)
 create mode 100644 tests/data/acpi/pc/DSDT.nohpet
 create mode 100644 tests/data/acpi/pc/FACP.nosmm
 create mode 100644 tests/data/acpi/q35/DSDT.nohpet
 create mode 100644 tests/data/acpi/q35/FACP.nosmm

diff --git a/tests/data/acpi/pc/DSDT.nohpet b/tests/data/acpi/pc/DSDT.nohpet
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/data/acpi/pc/FACP.nosmm b/tests/data/acpi/pc/FACP.nosmm
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/data/acpi/q35/DSDT.nohpet b/tests/data/acpi/q35/DSDT.nohpet
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/data/acpi/q35/FACP.nosmm b/tests/data/acpi/q35/FACP.nosmm
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..95592459c5 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,15 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/FACP.nosmm",
+"tests/data/acpi/pc/DSDT.nohpet",
+"tests/data/acpi/q35/DSDT",
+"tests/data/acpi/q35/DSDT.tis",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.mmio64",
+"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/FACP.nosmm",
+"tests/data/acpi/q35/DSDT.nohpet",
+"tests/data/acpi/q35/DSDT.dimmpxm",
+"tests/data/acpi/q35/DSDT.acpihmat",
-- 
2.17.1



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

* [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-23 14:22   ` Igor Mammedov
  2021-02-18  5:51 ` [PATCH v5 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

The following patch will introduce incompatible behavior of SMM.
Introduce a property to keep the old behavior for compatibility.
To enable smm compat, use "-global ICH9-LPC.smm-compat=on" or
"-global PIIX4_PM.smm-compat=on"

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 hw/acpi/piix4.c        | 2 ++
 hw/isa/lpc_ich9.c      | 1 +
 include/hw/acpi/ich9.h | 1 +
 3 files changed, 4 insertions(+)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 669be5bbf6..30dd9b2309 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -74,6 +74,7 @@ struct PIIX4PMState {
     qemu_irq irq;
     qemu_irq smi_irq;
     int smm_enabled;
+    bool smm_compat;
     Notifier machine_ready;
     Notifier powerdown_notifier;
 
@@ -642,6 +643,7 @@ static Property piix4_pm_properties[] = {
                      use_acpi_root_pci_hotplug, true),
     DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
                      acpi_memory_hotplug.is_enabled, true),
+    DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index d3145bf014..3963b73520 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -775,6 +775,7 @@ static const VMStateDescription vmstate_ich9_lpc = {
 
 static Property ich9_lpc_properties[] = {
     DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true),
+    DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false),
     DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features,
                       ICH9_LPC_SMI_F_BROADCAST_BIT, true),
     DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features,
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 54571c77e0..df519e40b5 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -59,6 +59,7 @@ typedef struct ICH9LPCPMRegs {
     uint8_t disable_s4;
     uint8_t s4_val;
     uint8_t smm_enabled;
+    bool smm_compat;
     bool enable_tco;
     TCOIORegs tco_regs;
 } ICH9LPCPMRegs;
-- 
2.17.1



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

* [PATCH v5 04/10] acpi/core: always set SCI_EN when SMM isn't supported
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (2 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported isaku.yamahata
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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
"smm-compat" introduced by earlier patch. If the property is true,
disable new behavior.

ACPI spec 4.8.10.1 PM1 Event Grouping
PM1 Eanble Registers
> For ACPI-only platforms (where SCI_EN is always set)

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 hw/acpi/core.c         | 11 ++++++++++-
 hw/acpi/ich9.c         |  2 +-
 hw/acpi/piix4.c        |  3 ++-
 hw/core/machine.c      |  5 ++++-
 hw/isa/vt82c686.c      |  2 +-
 include/hw/acpi/acpi.h |  4 +++-
 6 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 7170bff657..1e004d0078 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -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,13 @@ 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;
 
     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 +644,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 */
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 5ff4e01c36..853447cf9d 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -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, !pm->smm_compat && !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,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 30dd9b2309..1efc0ded9f 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -497,7 +497,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_compat && !s->smm_enabled);
     acpi_gpe_init(&s->ar, GPE_LEN);
 
     s->powerdown_notifier.notify = piix4_pm_powerdown_req;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 970046f438..4386f57b5c 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -36,7 +36,10 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-pci.h"
 
-GlobalProperty hw_compat_5_2[] = {};
+GlobalProperty hw_compat_5_2[] = {
+    { "ICH9-LPC", "smm-compat", "on"},
+    { "PIIX4_PM", "smm-compat", "on"},
+};
 const size_t hw_compat_5_2_len = G_N_ELEMENTS(hw_compat_5_2);
 
 GlobalProperty hw_compat_5_1[] = {
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index a6f5a0843d..071b64b497 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -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[] = {
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 22b0b65bb2..9e8a76f2e2 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -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);
-- 
2.17.1



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

* [PATCH v5 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (3 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 06/10] acpi: add test case for smm unsupported -machine smm=off isaku.yamahata
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

From table 5.9 SMI_CMD of ACPI spec
> 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

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 hw/i386/acpi-build.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b9190b924a..49aef4ebd1 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -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);
+    /*
+     * "ICH9-LPC" or "PIIX4_PM" has "smm-compat" property to keep the old
+     * behavior for compatibility irrelevant to smm_enabled, which doesn't
+     * comforms to ACPI spec.
+     */
+    bool smm_enabled = object_property_get_bool(o, "smm-compat", NULL) ?
+        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 },
-- 
2.17.1



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

* [PATCH v5 06/10] acpi: add test case for smm unsupported -machine smm=off
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (4 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 tests/qtest/bios-tables-test.c | 76 ++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 77053975aa..93d037c29d 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -973,6 +973,39 @@ static void test_acpi_piix4_tcg_memhp(void)
     free_test_data(&data);
 }
 
+static void test_acpi_piix4_tcg_nosmm(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".nosmm";
+    test_acpi_one("-machine smm=off", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_piix4_tcg_smm_compat(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".smm-compat";
+    test_acpi_one("-global PIIX4_PM.smm-compat=on", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_piix4_tcg_smm_compat_nosmm(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".smm-compat-nosmm";
+    test_acpi_one("-global PIIX4_PM.smm-compat=on -machine smm=off", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_q35_tcg_numamem(void)
 {
     test_data data;
@@ -985,6 +1018,39 @@ 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_q35_tcg_smm_compat(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".smm-compat";
+    test_acpi_one("-global ICH9-LPC.smm-compat=on", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_q35_tcg_smm_compat_nosmm(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".smm-compat-nosmm";
+    test_acpi_one("-global ICH9-LPC.smm-compat=on -machine smm=off", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_piix4_tcg_numamem(void)
 {
     test_data data;
@@ -1445,6 +1511,16 @@ 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/piix4/nosmm", test_acpi_piix4_tcg_nosmm);
+        qtest_add_func("acpi/piix4/smm-compat",
+                       test_acpi_piix4_tcg_smm_compat);
+        qtest_add_func("acpi/piix4/smm-compat-nosmm",
+                       test_acpi_piix4_tcg_smm_compat_nosmm);
+        qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
+        qtest_add_func("acpi/q35/smm-compat",
+                       test_acpi_q35_tcg_smm_compat);
+        qtest_add_func("acpi/q35/smm-compat-nosmm",
+                       test_acpi_q35_tcg_smm_compat_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);
-- 
2.17.1



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

* [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (5 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 06/10] acpi: add test case for smm unsupported -machine smm=off isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-23 14:26   ` Igor Mammedov
  2021-02-18  5:51 ` [PATCH v5 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled isaku.yamahata
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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,47 @@

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

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

                 Return (Arg3)
             }
         }
+
+        Device (DRAC)
+        {
+            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
+            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
+            {
+                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x00000000,         // Granularity
+                    0xB0000000,         // Range Minimum
+                    0xBFFFFFFF,         // Range Maximum
+                    0x00000000,         // Translation Offset
+                    0x10000000,         // Length
+                    ,, , AddressRangeMemory, TypeStatic)
+            })
+        }
     }

     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

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 49aef4ebd1..96497475d1 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
+static Aml *build_q35_dram_controller(const AcpiMcfgInfo *mcfg)
+{
+    Aml *dev;
+    Aml *resource_template;
+
+    /* DRAM controller */
+    dev = aml_device("DRAC");
+    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
+
+    resource_template = aml_resource_template();
+    if (mcfg->base + mcfg->size - 1 >= (1ULL << 32)) {
+        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));
+    } else {
+        aml_append(resource_template,
+                   aml_dword_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));
+    }
+    aml_append(dev, aml_name_decl("_CRS", resource_template));
+
+    return dev;
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -1218,6 +1258,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
     X86MachineState *x86ms = X86_MACHINE(machine);
     AcpiMcfgInfo mcfg;
+    bool mcfg_valid = !!acpi_get_mcfg(&mcfg);
     uint32_t nr_mem = machine->ram_slots;
     int root_bus_limit = 0xFF;
     PCIBus *bus = NULL;
@@ -1256,6 +1297,9 @@ 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);
+        if (mcfg_valid) {
+            aml_append(sb_scope, build_q35_dram_controller(&mcfg));
+        }
 
         if (pm->smi_on_cpuhp) {
             /* reserve SMI block resources, IO ports 0xB2, 0xB3 */
@@ -1386,7 +1430,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
      * the PCI0._CRS.  Add mmconfig to the set so it will be excluded
      * too.
      */
-    if (acpi_get_mcfg(&mcfg)) {
+    if (mcfg_valid) {
         crs_range_insert(crs_range_set.mem_ranges,
                          mcfg.base, mcfg.base + mcfg.size - 1);
     }
-- 
2.17.1



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

* [PATCH v5 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (6 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 09/10] acpi: add test case for -no-hpet isaku.yamahata
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, Sean Christopherson, isaku.yamahata

From: Sean Christopherson <sean.j.christopherson@intel.com>

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)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 hw/i386/acpi-build.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 96497475d1..31a5f6f4a5 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1281,7 +1281,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);
-- 
2.17.1



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

* [PATCH v5 09/10] acpi: add test case for -no-hpet
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (7 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-18  5:51 ` [PATCH v5 10/10] qtest/acpi/bios-tables-test: update acpi tables isaku.yamahata
  2021-02-24 16:08 ` [PATCH v5 00/10] ACPI related fixes to comform the spec better Igor Mammedov
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 tests/qtest/bios-tables-test.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 93d037c29d..e020c83d2a 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1006,6 +1006,17 @@ static void test_acpi_piix4_tcg_smm_compat_nosmm(void)
     free_test_data(&data);
 }
 
+static void test_acpi_piix4_tcg_nohpet(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".nohpet";
+    test_acpi_one("-no-hpet", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_q35_tcg_numamem(void)
 {
     test_data data;
@@ -1051,6 +1062,17 @@ static void test_acpi_q35_tcg_smm_compat_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;
@@ -1516,11 +1538,13 @@ int main(int argc, char *argv[])
                        test_acpi_piix4_tcg_smm_compat);
         qtest_add_func("acpi/piix4/smm-compat-nosmm",
                        test_acpi_piix4_tcg_smm_compat_nosmm);
+        qtest_add_func("acpi/piix4/nohpet", test_acpi_piix4_tcg_nohpet);
         qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
         qtest_add_func("acpi/q35/smm-compat",
                        test_acpi_q35_tcg_smm_compat);
         qtest_add_func("acpi/q35/smm-compat-nosmm",
                        test_acpi_q35_tcg_smm_compat_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);
-- 
2.17.1



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

* [PATCH v5 10/10] qtest/acpi/bios-tables-test: update acpi tables
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (8 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 09/10] acpi: add test case for -no-hpet isaku.yamahata
@ 2021-02-18  5:51 ` isaku.yamahata
  2021-02-24 16:08 ` [PATCH v5 00/10] ACPI related fixes to comform the spec better Igor Mammedov
  10 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-18  5:51 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, marcel.apfelbaum
  Cc: isaku.yamahata, isaku.yamahata

From: Isaku Yamahata <isaku.yamahata@intel.com>

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

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 tests/data/acpi/pc/DSDT.nohpet              | Bin 0 -> 4923 bytes
 tests/data/acpi/pc/FACP.nosmm               | Bin 0 -> 116 bytes
 tests/data/acpi/q35/DSDT                    | Bin 7801 -> 7859 bytes
 tests/data/acpi/q35/DSDT.acpihmat           | Bin 9126 -> 9184 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 7819 -> 7877 bytes
 tests/data/acpi/q35/DSDT.cphp               | Bin 8265 -> 8323 bytes
 tests/data/acpi/q35/DSDT.dimmpxm            | Bin 9455 -> 9513 bytes
 tests/data/acpi/q35/DSDT.ipmibt             | Bin 7876 -> 7934 bytes
 tests/data/acpi/q35/DSDT.memhp              | Bin 9160 -> 9218 bytes
 tests/data/acpi/q35/DSDT.mmio64             | Bin 8932 -> 8990 bytes
 tests/data/acpi/q35/DSDT.nohpet             | Bin 0 -> 7717 bytes
 tests/data/acpi/q35/DSDT.numamem            | Bin 7807 -> 7865 bytes
 tests/data/acpi/q35/DSDT.tis                | Bin 8407 -> 8465 bytes
 tests/data/acpi/q35/FACP.nosmm              | Bin 0 -> 244 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  14 --------------
 15 files changed, 14 deletions(-)

diff --git a/t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$n$k$15D5iALt6cCBUNQsEW$*2vdn;3q&!`Mz#^-zWxTfM+6Hk#S-6snLuYYto
z*mm!O!Y88O1@Jgu+Qwo@6B-ZD;}PpYJxIM;&pSKrsjKwFovR$S0!$-pC6nH19fkL;
z)KI|L34noYDHG1zhqQdi(1YE3&q_VS7p?8`@V5ZIqJR;vQ@f{AAUPm2LDNJ_P~61u
zX9Gf2U#MgaN@&mznvtxyeR-@izEH_}O+v5vLGMXcJluP%nlDtch9orP2fZ&@xrB0G
zsAR=y^a2R`L02SeL_#CJP{|sV(5N5ufn=SP&{<!oWX0pD7weoK^r2+cB~<r?O4gW!
z#{8fkO4hi9#(klZ6@M^#vCjKJvyv5;fCn{vp_28wgkJZ9<|OM43BBP9m8=UAy5I*D
zl66r+7k#0U^$iJq!w+go)|(P~(-$gPmn3w_51N;(Z%XK!zEH{fmW00L2Q5g}w<Yv#
zU#MigC84*bL5=k#^W$<Y(2pE;aGyP*Ubp88Ittj$JRw1Xw5+0l9m%tFNgzw~uoK2j
z`pCkzGL!-&jch7P*c^s7@^yb?BWJk8hc@!IGP037T&P1E`FlXNxx)^2SKLL8EL?C>
z#(f0kOFQl+M;0y}X~%;E%9nPXWLyN&o^a($`zpy;&eGm><x9JpF&3t@<7RSXi7`86
zjU_g+Q{Lv7oifK_8QBvgkJ(pI#%UkfyCkFCxJAbl{Lh2_c%Ui7y>6QgA55<NAF!vK
AJpcdz

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/pc/FACP.nosmm b/tests/data/acpi/pc/FACP.nosmm
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7e19550748b4deec9fad7bfb9a714254e1d695ee 100644
GIT binary patch
literal 116
zcmZ>BbPgzCU|?W8=j89~5v<@85#X!<1dKp25F13p03!n@jLE>j24S*5X%LSC$bPUM
bD$c~f!UAOe=l{<S5n*630y361FfafBA<PT`

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT
index 008a3d7d0fd64224b0880412c0077e28e930fa5a..cccf92f0466fa4eaf2e9e06675b3b102c7a8eb86 100644
GIT binary patch
delta 88
zcmexqv)Pu*CD<iovm65h<GYDmsZ6eX6AM>bMK@Wv1UWi$#Cv$U@CNt=7&sdkGH}E@
j2L%htbIG)eGcfQlGC;tF|NsB*hq47K88%BX#>)Z#Nca{a

delta 29
lcmdmN`_qQYCD<jTQjURvap^>^R3>k(iG?dShcL#=0sxLH2_gUh

diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat
index 2723b690089c9e75869708cb92d3081b6bb5ec65..b3c1dd6bc40210425ac37dba88a650b0ea60ce1c 100644
GIT binary patch
delta 88
zcmZ4H{=l8fCD<k8fieRF<LZfAsZ6eX6AM>bMK@Wv1UWi$#Cv$U@CNt=7&sdkGH}E@
j2L%htbIG)eGcfQlGC;tF|NsB*hq47K88%BX_9y`WKL-{v

delta 29
lcmaFhzRaD=CD<ionKA<dW70&fR3>k(iG?dShcNai0RW8-2{Hfx

diff --git a/tests/data/acpi/q35/DSDT.bridge b/tests/data/acpi/q35/DSDT.bridge
index 86711455576518f9ddd1f524d82a447946be32ba..eb5d27d95b2cdeda5f7e1f6b151cfea02e6bd907 100644
GIT binary patch
delta 88
zcmeCSJ!;G466_LkRE~jxv3(*}Dw8YU#KM(U(M=XEL5|KG@gANoya9dz2F?bC3>@*!
iLBWFZTr%zA3=BMs3=pv4|NsB{p=^OlhRsrpg|Yw<cNK&H

delta 29
kcmX?V+ilC`66_MvEyuvXXg857mC2iHV&TfoA&iBx0Dw3Mga7~l

diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp
index 42b7819ea8c9337e943c34e826af19723f99a358..e55d12990c98d8eed760b858ce18a036b612da1c 100644
GIT binary patch
delta 88
zcmX@<(Co<N66_MvtiZs)7&MV9mC2QFV&O`w=q3x7AV+78cn?n(-T=P<17`z6299{=
ipkP6HE}3?51_mBR1_;>j|NsB}P_{rN!)7T)eR%-yPZZJs

delta 29
kcmZp6Jn6vY66_M<sldR%$T^WKmC2iHV&TfoA&mO+0C#5x(f|Me

diff --git a/tests/data/acpi/q35/DSDT.dimmpxm b/tests/data/acpi/q35/DSDT.dimmpxm
index 7c3526d9670305e41020e5d95a3d0e9897b1e6d3..95901f94c0d445919cb84dd1f6d98c646ae8176e 100644
GIT binary patch
delta 88
zcmaFwxzdZvCD<iIQ<Z^%QFbC%Dw8YU#KM(U(M=XEL5|KG@gANoya9dz2F?bC3>@*!
iLBWFZTr%zA3=BMs3=pv4|NsB{p=^OlhRsrpSCs+g?G;b}

delta 29
lcmZ4K_1=@qCD<k8y$S;Z<JE~=sZ8En6AM>v4q?2i3;>)Z3Qzz5

diff --git a/tests/data/acpi/q35/DSDT.ipmibt b/tests/data/acpi/q35/DSDT.ipmibt
index 8d3ccc3e75164c2884fbe21659100e12fc70ae38..ce07e9f152def6a22ab29b3bde98b7d1f15a0522 100644
GIT binary patch
delta 88
zcmX?N`_GokCD<k8pBw`NqtZmKR3=xxiG?ezqMIySf*hSW;ypZFcmw<b44e%N893sd
jgMtO+xn$bK85npN86aT8|NsB@L)ikA44b7GSIGhZEesX|

delta 29
lcmexod&HK@CD<k8h#Uh0<IRa&sZ8En6AM>v4q;p+3jms{3IhND

diff --git a/tests/data/acpi/q35/DSDT.memhp b/tests/data/acpi/q35/DSDT.memhp
index f1c545d94b856fa8d19b8433233d80397cb05714..7acf6243f08cd906aa8a02d3acf1d720b36385ea 100644
GIT binary patch
delta 88
zcmX@%-sHjM66_Mfq{6_!cz+^SDw8YU#KM(U(M=XEL5|KG@gANoya9dz2F?bC3>@*!
iLBWFZTr%zA3=BMs3=pv4|NsB{p=^OlhRsrp>y!ZYffaB7

delta 29
lcmZqjIN{Fa66_LkLYaYqar#8AR3>k(iG?dShcK>F0sxF532*=a

diff --git a/tests/data/acpi/q35/DSDT.mmio64 b/tests/data/acpi/q35/DSDT.mmio64
index 4fb285f2efea00964ea0f5c4172c213f0817b563..77d46369e48efca9a9e5024542c77cd26144beff 100644
GIT binary patch
delta 88
zcmaFjI?s*ECD<iIPMLv$amqxlR3=xxiG?ezqMIySf*hSW;ypZFcmw<b44e%N893sd
jgMtO+xn$bK85npN86aT8|NsB@L)ikA44b7GPbmTb`w$h6

delta 29
lcmbQ|_QaLTCD<k8i4p??qt8UHR3>k(iG?dShcKQ}1OSi336B5(

diff --git a/tests/data/acpi/q35/DSDT.nohpet b/tests/data/acpi/q35/DSDT.nohpet
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0b10128e42af0c7b65e010963085bbf690a64065 100644
GIT binary patch
literal 7717
zcmb7JTW=f38J*=tS}m92lA<MBzDRJB-Vsx>(;6*ml-%Vlx=~!YZa@K~B&U_*0$Ics
z5W@&yD?sD;p(r9a=%Z{XK;PP@_Obp6eXD`~gTD45ekyyu`F7+Pk^&+=kb7p&nQzYC
z&T=LQgN?T@31R)cvgS9!`O2?b{yaXG5Q4Vp*K4LWMdwjasdueRB4u?RXXG}%Dt7V5
zLFH!M`qOUjt6uN^=RIpH65B7lXWLuRXHR<Df=GMYk>k*YSDoyJm2PL>cUpe4WOp0Q
zz%BpNvF)zUTS>cH4%))*-fRY<xIErn3;op7yTT7{EgY_<4|elYj@McF_tkIaF8uPV
zTldQ^fAO#1JiY6rKv=}Djo+&gef1vpoVnhi_vOJI>r;};eG7+EUmnQa+~(1qs7Ec&
zU2dYT7LM+A_OA!+vM<M&ZLPLSerW;Y^4np4&bjdUj1Vpz9QypV-|zo}H-+~=c;9`8
zT$01i{%kWWccm#;h&dd_R<pgHaC(mGE#<Bx6_Hq-{cB5=0AxNYNgRuCqwM6k=vn7X
z-Rg;+u&lauTinL)<%D=3I{R;}tld0T<)#dk?W8Z$m^%B5%dL$C)pv@Iuw`&PCtJ5Z
zNq&;F?aPm3&x`)r%CRO5HqOcj&Fkdrq_8i0QuB6u!#^HPCO%@a>qtbxvM&qkfv{Um
zzb1-q7r$1tOUV1f`xYGy&;O6SH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i3*iN0!<Nc#RtV0RuDh?(@m>he73L3v{ybIr}wrX2}t#8rQFQ~JSx
zc#zq$-)fdh3ndx`uSKMbd4Hq!e&WzM*cHF`OQq7CVq?t55GFd`*}RfcbN6JF4D|ca
z?qD;DMWS~&doZ|zEJRMO*ZJPip5>*ZUU4N&woX^b8te)^jO@QyoAyJ0)jq+7?XOmE
z6%zeO>_pb>7eV3RwiSunk=2XD){ABLj|V;L*$$d|(avB=X?U;^C*^SF*<dS9%g)z_
z69-#PA7#FdM(sa*Yv{<)d5?CU&=|MG-WEpn{HKTS4$<V5fz!9+B%`4NgPqXr?a*3P
zHN}fn)Zw<+p;HcTJDr8m=7##hc=onOALf+_e=Xc_PdLn@ua=?yaqyx$BaThvBnDfF
z`r%+B4)e&-bw0aJ*EH^bd~kc<y0(w#>c$<gQr^gC99v+vf!;%llURq_$dDPad*{RA
zdE7kpR<&C#EsFS#ryGf`DX&O-<b5CCQl*~=ubk)GjaU6>4eh;*^S38ik--0aeERf-
zb*<O#YuB>TZsEa#&o|ip+C9cuECdPhU%B`u_tU#=zfbSB^hpR~S<c3?++TQ)__ML+
zCD!Zy$9rDhc={tO<;A^m8(D_75BJ80FfFC|DOlvyOSv*whDCn9QM>kF<K?vs$FO{`
z&5zBGS+qv@gH1@ntKGs_%0fMCU+Wg^l#_5Udj|9_?V;-4&)*!n&i*^KTRsO)cD=fC
z6X$P{*jOgit9WTIO^;8nmfDnSYBzW>G82|cych`=KMYIP8Q>sW0wEYK1mZ|;EUJyG
GwDEs12p4Jq

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.numamem
index dd9dc9d02501afb50da7b9e77daabeee8968c340..e4c4582e7f76b072ab1123c748b89ea33ea1db87 100644
GIT binary patch
delta 88
zcmexwv(uK#CD<ioryK(V<BW-1sZ6eX6AM>bMK@Wv1UWi$#Cv$U@CNt=7&sdkGH}E@
j2L%htbIG)eGcfQlGC;tF|NsB*hq47K88%BXrpf{UHWn4+

delta 29
kcmdmK``?DkCD<jTUXFo*(SIUWDw8+Y#KM)ELl{$K0gCkq<NyEw

diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis
index b8e380340209a38163ef6ca2f6f9dfaf458ab08d..15a26a14e4be5280c0f1cc09f66428311100b7ab 100644
GIT binary patch
delta 88
zcmccaIMIpACD<iIP?3RwasNcFR3=xxiG?ezqMIySf*hSW;ypZFcmw<b44e%N893sd
jgMtO+xn$bK85npN86aT8|NsB@L)ikA44b7G_sRnR_dOMQ

delta 29
lcmbQ}bls85CD<k8x&i|OWBEj`R3>k(iG?dShcNDy2LO#z33>nk

diff --git a/tests/data/acpi/q35/FACP.nosmm b/tests/data/acpi/q35/FACP.nosmm
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6a9aa5f370eb9af6a03dc739d8a159be58fdee01 100644
GIT binary patch
literal 244
zcmZ>BbPo8!z`(#<;N<V@5v<@85#X!<1dKp25F13p03!n@jLE>j24S*5X%LSC$X0-f
zGcm9T0LA|E|L2FOWMD7?GM2V5Ffej3F#P0!h{7ddihwku0+2v57svwxMxcSn_QAxF
TX+{NzJ3wNL4G8yu_%Hwf9PJGO

literal 0
HcmV?d00001

diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 95592459c5..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,15 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/FACP.nosmm",
-"tests/data/acpi/pc/DSDT.nohpet",
-"tests/data/acpi/q35/DSDT",
-"tests/data/acpi/q35/DSDT.tis",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.mmio64",
-"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/FACP.nosmm",
-"tests/data/acpi/q35/DSDT.nohpet",
-"tests/data/acpi/q35/DSDT.dimmpxm",
-"tests/data/acpi/q35/DSDT.acpihmat",
-- 
2.17.1



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

* Re: [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM
  2021-02-18  5:51 ` [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
@ 2021-02-23 14:22   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2021-02-23 14:22 UTC (permalink / raw)
  To: isaku.yamahata; +Cc: isaku.yamahata, qemu-devel, mst

On Wed, 17 Feb 2021 21:51:11 -0800
isaku.yamahata@gmail.com wrote:

subj: s/properoty/property/

perhaps Michael can fix it up when merging  

> From: Isaku Yamahata <isaku.yamahata@intel.com>
> 
> The following patch will introduce incompatible behavior of SMM.
> Introduce a property to keep the old behavior for compatibility.
> To enable smm compat, use "-global ICH9-LPC.smm-compat=on" or
> "-global PIIX4_PM.smm-compat=on"
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/piix4.c        | 2 ++
>  hw/isa/lpc_ich9.c      | 1 +
>  include/hw/acpi/ich9.h | 1 +
>  3 files changed, 4 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index 669be5bbf6..30dd9b2309 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -74,6 +74,7 @@ struct PIIX4PMState {
>      qemu_irq irq;
>      qemu_irq smi_irq;
>      int smm_enabled;
> +    bool smm_compat;
>      Notifier machine_ready;
>      Notifier powerdown_notifier;
>  
> @@ -642,6 +643,7 @@ static Property piix4_pm_properties[] = {
>                       use_acpi_root_pci_hotplug, true),
>      DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
>                       acpi_memory_hotplug.is_enabled, true),
> +    DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index d3145bf014..3963b73520 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -775,6 +775,7 @@ static const VMStateDescription vmstate_ich9_lpc = {
>  
>  static Property ich9_lpc_properties[] = {
>      DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true),
> +    DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false),
>      DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features,
>                        ICH9_LPC_SMI_F_BROADCAST_BIT, true),
>      DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features,
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index 54571c77e0..df519e40b5 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -59,6 +59,7 @@ typedef struct ICH9LPCPMRegs {
>      uint8_t disable_s4;
>      uint8_t s4_val;
>      uint8_t smm_enabled;
> +    bool smm_compat;
>      bool enable_tco;
>      TCOIORegs tco_regs;
>  } ICH9LPCPMRegs;



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

* Re: [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region
  2021-02-18  5:51 ` [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
@ 2021-02-23 14:26   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2021-02-23 14:26 UTC (permalink / raw)
  To: isaku.yamahata; +Cc: isaku.yamahata, qemu-devel, mst

On Wed, 17 Feb 2021 21:51:15 -0800
isaku.yamahata@gmail.com wrote:

> From: Isaku Yamahata <isaku.yamahata@intel.com>
> 
> 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,47 @@
> 
>                      If ((CDW3 != Local0))
>                      {
>                          CDW1 |= 0x10
>                      }
> 
>                      CDW3 = Local0
>                  }
>                  Else
>                  {
>                      CDW1 |= 0x04
>                  }
> 
>                  Return (Arg3)
>              }
>          }
> +
> +        Device (DRAC)
> +        {
> +            Name (_HID, "PNP0C01" /* System Board */)  // _HID: Hardware ID
> +            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
> +            {
> +                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
> +                    0x00000000,         // Granularity
> +                    0xB0000000,         // Range Minimum
> +                    0xBFFFFFFF,         // Range Maximum
> +                    0x00000000,         // Translation Offset
> +                    0x10000000,         // Length
> +                    ,, , AddressRangeMemory, TypeStatic)
> +            })
> +        }
>      }
> 
>      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
> 
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/i386/acpi-build.c | 46 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 45 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 49aef4ebd1..96497475d1 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1072,6 +1072,46 @@ static void build_q35_pci0_int(Aml *table)
>      aml_append(table, sb_scope);
>  }
>  
> +static Aml *build_q35_dram_controller(const AcpiMcfgInfo *mcfg)
> +{
> +    Aml *dev;
> +    Aml *resource_template;
> +
> +    /* DRAM controller */
> +    dev = aml_device("DRAC");
> +    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C01")));
> +
> +    resource_template = aml_resource_template();
> +    if (mcfg->base + mcfg->size - 1 >= (1ULL << 32)) {
> +        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));
> +    } else {
> +        aml_append(resource_template,
> +                   aml_dword_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));
> +    }
> +    aml_append(dev, aml_name_decl("_CRS", resource_template));
> +
> +    return dev;
> +}
> +
>  static void build_q35_isa_bridge(Aml *table)
>  {
>      Aml *dev;
> @@ -1218,6 +1258,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>      PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
>      X86MachineState *x86ms = X86_MACHINE(machine);
>      AcpiMcfgInfo mcfg;
> +    bool mcfg_valid = !!acpi_get_mcfg(&mcfg);
>      uint32_t nr_mem = machine->ram_slots;
>      int root_bus_limit = 0xFF;
>      PCIBus *bus = NULL;
> @@ -1256,6 +1297,9 @@ 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);
> +        if (mcfg_valid) {
> +            aml_append(sb_scope, build_q35_dram_controller(&mcfg));
> +        }
>  
>          if (pm->smi_on_cpuhp) {
>              /* reserve SMI block resources, IO ports 0xB2, 0xB3 */
> @@ -1386,7 +1430,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>       * the PCI0._CRS.  Add mmconfig to the set so it will be excluded
>       * too.
>       */
> -    if (acpi_get_mcfg(&mcfg)) {
> +    if (mcfg_valid) {
>          crs_range_insert(crs_range_set.mem_ranges,
>                           mcfg.base, mcfg.base + mcfg.size - 1);
>      }



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

* Re: [PATCH v5 00/10] ACPI related fixes to comform the spec better
  2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (9 preceding siblings ...)
  2021-02-18  5:51 ` [PATCH v5 10/10] qtest/acpi/bios-tables-test: update acpi tables isaku.yamahata
@ 2021-02-24 16:08 ` Igor Mammedov
  10 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2021-02-24 16:08 UTC (permalink / raw)
  To: isaku.yamahata; +Cc: isaku.yamahata, qemu-devel, mst

On Wed, 17 Feb 2021 21:51:08 -0800
isaku.yamahata@gmail.com wrote:

> From: Isaku Yamahata <isaku.yamahata@intel.com>
> 
> Miscellaneous bug fixes related to ACPI to play nice with guest BIOSes/OSes
> by conforming to ACPI spec better.

Michael,
  I finished with review,
  to me series looks ready to be merged

> Changes from v4:
> - rebased to 1af5629673
> - move compat property from 3/10 to 4/10
> - use the end of the address for rage maximum of memory region
> - code simplification to generate _CRS
> 
> Changes from v3:
> - rename compat property name to smm-compat and add it to ICH9-LPC and PIIX4_PM
> - MMCFG memory region to use dword memory region when possible
> - fix max base address of MMCFG memory region
> - add more test cases with smm-compat=on and/or piix4
> 
> 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
>   ich9, piix4: add properoty, smm-compat, 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                    |  11 +++-
>  hw/acpi/ich9.c                    |   2 +-
>  hw/acpi/piix4.c                   |   5 +-
>  hw/core/machine.c                 |   5 +-
>  hw/i386/acpi-build.c              |  72 +++++++++++++++++++--
>  hw/isa/lpc_ich9.c                 |   1 +
>  hw/isa/vt82c686.c                 |   2 +-
>  include/hw/acpi/acpi.h            |   4 +-
>  include/hw/acpi/ich9.h            |   1 +
>  scripts/checkpatch.pl             |   4 +-
>  tests/data/acpi/pc/DSDT.nohpet    | Bin 0 -> 4923 bytes
>  tests/data/acpi/pc/FACP.nosmm     | Bin 0 -> 116 bytes
>  tests/data/acpi/q35/DSDT          | Bin 7801 -> 7859 bytes
>  tests/data/acpi/q35/DSDT.acpihmat | Bin 9126 -> 9184 bytes
>  tests/data/acpi/q35/DSDT.bridge   | Bin 7819 -> 7877 bytes
>  tests/data/acpi/q35/DSDT.cphp     | Bin 8265 -> 8323 bytes
>  tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9455 -> 9513 bytes
>  tests/data/acpi/q35/DSDT.ipmibt   | Bin 7876 -> 7934 bytes
>  tests/data/acpi/q35/DSDT.memhp    | Bin 9160 -> 9218 bytes
>  tests/data/acpi/q35/DSDT.mmio64   | Bin 8932 -> 8990 bytes
>  tests/data/acpi/q35/DSDT.nohpet   | Bin 0 -> 7717 bytes
>  tests/data/acpi/q35/DSDT.numamem  | Bin 7807 -> 7865 bytes
>  tests/data/acpi/q35/DSDT.tis      | Bin 8407 -> 8465 bytes
>  tests/data/acpi/q35/FACP.nosmm    | Bin 0 -> 244 bytes
>  tests/qtest/bios-tables-test.c    | 100 ++++++++++++++++++++++++++++++
>  25 files changed, 194 insertions(+), 13 deletions(-)
>  create mode 100644 tests/data/acpi/pc/DSDT.nohpet
>  create mode 100644 tests/data/acpi/pc/FACP.nosmm
>  create mode 100644 tests/data/acpi/q35/DSDT.nohpet
>  create mode 100644 tests/data/acpi/q35/FACP.nosmm
> 



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

end of thread, other threads:[~2021-02-24 16:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  5:51 [PATCH v5 00/10] ACPI related fixes to comform the spec better isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
2021-02-23 14:22   ` Igor Mammedov
2021-02-18  5:51 ` [PATCH v5 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 06/10] acpi: add test case for smm unsupported -machine smm=off isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
2021-02-23 14:26   ` Igor Mammedov
2021-02-18  5:51 ` [PATCH v5 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 09/10] acpi: add test case for -no-hpet isaku.yamahata
2021-02-18  5:51 ` [PATCH v5 10/10] qtest/acpi/bios-tables-test: update acpi tables isaku.yamahata
2021-02-24 16:08 ` [PATCH v5 00/10] ACPI related fixes to comform the spec better Igor Mammedov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.