x86/pv/domain: clean up setup_compat_l4
authorWei Liu <wei.liu2@citrix.com>
Wed, 26 Apr 2017 15:24:13 +0000 (16:24 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 7 Jun 2017 11:15:56 +0000 (12:15 +0100)
Move updating type_info after clearing the page. Add spaces.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/pv/domain.c

index 2fa075bc43eb31d4727ebc2871c53c7c7eb5e392..4bd65819f77d8145d55f4d9b8af92f2c450014c8 100644 (file)
@@ -27,14 +27,14 @@ static int setup_compat_l4(struct vcpu *v)
     if ( pg == NULL )
         return -ENOMEM;
 
-    /* This page needs to look like a pagetable so that it can be shadowed */
-    pg->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
-
     l4tab = __map_domain_page(pg);
     clear_page(l4tab);
     init_guest_l4_table(l4tab, v->domain, 1);
     unmap_domain_page(l4tab);
 
+    /* This page needs to look like a pagetable so that it can be shadowed */
+    pg->u.inuse.type_info = PGT_l4_page_table | PGT_validated | 1;
+
     v->arch.guest_table = pagetable_from_page(pg);
     v->arch.guest_table_user = v->arch.guest_table;