Skip to contentSkip to conversation

hw/cxl: Add dummy ACPI QTG DSM

PATCH New Jonathan Cameron 1 participant 4 messages Oct 12, 2023

lore
Share & tools
lore
#0 lore raw

v5 cover hw/cxl: Add dummy ACPI QTG DSM

This series wraps Dave Jiang's v4 with tests as per v2.
The kernel code using this is now at v10 and reflects the changes made here.

https://lore.kernel.org/linux-cxl/[email protected]/T/#t

The discussions around the QEMU patches resulted in significant fixes to the kernel code - which is great. Thanks to all involved.

Changes since v4:
- Add updated bios table to reflect the changs made in v3/v4

Based-on: qemu/master a51e5124a6

Key thing to note vs V2 is that this now returns a package of integers and the example returns a package with two elements in it. This corresponds to a firmware saying that for any input parameters the QTGs should be used in order of preference 0 then 1.

As per patch 2 description:

Add a simple _DSM call support for the ACPI0017 device to return fake QTG ID values of 0 and 1 in all cases. This for _DSM plumbing testing from the OS.

Following edited for readability

Device (CXLM)

{
    Name (_HID, "ACPI0017")  // _HID: Hardware ID
...
    Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
    {
        If ((Arg0 == ToUUID ("f365f9a6-a7de-4071-a66a-b40c0b4f8e52")))
        {
            If ((Arg2 == Zero))
            {
                Return (Buffer (One) { 0x01 })
            }

            If ((Arg2 == One))
            {
                Return (Package (0x02)
                {
                    One,
                    Package (0x02)
                    {
                        Zero,
                        One
                    }
                })
            }
        }
    }

Dave Jiang (1):
hw/cxl: Add QTG _DSM support for ACPI0017 device

Jonathan Cameron (2):
tests/acpi: Allow update of DSDT.cxl
tests/acpi: Update DSDT.cxl with QTG DSM

 include/hw/acpi/cxl.h        |   1 +
 hw/acpi/cxl.c                |  69 +++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c         |   1 +
 tests/data/acpi/q35/DSDT.cxl | Bin 9655 -> 9713 bytes
 4 files changed, 71 insertions(+)
Signature · 1 line
2.39.2
#1 lore raw

PATCH v5 1/3 tests/acpi: Allow update of DSDT.cxl

Addition of QTG in following patch requires an update to the test data.

---
v5 : No change

 tests/qtest/bios-tables-test-allowed-diff.h | 1 +
 1 file changed, 1 insertion(+)
tests/qtest/bios-tables-test-allowed-diff.h +1 -0
index dfb8523c8b..9ce0f596cc 100644
@@ -1 +1,2 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/DSDT.cxl",
Signature · 1 line
2.39.2
#2 lore raw

PATCH v5 2/3 hw/cxl: Add QTG _DSM support for ACPI0017 device

In reply to Jonathan Cameron

From: Dave Jiang <[email protected]>

Add a simple _DSM call support for the ACPI0017 device to return fake QTG ID values of 0 and 1 in all cases. This for _DSM plumbing testing from the OS.

Following edited for readability

Device (CXLM)

{
    Name (_HID, "ACPI0017")  // _HID: Hardware ID
...
    Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
    {
        If ((Arg0 == ToUUID ("f365f9a6-a7de-4071-a66a-b40c0b4f8e52")))
        {
            If ((Arg2 == Zero))
            {
                Return (Buffer (One) { 0x01 })
            }

            If ((Arg2 == One))
            {
                Return (Package (0x02)
                {
                    One,
                    Package (0x02)
                    {
                        Zero,
                        One
                    }
                })
            }
        }
    }

---
v5: No change - picked up Dave's V4 posting to wrap with tests.

 include/hw/acpi/cxl.h |  1 +
 hw/acpi/cxl.c         | 69 +++++++++++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c  |  1 +
 3 files changed, 71 insertions(+)
include/hw/acpi/cxl.h +1 -0
index acf4418886..8f22c71530 100644
@@ -25,5 +25,6 @@ void cxl_build_cedt(GArray *table_offsets, GArray *table_data,
                     BIOSLinker *linker, const char *oem_id,
                     const char *oem_table_id, CXLState *cxl_state);
 void build_cxl_osc_method(Aml *dev);
+void build_cxl_dsm_method(Aml *dev);
 
 #endif
hw/acpi/cxl.c +69 -0

75 lines not on this page · raw message

hw/i386/acpi-build.c +1 -0
index 3f2b27cf75..019aa71525 100644
@@ -1422,6 +1422,7 @@ static void build_acpi0017(Aml *table)
     method = aml_method("_STA", 0, AML_NOTSERIALIZED);
     aml_append(method, aml_return(aml_int(0x01)));
     aml_append(dev, method);
+    build_cxl_dsm_method(dev);
 
     aml_append(scope, dev);
     aml_append(table, scope);
Signature · 1 line
2.39.2
#3 lore raw

PATCH v5 3/3 tests/acpi: Update DSDT.cxl with QTG DSM

In reply to Jonathan Cameron

Description of change in previous patch.

---
v5: Updated test data to reflect changes since v2.

 tests/qtest/bios-tables-test-allowed-diff.h |   1 -
 tests/data/acpi/q35/DSDT.cxl                | Bin 9655 -> 9713 bytes
 2 files changed, 1 deletion(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -1
index 9ce0f596cc..dfb8523c8b 100644
@@ -1,2 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/DSDT.cxl",
tests/data/acpi/q35/DSDT.cxl binary +0 -0
index ee16a861c2de7b7caaf11d91c50fcdf308815233..145301c52af9a17242bb306c210f8a7e0f01b827 100644
GIT binary patch
Signature · 1 line
2.39.2