kernel_optimize_test/drivers/acpi
Dan Williams 366de90ccf ACPI: NFIT: Fix support for virtual SPA ranges
commit b93dfa6bda4d4e88e5386490f2b277a26958f9d3 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
pmic
x86
ac.c
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_configfs.c
acpi_dbg.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
acpi_platform.c
acpi_pnp.c
acpi_processor.c
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
battery.c
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
container.c
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
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_sys.c
ec.c ACPI: EC: trust DSDT GPE for certain HP laptop 2021-07-14 16:56:01 +02:00
event.c
evged.c
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
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c
power.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
pptt.c
proc.c
processor_core.c
processor_driver.c
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
processor_thermal.c
processor_throttling.c
property.c
reboot.c
resource.c Revert "ACPI: resources: Add checks for ACPI IRQ override" 2021-08-04 12:46:39 +02:00
sbs.c
sbshc.c
sbshc.h
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
spcr.c
sysfs.c
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-04-07 15:00:08 +02:00
thermal.c
tiny-power-button.c
utils.c
video_detect.c ACPI: video: use native backlight for GA401/GA502/GA503 2021-07-14 16:55:57 +02:00
wakeup.c