All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cheng <icheng@nvidia.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	 Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	 Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <iweiny@kernel.org>, Li Ming <ming.li@zohomail.com>,
	 linux-cxl@vger.kernel.org
Subject: Re: [PATCH v3 2/2] cxl/test: Add a 2-way 16K root decoder for passthrough testing
Date: Fri, 31 Jul 2026 15:44:18 +0800	[thread overview]
Message-ID: <amxRzTxrPiwhlsx1@MWDK4CY14F> (raw)
In-Reply-To: <e89552a2c51b63657da50c9286d48ab858016721.1784940306.git.alison.schofield@intel.com>

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 <alison.schofield@intel.com>
> ---
>  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 <icheng@nvidia.com>

Best regards,
Richard Cheng.

  reply	other threads:[~2026-07-31  7:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  1:08 [PATCH v3 0/2] cxl: Allow passthrough decoders with >16K granularity Alison Schofield
2026-07-25  1:08 ` [PATCH v3 1/2] cxl/region: " Alison Schofield
2026-07-25  1:26   ` sashiko-bot
2026-07-25  1:42     ` Alison Schofield
2026-07-31  7:41   ` Richard Cheng
2026-09-04  3:17     ` Alison Schofield
2026-07-25  1:08 ` [PATCH v3 2/2] cxl/test: Add a 2-way 16K root decoder for passthrough testing Alison Schofield
2026-07-31  7:44   ` Richard Cheng [this message]
2026-09-04  3:12     ` Alison Schofield
2026-07-27 23:36 ` [PATCH v3 0/2] cxl: Allow passthrough decoders with >16K granularity Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amxRzTxrPiwhlsx1@MWDK4CY14F \
    --to=icheng@nvidia.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.