[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 29/32] Temp: acpi/cxl: Add ACPI0017 (CEDT awareness)
From: |
Ben Widawsky |
Subject: |
[RFC PATCH v2 29/32] Temp: acpi/cxl: Add ACPI0017 (CEDT awareness) |
Date: |
Tue, 5 Jan 2021 08:53:20 -0800 |
This represents Intel's proposal for how the system firmware can notify
Linux that the CEDT exists and provides a driver attach point. It is not
in the CXL 2.0 specification as of now.
CXL 2.0 specification adds an _HID, ACPI0016, for CXL capable host
bridges, with a _CID of PNP0A08 (PCIe host bridge). CXL aware software
is able to use this initiate the proper _OSC method, and get the _UID
which is referenced by the CEDT. Therefore the existence of an ACPI0016
device allows a CXL aware driver perform the necessary actions. For a
CXL capable OS, this works. For a CXL unaware OS, this works.
The motivation for ACPI0017 is to provide the possibility of having a
Linux CXL module that can work on a legacy Linux kernel. Linux core
PCI/ACPI which won't be built as a module, will see the _CID of PNP0A08
and bind a driver to it. If we later loaded a driver for ACPI0016, Linux
won't be able to bind it to the hardware because it has already bound
the PNP0A08 driver. The ACPI0017 device is an opportunity to have an
object to bind a driver will be used by a Linux driver to walk the CXL
topology and do everything that we would have preferred to do with
ACPI0016.
There is another motivation for an ACPI0017 device which isn't
implemented here. An operating system needs an attach point for a
non-volatile region provider that understands cross-hostbridge
interleaving. Since QEMU emulation doesn't support interleaving yet,
this is more important on the OS side, for now.
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
hw/i386/acpi-build.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 49242eb8f3..470dd7ddf4 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1221,6 +1221,19 @@ static void init_pci_acpi(Aml *dev, int uid, int type)
}
}
+static void build_acpi0017(Aml *table)
+{
+ Aml *dev;
+ Aml *scope;
+
+ scope = aml_scope("_SB");
+ dev = aml_device("CXLM");
+ aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0017")));
+
+ aml_append(scope, dev);
+ aml_append(table, scope);
+}
+
static void
build_dsdt(GArray *table_data, BIOSLinker *linker,
AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -1237,6 +1250,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
int root_bus_limit = 0xFF;
PCIBus *bus = NULL;
TPMIf *tpm = tpm_find();
+ bool cxl_present = false;
int i;
VMBusBridge *vmbus_bridge = vmbus_bridge_find();
@@ -1392,6 +1406,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
/* Handle the ranges for the PXB expanders */
if (type == CXL) {
+ cxl_present = true;
uint64_t base = CXL_HOST_BASE + uid * 0x10000;
crs_range_insert(crs_range_set.mem_ranges, base,
base + 0x10000 - 1);
@@ -1399,6 +1414,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
}
+ if (cxl_present) {
+ build_acpi0017(dsdt);
+ }
+
/*
* At this point crs_range_set has all the ranges used by pci
* busses *other* than PCI0. These ranges will be excluded from
--
2.30.0
- Re: [Linuxarm] Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), (continued)
- [RFC PATCH v2 09/32] hw/cxl/device: Add cheap EVENTS implementation (8.2.9.1), Ben Widawsky, 2021/01/05
- [RFC PATCH v2 08/32] hw/cxl/device: Add memory devices (8.2.8.5), Ben Widawsky, 2021/01/05
- [RFC PATCH v2 10/32] hw/cxl/device: Placeholder for firmware commands, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 11/32] hw/cxl/device: Timestamp implementation (8.2.9.3), Ben Widawsky, 2021/01/05
- [RFC PATCH v2 13/32] hw/pxb: Use a type for realizing expanders, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 12/32] hw/cxl/device: Add log commands (8.2.9.4) + CEL, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 32/32] qtest/cxl: Add very basic sanity tests, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 30/32] tests/acpi: Add new CEDT files, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 29/32] Temp: acpi/cxl: Add ACPI0017 (CEDT awareness),
Ben Widawsky <=
- [RFC PATCH v2 14/32] hw/pci/cxl: Create a CXL bus type, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 15/32] hw/pxb: Allow creation of a CXL PXB (host bridge), Ben Widawsky, 2021/01/05
- [RFC PATCH v2 31/32] WIP: i386/cxl: Initialize a host bridge, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 16/32] qtest: allow DSDT acpi table changes, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 18/32] tests/acpi: remove stale allowed tables, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 17/32] acpi/pci: Consolidate host bridge setup, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 19/32] hw/pci: Plumb _UID through host bridges, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 20/32] hw/cxl/component: Implement host bridge MMIO (8.2.5, table 142), Ben Widawsky, 2021/01/05
- [RFC PATCH v2 21/32] acpi/pxb/cxl: Reserve host bridge MMIO, Ben Widawsky, 2021/01/05
- [RFC PATCH v2 22/32] hw/pxb/cxl: Add "windows" for host bridges, Ben Widawsky, 2021/01/05