mm: fixup pfnmap memory failure handling
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesIn review
- v13 patches 4 repliesSuperseded 1 of 3 applied
Changes in v2 from the cover letter
* 1/3 added to the mm-unstable branch (Thanks Andrew Morton!)
* Fixed return types in 3/3 based on Alex Williamson' suggestions.
* s/u64/pgoff_t u64 for offsets in 3/3 (Thanks Alex Williamson)
* Removed inine in pfn_memregion_offset in 3/3 (Thanks Alex Williamson)
* No change in 1/3, 2/3.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mm: fixup pfnmap memory failure handling to use pgoffinclude/ mm/ | +20 | 3 replies | |
| 2/3 | mm: add stubs for PFNMAP memory failure registration functionsinclude/ | +11 | 0 replies | |
| 3/3 | vfio/nvgrace-gpu: register device memory for poison handlingdrivers/ | +112 | 1 reply |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Alex Williamson |
|---|---|
| 1/3 | |
| 2/3 | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] mm: fixup pfnmap memory failure handling
From: Ankit Agrawal <[email protected]>
It was noticed during 6.19 merge window that the patch series [1] to introduce memory failure handling for the PFNMAP memory is broken.
The expected behaviour of the series is to allow a driver (such as nvgrace-gpu) to register its device memory with the mm. The mm would then handle the poison on that registered memory region.
However, the following issues were identified in the patch series.
1. Faulty use of PFN instead of mapping file page offset to derive the usermode process VA corresponding to the mapping to PFN.
2. nvgrace-gpu code called the registration at mmap, exposing it to corruption. This may happen, when multiple mmap were called on the same BAR. This issue was also noticed by Linus Torvalds who reverted the patch [2].
This patch series addresses those issues.
Patch 1/3 fixes the first issue by translating PFN to page offset and using that information to send the SIGBUS to the mapping process. Patch 2/3 add stubs for CONFIG_MEMORY_FAILURE disabled. Patch 3/3 is a resend of the reverted change to register the device memory at the time of open instead of mmap.
Many thanks to Jason Gunthorpe ([email protected]) and Alex Williamson ([email protected]) for identifying the issue and suggesting the fix. Thanks to Andrew Morton ([email protected]) for picking up 1/3 for mm-unstable. Requesting to consider the entire series in 6.19 as 3/3 is a resend-with-fix of the only user that was reverted in the original series [2].
Changelog:
v2:
* 1/3 added to the mm-unstable branch (Thanks Andrew Morton!)
* Fixed return types in 3/3 based on Alex Williamson' suggestions.
* s/u64/pgoff_t u64 for offsets in 3/3 (Thanks Alex Williamson)
* Removed inine in pfn_memregion_offset in 3/3 (Thanks Alex Williamson)
* No change in 1/3, 2/3.
Link:
https://lore.kernel.org/all/[email protected]/ [v1]
Ankit Agrawal (3):
mm: fixup pfnmap memory failure handling to use pgoff
mm: add stubs for PFNMAP memory failure registration functions vfio/nvgrace-gpu: register device memory for poison handling
drivers/vfio/pci/nvgrace-gpu/main.c | 116 +++++++++++++++++++++++++++- include/linux/memory-failure.h | 15 +++- mm/memory-failure.c | 29 ++++--- 3 files changed, 143 insertions(+), 17 deletions(-)
Signature · 1 line
2.34.1