hw/cxl: Support Back-Invalidate (+ PCIe Flit mode)
v5 cover hw/cxl: Support Back-Invalidate (+ PCIe Flit mode)
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/
Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.
v5 changes:
- Rebase much earlier in the CXL queue as Davidlohr had it beind some stuff I was carrying that is not ready for upstream just yet.
- Update the CFMWS flags directly as the patch doing restriction control needs some more thought.
- Bios tables test data updates.
- Don't provide flit mode control for gen_pcie_root_port as we don't need it for the rest of the series which is all about CXL.
The following allows support for component basic back invalidation discovery and config, by exposing the BI routing table and decoder registers. Instead of going the type2[0] route, this series proposes adding support for type3 hdm-db, which allows a more direct way of supporting BI in qemu.
As BI is a dependent on the larger flits introduced in PCIe (and CXL 3.0) add support for enabling that for CXL components. Negotiation is handled via an equivalent of what we do for link speed.
Davidlohr Bueso (3):
hw/pcie: Support enabling flit mode
hw/cxl: Support type3 HDM-DB
hw/cxl: Remove register special_ops->read()
Ira Weiny (1):
hw/cxl: Refactor component register initialization
Jonathan Cameron (3):
tests/bios-tables-test: Excluded CEDT.cxl for BI restriction
relaxation.
hw/cxl: Update CXL Fixed Memory Window ACPI description to include
Back Invalidate support.
tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMS
docs/system/devices/cxl.rst | 23 +++ include/hw/cxl/cxl_component.h | 87 +++++++-- include/hw/cxl/cxl_device.h | 4 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/acpi/cxl.c | 2 +- hw/cxl/cxl-component-utils.c | 211 ++++++++++++++++------ hw/mem/cxl_type3.c | 15 +- hw/pci-bridge/cxl_downstream.c | 10 +- hw/pci-bridge/cxl_root_port.c | 11 +- hw/pci-bridge/cxl_upstream.c | 18 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci/pcie.c | 23 ++- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 15 files changed, 313 insertions(+), 97 deletions(-)
Signature · 1 line
2.48.1
PATCH v5 1/7 hw/pcie: Support enabling flit mode
From: Davidlohr Bueso <[email protected]>
PCIe Flit Mode, introduced with the PCIe 6.0 specification, is a fundamental change in how data is transmitted over the bus to improve transfer rates. It shifts from variable-sized Transaction Layer Packets (TLPs) to fixed 256-byte Flow Control Units (FLITs).
As with the link speed and width training, have ad-hoc property for setting the flit mode and allow CXL components to make use of it.
For the CXL root port and dsp cases, always report flit mode but the actual value after 'training' will depend on the downstream device configuration.
---
v5: (Jonathan) Dropped the gen_pcie_root_port.c support as not needed
for this series which is otherwise all about CXL.
--- include/hw/cxl/cxl_device.h | 1 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/mem/cxl_type3.c | 6 ++++-- hw/pci-bridge/cxl_downstream.c | 8 +++++--- hw/pci-bridge/cxl_root_port.c | 8 +++++--- hw/pci-bridge/cxl_upstream.c | 16 +++++++++------- hw/pci/pcie.c | 23 +++++++++++++++++++---- 9 files changed, 46 insertions(+), 20 deletions(-)
include/hw/cxl/cxl_device.h +1 -0
@@ -598,6 +598,7 @@ struct CXLType3Dev {/* PCIe link characteristics */ PCIExpLinkSpeed speed;PCIExpLinkWidth width; +bool flitmode;/* DOE */ DOECap doe_cdat;
include/hw/pci-bridge/cxl_upstream_port.h +1 -0
@@ -15,6 +15,7 @@ typedef struct CXLUpstreamPort {PCIExpLinkSpeed speed;PCIExpLinkWidth width; +bool flitmode;DOECap doe_cdat;uint64_t sn;
include/hw/pci/pcie.h +1 -1
@@ -142,7 +142,7 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset);void pcie_dev_ser_num_init (PCIDevice *dev,uint16_t offset,uint64_t ser_num);void pcie_ats_init (PCIDevice *dev,uint16_t offset,bool aligned);void pcie_cap_fill_link_ep_usp (PCIDevice *dev,PCIExpLinkWidth width, -PCIExpLinkSpeed speed); +PCIExpLinkSpeed speed,bool flitmode);void pcie_cap_slot_pre_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp);
include/hw/pci/pcie_port.h +1 -0
@@ -58,6 +58,7 @@ struct PCIESlot {PCIExpLinkSpeed speed;PCIExpLinkWidth width; +bool flitmode;/* Disable ACS (really for a pcie_root_port) */ bool disable_acs;
hw/mem/cxl_type3.c +4 -2
@@ -405,7 +405,7 @@ static void build_dvsecs(CXLType3Dev *ct3d) dvsec = (uint8_t *)&(CXLDVSECPortFlexBus ){ .cap =0x26 ,/* 68B, IO, Mem, non-MLD */ .ctrl =0x02 ,/* IO always enabled */ - .status =0x26 ,/* same as capabilities */ + .status = ct3d->flitmode ?0x6 :0x26 ,/* lack of 68B */ .rcvd_mod_ts_data_phase1 =0xef ,/* WTF? */ }; cxl_component_create_dvsec(cxl_cstate, CXL2_TYPE3_DEVICE,
@@ -1245,7 +1245,8 @@ static void ct3d_reset(DeviceState *dev)uint32_t *reg_state = ct3d->cxl_cstate.crb.cache_mem_registers;uint32_t *write_msk = ct3d->cxl_cstate.crb.cache_mem_regs_write_mask; -pcie_cap_fill_link_ep_usp (PCI_DEVICE (dev), ct3d->width, ct3d->speed); +pcie_cap_fill_link_ep_usp (PCI_DEVICE (dev), ct3d->width, ct3d->speed, + ct3d->flitmode);cxl_component_register_init_common (reg_state, write_msk,CXL2_TYPE3_DEVICE );cxl_device_register_init_t3 (ct3d,CXL_T3_MSIX_MBOX );
@@ -1284,6 +1285,7 @@ static const Property ct3_props[] = { speed, PCIE_LINK_SPEED_32), DEFINE_PROP_PCIE_LINK_WIDTH("x-width", CXLType3Dev, width, PCIE_LINK_WIDTH_16), + DEFINE_PROP_BOOL("x-256b-flit", CXLType3Dev, flitmode, false), };static uint64_t get_lsa_size (CXLType3Dev *ct3d)
hw/pci-bridge/cxl_downstream.c +5 -3
@@ -94,8 +94,9 @@ static void cxl_dsp_reset(DeviceState *qdev)latch_registers (dsp); } -static void build_dvsecs (CXLComponentState *cxl) +static void build_dvsecs (PCIDevice *d,CXLComponentState *cxl) { +PCIESlot *s =PCIE_SLOT (d);uint8_t *dvsec; dvsec = (uint8_t *)&(CXLDVSECPortExt ){0 };
@@ -107,7 +108,7 @@ static void build_dvsecs(CXLComponentState *cxl) dvsec = (uint8_t *)&(CXLDVSECPortFlexBus ){ .cap =0x27 ,/* Cache, IO, Mem, non-MLD */ .ctrl =0x02 ,/* IO always enabled */ - .status =0x26 ,/* same */ + .status = s->flitmode ?0x6 :0x26 ,/* lack of 68B */ .rcvd_mod_ts_data_phase1 =0xef ,/* WTF? */ }; cxl_component_create_dvsec(cxl, CXL2_DOWNSTREAM_PORT,
@@ -182,7 +183,7 @@ static void cxl_dsp_realize(PCIDevice *d, Error **errp) cxl_cstate->dvsec_offset =CXL_DOWNSTREAM_PORT_DVSEC_OFFSET ; cxl_cstate->pdev = d; -build_dvsecs (cxl_cstate); +build_dvsecs (d, cxl_cstate);cxl_component_register_block_init (OBJECT (d), cxl_cstate,TYPE_CXL_DSP ); pci_register_bar(d, CXL_COMPONENT_REG_BAR_IDX, PCI_BASE_ADDRESS_SPACE_MEMORY |
@@ -217,6 +218,7 @@ static const Property cxl_dsp_props[] = { speed, PCIE_LINK_SPEED_64), DEFINE_PROP_PCIE_LINK_WIDTH("x-width", PCIESlot, width, PCIE_LINK_WIDTH_16), + DEFINE_PROP_BOOL("x-256b-flit", PCIESlot, flitmode, true), };static void cxl_dsp_class_init (ObjectClass *oc,const void *data)
hw/pci-bridge/cxl_root_port.c +5 -3
@@ -104,8 +104,9 @@ static void latch_registers(CXLRootPort *crp)cxl_component_register_init_common (reg_state, write_msk,CXL2_ROOT_PORT ); } -static void build_dvsecs (CXLComponentState *cxl) +static void build_dvsecs (PCIDevice *d,CXLComponentState *cxl) { +PCIESlot *s =PCIE_SLOT (d);uint8_t *dvsec; dvsec = (uint8_t *)&(CXLDVSECPortExt ){0 };
@@ -126,7 +127,7 @@ static void build_dvsecs(CXLComponentState *cxl) dvsec = (uint8_t *)&(CXLDVSECPortFlexBus ){ .cap =0x26 ,/* IO, Mem, non-MLD */ .ctrl =0x2 , - .status =0x26 ,/* same */ + .status = s->flitmode ?0x6 :0x26 ,/* lack of 68B */ .rcvd_mod_ts_data_phase1 =0xef , }; cxl_component_create_dvsec(cxl, CXL2_ROOT_PORT,
@@ -176,7 +177,7 @@ static void cxl_rp_realize(DeviceState *dev, Error **errp) cxl_cstate->dvsec_offset =CXL_ROOT_PORT_DVSEC_OFFSET ; cxl_cstate->pdev = pci_dev; -build_dvsecs (cxl_cstate); +build_dvsecs (pci_dev, cxl_cstate);cxl_component_register_block_init (OBJECT (pci_dev), cxl_cstate,TYPE_CXL_ROOT_PORT );
@@ -211,6 +212,7 @@ static const Property gen_rp_props[] = { speed, PCIE_LINK_SPEED_64), DEFINE_PROP_PCIE_LINK_WIDTH("x-width", PCIESlot, width, PCIE_LINK_WIDTH_32), + DEFINE_PROP_BOOL("x-256b-flit", PCIESlot, flitmode, true), }; static void cxl_rp_dvsec_write_config(PCIDevice *dev, uint32_t addr,
hw/pci-bridge/cxl_upstream.c +9 -7
@@ -101,28 +101,29 @@ static void cxl_usp_reset(DeviceState *qdev)pci_bridge_reset (qdev);pcie_cap_deverr_reset (d); -pcie_cap_fill_link_ep_usp (d, usp->width, usp->speed); +pcie_cap_fill_link_ep_usp (d, usp->width, usp->speed, usp->flitmode);latch_registers (usp); } -static void build_dvsecs (CXLComponentState *cxl) +static void build_dvsecs (CXLUpstreamPort *usp) { +CXLComponentState *cxl_cstate = &usp->cxl_cstate;uint8_t *dvsec; dvsec = (uint8_t *)&(CXLDVSECPortExt ){ .status =0x1 ,/* Port Power Management Init Complete */ }; -cxl_component_create_dvsec (cxl,CXL2_UPSTREAM_PORT , +cxl_component_create_dvsec (cxl_cstate,CXL2_UPSTREAM_PORT ,EXTENSIONS_PORT_DVSEC_LENGTH ,EXTENSIONS_PORT_DVSEC ,EXTENSIONS_PORT_DVSEC_REVID , dvsec); dvsec = (uint8_t *)&(CXLDVSECPortFlexBus ){ .cap =0x27 ,/* Cache, IO, Mem, non-MLD */ .ctrl =0x27 ,/* Cache, IO, Mem */ - .status =0x26 ,/* same */ + .status = usp->flitmode ?0x6 :0x26 ,/* lack of 68B */ .rcvd_mod_ts_data_phase1 =0xef ,/* WTF? */ }; -cxl_component_create_dvsec (cxl,CXL2_UPSTREAM_PORT , +cxl_component_create_dvsec (cxl_cstate,CXL2_UPSTREAM_PORT ,PCIE_CXL3_FLEXBUS_PORT_DVSEC_LENGTH ,PCIE_FLEXBUS_PORT_DVSEC ,PCIE_CXL3_FLEXBUS_PORT_DVSEC_REVID , dvsec);
@@ -132,7 +133,7 @@ static void build_dvsecs(CXLComponentState *cxl) .reg0_base_lo = RBI_COMPONENT_REG | CXL_COMPONENT_REG_BAR_IDX, .reg0_base_hi = 0, }; -cxl_component_create_dvsec (cxl,CXL2_UPSTREAM_PORT , +cxl_component_create_dvsec (cxl_cstate,CXL2_UPSTREAM_PORT ,REG_LOC_DVSEC_LENGTH ,REG_LOC_DVSEC ,REG_LOC_DVSEC_REVID , dvsec); }
@@ -327,7 +328,7 @@ static void cxl_usp_realize(PCIDevice *d, Error **errp) } cxl_cstate->dvsec_offset =CXL_UPSTREAM_PORT_DVSEC_OFFSET ; cxl_cstate->pdev = d; -build_dvsecs (cxl_cstate); +build_dvsecs (usp);cxl_component_register_block_init (OBJECT (d), cxl_cstate,TYPE_CXL_USP ); pci_register_bar(d, CXL_COMPONENT_REG_BAR_IDX, PCI_BASE_ADDRESS_SPACE_MEMORY |
@@ -369,6 +370,7 @@ static const Property cxl_upstream_props[] = { speed, PCIE_LINK_SPEED_32), DEFINE_PROP_PCIE_LINK_WIDTH("x-width", CXLUpstreamPort, width, PCIE_LINK_WIDTH_16), + DEFINE_PROP_BOOL("x-256b-flit", CXLUpstreamPort, flitmode, false), };static void cxl_upstream_class_init (ObjectClass *oc,const void *data)
hw/pci/pcie.c +19 -4
@@ -113,7 +113,7 @@ pcie_cap_v1_fill(PCIDevice *dev, uint8_t port, uint8_t type, uint8_t version)/* Includes setting the target speed default */ static void pcie_cap_fill_lnk (uint8_t *exp_cap,PCIExpLinkWidth width, -PCIExpLinkSpeed speed) +PCIExpLinkSpeed speed,bool flitmode) {/* Clear and fill LNKCAP from what was configured above */ pci_long_test_and_clear_mask(exp_cap + PCI_EXP_LNKCAP,
@@ -158,10 +158,15 @@ static void pcie_cap_fill_lnk(uint8_t *exp_cap, PCIExpLinkWidth width, PCI_EXP_LNKCAP2_SLS_64_0GB); } } + +if (flitmode) { +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA2 , +PCI_EXP_LNKSTA2_FLIT ); + } }void pcie_cap_fill_link_ep_usp (PCIDevice *dev,PCIExpLinkWidth width, -PCIExpLinkSpeed speed) +PCIExpLinkSpeed speed,bool flitmode) {uint8_t *exp_cap = dev->config + dev->exp.exp_cap;
@@ -175,7 +180,7 @@ void pcie_cap_fill_link_ep_usp(PCIDevice *dev, PCIExpLinkWidth width,QEMU_PCI_EXP_LNKSTA_NLW (width) | QEMU_PCI_EXP_LNKSTA_CLS(speed)); -pcie_cap_fill_lnk (exp_cap, width, speed); +pcie_cap_fill_lnk (exp_cap, width, speed, flitmode); }static void pcie_cap_fill_slot_lnk (PCIDevice *dev)
@@ -212,7 +217,7 @@ static void pcie_cap_fill_slot_lnk(PCIDevice *dev)/* the PCI_EXP_LNKSTA_DLLLA will be set in the hotplug function */ } -pcie_cap_fill_lnk (exp_cap, s->width, s->speed); +pcie_cap_fill_lnk (exp_cap, s->width, s->speed, s->flitmode); } int pcie_cap_init(PCIDevice *dev, uint8_t offset,
@@ -1106,6 +1111,8 @@ void pcie_sync_bridge_lnk(PCIDevice *bridge_dev)if (!target || !target->exp.exp_cap) { lnksta = lnkcap; }else { +uint16_t lnksta2; + lnksta = target->config_read (target, target->exp.exp_cap +PCI_EXP_LNKSTA ,sizeof (lnksta));
@@ -1119,6 +1126,14 @@ void pcie_sync_bridge_lnk(PCIDevice *bridge_dev) lnksta &= ~PCI_EXP_LNKSTA_CLS ; lnksta |= lnkcap &PCI_EXP_LNKCAP_SLS ; } + + lnksta2 = target->config_read (target, + target->exp.exp_cap +PCI_EXP_LNKSTA2 , +sizeof (lnksta2)); +pci_word_test_and_clear_mask (exp_cap +PCI_EXP_LNKSTA2 , +PCI_EXP_LNKSTA2_FLIT ); +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA2 , + lnksta2 &PCI_EXP_LNKSTA2_FLIT ); }if (!(lnksta &PCI_EXP_LNKSTA_NLW )) {
Signature · 1 line
2.48.1
PATCH v5 2/7 hw/cxl: Refactor component register initialization
In reply to Jonathan CameronFrom: Ira Weiny <[email protected]>
CXL 3.2 8.2.4 Table 8-22 defines which capabilities are mandatory, not permitted, or optional for each type of device.
cxl_component_register_init_common() uses a rather odd 'fall through' mechanism to define each component register set. This assumes that any device or capability being added builds on the previous devices capabilities. This is not true as there are mutually exclusive capabilities defined. For example, downstream ports can not have snoop but it can have Back Invalidate capable decoders.
Refactor this code to make it easier to add individual capabilities as defined by a device type. Any capability which is not specified by the type is left NULL'ed out which complies with the packed nature of the register array.
Update all spec references to 3.2.
No functional changes should be seen with this patch.
--- include/hw/cxl/cxl_component.h | 33 ++++++++++----- hw/cxl/cxl-component-utils.c | 75 +++++++++++----------------------- 2 files changed, 46 insertions(+), 62 deletions(-)
include/hw/cxl/cxl_component.h +22 -11
@@ -32,10 +32,20 @@ enum reg_type { };/* -* Capability registers are defined at the top of the CXL.cache/mem region and -* are packed. For our purposes we will always define the caps in the same -* order. -* CXL r3.1 Table 8-22: CXL_CAPABILITY_ID Assignment for details. +* CXL r3.2 - 8.2.4 Table 8-22 and 8-23 +* +* Capability registers are defined at the top of the CXL.cache/mem region. +* They are defined to be packed and at variable offsets. However, NULL +* capabilities can be added to the packed array. To facilitate easier access +* within the QEMU code, define these at specified offsets. Then NULL out any +* capabilities for devices which don't (or can't) have a particular capability +* (see cxl_component_register_init_common). NULL capabilities are to be +* ignored by software. +* +* 'offsets' are based on index's which can then be used to report the array +* size in CXL Capability Header Register (index/offset 0). +* +* See CXL r3.2 Table 8-25 for an example of allowing a 'NULL' header. */ /* CXL r3.1 Section 8.2.4.1: CXL Capability Header Register */
@@ -46,16 +56,17 @@ REG32(CXL_CAPABILITY_HEADER, 0) FIELD(CXL_CAPABILITY_HEADER, CACHE_MEM_VERSION, 20, 4) FIELD(CXL_CAPABILITY_HEADER, ARRAY_SIZE, 24, 8) -#define CXLx_CAPABILITY_HEADER (type, offset) \ - REG32(CXL_##type##_CAPABILITY_HEADER, offset) \ +#define CXLx_CAPABILITY_HEADER (type, idx) \ + enum { CXL_##type##_CAP_HDR_IDX = idx }; \ + REG32(CXL_##type##_CAPABILITY_HEADER, (idx * 0x4)) \ FIELD(CXL_##type##_CAPABILITY_HEADER, ID, 0, 16) \ FIELD(CXL_##type##_CAPABILITY_HEADER, VERSION, 16, 4) \ FIELD(CXL_##type##_CAPABILITY_HEADER, PTR, 20, 12) -CXLx_CAPABILITY_HEADER(RAS, 0x4) -CXLx_CAPABILITY_HEADER(LINK, 0x8) -CXLx_CAPABILITY_HEADER(HDM, 0xc) -CXLx_CAPABILITY_HEADER(EXTSEC, 0x10) -CXLx_CAPABILITY_HEADER (SNOOP ,0x14 ) +CXLx_CAPABILITY_HEADER(RAS, 1) +CXLx_CAPABILITY_HEADER(LINK, 2) +CXLx_CAPABILITY_HEADER(HDM, 3) +CXLx_CAPABILITY_HEADER(EXTSEC, 4) +CXLx_CAPABILITY_HEADER (SNOOP ,5 )/* * Capability structures contain the actual registers that the CXL component
hw/cxl/cxl-component-utils.c +24 -51
104 lines not on this page · raw message
Signature · 1 line
2.48.1
PATCH v5 3/7 tests/bios-tables-test: Excluded CEDT.cxl for BI restriction relaxation.
In reply to Jonathan CameronThe next patch will relax restrictions on the fixed memory window to allow use with back invalidate capable devices.
---
v5: New patch as test data update was previously missing.
--- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+)
tests/qtest/bios-tables-test-allowed-diff.h +1 -0
@@ -1 +1,2 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/q35/CEDT.cxl",
Signature · 1 line
2.48.1
PATCH v5 4/7 hw/cxl: Update CXL Fixed Memory Window ACPI description to include Back Invalidate support.
In reply to Jonathan CameronDefaults for these windows has always been to enable anything QEMU supports. With the addition of back invalidate support it is necessary to specify that host windows support this.
CXL emulation is currently only suitable for software stack verification. The relaxation of the restrictions on this window to include BI have no affect on the OS until BI capable devices are added and until now these have not existed. As such no backwards compatibility impacts are expected from this change.
---
v5: Equivalent of the default change in the window restrictions patch.
That patch isn't ready for upstream just yet, so for now just change the value for everyone.
--- hw/acpi/cxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/acpi/cxl.c +1 -1
@@ -172,7 +172,7 @@ static void cedt_build_cfmws(CXLFixedWindow *fw, Aml *cedt)build_append_int_noprefix (table_data, fw->enc_int_gran,4 );/* Window Restrictions */ -build_append_int_noprefix (table_data,0x0f ,2 ); +build_append_int_noprefix (table_data,0x2f ,2 );/* QTG ID */ build_append_int_noprefix (table_data,0 ,2 );
Signature · 1 line
2.48.1
Re: [PATCH qemu v5 4/7] hw/cxl: Update CXL Fixed Memory Window ACPI description to include Back Invalidate support.
Quoted 11 lines · Jonathan Cameron
Defaults for these windows has always been to enable anything QEMU supports. With the addition of back invalidate support it is necessary to specify that host windows support this.
CXL emulation is currently only suitable for software stack verification. The relaxation of the restrictions on this window to include BI have no affect on the OS until BI capable devices are added and until now these have not existed. As such no backwards compatibility impacts are expected from this change.
Signed-off-by Jonathan Cameron <[email protected]>
PATCH v5 5/7 tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMS
In reply to Jonathan CameronWith the addition of back invalidate support in the CXL emulation relax the restriction on the CXL Fixed Memory Window Structures so all advertised ranges continue to support being used with all features that QEMU emulates.
[064h 0100 001h] Subtable Type : 01 [CXL Fixed Memory Window Structure]
[065h 0101 001h] Reserved : 00
[066h 0102 002h] Length : 0028
[068h 0104 004h] Reserved : 00000000
[06Ch 0108 008h] Window base address : 0000000110000000
[074h 0116 008h] Window size : 0000000100000000
[07Ch 0124 001h] Interleave Members : 00
[07Dh 0125 001h] Interleave Arithmetic : 00
[07Eh 0126 002h] Reserved : 0000
[080h 0128 004h] Granularity : 00000005
[084h 0132 002h] Restrictions : 002F # Changed from 000F
[086h 0134 002h] QtgId : 0000
[088h 0136 004h] First Target : 0000000C
---
v5: New patch
--- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 2 files changed, 1 deletion(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -1
@@ -1,2 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/q35/CEDT.cxl",
tests/data/acpi/x86/q35/CEDT.cxl binary +0 -0
Signature · 1 line
2.48.1
PATCH v5 6/7 hw/cxl: Support type3 HDM-DB
In reply to Jonathan CameronFrom: Davidlohr Bueso <[email protected]>
Add basic plumbing for memory expander devices that support Back Invalidation. This introduces a 'hdm-db=on|off' parameter and exposes the relevant BI RT/Decoder component cachemem registers.
Some noteworthy properties:
- Devices require enabling Flit mode across the CXL topology.
- Explicit BI-ID commit is required.
- HDM decoder support both host and dev coherency models.
--- docs/system/devices/cxl.rst | 23 +++++ include/hw/cxl/cxl_component.h | 54 ++++++++++- include/hw/cxl/cxl_device.h | 3 + hw/cxl/cxl-component-utils.c | 142 ++++++++++++++++++++++++++-- hw/mem/cxl_type3.c | 9 +- hw/pci-bridge/cxl_downstream.c | 2 +- hw/pci-bridge/cxl_root_port.c | 3 +- hw/pci-bridge/cxl_upstream.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- 9 files changed, 225 insertions(+), 15 deletions(-)
docs/system/devices/cxl.rst +23 -0
@@ -384,6 +384,29 @@ An example of 4 devices below a switch suitable for 1, 2 or 4 way interleave:: -device cxl-type3,bus=swport3,persistent-memdev=cxl-mem3,lsa=cxl-lsa3,id=cxl-pmem3,sn=0x4 \ -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=4k +An example of 4 type3 devices with volatile memory below a switch. Two of the devices +use HDM-DB for coherence, which requires operating in Flit mode:: + + qemu-system-x86_64 -M q35,cxl=on -m 4G,maxmem=8G,slots=8 -smp 4 \ + ... + -object memory-backend-ram,id=cxl-mem0,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem1,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem2,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem3,share=on,size=256M \ + -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.1 \ + -device cxl-rp,port=0,bus=cxl.1,id=root_port0,chassis=0,slot=0 \ + -device cxl-rp,port=1,bus=cxl.1,id=root_port1,chassis=0,slot=1 \ + -device cxl-upstream,bus=root_port0,id=us0,x-256b-flit=on \ + -device cxl-downstream,port=0,bus=us0,id=swport0,chassis=0,slot=4 \ + -device cxl-type3,bus=swport0,volatile-memdev=cxl-mem0,id=cxl-mem0,sn=0x1,x-256b-flit=on,hdm-db=on \ + -device cxl-downstream,port=1,bus=us0,id=swport1,chassis=0,slot=5 \ + -device cxl-type3,bus=swport1,volatile-memdev=cxl-mem1,id=cxl-mem1,sn=0x2,x-256b-flit=on,hdm-db=on \ + -device cxl-downstream,port=2,bus=us0,id=swport2,chassis=0,slot=6 \ + -device cxl-type3,bus=swport2,volatile-memdev=cxl-mem2,id=cxl-mem2,sn=0x3 \ + -device cxl-downstream,port=3,bus=us0,id=swport3,chassis=0,slot=7 \ + -device cxl-type3,bus=swport3,volatile-memdev=cxl-mem3,id=cxl-mem3,sn=0x4 \ + -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=4k + A simple arm/virt example featuring a single direct connected CXL Type 3 Volatile Memory device::
include/hw/cxl/cxl_component.h +51 -3
80 lines not on this page · raw message
include/hw/cxl/cxl_device.h +3 -0
@@ -625,6 +625,9 @@ struct CXLType3Dev {CXLMemECSReadAttrs ecs_attrs;CXLMemECSWriteAttrs ecs_wr_attrs; +/* BI flows */ +bool hdmdb; +struct dynamic_capacity {HostMemoryBackend *host_dc;AddressSpace host_dc_as;
hw/cxl/cxl-component-utils.c +135 -7
193 lines not on this page · raw message
hw/mem/cxl_type3.c +8 -1
@@ -748,6 +748,11 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp)return false; } +if (!ct3d->flitmode && ct3d->hdmdb) { +error_setg (errp,"hdm-db requires operating in 256b flit" ); +return false; + } +if (ct3d->hostvmem) {MemoryRegion *vmr;char *v_name;
@@ -1247,7 +1252,8 @@ static void ct3d_reset(DeviceState *dev)pcie_cap_fill_link_ep_usp (PCI_DEVICE (dev), ct3d->width, ct3d->speed, ct3d->flitmode); -cxl_component_register_init_common (reg_state, write_msk,CXL2_TYPE3_DEVICE ); +cxl_component_register_init_common (reg_state, write_msk, +CXL2_TYPE3_DEVICE , ct3d->hdmdb);cxl_device_register_init_t3 (ct3d,CXL_T3_MSIX_MBOX );/*
@@ -1286,6 +1292,7 @@ static const Property ct3_props[] = {DEFINE_PROP_PCIE_LINK_WIDTH ("x-width" , CXLType3Dev, width,PCIE_LINK_WIDTH_16 ),DEFINE_PROP_BOOL ("x-256b-flit" , CXLType3Dev, flitmode, false), + DEFINE_PROP_BOOL("hdm-db", CXLType3Dev, hdmdb, false), };static uint64_t get_lsa_size (CXLType3Dev *ct3d)
hw/pci-bridge/cxl_downstream.c +1 -1
@@ -39,7 +39,7 @@ static void latch_registers(CXLDownstreamPort *dsp)uint32_t *write_msk = dsp->cxl_cstate.crb.cache_mem_regs_write_mask;cxl_component_register_init_common (reg_state, write_msk, -CXL2_DOWNSTREAM_PORT ); +CXL2_DOWNSTREAM_PORT , true); }/* TODO: Look at sharing this code across all CXL port types */
hw/pci-bridge/cxl_root_port.c +2 -1
@@ -101,7 +101,8 @@ static void latch_registers(CXLRootPort *crp)uint32_t *reg_state = crp->cxl_cstate.crb.cache_mem_registers;uint32_t *write_msk = crp->cxl_cstate.crb.cache_mem_regs_write_mask; -cxl_component_register_init_common (reg_state, write_msk,CXL2_ROOT_PORT ); +cxl_component_register_init_common (reg_state, write_msk,CXL2_ROOT_PORT , + true); }static void build_dvsecs (PCIDevice *d,CXLComponentState *cxl)
hw/pci-bridge/cxl_upstream.c +1 -1
@@ -90,7 +90,7 @@ static void latch_registers(CXLUpstreamPort *usp)uint32_t *write_msk = usp->cxl_cstate.crb.cache_mem_regs_write_mask;cxl_component_register_init_common (reg_state, write_msk, -CXL2_UPSTREAM_PORT ); +CXL2_UPSTREAM_PORT , usp->flitmode);ARRAY_FIELD_DP32 (reg_state,CXL_HDM_DECODER_CAPABILITY ,TARGET_COUNT ,8 ); }
hw/pci-bridge/pci_expander_bridge.c +1 -1
@@ -301,7 +301,7 @@ static void pxb_cxl_dev_reset(DeviceState *dev)uint32_t *write_msk = cxl_cstate->crb.cache_mem_regs_write_mask;int dsp_count =0 ; -cxl_component_register_init_common (reg_state, write_msk,CXL2_RC ); +cxl_component_register_init_common (reg_state, write_msk,CXL2_RC , false);/* * The CXL specification allows for host bridges with no HDM decoders * if they only have a single root port.
Signature · 1 line
2.48.1
Re: [PATCH qemu v5 6/7] hw/cxl: Support type3 HDM-DB
Quoted 211 lines · Jonathan Cameron
From: Davidlohr Bueso <[email protected]>
Add basic plumbing for memory expander devices that support Back Invalidation. This introduces a 'hdm-db=on|off' parameter and exposes the relevant BI RT/Decoder component cachemem registers.
Some noteworthy properties:
- Devices require enabling Flit mode across the CXL topology.
- Explicit BI-ID commit is required.
- HDM decoder support both host and dev coherency models.Tested-by Dongjoo Seo <[email protected]>Signed-off-by Davidlohr Bueso <[email protected]>Signed-off-by Jonathan Cameron <[email protected]>--- docs/system/devices/cxl.rst | 23 +++++ include/hw/cxl/cxl_component.h | 54 ++++++++++- include/hw/cxl/cxl_device.h | 3 + hw/cxl/cxl-component-utils.c | 142 ++++++++++++++++++++++++++-- hw/mem/cxl_type3.c | 9 +- hw/pci-bridge/cxl_downstream.c | 2 +- hw/pci-bridge/cxl_root_port.c | 3 +- hw/pci-bridge/cxl_upstream.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- 9 files changed, 225 insertions(+), 15 deletions(-)docs/system/devices/cxl.rst +23
-0@@ -384,6 +384,29 @@ An example of 4 devices below a switch suitable for 1, 2 or 4 way interleave:: -device cxl-type3,bus=swport3,persistent-memdev=cxl-mem3,lsa=cxl-lsa3,id=cxl-pmem3,sn=0x4 \ -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=4k +An example of 4 type3 devices with volatile memory below a switch. Two of the devices +use HDM-DB for coherence, which requires operating in Flit mode:: + + qemu-system-x86_64 -M q35,cxl=on -m 4G,maxmem=8G,slots=8 -smp 4 \ + ... + -object memory-backend-ram,id=cxl-mem0,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem1,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem2,share=on,size=256M \ + -object memory-backend-ram,id=cxl-mem3,share=on,size=256M \ + -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.1 \ + -device cxl-rp,port=0,bus=cxl.1,id=root_port0,chassis=0,slot=0 \ + -device cxl-rp,port=1,bus=cxl.1,id=root_port1,chassis=0,slot=1 \ + -device cxl-upstream,bus=root_port0,id=us0,x-256b-flit=on \ + -device cxl-downstream,port=0,bus=us0,id=swport0,chassis=0,slot=4 \ + -device cxl-type3,bus=swport0,volatile-memdev=cxl-mem0,id=cxl-mem0,sn=0x1,x-256b-flit=on,hdm-db=on \ + -device cxl-downstream,port=1,bus=us0,id=swport1,chassis=0,slot=5 \ + -device cxl-type3,bus=swport1,volatile-memdev=cxl-mem1,id=cxl-mem1,sn=0x2,x-256b-flit=on,hdm-db=on \ + -device cxl-downstream,port=2,bus=us0,id=swport2,chassis=0,slot=6 \ + -device cxl-type3,bus=swport2,volatile-memdev=cxl-mem2,id=cxl-mem2,sn=0x3 \ + -device cxl-downstream,port=3,bus=us0,id=swport3,chassis=0,slot=7 \ + -device cxl-type3,bus=swport3,volatile-memdev=cxl-mem3,id=cxl-mem3,sn=0x4 \ + -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=4k + A simple arm/virt example featuring a single direct connected CXL Type 3 Volatile Memory device::include/hw/cxl/cxl_component.h +51
-3@@ -67,6 +67,8 @@ CXLx_CAPABILITY_HEADER(LINK, 2) CXLx_CAPABILITY_HEADER(HDM, 3) CXLx_CAPABILITY_HEADER(EXTSEC, 4) CXLx_CAPABILITY_HEADER(SNOOP, 5) +CXLx_CAPABILITY_HEADER(BI_RT, 6) +CXLx_CAPABILITY_HEADER (BI_DECODER ,7 )/* * Capability structures contain the actual registers that the CXL component @@ -211,10 +213,55 @@ HDM_DECODER_INIT(3); (CXL_IDE_REGISTERS_OFFSET + CXL_IDE_REGISTERS_SIZE)#define CXL_SNOOP_REGISTERS_SIZE 0x8 -QEMU_BUILD_BUG_MSG ((CXL_SNOOP_REGISTERS_OFFSET + -CXL_SNOOP_REGISTERS_SIZE ) >=0x1000 , +#define CXL_BI_RT_CAP_VERSION 1 +#define CXL_BI_RT_REGISTERS_OFFSET \ + (CXL_SNOOP_REGISTERS_OFFSET + CXL_SNOOP_REGISTERS_SIZE) +#define CXL_BI_RT_REGISTERS_SIZE 0xC + +REG32(CXL_BI_RT_CAPABILITY, CXL_BI_RT_REGISTERS_OFFSET) + FIELD(CXL_BI_RT_CAPABILITY, EXPLICIT_COMMIT, 0, 1) +REG32(CXL_BI_RT_CTRL, CXL_BI_RT_REGISTERS_OFFSET + 0x4) + FIELD(CXL_BI_RT_CTRL, COMMIT, 0, 1) +REG32(CXL_BI_RT_STATUS, CXL_BI_RT_REGISTERS_OFFSET + 0x8) + FIELD(CXL_BI_RT_STATUS, COMMITTED, 0, 1) + FIELD(CXL_BI_RT_STATUS, ERR_NOT_COMMITTED, 1, 1) + FIELD(CXL_BI_RT_STATUS, COMMIT_TMO_SCALE, 8, 4) +FIELD (CXL_BI_RT_STATUS ,COMMIT_TMO_BASE ,12 ,4 ) + +/* CXL r3.2 8.2.4.27 - CXL BI Decoder Capability Structure */ +#define CXL_BI_DECODER_CAP_VERSION 1 +#define CXL_BI_DECODER_REGISTERS_OFFSET \ + (CXL_BI_RT_REGISTERS_OFFSET + CXL_BI_RT_REGISTERS_SIZE) +#define CXL_BI_DECODER_REGISTERS_SIZE 0xC + +REG32(CXL_BI_DECODER_CAPABILITY, CXL_BI_DECODER_REGISTERS_OFFSET) + FIELD(CXL_BI_DECODER_CAPABILITY, HDM_D, 0, 1) + FIELD(CXL_BI_DECODER_CAPABILITY, EXPLICIT_COMMIT, 1, 1) +REG32(CXL_BI_DECODER_CTRL, CXL_BI_DECODER_REGISTERS_OFFSET + 0x4) + FIELD(CXL_BI_DECODER_CTRL, BI_FW, 0, 1) + FIELD(CXL_BI_DECODER_CTRL, BI_ENABLE, 1, 1) + FIELD(CXL_BI_DECODER_CTRL, COMMIT, 2, 1) +REG32(CXL_BI_DECODER_STATUS, CXL_BI_DECODER_REGISTERS_OFFSET + 0x8) + FIELD(CXL_BI_DECODER_STATUS, COMMITTED, 0, 1) + FIELD(CXL_BI_DECODER_STATUS, ERR_NOT_COMMITTED, 1, 1) + FIELD(CXL_BI_DECODER_STATUS, COMMIT_TMO_SCALE, 8, 4) + FIELD(CXL_BI_DECODER_STATUS, COMMIT_TMO_BASE, 12, 4) + +QEMU_BUILD_BUG_MSG ((CXL_BI_DECODER_REGISTERS_OFFSET + +CXL_BI_DECODER_REGISTERS_SIZE ) >=0x1000 ,"No space for registers" ); +/* track BI explicit commit handling for route table and decoder */ +enum { +CXL_BISTATE_RT =0 , +CXL_BISTATE_DECODER , +CXL_BISTATE_MAX +}; + +typedef struct bi_state { +uint64_t last_commit;/* last 0->1 transition */ +}BIState ; + typedef struct component_registers { /* * Main memory region to be registered with QEMU core.@@ -259,6 +306,7 @@ typedef struct cxl_component { };CDATObject cdat; +BIState bi_state[CXL_BISTATE_MAX ]; } CXLComponentState; void cxl_component_register_block_init(Object *obj,@@ -266,7 +314,7 @@ void cxl_component_register_block_init(Object *obj, const char *type);void cxl_component_register_init_common (uint32_t *reg_state,uint32_t *write_msk, -enum reg_type type); +enum reg_type type,bool bi); void cxl_component_create_dvsec(CXLComponentState *cxl_cstate, enum reg_type cxl_dev_type, uint16_t length,include/hw/cxl/cxl_device.h +3
-0@@ -625,6 +625,9 @@ struct CXLType3Dev {CXLMemECSReadAttrs ecs_attrs;CXLMemECSWriteAttrs ecs_wr_attrs; +/* BI flows */ +bool hdmdb; +struct dynamic_capacity {HostMemoryBackend *host_dc;AddressSpace host_dc_as;hw/cxl/cxl-component-utils.c +33
-3@@ -71,10 +71,40 @@ static uint64_t cxl_cache_mem_read_reg(void *opaque, hwaddr offset,case 4 :if (cregs->special_ops && cregs->special_ops->read) {return cregs->special_ops->read (cxl_cstate, offset,4 ); - }else { -QEMU_BUILD_BUG_ON (sizeof (*cregs->cache_mem_registers) !=4 ); -return cregs->cache_mem_registers[offset /4 ]; } + +QEMU_BUILD_BUG_ON (sizeof (*cregs->cache_mem_registers) !=4 ); + +if (offset ==A_CXL_BI_RT_STATUS || + offset ==A_CXL_BI_DECODER_STATUS ) { +int type; +uint64_t started; + + type = (offset ==A_CXL_BI_RT_STATUS ) ? +CXL_BISTATE_RT :CXL_BISTATE_DECODER ; + started = cxl_cstate->bi_state[type].last_commit; + +if (started) { +uint32_t *cache_mem = cregs->cache_mem_registers; +uint32_t val = cache_mem[offset /4 ]; +uint64_t now; +int set; + + now =qemu_clock_get_ms (QEMU_CLOCK_VIRTUAL ); +/* arbitrary 100 ms to do the commit */ + set = !!(now >= started +100 ); + +if (offset ==A_CXL_BI_RT_STATUS ) { + val =FIELD_DP32 (val,CXL_BI_RT_STATUS ,COMMITTED , set); + }else { + val =FIELD_DP32 (val,CXL_BI_DECODER_STATUS ,COMMITTED , + set); + } +stl_le_p ((uint8_t *)cache_mem + offset, val); + } + } + +return cregs->cache_mem_registers[offset /4 ];case 8 :qemu_log_mask (LOG_UNIMP ,"CXL 8 byte cache mem registers not implemented\n" );
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 157
Quoted 10 lines
hw/cxl/cxl-component-utils.c +7
-0@@ -118,6 +148,47 @@ static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset,stl_le_p ((uint8_t *)cache_mem + offset, value); } +static void bi_handler (CXLComponentState *cxl_cstate,hwaddr offset, +uint32_t value) +{ +ComponentRegisters *cregs = &cxl_cstate->crb; +uint32_t sts, *cache_mem = cregs->cache_mem_registers; +bool to_commit = false; +int type;
type is declared here...
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 167
Quoted 10 lines
hw/cxl/cxl-component-utils.c +10
-0+ +switch (offset) { +case A_CXL_BI_RT_CTRL : + to_commit =FIELD_EX32 (value,CXL_BI_RT_CTRL ,COMMIT ); +if (to_commit) { + sts =cxl_cache_mem_read_reg (cxl_cstate, +R_CXL_BI_RT_STATUS ,4 ); + sts =FIELD_DP32 (sts,CXL_BI_RT_STATUS ,COMMITTED ,0 ); +stl_le_p ((uint8_t *)cache_mem +R_CXL_BI_RT_STATUS , sts); + type =CXL_BISTATE_RT ;
and initialized here
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 177
Quoted 10 lines
hw/cxl/cxl-component-utils.c +10
-0+ } +break ; +case A_CXL_BI_DECODER_CTRL : + to_commit =FIELD_EX32 (value,CXL_BI_DECODER_CTRL ,COMMIT ); +if (to_commit) { + sts =cxl_cache_mem_read_reg (cxl_cstate, +R_CXL_BI_DECODER_STATUS ,4 ); + sts =FIELD_DP32 (sts,CXL_BI_DECODER_STATUS ,COMMITTED ,0 ); +stl_le_p ((uint8_t *)cache_mem +R_CXL_BI_DECODER_STATUS , sts); + type =CXL_BISTATE_DECODER ;
and here
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 186
Quoted 9 lines
hw/cxl/cxl-component-utils.c +9
-0+ } +break ; +default : +break ; + } + +if (to_commit) { + cxl_cstate->bi_state[type].last_commit = +qemu_clock_get_ms (QEMU_CLOCK_VIRTUAL );
so there is no way for it to be used uninitialized.
However some gcc versions are not smart enough to see that and they warn:
https://gitlab.com/mstredhat/qemu/-/jobs/12972572228
../hw/cxl/cxl-component-utils.c: In function ‘cxl_cache_mem_write_reg’:../hw/cxl/cxl-component-utils.c:181:48: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
181 | cxl_cstate->bi_state[type].last_commit =
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
182 | qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../hw/cxl/cxl-component-utils.c:153:9: note: ‘type’ was declared here
153 | int type;
| ^~~~cc1: all warnings being treated as errors
Quoted 206 lines
hw/cxl/cxl-component-utils.c +66
-4+ } + +stl_le_p ((uint8_t *)cache_mem + offset, value); +} +static void cxl_cache_mem_write_reg (void *opaque,hwaddr offset,uint64_t value,unsigned size) {@@ -141,6 +212,9 @@ static void cxl_cache_mem_write_reg(void *opaque, hwaddr offset, uint64_t value,if (offset >=A_CXL_HDM_DECODER_CAPABILITY && offset <=A_CXL_HDM_DECODER3_TARGET_LIST_HI ) {dumb_hdm_handler (cxl_cstate, offset, value); + }else if (offset ==A_CXL_BI_RT_CTRL || + offset ==A_CXL_BI_DECODER_CTRL ) { +bi_handler (cxl_cstate, offset, value); }else { cregs->cache_mem_registers[offset /4 ] = value; }@@ -230,7 +304,7 @@ static void ras_init_common(uint32_t *reg_state, uint32_t *write_msk) }static void hdm_init_common (uint32_t *reg_state,uint32_t *write_msk, -enum reg_type type) +enum reg_type type,bool bi) {int decoder_count =CXL_HDM_DECODER_COUNT ;int hdm_inc =R_CXL_HDM_DECODER1_BASE_LO -R_CXL_HDM_DECODER0_BASE_LO ;@@ -255,7 +329,9 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk, UIO_DECODER_COUNT, 0);ARRAY_FIELD_DP32 (reg_state,CXL_HDM_DECODER_CAPABILITY ,MEMDATA_NXM_CAP ,0 );ARRAY_FIELD_DP32 (reg_state,CXL_HDM_DECODER_CAPABILITY , -SUPPORTED_COHERENCY_MODEL ,0 );/* Unknown */ +SUPPORTED_COHERENCY_MODEL , +/* host+dev or Unknown */ + type ==CXL2_TYPE3_DEVICE && bi ?3 :0 );ARRAY_FIELD_DP32 (reg_state,CXL_HDM_DECODER_GLOBAL_CONTROL ,HDM_DECODER_ENABLE ,0 ); write_msk[R_CXL_HDM_DECODER_GLOBAL_CONTROL ] =0x3 ;@@ -278,9 +354,43 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk, } } +static void bi_rt_init_common (uint32_t *reg_state,uint32_t *write_msk) +{ +/* switch usp must commit the new BI-ID, timeout of 2secs */ +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_CAPABILITY ,EXPLICIT_COMMIT ,1 ); + +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_CTRL ,COMMIT ,0 ); + write_msk[R_CXL_BI_RT_CTRL ] =0x1 ; + +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_STATUS ,COMMITTED ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_STATUS ,ERR_NOT_COMMITTED ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_STATUS ,COMMIT_TMO_SCALE ,0x6 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_RT_STATUS ,COMMIT_TMO_BASE ,0x2 ); +} + +static void bi_decoder_init_common (uint32_t *reg_state,uint32_t *write_msk, +enum reg_type type) +{ +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_CAPABILITY ,HDM_D ,0 ); +/* switch dsp must commit the new BI-ID, timeout of 2secs */ +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_CAPABILITY ,EXPLICIT_COMMIT , + (type !=CXL2_ROOT_PORT && type !=CXL2_TYPE3_DEVICE )); + +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_CTRL ,BI_FW ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_CTRL ,BI_ENABLE ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_CTRL ,COMMIT ,0 ); + write_msk[R_CXL_BI_DECODER_CTRL ] =0x7 ; + +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_STATUS ,COMMITTED ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_STATUS ,ERR_NOT_COMMITTED ,0 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_STATUS ,COMMIT_TMO_SCALE ,0x6 ); +ARRAY_FIELD_DP32 (reg_state,CXL_BI_DECODER_STATUS ,COMMIT_TMO_BASE ,0x2 ); +} +void cxl_component_register_init_common (uint32_t *reg_state,uint32_t *write_msk, -enum reg_type type) +enum reg_type type, +bool bi) {int caps =0 ;@@ -320,7 +430,7 @@ void cxl_component_register_init_common(uint32_t *reg_state,case CXL2_LOGICAL_DEVICE :/* + HDM */ init_cap_reg (HDM ,5 ,1 ); -hdm_init_common (reg_state, write_msk, type); +hdm_init_common (reg_state, write_msk, type, bi);/* fallthrough */ case CXL2_DOWNSTREAM_PORT :case CXL2_DEVICE :@@ -335,6 +445,24 @@ void cxl_component_register_init_common(uint32_t *reg_state,abort (); } +/* back invalidate */ +if (bi) { +switch (type) { +case CXL2_UPSTREAM_PORT : +init_cap_reg (BI_RT ,11 ,CXL_BI_RT_CAP_VERSION ); +bi_rt_init_common (reg_state, write_msk); +break ; +case CXL2_ROOT_PORT : +case CXL2_DOWNSTREAM_PORT : +case CXL2_TYPE3_DEVICE : +init_cap_reg (BI_DECODER ,12 ,CXL_BI_DECODER_CAP_VERSION ); +bi_decoder_init_common (reg_state, write_msk, type); +break ; +default : +break ; + } + } +ARRAY_FIELD_DP32 (reg_state,CXL_CAPABILITY_HEADER ,ARRAY_SIZE , caps);#undef init_cap_reg }hw/mem/cxl_type3.c +8
-1@@ -748,6 +748,11 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp)return false; } +if (!ct3d->flitmode && ct3d->hdmdb) { +error_setg (errp,"hdm-db requires operating in 256b flit" ); +return false; + } +if (ct3d->hostvmem) {MemoryRegion *vmr;char *v_name;@@ -1247,7 +1252,8 @@ static void ct3d_reset(DeviceState *dev)pcie_cap_fill_link_ep_usp (PCI_DEVICE (dev), ct3d->width, ct3d->speed, ct3d->flitmode); -cxl_component_register_init_common (reg_state, write_msk,CXL2_TYPE3_DEVICE ); +cxl_component_register_init_common (reg_state, write_msk, +CXL2_TYPE3_DEVICE , ct3d->hdmdb);cxl_device_register_init_t3 (ct3d,CXL_T3_MSIX_MBOX );/* @@ -1286,6 +1292,7 @@ static const Property ct3_props[] = {DEFINE_PROP_PCIE_LINK_WIDTH ("x-width" , CXLType3Dev, width,PCIE_LINK_WIDTH_16 ),DEFINE_PROP_BOOL ("x-256b-flit" , CXLType3Dev, flitmode, false), + DEFINE_PROP_BOOL("hdm-db", CXLType3Dev, hdmdb, false), };static uint64_t get_lsa_size (CXLType3Dev *ct3d)hw/pci-bridge/cxl_downstream.c +1
-1@@ -39,7 +39,7 @@ static void latch_registers(CXLDownstreamPort *dsp)uint32_t *write_msk = dsp->cxl_cstate.crb.cache_mem_regs_write_mask;cxl_component_register_init_common (reg_state, write_msk, -CXL2_DOWNSTREAM_PORT ); +CXL2_DOWNSTREAM_PORT , true); }/* TODO: Look at sharing this code across all CXL port types */ hw/pci-bridge/cxl_root_port.c +2
-1@@ -101,7 +101,8 @@ static void latch_registers(CXLRootPort *crp)uint32_t *reg_state = crp->cxl_cstate.crb.cache_mem_registers;uint32_t *write_msk = crp->cxl_cstate.crb.cache_mem_regs_write_mask; -cxl_component_register_init_common (reg_state, write_msk,CXL2_ROOT_PORT ); +cxl_component_register_init_common (reg_state, write_msk,CXL2_ROOT_PORT , + true); }static void build_dvsecs (PCIDevice *d,CXLComponentState *cxl)hw/pci-bridge/cxl_upstream.c +1
-1@@ -90,7 +90,7 @@ static void latch_registers(CXLUpstreamPort *usp)uint32_t *write_msk = usp->cxl_cstate.crb.cache_mem_regs_write_mask;cxl_component_register_init_common (reg_state, write_msk, -CXL2_UPSTREAM_PORT ); +CXL2_UPSTREAM_PORT , usp->flitmode);ARRAY_FIELD_DP32 (reg_state,CXL_HDM_DECODER_CAPABILITY ,TARGET_COUNT ,8 ); }hw/pci-bridge/pci_expander_bridge.c +1
-1@@ -301,7 +301,7 @@ static void pxb_cxl_dev_reset(DeviceState *dev)uint32_t *write_msk = cxl_cstate->crb.cache_mem_regs_write_mask;int dsp_count =0 ; -cxl_component_register_init_common (reg_state, write_msk,CXL2_RC ); +cxl_component_register_init_common (reg_state, write_msk,CXL2_RC , false);/* * The CXL specification allows for host bridges with no HDM decoders * if they only have a single root port. Signature · 1 line
2.48.1
Re: [PATCH qemu v5 6/7] hw/cxl: Support type3 HDM-DB
Quoted 68 lines
Quoted 8 lines
hw/cxl/cxl-component-utils.c +3
-0+ } + +return cregs->cache_mem_registers[offset /4 ];case 8 :qemu_log_mask (LOG_UNIMP ,"CXL 8 byte cache mem registers not implemented\n" );hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 157
Quoted 10 lines
hw/cxl/cxl-component-utils.c +7
-0@@ -118,6 +148,47 @@ static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset,stl_le_p ((uint8_t *)cache_mem + offset, value); } +static void bi_handler (CXLComponentState *cxl_cstate,hwaddr offset, +uint32_t value) +{ +ComponentRegisters *cregs = &cxl_cstate->crb; +uint32_t sts, *cache_mem = cregs->cache_mem_registers; +bool to_commit = false; +int type;type is declared here...
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 167
Quoted 10 lines
hw/cxl/cxl-component-utils.c +10
-0+ +switch (offset) { +case A_CXL_BI_RT_CTRL : + to_commit =FIELD_EX32 (value,CXL_BI_RT_CTRL ,COMMIT ); +if (to_commit) { + sts =cxl_cache_mem_read_reg (cxl_cstate, +R_CXL_BI_RT_STATUS ,4 ); + sts =FIELD_DP32 (sts,CXL_BI_RT_STATUS ,COMMITTED ,0 ); +stl_le_p ((uint8_t *)cache_mem +R_CXL_BI_RT_STATUS , sts); + type =CXL_BISTATE_RT ;and initialized here
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 177
Quoted 10 lines
hw/cxl/cxl-component-utils.c +10
-0+ } +break ; +case A_CXL_BI_DECODER_CTRL : + to_commit =FIELD_EX32 (value,CXL_BI_DECODER_CTRL ,COMMIT ); +if (to_commit) { + sts =cxl_cache_mem_read_reg (cxl_cstate, +R_CXL_BI_DECODER_STATUS ,4 ); + sts =FIELD_DP32 (sts,CXL_BI_DECODER_STATUS ,COMMITTED ,0 ); +stl_le_p ((uint8_t *)cache_mem +R_CXL_BI_DECODER_STATUS , sts); + type =CXL_BISTATE_DECODER ;and here
hw/cxl/cxl-component-utils.c static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset, · line 186
Quoted 9 lines
hw/cxl/cxl-component-utils.c +9
-0+ } +break ; +default : +break ; + } + +if (to_commit) { + cxl_cstate->bi_state[type].last_commit = +qemu_clock_get_ms (QEMU_CLOCK_VIRTUAL );so there is no way for it to be used uninitialized.
However some gcc versions are not smart enough to see that and they warn:
https://gitlab.com/mstredhat/qemu/-/jobs/12972572228
../hw/cxl/cxl-component-utils.c: In function ‘cxl_cache_mem_write_reg’:../hw/cxl/cxl-component-utils.c:181:48: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Quoted 9 lines
181 | cxl_cstate->bi_state[type].last_commit = | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 182 | qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../hw/cxl/cxl-component-utils.c:153:9: note: ‘type’ was declared here 153 | int type; | ^~~~cc1: all warnings being treated as errors
Thanks. I'll set it to 0 at declaration with a comment that it's there to resolve a compiler warning (so no one deletes it as a cleanup!)
Jonathan
PATCH v5 7/7 hw/cxl: Remove register special_ops->read()
In reply to Jonathan CameronFrom: Davidlohr Bueso <[email protected]>
... this is unused, unlike its write counterpart.
--- hw/cxl/cxl-component-utils.c | 4 ---- 1 file changed, 4 deletions(-)
hw/cxl/cxl-component-utils.c +0 -4
@@ -69,10 +69,6 @@ static uint64_t cxl_cache_mem_read_reg(void *opaque, hwaddr offset,switch (size) {case 4 : -if (cregs->special_ops && cregs->special_ops->read) { -return cregs->special_ops->read (cxl_cstate, offset,4 ); - } -QEMU_BUILD_BUG_ON (sizeof (*cregs->cache_mem_registers) !=4 ); if (offset == A_CXL_BI_RT_STATUS ||
Signature · 1 line
2.48.1
Quoted 8 lines · Jonathan Cameron
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.
I have tried my kernel side stuff with these patches and they work correctly (direct attached and switches). I also went through them and did not find any issues.
Thanks,
Davidlohr
Quoted 7 lines · Jonathan Cameron
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.
applying this on top does seem to conflict.
let me get rest merged then this can be rebased.
Quoted 52 lines
v5 changes:
- Rebase much earlier in the CXL queue as Davidlohr had it beind some stuff I was carrying that is not ready for upstream just yet.
- Update the CFMWS flags directly as the patch doing restriction control needs some more thought.
- Bios tables test data updates.
- Don't provide flit mode control forgen_pcie_root_portas we don't need it for the rest of the series which is all about CXL.The following allows support for component basic back invalidation discovery and config, by exposing the BI routing table and decoder registers. Instead of going the type2[0] route, this series proposes adding support for type3 hdm-db, which allows a more direct way of supporting BI in qemu.
As BI is a dependent on the larger flits introduced in PCIe (and CXL 3.0) add support for enabling that for CXL components. Negotiation is handled via an equivalent of what we do for link speed.
Davidlohr Bueso (3):
hw/pcie: Support enabling flit mode
hw/cxl: Support type3 HDM-DB
hw/cxl: Remove registerspecial_ops->read()Ira Weiny (1):
hw/cxl: Refactor component register initializationJonathan Cameron (3):
tests/bios-tables-test: Excluded CEDT.cxl for BI restriction
relaxation.
hw/cxl: Update CXL Fixed Memory Window ACPI description to include
Back Invalidate support.
tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMSdocs/system/devices/cxl.rst | 23 +++ include/hw/cxl/cxl_component.h | 87 +++++++-- include/hw/cxl/cxl_device.h | 4 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/acpi/cxl.c | 2 +- hw/cxl/cxl-component-utils.c | 211 ++++++++++++++++------ hw/mem/cxl_type3.c | 15 +- hw/pci-bridge/cxl_downstream.c | 10 +- hw/pci-bridge/cxl_root_port.c | 11 +- hw/pci-bridge/cxl_upstream.c | 18 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci/pcie.c | 23 ++- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 15 files changed, 313 insertions(+), 97 deletions(-)Signature · 1 line
2.48.1
Quoted 11 lines · On Tue, 3 Feb 2026 15:39:22 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 7 lines · Jonathan Cameron
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.applying this on top does seem to conflict.
let me get rest merged then this can be rebased.
Hi Michael
So I assume this is your v01-04-02-2026 branch.
I tried rebasing on that and ran into some issue.
Looks like you have a stale version of
[PATCH qemu v4 0/5] cxl: r3.2 specification event updates.
https://lore.kernel.org/all/[email protected]/
Markus had some comments that needed a new version.
Mostly updating a few more version numbers in the comments to keep things consistent.
Not sure that has anything to do with the merge conflict.
Quoted 56 lines
Quoted 53 lines
v5 changes:
- Rebase much earlier in the CXL queue as Davidlohr had it beind some stuff I was carrying that is not ready for upstream just yet.
- Update the CFMWS flags directly as the patch doing restriction control needs some more thought.
- Bios tables test data updates.
- Don't provide flit mode control forgen_pcie_root_portas we don't need it for the rest of the series which is all about CXL.The following allows support for component basic back invalidation discovery and config, by exposing the BI routing table and decoder registers. Instead of going the type2[0] route, this series proposes adding support for type3 hdm-db, which allows a more direct way of supporting BI in qemu.
As BI is a dependent on the larger flits introduced in PCIe (and CXL 3.0) add support for enabling that for CXL components. Negotiation is handled via an equivalent of what we do for link speed.
Davidlohr Bueso (3):
hw/pcie: Support enabling flit mode
hw/cxl: Support type3 HDM-DB
hw/cxl: Remove registerspecial_ops->read()Ira Weiny (1):
hw/cxl: Refactor component register initializationJonathan Cameron (3):
tests/bios-tables-test: Excluded CEDT.cxl for BI restriction
relaxation.
hw/cxl: Update CXL Fixed Memory Window ACPI description to include
Back Invalidate support.
tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMSdocs/system/devices/cxl.rst | 23 +++ include/hw/cxl/cxl_component.h | 87 +++++++-- include/hw/cxl/cxl_device.h | 4 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/acpi/cxl.c | 2 +- hw/cxl/cxl-component-utils.c | 211 ++++++++++++++++------ hw/mem/cxl_type3.c | 15 +- hw/pci-bridge/cxl_downstream.c | 10 +- hw/pci-bridge/cxl_root_port.c | 11 +- hw/pci-bridge/cxl_upstream.c | 18 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci/pcie.c | 23 ++- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 15 files changed, 313 insertions(+), 97 deletions(-)Signature · 1 line
2.48.1
Quoted 20 lines · On Wed, 4 Feb 2026 11:12:02 +0000 Jonathan Cameron via qemu development…
Quoted 11 lines · On Tue, 3 Feb 2026 15:39:22 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 7 lines · Jonathan Cameron
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.applying this on top does seem to conflict.
let me get rest merged then this can be rebased.Hi Michael
So I assume this is your v01-04-02-2026 branch.
I tried rebasing on that and ran into some issue.
Quoted 8 lines
Looks like you have a stale version of
[PATCH qemu v4 0/5] cxl: r3.2 specification event updates.
https://lore.kernel.org/all/[email protected]/Markus had some comments that needed a new version.
Mostly updating a few more version numbers in the comments to keep things consistent.Not sure that has anything to do with the merge conflict.
Looks like it was a context change that trips git up.
I'll post a rebased version 6 on top of the 3 series that I think should merge before this one. (It might be fine to pass with the media operations fixes one as that is pretty tightly isolated).
Thanks
Jonathan
Quoted 59 lines
Quoted 57 lines
Quoted 54 lines
v5 changes:
- Rebase much earlier in the CXL queue as Davidlohr had it beind some stuff I was carrying that is not ready for upstream just yet.
- Update the CFMWS flags directly as the patch doing restriction control needs some more thought.
- Bios tables test data updates.
- Don't provide flit mode control forgen_pcie_root_portas we don't need it for the rest of the series which is all about CXL.The following allows support for component basic back invalidation discovery and config, by exposing the BI routing table and decoder registers. Instead of going the type2[0] route, this series proposes adding support for type3 hdm-db, which allows a more direct way of supporting BI in qemu.
As BI is a dependent on the larger flits introduced in PCIe (and CXL 3.0) add support for enabling that for CXL components. Negotiation is handled via an equivalent of what we do for link speed.
Davidlohr Bueso (3):
hw/pcie: Support enabling flit mode
hw/cxl: Support type3 HDM-DB
hw/cxl: Remove registerspecial_ops->read()Ira Weiny (1):
hw/cxl: Refactor component register initializationJonathan Cameron (3):
tests/bios-tables-test: Excluded CEDT.cxl for BI restriction
relaxation.
hw/cxl: Update CXL Fixed Memory Window ACPI description to include
Back Invalidate support.
tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMSdocs/system/devices/cxl.rst | 23 +++ include/hw/cxl/cxl_component.h | 87 +++++++-- include/hw/cxl/cxl_device.h | 4 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/acpi/cxl.c | 2 +- hw/cxl/cxl-component-utils.c | 211 ++++++++++++++++------ hw/mem/cxl_type3.c | 15 +- hw/pci-bridge/cxl_downstream.c | 10 +- hw/pci-bridge/cxl_root_port.c | 11 +- hw/pci-bridge/cxl_upstream.c | 18 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci/pcie.c | 23 ++- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 15 files changed, 313 insertions(+), 97 deletions(-)Signature · 1 line
2.48.1
Quoted 18 lines · Jonathan Cameron
Quoted 11 lines · On Tue, 3 Feb 2026 15:39:22 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 7 lines · Jonathan Cameron
Lightly reworked version of Davidlohr's v4.
https://lore.kernel.org/qemu-devel/[email protected]/Whilst I have several other series posted for merge this applies fine to upstream, so no dependencies.
Davidlohr, please check I didn't mess anthing up and perhaps give tags for the 3 new patches.applying this on top does seem to conflict.
let me get rest merged then this can be rebased.Hi Michael
So I assume this is your v01-04-02-2026 branch.
Quoted 8 lines
I tried rebasing on that and ran into some issue.
Looks like you have a stale version of
[PATCH qemu v4 0/5] cxl: r3.2 specification event updates.
https://lore.kernel.org/all/[email protected]/Markus had some comments that needed a new version.
Mostly updating a few more version numbers in the comments to keep things consistent.
Right and *that* now has review comments so it looks like there will be v5 ...
Quoted 59 lines
Not sure that has anything to do with the merge conflict.
Quoted 56 lines
Quoted 53 lines
v5 changes:
- Rebase much earlier in the CXL queue as Davidlohr had it beind some stuff I was carrying that is not ready for upstream just yet.
- Update the CFMWS flags directly as the patch doing restriction control needs some more thought.
- Bios tables test data updates.
- Don't provide flit mode control forgen_pcie_root_portas we don't need it for the rest of the series which is all about CXL.The following allows support for component basic back invalidation discovery and config, by exposing the BI routing table and decoder registers. Instead of going the type2[0] route, this series proposes adding support for type3 hdm-db, which allows a more direct way of supporting BI in qemu.
As BI is a dependent on the larger flits introduced in PCIe (and CXL 3.0) add support for enabling that for CXL components. Negotiation is handled via an equivalent of what we do for link speed.
Davidlohr Bueso (3):
hw/pcie: Support enabling flit mode
hw/cxl: Support type3 HDM-DB
hw/cxl: Remove registerspecial_ops->read()Ira Weiny (1):
hw/cxl: Refactor component register initializationJonathan Cameron (3):
tests/bios-tables-test: Excluded CEDT.cxl for BI restriction
relaxation.
hw/cxl: Update CXL Fixed Memory Window ACPI description to include
Back Invalidate support.
tests/acpi/cxl: Update CEDT.cxl to allow BI in CFWMSdocs/system/devices/cxl.rst | 23 +++ include/hw/cxl/cxl_component.h | 87 +++++++-- include/hw/cxl/cxl_device.h | 4 + include/hw/pci-bridge/cxl_upstream_port.h | 1 + include/hw/pci/pcie.h | 2 +- include/hw/pci/pcie_port.h | 1 + hw/acpi/cxl.c | 2 +- hw/cxl/cxl-component-utils.c | 211 ++++++++++++++++------ hw/mem/cxl_type3.c | 15 +- hw/pci-bridge/cxl_downstream.c | 10 +- hw/pci-bridge/cxl_root_port.c | 11 +- hw/pci-bridge/cxl_upstream.c | 18 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci/pcie.c | 23 ++- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 15 files changed, 313 insertions(+), 97 deletions(-)Signature · 1 line
2.48.1