[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNbGfOxB4LXaFL0Z@rric.localdomain>
Date: Fri, 26 Sep 2025 18:59:40 +0200
From: Robert Richter <rrichter@....com>
To: Gregory Price <gourry@...rry.net>
Cc: 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>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Dave Jiang <dave.jiang@...el.com>,
Davidlohr Bueso <dave@...olabs.net>, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Fabio M. De Francesco" <fabio.m.de.francesco@...ux.intel.com>,
Terry Bowman <terry.bowman@....com>,
Joshua Hahn <joshua.hahnjy@...il.com>
Subject: Re: [PATCH v3 11/11] cxl: Enable AMD Zen5 address translation using
ACPI PRMT
On 24.09.25 13:09:46, Gregory Price wrote:
> On Fri, Sep 12, 2025 at 04:45:13PM +0200, Robert Richter wrote:
> > +static void cxl_prm_init(struct cxl_port *port)
> > +{
> > + u64 spa;
> > + struct prm_cxl_dpa_spa_data data = { .out = &spa, };
> > + int rc;
> > +
> > + if (!check_prm_address_translation(port))
> > + return;
> > +
> > + /* Check kernel (-EOPNOTSUPP) and firmware support (-ENODEV) */
> > + rc = acpi_call_prm_handler(prm_cxl_dpa_spa_guid, &data);
> > + if (rc == -EOPNOTSUPP || rc == -ENODEV)
> > + return;
> > +
> > + port->to_hpa = cxl_prm_to_hpa;
> > +
> > + dev_dbg(port->host_bridge, "PRM address translation enabled for %s.\n",
> > + dev_name(&port->dev));
> > +}
>
> Is it possible that the PRMT function is present but uninitialize?
> For example if expanders are not in a normalized address mode.
>
> This code would likely still add the to_hpa() function reference even
> if the underlying PRMT function hasn't been set up for translation.
At this point during init, it is not yet possible to determine
normalized address mode. Endpoint and hdm decoders are still unknown.
Thus, PRM is enabled for the port. Later, during region setup, there is
a check for that while determining the region's HPA range. Addresses
are translated and ranges adjusted only if needed. Once the ranges are
set up, no further PRM handler calls are executed.
Thanks for review and testing.
-Robert
Powered by blists - more mailing lists