All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] ACPI related fixes to comform the spec better
@ 2021-02-16  1:04 isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 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              |  81 ++++++++++++++++++++++--
 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 -> 7872 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9126 -> 9197 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7819 -> 7890 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8265 -> 8336 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9455 -> 9526 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7876 -> 7947 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9160 -> 9231 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8932 -> 9003 bytes
 tests/data/acpi/q35/DSDT.nohpet   | Bin 0 -> 7730 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7807 -> 7878 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8407 -> 8478 bytes
 tests/data/acpi/q35/FACP.nosmm    | Bin 0 -> 244 bytes
 tests/qtest/bios-tables-test.c    | 100 ++++++++++++++++++++++++++++++
 25 files changed, 203 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 v4 01/10] checkpatch: don't emit warning on newly created acpi data files
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h isaku.yamahata
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 v4 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 01/10] checkpatch: don't emit warning on newly created acpi data files isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16 22:21   ` Igor Mammedov
  2021-02-16  1:04 ` [PATCH v4 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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.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/core/machine.c      | 5 ++++-
 hw/isa/lpc_ich9.c      | 1 +
 include/hw/acpi/ich9.h | 1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

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/core/machine.c b/hw/core/machine.c
index de3b8f1b31..870c9201df 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -33,7 +33,10 @@
 #include "migration/global_state.h"
 #include "migration/vmstate.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/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 v4 04/10] acpi/core: always set SCI_EN when SMM isn't supported
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (2 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16 22:22   ` Igor Mammedov
  2021-02-16  1:04 ` [PATCH v4 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported isaku.yamahata
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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
"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
> For ACPI-only platforms (where SCI_EN is always set)

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/isa/vt82c686.c      |  2 +-
 include/hw/acpi/acpi.h |  4 +++-
 5 files changed, 17 insertions(+), 5 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/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 v4 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (3 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 06/10] acpi: add test case for smm unsupported -machine smm=off isaku.yamahata
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 f56d699c7f..e3386ae674 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 v4 06/10] acpi: add test case for smm unsupported -machine smm=off
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (4 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 669202fc95..592c074ec7 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -957,6 +957,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;
@@ -969,6 +1002,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;
@@ -1325,6 +1391,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 v4 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (5 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 06/10] acpi: add test case for smm unsupported -machine smm=off isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16 22:32   ` Igor Mammedov
  2021-02-16  1:04 ` [PATCH v4 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled isaku.yamahata
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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,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 ()
+            {
+                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+                    0x00000000,         // Granularity
+                    0xB0000000,         // Range Minimum
+                    0xB0000000,         // Range Maximum
+                    0x00000000,         // Translation Offset
+                    0x10000000,         // 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

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

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e3386ae674..30326f69b3 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1072,6 +1072,55 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
+static Aml *build_q35_dram_controller(AcpiMcfgInfo *mcfg)
+{
+    Aml *dev;
+    Aml *rbuf;
+    Aml *resource_template;
+    Aml *rbuf_name;
+    Aml *crs;
+
+    /* 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,
+                                    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,
+                                    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;
@@ -1218,6 +1267,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 +1306,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 +1439,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 v4 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (6 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 09/10] acpi: add test case for -no-hpet isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 10/10] qtest/acpi/bios-tables-test: update acpi tables isaku.yamahata
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 30326f69b3..aaff9a406d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1290,7 +1290,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) {
@@ -1337,7 +1339,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 v4 09/10] acpi: add test case for -no-hpet
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (7 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  2021-02-16  1:04 ` [PATCH v4 10/10] qtest/acpi/bios-tables-test: update acpi tables isaku.yamahata
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 592c074ec7..3fb7ed0c46 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -990,6 +990,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;
@@ -1035,6 +1046,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;
@@ -1396,11 +1418,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 v4 10/10] qtest/acpi/bios-tables-test: update acpi tables
  2021-02-16  1:04 [PATCH v4 00/10] ACPI related fixes to comform the spec better isaku.yamahata
                   ` (8 preceding siblings ...)
  2021-02-16  1:04 ` [PATCH v4 09/10] acpi: add test case for -no-hpet isaku.yamahata
@ 2021-02-16  1:04 ` isaku.yamahata
  9 siblings, 0 replies; 14+ messages in thread
From: isaku.yamahata @ 2021-02-16  1:04 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 -> 7872 bytes
 tests/data/acpi/q35/DSDT.acpihmat           | Bin 9126 -> 9197 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 7819 -> 7890 bytes
 tests/data/acpi/q35/DSDT.cphp               | Bin 8265 -> 8336 bytes
 tests/data/acpi/q35/DSDT.dimmpxm            | Bin 9455 -> 9526 bytes
 tests/data/acpi/q35/DSDT.ipmibt             | Bin 7876 -> 7947 bytes
 tests/data/acpi/q35/DSDT.memhp              | Bin 9160 -> 9231 bytes
 tests/data/acpi/q35/DSDT.mmio64             | Bin 8932 -> 9003 bytes
 tests/data/acpi/q35/DSDT.nohpet             | Bin 0 -> 7730 bytes
 tests/data/acpi/q35/DSDT.numamem            | Bin 7807 -> 7878 bytes
 tests/data/acpi/q35/DSDT.tis                | Bin 8407 -> 8478 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/tests/data/acpi/pc/DSDT.nohpet b/tests/data/acpi/pc/DSDT.nohpet
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..302deb595c79da7eb8da87baad16a21326e02430 100644
GIT binary patch
literal 4923
zcmb7IQEwZ^5uW88<>QjHj?~$5tRyBByJ^xQCMjEX5TFpbM@qCr>dd2(7AJtD$e>gZ
zzy~J+q6$H222d0~6%bVPp%09qyjnk@{R#aE`3)%$>#6L_9hagh9*_{w@n+`RZ)SF9
zXO}W<v-Z&(0Nc%PiZwfx|Dz>L)G+{{cly>#>NYrCGrwAA(U8iVXHoARA9>CAy_w%y
zW&h|j{@!SO`E7$WUD$b{pX@Z<Z;l!}K%l)Hmveg27wdMu?(`NcQA%s|wUQaj{f8@B
zJ!e)yt8bM|(0}s*VF=*#ZkFs^-Lu9pM2x|@mlh%3;HqAkzpF?fp`6~m^}LB-pHx9o
zyO!g#T3uA_#0`FJl{KINjIFXZwDEf}1pDChZkIQ=Mx$ouUK^$H@FM7h%4tPYj3T~*
zu@dV7zp=`GQhriEU1hJ7R|>Gj6?k9uh%?0vD<?B6nx$k)2Oj2|Jk9tS5Ai$rm*fk4
zz(40d^I5KG^`cow%yWb0eEbta!Rci;tXf8<r~0$SUJF;}@m2Pf@|B`#i(M~<tk^7%
z#)J`#GdyL?xpJ<6wy1k!?o?}HG$GMprXIBmE--Bo*goiM+Ql+;En(MK6kc-8d8U&f
zaQU`U_%KsW*DgH5y3t;86$^(1kxv&Mp&?%>S6Ni|4J3$sWviTWSbjsSgK@_ag-0Rh
z9g+qEw?jsEpX~w-cituSDd?4DsseqTQ^go2uUpj`xXDnr;X?C8K629JUH30d9)cbB
z;AwLQxB{)de%wM(L<QKWteep8-#%`!e&V>v)sfnU_V@9TltWPBxWz*wO@63RMj8Qa
z_v`%~u0wP%fTK2md(cFGM{Ndf`>4@`z2<4dd3O7*LeWy$Qb9AT`Z%rOBSViYJ(e_M
zuJjmZ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y_i8aE69

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT
index d25cd7072932886d6967f4023faac1e1fa6e836c..abff765d8e3941a408e6bc703c0b61ec46feccae 100644
GIT binary patch
delta 101
zcmexqbHJ9%CD<k8fE)t@Bilr-R3<0>iG?fOqnlh=T!I{(IpRG$U3dfh0t}oD3>i3r
soI>3M<+)_q#TgiQ7#Sd71CRn?5D=(j5aEt@4hrU20#dtKiZNam0McO<jQ{`u

delta 29
lcmX?L`_qQYCD<jTQjURv@!LeMR3>k(iG?dSCo;y%0sxek35@^%

diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat
index 722e06af83abcde203a2b96a8ec81fd3bab9fc98..5a1d554ee31e64731b42e483e945e5999b79d45a 100644
GIT binary patch
delta 101
zcmZ4H{??t#CD<k8tug}x<Kc;1sZ37%6AM?mM>n~$xCA*mbHsaiy6^`01sFIR7&34K
sIfc3j%5%xIi!(6rFfu^E1|S8(ARti5Ai^E*92Cs41f+Je6l0GP03F2^od5s;

delta 29
lcmaFszRaD=CD<ionKA<d<K~H6sZ8En6AM>vPGsy+0sxbG37r4{

diff --git a/tests/data/acpi/q35/DSDT.bridge b/tests/data/acpi/q35/DSDT.bridge
index 06bac139d668ddfc7914e258b471a303c9dbd192..184f07c664496c37ffe1475a86358b3c0d702d68 100644
GIT binary patch
delta 101
zcmeCSy=2Sf66_LkNsfVmasEWER3<0>iG?fOqnlh=T!I{(IpRG$U3dfh0t}oD3>i3r
soI>3M<+)_q#TgiQ7#Sd71CRn?5D=(j5aEt@4hrU20#dtKim^}@0O;@)?*IS*

delta 29
kcmca)+ilC`66_MvEyuvX*guggmC2iHV&TfoiHwD^0EVOp?*IS*

diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp
index 2b933ac482e6883efccbd7d6c96089602f2c0b4d..8e164c4a1cc46f552c834601c356d345287c9750 100644
GIT binary patch
delta 101
zcmX@<Fu{?_CD<iof&v2rW7b5jR3<0>iG?fOqnlh=T!I{(IpRG$U3dfh0t}oD3>i3r
soI>3M<+)_q#TgiQ7#Sd71CRn?5D=(j5aEt@4hrU20#dtKicw!40Kp9vJpcdz

delta 29
kcmbQ>c+!E(CD<jzQ-OhjF=`@LDw8+Y#KM)E6B+g80e#a5Jpcdz

diff --git a/tests/data/acpi/q35/DSDT.dimmpxm b/tests/data/acpi/q35/DSDT.dimmpxm
index bd8f8305b028ef20f9b6d1a0c69ac428d027e3d1..47cf7eeb43da90fb637d3c96a69af999a67d132e 100644
GIT binary patch
delta 101
zcmaFwxy_5qCD<jzOqGFw(R3nLDw7lc#KM*C(M_%_E<ujY9Pu8WF1!JL0S3+nh724*
sPN8ms@?0|Q;tUKtj0_O40Z4%`2nbX%h;YX{2L*F10jb?A#duX20Jd)xy8r+H

delta 29
lcmdny_1=@qCD<k8y$S;ZquNBSR3>k(iG?dSCo*1D1^|<h3A+FQ

diff --git a/tests/data/acpi/q35/DSDT.ipmibt b/tests/data/acpi/q35/DSDT.ipmibt
index a8f868e23c25688ab1c0371016c071f23e9d732f..cfb8439511e05c0d3e6c74f5a5ddae8c35d3b939 100644
GIT binary patch
delta 101
zcmX?N+il0?66_MfEziKfXgQH9mC1>JV&O{n=q6Vdmmo)Hj(87G7v2EB00U<OLk5l@
sr%*RRc`liDaRvq+Mg|Dj0Hi<|1OzG>M7ZOfgMvAhfYff5Vq7H)0DAcp?*IS*

delta 29
lcmeCSJ7UY_66_LkM2>-hQEMVsDw8+Y#KM)E6B$>@0sw=v2=4#@

diff --git a/tests/data/acpi/q35/DSDT.memhp b/tests/data/acpi/q35/DSDT.memhp
index 9a802e4c67022386442976d5cb997ea3fc57b58f..4e588f184a6be20a156d195e0ed28e5b56d129a1 100644
GIT binary patch
delta 101
zcmX@%-tWQX66_Mfufo8<_<bT*Dw7lc#KM*C(M_%_E<ujY9Pu8WF1!JL0S3+nh724*
sPN8ms@?0|Q;tUKtj0_O40Z4%`2nbX%h;YX{2L*F10jb?A#kfuh0LiNr+W-In

delta 29
lcmeD8IN{Fa66_LkLYaYq@x?^0R3>k(iG?dSCo-;60sxYY3EKbw

diff --git a/tests/data/acpi/q35/DSDT.mmio64 b/tests/data/acpi/q35/DSDT.mmio64
index 948c2dc7264c31932b490ca00691a7c4d9aefdb0..d76e8136998c5b3a25bac21da7070a47fcfbde4e 100644
GIT binary patch
delta 101
zcmaFjy4sD)CD<iITbY4@am_@oR3<0>iG?fOqnlh=T!I{(IpRG$U3dfh0t}oD3>i3r
soI>3M<+)_q#TgiQ7#Sd71CRn?5D=(j5aEt@4hrU20#dtKit&^p0M2d|`Tzg`

delta 29
lcmZ4O_QaLTCD<k8i4p??<J^f{sZ8En6AM>vPGmf#2mqEa3Hks4

diff --git a/tests/data/acpi/q35/DSDT.nohpet b/tests/data/acpi/q35/DSDT.nohpet
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3a98616f729cda2f1984e94a3dbd2bde02aa620a 100644
GIT binary patch
literal 7730
zcmb7JTW=f38J*=tS}m8-lA<MBwj;q!??p_>P8+nSQF52J=tgm=x&Z}{lAKnK3uF;n
zKnx>*tpJVVhoXq!ppUYl0C{Vl`da^k_N@l`5Bl1N_^IsqzS)syND7Dqh}<)K&U|xb
zFK0O$gh6}h4I!+5l-K=wxKRF0(+|*Q2_a~kzP(0jOLQIv<yzOuBvMxAQHHniQML;|
z3Cf!_>(6_=FMGXvpY^QmNbEfKp6+Z%pFZyG2qNw8M2<rnUU{k;mb;w;-)Z`dqTQ`G
z0=M)}$F{q^+)CQrQqU51ce4?Q!peAeJ@ivg?g&4)xp=geKHSSqJ6>n?-`BpGzx1mw
zZ{91t_~pNT`{a(30$~Z?HomV#^wE3JbLM+T-WP|rtxrhK`xcL;zc}RGvdyDCQIA@l
zxw476T0FkfIjE$9R>|i<W}9oxqF-DTcB{Nu&CNTPKARQ7rP-mszsCQx?cEoJOxJIP
z_Azn2@4ZEq$!_Oht`U~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frXjcc^=e@rVFY5)KL

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.numamem
index 44ec1b0af400da6d298284aa959aa38add7e6dd5..13f09ff3d8c566fdf4f9c7a604e92184ac1aee2f 100644
GIT binary patch
delta 101
zcmexwbIg{@CD<k8m>dHG<A#Y`sZ37%6AM?mM>n~$xCA*mbHsaiy6^`01sFIR7&34K
sIfc3j%5%xIi!(6rFfu^E1|S8(ARti5Ai^E*92Cs41f+Je6l1C^023M(PXGV_

delta 29
lcmX?R``?DkCD<jTUXFo*alu5cR3>k(iG?dSCo-nW0sxU=2~Pk3

diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis
index 30da3ec27958881801dacc954a343321ba26a2ae..e15073068895a3b601b49267806b55a904b8dbff 100644
GIT binary patch
delta 101
zcmccaIM0d8CD<iIPLY9u@%lurR3<0>iG?fOqnlh=T!I{(IpRG$U3dfh0t}oD3>i3r
soI>3M<+)_q#TgiQ7#Sd71CRn?5D=(j5aEt@4hrU20#dtKigB+z0Lo1j<p2Nx

delta 29
lcmbQ|bls85CD<k8x&i|O<B5q}sZ8En6AM>vPGsCG4*-+D3FQC)

diff --git a/tests/data/acpi/q35/FACP.nosmm b/tests/data/acpi/q35/FACP.nosmm
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..891450367cbd1aca397d296831ebeb5cc0788f0f 100644
GIT binary patch
literal 244
zcmZ>BbPo8!z`($K&B@={BUr&HBEZ=VD8>jB1F=Cg3@|cq!k7#UY!D_3lm_uQfNTYr
zI1>Yl08s2d|9^gnN(KfaAY*9@0|O%m1H(@qh$vhVrU*zgDgX&2bAdcCU<4Y7Y#&S<
TnPyagxC11{*nn^khz|n*0A~&X

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 v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM
  2021-02-16  1:04 ` [PATCH v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM isaku.yamahata
@ 2021-02-16 22:21   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2021-02-16 22:21 UTC (permalink / raw)
  To: isaku.yamahata; +Cc: isaku.yamahata, qemu-devel, mst

On Mon, 15 Feb 2021 17:04:08 -0800
isaku.yamahata@gmail.com wrote:

> 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.smm-compat=on"
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>

looks good to me, but doesn't apply to master anymore, so needs to be rebased
> ---
>  hw/acpi/piix4.c        | 2 ++
>  hw/core/machine.c      | 5 ++++-
>  hw/isa/lpc_ich9.c      | 1 +
>  include/hw/acpi/ich9.h | 1 +
>  4 files changed, 8 insertions(+), 1 deletion(-)
> 
> 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/core/machine.c b/hw/core/machine.c
> index de3b8f1b31..870c9201df 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -33,7 +33,10 @@
>  #include "migration/global_state.h"
>  #include "migration/vmstate.h"
>  
> -GlobalProperty hw_compat_5_2[] = {};
> +GlobalProperty hw_compat_5_2[] = {
> +    { "ICH9-LPC", "smm-compat", "on"},
> +    { "PIIX4_PM", "smm-compat", "on"},
> +};
I'd put this hunk into the 4/10, where behavior changes

and add a note to commit this message that property will be used by the next patch

>  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/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 v4 04/10] acpi/core: always set SCI_EN when SMM isn't supported
  2021-02-16  1:04 ` [PATCH v4 04/10] acpi/core: always set SCI_EN when SMM isn't supported isaku.yamahata
@ 2021-02-16 22:22   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2021-02-16 22:22 UTC (permalink / raw)
  To: isaku.yamahata; +Cc: isaku.yamahata, qemu-devel, mst

On Mon, 15 Feb 2021 17:04:09 -0800
isaku.yamahata@gmail.com wrote:

> 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
> "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
> > For ACPI-only platforms (where SCI_EN is always set)  
> 
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>

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

> ---
>  hw/acpi/core.c         | 11 ++++++++++-
>  hw/acpi/ich9.c         |  2 +-
>  hw/acpi/piix4.c        |  3 ++-
>  hw/isa/vt82c686.c      |  2 +-
>  include/hw/acpi/acpi.h |  4 +++-
>  5 files changed, 17 insertions(+), 5 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/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);



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

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

On Mon, 15 Feb 2021 17:04:12 -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,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 ()
> +            {
> +                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
> +                    0x00000000,         // Granularity
> +                    0xB0000000,         // Range Minimum
> +                    0xB0000000,         // Range Maximum
> +                    0x00000000,         // Translation Offset
> +                    0x10000000,         // 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
> 
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
> ---
>  hw/i386/acpi-build.c | 55 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 54 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index e3386ae674..30326f69b3 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1072,6 +1072,55 @@ static void build_q35_pci0_int(Aml *table)
>      aml_append(table, sb_scope);
>  }
>  
> +static Aml *build_q35_dram_controller(AcpiMcfgInfo *mcfg)
> +{
> +    Aml *dev;
> +    Aml *rbuf;
> +    Aml *resource_template;
> +    Aml *rbuf_name;
> +    Aml *crs;
> +
> +    /* 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,
                                here       ^^^

> +        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,
                             and here   ^^^
please revert it to the way did it in v3,
I was wrong suggesting that for fixed address case.
 
> +                                    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);
can be simpler if method is replaced with _CRS variable, i.e.:

       aml_append(dev, aml_name_decl("_CRS", resource_template));

> +
> +    return dev;
> +}
> +
>  static void build_q35_isa_bridge(Aml *table)
>  {
>      Aml *dev;
> @@ -1218,6 +1267,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 +1306,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 +1439,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

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

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

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.