Factor the NFIT table walking logic into a handful of helperNot all child devices of the NVDIMM root device represent DIMM
functiondevices which pass back a temporarily malloc'd array ofare present in the system. The spec says (ACPI 6.2,
pointers.sec 9.20.2):
The complexity tradeoff of embedded-walks vs factored-out-walks in> For each NVDIMM present or intended to be supported by platform,
the existing logic is mostly neutral,> platform firmware also exposes an NVDIMM device ... but the complexity win willunder the
come with upcoming namespace support where we would need to do> NVDIMM root device.
Present NVDIMM devices are found by walking all of the NFIT
three nested walks to correlate each SPA with manytable's SPA ranges, then walking the NVDIMM Regionregions mentioned by
Mapping Structures, and then each of those regions with an NVDIMM
Control Region StructureSPA ranges.
Notably, this change allows us to modify the way in which NVDIMMA set of NFIT walking helper functions are introduced to avoid the
devices arneed to splat the enumerated. Previously, we would create an NVDIMMion logic across several disparate
device for each child of the ACPI NVDIMM root device. On manycallbacks.
systems (and allowed by the spec), these child devices only
represent a slot where an NVDIMM could possibly be plugged in.
With this change, we have the acpi_nfit_get_dimm_ids() function
which walks SPAs, to regions, to control regions to find actually
present NVDIMMs.