[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] get_page_type() must clean up writable pagetable state



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ed2ef64fdc3367e591d148316c948bd9669b40a6
# Parent  dd754654d4273ceb4bdaeba96e24152f6a7fe3c5
get_page_type() must clean up writable pagetable state
before failing, otherwise functions like set_gdt() can
spuriously fail because a page appears to be writable
despite there being pending changes to mapping of that
page in ptwr state.

This should fix the reported cases of crashes in
vcpu_prepare in xenlinux.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r dd754654d427 -r ed2ef64fdc33 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Nov 14 18:45:32 2005
+++ b/xen/arch/x86/mm.c Mon Nov 14 18:55:40 2005
@@ -1461,6 +1461,22 @@
             {
                 if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
                 {
+                    if ( current->domain == page_get_owner(page) )
+                    {
+                        /*
+                         * This ensures functions like set_gdt() see up-to-date
+                         * type info without needing to clean up writable p.t.
+                         * state on the fast path.
+                         */
+                        LOCK_BIGLOCK(current->domain);
+                        cleanup_writable_pagetable(current->domain);
+                        y = page->u.inuse.type_info;
+                        UNLOCK_BIGLOCK(current->domain);
+                        /* Can we make progress now? */
+                        if ( ((y & PGT_type_mask) == (type & PGT_type_mask)) ||
+                             ((y & PGT_count_mask) == 0) )
+                            goto again;
+                    }
                     if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
                          ((type & PGT_type_mask) != PGT_l1_page_table) )
                         MEM_LOG("Bad type (saw %" PRtype_info

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.