linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] mm:fix gup_pud_range
@ 2019-09-20 15:51 Qiujun Huang
  2019-09-20 15:58 ` Aneesh Kumar K.V
  2019-09-20 19:37 ` John Hubbard
  0 siblings, 2 replies; 5+ messages in thread
From: Qiujun Huang @ 2019-09-20 15:51 UTC (permalink / raw)
  To: akpm
  Cc: ira.weiny, jgg, dan.j.williams, rppt, hqjagain, jhubbard,
	aneesh.kumar, keith.busch, linux-mm, linux-kernel

__get_user_pages_fast try to walk the page table but the
hugepage pte is replace by hwpoison swap entry by mca path.
...
[15798.177437] mce: Uncorrected hardware memory error in
				user-access at 224f1761c0
[15798.180171] MCE 0x224f176: Killing pal_main:6784 due to
				hardware memory corruption
[15798.180176] MCE 0x224f176: Killing qemu-system-x86:167336
				due to hardware memory corruption
...
[15798.180206] BUG: unable to handle kernel
[15798.180226] paging request at ffff891200003000
[15798.180236] IP: [<ffffffff8106edae>] gup_pud_range+
				0x13e/0x1e0
...

We need to skip the hwpoison entry in gup_pud_range.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
 mm/gup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/gup.c b/mm/gup.c
index 98f13ab..6157ed9 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2230,6 +2230,8 @@ static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
 		next = pud_addr_end(addr, end);
 		if (pud_none(pud))
 			return 0;
+		if (unlikely(!pud_present(pud)))
+			return 0;
 		if (unlikely(pud_huge(pud))) {
 			if (!gup_huge_pud(pud, pudp, addr, next, flags,
 					  pages, nr))
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-21  1:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 15:51 [PATCH 3/3] mm:fix gup_pud_range Qiujun Huang
2019-09-20 15:58 ` Aneesh Kumar K.V
2019-09-20 19:37 ` John Hubbard
2019-09-21  0:33   ` Qiujun Huang
     [not found]     ` <ce863f5b-2337-1ac3-4d3d-d1d62acbba24@nvidia.com>
2019-09-21  1:47       ` Qiujun Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).