|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: Vanilla Linux and has_foreign_mapping
On Mon, 2008-04-21 at 21:46 +1000, Jeremy Fitzhardinge wrote:
> Michael Abd-El-Malek wrote:
> > I'm trying to add support to Linux 2.6.25 for the
> > "has_foreign_mappings" MMU context flag. Xen's Linux 2.6.18 tree uses
> > this flag, so that page tables are properly disposed of when an
> > application exits when it has foreign mappings.
>
> I was hoping to avoid having to introduce that flag, but I have to admit
> I haven't given it much analysis. How are you using it?
I looked at this a while back, but am somewhat sparse on the details
now.
Attaching a commit from the dom0 tree that references this.
>From my notes:
http://lists.xensource.com/archives/html/xen-devel/2006-08/msg00014.html
http://xenbits.xensource.com/xen-unstable.hg?rev/e351aace191e
it sounds like the scenario is thus:
1) process with foreign mappings exits, arch_exit_mmap() called
2) the page tables get unpinned, no other users of the foreign
pages so they get returned to the xen heap
3) dom0 balloons and the machine physical page which had been
foreign mapped is now allocated to another dom0 process
4) when the original process goes to clean up its ptes, it
reverse maps the mfn in the pte to the now allocated and
drops a reference count it doesn't own
I've also a vague memory of thinking that the PAGE_IO flag recently
introduced to linux-2.6.18-xen.hg could be used to avoid this condition
too.
Cheers,
Mark.
ioctl-privcmd-mmap.patch
Description: Text Data
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|