lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d67e3fc9-ebc8-4538-9135-48a0b02d7af9@intel.com>
Date: Wed, 15 Oct 2025 09:38:35 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Vishal Aslot <vaslot@...dia.com>, Davidlohr Bueso <dave@...olabs.net>,
 Jonathan Cameron <jonathan.cameron@...wei.com>,
 Alison Schofield <alison.schofield@...el.com>,
 Vishal Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>,
 Dan Williams <dan.j.williams@...el.com>, Li Ming <ming.li@...omail.com>,
 "open list:COMPUTE EXPRESS LINK (CXL)" <linux-cxl@...r.kernel.org>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 2/2] cxl: Allow zero sized HDM decoders



On 10/14/25 7:40 PM, Vishal Aslot wrote:
> CXL spec permits committing zero sized decoders.
> Linux currently considers them as an error.
> 
> Zero-sized decoders are helpful when the BIOS
> is committing them. Often BIOS will also lock
> them to prevent them being changed due to the
> TSP requirement. For example, if the type 3
> device is part of a TCB.
> 
> The host bridge, switch, and end-point decoders
> can all be committed with zero-size. If they are
> locked along the VH, it is often to prevent
> hotplugging of a new device that could not be
> attested post boot and cannot be included in
> TCB.
> 
> The caller leaves the decoder allocated but does
> not add it. It simply continues to the next decoder.

I think it should add it as well, just as a locked decoder that's size 0. When we do cxl list of decoders, we should see those decoders as how they are.

DJ

> 
> Signed-off-by: Vishal Aslot <vaslot@...dia.com>
> ---
>  drivers/cxl/core/hdm.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index d3a094ca01ad..1c036a485723 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -1036,13 +1036,14 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
>  			return -ENXIO;
>  		}
>  
> +		port->commit_end = cxld->id;
> +
>  		if (size == 0) {
> -			dev_warn(&port->dev,
> +			dev_dbg(&port->dev,
>  				 "decoder%d.%d: Committed with zero size\n",
>  				 port->id, cxld->id);
> -			return -ENXIO;
> +			return -ENOSPC;
>  		}
> -		port->commit_end = cxld->id;
>  	} else {
>  		if (cxled) {
>  			struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
> @@ -1198,6 +1199,8 @@ static int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
>  
>  		rc = init_hdm_decoder(port, cxld, hdm, i, &dpa_base, info);
>  		if (rc) {
> +			if (rc == -ENOSPC)
> +				continue;
>  			dev_warn(&port->dev,
>  				 "Failed to initialize decoder%d.%d\n",
>  				 port->id, i);



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ