WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] clean up hap_enabled definition.

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] clean up hap_enabled definition.
From: "Li, Xin" <xin.li@xxxxxxxxx>
Date: Mon, 14 Jun 2010 00:47:27 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Delivery-date: Sun, 13 Jun 2010 09:48:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcsLGBPFLODqCDw9ReKdi7wGIik/Ig==
Thread-topic: [PATCH] clean up hap_enabled definition.
clean up the definition of hap_enabled().

Actually when hvm_domain.hap_enabled is true, it is already a hvm domain.

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

diff -r 06c384172152 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Fri Jun 11 17:47:49 2010 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Mon Jun 14 08:31:35 2010 +0800
@@ -704,7 +704,7 @@
 
     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);
diff -r 06c384172152 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c     Fri Jun 11 17:47:49 2010 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c     Mon Jun 14 08:31:35 2010 +0800
@@ -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 @@
 # 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
diff -r 06c384172152 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Jun 11 17:47:49 2010 +0100
+++ b/xen/arch/x86/mm/p2m.c     Mon Jun 14 08:31:35 2010 +0800
@@ -1729,8 +1729,7 @@
     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;
diff -r 06c384172152 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c  Fri Jun 11 17:47:49 2010 +0100
+++ b/xen/arch/x86/mm/paging.c  Mon Jun 14 08:31:35 2010 +0800
@@ -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)
diff -r 06c384172152 xen/include/asm-x86/hvm/domain.h
--- a/xen/include/asm-x86/hvm/domain.h  Fri Jun 11 17:47:49 2010 +0100
+++ b/xen/include/asm-x86/hvm/domain.h  Mon Jun 14 08:31:35 2010 +0800
@@ -98,5 +98,7 @@
     };
 };
 
+#define hap_enabled(d)  ((d)->arch.hvm_domain.hap_enabled)
+
 #endif /* __ASM_X86_HVM_DOMAIN_H__ */

Attachment: clean_hap-enabled.patch
Description: clean_hap-enabled.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] clean up hap_enabled definition., Li, Xin <=