Alison Schofield wrote: > On Tue, Jul 22, 2025 at 02:04:00PM -0700, Dan Williams wrote: > > Smita Koralahalli wrote: > > > Refactor cxl_acpi_probe() to use a single exit path so that the fallback > > > DAX registration can be scheduled regardless of probe success or failure. > > > > I do not understand why cxl_acpi needs to be responsible for this, > > especially in the cxl_acpi_probe() failure path. Certainly if > > cxl_acpi_probe() fails, that is a strong signal to give up on the CXL > > subsystem altogether and fallback to DAX vanilla discovery exclusively. > > > > Now, maybe the need for this becomes clearer in follow-on patches. > > However, I would have expected that DAX, which currently arranges for > > CXL to load first would just flush CXL discovery, make a decision about > > whether proceed with Soft Reserved, or not. > > > > Something like: > > > > DAX CXL > > Scan CXL Windows. Fail on any > > window > > parsing failures > > > > Launch a work item to flush > > PCI > > discovery and give a > > reaonable amount of > > time for cxl_pci and > > cxl_mem to quiesce > > > > <assumes CXL Windows are discovered > > by virtue of initcall order or > > MODULE_SOFTDEP("pre: cxl_acpi")> > > > > Calls a CXL flush routine to await probe > > completion (will always be racy) > > > > Evaluates if all Soft Reserve has > > cxl_region coverage > > > > if yes: skip publishing CXL intersecting > > Soft Reserve range in iomem, let dax_cxl > > attach to the cxl_region devices > > > > if no: decline the already published > > cxl_dax_regions, notify cxl_acpi to > > shutdown. Install Soft Reserved in iomem > > and create dax_hmem devices for the > > ranges per usual. > > This is super course. If CXL region driver sets up 99 regions with > exact matching SR ranges and there are no CXL Windows with unused SR, > then we have a YES! > > But if after those 99 successful assemblies, we get one errant window > with a Soft Reserved for which a region never assembles, it's a hard NO. > DAX declines, ie teardowns the 99 dax_regions and cxl_regions.
Exactly. > Obviously, this is different from the current approach that aimed to > pick up completely unused SRs and the trimmings from SRs that exceeded > region size and offered them to DAX too. > > I'm cringing a bit at the fact that one bad apple (like a cxl device > that doesn't show up for it's region) means no CXL devices get managed. Think of the linear extended cache case where if you just look at the endpoint CXL decoders you get half of the capacity and none of the warning that the DDR side of the cache can not be managed. Consider the other address translation error cases where endpoint decoders do not tell the full story. Now think of the contract of what the CXL driver offers. It says, "hey if you change this configuration I have high confidence that I have managed everything associated with this region throughout the whole platform config", or "if an error happens anywhere within a CXL window you can rely on my identification of the system components to suspect". > Probably asking the obvious question here. This is what 'we' want, > right? So, in the end it is not a fair fight. It is a handful of Linux developers vs multiple platform BIOS teams per vendor and per hardware generation. The amount of Linux tripping, specification-stretching, innovation is eye watering. The downside of being drastic and coarse is worth the benefit. The status quo is end users get nothing (stranded memory), or low confidence partial configs with latent RAS problems. The coarse policy is a spec compliant, safe fallback that gets end users access to the memory the BIOS/firmware promised. It buys time for the platform vendor to get Linux fixed, or even better, these Linux coniptions catch problems earlier in platform qualification cycle. The alternative fine grained policy hopes that the memory the CXL driver gives up on was not critical or indicative of a deeper misunderstanding of the platform. I do not want to debug hopeful guesses on top of undefined breakage.