x86/mm: use is_..._vcpu() instead of open coding it
authorJan Beulich <jbeulich@suse.com>
Wed, 24 Jun 2015 08:37:50 +0000 (10:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 24 Jun 2015 08:37:50 +0000 (10:37 +0200)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/arch/x86/mm/p2m.c
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/mm/shadow/none.c

index 1fd11947fa9d2d31077a85cfe170a64b8c7b8b2e..6b39733d2e96fcdbbbb26ab36396faef07f3a244 100644 (file)
@@ -1851,9 +1851,7 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
     struct p2m_domain *hostp2m = p2m_get_hostp2m(v->domain);
     const struct paging_mode *hostmode = paging_get_hostmode(v);
 
-    if ( is_hvm_domain(v->domain)
-        && paging_mode_hap(v->domain) 
-        && nestedhvm_is_n2(v) )
+    if ( is_hvm_vcpu(v) && paging_mode_hap(v->domain) && nestedhvm_is_n2(v) )
     {
         unsigned long gfn;
         struct p2m_domain *p2m;
index c7e0e54a98ff5ae55672e74e1b44d1819ef97bab..55b9671e772440a961f4e6e85fd24e2f5f4b2928 100644 (file)
@@ -971,7 +971,7 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn)
     if ( pg->shadow_flags &
          ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)
          || sh_page_has_multiple_shadows(pg)
-         || is_pv_domain(v->domain)
+         || is_pv_vcpu(v)
          || !v->domain->arch.paging.shadow.oos_active )
         return 0;
 
index 809f81cc8d019aee71a8e691bcf32ccffa55301b..9526443b9a01468d703dd07e02c8c4817f4de7c2 100644 (file)
@@ -73,6 +73,6 @@ static const struct paging_mode sh_paging_none = {
 
 void shadow_vcpu_init(struct vcpu *v)
 {
-    ASSERT(is_pv_domain(v->domain));
+    ASSERT(is_pv_vcpu(v));
     v->arch.paging.mode = &sh_paging_none;
 }