s390/mm: fix phys vs virt confusion in mark_kernel_pXd() functions family

Due to historical reasons mark_kernel_pXd() functions
misuse the notion of physical vs virtual addresses
difference.

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Alexander Gordeev 2021-03-29 18:32:55 +02:00 committed by Heiko Carstens
parent 0cc00c8d40
commit 3784231b1e

View File

@ -112,7 +112,7 @@ static void mark_kernel_pmd(pud_t *pud, unsigned long addr, unsigned long end)
next = pmd_addr_end(addr, end); next = pmd_addr_end(addr, end);
if (pmd_none(*pmd) || pmd_large(*pmd)) if (pmd_none(*pmd) || pmd_large(*pmd))
continue; continue;
page = virt_to_page(pmd_val(*pmd)); page = phys_to_page(pmd_val(*pmd));
set_bit(PG_arch_1, &page->flags); set_bit(PG_arch_1, &page->flags);
} while (pmd++, addr = next, addr != end); } while (pmd++, addr = next, addr != end);
} }
@ -130,7 +130,7 @@ static void mark_kernel_pud(p4d_t *p4d, unsigned long addr, unsigned long end)
if (pud_none(*pud) || pud_large(*pud)) if (pud_none(*pud) || pud_large(*pud))
continue; continue;
if (!pud_folded(*pud)) { if (!pud_folded(*pud)) {
page = virt_to_page(pud_val(*pud)); page = phys_to_page(pud_val(*pud));
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
set_bit(PG_arch_1, &page[i].flags); set_bit(PG_arch_1, &page[i].flags);
} }
@ -151,7 +151,7 @@ static void mark_kernel_p4d(pgd_t *pgd, unsigned long addr, unsigned long end)
if (p4d_none(*p4d)) if (p4d_none(*p4d))
continue; continue;
if (!p4d_folded(*p4d)) { if (!p4d_folded(*p4d)) {
page = virt_to_page(p4d_val(*p4d)); page = phys_to_page(p4d_val(*p4d));
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
set_bit(PG_arch_1, &page[i].flags); set_bit(PG_arch_1, &page[i].flags);
} }
@ -173,7 +173,7 @@ static void mark_kernel_pgd(void)
if (pgd_none(*pgd)) if (pgd_none(*pgd))
continue; continue;
if (!pgd_folded(*pgd)) { if (!pgd_folded(*pgd)) {
page = virt_to_page(pgd_val(*pgd)); page = phys_to_page(pgd_val(*pgd));
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
set_bit(PG_arch_1, &page[i].flags); set_bit(PG_arch_1, &page[i].flags);
} }