[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 30/43] acpi/cxl: Introduce CFMWS structures in CEDT
From: |
Jonathan Cameron |
Subject: |
[PATCH v5 30/43] acpi/cxl: Introduce CFMWS structures in CEDT |
Date: |
Wed, 2 Feb 2022 14:10:24 +0000 |
From: Ben Widawsky <ben.widawsky@intel.com>
The CEDT CXL Fixed Window Memory Window Structures (CFMWs)
define regions of the host phyiscal address map which
(via an impdef means) are configured such that they have
a particular interleave setup across one or more CXL Host Bridges.
Reported-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
hw/acpi/cxl.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c
index 442f836a3e..50efc7f690 100644
--- a/hw/acpi/cxl.c
+++ b/hw/acpi/cxl.c
@@ -60,6 +60,64 @@ static void cedt_build_chbs(GArray *table_data, PXBDev *cxl)
build_append_int_noprefix(table_data, memory_region_size(mr), 8);
}
+/*
+ * CFMWS entries in CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
+ * Interleave ways encoding in CXL 2.0 ECN: 3, 6, 12 and 16-way memory
+ * interleaving.
+ */
+static void cedt_build_cfmws(GArray *table_data, MachineState *ms)
+{
+ CXLState *cxls = ms->cxl_devices_state;
+ GList *it;
+
+ for (it = cxls->fixed_windows; it; it = it->next) {
+ CXLFixedWindow *fw = it->data;
+ int i;
+
+ /* Type */
+ build_append_int_noprefix(table_data, 1, 1);
+
+ /* Reserved */
+ build_append_int_noprefix(table_data, 0, 1);
+
+ /* Record Length */
+ build_append_int_noprefix(table_data, 36 + 4 * fw->num_targets, 2);
+
+ /* Reserved */
+ build_append_int_noprefix(table_data, 0, 4);
+
+ /* Base HPA */
+ build_append_int_noprefix(table_data, fw->mr.addr, 8);
+
+ /* Window Size */
+ build_append_int_noprefix(table_data, fw->size, 8);
+
+ /* Host Bridge Interleave Ways */
+ build_append_int_noprefix(table_data, fw->enc_int_ways, 1);
+
+ /* Host Bridge Interleave Arithmetic */
+ build_append_int_noprefix(table_data, 0, 1);
+
+ /* Reserved */
+ build_append_int_noprefix(table_data, 0, 2);
+
+ /* Host Bridge Interleave Granularity */
+ build_append_int_noprefix(table_data, fw->enc_int_gran, 4);
+
+ /* Window Restrictions */
+ build_append_int_noprefix(table_data, 0x0f, 2); /* No restrictions */
+
+ /* QTG ID */
+ build_append_int_noprefix(table_data, 0, 2);
+
+ /* Host Bridge List (list of UIDs - currently bus_nr) */
+ for (i = 0; i < fw->num_targets; i++) {
+ g_assert(fw->target_hbs[i]);
+ build_append_int_noprefix(table_data, fw->target_hbs[i]->bus_nr,
4);
+ }
+ }
+}
+
static int cxl_foreach_pxb_hb(Object *obj, void *opaque)
{
Aml *cedt = opaque;
@@ -86,6 +144,7 @@ void cxl_build_cedt(MachineState *ms, GArray *table_offsets,
GArray *table_data,
/* reserve space for CEDT header */
object_child_foreach_recursive(object_get_root(), cxl_foreach_pxb_hb,
cedt);
+ cedt_build_cfmws(cedt->buf, ms);
/* copy AML table into ACPI tables blob and patch header there */
g_array_append_vals(table_data, cedt->buf->data, cedt->buf->len);
--
2.32.0
- Re: [PATCH v5 20/43] hw/cxl/device: Add a memory device (8.2.8.5), (continued)
- [PATCH v5 21/43] hw/cxl/device: Implement MMIO HDM decoding (8.2.5.12), Jonathan Cameron, 2022/02/02
- [PATCH v5 22/43] acpi/cxl: Add _OSC implementation (9.14.2), Jonathan Cameron, 2022/02/02
- [PATCH v5 23/43] tests/acpi: allow CEDT table addition, Jonathan Cameron, 2022/02/02
- [PATCH v5 24/43] acpi/cxl: Create the CEDT (9.14.1), Jonathan Cameron, 2022/02/02
- [PATCH v5 25/43] hw/cxl/device: Add some trivial commands, Jonathan Cameron, 2022/02/02
- [PATCH v5 26/43] hw/cxl/device: Plumb real Label Storage Area (LSA) sizing, Jonathan Cameron, 2022/02/02
- [PATCH v5 27/43] hw/cxl/device: Implement get/set Label Storage Area (LSA), Jonathan Cameron, 2022/02/02
- [PATCH v5 28/43] hw/cxl/component: Add utils for interleave parameter encoding/decoding, Jonathan Cameron, 2022/02/02
- [PATCH v5 29/43] hw/cxl/host: Add support for CXL Fixed Memory Windows., Jonathan Cameron, 2022/02/02
- [PATCH v5 30/43] acpi/cxl: Introduce CFMWS structures in CEDT,
Jonathan Cameron <=
- [PATCH v5 31/43] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl, Jonathan Cameron, 2022/02/02
- [PATCH v5 32/43] pci/pcie_port: Add pci_find_port_by_pn(), Jonathan Cameron, 2022/02/02
- [PATCH v5 33/43] CXL/cxl_component: Add cxl_get_hb_cstate(), Jonathan Cameron, 2022/02/02
- [PATCH v5 34/43] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/02/02
- [PATCH v5 35/43] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/02/02
- [PATCH v5 36/43] arm/virt: Allow virt/CEDT creation, Jonathan Cameron, 2022/02/02
- [PATCH v5 37/43] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl, Jonathan Cameron, 2022/02/02
- [PATCH v5 38/43] RFC: softmmu/memory: Add ops to memory_region_ram_init_from_file, Jonathan Cameron, 2022/02/02
- [PATCH v5 39/43] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/02/02
- [PATCH v5 40/43] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/02/02