Skip to contentSkip to conversation

acpi: Error Record Serialization Table, ERST, support for QEMU

PATCH Superseded Eric DeVolder 4 participants 21 messages Oct 15, 2021 – Oct 24, 2021 Arm/Amlogic Meson SoC support

v8 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

v8 cover acpi: Error Record Serialization Table, ERST, support for QEMU

This patchset introduces support for the ACPI Error Record Serialization Table, ERST.

For background and implementation information, please see docs/specs/acpi_erst.rst, which is patch 2/10.

---
v8: 15oct2021
- Added Kconfig option for ERST, per Ani Sinha
- Fixed patch ordering, per Ani

v7: 7oct2021
- style improvements, per Igor
- use of endian accessors for storage header, per Igor
- a number of optimizations and improvements, per Igor
- updated spec for header, per Igor
- updated spec for rst format, per Michael Tsirkin
- updated spec for new record_size parameter Due to changes in the spec, I am not carrying the Acked-by from Ani Sinha.
- changes for and testing of migration to systems with differing ERST_RECORD_SIZE

v6: 5aug2021
- Fixed compile warning/error, per Michael Tsirkin
- Fixed mingw32 build error, per Michael
- Converted exchange buffer to MemoryBackend, per Igor
- Migrated test to PCI, per Igor
- Significantly reduced amount of copying, per Igor
- Corrections/enhancements to acpi_erst.txt, per Igor
- Many misc/other small items, per Igor

v5: 30jun2021
- Create docs/specs/acpi_erst.txt, per Igor
- Separate PCI BARs for registers and memory, per Igor
- Convert debugging to use trace infrastructure, per Igor
- Various other fixups, per Igor

v4: 11jun2021
- Converted to a PCI device, per Igor.
- Updated qtest.
- Rearranged patches, per Igor.

v3: 28may2021
- Converted to using a TYPE_MEMORY_BACKEND_FILE object rather than internal array with explicit file operations, per Igor.
- Changed the way the qdev and base address are handled, allowing ERST to be disabled at run-time. Also aligns better with other existing code.

v2: 8feb2021
- Added qtest/smoke test per Paolo Bonzini
- Split patch into smaller chunks, per Igor Mammedov
- Did away with use of ACPI packed structures, per Igor Mammedov

v1: 26oct2020
- initial post

---
Eric DeVolder (10):
ACPI ERST: bios-tables-test.c steps 1 and 2 ACPI ERST: specification for ERST support ACPI ERST: PCI device_id for ERST
ACPI ERST: header file for ERST
ACPI ERST: support for ACPI ERST feature ACPI ERST: build the ACPI ERST table
ACPI ERST: create ACPI ERST table for pc/x86 machines ACPI ERST: qtest for ERST
ACPI ERST: bios-tables-test testcase
ACPI ERST: step 6 of bios-tables-test.c

 docs/specs/acpi_erst.rst          |  200 +++++++
 hw/acpi/Kconfig                   |    6 +
 hw/acpi/erst.c                    | 1077 +++++++++++++++++++++++++++++++++++++
 hw/acpi/meson.build               |    1 +
 hw/acpi/trace-events              |   15 +
 hw/i386/acpi-build.c              |    9 +
 hw/i386/acpi-microvm.c            |    9 +
 include/hw/acpi/erst.h            |   24 +
 include/hw/pci/pci.h              |    1 +
 tests/data/acpi/microvm/ERST.pcie |  Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst  |  Bin 0 -> 5969 bytes
 tests/data/acpi/pc/ERST           |    0
 tests/data/acpi/q35/DSDT.acpierst |  Bin 0 -> 8306 bytes
 tests/data/acpi/q35/ERST          |    0
 tests/qtest/bios-tables-test.c    |   55 ++
 tests/qtest/erst-test.c           |  167 ++++++
 tests/qtest/meson.build           |    2 +
 17 files changed, 1566 insertions(+)
 create mode 100644 docs/specs/acpi_erst.rst
 create mode 100644 hw/acpi/erst.c
 create mode 100644 include/hw/acpi/erst.h
 create mode 100644 tests/data/acpi/microvm/ERST.pcie
 create mode 100644 tests/data/acpi/pc/DSDT.acpierst
 create mode 100644 tests/data/acpi/pc/ERST
 create mode 100644 tests/data/acpi/q35/DSDT.acpierst
 create mode 100644 tests/data/acpi/q35/ERST
 create mode 100644 tests/qtest/erst-test.c
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v8 1/10 ACPI ERST: bios-tables-test.c steps 1 and 2

Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2.

---
 tests/data/acpi/microvm/ERST.pcie           | 0
 tests/data/acpi/pc/DSDT.acpierst            | 0
 tests/data/acpi/pc/ERST                     | 0
 tests/data/acpi/q35/DSDT.acpierst           | 0
 tests/data/acpi/q35/ERST                    | 0
 tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++
 6 files changed, 5 insertions(+)
 create mode 100644 tests/data/acpi/microvm/ERST.pcie
 create mode 100644 tests/data/acpi/pc/DSDT.acpierst
 create mode 100644 tests/data/acpi/pc/ERST
 create mode 100644 tests/data/acpi/q35/DSDT.acpierst
 create mode 100644 tests/data/acpi/q35/ERST
tests/data/acpi/microvm/ERST.pcie new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/data/acpi/pc/DSDT.acpierst new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/data/acpi/pc/ERST new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/data/acpi/q35/DSDT.acpierst new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/data/acpi/q35/ERST new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/qtest/bios-tables-test-allowed-diff.h +5 -0
index dfb8523..c06241a 100644
@@ -1 +1,6 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/ERST",
+"tests/data/acpi/q35/DSDT.acpierst",
+"tests/data/acpi/q35/ERST",
+"tests/data/acpi/microvm/ERST.pcie",
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v8 2/10 ACPI ERST: specification for ERST support

In reply to Eric DeVolder

Information on the implementation of the ACPI ERST support.

---
 docs/specs/acpi_erst.rst | 200 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 200 insertions(+)
 create mode 100644 docs/specs/acpi_erst.rst
docs/specs/acpi_erst.rst new file +200 -0
new file mode 100644
index 0000000..a8a9d22
@@ -0,0 +1,200 @@
+ACPI ERST DEVICE
+================
+
+The ACPI ERST device is utilized to support the ACPI Error Record
+Serialization Table, ERST, functionality. This feature is designed for
+storing error records in persistent storage for future reference
+and/or debugging.
+
+The ACPI specification[1], in Chapter "ACPI Platform Error Interfaces
+(APEI)", and specifically subsection "Error Serialization", outlines a
+method for storing error records into persistent storage.
+
+The format of error records is described in the UEFI specification[2],
+in Appendix N "Common Platform Error Record".
+
+While the ACPI specification allows for an NVRAM "mode" (see
+GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES) where non-volatile RAM is
+directly exposed for direct access by the OS/guest, this device
+implements the non-NVRAM "mode". This non-NVRAM "mode" is what is
+implemented by most BIOS (since flash memory requires programming
+operations in order to update its contents). Furthermore, as of the
+time of this writing, Linux only supports the non-NVRAM "mode".
+
+
+Background/Motivation
+---------------------
+
+Linux uses the persistent storage filesystem, pstore, to record
+information (eg. dmesg tail) upon panics and shutdowns.  Pstore is
+independent of, and runs before, kdump.  In certain scenarios (ie.
+hosts/guests with root filesystems on NFS/iSCSI where networking
+software and/or hardware fails, and thus kdump fails), pstore may
+contain information available for post-mortem debugging.
+
+Two common storage backends for the pstore filesystem are ACPI ERST
+and UEFI. Most BIOS implement ACPI ERST. UEFI is not utilized in all
+guests. With QEMU supporting ACPI ERST, it becomes a viable pstore
+storage backend for virtual machines (as it is now for bare metal
+machines).
+
+Enabling support for ACPI ERST facilitates a consistent method to
+capture kernel panic information in a wide range of guests: from
+resource-constrained microvms to very large guests, and in particular,
+in direct-boot environments (which would lack UEFI run-time services).
+
+Note that Microsoft Windows also utilizes the ACPI ERST for certain
+crash information, if available[3].
+
+
+Configuration|Usage
+-------------------
+
+To use ACPI ERST, a memory-backend-file object and acpi-erst device
+can be created, for example:
+
+ qemu ...
+ -object memory-backend-file,id=erstnvram,mem-path=acpi-erst.backing,size=0x10000,share=on \
+ -device acpi-erst,memdev=erstnvram
+
+For proper operation, the ACPI ERST device needs a memory-backend-file
+object with the following parameters:
+
+ - id: The id of the memory-backend-file object is used to associate
+   this memory with the acpi-erst device.
+ - size: The size of the ACPI ERST backing storage. This parameter is
+   required.
+ - mem-path: The location of the ACPI ERST backing storage file. This
+   parameter is also required.
+ - share: The share=on parameter is required so that updates to the
+   ERST backing store are written to the file.
+
+and ERST device:
+
+ - memdev: Is the object id of the memory-backend-file.
+ - record_size: Specifies the size of the records (or slots) in the
+   backend storage. Must be a power of two value greater than or
+   equal to 4096 (PAGE_SIZE).
+
+
+PCI Interface
+-------------
+
+The ERST device is a PCI device with two BARs, one for accessing the
+programming registers, and the other for accessing the record exchange
+buffer.
+
+BAR0 contains the programming interface consisting of ACTION and VALUE
+64-bit registers.  All ERST actions/operations/side effects happen on
+the write to the ACTION, by design. Any data needed by the action must
+be placed into VALUE prior to writing ACTION.  Reading the VALUE
+simply returns the register contents, which can be updated by a
+previous ACTION.
+
+BAR1 contains the 8KiB record exchange buffer, which is the
+implemented maximum record size.
+
+
+Backend Storage Format
+----------------------
+
+The backend storage is divided into fixed size "slots", 8KiB in
+length, with each slot storing a single record.  Not all slots need to
+be occupied, and they need not be occupied in a contiguous fashion.
+The ability to clear/erase specific records allows for the formation
+of unoccupied slots.
+
+Slot 0 contains a backend storage header that identifies the contents
+as ERST and also facilitates efficient access to the records.
+Depending upon the size of the backend storage, additional slots will
+be designated to be a part of the slot 0 header. For example, at 8KiB,
+the slot 0 header can accomodate 1021 records. Thus a storage size
+of 8MiB (8KiB * 1024) requires an additional slot for use by the
+header. In this scenario, slot 0 and slot 1 form the backend storage
+header, and records can be stored starting at slot 2.
+
+Below is an example layout of the backend storage format (for storage
+size less than 8MiB). The size of the storage is a multiple of 8KiB,
+and contains N number of slots to store records. The example below
+shows two records (in CPER format) in the backend storage, while the
+remaining slots are empty/available.
+
+::
+
+ Slot   Record
+        <------------------ 8KiB -------------------->
+        +--------------------------------------------+
+    0   | storage header                             |
+        +--------------------------------------------+
+    1   | empty/available                            |
+        +--------------------------------------------+
+    2   | CPER                                       |
+        +--------------------------------------------+
+    3   | CPER                                       |
+        +--------------------------------------------+
+  ...   |                                            |
+        +--------------------------------------------+
+    N   | empty/available                            |
+        +--------------------------------------------+
+
+The storage header consists of some basic information and an array
+of CPER record_id's to efficiently access records in the backend
+storage.
+
+All fields in the header are stored in little endian format.
+
+::
+
+  +--------------------------------------------+
+  | magic                                      | 0x0000
+  +--------------------------------------------+
+  | record_offset        | record_size         | 0x0008
+  +--------------------------------------------+
+  | record_count         | reserved | version  | 0x0010
+  +--------------------------------------------+
+  | record_id[0]                               | 0x0018
+  +--------------------------------------------+
+  | record_id[1]                               | 0x0020
+  +--------------------------------------------+
+  | record_id[...]                             |
+  +--------------------------------------------+
+  | record_id[N]                               | 0x1FF8
+  +--------------------------------------------+
+
+The 'magic' field contains the value 0x524F545354535245.
+
+The 'record_size' field contains the value 0x2000, 8KiB.
+
+The 'record_offset' field points to the first record_id in the array,
+0x0018.
+
+The 'version' field contains 0x0100, the first version.
+
+The 'record_count' field contains the number of valid records in the
+backend storage.
+
+The 'record_id' array fields are the 64-bit record identifiers of the
+CPER record in the corresponding slot. Stated differently, the
+location of a CPER record_id in the record_id[] array provides the
+slot index for the corresponding record in the backend storage.
+
+Note that, for example, with a backend storage less than 8MiB, slot 0
+contains the header, so the record_id[0] will never contain a valid
+CPER record_id. Instead slot 1 is the first available slot and thus
+record_id_[1] may contain a CPER.
+
+A 'record_id' of all 0s or all 1s indicates an invalid record (ie. the
+slot is available).
+
+
+References
+----------
+
+[1] "Advanced Configuration and Power Interface Specification",
+    version 4.0, June 2009.
+
+[2] "Unified Extensible Firmware Interface Specification",
+    version 2.1, October 2008.
+
+[3] "Windows Hardware Error Architecture", specfically
+    "Error Record Persistence Mechanism".
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH v8 3/10 ACPI ERST: PCI device_id for ERST

In reply to Eric DeVolder

This change reserves the PCI device_id for the new ACPI ERST device.

---
 include/hw/pci/pci.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/pci/pci.h +1 -0
index 7fc9013..45b79b1 100644
@@ -108,6 +108,7 @@ extern bool pci_available;
 #define PCI_DEVICE_ID_REDHAT_MDPY        0x000f
 #define PCI_DEVICE_ID_REDHAT_NVME        0x0010
 #define PCI_DEVICE_ID_REDHAT_PVPANIC     0x0011
+#define PCI_DEVICE_ID_REDHAT_ACPI_ERST   0x0012
 #define PCI_DEVICE_ID_REDHAT_QXL         0x0100
 
 #define FMT_PCIBUS                      PRIx64
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH v8 4/10 ACPI ERST: header file for ERST

In reply to Eric DeVolder

This change introduces the public defintions for ACPI ERST.

---
 include/hw/acpi/erst.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 include/hw/acpi/erst.h
include/hw/acpi/erst.h new file +19 -0
new file mode 100644
index 0000000..9d63717
@@ -0,0 +1,19 @@
+/*
+ * ACPI Error Record Serialization Table, ERST, Implementation
+ *
+ * ACPI ERST introduced in ACPI 4.0, June 16, 2009.
+ * ACPI Platform Error Interfaces : Error Serialization
+ *
+ * Copyright (c) 2021 Oracle and/or its affiliates.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef HW_ACPI_ERST_H
+#define HW_ACPI_ERST_H
+
+void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
+                const char *oem_id, const char *oem_table_id);
+
+#define TYPE_ACPI_ERST "acpi-erst"
+
+#endif
Signature · 1 line
1.8.3.1
Reviewed-by on v8 4/10
#5 lore raw

Re: [PATCH v8 04/10] ACPI ERST: header file for ERST

Quoted 3 lines · Eric DeVolder

This change introduces the public defintions for ACPI ERST.

Quoted 34 lines
---
 include/hw/acpi/erst.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 include/hw/acpi/erst.h
include/hw/acpi/erst.h new file +19 -1
new file mode 100644
index 0000000..9d63717
@@ -0,0 +1,19 @@
+/*
+ * ACPI Error Record Serialization Table, ERST, Implementation
+ *
+ * ACPI ERST introduced in ACPI 4.0, June 16, 2009.
+ * ACPI Platform Error Interfaces : Error Serialization
+ *
+ * Copyright (c) 2021 Oracle and/or its affiliates.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef HW_ACPI_ERST_H
+#define HW_ACPI_ERST_H
+
+void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
+                const char *oem_id, const char *oem_table_id);
+
+#define TYPE_ACPI_ERST "acpi-erst"
+
+#endif
--

1.8.3.1

#6 lore raw

PATCH v8 5/10 ACPI ERST: support for ACPI ERST feature

In reply to Eric DeVolder

This implements a PCI device for ACPI ERST. This implements the non-NVRAM "mode" of operation for ERST as it is supported by Linux and Windows.

---
 hw/acpi/Kconfig      |   6 +
 hw/acpi/erst.c       | 836 +++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/acpi/meson.build  |   1 +
 hw/acpi/trace-events |  15 +
 4 files changed, 858 insertions(+)
 create mode 100644 hw/acpi/erst.c
hw/acpi/Kconfig +6 -0
index 3b5e118..79dc7a1 100644
@@ -10,6 +10,7 @@ config ACPI_X86
     select ACPI_HMAT
     select ACPI_PIIX4
     select ACPI_PCIHP
+    select ACPI_ERST
 
 config ACPI_X86_ICH
     bool
@@ -56,3 +57,8 @@ config ACPI_HW_REDUCED
     select ACPI
     select ACPI_MEMORY_HOTPLUG
     select ACPI_NVDIMM
+
+config ACPI_ERST
+    bool
+    default y
+    depends on ACPI && PCI
hw/acpi/erst.c new file +836 -0

836 lines not on this page · raw message

hw/acpi/meson.build +1 -0
index 7d8c0eb..8637c8b 100644
@@ -21,6 +21,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c'))
 acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c'))
 acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c'))
 acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c'))
+acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c'))
 acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c'))
 acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
 acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
hw/acpi/trace-events +15 -0
index 974d770..2250126 100644
@@ -55,3 +55,18 @@ piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64
 # tco.c
 tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)"
 tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d"
+
+# erst.c
+acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%04" PRIx64 " <== 0x%016" PRIx64 " (size: %u)"
+acpi_erst_reg_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%04" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)"
+acpi_erst_mem_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%06" PRIx64 " <== 0x%016" PRIx64 " (size: %u)"
+acpi_erst_mem_read(uint64_t addr, uint64_t val, unsigned size) " addr: 0x%06" PRIx64 " ==> 0x%016" PRIx64 " (size: %u)"
+acpi_erst_pci_bar_0(uint64_t addr) "BAR0: 0x%016" PRIx64
+acpi_erst_pci_bar_1(uint64_t addr) "BAR1: 0x%016" PRIx64
+acpi_erst_realizefn_in(void)
+acpi_erst_realizefn_out(unsigned size) "total nvram size %u bytes"
+acpi_erst_reset_in(unsigned record_count) "record_count %u"
+acpi_erst_reset_out(unsigned record_count) "record_count %u"
+acpi_erst_post_load(void *header, unsigned slot_size) "header: 0x%p slot_size %u"
+acpi_erst_class_init_in(void)
+acpi_erst_class_init_out(void)
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH v8 6/10 ACPI ERST: build the ACPI ERST table

In reply to Eric DeVolder

This builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device.

---
 hw/acpi/erst.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 241 insertions(+)
hw/acpi/erst.c +241 -0
index 4304f55..06a87af 100644
@@ -701,6 +701,247 @@ static const MemoryRegionOps erst_reg_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
+
+/*******************************************************************/
+/*******************************************************************/
+
+/* ACPI 4.0: Table 17-19 Serialization Instructions */
+#define INST_READ_REGISTER                 0x00
+#define INST_READ_REGISTER_VALUE           0x01
+#define INST_WRITE_REGISTER                0x02
+#define INST_WRITE_REGISTER_VALUE          0x03
+#define INST_NOOP                          0x04
+#define INST_LOAD_VAR1                     0x05
+#define INST_LOAD_VAR2                     0x06
+#define INST_STORE_VAR1                    0x07
+#define INST_ADD                           0x08
+#define INST_SUBTRACT                      0x09
+#define INST_ADD_VALUE                     0x0A
+#define INST_SUBTRACT_VALUE                0x0B
+#define INST_STALL                         0x0C
+#define INST_STALL_WHILE_TRUE              0x0D
+#define INST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E
+#define INST_GOTO                          0x0F
+#define INST_SET_SRC_ADDRESS_BASE          0x10
+#define INST_SET_DST_ADDRESS_BASE          0x11
+#define INST_MOVE_DATA                     0x12
+
+/* ACPI 4.0: 17.4.1.2 Serialization Instruction Entries */
+static void build_serialization_instruction_entry(GArray *table_data,
+    uint8_t serialization_action,
+    uint8_t instruction,
+    uint8_t flags,
+    uint8_t register_bit_width,
+    uint64_t register_address,
+    uint64_t value,
+    uint64_t mask)
+{
+    /* ACPI 4.0: Table 17-18 Serialization Instruction Entry */
+    struct AcpiGenericAddress gas;
+
+    /* Serialization Action */
+    build_append_int_noprefix(table_data, serialization_action, 1);
+    /* Instruction */
+    build_append_int_noprefix(table_data, instruction         , 1);
+    /* Flags */
+    build_append_int_noprefix(table_data, flags               , 1);
+    /* Reserved */
+    build_append_int_noprefix(table_data, 0                   , 1);
+    /* Register Region */
+    gas.space_id = AML_SYSTEM_MEMORY;
+    gas.bit_width = register_bit_width;
+    gas.bit_offset = 0;
+    switch (register_bit_width) {
+    case 8:
+        gas.access_width = 1;
+        break;
+    case 16:
+        gas.access_width = 2;
+        break;
+    case 32:
+        gas.access_width = 3;
+        break;
+    case 64:
+        gas.access_width = 4;
+        break;
+    default:
+        gas.access_width = 0;
+        break;
+    }
+    gas.address = register_address;
+    build_append_gas_from_struct(table_data, &gas);
+    /* Value */
+    build_append_int_noprefix(table_data, value  , 8);
+    /* Mask */
+    build_append_int_noprefix(table_data, mask   , 8);
+}
+
+/* ACPI 4.0: 17.4.1 Serialization Action Table */
+void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
+    const char *oem_id, const char *oem_table_id)
+{
+    GArray *table_instruction_data;
+    unsigned action;
+    hwaddr bar0, bar1;
+    AcpiTable table = { .sig = "ERST", .rev = 1, .oem_id = oem_id,
+                        .oem_table_id = oem_table_id };
+
+    bar0 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 0);
+    trace_acpi_erst_pci_bar_0(bar0);
+    bar1 = (hwaddr)pci_get_bar_addr(PCI_DEVICE(erst_dev), 1);
+    trace_acpi_erst_pci_bar_1(bar1);
+
+#define MASK8  0x00000000000000FFUL
+#define MASK16 0x000000000000FFFFUL
+#define MASK32 0x00000000FFFFFFFFUL
+#define MASK64 0xFFFFFFFFFFFFFFFFUL
+
+    /*
+     * Serialization Action Table
+     * The serialization action table must be generated first
+     * so that its size can be known in order to populate the
+     * Instruction Entry Count field.
+     */
+    table_instruction_data = g_array_new(FALSE, FALSE, sizeof(char));
+
+    /* Serialization Instruction Entries */
+    action = ACTION_BEGIN_WRITE_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_BEGIN_READ_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_BEGIN_CLEAR_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_END_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_SET_RECORD_OFFSET;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER      , 0, 32,
+        bar0 + ERST_VALUE_OFFSET , 0, MASK32);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_EXECUTE_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_VALUE_OFFSET , ERST_EXECUTE_OPERATION_MAGIC, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_CHECK_BUSY_STATUS;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER_VALUE , 0, 32,
+        bar0 + ERST_VALUE_OFFSET, 0x01, MASK8);
+
+    action = ACTION_GET_COMMAND_STATUS;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 32,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK8);
+
+    action = ACTION_GET_RECORD_IDENTIFIER;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 64,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK64);
+
+    action = ACTION_SET_RECORD_IDENTIFIER;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER      , 0, 64,
+        bar0 + ERST_VALUE_OFFSET , 0, MASK64);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_GET_RECORD_COUNT;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 32,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK32);
+
+    action = ACTION_BEGIN_DUMMY_WRITE_OPERATION;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+
+    action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 64,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK64);
+
+    action = ACTION_GET_ERROR_LOG_ADDRESS_LENGTH;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 64,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK32);
+
+    action = ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 32,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK32);
+
+    action = ACTION_GET_EXECUTE_OPERATION_TIMINGS;
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_WRITE_REGISTER_VALUE, 0, 32,
+        bar0 + ERST_ACTION_OFFSET, action, MASK8);
+    build_serialization_instruction_entry(table_instruction_data,
+        action, INST_READ_REGISTER       , 0, 64,
+        bar0 + ERST_VALUE_OFFSET, 0, MASK64);
+
+    /* Serialization Header */
+    acpi_table_begin(&table, table_data);
+
+    /* Serialization Header Size */
+    build_append_int_noprefix(table_data, 48, 4);
+
+    /* Reserved */
+    build_append_int_noprefix(table_data,  0, 4);
+
+    /*
+     * Instruction Entry Count
+     * Each instruction entry is 32 bytes
+     */
+    build_append_int_noprefix(table_data,
+        (table_instruction_data->len / 32), 4);
+
+    /* Serialization Instruction Entries */
+    g_array_append_vals(table_data, table_instruction_data->data,
+        table_instruction_data->len);
+    g_array_free(table_instruction_data, TRUE);
+
+    acpi_table_end(linker, &table);
+}
+
 /*******************************************************************/
 /*******************************************************************/
 static int erst_post_load(void *opaque, int version_id)
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH v8 7/10 ACPI ERST: create ACPI ERST table for pc/x86 machines

In reply to Eric DeVolder

This change exposes ACPI ERST support for x86 guests.

---
 hw/i386/acpi-build.c   | 9 +++++++++
 hw/i386/acpi-microvm.c | 9 +++++++++
 include/hw/acpi/erst.h | 5 +++++
 3 files changed, 23 insertions(+)
hw/i386/acpi-build.c +9 -0
index 81418b7..9c2f9d9 100644
@@ -43,6 +43,7 @@
 #include "sysemu/tpm.h"
 #include "hw/acpi/tpm.h"
 #include "hw/acpi/vmgenid.h"
+#include "hw/acpi/erst.h"
 #include "sysemu/tpm_backend.h"
 #include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
@@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     GArray *tables_blob = tables->table_data;
     AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
     Object *vmgenid_dev;
+    Object *erst_dev;
     char *oem_id;
     char *oem_table_id;
 
@@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
                     ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                     x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
     vmgenid_dev = find_vmgenid_dev();
     if (vmgenid_dev) {
         acpi_add_table(table_offsets, tables_blob);
hw/i386/acpi-microvm.c +9 -0
index 196d318..662c8ad 100644
@@ -30,6 +30,7 @@
 #include "hw/acpi/bios-linker-loader.h"
 #include "hw/acpi/generic_event_device.h"
 #include "hw/acpi/utils.h"
+#include "hw/acpi/erst.h"
 #include "hw/i386/fw_cfg.h"
 #include "hw/i386/microvm.h"
 #include "hw/pci/pci.h"
@@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
     X86MachineState *x86ms = X86_MACHINE(mms);
     GArray *table_offsets;
     GArray *tables_blob = tables->table_data;
+    Object *erst_dev;
     unsigned dsdt, xsdt;
     AcpiFadtData pmfadt = {
         /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
@@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
                     ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                     x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
     xsdt = tables_blob->len;
     build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id,
                x86ms->oem_table_id);
include/hw/acpi/erst.h +5 -0
index 9d63717..b747fe7 100644
@@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
 
 #define TYPE_ACPI_ERST "acpi-erst"
 
+/* returns NULL unless there is exactly one device */
+static inline Object *find_erst_dev(void)
+{
+    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
+}
 #endif
Signature · 1 line
1.8.3.1
#9 lore raw

Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

Quoted 30 lines · Eric DeVolder

This change exposes ACPI ERST support for x86 guests.

---
 hw/i386/acpi-build.c   | 9 +++++++++
 hw/i386/acpi-microvm.c | 9 +++++++++
 include/hw/acpi/erst.h | 5 +++++
 3 files changed, 23 insertions(+)
hw/i386/acpi-build.c +2 -0
index 81418b7..9c2f9d9 100644
@@ -43,6 +43,7 @@
 #include "sysemu/tpm.h"
 #include "hw/acpi/tpm.h"
 #include "hw/acpi/vmgenid.h"
+#include "hw/acpi/erst.h"
 #include "sysemu/tpm_backend.h"
 #include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
@@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     GArray *tables_blob = tables->table_data;
     AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
     Object *vmgenid_dev;
+    Object *erst_dev;
     char *oem_id;
     char *oem_table_id;
 

hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2571

Quoted 10 lines
hw/i386/acpi-build.c +7 -0
@@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
                     ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                     x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+

This needs to be ifdef'd between CONFIG_ERST.

hw/i386/acpi-microvm.c

Quoted 4 lines
hw/i386/acpi-build.c +0 -0
     vmgenid_dev = find_vmgenid_dev();
     if (vmgenid_dev) {
         acpi_add_table(table_offsets, tables_blob);
hw/i386/acpi-microvm.c +0 -0

I do not think we need to include this for microvm machines. They are supposed to have minimal ACPUI support. So lets not bloat it unless there is a specific requirement to support ERST on microvms as well.

Quoted 54 lines

index 196d318..662c8ad 100644

hw/i386/acpi-microvm.c +9 -0
@@ -30,6 +30,7 @@
 #include "hw/acpi/bios-linker-loader.h"
 #include "hw/acpi/generic_event_device.h"
 #include "hw/acpi/utils.h"
+#include "hw/acpi/erst.h"
 #include "hw/i386/fw_cfg.h"
 #include "hw/i386/microvm.h"
 #include "hw/pci/pci.h"
@@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
     X86MachineState *x86ms = X86_MACHINE(mms);
     GArray *table_offsets;
     GArray *tables_blob = tables->table_data;
+    Object *erst_dev;
     unsigned dsdt, xsdt;
     AcpiFadtData pmfadt = {
         /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
@@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
                     ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                     x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
 
 
 
     xsdt = tables_blob->len;
     build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id,
                x86ms->oem_table_id);
include/hw/acpi/erst.h +5 -1
index 9d63717..b747fe7 100644
@@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
 
 #define TYPE_ACPI_ERST "acpi-erst"
 
+/* returns NULL unless there is exactly one device */
+static inline Object *find_erst_dev(void)
+{
+    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
+}
 #endif
--

1.8.3.1

#10 lore raw

Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

Ani, inline below.
eric

Quoted 37 lines · Ani Sinha
Quoted 33 lines · Eric DeVolder

This change exposes ACPI ERST support for x86 guests.

---
  hw/i386/acpi-build.c   | 9 +++++++++
  hw/i386/acpi-microvm.c | 9 +++++++++
  include/hw/acpi/erst.h | 5 +++++
  3 files changed, 23 insertions(+)
hw/i386/acpi-build.c +2 -0
index 81418b7..9c2f9d9 100644
@@ -43,6 +43,7 @@
  #include "sysemu/tpm.h"
  #include "hw/acpi/tpm.h"
  #include "hw/acpi/vmgenid.h"
+#include "hw/acpi/erst.h"
  #include "sysemu/tpm_backend.h"
  #include "hw/rtc/mc146818rtc_regs.h"
  #include "migration/vmstate.h"
@@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
      GArray *tables_blob = tables->table_data;
      AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
      Object *vmgenid_dev;
+    Object *erst_dev;
      char *oem_id;
      char *oem_table_id;
 
@@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
Quoted 9 lines

hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2571

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+

This needs to be ifdef'd between CONFIG_ERST.

ok

Quoted 10 lines

hw/i386/acpi-microvm.c

Quoted 6 lines
hw/i386/acpi-build.c +0 -0
      vmgenid_dev = find_vmgenid_dev();
      if (vmgenid_dev) {
          acpi_add_table(table_offsets, tables_blob);
hw/i386/acpi-microvm.c +0 -0

I do not think we need to include this for microvm machines. They are supposed to have minimal ACPUI support. So lets not bloat it unless there is a specific requirement to support ERST on microvms as well.

Would it be ok if I ifdef this on CONFIG_ERST also?

Quoted 56 lines
Quoted 56 lines

index 196d318..662c8ad 100644

hw/i386/acpi-microvm.c +9 -0
@@ -30,6 +30,7 @@
  #include "hw/acpi/bios-linker-loader.h"
  #include "hw/acpi/generic_event_device.h"
  #include "hw/acpi/utils.h"
+#include "hw/acpi/erst.h"
  #include "hw/i386/fw_cfg.h"
  #include "hw/i386/microvm.h"
  #include "hw/pci/pci.h"
@@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
      X86MachineState *x86ms = X86_MACHINE(mms);
      GArray *table_offsets;
      GArray *tables_blob = tables->table_data;
+    Object *erst_dev;
      unsigned dsdt, xsdt;
      AcpiFadtData pmfadt = {
          /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
@@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
 
 
 
      xsdt = tables_blob->len;
      build_xsdt(tables_blob, tables->linker, table_offsets, x86ms->oem_id,
                 x86ms->oem_table_id);
include/hw/acpi/erst.h +5 -1
index 9d63717..b747fe7 100644
@@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev,
 
  #define TYPE_ACPI_ERST "acpi-erst"
 
+/* returns NULL unless there is exactly one device */
+static inline Object *find_erst_dev(void)
+{
+    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
+}
  #endif
--

1.8.3.1

#11 lore raw

Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

Quoted 64 lines · Eric DeVolder

Ani, inline below.
eric

Quoted 39 lines · Ani Sinha
Quoted 35 lines · Eric DeVolder

This change exposes ACPI ERST support for x86 guests.

---
  hw/i386/acpi-build.c   | 9 +++++++++
  hw/i386/acpi-microvm.c | 9 +++++++++
  include/hw/acpi/erst.h | 5 +++++
  3 files changed, 23 insertions(+)
hw/i386/acpi-build.c +2 -0
index 81418b7..9c2f9d9 100644
@@ -43,6 +43,7 @@
  #include "sysemu/tpm.h"
  #include "hw/acpi/tpm.h"
  #include "hw/acpi/vmgenid.h"
+#include "hw/acpi/erst.h"
  #include "sysemu/tpm_backend.h"
  #include "hw/rtc/mc146818rtc_regs.h"
  #include "migration/vmstate.h"
@@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables,
 MachineState *machine)
      GArray *tables_blob = tables->table_data;
      AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
      Object *vmgenid_dev;
+    Object *erst_dev;
      char *oem_id;
      char *oem_table_id;
@@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables,
 MachineState *machine)
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
Quoted 9 lines

hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2571

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+

This needs to be ifdef'd between CONFIG_ERST.

ok

Quoted 10 lines

hw/i386/acpi-microvm.c

Quoted 6 lines
hw/i386/acpi-build.c +0 -0
      vmgenid_dev = find_vmgenid_dev();
      if (vmgenid_dev) {
          acpi_add_table(table_offsets, tables_blob);
hw/i386/acpi-microvm.c +0 -0

I do not think we need to include this for microvm machines. They are supposed to have minimal ACPUI support. So lets not bloat it unless there is a specific requirement to support ERST on microvms as well.

Quoted 1 line

Would it be ok if I ifdef this on CONFIG_ERST also?

I think we should not touch microvm machine unless you can justify why you need ERST support there.

Quoted 62 lines
Quoted 61 lines
Quoted 61 lines

index 196d318..662c8ad 100644

hw/i386/acpi-microvm.c +2 -0
@@ -30,6 +30,7 @@
  #include "hw/acpi/bios-linker-loader.h"
  #include "hw/acpi/generic_event_device.h"
  #include "hw/acpi/utils.h"
+#include "hw/acpi/erst.h"
  #include "hw/i386/fw_cfg.h"
  #include "hw/i386/microvm.h"
  #include "hw/pci/pci.h"
@@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables
 *tables,
      X86MachineState *x86ms = X86_MACHINE(mms);
      GArray *table_offsets;
      GArray *tables_blob = tables->table_data;
+    Object *erst_dev;
      unsigned dsdt, xsdt;
      AcpiFadtData pmfadt = {
          /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
hw/i386/acpi-microvm.c +7 -0
@@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables
 *tables,
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
 
 
      xsdt = tables_blob->len;
      build_xsdt(tables_blob, tables->linker, table_offsets,
x86ms->oem_id,
                 x86ms->oem_table_id);
include/hw/acpi/erst.h +5 -0
index 9d63717..b747fe7 100644
@@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker,
 Object *erst_dev,
 
  #define TYPE_ACPI_ERST "acpi-erst"
 
+/* returns NULL unless there is exactly one device */
+static inline Object *find_erst_dev(void)
+{
+    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
+}

#endif
--
1.8.3.1

#12 lore raw

Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

Quoted 68 lines · Ani Sinha
Quoted 64 lines · Eric DeVolder

Ani, inline below.
eric

Quoted 39 lines · Ani Sinha
Quoted 35 lines · Eric DeVolder

This change exposes ACPI ERST support for x86 guests.

---
  hw/i386/acpi-build.c   | 9 +++++++++
  hw/i386/acpi-microvm.c | 9 +++++++++
  include/hw/acpi/erst.h | 5 +++++
  3 files changed, 23 insertions(+)
hw/i386/acpi-build.c +2 -0
index 81418b7..9c2f9d9 100644
@@ -43,6 +43,7 @@
  #include "sysemu/tpm.h"
  #include "hw/acpi/tpm.h"
  #include "hw/acpi/vmgenid.h"
+#include "hw/acpi/erst.h"
  #include "sysemu/tpm_backend.h"
  #include "hw/rtc/mc146818rtc_regs.h"
  #include "migration/vmstate.h"
@@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables,
 MachineState *machine)
      GArray *tables_blob = tables->table_data;
      AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
      Object *vmgenid_dev;
+    Object *erst_dev;
      char *oem_id;
      char *oem_table_id;
@@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables,
 MachineState *machine)
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
Quoted 9 lines

hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, MachineState *machine) · line 2571

Quoted 7 lines
hw/i386/acpi-build.c +7 -0
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+

This needs to be ifdef'd between CONFIG_ERST.

ok

Quoted 10 lines

hw/i386/acpi-microvm.c

Quoted 6 lines
hw/i386/acpi-build.c +0 -0
      vmgenid_dev = find_vmgenid_dev();
      if (vmgenid_dev) {
          acpi_add_table(table_offsets, tables_blob);
hw/i386/acpi-microvm.c +0 -0

I do not think we need to include this for microvm machines. They are supposed to have minimal ACPUI support. So lets not bloat it unless there is a specific requirement to support ERST on microvms as well.

Quoted 4 lines
Quoted 1 line

Would it be ok if I ifdef this on CONFIG_ERST also?

I think we should not touch microvm machine unless you can justify why you need ERST support there.

OTOH why not? No idea... CC microvm maintainers and let them decide.

Quoted 62 lines
Quoted 62 lines
Quoted 61 lines
Quoted 61 lines

index 196d318..662c8ad 100644

hw/i386/acpi-microvm.c +2 -0
@@ -30,6 +30,7 @@
  #include "hw/acpi/bios-linker-loader.h"
  #include "hw/acpi/generic_event_device.h"
  #include "hw/acpi/utils.h"
+#include "hw/acpi/erst.h"
  #include "hw/i386/fw_cfg.h"
  #include "hw/i386/microvm.h"
  #include "hw/pci/pci.h"
@@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables
 *tables,
      X86MachineState *x86ms = X86_MACHINE(mms);
      GArray *table_offsets;
      GArray *tables_blob = tables->table_data;
+    Object *erst_dev;
      unsigned dsdt, xsdt;
      AcpiFadtData pmfadt = {
          /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
hw/i386/acpi-microvm.c +7 -0
@@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables
 *tables,
                      ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
                      x86ms->oem_table_id);
 
+    erst_dev = find_erst_dev();
+    if (erst_dev) {
+        acpi_add_table(table_offsets, tables_blob);
+        build_erst(tables_blob, tables->linker, erst_dev,
+                   x86ms->oem_id, x86ms->oem_table_id);
+    }
+
 
 
      xsdt = tables_blob->len;
      build_xsdt(tables_blob, tables->linker, table_offsets,
x86ms->oem_id,
                 x86ms->oem_table_id);
include/hw/acpi/erst.h +5 -0
index 9d63717..b747fe7 100644
@@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker,
 Object *erst_dev,
 
  #define TYPE_ACPI_ERST "acpi-erst"
 
+/* returns NULL unless there is exactly one device */
+static inline Object *find_erst_dev(void)
+{
+    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
+}

#endif
--
1.8.3.1

#13 lore raw

Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Ani Sinha
Quoted 8 lines · Eric DeVolder

Ani, inline below.
eric

Quoted 4 lines · Ani Sinha

On Fri, 15 Oct 2021, Eric DeVolder wrote:

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

hw/i386/acpi-microvm.c

Quoted 1 line
hw/i386/acpi-microvm.c +0 -0

I do not think we need to include this for microvm machines. They are supposed to have minimal ACPUI support. So lets not bloat it unless there is a specific requirement to support ERST on microvms as well.

Would it be ok if I ifdef this on CONFIG_ERST also?

I think we should not touch microvm machine unless you can justify why you need ERST support there.

OTOH why not? No idea... CC microvm maintainers and let them decide.

I would argue that ERST support for microvm is in fact more useful than for "regular" VMs: those VMs can use EFI storage for pstore while microvms won't have that option.

-boris

#14 lore raw

PATCH v8 8/10 ACPI ERST: qtest for ERST

In reply to Eric DeVolder

This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest.

---
 tests/qtest/erst-test.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/qtest/meson.build |   2 +
 2 files changed, 169 insertions(+)
 create mode 100644 tests/qtest/erst-test.c
tests/qtest/erst-test.c new file +167 -0
new file mode 100644
index 0000000..370c119
@@ -0,0 +1,167 @@
+/*
+ * QTest testcase for acpi-erst
+ *
+ * Copyright (c) 2021 Oracle
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include <glib/gstdio.h>
+#include "libqos/libqos-pc.h"
+#include "libqos/libqtest.h"
+#include "qemu-common.h"
+
+static void save_fn(QPCIDevice *dev, int devfn, void *data)
+{
+    QPCIDevice **pdev = (QPCIDevice **) data;
+
+    *pdev = dev;
+}
+
+static QPCIDevice *get_device(QPCIBus *pcibus)
+{
+    QPCIDevice *dev;
+
+    dev = NULL;
+    qpci_device_foreach(pcibus, 0x1b36, 0x0012, save_fn, &dev);
+    g_assert(dev != NULL);
+
+    return dev;
+}
+
+typedef struct _ERSTState {
+    QOSState *qs;
+    QPCIBar reg_bar, mem_bar;
+    uint64_t reg_barsize, mem_barsize;
+    QPCIDevice *dev;
+} ERSTState;
+
+#define ACTION 0
+#define VALUE 8
+
+static const char *reg2str(unsigned reg)
+{
+    switch (reg) {
+    case 0:
+        return "ACTION";
+    case 8:
+        return "VALUE";
+    default:
+        return NULL;
+    }
+}
+
+static inline uint32_t in_reg32(ERSTState *s, unsigned reg)
+{
+    const char *name = reg2str(reg);
+    uint32_t res;
+
+    res = qpci_io_readl(s->dev, s->reg_bar, reg);
+    g_test_message("*%s -> %08x", name, res);
+
+    return res;
+}
+
+static inline uint64_t in_reg64(ERSTState *s, unsigned reg)
+{
+    const char *name = reg2str(reg);
+    uint64_t res;
+
+    res = qpci_io_readq(s->dev, s->reg_bar, reg);
+    g_test_message("*%s -> %016llx", name, (unsigned long long)res);
+
+    return res;
+}
+
+static inline void out_reg32(ERSTState *s, unsigned reg, uint32_t v)
+{
+    const char *name = reg2str(reg);
+
+    g_test_message("%08x -> *%s", v, name);
+    qpci_io_writel(s->dev, s->reg_bar, reg, v);
+}
+
+static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v)
+{
+    const char *name = reg2str(reg);
+
+    g_test_message("%016llx -> *%s", (unsigned long long)v, name);
+    qpci_io_writeq(s->dev, s->reg_bar, reg, v);
+}
+
+static void cleanup_vm(ERSTState *s)
+{
+    g_free(s->dev);
+    qtest_shutdown(s->qs);
+}
+
+static void setup_vm_cmd(ERSTState *s, const char *cmd)
+{
+    const char *arch = qtest_get_arch();
+
+    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+        s->qs = qtest_pc_boot(cmd);
+    } else {
+        g_printerr("erst-test tests are only available on x86\n");
+        exit(EXIT_FAILURE);
+    }
+    s->dev = get_device(s->qs->pcibus);
+
+    s->reg_bar = qpci_iomap(s->dev, 0, &s->reg_barsize);
+    g_assert_cmpuint(s->reg_barsize, ==, 16);
+
+    s->mem_bar = qpci_iomap(s->dev, 1, &s->mem_barsize);
+    g_assert_cmpuint(s->mem_barsize, ==, 0x2000);
+
+    qpci_device_enable(s->dev);
+}
+
+static void test_acpi_erst_basic(void)
+{
+    ERSTState state;
+    uint64_t log_address_range;
+    uint64_t log_address_length;
+    uint32_t log_address_attr;
+
+    setup_vm_cmd(&state,
+        "-object memory-backend-file,"
+            "mem-path=acpi-erst.XXXXXX,"
+            "size=64K,"
+            "share=on,"
+            "id=nvram "
+        "-device acpi-erst,"
+            "memdev=nvram");
+
+    out_reg32(&state, ACTION, 0xD);
+    log_address_range = in_reg64(&state, VALUE);
+    out_reg32(&state, ACTION, 0xE);
+    log_address_length = in_reg64(&state, VALUE);
+    out_reg32(&state, ACTION, 0xF);
+    log_address_attr = in_reg32(&state, VALUE);
+
+    /* Check log_address_range is not 0, ~0 or base */
+    g_assert_cmpuint(log_address_range, !=,  0ULL);
+    g_assert_cmpuint(log_address_range, !=, ~0ULL);
+    g_assert_cmpuint(log_address_range, !=, state.reg_bar.addr);
+    g_assert_cmpuint(log_address_range, ==, state.mem_bar.addr);
+
+    /* Check log_address_length is bar1_size */
+    g_assert_cmpuint(log_address_length, ==, state.mem_barsize);
+
+    /* Check log_address_attr is 0 */
+    g_assert_cmpuint(log_address_attr, ==, 0);
+
+    cleanup_vm(&state);
+}
+
+int main(int argc, char **argv)
+{
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_func("/acpi-erst/basic", test_acpi_erst_basic);
+    ret = g_test_run();
+    return ret;
+}
tests/qtest/meson.build +2 -0
index c9d8458..15ae6d9 100644
@@ -68,6 +68,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) +   \
   (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) +                 \
+  (config_all_devices.has_key('CONFIG_ACPI') ? ['erst-test'] : []) +                        \
   (unpack_edk2_blobs ? ['bios-tables-test'] : []) +                                         \
   qtests_pci +                                                                              \
   ['fdc-test',
@@ -246,6 +247,7 @@ qtests = {
   'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
   'cdrom-test': files('boot-sector.c'),
   'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
+  'erst-test': files('erst-test.c'),
   'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
   'migration-test': files('migration-helpers.c'),
   'pxe-test': files('boot-sector.c'),
Signature · 1 line
1.8.3.1
#15 lore raw

PATCH v8 9/10 ACPI ERST: bios-tables-test testcase

In reply to Eric DeVolder

This change implements the test suite checks for the ERST table.

---
 tests/qtest/bios-tables-test.c | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
tests/qtest/bios-tables-test.c +55 -0
index 4f11d03..617eaf6 100644
@@ -1381,6 +1381,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)
     test_acpi_tcg_acpi_hmat(MACHINE_PC);
 }
 
+static void test_acpi_erst(const char *machine)
+{
+    gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
+    gchar *params;
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = machine;
+    data.variant = ".acpierst";
+    params = g_strdup_printf(
+        " -object memory-backend-file,id=erstnvram,"
+            "mem-path=%s,size=0x10000,share=on"
+        " -device acpi-erst,memdev=erstnvram", tmp_path);
+    test_acpi_one(params, &data);
+    free_test_data(&data);
+    g_free(params);
+    g_assert(g_rmdir(tmp_path) == 0);
+    g_free(tmp_path);
+}
+
+static void test_acpi_piix4_erst(void)
+{
+    test_acpi_erst(MACHINE_PC);
+}
+
+static void test_acpi_q35_erst(void)
+{
+    test_acpi_erst(MACHINE_Q35);
+}
+
+static void test_acpi_microvm_erst(void)
+{
+    gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
+    gchar *params;
+    test_data data;
+
+    test_acpi_microvm_prepare(&data);
+    data.variant = ".pcie";
+    data.tcg_only = true; /* need constant host-phys-bits */
+    params = g_strdup_printf(" -machine microvm,"
+        "acpi=on,ioapic2=off,rtc=off,pcie=on"
+        " -object memory-backend-file,id=erstnvram,"
+           "mem-path=%s,size=0x10000,share=on"
+        " -device acpi-erst,memdev=erstnvram", tmp_path);
+    test_acpi_one(params, &data);
+    g_free(params);
+    g_assert(g_rmdir(tmp_path) == 0);
+    g_free(tmp_path);
+    free_test_data(&data);
+}
+
 static void test_acpi_virt_tcg(void)
 {
     test_data data = {
@@ -1566,7 +1617,11 @@ int main(int argc, char *argv[])
         qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm);
         if (strcmp(arch, "x86_64") == 0) {
             qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg);
+            qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_erst);
         }
+        qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_erst);
+        qtest_add_func("acpi/q35/acpierst", test_acpi_q35_erst);
+
     } else if (strcmp(arch, "aarch64") == 0) {
         qtest_add_func("acpi/virt", test_acpi_virt_tcg);
         qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
Signature · 1 line
1.8.3.1
#16 lore raw

PATCH v8 10/10 ACPI ERST: step 6 of bios-tables-test.c

In reply to Eric DeVolder

Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6.

Below is the disassembly of an ERST table, tests/data/acpi/pc/ERST. This is a PCI device and as such its base address can change; it is possible for the address fields to differ between this and other ERST tables.

[000h 0000   4]                    Signature : "ERST"    [Error Record Serialization Table]
[004h 0004   4]                 Table Length : 00000390
[008h 0008   1]                     Revision : 01
[009h 0009   1]                     Checksum : D6
[00Ah 0010   6]                       Oem ID : "BOCHS "
[010h 0016   8]                 Oem Table ID : "BXPC    "
[018h 0024   4]                 Oem Revision : 00000001
[01Ch 0028   4]              Asl Compiler ID : "BXPC"
[020h 0032   4]        Asl Compiler Revision : 00000001
[024h 0036   4]  Serialization Header Length : 00000030
[028h 0040   4]                     Reserved : 00000000
[02Ch 0044   4]      Instruction Entry Count : 0000001B
[030h 0048   1]                       Action : 00 [Begin Write Operation]
[031h 0049   1]                  Instruction : 03 [Write Register Value]
[032h 0050   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[033h 0051 1] Reserved : 00

[034h 0052 12] Register Region : [Generic Address Structure]

[034h 0052   1]                     Space ID : 00 [SystemMemory]
[035h 0053   1]                    Bit Width : 20
[036h 0054   1]                   Bit Offset : 00
[037h 0055   1]         Encoded Access Width : 03 [DWord Access:32]
[038h 0056   8]                      Address : 00000000FEBF3000

[040h 0064 8] Value : 0000000000000000
[048h 0072 8] Mask : 00000000000000FF

[050h 0080   1]                       Action : 01 [Begin Read Operation]
[051h 0081   1]                  Instruction : 03 [Write Register Value]
[052h 0082   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[053h 0083 1] Reserved : 00

[054h 0084 12] Register Region : [Generic Address Structure]

[054h 0084   1]                     Space ID : 00 [SystemMemory]
[055h 0085   1]                    Bit Width : 20
[056h 0086   1]                   Bit Offset : 00
[057h 0087   1]         Encoded Access Width : 03 [DWord Access:32]
[058h 0088   8]                      Address : 00000000FEBF3000

[060h 0096 8] Value : 0000000000000001
[068h 0104 8] Mask : 00000000000000FF

[070h 0112   1]                       Action : 02 [Begin Clear Operation]
[071h 0113   1]                  Instruction : 03 [Write Register Value]
[072h 0114   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[073h 0115 1] Reserved : 00

[074h 0116 12] Register Region : [Generic Address Structure]

[074h 0116   1]                     Space ID : 00 [SystemMemory]
[075h 0117   1]                    Bit Width : 20
[076h 0118   1]                   Bit Offset : 00
[077h 0119   1]         Encoded Access Width : 03 [DWord Access:32]
[078h 0120   8]                      Address : 00000000FEBF3000

[080h 0128 8] Value : 0000000000000002
[088h 0136 8] Mask : 00000000000000FF

[090h 0144   1]                       Action : 03 [End Operation]
[091h 0145   1]                  Instruction : 03 [Write Register Value]
[092h 0146   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[093h 0147 1] Reserved : 00

[094h 0148 12] Register Region : [Generic Address Structure]

[094h 0148   1]                     Space ID : 00 [SystemMemory]
[095h 0149   1]                    Bit Width : 20
[096h 0150   1]                   Bit Offset : 00
[097h 0151   1]         Encoded Access Width : 03 [DWord Access:32]
[098h 0152   8]                      Address : 00000000FEBF3000

[0A0h 0160 8] Value : 0000000000000003
[0A8h 0168 8] Mask : 00000000000000FF

[0B0h 0176   1]                       Action : 04 [Set Record Offset]
[0B1h 0177   1]                  Instruction : 02 [Write Register]
[0B2h 0178   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0B3h 0179 1] Reserved : 00

[0B4h 0180 12] Register Region : [Generic Address Structure]

[0B4h 0180   1]                     Space ID : 00 [SystemMemory]
[0B5h 0181   1]                    Bit Width : 20
[0B6h 0182   1]                   Bit Offset : 00
[0B7h 0183   1]         Encoded Access Width : 03 [DWord Access:32]
[0B8h 0184   8]                      Address : 00000000FEBF3008

[0C0h 0192 8] Value : 0000000000000000
[0C8h 0200 8] Mask : 00000000FFFFFFFF

[0D0h 0208   1]                       Action : 04 [Set Record Offset]
[0D1h 0209   1]                  Instruction : 03 [Write Register Value]
[0D2h 0210   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0D3h 0211 1] Reserved : 00

[0D4h 0212 12] Register Region : [Generic Address Structure]

[0D4h 0212   1]                     Space ID : 00 [SystemMemory]
[0D5h 0213   1]                    Bit Width : 20
[0D6h 0214   1]                   Bit Offset : 00
[0D7h 0215   1]         Encoded Access Width : 03 [DWord Access:32]
[0D8h 0216   8]                      Address : 00000000FEBF3000

[0E0h 0224 8] Value : 0000000000000004
[0E8h 0232 8] Mask : 00000000000000FF

[0F0h 0240   1]                       Action : 05 [Execute Operation]
[0F1h 0241   1]                  Instruction : 03 [Write Register Value]
[0F2h 0242   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0F3h 0243 1] Reserved : 00

[0F4h 0244 12] Register Region : [Generic Address Structure]

[0F4h 0244   1]                     Space ID : 00 [SystemMemory]
[0F5h 0245   1]                    Bit Width : 20
[0F6h 0246   1]                   Bit Offset : 00
[0F7h 0247   1]         Encoded Access Width : 03 [DWord Access:32]
[0F8h 0248   8]                      Address : 00000000FEBF3008

[100h 0256 8] Value : 000000000000009C
[108h 0264 8] Mask : 00000000000000FF

[110h 0272   1]                       Action : 05 [Execute Operation]
[111h 0273   1]                  Instruction : 03 [Write Register Value]
[112h 0274   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[113h 0275 1] Reserved : 00

[114h 0276 12] Register Region : [Generic Address Structure]

[114h 0276   1]                     Space ID : 00 [SystemMemory]
[115h 0277   1]                    Bit Width : 20
[116h 0278   1]                   Bit Offset : 00
[117h 0279   1]         Encoded Access Width : 03 [DWord Access:32]
[118h 0280   8]                      Address : 00000000FEBF3000

[120h 0288 8] Value : 0000000000000005
[128h 0296 8] Mask : 00000000000000FF

[130h 0304   1]                       Action : 06 [Check Busy Status]
[131h 0305   1]                  Instruction : 03 [Write Register Value]
[132h 0306   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[133h 0307 1] Reserved : 00

[134h 0308 12] Register Region : [Generic Address Structure]

[134h 0308   1]                     Space ID : 00 [SystemMemory]
[135h 0309   1]                    Bit Width : 20
[136h 0310   1]                   Bit Offset : 00
[137h 0311   1]         Encoded Access Width : 03 [DWord Access:32]
[138h 0312   8]                      Address : 00000000FEBF3000

[140h 0320 8] Value : 0000000000000006
[148h 0328 8] Mask : 00000000000000FF

[150h 0336   1]                       Action : 06 [Check Busy Status]
[151h 0337   1]                  Instruction : 01 [Read Register Value]
[152h 0338   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[153h 0339 1] Reserved : 00

[154h 0340 12] Register Region : [Generic Address Structure]

[154h 0340   1]                     Space ID : 00 [SystemMemory]
[155h 0341   1]                    Bit Width : 20
[156h 0342   1]                   Bit Offset : 00
[157h 0343   1]         Encoded Access Width : 03 [DWord Access:32]
[158h 0344   8]                      Address : 00000000FEBF3008

[160h 0352 8] Value : 0000000000000001
[168h 0360 8] Mask : 00000000000000FF

[170h 0368   1]                       Action : 07 [Get Command Status]
[171h 0369   1]                  Instruction : 03 [Write Register Value]
[172h 0370   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[173h 0371 1] Reserved : 00

[174h 0372 12] Register Region : [Generic Address Structure]

[174h 0372   1]                     Space ID : 00 [SystemMemory]
[175h 0373   1]                    Bit Width : 20
[176h 0374   1]                   Bit Offset : 00
[177h 0375   1]         Encoded Access Width : 03 [DWord Access:32]
[178h 0376   8]                      Address : 00000000FEBF3000

[180h 0384 8] Value : 0000000000000007
[188h 0392 8] Mask : 00000000000000FF

[190h 0400   1]                       Action : 07 [Get Command Status]
[191h 0401   1]                  Instruction : 00 [Read Register]
[192h 0402   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[193h 0403 1] Reserved : 00

[194h 0404 12] Register Region : [Generic Address Structure]

[194h 0404   1]                     Space ID : 00 [SystemMemory]
[195h 0405   1]                    Bit Width : 20
[196h 0406   1]                   Bit Offset : 00
[197h 0407   1]         Encoded Access Width : 03 [DWord Access:32]
[198h 0408   8]                      Address : 00000000FEBF3008

[1A0h 0416 8] Value : 0000000000000000
[1A8h 0424 8] Mask : 00000000000000FF

[1B0h 0432   1]                       Action : 08 [Get Record Identifier]
[1B1h 0433   1]                  Instruction : 03 [Write Register Value]
[1B2h 0434   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1B3h 0435 1] Reserved : 00

[1B4h 0436 12] Register Region : [Generic Address Structure]

[1B4h 0436   1]                     Space ID : 00 [SystemMemory]
[1B5h 0437   1]                    Bit Width : 20
[1B6h 0438   1]                   Bit Offset : 00
[1B7h 0439   1]         Encoded Access Width : 03 [DWord Access:32]
[1B8h 0440   8]                      Address : 00000000FEBF3000

[1C0h 0448 8] Value : 0000000000000008
[1C8h 0456 8] Mask : 00000000000000FF

[1D0h 0464   1]                       Action : 08 [Get Record Identifier]
[1D1h 0465   1]                  Instruction : 00 [Read Register]
[1D2h 0466   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1D3h 0467 1] Reserved : 00

[1D4h 0468 12] Register Region : [Generic Address Structure]

[1D4h 0468   1]                     Space ID : 00 [SystemMemory]
[1D5h 0469   1]                    Bit Width : 40
[1D6h 0470   1]                   Bit Offset : 00
[1D7h 0471   1]         Encoded Access Width : 04 [QWord Access:64]
[1D8h 0472   8]                      Address : 00000000FEBF3008

[1E0h 0480 8] Value : 0000000000000000
[1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF

[1F0h 0496   1]                       Action : 09 [Set Record Identifier]
[1F1h 0497   1]                  Instruction : 02 [Write Register]
[1F2h 0498   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1F3h 0499 1] Reserved : 00

[1F4h 0500 12] Register Region : [Generic Address Structure]

[1F4h 0500   1]                     Space ID : 00 [SystemMemory]
[1F5h 0501   1]                    Bit Width : 40
[1F6h 0502   1]                   Bit Offset : 00
[1F7h 0503   1]         Encoded Access Width : 04 [QWord Access:64]
[1F8h 0504   8]                      Address : 00000000FEBF3008

[200h 0512 8] Value : 0000000000000000
[208h 0520 8] Mask : FFFFFFFFFFFFFFFF

[210h 0528   1]                       Action : 09 [Set Record Identifier]
[211h 0529   1]                  Instruction : 03 [Write Register Value]
[212h 0530   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[213h 0531 1] Reserved : 00

[214h 0532 12] Register Region : [Generic Address Structure]

[214h 0532   1]                     Space ID : 00 [SystemMemory]
[215h 0533   1]                    Bit Width : 20
[216h 0534   1]                   Bit Offset : 00
[217h 0535   1]         Encoded Access Width : 03 [DWord Access:32]
[218h 0536   8]                      Address : 00000000FEBF3000

[220h 0544 8] Value : 0000000000000009
[228h 0552 8] Mask : 00000000000000FF

[230h 0560   1]                       Action : 0A [Get Record Count]
[231h 0561   1]                  Instruction : 03 [Write Register Value]
[232h 0562   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[233h 0563 1] Reserved : 00

[234h 0564 12] Register Region : [Generic Address Structure]

[234h 0564   1]                     Space ID : 00 [SystemMemory]
[235h 0565   1]                    Bit Width : 20
[236h 0566   1]                   Bit Offset : 00
[237h 0567   1]         Encoded Access Width : 03 [DWord Access:32]
[238h 0568   8]                      Address : 00000000FEBF3000

[240h 0576 8] Value : 000000000000000A
[248h 0584 8] Mask : 00000000000000FF

[250h 0592   1]                       Action : 0A [Get Record Count]
[251h 0593   1]                  Instruction : 00 [Read Register]
[252h 0594   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[253h 0595 1] Reserved : 00

[254h 0596 12] Register Region : [Generic Address Structure]

[254h 0596   1]                     Space ID : 00 [SystemMemory]
[255h 0597   1]                    Bit Width : 20
[256h 0598   1]                   Bit Offset : 00
[257h 0599   1]         Encoded Access Width : 03 [DWord Access:32]
[258h 0600   8]                      Address : 00000000FEBF3008

[260h 0608 8] Value : 0000000000000000
[268h 0616 8] Mask : 00000000FFFFFFFF

[270h 0624   1]                       Action : 0B [Begin Dummy Write]
[271h 0625   1]                  Instruction : 03 [Write Register Value]
[272h 0626   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[273h 0627 1] Reserved : 00

[274h 0628 12] Register Region : [Generic Address Structure]

[274h 0628   1]                     Space ID : 00 [SystemMemory]
[275h 0629   1]                    Bit Width : 20
[276h 0630   1]                   Bit Offset : 00
[277h 0631   1]         Encoded Access Width : 03 [DWord Access:32]
[278h 0632   8]                      Address : 00000000FEBF3000

[280h 0640 8] Value : 000000000000000B
[288h 0648 8] Mask : 00000000000000FF

[290h 0656   1]                       Action : 0D [Get Error Address Range]
[291h 0657   1]                  Instruction : 03 [Write Register Value]
[292h 0658   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[293h 0659 1] Reserved : 00

[294h 0660 12] Register Region : [Generic Address Structure]

[294h 0660   1]                     Space ID : 00 [SystemMemory]
[295h 0661   1]                    Bit Width : 20
[296h 0662   1]                   Bit Offset : 00
[297h 0663   1]         Encoded Access Width : 03 [DWord Access:32]
[298h 0664   8]                      Address : 00000000FEBF3000

[2A0h 0672 8] Value : 000000000000000D
[2A8h 0680 8] Mask : 00000000000000FF

[2B0h 0688   1]                       Action : 0D [Get Error Address Range]
[2B1h 0689   1]                  Instruction : 00 [Read Register]
[2B2h 0690   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2B3h 0691 1] Reserved : 00

[2B4h 0692 12] Register Region : [Generic Address Structure]

[2B4h 0692   1]                     Space ID : 00 [SystemMemory]
[2B5h 0693   1]                    Bit Width : 40
[2B6h 0694   1]                   Bit Offset : 00
[2B7h 0695   1]         Encoded Access Width : 04 [QWord Access:64]
[2B8h 0696   8]                      Address : 00000000FEBF3008

[2C0h 0704 8] Value : 0000000000000000
[2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF

[2D0h 0720   1]                       Action : 0E [Get Error Address Length]
[2D1h 0721   1]                  Instruction : 03 [Write Register Value]
[2D2h 0722   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2D3h 0723 1] Reserved : 00

[2D4h 0724 12] Register Region : [Generic Address Structure]

[2D4h 0724   1]                     Space ID : 00 [SystemMemory]
[2D5h 0725   1]                    Bit Width : 20
[2D6h 0726   1]                   Bit Offset : 00
[2D7h 0727   1]         Encoded Access Width : 03 [DWord Access:32]
[2D8h 0728   8]                      Address : 00000000FEBF3000

[2E0h 0736 8] Value : 000000000000000E
[2E8h 0744 8] Mask : 00000000000000FF

[2F0h 0752   1]                       Action : 0E [Get Error Address Length]
[2F1h 0753   1]                  Instruction : 00 [Read Register]
[2F2h 0754   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2F3h 0755 1] Reserved : 00

[2F4h 0756 12] Register Region : [Generic Address Structure]

[2F4h 0756   1]                     Space ID : 00 [SystemMemory]
[2F5h 0757   1]                    Bit Width : 40
[2F6h 0758   1]                   Bit Offset : 00
[2F7h 0759   1]         Encoded Access Width : 04 [QWord Access:64]
[2F8h 0760   8]                      Address : 00000000FEBF3008

[300h 0768 8] Value : 0000000000000000
[308h 0776 8] Mask : 00000000FFFFFFFF

[310h 0784   1]                       Action : 0F [Get Error Attributes]
[311h 0785   1]                  Instruction : 03 [Write Register Value]
[312h 0786   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[313h 0787 1] Reserved : 00

[314h 0788 12] Register Region : [Generic Address Structure]

[314h 0788   1]                     Space ID : 00 [SystemMemory]
[315h 0789   1]                    Bit Width : 20
[316h 0790   1]                   Bit Offset : 00
[317h 0791   1]         Encoded Access Width : 03 [DWord Access:32]
[318h 0792   8]                      Address : 00000000FEBF3000

[320h 0800 8] Value : 000000000000000F
[328h 0808 8] Mask : 00000000000000FF

[330h 0816   1]                       Action : 0F [Get Error Attributes]
[331h 0817   1]                  Instruction : 00 [Read Register]
[332h 0818   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[333h 0819 1] Reserved : 00

[334h 0820 12] Register Region : [Generic Address Structure]

[334h 0820   1]                     Space ID : 00 [SystemMemory]
[335h 0821   1]                    Bit Width : 20
[336h 0822   1]                   Bit Offset : 00
[337h 0823   1]         Encoded Access Width : 03 [DWord Access:32]
[338h 0824   8]                      Address : 00000000FEBF3008

[340h 0832 8] Value : 0000000000000000
[348h 0840 8] Mask : 00000000FFFFFFFF

[350h 0848   1]                       Action : 10 [Execute Timings]
[351h 0849   1]                  Instruction : 03 [Write Register Value]
[352h 0850   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[353h 0851 1] Reserved : 00

[354h 0852 12] Register Region : [Generic Address Structure]

[354h 0852   1]                     Space ID : 00 [SystemMemory]
[355h 0853   1]                    Bit Width : 20
[356h 0854   1]                   Bit Offset : 00
[357h 0855   1]         Encoded Access Width : 03 [DWord Access:32]
[358h 0856   8]                      Address : 00000000FEBF3000

[360h 0864 8] Value : 0000000000000010
[368h 0872 8] Mask : 00000000000000FF

[370h 0880   1]                       Action : 10 [Execute Timings]
[371h 0881   1]                  Instruction : 00 [Read Register]
[372h 0882   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[373h 0883 1] Reserved : 00

[374h 0884 12] Register Region : [Generic Address Structure]

[374h 0884   1]                     Space ID : 00 [SystemMemory]
[375h 0885   1]                    Bit Width : 40
[376h 0886   1]                   Bit Offset : 00
[377h 0887   1]         Encoded Access Width : 04 [QWord Access:64]
[378h 0888   8]                      Address : 00000000FEBF3008

[380h 0896 8] Value : 0000000000000000
[388h 0904 8] Mask : FFFFFFFFFFFFFFFF

And the diff of DSDT (note this seems to suggest that some other device is omitted from the .acpierst configuration, but otherwise DSDT is unchanged).

--- dsdt-noacpierst.dsl 2021-10-14 15:44:13.000000000 -0400
+++ dsdt-acpierst.dsl 2021-10-14 15:47:14.000000000 -0400
@@ -5,13 +5,13 @@
*
* Disassembling to symbolic ASL+ operators
*
- * Disassembly of tests/data/acpi/pc/DSDT, Thu Oct 14 15:44:13 2021
+ * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Oct 14 15:47:14 2021 *
* Original Table Header:

  *     Signature        "DSDT"
- *     Length           0x00001772 (6002)
+ *     Length           0x00001751 (5969)
  *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
- *     Checksum         0x9E
+ *     Checksum         0x95
  *     OEM ID           "BOCHS "
  *     OEM Table ID     "BXPC    "
  *     OEM Revision     0x00000001 (1)

@@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "

             Device (S18)
             {
-                Name (_SUN, 0x03)  // _SUN: Slot User Number
                 Name (_ADR, 0x00030000)  // _ADR: Address

- Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device
- {
- PCEJ (BSEL, _SUN)
- }
-
+ Name (ASUN, 0x03)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))

                 }
             }

@@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "

Method (DVNT, 2, NotSerialized)
{
- If ((Arg0 & 0x08))
- {
- Notify (S18, Arg1)
- }
-

                 If ((Arg0 & 0x10))
                 {
                     Notify (S20, Arg1)
---
 tests/data/acpi/microvm/ERST.pcie           | Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 0 -> 5969 bytes
 tests/data/acpi/q35/DSDT.acpierst           | Bin 0 -> 8306 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   5 -----
 4 files changed, 5 deletions(-)
tests/data/acpi/microvm/ERST.pcie binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bb0593eeb8730d51a6f0fe51a00a00df9c83c419 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b0eafe90e5832935557ec5e6802c0147c88f379c 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
index c06241a..dfb8523 100644
@@ -1,6 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/ERST",
-"tests/data/acpi/q35/DSDT.acpierst",
-"tests/data/acpi/q35/ERST",
-"tests/data/acpi/microvm/ERST.pcie",
Signature · 1 line
1.8.3.1
#17 lore raw

Re: [PATCH v8 10/10] ACPI ERST: step 6 of bios-tables-test.c

Quoted 451 lines · Eric DeVolder

Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6.

Below is the disassembly of an ERST table, tests/data/acpi/pc/ERST. This is a PCI device and as such its base address can change; it is possible for the address fields to differ between this and other ERST tables.

[000h 0000   4]                    Signature : "ERST"    [Error Record Serialization Table]
[004h 0004   4]                 Table Length : 00000390
[008h 0008   1]                     Revision : 01
[009h 0009   1]                     Checksum : D6
[00Ah 0010   6]                       Oem ID : "BOCHS "
[010h 0016   8]                 Oem Table ID : "BXPC    "
[018h 0024   4]                 Oem Revision : 00000001
[01Ch 0028   4]              Asl Compiler ID : "BXPC"
[020h 0032   4]        Asl Compiler Revision : 00000001
[024h 0036   4]  Serialization Header Length : 00000030
[028h 0040   4]                     Reserved : 00000000
[02Ch 0044   4]      Instruction Entry Count : 0000001B
[030h 0048   1]                       Action : 00 [Begin Write Operation]
[031h 0049   1]                  Instruction : 03 [Write Register Value]
[032h 0050   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[033h 0051 1] Reserved : 00

[034h 0052 12] Register Region : [Generic Address Structure]

[034h 0052   1]                     Space ID : 00 [SystemMemory]
[035h 0053   1]                    Bit Width : 20
[036h 0054   1]                   Bit Offset : 00
[037h 0055   1]         Encoded Access Width : 03 [DWord Access:32]
[038h 0056   8]                      Address : 00000000FEBF3000

[040h 0064 8] Value : 0000000000000000
[048h 0072 8] Mask : 00000000000000FF

[050h 0080   1]                       Action : 01 [Begin Read Operation]
[051h 0081   1]                  Instruction : 03 [Write Register Value]
[052h 0082   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[053h 0083 1] Reserved : 00

[054h 0084 12] Register Region : [Generic Address Structure]

[054h 0084   1]                     Space ID : 00 [SystemMemory]
[055h 0085   1]                    Bit Width : 20
[056h 0086   1]                   Bit Offset : 00
[057h 0087   1]         Encoded Access Width : 03 [DWord Access:32]
[058h 0088   8]                      Address : 00000000FEBF3000

[060h 0096 8] Value : 0000000000000001
[068h 0104 8] Mask : 00000000000000FF

[070h 0112   1]                       Action : 02 [Begin Clear Operation]
[071h 0113   1]                  Instruction : 03 [Write Register Value]
[072h 0114   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[073h 0115 1] Reserved : 00

[074h 0116 12] Register Region : [Generic Address Structure]

[074h 0116   1]                     Space ID : 00 [SystemMemory]
[075h 0117   1]                    Bit Width : 20
[076h 0118   1]                   Bit Offset : 00
[077h 0119   1]         Encoded Access Width : 03 [DWord Access:32]
[078h 0120   8]                      Address : 00000000FEBF3000

[080h 0128 8] Value : 0000000000000002
[088h 0136 8] Mask : 00000000000000FF

[090h 0144   1]                       Action : 03 [End Operation]
[091h 0145   1]                  Instruction : 03 [Write Register Value]
[092h 0146   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[093h 0147 1] Reserved : 00

[094h 0148 12] Register Region : [Generic Address Structure]

[094h 0148   1]                     Space ID : 00 [SystemMemory]
[095h 0149   1]                    Bit Width : 20
[096h 0150   1]                   Bit Offset : 00
[097h 0151   1]         Encoded Access Width : 03 [DWord Access:32]
[098h 0152   8]                      Address : 00000000FEBF3000

[0A0h 0160 8] Value : 0000000000000003
[0A8h 0168 8] Mask : 00000000000000FF

[0B0h 0176   1]                       Action : 04 [Set Record Offset]
[0B1h 0177   1]                  Instruction : 02 [Write Register]
[0B2h 0178   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0B3h 0179 1] Reserved : 00

[0B4h 0180 12] Register Region : [Generic Address Structure]

[0B4h 0180   1]                     Space ID : 00 [SystemMemory]
[0B5h 0181   1]                    Bit Width : 20
[0B6h 0182   1]                   Bit Offset : 00
[0B7h 0183   1]         Encoded Access Width : 03 [DWord Access:32]
[0B8h 0184   8]                      Address : 00000000FEBF3008

[0C0h 0192 8] Value : 0000000000000000
[0C8h 0200 8] Mask : 00000000FFFFFFFF

[0D0h 0208   1]                       Action : 04 [Set Record Offset]
[0D1h 0209   1]                  Instruction : 03 [Write Register Value]
[0D2h 0210   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0D3h 0211 1] Reserved : 00

[0D4h 0212 12] Register Region : [Generic Address Structure]

[0D4h 0212   1]                     Space ID : 00 [SystemMemory]
[0D5h 0213   1]                    Bit Width : 20
[0D6h 0214   1]                   Bit Offset : 00
[0D7h 0215   1]         Encoded Access Width : 03 [DWord Access:32]
[0D8h 0216   8]                      Address : 00000000FEBF3000

[0E0h 0224 8] Value : 0000000000000004
[0E8h 0232 8] Mask : 00000000000000FF

[0F0h 0240   1]                       Action : 05 [Execute Operation]
[0F1h 0241   1]                  Instruction : 03 [Write Register Value]
[0F2h 0242   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0F3h 0243 1] Reserved : 00

[0F4h 0244 12] Register Region : [Generic Address Structure]

[0F4h 0244   1]                     Space ID : 00 [SystemMemory]
[0F5h 0245   1]                    Bit Width : 20
[0F6h 0246   1]                   Bit Offset : 00
[0F7h 0247   1]         Encoded Access Width : 03 [DWord Access:32]
[0F8h 0248   8]                      Address : 00000000FEBF3008

[100h 0256 8] Value : 000000000000009C
[108h 0264 8] Mask : 00000000000000FF

[110h 0272   1]                       Action : 05 [Execute Operation]
[111h 0273   1]                  Instruction : 03 [Write Register Value]
[112h 0274   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[113h 0275 1] Reserved : 00

[114h 0276 12] Register Region : [Generic Address Structure]

[114h 0276   1]                     Space ID : 00 [SystemMemory]
[115h 0277   1]                    Bit Width : 20
[116h 0278   1]                   Bit Offset : 00
[117h 0279   1]         Encoded Access Width : 03 [DWord Access:32]
[118h 0280   8]                      Address : 00000000FEBF3000

[120h 0288 8] Value : 0000000000000005
[128h 0296 8] Mask : 00000000000000FF

[130h 0304   1]                       Action : 06 [Check Busy Status]
[131h 0305   1]                  Instruction : 03 [Write Register Value]
[132h 0306   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[133h 0307 1] Reserved : 00

[134h 0308 12] Register Region : [Generic Address Structure]

[134h 0308   1]                     Space ID : 00 [SystemMemory]
[135h 0309   1]                    Bit Width : 20
[136h 0310   1]                   Bit Offset : 00
[137h 0311   1]         Encoded Access Width : 03 [DWord Access:32]
[138h 0312   8]                      Address : 00000000FEBF3000

[140h 0320 8] Value : 0000000000000006
[148h 0328 8] Mask : 00000000000000FF

[150h 0336   1]                       Action : 06 [Check Busy Status]
[151h 0337   1]                  Instruction : 01 [Read Register Value]
[152h 0338   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[153h 0339 1] Reserved : 00

[154h 0340 12] Register Region : [Generic Address Structure]

[154h 0340   1]                     Space ID : 00 [SystemMemory]
[155h 0341   1]                    Bit Width : 20
[156h 0342   1]                   Bit Offset : 00
[157h 0343   1]         Encoded Access Width : 03 [DWord Access:32]
[158h 0344   8]                      Address : 00000000FEBF3008

[160h 0352 8] Value : 0000000000000001
[168h 0360 8] Mask : 00000000000000FF

[170h 0368   1]                       Action : 07 [Get Command Status]
[171h 0369   1]                  Instruction : 03 [Write Register Value]
[172h 0370   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[173h 0371 1] Reserved : 00

[174h 0372 12] Register Region : [Generic Address Structure]

[174h 0372   1]                     Space ID : 00 [SystemMemory]
[175h 0373   1]                    Bit Width : 20
[176h 0374   1]                   Bit Offset : 00
[177h 0375   1]         Encoded Access Width : 03 [DWord Access:32]
[178h 0376   8]                      Address : 00000000FEBF3000

[180h 0384 8] Value : 0000000000000007
[188h 0392 8] Mask : 00000000000000FF

[190h 0400   1]                       Action : 07 [Get Command Status]
[191h 0401   1]                  Instruction : 00 [Read Register]
[192h 0402   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[193h 0403 1] Reserved : 00

[194h 0404 12] Register Region : [Generic Address Structure]

[194h 0404   1]                     Space ID : 00 [SystemMemory]
[195h 0405   1]                    Bit Width : 20
[196h 0406   1]                   Bit Offset : 00
[197h 0407   1]         Encoded Access Width : 03 [DWord Access:32]
[198h 0408   8]                      Address : 00000000FEBF3008

[1A0h 0416 8] Value : 0000000000000000
[1A8h 0424 8] Mask : 00000000000000FF

[1B0h 0432   1]                       Action : 08 [Get Record Identifier]
[1B1h 0433   1]                  Instruction : 03 [Write Register Value]
[1B2h 0434   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1B3h 0435 1] Reserved : 00

[1B4h 0436 12] Register Region : [Generic Address Structure]

[1B4h 0436   1]                     Space ID : 00 [SystemMemory]
[1B5h 0437   1]                    Bit Width : 20
[1B6h 0438   1]                   Bit Offset : 00
[1B7h 0439   1]         Encoded Access Width : 03 [DWord Access:32]
[1B8h 0440   8]                      Address : 00000000FEBF3000

[1C0h 0448 8] Value : 0000000000000008
[1C8h 0456 8] Mask : 00000000000000FF

[1D0h 0464   1]                       Action : 08 [Get Record Identifier]
[1D1h 0465   1]                  Instruction : 00 [Read Register]
[1D2h 0466   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1D3h 0467 1] Reserved : 00

[1D4h 0468 12] Register Region : [Generic Address Structure]

[1D4h 0468   1]                     Space ID : 00 [SystemMemory]
[1D5h 0469   1]                    Bit Width : 40
[1D6h 0470   1]                   Bit Offset : 00
[1D7h 0471   1]         Encoded Access Width : 04 [QWord Access:64]
[1D8h 0472   8]                      Address : 00000000FEBF3008

[1E0h 0480 8] Value : 0000000000000000
[1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF

[1F0h 0496   1]                       Action : 09 [Set Record Identifier]
[1F1h 0497   1]                  Instruction : 02 [Write Register]
[1F2h 0498   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1F3h 0499 1] Reserved : 00

[1F4h 0500 12] Register Region : [Generic Address Structure]

[1F4h 0500   1]                     Space ID : 00 [SystemMemory]
[1F5h 0501   1]                    Bit Width : 40
[1F6h 0502   1]                   Bit Offset : 00
[1F7h 0503   1]         Encoded Access Width : 04 [QWord Access:64]
[1F8h 0504   8]                      Address : 00000000FEBF3008

[200h 0512 8] Value : 0000000000000000
[208h 0520 8] Mask : FFFFFFFFFFFFFFFF

[210h 0528   1]                       Action : 09 [Set Record Identifier]
[211h 0529   1]                  Instruction : 03 [Write Register Value]
[212h 0530   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[213h 0531 1] Reserved : 00

[214h 0532 12] Register Region : [Generic Address Structure]

[214h 0532   1]                     Space ID : 00 [SystemMemory]
[215h 0533   1]                    Bit Width : 20
[216h 0534   1]                   Bit Offset : 00
[217h 0535   1]         Encoded Access Width : 03 [DWord Access:32]
[218h 0536   8]                      Address : 00000000FEBF3000

[220h 0544 8] Value : 0000000000000009
[228h 0552 8] Mask : 00000000000000FF

[230h 0560   1]                       Action : 0A [Get Record Count]
[231h 0561   1]                  Instruction : 03 [Write Register Value]
[232h 0562   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[233h 0563 1] Reserved : 00

[234h 0564 12] Register Region : [Generic Address Structure]

[234h 0564   1]                     Space ID : 00 [SystemMemory]
[235h 0565   1]                    Bit Width : 20
[236h 0566   1]                   Bit Offset : 00
[237h 0567   1]         Encoded Access Width : 03 [DWord Access:32]
[238h 0568   8]                      Address : 00000000FEBF3000

[240h 0576 8] Value : 000000000000000A
[248h 0584 8] Mask : 00000000000000FF

[250h 0592   1]                       Action : 0A [Get Record Count]
[251h 0593   1]                  Instruction : 00 [Read Register]
[252h 0594   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[253h 0595 1] Reserved : 00

[254h 0596 12] Register Region : [Generic Address Structure]

[254h 0596   1]                     Space ID : 00 [SystemMemory]
[255h 0597   1]                    Bit Width : 20
[256h 0598   1]                   Bit Offset : 00
[257h 0599   1]         Encoded Access Width : 03 [DWord Access:32]
[258h 0600   8]                      Address : 00000000FEBF3008

[260h 0608 8] Value : 0000000000000000
[268h 0616 8] Mask : 00000000FFFFFFFF

[270h 0624   1]                       Action : 0B [Begin Dummy Write]
[271h 0625   1]                  Instruction : 03 [Write Register Value]
[272h 0626   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[273h 0627 1] Reserved : 00

[274h 0628 12] Register Region : [Generic Address Structure]

[274h 0628   1]                     Space ID : 00 [SystemMemory]
[275h 0629   1]                    Bit Width : 20
[276h 0630   1]                   Bit Offset : 00
[277h 0631   1]         Encoded Access Width : 03 [DWord Access:32]
[278h 0632   8]                      Address : 00000000FEBF3000

[280h 0640 8] Value : 000000000000000B
[288h 0648 8] Mask : 00000000000000FF

[290h 0656   1]                       Action : 0D [Get Error Address Range]
[291h 0657   1]                  Instruction : 03 [Write Register Value]
[292h 0658   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[293h 0659 1] Reserved : 00

[294h 0660 12] Register Region : [Generic Address Structure]

[294h 0660   1]                     Space ID : 00 [SystemMemory]
[295h 0661   1]                    Bit Width : 20
[296h 0662   1]                   Bit Offset : 00
[297h 0663   1]         Encoded Access Width : 03 [DWord Access:32]
[298h 0664   8]                      Address : 00000000FEBF3000

[2A0h 0672 8] Value : 000000000000000D
[2A8h 0680 8] Mask : 00000000000000FF

[2B0h 0688   1]                       Action : 0D [Get Error Address Range]
[2B1h 0689   1]                  Instruction : 00 [Read Register]
[2B2h 0690   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2B3h 0691 1] Reserved : 00

[2B4h 0692 12] Register Region : [Generic Address Structure]

[2B4h 0692   1]                     Space ID : 00 [SystemMemory]
[2B5h 0693   1]                    Bit Width : 40
[2B6h 0694   1]                   Bit Offset : 00
[2B7h 0695   1]         Encoded Access Width : 04 [QWord Access:64]
[2B8h 0696   8]                      Address : 00000000FEBF3008

[2C0h 0704 8] Value : 0000000000000000
[2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF

[2D0h 0720   1]                       Action : 0E [Get Error Address Length]
[2D1h 0721   1]                  Instruction : 03 [Write Register Value]
[2D2h 0722   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2D3h 0723 1] Reserved : 00

[2D4h 0724 12] Register Region : [Generic Address Structure]

[2D4h 0724   1]                     Space ID : 00 [SystemMemory]
[2D5h 0725   1]                    Bit Width : 20
[2D6h 0726   1]                   Bit Offset : 00
[2D7h 0727   1]         Encoded Access Width : 03 [DWord Access:32]
[2D8h 0728   8]                      Address : 00000000FEBF3000

[2E0h 0736 8] Value : 000000000000000E
[2E8h 0744 8] Mask : 00000000000000FF

[2F0h 0752   1]                       Action : 0E [Get Error Address Length]
[2F1h 0753   1]                  Instruction : 00 [Read Register]
[2F2h 0754   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2F3h 0755 1] Reserved : 00

[2F4h 0756 12] Register Region : [Generic Address Structure]

[2F4h 0756   1]                     Space ID : 00 [SystemMemory]
[2F5h 0757   1]                    Bit Width : 40
[2F6h 0758   1]                   Bit Offset : 00
[2F7h 0759   1]         Encoded Access Width : 04 [QWord Access:64]
[2F8h 0760   8]                      Address : 00000000FEBF3008

[300h 0768 8] Value : 0000000000000000
[308h 0776 8] Mask : 00000000FFFFFFFF

[310h 0784   1]                       Action : 0F [Get Error Attributes]
[311h 0785   1]                  Instruction : 03 [Write Register Value]
[312h 0786   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[313h 0787 1] Reserved : 00

[314h 0788 12] Register Region : [Generic Address Structure]

[314h 0788   1]                     Space ID : 00 [SystemMemory]
[315h 0789   1]                    Bit Width : 20
[316h 0790   1]                   Bit Offset : 00
[317h 0791   1]         Encoded Access Width : 03 [DWord Access:32]
[318h 0792   8]                      Address : 00000000FEBF3000

[320h 0800 8] Value : 000000000000000F
[328h 0808 8] Mask : 00000000000000FF

[330h 0816   1]                       Action : 0F [Get Error Attributes]
[331h 0817   1]                  Instruction : 00 [Read Register]
[332h 0818   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[333h 0819 1] Reserved : 00

[334h 0820 12] Register Region : [Generic Address Structure]

[334h 0820   1]                     Space ID : 00 [SystemMemory]
[335h 0821   1]                    Bit Width : 20
[336h 0822   1]                   Bit Offset : 00
[337h 0823   1]         Encoded Access Width : 03 [DWord Access:32]
[338h 0824   8]                      Address : 00000000FEBF3008

[340h 0832 8] Value : 0000000000000000
[348h 0840 8] Mask : 00000000FFFFFFFF

[350h 0848   1]                       Action : 10 [Execute Timings]
[351h 0849   1]                  Instruction : 03 [Write Register Value]
[352h 0850   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[353h 0851 1] Reserved : 00

[354h 0852 12] Register Region : [Generic Address Structure]

[354h 0852   1]                     Space ID : 00 [SystemMemory]
[355h 0853   1]                    Bit Width : 20
[356h 0854   1]                   Bit Offset : 00
[357h 0855   1]         Encoded Access Width : 03 [DWord Access:32]
[358h 0856   8]                      Address : 00000000FEBF3000

[360h 0864 8] Value : 0000000000000010
[368h 0872 8] Mask : 00000000000000FF

[370h 0880   1]                       Action : 10 [Execute Timings]
[371h 0881   1]                  Instruction : 00 [Read Register]
[372h 0882   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[373h 0883 1] Reserved : 00

[374h 0884 12] Register Region : [Generic Address Structure]

[374h 0884   1]                     Space ID : 00 [SystemMemory]
[375h 0885   1]                    Bit Width : 40
[376h 0886   1]                   Bit Offset : 00
[377h 0887   1]         Encoded Access Width : 04 [QWord Access:64]
[378h 0888   8]                      Address : 00000000FEBF3008
Quoted 6 lines

[380h 0896 8] Value : 0000000000000000
[388h 0904 8] Mask : FFFFFFFFFFFFFFFF

And the diff of DSDT (note this seems to suggest that some other device is omitted from the .acpierst configuration, but otherwise DSDT is unchanged).

We need to understand why we see these changes in the DSDT table.

Quoted 200 lines

--- dsdt-noacpierst.dsl 2021-10-14 15:44:13.000000000 -0400
+++ dsdt-acpierst.dsl 2021-10-14 15:47:14.000000000 -0400

(quoted diff) +5 -15
@@ -5,13 +5,13 @@
  *
  * Disassembling to symbolic ASL+ operators
  *
- * Disassembly of tests/data/acpi/pc/DSDT, Thu Oct 14 15:44:13 2021
+ * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Oct 14 15:47:14 2021
  *
  * Original Table Header:
  *     Signature        "DSDT"
- *     Length           0x00001772 (6002)
+ *     Length           0x00001751 (5969)
  *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
- *     Checksum         0x9E
+ *     Checksum         0x95
  *     OEM ID           "BOCHS "
  *     OEM Table ID     "BXPC    "
  *     OEM Revision     0x00000001 (1)
@@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "
 
             Device (S18)
             {
-                Name (_SUN, 0x03)  // _SUN: Slot User Number
                 Name (_ADR, 0x00030000)  // _ADR: Address
-                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                {
-                    PCEJ (BSEL, _SUN)
-                }
-
+                Name (ASUN, 0x03)
                 Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                 {
-                    Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+                    Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))
                 }
             }
 
@@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "
 
             Method (DVNT, 2, NotSerialized)
             {
-                If ((Arg0 & 0x08))
-                {
-                    Notify (S18, Arg1)
-                }
-
                 If ((Arg0 & 0x10))
                 {
                     Notify (S20, Arg1)
---
 tests/data/acpi/microvm/ERST.pcie           | Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 0 -> 5969 bytes
 tests/data/acpi/q35/DSDT.acpierst           | Bin 0 -> 8306 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   5 -----
 4 files changed, 5 deletions(-)
tests/data/acpi/microvm/ERST.pcie binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bb0593eeb8730d51a6f0fe51a00a00df9c83c419 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b0eafe90e5832935557ec5e6802c0147c88f379c 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -0
index c06241a..dfb8523 100644

tests/qtest/bios-tables-test-allowed-diff.h line 6

Quoted 6 lines
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
@@ -1,6 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/ERST",
-"tests/data/acpi/q35/DSDT.acpierst",
-"tests/data/acpi/q35/ERST",
-"tests/data/acpi/microvm/ERST.pcie",

What about the blobs for :

tests/data/acpi/pc/ERST
tests/data/acpi/q35/ERST
since you have indicated above that these tables are also modified ?

You have only added blobs for the following tables:

Quoted 3 lines
 tests/data/acpi/microvm/ERST.pcie           | Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 0 -> 5969 bytes

tests/data/acpi/q35/DSDT.acpierst

Did I miss something?

#18 lore raw

Re: [PATCH v8 10/10] ACPI ERST: step 6 of bios-tables-test.c

Ani, below. Eric

Quoted 455 lines · Ani Sinha
Quoted 451 lines · Eric DeVolder

Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6.

Below is the disassembly of an ERST table, tests/data/acpi/pc/ERST. This is a PCI device and as such its base address can change; it is possible for the address fields to differ between this and other ERST tables.

[000h 0000   4]                    Signature : "ERST"    [Error Record Serialization Table]
[004h 0004   4]                 Table Length : 00000390
[008h 0008   1]                     Revision : 01
[009h 0009   1]                     Checksum : D6
[00Ah 0010   6]                       Oem ID : "BOCHS "
[010h 0016   8]                 Oem Table ID : "BXPC    "
[018h 0024   4]                 Oem Revision : 00000001
[01Ch 0028   4]              Asl Compiler ID : "BXPC"
[020h 0032   4]        Asl Compiler Revision : 00000001
[024h 0036   4]  Serialization Header Length : 00000030
[028h 0040   4]                     Reserved : 00000000
[02Ch 0044   4]      Instruction Entry Count : 0000001B
[030h 0048   1]                       Action : 00 [Begin Write Operation]
[031h 0049   1]                  Instruction : 03 [Write Register Value]
[032h 0050   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[033h 0051 1] Reserved : 00

[034h 0052 12] Register Region : [Generic Address Structure]

[034h 0052   1]                     Space ID : 00 [SystemMemory]
[035h 0053   1]                    Bit Width : 20
[036h 0054   1]                   Bit Offset : 00
[037h 0055   1]         Encoded Access Width : 03 [DWord Access:32]
[038h 0056   8]                      Address : 00000000FEBF3000

[040h 0064 8] Value : 0000000000000000
[048h 0072 8] Mask : 00000000000000FF

[050h 0080   1]                       Action : 01 [Begin Read Operation]
[051h 0081   1]                  Instruction : 03 [Write Register Value]
[052h 0082   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[053h 0083 1] Reserved : 00

[054h 0084 12] Register Region : [Generic Address Structure]

[054h 0084   1]                     Space ID : 00 [SystemMemory]
[055h 0085   1]                    Bit Width : 20
[056h 0086   1]                   Bit Offset : 00
[057h 0087   1]         Encoded Access Width : 03 [DWord Access:32]
[058h 0088   8]                      Address : 00000000FEBF3000

[060h 0096 8] Value : 0000000000000001
[068h 0104 8] Mask : 00000000000000FF

[070h 0112   1]                       Action : 02 [Begin Clear Operation]
[071h 0113   1]                  Instruction : 03 [Write Register Value]
[072h 0114   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[073h 0115 1] Reserved : 00

[074h 0116 12] Register Region : [Generic Address Structure]

[074h 0116   1]                     Space ID : 00 [SystemMemory]
[075h 0117   1]                    Bit Width : 20
[076h 0118   1]                   Bit Offset : 00
[077h 0119   1]         Encoded Access Width : 03 [DWord Access:32]
[078h 0120   8]                      Address : 00000000FEBF3000

[080h 0128 8] Value : 0000000000000002
[088h 0136 8] Mask : 00000000000000FF

[090h 0144   1]                       Action : 03 [End Operation]
[091h 0145   1]                  Instruction : 03 [Write Register Value]
[092h 0146   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[093h 0147 1] Reserved : 00

[094h 0148 12] Register Region : [Generic Address Structure]

[094h 0148   1]                     Space ID : 00 [SystemMemory]
[095h 0149   1]                    Bit Width : 20
[096h 0150   1]                   Bit Offset : 00
[097h 0151   1]         Encoded Access Width : 03 [DWord Access:32]
[098h 0152   8]                      Address : 00000000FEBF3000

[0A0h 0160 8] Value : 0000000000000003
[0A8h 0168 8] Mask : 00000000000000FF

[0B0h 0176   1]                       Action : 04 [Set Record Offset]
[0B1h 0177   1]                  Instruction : 02 [Write Register]
[0B2h 0178   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0B3h 0179 1] Reserved : 00

[0B4h 0180 12] Register Region : [Generic Address Structure]

[0B4h 0180   1]                     Space ID : 00 [SystemMemory]
[0B5h 0181   1]                    Bit Width : 20
[0B6h 0182   1]                   Bit Offset : 00
[0B7h 0183   1]         Encoded Access Width : 03 [DWord Access:32]
[0B8h 0184   8]                      Address : 00000000FEBF3008

[0C0h 0192 8] Value : 0000000000000000
[0C8h 0200 8] Mask : 00000000FFFFFFFF

[0D0h 0208   1]                       Action : 04 [Set Record Offset]
[0D1h 0209   1]                  Instruction : 03 [Write Register Value]
[0D2h 0210   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0D3h 0211 1] Reserved : 00

[0D4h 0212 12] Register Region : [Generic Address Structure]

[0D4h 0212   1]                     Space ID : 00 [SystemMemory]
[0D5h 0213   1]                    Bit Width : 20
[0D6h 0214   1]                   Bit Offset : 00
[0D7h 0215   1]         Encoded Access Width : 03 [DWord Access:32]
[0D8h 0216   8]                      Address : 00000000FEBF3000

[0E0h 0224 8] Value : 0000000000000004
[0E8h 0232 8] Mask : 00000000000000FF

[0F0h 0240   1]                       Action : 05 [Execute Operation]
[0F1h 0241   1]                  Instruction : 03 [Write Register Value]
[0F2h 0242   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[0F3h 0243 1] Reserved : 00

[0F4h 0244 12] Register Region : [Generic Address Structure]

[0F4h 0244   1]                     Space ID : 00 [SystemMemory]
[0F5h 0245   1]                    Bit Width : 20
[0F6h 0246   1]                   Bit Offset : 00
[0F7h 0247   1]         Encoded Access Width : 03 [DWord Access:32]
[0F8h 0248   8]                      Address : 00000000FEBF3008

[100h 0256 8] Value : 000000000000009C
[108h 0264 8] Mask : 00000000000000FF

[110h 0272   1]                       Action : 05 [Execute Operation]
[111h 0273   1]                  Instruction : 03 [Write Register Value]
[112h 0274   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[113h 0275 1] Reserved : 00

[114h 0276 12] Register Region : [Generic Address Structure]

[114h 0276   1]                     Space ID : 00 [SystemMemory]
[115h 0277   1]                    Bit Width : 20
[116h 0278   1]                   Bit Offset : 00
[117h 0279   1]         Encoded Access Width : 03 [DWord Access:32]
[118h 0280   8]                      Address : 00000000FEBF3000

[120h 0288 8] Value : 0000000000000005
[128h 0296 8] Mask : 00000000000000FF

[130h 0304   1]                       Action : 06 [Check Busy Status]
[131h 0305   1]                  Instruction : 03 [Write Register Value]
[132h 0306   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[133h 0307 1] Reserved : 00

[134h 0308 12] Register Region : [Generic Address Structure]

[134h 0308   1]                     Space ID : 00 [SystemMemory]
[135h 0309   1]                    Bit Width : 20
[136h 0310   1]                   Bit Offset : 00
[137h 0311   1]         Encoded Access Width : 03 [DWord Access:32]
[138h 0312   8]                      Address : 00000000FEBF3000

[140h 0320 8] Value : 0000000000000006
[148h 0328 8] Mask : 00000000000000FF

[150h 0336   1]                       Action : 06 [Check Busy Status]
[151h 0337   1]                  Instruction : 01 [Read Register Value]
[152h 0338   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[153h 0339 1] Reserved : 00

[154h 0340 12] Register Region : [Generic Address Structure]

[154h 0340   1]                     Space ID : 00 [SystemMemory]
[155h 0341   1]                    Bit Width : 20
[156h 0342   1]                   Bit Offset : 00
[157h 0343   1]         Encoded Access Width : 03 [DWord Access:32]
[158h 0344   8]                      Address : 00000000FEBF3008

[160h 0352 8] Value : 0000000000000001
[168h 0360 8] Mask : 00000000000000FF

[170h 0368   1]                       Action : 07 [Get Command Status]
[171h 0369   1]                  Instruction : 03 [Write Register Value]
[172h 0370   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[173h 0371 1] Reserved : 00

[174h 0372 12] Register Region : [Generic Address Structure]

[174h 0372   1]                     Space ID : 00 [SystemMemory]
[175h 0373   1]                    Bit Width : 20
[176h 0374   1]                   Bit Offset : 00
[177h 0375   1]         Encoded Access Width : 03 [DWord Access:32]
[178h 0376   8]                      Address : 00000000FEBF3000

[180h 0384 8] Value : 0000000000000007
[188h 0392 8] Mask : 00000000000000FF

[190h 0400   1]                       Action : 07 [Get Command Status]
[191h 0401   1]                  Instruction : 00 [Read Register]
[192h 0402   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[193h 0403 1] Reserved : 00

[194h 0404 12] Register Region : [Generic Address Structure]

[194h 0404   1]                     Space ID : 00 [SystemMemory]
[195h 0405   1]                    Bit Width : 20
[196h 0406   1]                   Bit Offset : 00
[197h 0407   1]         Encoded Access Width : 03 [DWord Access:32]
[198h 0408   8]                      Address : 00000000FEBF3008

[1A0h 0416 8] Value : 0000000000000000
[1A8h 0424 8] Mask : 00000000000000FF

[1B0h 0432   1]                       Action : 08 [Get Record Identifier]
[1B1h 0433   1]                  Instruction : 03 [Write Register Value]
[1B2h 0434   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1B3h 0435 1] Reserved : 00

[1B4h 0436 12] Register Region : [Generic Address Structure]

[1B4h 0436   1]                     Space ID : 00 [SystemMemory]
[1B5h 0437   1]                    Bit Width : 20
[1B6h 0438   1]                   Bit Offset : 00
[1B7h 0439   1]         Encoded Access Width : 03 [DWord Access:32]
[1B8h 0440   8]                      Address : 00000000FEBF3000

[1C0h 0448 8] Value : 0000000000000008
[1C8h 0456 8] Mask : 00000000000000FF

[1D0h 0464   1]                       Action : 08 [Get Record Identifier]
[1D1h 0465   1]                  Instruction : 00 [Read Register]
[1D2h 0466   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1D3h 0467 1] Reserved : 00

[1D4h 0468 12] Register Region : [Generic Address Structure]

[1D4h 0468   1]                     Space ID : 00 [SystemMemory]
[1D5h 0469   1]                    Bit Width : 40
[1D6h 0470   1]                   Bit Offset : 00
[1D7h 0471   1]         Encoded Access Width : 04 [QWord Access:64]
[1D8h 0472   8]                      Address : 00000000FEBF3008

[1E0h 0480 8] Value : 0000000000000000
[1E8h 0488 8] Mask : FFFFFFFFFFFFFFFF

[1F0h 0496   1]                       Action : 09 [Set Record Identifier]
[1F1h 0497   1]                  Instruction : 02 [Write Register]
[1F2h 0498   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[1F3h 0499 1] Reserved : 00

[1F4h 0500 12] Register Region : [Generic Address Structure]

[1F4h 0500   1]                     Space ID : 00 [SystemMemory]
[1F5h 0501   1]                    Bit Width : 40
[1F6h 0502   1]                   Bit Offset : 00
[1F7h 0503   1]         Encoded Access Width : 04 [QWord Access:64]
[1F8h 0504   8]                      Address : 00000000FEBF3008

[200h 0512 8] Value : 0000000000000000
[208h 0520 8] Mask : FFFFFFFFFFFFFFFF

[210h 0528   1]                       Action : 09 [Set Record Identifier]
[211h 0529   1]                  Instruction : 03 [Write Register Value]
[212h 0530   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[213h 0531 1] Reserved : 00

[214h 0532 12] Register Region : [Generic Address Structure]

[214h 0532   1]                     Space ID : 00 [SystemMemory]
[215h 0533   1]                    Bit Width : 20
[216h 0534   1]                   Bit Offset : 00
[217h 0535   1]         Encoded Access Width : 03 [DWord Access:32]
[218h 0536   8]                      Address : 00000000FEBF3000

[220h 0544 8] Value : 0000000000000009
[228h 0552 8] Mask : 00000000000000FF

[230h 0560   1]                       Action : 0A [Get Record Count]
[231h 0561   1]                  Instruction : 03 [Write Register Value]
[232h 0562   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[233h 0563 1] Reserved : 00

[234h 0564 12] Register Region : [Generic Address Structure]

[234h 0564   1]                     Space ID : 00 [SystemMemory]
[235h 0565   1]                    Bit Width : 20
[236h 0566   1]                   Bit Offset : 00
[237h 0567   1]         Encoded Access Width : 03 [DWord Access:32]
[238h 0568   8]                      Address : 00000000FEBF3000

[240h 0576 8] Value : 000000000000000A
[248h 0584 8] Mask : 00000000000000FF

[250h 0592   1]                       Action : 0A [Get Record Count]
[251h 0593   1]                  Instruction : 00 [Read Register]
[252h 0594   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[253h 0595 1] Reserved : 00

[254h 0596 12] Register Region : [Generic Address Structure]

[254h 0596   1]                     Space ID : 00 [SystemMemory]
[255h 0597   1]                    Bit Width : 20
[256h 0598   1]                   Bit Offset : 00
[257h 0599   1]         Encoded Access Width : 03 [DWord Access:32]
[258h 0600   8]                      Address : 00000000FEBF3008

[260h 0608 8] Value : 0000000000000000
[268h 0616 8] Mask : 00000000FFFFFFFF

[270h 0624   1]                       Action : 0B [Begin Dummy Write]
[271h 0625   1]                  Instruction : 03 [Write Register Value]
[272h 0626   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[273h 0627 1] Reserved : 00

[274h 0628 12] Register Region : [Generic Address Structure]

[274h 0628   1]                     Space ID : 00 [SystemMemory]
[275h 0629   1]                    Bit Width : 20
[276h 0630   1]                   Bit Offset : 00
[277h 0631   1]         Encoded Access Width : 03 [DWord Access:32]
[278h 0632   8]                      Address : 00000000FEBF3000

[280h 0640 8] Value : 000000000000000B
[288h 0648 8] Mask : 00000000000000FF

[290h 0656   1]                       Action : 0D [Get Error Address Range]
[291h 0657   1]                  Instruction : 03 [Write Register Value]
[292h 0658   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[293h 0659 1] Reserved : 00

[294h 0660 12] Register Region : [Generic Address Structure]

[294h 0660   1]                     Space ID : 00 [SystemMemory]
[295h 0661   1]                    Bit Width : 20
[296h 0662   1]                   Bit Offset : 00
[297h 0663   1]         Encoded Access Width : 03 [DWord Access:32]
[298h 0664   8]                      Address : 00000000FEBF3000

[2A0h 0672 8] Value : 000000000000000D
[2A8h 0680 8] Mask : 00000000000000FF

[2B0h 0688   1]                       Action : 0D [Get Error Address Range]
[2B1h 0689   1]                  Instruction : 00 [Read Register]
[2B2h 0690   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2B3h 0691 1] Reserved : 00

[2B4h 0692 12] Register Region : [Generic Address Structure]

[2B4h 0692   1]                     Space ID : 00 [SystemMemory]
[2B5h 0693   1]                    Bit Width : 40
[2B6h 0694   1]                   Bit Offset : 00
[2B7h 0695   1]         Encoded Access Width : 04 [QWord Access:64]
[2B8h 0696   8]                      Address : 00000000FEBF3008

[2C0h 0704 8] Value : 0000000000000000
[2C8h 0712 8] Mask : FFFFFFFFFFFFFFFF

[2D0h 0720   1]                       Action : 0E [Get Error Address Length]
[2D1h 0721   1]                  Instruction : 03 [Write Register Value]
[2D2h 0722   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2D3h 0723 1] Reserved : 00

[2D4h 0724 12] Register Region : [Generic Address Structure]

[2D4h 0724   1]                     Space ID : 00 [SystemMemory]
[2D5h 0725   1]                    Bit Width : 20
[2D6h 0726   1]                   Bit Offset : 00
[2D7h 0727   1]         Encoded Access Width : 03 [DWord Access:32]
[2D8h 0728   8]                      Address : 00000000FEBF3000

[2E0h 0736 8] Value : 000000000000000E
[2E8h 0744 8] Mask : 00000000000000FF

[2F0h 0752   1]                       Action : 0E [Get Error Address Length]
[2F1h 0753   1]                  Instruction : 00 [Read Register]
[2F2h 0754   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[2F3h 0755 1] Reserved : 00

[2F4h 0756 12] Register Region : [Generic Address Structure]

[2F4h 0756   1]                     Space ID : 00 [SystemMemory]
[2F5h 0757   1]                    Bit Width : 40
[2F6h 0758   1]                   Bit Offset : 00
[2F7h 0759   1]         Encoded Access Width : 04 [QWord Access:64]
[2F8h 0760   8]                      Address : 00000000FEBF3008

[300h 0768 8] Value : 0000000000000000
[308h 0776 8] Mask : 00000000FFFFFFFF

[310h 0784   1]                       Action : 0F [Get Error Attributes]
[311h 0785   1]                  Instruction : 03 [Write Register Value]
[312h 0786   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[313h 0787 1] Reserved : 00

[314h 0788 12] Register Region : [Generic Address Structure]

[314h 0788   1]                     Space ID : 00 [SystemMemory]
[315h 0789   1]                    Bit Width : 20
[316h 0790   1]                   Bit Offset : 00
[317h 0791   1]         Encoded Access Width : 03 [DWord Access:32]
[318h 0792   8]                      Address : 00000000FEBF3000

[320h 0800 8] Value : 000000000000000F
[328h 0808 8] Mask : 00000000000000FF

[330h 0816   1]                       Action : 0F [Get Error Attributes]
[331h 0817   1]                  Instruction : 00 [Read Register]
[332h 0818   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[333h 0819 1] Reserved : 00

[334h 0820 12] Register Region : [Generic Address Structure]

[334h 0820   1]                     Space ID : 00 [SystemMemory]
[335h 0821   1]                    Bit Width : 20
[336h 0822   1]                   Bit Offset : 00
[337h 0823   1]         Encoded Access Width : 03 [DWord Access:32]
[338h 0824   8]                      Address : 00000000FEBF3008

[340h 0832 8] Value : 0000000000000000
[348h 0840 8] Mask : 00000000FFFFFFFF

[350h 0848   1]                       Action : 10 [Execute Timings]
[351h 0849   1]                  Instruction : 03 [Write Register Value]
[352h 0850   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[353h 0851 1] Reserved : 00

[354h 0852 12] Register Region : [Generic Address Structure]

[354h 0852   1]                     Space ID : 00 [SystemMemory]
[355h 0853   1]                    Bit Width : 20
[356h 0854   1]                   Bit Offset : 00
[357h 0855   1]         Encoded Access Width : 03 [DWord Access:32]
[358h 0856   8]                      Address : 00000000FEBF3000

[360h 0864 8] Value : 0000000000000010
[368h 0872 8] Mask : 00000000000000FF

[370h 0880   1]                       Action : 10 [Execute Timings]
[371h 0881   1]                  Instruction : 00 [Read Register]
[372h 0882   1]        Flags (decoded below) : 00

Preserve Register Bits : 0
[373h 0883 1] Reserved : 00

[374h 0884 12] Register Region : [Generic Address Structure]

[374h 0884   1]                     Space ID : 00 [SystemMemory]
[375h 0885   1]                    Bit Width : 40
[376h 0886   1]                   Bit Offset : 00
[377h 0887   1]         Encoded Access Width : 04 [QWord Access:64]
[378h 0888   8]                      Address : 00000000FEBF3008
Quoted 8 lines
Quoted 6 lines

[380h 0896 8] Value : 0000000000000000
[388h 0904 8] Mask : FFFFFFFFFFFFFFFF

And the diff of DSDT (note this seems to suggest that some other device is omitted from the .acpierst configuration, but otherwise DSDT is unchanged).

We need to understand why we see these changes in the DSDT table.

I expected to see a change that reflected adding ERST pointer; but I don't think this reflects that. Do you have suggestions?

Quoted 214 lines
Quoted 201 lines

--- dsdt-noacpierst.dsl 2021-10-14 15:44:13.000000000 -0400
+++ dsdt-acpierst.dsl 2021-10-14 15:47:14.000000000 -0400

(quoted diff) +5 -15
@@ -5,13 +5,13 @@
   *
   * Disassembling to symbolic ASL+ operators
   *
- * Disassembly of tests/data/acpi/pc/DSDT, Thu Oct 14 15:44:13 2021
+ * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Oct 14 15:47:14 2021
   *
   * Original Table Header:
   *     Signature        "DSDT"
- *     Length           0x00001772 (6002)
+ *     Length           0x00001751 (5969)
   *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
- *     Checksum         0x9E
+ *     Checksum         0x95
   *     OEM ID           "BOCHS "
   *     OEM Table ID     "BXPC    "
   *     OEM Revision     0x00000001 (1)
@@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "
 
              Device (S18)
              {
-                Name (_SUN, 0x03)  // _SUN: Slot User Number
                  Name (_ADR, 0x00030000)  // _ADR: Address
-                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                {
-                    PCEJ (BSEL, _SUN)
-                }
-
+                Name (ASUN, 0x03)
                  Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                  {
-                    Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+                    Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))
                  }
              }
 
@@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "
 
              Method (DVNT, 2, NotSerialized)
              {
-                If ((Arg0 & 0x08))
-                {
-                    Notify (S18, Arg1)
-                }
-
                  If ((Arg0 & 0x10))
                  {
                      Notify (S20, Arg1)
---
  tests/data/acpi/microvm/ERST.pcie           | Bin 0 -> 912 bytes
  tests/data/acpi/pc/DSDT.acpierst            | Bin 0 -> 5969 bytes
  tests/data/acpi/q35/DSDT.acpierst           | Bin 0 -> 8306 bytes
  tests/qtest/bios-tables-test-allowed-diff.h |   5 -----
  4 files changed, 5 deletions(-)
tests/data/acpi/microvm/ERST.pcie binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bb0593eeb8730d51a6f0fe51a00a00df9c83c419 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b0eafe90e5832935557ec5e6802c0147c88f379c 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -0
index c06241a..dfb8523 100644

tests/qtest/bios-tables-test-allowed-diff.h line 6

Quoted 6 lines
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
@@ -1,6 +1 @@
  /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/ERST",
-"tests/data/acpi/q35/DSDT.acpierst",
-"tests/data/acpi/q35/ERST",
-"tests/data/acpi/microvm/ERST.pcie",

What about the blobs for :

tests/data/acpi/pc/ERST
tests/data/acpi/q35/ERST
since you have indicated above that these tables are also modified ?

Quoted 8 lines

You have only added blobs for the following tables:

Quoted 3 lines
  tests/data/acpi/microvm/ERST.pcie           | Bin 0 -> 912 bytes
  tests/data/acpi/pc/DSDT.acpierst            | Bin 0 -> 5969 bytes

tests/data/acpi/q35/DSDT.acpierst

Did I miss something?

No, unfortunately I made a mistake and neglected to include those two blobs.

Thanks for examining!
eric

#19 lore raw
In reply to Eric DeVolder

Hi Eric:

So I do not see all the patches in the series for v8. Just so you know, when you spin out a new version, please do send all the patches in the series again, including the ones that might have been already reviewed.

Ani

Quoted 106 lines · Eric DeVolder

This patchset introduces support for the ACPI Error Record Serialization Table, ERST.

For background and implementation information, please see docs/specs/acpi_erst.rst, which is patch 2/10.

---
v8: 15oct2021
- Added Kconfig option for ERST, per Ani Sinha
- Fixed patch ordering, per Ani

v7: 7oct2021
- style improvements, per Igor
- use of endian accessors for storage header, per Igor
- a number of optimizations and improvements, per Igor
- updated spec for header, per Igor
- updated spec for rst format, per Michael Tsirkin
- updated spec for new record_size parameter Due to changes in the spec, I am not carrying the Acked-by from Ani Sinha.
- changes for and testing of migration to systems with differing ERST_RECORD_SIZE

v6: 5aug2021
- Fixed compile warning/error, per Michael Tsirkin
- Fixed mingw32 build error, per Michael
- Converted exchange buffer to MemoryBackend, per Igor
- Migrated test to PCI, per Igor
- Significantly reduced amount of copying, per Igor
- Corrections/enhancements to acpi_erst.txt, per Igor
- Many misc/other small items, per Igor

v5: 30jun2021
- Create docs/specs/acpi_erst.txt, per Igor
- Separate PCI BARs for registers and memory, per Igor
- Convert debugging to use trace infrastructure, per Igor
- Various other fixups, per Igor

v4: 11jun2021
- Converted to a PCI device, per Igor.
- Updated qtest.
- Rearranged patches, per Igor.

v3: 28may2021
- Converted to using a TYPE_MEMORY_BACKEND_FILE object rather than internal array with explicit file operations, per Igor.
- Changed the way the qdev and base address are handled, allowing ERST to be disabled at run-time. Also aligns better with other existing code.

v2: 8feb2021
- Added qtest/smoke test per Paolo Bonzini
- Split patch into smaller chunks, per Igor Mammedov
- Did away with use of ACPI packed structures, per Igor Mammedov

v1: 26oct2020
- initial post

---
Eric DeVolder (10):
ACPI ERST: bios-tables-test.c steps 1 and 2 ACPI ERST: specification for ERST support ACPI ERST: PCI device_id for ERST
ACPI ERST: header file for ERST
ACPI ERST: support for ACPI ERST feature ACPI ERST: build the ACPI ERST table
ACPI ERST: create ACPI ERST table for pc/x86 machines ACPI ERST: qtest for ERST
ACPI ERST: bios-tables-test testcase
ACPI ERST: step 6 of bios-tables-test.c

 docs/specs/acpi_erst.rst          |  200 +++++++
 hw/acpi/Kconfig                   |    6 +
 hw/acpi/erst.c                    | 1077 +++++++++++++++++++++++++++++++++++++
 hw/acpi/meson.build               |    1 +
 hw/acpi/trace-events              |   15 +
 hw/i386/acpi-build.c              |    9 +
 hw/i386/acpi-microvm.c            |    9 +
 include/hw/acpi/erst.h            |   24 +
 include/hw/pci/pci.h              |    1 +
 tests/data/acpi/microvm/ERST.pcie |  Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst  |  Bin 0 -> 5969 bytes
 tests/data/acpi/pc/ERST           |    0
 tests/data/acpi/q35/DSDT.acpierst |  Bin 0 -> 8306 bytes
 tests/data/acpi/q35/ERST          |    0
 tests/qtest/bios-tables-test.c    |   55 ++
 tests/qtest/erst-test.c           |  167 ++++++
 tests/qtest/meson.build           |    2 +
 17 files changed, 1566 insertions(+)
 create mode 100644 docs/specs/acpi_erst.rst
 create mode 100644 hw/acpi/erst.c
 create mode 100644 include/hw/acpi/erst.h
 create mode 100644 tests/data/acpi/microvm/ERST.pcie
 create mode 100644 tests/data/acpi/pc/DSDT.acpierst
 create mode 100644 tests/data/acpi/pc/ERST
 create mode 100644 tests/data/acpi/q35/DSDT.acpierst
 create mode 100644 tests/data/acpi/q35/ERST
 create mode 100644 tests/qtest/erst-test.c

--
1.8.3.1

#20 lore raw

Oh sorry. Please disregard that. I see you did send all the patches in the series for v8. My Gmail tagging went wrong.

Quoted 119 lines · On Tue, Oct 19, 2021 at 17:30 Ani Sinha <[email protected]> wrote:

Hi Eric:

So I do not see all the patches in the series for v8. Just so you know, when you spin out a new version, please do send all the patches in the series again, including the ones that might have been already reviewed.

Ani

Quoted 74 lines · Eric DeVolder

This patchset introduces support for the ACPI Error Record Serialization Table, ERST.

For background and implementation information, please see docs/specs/acpi_erst.rst, which is patch 2/10.

---
v8: 15oct2021
- Added Kconfig option for ERST, per Ani Sinha
- Fixed patch ordering, per Ani

v7: 7oct2021
- style improvements, per Igor
- use of endian accessors for storage header, per Igor
- a number of optimizations and improvements, per Igor
- updated spec for header, per Igor
- updated spec for rst format, per Michael Tsirkin
- updated spec for new record_size parameter Due to changes in the spec, I am not carrying the Acked-by from Ani Sinha.
- changes for and testing of migration to systems with differing ERST_RECORD_SIZE

v6: 5aug2021
- Fixed compile warning/error, per Michael Tsirkin
- Fixed mingw32 build error, per Michael
- Converted exchange buffer to MemoryBackend, per Igor
- Migrated test to PCI, per Igor
- Significantly reduced amount of copying, per Igor
- Corrections/enhancements to acpi_erst.txt, per Igor
- Many misc/other small items, per Igor

v5: 30jun2021
- Create docs/specs/acpi_erst.txt, per Igor
- Separate PCI BARs for registers and memory, per Igor
- Convert debugging to use trace infrastructure, per Igor
- Various other fixups, per Igor

v4: 11jun2021
- Converted to a PCI device, per Igor.
- Updated qtest.
- Rearranged patches, per Igor.

v3: 28may2021
- Converted to using a TYPE_MEMORY_BACKEND_FILE object rather than internal array with explicit file operations, per Igor.
- Changed the way the qdev and base address are handled, allowing ERST to be disabled at run-time. Also aligns better with other existing code.

v2: 8feb2021
- Added qtest/smoke test per Paolo Bonzini
- Split patch into smaller chunks, per Igor Mammedov
- Did away with use of ACPI packed structures, per Igor Mammedov

v1: 26oct2020
- initial post

---
Eric DeVolder (10):
ACPI ERST: bios-tables-test.c steps 1 and 2 ACPI ERST: specification for ERST support ACPI ERST: PCI device_id for ERST
ACPI ERST: header file for ERST
ACPI ERST: support for ACPI ERST feature ACPI ERST: build the ACPI ERST table
ACPI ERST: create ACPI ERST table for pc/x86 machines ACPI ERST: qtest for ERST
ACPI ERST: bios-tables-test testcase
ACPI ERST: step 6 of bios-tables-test.c

Quoted 3 lines
 docs/specs/acpi_erst.rst          |  200 +++++++
 hw/acpi/Kconfig                   |    6 +
 hw/acpi/erst.c                    | 1077

+++++++++++++++++++++++++++++++++++++

Quoted 29 lines
 hw/acpi/meson.build               |    1 +
 hw/acpi/trace-events              |   15 +
 hw/i386/acpi-build.c              |    9 +
 hw/i386/acpi-microvm.c            |    9 +
 include/hw/acpi/erst.h            |   24 +
 include/hw/pci/pci.h              |    1 +
 tests/data/acpi/microvm/ERST.pcie |  Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst  |  Bin 0 -> 5969 bytes
 tests/data/acpi/pc/ERST           |    0
 tests/data/acpi/q35/DSDT.acpierst |  Bin 0 -> 8306 bytes
 tests/data/acpi/q35/ERST          |    0
 tests/qtest/bios-tables-test.c    |   55 ++
 tests/qtest/erst-test.c           |  167 ++++++
 tests/qtest/meson.build           |    2 +
 17 files changed, 1566 insertions(+)
 create mode 100644 docs/specs/acpi_erst.rst
 create mode 100644 hw/acpi/erst.c
 create mode 100644 include/hw/acpi/erst.h
 create mode 100644 tests/data/acpi/microvm/ERST.pcie
 create mode 100644 tests/data/acpi/pc/DSDT.acpierst
 create mode 100644 tests/data/acpi/pc/ERST
 create mode 100644 tests/data/acpi/q35/DSDT.acpierst
 create mode 100644 tests/data/acpi/q35/ERST
 create mode 100644 tests/qtest/erst-test.c

--
1.8.3.1