linux-stable/drivers/acpi
Dan Williams 366de90ccf ACPI: NFIT: Fix support for virtual SPA ranges
commit b93dfa6bda upstream.

Fix the NFIT parsing code to treat a 0 index in a SPA Range Structure as
a special case and not match Region Mapping Structures that use 0 to
indicate that they are not mapped. Without this fix some platform BIOS
descriptions of "virtual disk" ranges do not result in the pmem driver
attaching to the range.

Details:
In addition to typical persistent memory ranges, the ACPI NFIT may also
convey "virtual" ranges. These ranges are indicated by a UUID in the SPA
Range Structure of UUID_VOLATILE_VIRTUAL_DISK, UUID_VOLATILE_VIRTUAL_CD,
UUID_PERSISTENT_VIRTUAL_DISK, or UUID_PERSISTENT_VIRTUAL_CD. The
critical difference between virtual ranges and UUID_PERSISTENT_MEMORY,
is that virtual do not support associations with Region Mapping
Structures.  For this reason the "index" value of virtual SPA Range
Structures is allowed to be 0. If a platform BIOS decides to represent
NVDIMMs with disconnected "Region Mapping Structures" (range-index ==
0), the kernel may falsely associate them with standalone ranges where
the "SPA Range Structure Index" is also zero. When this happens the
driver may falsely require labels where "virtual disks" are expected to
be label-less. I.e. "label-less" is where the namespace-range ==
region-range and the pmem driver attaches with no user action to create
a namespace.

Cc: Jacek Zloch <jacek.zloch@intel.com>
Cc: Lukasz Sobieraj <lukasz.sobieraj@intel.com>
Cc: "Lee, Chun-Yi" <jlee@suse.com>
Cc: <stable@vger.kernel.org>
Fixes: c2f32acdf8 ("acpi, nfit: treat virtual ramdisk SPA as pmem region")
Reported-by: Krzysztof Rusocki <krzysztof.rusocki@intel.com>
Reported-by: Damian Bassa <damian.bassa@intel.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/162870796589.2521182.1240403310175570220.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18 08:59:07 +02:00
..
acpica Revert "ACPICA: Fix memory leak caused by _CID repair function" 2021-08-12 13:22:01 +02:00
apei ACPI: APEI: fix synchronous external aborts in user-mode 2021-07-14 16:56:12 +02:00
arm64 ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure 2021-05-11 14:47:34 +02:00
dptf ACPI: DPTF: Fix reading of attributes 2021-08-04 12:46:39 +02:00
nfit ACPI: NFIT: Fix support for virtual SPA ranges 2021-08-18 08:59:07 +02:00
numa ACPI updates for 5.10-rc1 2020-10-14 11:42:04 -07:00
pmic ACPI / PMIC: Move TPS68470 OpRegion driver to drivers/acpi/pmic/ 2020-09-15 19:40:59 +02:00
x86 ACPI: Convert to new X86 CPU match macros 2020-03-24 21:30:50 +01:00
ac.c Merge branches 'acpi-mm', 'acpi-tables', 'acpi-apei' and 'acpi-misc' 2020-08-03 13:14:42 +02:00
acpi_adxl.c
acpi_amba.c ACPI: AMBA: Fix resource name in /proc/iomem 2021-07-20 16:05:49 +02:00
acpi_apd.c serial: 8250_dw: Add device HID for new AMD UART controller 2021-06-03 09:00:33 +02:00
acpi_cmos_rtc.c ACPI: cmos_rtc: Remove leftover ACPI_MODULE_NAME() 2020-09-25 18:25:51 +02:00
acpi_configfs.c ACPI: configfs: add missing check after configfs_register_default_group() 2021-03-04 11:38:22 +01:00
acpi_dbg.c ACPI: debug: don't allow debugging when ACPI is disabled 2020-10-16 17:58:52 +02:00
acpi_extlog.c ACPI / extlog: Check for RDMSR failure 2020-10-02 19:01:55 +02:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI: LPIT: Put the low power idle table after using it 2020-05-09 11:29:16 +02:00
acpi_lpss.c drm next for 5.10-rc1 2020-10-15 10:46:16 -07:00
acpi_memhotplug.c mm/memory_hotplug: prepare passing flags to add_memory() and friends 2020-10-16 11:11:18 -07:00
acpi_pad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
acpi_platform.c ACPI: platform: Remove ACPI_MODULE_NAME() 2020-09-25 18:25:51 +02:00
acpi_pnp.c ACPI: PNP: compare the string length in the matching_id() 2020-12-30 11:54:06 +01:00
acpi_processor.c ACPI: processor: remove comment regarding string _UID support 2020-10-16 18:11:27 +02:00
acpi_tad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
acpi_video.c ACPI: video: Add quirk for the Dell Vostro 3350 2021-07-20 16:05:49 +02:00
acpi_watchdog.c ACPI: watchdog: Put the watchdog action table after parsing 2020-05-09 11:29:17 +02:00
battery.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
bgrt.c ACPI: bgrt: Fix CFI violation 2021-07-14 16:56:12 +02:00
blacklist.c
bus.c ACPI: bus: Call kobject_put() in acpi_init() error path 2021-07-14 16:55:59 +02:00
button.c ACPI: button: Add DMI quirk for Medion Akoya E2228T 2020-11-09 19:29:41 +01:00
container.c ACPI: container: Remove leftover ACPICA debug functionality 2020-09-25 18:25:51 +02:00
cppc_acpi.c ACPI: CPPC: Replace cppc_attr with kobj_attribute 2021-05-14 09:50:16 +02:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-05-11 14:47:12 +02:00
debugfs.c ACPI: debugfs: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
device_pm.c ACPI: PM / fan: Put fan device IDs into separate header file 2021-07-14 16:56:11 +02:00
device_sysfs.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
dock.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
ec.c ACPI: EC: trust DSDT GPE for certain HP laptop 2021-07-14 16:56:01 +02:00
ec_sys.c
event.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
evged.c ACPI: GED: fix -Wformat 2020-11-09 19:25:20 +01:00
fan.c ACPI: PM / fan: Put fan device IDs into separate header file 2021-07-14 16:56:11 +02:00
fan.h ACPI: PM / fan: Put fan device IDs into separate header file 2021-07-14 16:56:11 +02:00
glue.c
hed.c
internal.h ACPI: scan: Use unique number for instance_no 2021-03-30 14:32:06 +02:00
ioapic.c
irq.c
Kconfig ACPI: Kconfig: Fix table override from built-in initrd 2021-07-28 14:35:39 +02:00
Makefile ACPI: tables: Add custom DSDT file as makefile prerequisite 2021-07-14 16:56:01 +02:00
nvs.c
osi.c ACPI: OSI: Shoot duplicate word 2019-11-13 11:12:08 +01:00
osl.c ACPI: OSL: Make ACPICA use logical addresses of GPE blocks 2020-09-11 16:45:00 +02:00
pci_irq.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
pci_link.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
pci_mcfg.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
pci_root.c Merge branches 'acpi-extlog', 'acpi-memhotplug', 'acpi-button', 'acpi-tools' and 'acpi-pci' 2020-10-13 14:45:36 +02:00
pci_slot.c ACPI: PCI: Remove unused ACPICA debug code 2020-09-25 18:25:51 +02:00
power.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
pptt.c ACPI: PPTT: Consistently use unsigned int as parameter type 2020-01-07 11:46:36 +01:00
proc.c ACPI: proc: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
processor_core.c ACPI: processor: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
processor_driver.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
processor_idle.c ACPI: processor idle: Fix up C-state latency if not ordered 2021-07-14 16:55:57 +02:00
processor_pdc.c
processor_perflib.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
processor_thermal.c ACPI: processor: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-04 16:28:24 +02:00
property.c ACPI: property: Fix fwnode string properties matching 2021-03-04 11:38:22 +01:00
reboot.c ACPI: reboot: Avoid racing after writing to ACPI RESET_REG 2020-10-16 18:04:52 +02:00
resource.c Revert "ACPI: resources: Add checks for ACPI IRQ override" 2021-08-04 12:46:39 +02:00
sbs.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
sbshc.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
sbshc.h ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
scan.c ACPI: scan: Fix a memory leak in an error handling path 2021-05-19 10:13:13 +02:00
sleep.c Revert "ACPI: sleep: Put the FACS table after using it" 2021-06-16 12:01:39 +02:00
sleep.h ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-04 19:45:18 +02:00
spcr.c ACPI: Use fallthrough pseudo-keyword 2020-07-09 14:09:28 +02:00
sysfs.c Merge back sysfs-related ACPI material for v5.9. 2020-06-29 13:49:49 +02:00
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-04-07 15:00:08 +02:00
thermal.c ACPI: thermal: Do not call acpi_thermal_check() directly 2021-02-03 23:28:37 +01:00
tiny-power-button.c ACPI: tiny-power-button: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
utils.c ACPI: utils: remove unreachable breaks 2020-10-22 18:58:26 +02:00
video_detect.c ACPI: video: use native backlight for GA401/GA502/GA503 2021-07-14 16:55:57 +02:00
wakeup.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00