FAILED: patch "[PATCH] mm: hugetlb: fix missing cache flush in" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 348923665a0e50ad9fc0b3bb8127d3cb976691cc Mon Sep 17 00:00:00 2001
From: Muchun Song <[email protected]>
Date: Tue, 22 Mar 2022 14:42:02 -0700
Subject: [PATCH] mm: hugetlb: fix missing cache flush in
hugetlb_mcopy_atomic_pte()
folio_copy() will copy the data from one page to the target page, then the target page will be mapped to the user space address, which might have an alias issue with the kernel address used to copy the data from the page to. There are 2 ways to fix this issue.
1) insert flush_dcache_page() after folio_copy().
2) replace folio_copy() with copy_user_huge_page() which already considers the cache maintenance.
We chose 2) way to fix the issue since architectures can optimize this situation. It is also make backports easier.
mm/hugetlb.c +2 -1
@@ -5816,7 +5816,8 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, *pagep =NULL ; goto out; } -folio_copy (page_folio (page),page_folio (*pagep)); +copy_user_huge_page (page, *pagep, dst_addr, dst_vma, +pages_per_huge_page (h));put_page (*pagep); *pagep =NULL ; }