ia64/xen-unstable

changeset 8966:049929854f7f

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@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Feb 22 19:38:50 2006 +0100 (2006-02-22)
parents 8fb4392c1d87
children f1c75df46b46
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Feb 22 19:23:35 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Wed Feb 22 19:38:50 2006 +0100
     1.3 @@ -346,7 +346,7 @@ int arch_set_info_guest(
     1.4      struct vcpu *v, struct vcpu_guest_context *c)
     1.5  {
     1.6      struct domain *d = v->domain;
     1.7 -    unsigned long phys_basetab;
     1.8 +    unsigned long phys_basetab = INVALID_MFN;
     1.9      int i, rc;
    1.10  
    1.11      /*
    1.12 @@ -421,7 +421,14 @@ int arch_set_info_guest(
    1.13      if ( (rc = (int)set_gdt(v, c->gdt_frames, c->gdt_ents)) != 0 )
    1.14          return rc;
    1.15  
    1.16 -    if ( shadow_mode_refcounts(d) )
    1.17 +    if ( c->flags & VGCF_HVM_GUEST )
    1.18 +    {
    1.19 +        v->arch.guest_table = mk_pagetable(0);
    1.20 +
    1.21 +        if ( !hvm_initialize_guest_resources(v) )
    1.22 +            return -EINVAL;
    1.23 +    }
    1.24 +    else if ( shadow_mode_refcounts(d) )
    1.25      {
    1.26          if ( !get_page(mfn_to_page(phys_basetab>>PAGE_SHIFT), d) )
    1.27          {
    1.28 @@ -429,7 +436,7 @@ int arch_set_info_guest(
    1.29              return -EINVAL;
    1.30          }
    1.31      }
    1.32 -    else if ( !(c->flags & VGCF_HVM_GUEST) )
    1.33 +    else
    1.34      {
    1.35          if ( !get_page_and_type(mfn_to_page(phys_basetab>>PAGE_SHIFT), d,
    1.36                                  PGT_base_page_table) )
    1.37 @@ -439,14 +446,6 @@ int arch_set_info_guest(
    1.38          }
    1.39      }
    1.40  
    1.41 -    if ( c->flags & VGCF_HVM_GUEST )
    1.42 -    {
    1.43 -        v->arch.guest_table = mk_pagetable(0);
    1.44 -
    1.45 -        if ( !hvm_initialize_guest_resources(v) )
    1.46 -            return -EINVAL;
    1.47 -    }
    1.48 -
    1.49      update_pagetables(v);
    1.50  
    1.51      if ( v->vcpu_id == 0 )