[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 31/45] CXL/cxl_component: Add cxl_get_hb_cstate()
From: |
Jonathan Cameron |
Subject: |
[PATCH v9 31/45] CXL/cxl_component: Add cxl_get_hb_cstate() |
Date: |
Mon, 4 Apr 2022 16:14:31 +0100 |
From: Jonathan Cameron <jonathan.cameron@huawei.com>
Accessor to get hold of the cxl state for a CXL host bridge
without exposing the internals of the implementation.
Signed-off-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
hw/pci-bridge/pci_expander_bridge.c | 7 +++++++
include/hw/cxl/cxl_component.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/hw/pci-bridge/pci_expander_bridge.c
b/hw/pci-bridge/pci_expander_bridge.c
index b4813b6851..963fa41a11 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -72,6 +72,13 @@ static GList *pxb_dev_list;
#define TYPE_PXB_HOST "pxb-host"
+CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb)
+{
+ CXLHost *host = PXB_CXL_HOST(hb);
+
+ return &host->cxl_cstate;
+}
+
static int pxb_bus_num(PCIBus *bus)
{
PXBDev *pxb = convert_to_pxb(bus->parent_dev);
diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h
index b0f95d3484..779a7b1a97 100644
--- a/include/hw/cxl/cxl_component.h
+++ b/include/hw/cxl/cxl_component.h
@@ -202,4 +202,6 @@ static inline hwaddr cxl_decode_ig(int ig)
return 1 << (ig + 8);
}
+CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);
+
#endif
--
2.32.0
- [PATCH v9 22/45] qtests/cxl: Add initial root port and CXL type3 tests, (continued)
- [PATCH v9 22/45] qtests/cxl: Add initial root port and CXL type3 tests, Jonathan Cameron, 2022/04/04
- [PATCH v9 23/45] hw/cxl/component: Implement host bridge MMIO (8.2.5, table 142), Jonathan Cameron, 2022/04/04
- [PATCH v9 24/45] acpi/cxl: Add _OSC implementation (9.14.2), Jonathan Cameron, 2022/04/04
- [PATCH v9 25/45] acpi/cxl: Create the CEDT (9.14.1), Jonathan Cameron, 2022/04/04
- [PATCH v9 26/45] hw/cxl/component: Add utils for interleave parameter encoding/decoding, Jonathan Cameron, 2022/04/04
- [PATCH v9 27/45] hw/cxl/host: Add support for CXL Fixed Memory Windows., Jonathan Cameron, 2022/04/04
- [PATCH v9 28/45] acpi/cxl: Introduce CFMWS structures in CEDT, Jonathan Cameron, 2022/04/04
- [PATCH v9 29/45] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl, Jonathan Cameron, 2022/04/04
- [PATCH v9 30/45] pci/pcie_port: Add pci_find_port_by_pn(), Jonathan Cameron, 2022/04/04
- [PATCH v9 31/45] CXL/cxl_component: Add cxl_get_hb_cstate(),
Jonathan Cameron <=
- [PATCH v9 32/45] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/04/04
- [PATCH v9 33/45] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/04/04
- [PATCH v9 34/45] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/04/04
- [PATCH v9 35/45] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/04/04
- [PATCH v9 36/45] tests/acpi: q35: Allow addition of a CXL test., Jonathan Cameron, 2022/04/04
- [PATCH v9 37/45] qtests/bios-tables-test: Add a test for CXL emulation., Jonathan Cameron, 2022/04/04
- [PATCH v9 38/45] tests/acpi: Add tables for CXL emulation., Jonathan Cameron, 2022/04/04
- [PATCH v9 39/45] qtest/cxl: Add more complex test cases with CFMWs, Jonathan Cameron, 2022/04/04