]> xenbits.xensource.com Git - xen.git/commitdiff
x86 hap: clean up the definition of hap_enabled().
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Jun 2010 10:35:46 +0000 (11:35 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Jun 2010 10:35:46 +0000 (11:35 +0100)
Actually when hvm_domain.hap_enabled is true, it is already a hvm
domain.

Signed-off-by: Xin Li <xin.li@intel.com>
xen/arch/x86/mm/hap/p2m-ept.c
xen/arch/x86/mm/mem_sharing.c
xen/arch/x86/mm/p2m.c
xen/arch/x86/mm/paging.c
xen/include/asm-x86/hvm/domain.h

index 4fa1db4799d84d06f573ba4e9e51af9405bfc67b..e0b4a2a5069392e39c82ce75a3c76fff02336f79 100644 (file)
@@ -704,7 +704,7 @@ static void ept_dump_p2m_table(unsigned char key)
 
     for_each_domain(d)
     {
-        if ( !(is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled) )
+        if ( !hap_enabled(d) )
             continue;
 
         p2m = p2m_get_hostp2m(d);
index b539c3093da12e88dc4303903874ebdc759853cd..941ae9abb698cf202d71987998c42b31c22aab15 100644 (file)
@@ -32,7 +32,7 @@
 #include <xen/sched.h>
 
 /* Auditing of memory sharing code? */
-#define MEM_SHARING_AUDIT  0 
+#define MEM_SHARING_AUDIT  0
 
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void);
@@ -42,12 +42,9 @@ static void mem_sharing_audit(void);
 # define mem_sharing_audit() do {} while(0)
 #endif /* MEM_SHARING_AUDIT */
 
-
-#define hap_enabled(d) \
-    (is_hvm_domain(d) && paging_mode_hap(d))
 #define mem_sharing_enabled(d) \
     (is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
+
 #undef mfn_to_page
 #define mfn_to_page(_m) __mfn_to_page(mfn_x(_m))
 #undef mfn_valid
index 79ae91571108fc60a3becbe0ecd7755cb20b2ef3..e8f5282e662b7d41eccf37f16cce5e336a8e3193 100644 (file)
@@ -1729,8 +1729,7 @@ int p2m_init(struct domain *d)
     p2m->get_entry_current = p2m_gfn_to_mfn_current;
     p2m->change_entry_type_global = p2m_change_type_global;
 
-    if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
-         (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
+    if ( hap_enabled(d) && (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
         ept_p2m_init(d);
 
     return 0;
index 2cadef8e94de04969c2ea015f9d58a4ed99560ea..1c1112dc96c1c6d7ca0e6c031a9e1d006be196b7 100644 (file)
@@ -29,8 +29,6 @@
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
-#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
-
 /* Printouts */
 #define PAGING_PRINTK(_f, _a...)                                     \
     debugtrace_printk("pg: %s(): " _f, __func__, ##_a)
index 4d68d4b7f44ff7e79bc24be2e20bbce9260d177e..c43d9c385469d7f60e36e88f527b427da2204d07 100644 (file)
@@ -98,5 +98,7 @@ struct hvm_domain {
     };
 };
 
+#define hap_enabled(d)  ((d)->arch.hvm_domain.hap_enabled)
+
 #endif /* __ASM_X86_HVM_DOMAIN_H__ */