WSL2-Linux-Kernel/drivers/dax
Dan Williams 95d714d8ad devdax: Fix soft-reservation memory description
commit 67feaba413 upstream.

The "hmem" platform-devices that are created to represent the
platform-advertised "Soft Reserved" memory ranges end up inserting a
resource that causes the iomem_resource tree to look like this:

340000000-43fffffff : hmem.0
  340000000-43fffffff : Soft Reserved
    340000000-43fffffff : dax0.0

This is because insert_resource() reparents ranges when they completely
intersect an existing range.

This matters because code that uses region_intersects() to scan for a
given IORES_DESC will only check that top-level 'hmem.0' resource and
not the 'Soft Reserved' descendant.

So, to support EINJ (via einj_error_inject()) to inject errors into
memory hosted by a dax-device, be sure to describe the memory as
IORES_DESC_SOFT_RESERVED. This is a follow-on to:

commit b13a3e5fd4 ("ACPI: APEI: Fix _EINJ vs EFI_MEMORY_SP")

...that fixed EINJ support for "Soft Reserved" ranges in the first
instance.

Fixes: 262b45ae3a ("x86/efi: EFI soft reservation to E820 enumeration")
Reported-by: Ricardo Sandoval Torres <ricardo.sandoval.torres@intel.com>
Tested-by: Ricardo Sandoval Torres <ricardo.sandoval.torres@intel.com>
Cc: <stable@vger.kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Omar Avelar <omar.avelar@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mark Gross <markgross@kernel.org>
Link: https://lore.kernel.org/r/166397075670.389916.7435722208896316387.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-28 11:11:57 +02:00
..
hmem devdax: Fix soft-reservation memory description 2022-09-28 11:11:57 +02:00
pmem libnvdimm: Make remove callback return void 2021-02-16 19:35:29 -08:00
Kconfig mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports 2020-11-22 10:48:22 -08:00
Makefile ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device 2020-10-13 18:38:27 -07:00
bus.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
bus.h dax-device: Make remove callback return void 2021-02-16 19:45:13 -08:00
dax-private.h device-dax: add an 'align' attribute 2020-10-13 18:38:28 -07:00
device.c fs: remove noop_set_page_dirty() 2021-06-29 10:53:48 -07:00
kmem.c dax/kmem: use a single static memory group for a single probed unit 2021-09-08 11:50:23 -07:00
super.c dax: make sure inodes are flushed before destroy cache 2022-04-08 14:23:31 +02:00