Re: [PATCH v3 2/2] cxl/test: Add a 2-way 16K root decoder for passthrough testing
Richard Cheng <[email protected]> Fri, 31 Jul 2026 15:44:18 +0800
| Newsgroups | org.kernel.vger.linux-cxl |
|---|---|
| Message-ID | <amxRzTxrPiwhlsx1@MWDK4CY14F> |
On Fri, Jul 24, 2026 at 06:08:55PM +0800, Alison Schofield wrote: > The cxl-test topologies do not provide a configuration where pass- > through decoders compute a granularity above the 16K max encodable > in hardware. The widest power-of-2 root decoder currently available > is 2-way at 4K granularity, so a passthrough decoder below it > computes at most 16K. > I think 2-way with 4K granularity computes 8K, not 16K. The conclusion does hold, just the number. > Add a CFMWS entry for a 2-way root decoder at 16K granularity. This > topology supports a region configuration spanning the two multi-port > host bridges and placing one endpoint under each bridge. The > intermediate switch decoders are then passthrough decoders with a > computed granularity of 32K. > > This allows a CXL unit test to be added for this case. > > Place the new window in the XOR topology set so the default modulo > topology used by most cxl-test coverage is unchanged. > > Assisted-by: Claude:Opus-4-8 > Signed-off-by: Alison Schofield <[email protected]> > --- > tools/testing/cxl/test/cxl.c | 48 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 46 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c > index ef92dd35e030..5b87a3f5673f 100644 > --- a/tools/testing/cxl/test/cxl.c > +++ b/tools/testing/cxl/test/cxl.c > @@ -188,10 +188,18 @@ static struct { > struct acpi_cedt_cfmws cfmws; > u32 target[3]; > } cfmws8; > + struct { > + struct acpi_cedt_cfmws cfmws; > + u32 target[2]; > + } cfmws9; > struct { > struct acpi_cedt_cxims cxims; > u64 xormap_list[2]; > } cxims0; > + struct { > + struct acpi_cedt_cxims cxims; > + u64 xormap_list[1]; > + } cxims1; > } __packed mock_cedt = { > .cedt = { > .header = { > @@ -371,6 +379,28 @@ static struct { > }, > .target = { 0, 1, 2, }, > }, > + /* > + * A 2-way root at 16K granularity. A passthrough decoder below this > + * root computes a 32K granularity (16K * 2), which exceeds the maximum > + * encodable in hardware. It exercises the passthrough granularity path > + * in cxl_port_setup_targets(). > + */ > + .cfmws9 = { > + .cfmws = { > + .header = { > + .type = ACPI_CEDT_TYPE_CFMWS, > + .length = sizeof(mock_cedt.cfmws9), > + }, > + .interleave_arithmetic = ACPI_CEDT_CFMWS_ARITHMETIC_XOR, > + .interleave_ways = 1, > + .granularity = 6, > + .restrictions = ACPI_CEDT_CFMWS_RESTRICT_HOSTONLYMEM | > + ACPI_CEDT_CFMWS_RESTRICT_PMEM, > + .qtg_id = FAKE_QTG_ID, > + .window_size = SZ_256M * 8UL, > + }, > + .target = { 0, 1, }, > + }, > .cxims0 = { > .cxims = { > .header = { > @@ -382,6 +412,18 @@ static struct { > }, > .xormap_list = { 0x404100, 0x808200, }, > }, > + /* CXIMS for the 16K (hbig = 6) 2-way root, cfmws9 */ > + .cxims1 = { > + .cxims = { > + .header = { > + .type = ACPI_CEDT_TYPE_CXIMS, > + .length = sizeof(mock_cedt.cxims1), > + }, > + .hbig = 6, > + .nr_xormaps = 1, > + }, > + .xormap_list = { 0x0, }, > + }, > }; > > struct acpi_cedt_cfmws *mock_cfmws[] = { > @@ -395,6 +437,7 @@ struct acpi_cedt_cfmws *mock_cfmws[] = { > [6] = &mock_cedt.cfmws6.cfmws, > [7] = &mock_cedt.cfmws7.cfmws, > [8] = &mock_cedt.cfmws8.cfmws, > + [9] = &mock_cedt.cfmws9.cfmws, > }; > > static int cfmws_start; > @@ -402,10 +445,11 @@ static int cfmws_end; > #define CFMWS_MOD_ARRAY_START 0 > #define CFMWS_MOD_ARRAY_END 5 > #define CFMWS_XOR_ARRAY_START 6 > -#define CFMWS_XOR_ARRAY_END 8 > +#define CFMWS_XOR_ARRAY_END 9 > > -struct acpi_cedt_cxims *mock_cxims[1] = { > +struct acpi_cedt_cxims *mock_cxims[2] = { > [0] = &mock_cedt.cxims0.cxims, > + [1] = &mock_cedt.cxims1.cxims, > }; > > struct cxl_mock_res { > -- > 2.37.3 > > Reviewed-by: Richard Cheng <[email protected]> Best regards, Richard Cheng.