Skip to content

Commit 3c8e44c

Browse files
xzpeterakpm00
authored andcommitted
mm: mark special bits for huge pfn mappings when inject
We need these special bits to be around on pfnmaps. Mark properly for !devmap case, reflecting that there's no page struct backing the entry. Link: https://lkml.kernel.org/r/[email protected] Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Peter Xu <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Niklas Schnelle <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent ef713ec commit 3c8e44c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mm/huge_memory.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,8 @@ static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
13701370
entry = pmd_mkhuge(pfn_t_pmd(pfn, prot));
13711371
if (pfn_t_devmap(pfn))
13721372
entry = pmd_mkdevmap(entry);
1373+
else
1374+
entry = pmd_mkspecial(entry);
13731375
if (write) {
13741376
entry = pmd_mkyoung(pmd_mkdirty(entry));
13751377
entry = maybe_pmd_mkwrite(entry, vma);
@@ -1466,6 +1468,8 @@ static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
14661468
entry = pud_mkhuge(pfn_t_pud(pfn, prot));
14671469
if (pfn_t_devmap(pfn))
14681470
entry = pud_mkdevmap(entry);
1471+
else
1472+
entry = pud_mkspecial(entry);
14691473
if (write) {
14701474
entry = pud_mkyoung(pud_mkdirty(entry));
14711475
entry = maybe_pud_mkwrite(entry, vma);

0 commit comments

Comments
 (0)