mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
powerpc: remove checks for devmap pages and PMDs/PUDs
PFN_DEV no longer exists. This means no devmap PMDs or PUDs will be created, so checking for them is redundant. Instead mappings of pages that would have previously returned true for pXd_devmap() will return true for pXd_trans_huge() Link: https://lkml.kernel.org/r/31f63cc8dd518f9e2ec300681fe302eb4adf49b4.1750323463.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple <apopple@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: Balbir Singh <balbirs@nvidia.com> Cc: Björn Töpel <bjorn@kernel.org> Cc: Björn Töpel <bjorn@rivosinc.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Deepak Gupta <debug@rivosinc.com> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Cc: Inki Dae <m.szyprowski@samsung.com> Cc: John Groves <john@groves.net> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
2f4e882d95
commit
bea0cc7cf4
|
|
@ -54,7 +54,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
|
|||
/*
|
||||
* Make sure this is thp or devmap entry
|
||||
*/
|
||||
if (!(old_pmd & (H_PAGE_THP_HUGE | _PAGE_DEVMAP)))
|
||||
if (!(old_pmd & H_PAGE_THP_HUGE))
|
||||
return 0;
|
||||
|
||||
rflags = htab_convert_pte_flags(new_pmd, flags);
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ unsigned long hash__pmd_hugepage_update(struct mm_struct *mm, unsigned long addr
|
|||
unsigned long old;
|
||||
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
WARN_ON(!hash__pmd_trans_huge(*pmdp) && !pmd_devmap(*pmdp));
|
||||
WARN_ON(!hash__pmd_trans_huge(*pmdp));
|
||||
assert_spin_locked(pmd_lockptr(mm, pmdp));
|
||||
#endif
|
||||
|
||||
|
|
@ -227,7 +227,6 @@ pmd_t hash__pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long addres
|
|||
|
||||
VM_BUG_ON(address & ~HPAGE_PMD_MASK);
|
||||
VM_BUG_ON(pmd_trans_huge(*pmdp));
|
||||
VM_BUG_ON(pmd_devmap(*pmdp));
|
||||
|
||||
pmd = *pmdp;
|
||||
pmd_clear(pmdp);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
|
|||
} while(!pte_xchg(ptep, __pte(old_pte), __pte(new_pte)));
|
||||
|
||||
/* Make sure this is a hugetlb entry */
|
||||
if (old_pte & (H_PAGE_THP_HUGE | _PAGE_DEVMAP))
|
||||
if (old_pte & H_PAGE_THP_HUGE)
|
||||
return 0;
|
||||
|
||||
rflags = htab_convert_pte_flags(new_pte, flags);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
|
|||
{
|
||||
int changed;
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
WARN_ON(!pmd_trans_huge(*pmdp) && !pmd_devmap(*pmdp));
|
||||
WARN_ON(!pmd_trans_huge(*pmdp));
|
||||
assert_spin_locked(pmd_lockptr(vma->vm_mm, pmdp));
|
||||
#endif
|
||||
changed = !pmd_same(*(pmdp), entry);
|
||||
|
|
@ -82,7 +82,6 @@ int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address,
|
|||
{
|
||||
int changed;
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
WARN_ON(!pud_devmap(*pudp));
|
||||
assert_spin_locked(pud_lockptr(vma->vm_mm, pudp));
|
||||
#endif
|
||||
changed = !pud_same(*(pudp), entry);
|
||||
|
|
@ -204,8 +203,8 @@ pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
|
|||
{
|
||||
pmd_t pmd;
|
||||
VM_BUG_ON(addr & ~HPAGE_PMD_MASK);
|
||||
VM_BUG_ON((pmd_present(*pmdp) && !pmd_trans_huge(*pmdp) &&
|
||||
!pmd_devmap(*pmdp)) || !pmd_present(*pmdp));
|
||||
VM_BUG_ON((pmd_present(*pmdp) && !pmd_trans_huge(*pmdp)) ||
|
||||
!pmd_present(*pmdp));
|
||||
pmd = pmdp_huge_get_and_clear(vma->vm_mm, addr, pmdp);
|
||||
/*
|
||||
* if it not a fullmm flush, then we can possibly end up converting
|
||||
|
|
@ -223,8 +222,7 @@ pud_t pudp_huge_get_and_clear_full(struct vm_area_struct *vma,
|
|||
pud_t pud;
|
||||
|
||||
VM_BUG_ON(addr & ~HPAGE_PMD_MASK);
|
||||
VM_BUG_ON((pud_present(*pudp) && !pud_devmap(*pudp)) ||
|
||||
!pud_present(*pudp));
|
||||
VM_BUG_ON(!pud_present(*pudp));
|
||||
pud = pudp_huge_get_and_clear(vma->vm_mm, addr, pudp);
|
||||
/*
|
||||
* if it not a fullmm flush, then we can possibly end up converting
|
||||
|
|
|
|||
|
|
@ -1426,7 +1426,7 @@ unsigned long radix__pmd_hugepage_update(struct mm_struct *mm, unsigned long add
|
|||
unsigned long old;
|
||||
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
WARN_ON(!radix__pmd_trans_huge(*pmdp) && !pmd_devmap(*pmdp));
|
||||
WARN_ON(!radix__pmd_trans_huge(*pmdp));
|
||||
assert_spin_locked(pmd_lockptr(mm, pmdp));
|
||||
#endif
|
||||
|
||||
|
|
@ -1443,7 +1443,7 @@ unsigned long radix__pud_hugepage_update(struct mm_struct *mm, unsigned long add
|
|||
unsigned long old;
|
||||
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
WARN_ON(!pud_devmap(*pudp));
|
||||
WARN_ON(!pud_trans_huge(*pudp));
|
||||
assert_spin_locked(pud_lockptr(mm, pudp));
|
||||
#endif
|
||||
|
||||
|
|
@ -1461,7 +1461,6 @@ pmd_t radix__pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long addre
|
|||
|
||||
VM_BUG_ON(address & ~HPAGE_PMD_MASK);
|
||||
VM_BUG_ON(radix__pmd_trans_huge(*pmdp));
|
||||
VM_BUG_ON(pmd_devmap(*pmdp));
|
||||
/*
|
||||
* khugepaged calls this for normal pmd
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
|
|||
return NULL;
|
||||
#endif
|
||||
|
||||
if (pmd_trans_huge(pmd) || pmd_devmap(pmd)) {
|
||||
if (pmd_trans_huge(pmd)) {
|
||||
if (is_thp)
|
||||
*is_thp = true;
|
||||
ret_pte = (pte_t *)pmdp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user