[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_XTe8r7Syn9Y4cf@aschofie-mobl2.lan>
Date: Tue, 8 Apr 2025 18:55:07 -0700
From: Alison Schofield <alison.schofield@...el.com>
To: Li Zhijian <lizhijian@...itsu.com>
CC: <linux-cxl@...r.kernel.org>, Jonathan Cameron
<jonathan.cameron@...wei.com>, Dave Jiang <dave.jiang@...el.com>, "Vishal
Verma" <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, "Dan
Williams" <dan.j.williams@...el.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] cxl/acpi: Verify CHBS length for CXL2.0
On Mon, Apr 07, 2025 at 04:02:17PM +0800, Li Zhijian wrote:
> Per CXL Spec r3.1 Table 9-21, both CXL1.1 and CXL2.0 have defined their
> own length, verify it to avoid an invalid CHBS.
Can you comment on removing the comparison to CXL_RCRB_SIZE. At some
point someone thought that was useful. As you remove it, please
explain.
>
> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
> ---
> V2: don't factor out, just validate # Dan
> ---
> drivers/cxl/acpi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index cb14829bb9be..2e63e50b2c40 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -11,8 +11,6 @@
> #include "cxlpci.h"
> #include "cxl.h"
>
> -#define CXL_RCRB_SIZE SZ_8K
> -
> struct cxl_cxims_data {
> int nr_maps;
> u64 xormaps[] __counted_by(nr_maps);
> @@ -478,8 +476,10 @@ static int cxl_get_chbs_iter(union acpi_subtable_headers *header, void *arg,
>
> chbs = (struct acpi_cedt_chbs *) header;
>
> - if (chbs->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11 &&
> - chbs->length != CXL_RCRB_SIZE)
> + if ((chbs->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11 &&
> + chbs->length != ACPI_CEDT_CHBS_LENGTH_CXL11) ||
> + (chbs->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL20 &&
> + chbs->length != ACPI_CEDT_CHBS_LENGTH_CXL20))
> return 0;
>
> if (!chbs->base)
> --
> 2.47.0
>
Powered by blists - more mailing lists