Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <dave@stgolabs.net>,
	<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
	<ira.weiny@intel.com>, <dan.j.williams@intel.com>
Subject: Re: [PATCH] cxl: Add hpa_to_spa to the root decoder callback operations
Date: Fri, 11 Jul 2025 17:45:30 +0100	[thread overview]
Message-ID: <20250711174530.0000291a@huawei.com> (raw)
In-Reply-To: <20250709200746.2567860-1-dave.jiang@intel.com>

On Wed, 9 Jul 2025 13:07:46 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> Remove cxl_hpa_to_spa_fn callback from cxl root decoder and add the
> callback function to cxl_decoder_ops. Refactor to group all the root
> decoder callbacks together.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Question inline about mixture of types of CFMWS entry.

> ---
>  drivers/cxl/acpi.c        |  9 +++++++--
>  drivers/cxl/core/port.c   |  2 +-
>  drivers/cxl/core/region.c | 11 ++++++++---
>  drivers/cxl/cxl.h         | 13 ++++++++-----
>  4 files changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index 48478bc406ee..9f7e2a49dc5a 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -20,6 +20,10 @@ static const guid_t acpi_cxl_qtg_id_guid =
>  	GUID_INIT(0xF365F9A6, 0xA7DE, 0x4071,
>  		  0xA6, 0x6A, 0xB4, 0x0C, 0x0B, 0x4F, 0x8E, 0x52);
>  
> +static u64 cxl_default_hpa_to_spa(struct cxl_root_decoder *cxlrd, u64 hpa)
> +{
> +	return hpa;
> +}
>  
>  static u64 cxl_xor_hpa_to_spa(struct cxl_root_decoder *cxlrd, u64 hpa)
>  {
> @@ -342,8 +346,9 @@ static int cxl_acpi_get_extended_linear_cache_size(struct resource *backing_res,
>  	return hmat_get_extended_linear_cache_size(backing_res, nid, size);
>  }
>  
> -static const struct cxl_rd_ops acpi_rd_ops = {
> +static struct cxl_rd_ops acpi_rd_ops = {
>  	.get_extended_linear_cache_size = cxl_acpi_get_extended_linear_cache_size,
> +	.hpa_to_spa = cxl_default_hpa_to_spa,
>  };
>  
>  DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
> @@ -425,7 +430,7 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
>  	cxlrd->qos_class = cfmws->qtg_id;
>  
>  	if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR)
> -		cxlrd->hpa_to_spa = cxl_xor_hpa_to_spa;
> +		cxlrd->ops->hpa_to_spa = cxl_xor_hpa_to_spa;

What happens if we have a mixture for different CMWS entries?
Some xor, some not.

>  
>  	rc = cxl_decoder_add(cxld, target_map);
>  	if (rc)

  parent reply	other threads:[~2025-07-11 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 20:07 [PATCH] cxl: Add hpa_to_spa to the root decoder callback operations Dave Jiang
2025-07-10  4:02 ` Alison Schofield
2025-07-11 16:45 ` Jonathan Cameron [this message]
2025-07-11 18:41   ` Alison Schofield
2025-07-15 15:23     ` Jonathan Cameron
2025-07-22  1:28       ` Alison Schofield

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=20250711174530.0000291a@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox