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

[Xen-changelog] Fix gcc warning and clean a piece of code in arch_set_info_guest to avoid



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 049929854f7f0c1707ac395c92fea3db2ddbc91f
# Parent  8fb4392c1d87c0b2a003d290e6d6d0541230c1c7
Fix gcc warning and clean a piece of code in arch_set_info_guest to avoid
AP of HVM domain going to a wrong code path.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>

diff -r 8fb4392c1d87 -r 049929854f7f xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Feb 22 18:23:35 2006
+++ b/xen/arch/x86/domain.c     Wed Feb 22 18:38:50 2006
@@ -346,7 +346,7 @@
     struct vcpu *v, struct vcpu_guest_context *c)
 {
     struct domain *d = v->domain;
-    unsigned long phys_basetab;
+    unsigned long phys_basetab = INVALID_MFN;
     int i, rc;
 
     /*
@@ -421,7 +421,14 @@
     if ( (rc = (int)set_gdt(v, c->gdt_frames, c->gdt_ents)) != 0 )
         return rc;
 
-    if ( shadow_mode_refcounts(d) )
+    if ( c->flags & VGCF_HVM_GUEST )
+    {
+        v->arch.guest_table = mk_pagetable(0);
+
+        if ( !hvm_initialize_guest_resources(v) )
+            return -EINVAL;
+    }
+    else if ( shadow_mode_refcounts(d) )
     {
         if ( !get_page(mfn_to_page(phys_basetab>>PAGE_SHIFT), d) )
         {
@@ -429,7 +436,7 @@
             return -EINVAL;
         }
     }
-    else if ( !(c->flags & VGCF_HVM_GUEST) )
+    else
     {
         if ( !get_page_and_type(mfn_to_page(phys_basetab>>PAGE_SHIFT), d,
                                 PGT_base_page_table) )
@@ -437,14 +444,6 @@
             destroy_gdt(v);
             return -EINVAL;
         }
-    }
-
-    if ( c->flags & VGCF_HVM_GUEST )
-    {
-        v->arch.guest_table = mk_pagetable(0);
-
-        if ( !hvm_initialize_guest_resources(v) )
-            return -EINVAL;
     }
 
     update_pagetables(v);

_______________________________________________
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®.