mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
Revert "mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in"
With " mm/uffd: Fix vma check on userfault for wp" to fix the registration, we'll be safe to remove the macro hacks now. Link: https://lkml.kernel.org/r/20221024193336.1233616-3-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
26215b7ee9
commit
b12fdbf15f
3 changed files with 0 additions and 8 deletions
|
@ -5114,7 +5114,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct
|
||||||
* unmapped and its refcount is dropped, so just clear pte here.
|
* unmapped and its refcount is dropped, so just clear pte here.
|
||||||
*/
|
*/
|
||||||
if (unlikely(!pte_present(pte))) {
|
if (unlikely(!pte_present(pte))) {
|
||||||
#ifdef CONFIG_PTE_MARKER_UFFD_WP
|
|
||||||
/*
|
/*
|
||||||
* If the pte was wr-protected by uffd-wp in any of the
|
* If the pte was wr-protected by uffd-wp in any of the
|
||||||
* swap forms, meanwhile the caller does not want to
|
* swap forms, meanwhile the caller does not want to
|
||||||
|
@ -5126,7 +5125,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct
|
||||||
set_huge_pte_at(mm, address, ptep,
|
set_huge_pte_at(mm, address, ptep,
|
||||||
make_pte_marker(PTE_MARKER_UFFD_WP));
|
make_pte_marker(PTE_MARKER_UFFD_WP));
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
huge_pte_clear(mm, address, ptep, sz);
|
huge_pte_clear(mm, address, ptep, sz);
|
||||||
spin_unlock(ptl);
|
spin_unlock(ptl);
|
||||||
continue;
|
continue;
|
||||||
|
@ -5155,13 +5153,11 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct
|
||||||
tlb_remove_huge_tlb_entry(h, tlb, ptep, address);
|
tlb_remove_huge_tlb_entry(h, tlb, ptep, address);
|
||||||
if (huge_pte_dirty(pte))
|
if (huge_pte_dirty(pte))
|
||||||
set_page_dirty(page);
|
set_page_dirty(page);
|
||||||
#ifdef CONFIG_PTE_MARKER_UFFD_WP
|
|
||||||
/* Leave a uffd-wp pte marker if needed */
|
/* Leave a uffd-wp pte marker if needed */
|
||||||
if (huge_pte_uffd_wp(pte) &&
|
if (huge_pte_uffd_wp(pte) &&
|
||||||
!(zap_flags & ZAP_FLAG_DROP_MARKER))
|
!(zap_flags & ZAP_FLAG_DROP_MARKER))
|
||||||
set_huge_pte_at(mm, address, ptep,
|
set_huge_pte_at(mm, address, ptep,
|
||||||
make_pte_marker(PTE_MARKER_UFFD_WP));
|
make_pte_marker(PTE_MARKER_UFFD_WP));
|
||||||
#endif
|
|
||||||
hugetlb_count_sub(pages_per_huge_page(h), mm);
|
hugetlb_count_sub(pages_per_huge_page(h), mm);
|
||||||
page_remove_rmap(page, vma, true);
|
page_remove_rmap(page, vma, true);
|
||||||
|
|
||||||
|
|
|
@ -1393,12 +1393,10 @@ zap_install_uffd_wp_if_needed(struct vm_area_struct *vma,
|
||||||
unsigned long addr, pte_t *pte,
|
unsigned long addr, pte_t *pte,
|
||||||
struct zap_details *details, pte_t pteval)
|
struct zap_details *details, pte_t pteval)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PTE_MARKER_UFFD_WP
|
|
||||||
if (zap_drop_file_uffd_wp(details))
|
if (zap_drop_file_uffd_wp(details))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pte_install_uffd_wp_if_needed(vma, addr, pte, pteval);
|
pte_install_uffd_wp_if_needed(vma, addr, pte, pteval);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long zap_pte_range(struct mmu_gather *tlb,
|
static unsigned long zap_pte_range(struct mmu_gather *tlb,
|
||||||
|
|
|
@ -267,7 +267,6 @@ static unsigned long change_pte_range(struct mmu_gather *tlb,
|
||||||
} else {
|
} else {
|
||||||
/* It must be an none page, or what else?.. */
|
/* It must be an none page, or what else?.. */
|
||||||
WARN_ON_ONCE(!pte_none(oldpte));
|
WARN_ON_ONCE(!pte_none(oldpte));
|
||||||
#ifdef CONFIG_PTE_MARKER_UFFD_WP
|
|
||||||
if (unlikely(uffd_wp && !vma_is_anonymous(vma))) {
|
if (unlikely(uffd_wp && !vma_is_anonymous(vma))) {
|
||||||
/*
|
/*
|
||||||
* For file-backed mem, we need to be able to
|
* For file-backed mem, we need to be able to
|
||||||
|
@ -279,7 +278,6 @@ static unsigned long change_pte_range(struct mmu_gather *tlb,
|
||||||
make_pte_marker(PTE_MARKER_UFFD_WP));
|
make_pte_marker(PTE_MARKER_UFFD_WP));
|
||||||
pages++;
|
pages++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} while (pte++, addr += PAGE_SIZE, addr != end);
|
} while (pte++, addr += PAGE_SIZE, addr != end);
|
||||||
arch_leave_lazy_mmu_mode();
|
arch_leave_lazy_mmu_mode();
|
||||||
|
|
Loading…
Reference in a new issue