lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] mm/hugetlb: Add missing VM_FAULT_SET_HINDEX in hugetlb_fault
Date
commit af19487f00f3 ("mm: make PTE_MARKER_SWAPIN_ERROR more general") added
the code to handle pte_markers in hugetlb faulting path.
In case of an UFFD_POISON event, a PTE_MARKER_POISONED will be created and
we will return VM_FAULT_HWPOISON_LARGE upon detecting that in the fault path.
Add the missing VM_FAULT_SET_HINDEX, so the right si_addr_lsb will be passed
to userspace to report the extension of the faulty area.

Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
mm/hugetlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 33d175add044..262456daf327 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -6485,7 +6485,8 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
pte_marker_get(pte_to_swp_entry(vmf.orig_pte));

if (marker & PTE_MARKER_POISONED) {
- ret = VM_FAULT_HWPOISON_LARGE;
+ ret = VM_FAULT_HWPOISON_LARGE |
+ VM_FAULT_SET_HINDEX(hstate_index(h));
goto out_mutex;
}
}
--
2.44.0

\
 
 \ /
  Last update: 2024-05-09 12:02    [W:0.070 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site