On Tue, Jul 29, 2008 at 05:53:48PM -0700, David Francisco Rodriguez Perez wrote:
> So I was able to do the unmapping from  the user space process page table
> inside UML using:
> 
>     pgdp = pgd_offset(mm, addr);
>     if (pgdp == NULL) return;
>     pudp = pud_offset(pgdp, addr);
>     if (pudp == NULL) return;
>     pmdp = pmd_offset(pudp, addr);
>     if (pmdp == NULL) return;
>     ptep = pte_offset_map_lock(mm, pmdp, addr, &ptlp);
>     if (ptep == NULL) return;
>     ptep_get_and_clear(mm,addr,ptep);
>     pte_unmap_unlock(ptep, ptlp);
> 
> and then decresing on purpose the map_count by 1 (only the kernel and 1 user
> process maximum sees that page) so that the vm_insert_page method can be
> called for that same page later on.

This looks pretty horrible.  Have you looked at whether there are
munmap helpers you could use?  They would take care of the TLB flush
as well.

                                Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to