Re: Interaction between Xen and XFS: stray RW mappings

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nick Piggin <nickpiggin@...>
Cc: David Chinner <dgc@...>, <xfs@...>, Xen-devel <xen-devel@...>, Linux Kernel Mailing List <linux-kernel@...>, Mark Williamson <mark.williamson@...>, Morten Bøgeskov <xen-users@...>, <xfs-masters@...>
Date: Sunday, October 14, 2007 - 8:57 pm

Nick Piggin wrote:

I see.


Hm.  Could there be a call to shoot down any lazy mappings of a page, so
the Xen pagetable code could use it on any pagetable page?  Ideally one
that could be used on any page, but only causes expensive operations
where needed.


In general the lazy unmappings won't worry Xen.  It's only for the
specific case of allocating memory for pagetables.  Xen can do a bit of
extra optimisation for cross-cpu tlb flushes (if the target vcpus are
not currently running, then you don't need to do anything), but they're
still an expensive operation, so the optimisation is definitely useful.


Not easily.  Xen doesn't use shadow pagetables.  Instead, it gives the
guest domains direct access to the real CPU's pagetable, but makes sure
they're always mapped RO so that the hypervisor can control updates to
the pagetables (either by trapping writes or via explicit hypercalls). 
This means that when constructing a new pagetable, Xen will verify that
all the mappings of pages making up the new pagetable are RO before
allowing it to be used.  If there are stray RW mappings of those pages,
pagetable construction will fail.

Aside from XFS, the only other case I've found where there could be
stray RW mappings is when using high pages which are still in the kmap
cache; I added an explicit call to flush the kmap cache to handle this. 
If vmap and kmap can be unified (at least the lazy unmap aspects of
them), then that would be a nice little cleanup.

    J
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Fri Oct 12, 12:58 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Sun Oct 14, 6:56 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 10:56 am)
Re: Interaction between Xen and XFS: stray RW mappings, Benjamin Herrenschmidt, (Sun Oct 21, 6:16 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 7:28 am)
Re: Interaction between Xen and XFS: stray RW mappings, Dave Airlie, (Sun Oct 21, 8:17 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 7:12 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Sun Oct 14, 7:33 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 12:15 am)
Re: Interaction between Xen and XFS: stray RW mappings, dean gaudet, (Sun Oct 21, 11:18 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 21, 11:34 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:40 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 22, 6:32 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 22, 8:36 pm)
Re: [PATCH] Allow lazy unmapping by taking extra page refere..., Jeremy Fitzhardinge, (Wed Oct 24, 1:08 am)
Re: [PATCH] Allow lazy unmapping by taking extra page refere..., Jeremy Fitzhardinge, (Wed Oct 24, 6:46 pm)
Re: [patch] Re: Interaction between Xen and XFS: stray RW ma..., Jeremy Fitzhardinge, (Tue Oct 23, 10:33 am)
Re: Interaction between Xen and XFS: stray RW mappings, Zachary Amsden, (Mon Oct 22, 8:16 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 3:11 pm)
Re: Interaction between Xen and XFS: stray RW mappings, dean gaudet, (Mon Oct 22, 12:28 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:32 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 22, 12:39 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:37 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 8:57 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 3:26 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 11:42 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 15, 12:11 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 15, 12:18 am)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 15, 12:25 am)
Re: [xfs-masters] Re: Interaction between Xen and XFS: stray..., Christoph Hellwig, (Mon Oct 15, 4:31 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Fri Oct 12, 1:08 pm)