Skip to contentSkip to conversation

mm-change-ghes-code-to-allow-poison-of-non-struct-pfn.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 17, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: change ghes code to allow poison of non-struct pfn
has been removed from the -mm tree. Its filename was
mm-change-ghes-code-to-allow-poison-of-non-struct-pfn.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Ankit Agrawal <[email protected]>
Subject: mm: change ghes code to allow poison of non-struct pfn
Date: Sun, 2 Nov 2025 18:44:32 +0000

Poison (or ECC) errors can be very common on a large size cluster. The kernel MM currently handles ECC errors / poison only on memory page backed by struct page. The handling is currently missing for the PFNMAP memory that does not have struct pages. The series adds such support.

Implement a new ECC handling for memory without struct pages. Kernel MM expose registration APIs to allow modules that are managing the device to register its device memory region. MM then tracks such regions using interval tree.

The mechanism is largely similar to that of ECC on pfn with struct pages. If there is an ECC error on a pfn, all the mapping to it are identified and a SIGBUS is sent to the user space processes owning those mappings. Note that there is one primary difference versus the handling of the poison on struct pages, which is to skip unmapping to the faulty PFN. This is done to handle the huge PFNMAP support added recently [1] that enables VM_PFNMAP vmas to map at PMD or PUD level. A poison to a PFN mapped in such as way would need breaking the PMD/PUD mapping into PTEs that will get mirrored into the S2. This can greatly increase the cost of table walks and have a major performance impact.

nvgrace-gpu-vfio-pci module maps the device memory to user VA (Qemu) using remap_pfn_range without being added to the kernel [2]. These device memory PFNs are not backed by struct page. So make nvgrace-gpu-vfio-pci module make use of the mechanism to get poison handling support on the device memory.

This patch (of 3):

The GHES code allows calling of memory_failure() on the PFNs that pass the pfn_valid() check. This contract is broken for the remapped PFNs which fails the check and ghes_do_memory_failure() returns without triggering memory_failure().

Update code to allow memory_failure() call on PFNs failing pfn_valid().

Cc Aniket Agashe <[email protected]>
Cc Ankit Agrawal <[email protected]>
Cc Borislav Betkov <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hanjun Guo <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Joanthan Cameron <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Kirti Wankhede <[email protected]>
Cc Len Brown <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc "Luck, Tony" <[email protected]>
Cc Matthew R. Ochs <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Neo Jia <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Smita Koralahalli Channabasappa <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Tarun Gupta <[email protected]>
Cc Uwe Kleine-König <[email protected]>
Cc Vikram Sethi <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Zhi Wang <[email protected]>

---

 drivers/acpi/apei/ghes.c |    6 ------
 1 file changed, 6 deletions(-)
drivers/acpi/apei/ghes.c renamed from drivers/acpi/apei/ghes.c~mm-change-ghes-code-to-allow-poison-of-non-struct-pfn +0 -6
@@ -505,12 +505,6 @@ static bool ghes_do_memory_failure(u64 p
 		return false;
 
 	pfn = PHYS_PFN(physical_addr);
-	if (!pfn_valid(pfn) && !arch_is_platform_page(physical_addr)) {
-		pr_warn_ratelimited(FW_WARN GHES_PFX
-		"Invalid address in generic error data: %#llx\n",
-		physical_addr);
-		return false;
-	}
 
 	if (flags == MF_ACTION_REQUIRED && current->mm) {
 		twcb = (void *)gen_pool_alloc(ghes_estatus_pool, sizeof(*twcb));

_

Patches currently in -mm which might be from [email protected] are