Kip Macy
2008-Feb-20 02:34 UTC
[Xen-devel] is there any way to avoid lazy updates to page attribute bits?
I''m finding that regardless of which update method I use - writeable page tables, HYPERVISOR_update_va_mapping, or HYPERVISOR_mmu_update that xen will frequently only update the address bits in the page table at the time of the hypercall - presumably setting the attribute bits some time later when the mapping is accessed. This is fairly problematic for me in that freebsd relies on the page attribute bits in the page table accurately reflecting the attributes that were set for a mapping. Is it now necessary for PV guests to maintain page attribute data outside of the page tables? -Kip _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Feb-20 08:10 UTC
Re: [Xen-devel] is there any way to avoid lazy updates to page attribute bits?
On 20/2/08 02:34, "Kip Macy" <kip.macy@gmail.com> wrote:> I''m finding that regardless of which update method I use - writeable > page tables, HYPERVISOR_update_va_mapping, or HYPERVISOR_mmu_update > that xen will frequently only update the address bits in the page > table at the time of the hypercall - presumably setting the attribute > bits some time later when the mapping is accessed. This is fairly > problematic for me in that freebsd relies on the page attribute bits > in the page table accurately reflecting the attributes that were set > for a mapping. Is it now necessary for PV guests to maintain page > attribute data outside of the page tables?Attributes are always updated synchronously at the same time as the address bits. Xen may modify the attributes a bit (e.g., fiddling with PAGE_GLOBAL and PAGE_USER for 64-bit guests) but this is done deterministically and synchronously; never lazily. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kip Macy
2008-Feb-20 21:56 UTC
Re: [Xen-devel] is there any way to avoid lazy updates to page attribute bits?
On Wed, Feb 20, 2008 at 12:10 AM, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 20/2/08 02:34, "Kip Macy" <kip.macy@gmail.com> wrote: > > > I''m finding that regardless of which update method I use - writeable > > page tables, HYPERVISOR_update_va_mapping, or HYPERVISOR_mmu_update > > that xen will frequently only update the address bits in the page > > table at the time of the hypercall - presumably setting the attribute > > bits some time later when the mapping is accessed. This is fairly > > problematic for me in that freebsd relies on the page attribute bits > > in the page table accurately reflecting the attributes that were set > > for a mapping. Is it now necessary for PV guests to maintain page > > attribute data outside of the page tables? > > Attributes are always updated synchronously at the same time as the address > bits. Xen may modify the attributes a bit (e.g., fiddling with PAGE_GLOBAL > and PAGE_USER for 64-bit guests) but this is done deterministically and > synchronously; never lazily.Ok. That isn''t what I''m seeing on 3.1 and 3.2, I''ll instrument xen and try to track it down. Also, I removed the use of recursive page tables so that I could use writeable page tables - not realizing that wr pts were a dud. I''ve disabled writeable page tables and have tried re-enabling the use of recursive page tables. It appears that that doesn''t work at all any more - is that correct? -Kip _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2008-Feb-21 01:51 UTC
RE: [Xen-devel] is there any way to avoid lazy updates to pageattribute bits?
> Also, I removed the use of recursive page tables so that I could use > writeable page tables - not realizing that wr pts were a dud. I''ve > disabled writeable page tables and have tried re-enabling the use of > recursive page tables. It appears that that doesn''t work at all any > more - is that correct?I''m not sure what you mean. You can write directly to pagetables, the write will just be emulated. It was only the ''unhooking'' optimization (known as wr_pt) that was removed in 3.1, there''s no guest-visible API change. You can of course used the batched mmu_update hypercall interface or the update_va_mapping hypercall. Recursive pagetables have been observed to work for a number of different guest types (including 64b and PAE) so I''ve no reason to believe they''re broken. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel