* Tracking changes to writable page tables
@ 2005-05-15 2:17 Jacob Gorm Hansen
0 siblings, 0 replies; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-05-15 2:17 UTC (permalink / raw)
To: xen-devel
hi,
It looks like xenlinux 2.6 now uses writable page tables by default (I
can't find the switch to enable/disable them).
I need to track writes to page tables, and I was wondering if it is
possible to get a page fault upon writes to read-only mapped page
tables, as when writing to other read-only mappings?
Thanks,
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tracking changes to writable page tables
@ 2005-05-15 4:57 Ian Pratt
2005-05-15 7:08 ` Jacob Gorm Hansen
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ian Pratt @ 2005-05-15 4:57 UTC (permalink / raw)
To: Jacob Gorm Hansen, xen-devel
> It looks like xenlinux 2.6 now uses writable page tables by
> default (I can't find the switch to enable/disable them).
>
> I need to track writes to page tables, and I was wondering if
> it is possible to get a page fault upon writes to read-only
> mapped page tables, as when writing to other read-only mappings?
Hmm, I can see that the current model makes like difficult for you
(though self-migration is a pretty twisted thing to be trying to do
anyway :-)
I wander if we should steal one of the OS bits in the PTE to
differentiate writable pagetable mappings? You could then take a normal
RO fault, set the bit, and then retry to have Xen do pagetable the work.
This would arguably be cleaner, though we've been reluctant to steal OS
bits just incase there's some OS out there that uses them all.
Ian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tracking changes to writable page tables
2005-05-15 4:57 Ian Pratt
@ 2005-05-15 7:08 ` Jacob Gorm Hansen
2005-05-15 7:26 ` Jacob Gorm Hansen
2005-05-15 8:30 ` Jacob Gorm Hansen
2005-05-15 19:23 ` Jacob Gorm Hansen
2 siblings, 1 reply; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-05-15 7:08 UTC (permalink / raw)
To: Ian Pratt; +Cc: xen-devel
Ian Pratt wrote:
>>It looks like xenlinux 2.6 now uses writable page tables by
>>default (I can't find the switch to enable/disable them).
>>
>>I need to track writes to page tables, and I was wondering if
>>it is possible to get a page fault upon writes to read-only
>>mapped page tables, as when writing to other read-only mappings?
>
>
> Hmm, I can see that the current model makes like difficult for you
> (though self-migration is a pretty twisted thing to be trying to do
> anyway :-)
>
Hmm while we are discussing twisted things; would it be possible to
implement writable page tables in the guest rather than in Xen?
The guest would then take the fault, unpin and decouple the page table
from the page directory, change the protection, and do the reverse when
the page table is next used.
I suppose that would be a (somewhat radical) solution to my problem.
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tracking changes to writable page tables
2005-05-15 7:08 ` Jacob Gorm Hansen
@ 2005-05-15 7:26 ` Jacob Gorm Hansen
0 siblings, 0 replies; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-05-15 7:26 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: Ian Pratt, xen-devel
Jacob Gorm Hansen wrote:
> Ian Pratt wrote:
>>
>>
>> Hmm, I can see that the current model makes like difficult for you
>> (though self-migration is a pretty twisted thing to be trying to do
>> anyway :-)
>>
>
> Hmm while we are discussing twisted things; would it be possible to
> implement writable page tables in the guest rather than in Xen?
>
On a related note, is there any way of querying the pinning status of
pages from Xen? I used to have two global bitmaps in the guest, one for
l1 and one for l2, but I suppose I could just as well add a
get-pinned-status(mfn) hypercall to Xen, if there is not one already?
Or I could add this info to struct page in Linux.
thanks,
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tracking changes to writable page tables
2005-05-15 4:57 Ian Pratt
2005-05-15 7:08 ` Jacob Gorm Hansen
@ 2005-05-15 8:30 ` Jacob Gorm Hansen
2005-05-15 19:23 ` Jacob Gorm Hansen
2 siblings, 0 replies; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-05-15 8:30 UTC (permalink / raw)
To: xen-devel
Ian Pratt wrote:
> I wander if we should steal one of the OS bits in the PTE to
> differentiate writable pagetable mappings? You could then take a normal
> RO fault, set the bit, and then retry to have Xen do pagetable the work.
>
> This would arguably be cleaner, though we've been reluctant to steal OS
> bits just incase there's some OS out there that uses them all.
Yes, that would also be a solution, though it is a little nasty to steal
the AVL bits.
Alternatively, I can just add the tracking to set_pte(), assuming that
all updates come through there, but that will probably slow down page
table updates a bit, even while not checkpointing the kernel.
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tracking changes to writable page tables
@ 2005-05-15 9:50 Ian Pratt
0 siblings, 0 replies; 8+ messages in thread
From: Ian Pratt @ 2005-05-15 9:50 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel
> Hmm while we are discussing twisted things; would it be
> possible to implement writable page tables in the guest
> rather than in Xen?
We thought about doing this, but the data that's needed for doing the
tracking is very different from what an OS normally keeps. It would make
the hypervisor API very messy, and significantly increase the difficulty
of porting new OSes.
Doing it in Xen hides most of the ugliness and reduces the number of
protection domain crossings as well.
Ian
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tracking changes to writable page tables
@ 2005-05-15 10:00 Ian Pratt
0 siblings, 0 replies; 8+ messages in thread
From: Ian Pratt @ 2005-05-15 10:00 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel
> On a related note, is there any way of querying the pinning
> status of pages from Xen? I used to have two global bitmaps
> in the guest, one for
> l1 and one for l2, but I suppose I could just as well add a
> get-pinned-status(mfn) hypercall to Xen, if there is not one already?
See the the dom0_op GETPAGEFRAMEINFO2
Ian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tracking changes to writable page tables
2005-05-15 4:57 Ian Pratt
2005-05-15 7:08 ` Jacob Gorm Hansen
2005-05-15 8:30 ` Jacob Gorm Hansen
@ 2005-05-15 19:23 ` Jacob Gorm Hansen
2 siblings, 0 replies; 8+ messages in thread
From: Jacob Gorm Hansen @ 2005-05-15 19:23 UTC (permalink / raw)
To: xen-devel
Ian Pratt wrote:
>>It looks like xenlinux 2.6 now uses writable page tables by
>>default (I can't find the switch to enable/disable them).
>>
>>I need to track writes to page tables, and I was wondering if
>>it is possible to get a page fault upon writes to read-only
>>mapped page tables, as when writing to other read-only mappings?
>
>
> Hmm, I can see that the current model makes like difficult for you
> (though self-migration is a pretty twisted thing to be trying to do
> anyway :-)
>
> I wander if we should steal one of the OS bits in the PTE to
> differentiate writable pagetable mappings? You could then take a normal
> RO fault, set the bit, and then retry to have Xen do pagetable the work.
>
> This would arguably be cleaner, though we've been reluctant to steal OS
> bits just incase there's some OS out there that uses them all.
Actually, it seems this could be done without using an AVL bit, as this
is really per-frame rather than per-VA information. If the pte-pin call
could add a 'propagate page fault' flag to the PTE frame, then I could
still get the first fault to the guest, and then remove the pinning bit
to prevent the rest of the faults.
Jacob
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-05-15 19:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-15 2:17 Tracking changes to writable page tables Jacob Gorm Hansen
-- strict thread matches above, loose matches on Subject: below --
2005-05-15 4:57 Ian Pratt
2005-05-15 7:08 ` Jacob Gorm Hansen
2005-05-15 7:26 ` Jacob Gorm Hansen
2005-05-15 8:30 ` Jacob Gorm Hansen
2005-05-15 19:23 ` Jacob Gorm Hansen
2005-05-15 9:50 Ian Pratt
2005-05-15 10:00 Ian Pratt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.