linux-stable/tools/testing/nvdimm
Dan Williams e9cfd259c6 ACPI: NFIT: Fix support for variable 'SPA' structure size
ACPI 6.4 introduced the "SpaLocationCookie" to the NFIT "System Physical
Address (SPA) Range Structure". The presence of that new field is
indicated by the ACPI_NFIT_LOCATION_COOKIE_VALID flag. Pre-ACPI-6.4
firmware implementations omit the flag and maintain the original size of
the structure.

Update the implementation to check that flag to determine the size
rather than the ACPI 6.4 compliant definition of 'struct
acpi_nfit_system_address' from the Linux ACPICA definitions.

Update the test infrastructure for the new expectations as well, i.e.
continue to emulate the ACPI 6.3 definition of that structure.

Without this fix the kernel fails to validate 'SPA' structures and this
leads to a crash in nfit_get_smbios_id() since that routine assumes that
SPAs are valid if it finds valid SMBIOS tables.

    BUG: unable to handle page fault for address: ffffffffffffffa8
    [..]
    Call Trace:
     skx_get_nvdimm_info+0x56/0x130 [skx_edac]
     skx_get_dimm_config+0x1f5/0x213 [skx_edac]
     skx_register_mci+0x132/0x1c0 [skx_edac]

Cc: Bob Moore <robert.moore@intel.com>
Cc: Erik Kaneda <erik.kaneda@intel.com>
Fixes: cf16b05c60 ("ACPICA: ACPI 6.4: NFIT: add Location Cookie field")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/162037273007.1195827.10907249070709169329.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2021-05-12 12:38:25 -07:00
..
test ACPI: NFIT: Fix support for variable 'SPA' structure size 2021-05-12 12:38:25 -07:00
acpi_nfit_test.c tools/testing/nvdimm: Populate dirty shutdown data 2018-10-17 10:47:19 -07:00
config_check.c testing/nvdimm: Add test module for non-nfit platforms 2021-01-28 00:22:48 -08:00
dax-dev.c device-dax: add dis-contiguous resource support 2020-10-13 18:38:28 -07:00
dax_pmem_compat_test.c tools/testing/nvdimm: add watermarks for dax_pmem* modules 2019-04-22 15:56:28 -07:00
dax_pmem_core_test.c tools/testing/nvdimm: add watermarks for dax_pmem* modules 2019-04-22 15:56:28 -07:00
dax_pmem_test.c tools/testing/nvdimm: add watermarks for dax_pmem* modules 2019-04-22 15:56:28 -07:00
device_dax_test.c tools/testing/nvdimm: force nfit_test to depend on instrumented modules 2018-02-01 16:49:54 -08:00
dimm_devs.c libnvdimm/security: Introduce a 'frozen' attribute 2019-08-29 13:49:13 -07:00
Kbuild tools/test/nvdimm: Fix out of tree build 2020-03-31 14:12:32 -07:00
libnvdimm_test.c tools/testing/nvdimm: force nfit_test to depend on instrumented modules 2018-02-01 16:49:54 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmem-dax.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
pmem_test.c tools/testing/nvdimm: force nfit_test to depend on instrumented modules 2018-02-01 16:49:54 -08:00
watermark.h tools/testing/nvdimm: add watermarks for dax_pmem* modules 2019-04-22 15:56:28 -07:00