If memory contents were to change, then all the above checking may get inconsistent. Looking into walk_page_range() you can see that the smaps_walk structure is not supposed to change while it is walking: Ģ02 err = walk->pgd_entry(pgd, addr, next, walk) Ģ04 (walk->pud_entry || walk->pmd_entry || walk->pte_entry Walk_page_range(vma->vm_start, vma->vm_end, &smaps_walk) Īnd your function is somewhat like that of walk_page_range(). The following is an excerpt from that function, the parts unrelated to. ![]() if (vma->vm_mm & !is_vm_hugetlb_page(vma)) A very simple example of a page table walk is the function followpage() in mm/memory.c. Look at /proc//smaps filesystem, you can see the userspace memory: cat smapsīfa60000-bfa81000 rw-p 00000000 00:00 0 Īnd how it is printed is via fs/proc/task_mmu.c (from kernel source): I'm working with kernel 2.6.35-22 and three levels page tables. So why the process can't complete correcly the `ioctl' call? Maybe i have to lock something before navigating the page tables? The strange thing is that calling ioctl in a user space process, this segfaults.but it seems that the way i'm looking for the page table entry is correct because with dmesg i obtain for example for each ioctl call: Valid pgd Struct page *page = walk_page_table(addr) ![]() This function is called from the ioctl and addr is a virtual address in process address space: static int my_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long addr) ![]() Printk(KERN_INFO "page frame struct is %p", page) In a kernel module i realized the following function: static struct page *walk_page_table(unsigned long addr) I'm trying to navigate the page tables for a process in linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |