Merge "pci_iomap: fix page fault issue on vmalloc with section mapping"

This commit is contained in:
qctecmdr 2021-03-09 03:08:55 -08:00 • committed by Gerrit - the friendly Code Review server
commit 6a0a03bd7e
2 changed files with 8 additions and 2 deletions

View file

@ -35,8 +35,7 @@ EXPORT_SYMBOL(pcibios_min_mem);
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{
if ((unsigned long)addr >= VMALLOC_START &&
(unsigned long)addr < VMALLOC_END)
if (is_vmalloc_addr(addr))
iounmap(addr);
}
EXPORT_SYMBOL(pci_iounmap);

View file

@ -120,10 +120,17 @@ void __check_vmalloc_seq(struct mm_struct *mm)
do {
seq = init_mm.context.vmalloc_seq;
#ifdef CONFIG_ENABLE_VMALLOC_SAVING
memcpy(pgd_offset(mm, PAGE_OFFSET),
pgd_offset_k(PAGE_OFFSET),
sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
pgd_index(PAGE_OFFSET)));
#else
memcpy(pgd_offset(mm, VMALLOC_START),
pgd_offset_k(VMALLOC_START),
sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
pgd_index(VMALLOC_START)));
#endif
mm->context.vmalloc_seq = seq;
} while (seq != init_mm.context.vmalloc_seq);
}