Balbir Singh <bsinghar...@gmail.com> writes: >> + ....... >> +/* >> + * map_kernel_page currently only called by __ioremap >> + * map_kernel_page adds an entry to the ioremap page table >> + * and adds an entry to the HPT, possibly bolting it >> + */ >> +int map_kernel_page(unsigned long ea, unsigned long pa, unsigned long flags) >> +{ >> + pgd_t *pgdp; >> + pud_t *pudp; >> + pmd_t *pmdp; >> + pte_t *ptep; >> + >> + if (slab_is_available()) { >> + pgdp = pgd_offset_k(ea); >> + pudp = pud_alloc(&init_mm, pgdp, ea); >> + if (!pudp) >> + return -ENOMEM; >> + pmdp = pmd_alloc(&init_mm, pudp, ea); >> + if (!pmdp) >> + return -ENOMEM; >> + ptep = pte_alloc_kernel(pmdp, ea); >> + if (!ptep) >> + return -ENOMEM; >> + set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, >> + __pgprot(flags))); >> + } else { >> + /* >> + * If the mm subsystem is not fully up, we cannot create a >> + * linux page table entry for this mapping. Simply bolt an >> + * entry in the hardware page table. >> + * >> + */ >> + if (htab_bolt_mapping(ea, ea + PAGE_SIZE, pa, flags, >> + mmu_io_psize, mmu_kernel_ssize)) { >> + printk(KERN_ERR "Failed to do bolted mapping IO " >> + "memory at %016lx !\n", pa); >> + return -ENOMEM; > > What happens when we do unmap this? I know this code has been around for a > while > so its not new
you mean iounmap ? it do call vunmap, which look for a linux page table entry. If it is a bolt_mapping entry as above, we will not have a linux page table entry and that unmap will not relaly remove the mapping. > >> + } >> + } >> + >> + smp_wmb(); >> + return 0; >> +} -aneesh _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev