rpms/kernel/FC-5 xen-9232_fix_vmx.patch, NONE, 1.1 xen-9236_fix_vmx.patch, NONE, 1.1 kernel-2.6.spec, 1.2063, 1.2064

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Mar 20 20:08:42 UTC 2006


Author: quintela

Update of /cvs/dist/rpms/kernel/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv11346

Modified Files:
	kernel-2.6.spec 
Added Files:
	xen-9232_fix_vmx.patch xen-9236_fix_vmx.patch 
Log Message:
added 9232 & 9236 xen HV csets neeeded for VMX x86/x86_64 transitions

xen-9232_fix_vmx.patch:
 shadow.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

--- NEW FILE xen-9232_fix_vmx.patch ---
# HG changeset patch
# User kaf24 at firebug.cl.cam.ac.uk
# Node ID 1f739672ca00d23dd10f110d05a9103918b4ea19
# Parent  1c24ee05f8f3e0180d28ac3922ed984b8e0d0735
Fix a bug which occurs when Xen is compiled with debug=y. Destroying a
32-bit HVM guest on x86/64 will cause a Xen hang.

Signed-off-by: Xiaohui Xin <xiaohui.xin at intel.com>

diff -r 1c24ee05f8f3 -r 1f739672ca00 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c	Tue Mar 14 15:40:44 2006 +0100
+++ b/xen/arch/x86/shadow.c	Tue Mar 14 15:43:10 2006 +0100
@@ -202,6 +202,16 @@ shadow_promote(struct domain *d, unsigne
  * tlbflush_timestamp holds a min & max index of valid page table entries
  * within the shadow page.
  */
+static inline void
+shadow_page_info_init(struct page_info *page,
+                      unsigned long gmfn,
+                      u32 psh_type)
+{
+    ASSERT( (gmfn & ~PGT_mfn_mask) == 0 );
+    page->u.inuse.type_info = psh_type | gmfn;
+    page->count_info = 0;
+    page->tlbflush_timestamp = 0;
+}
 
 static inline unsigned long
 alloc_shadow_page(struct domain *d,
@@ -249,6 +259,11 @@ alloc_shadow_page(struct domain *d,
                 l1 = map_domain_page(page_to_mfn(page + 1));
                 memset(l1, 0, PAGE_SIZE);
                 unmap_domain_page(l1);
+
+                /* we'd like to initialize the second continuous page here
+                 * and leave the first page initialization later */
+
+                shadow_page_info_init(page+1, gmfn, psh_type);
 #else
                 page = alloc_domheap_page(NULL);
                 if (!page)
@@ -294,10 +309,7 @@ alloc_shadow_page(struct domain *d,
 
     smfn = page_to_mfn(page);
 
-    ASSERT( (gmfn & ~PGT_mfn_mask) == 0 );
-    page->u.inuse.type_info = psh_type | gmfn;
-    page->count_info = 0;
-    page->tlbflush_timestamp = 0;
+    shadow_page_info_init(page, gmfn, psh_type);
 
     switch ( psh_type )
     {

xen-9236_fix_vmx.patch:
 arch/x86/shadow.c    |   14 +++++++++++++-
 include/asm-x86/mm.h |    9 +++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

--- NEW FILE xen-9236_fix_vmx.patch ---
# HG changeset patch
# User kaf24 at firebug.cl.cam.ac.uk
# Node ID f4cef1aa25218c37c1ed94d00acaa2741abd0d1c
# Parent  de5d2b9a9cfb2a01d6abe22ff51ae8b47c1d8865
Fix ASSERT failure caused by NX support code on x86_64
When turning on debug for x86_64, ASSERT(gpfn =3D=3D (gpfn & =
PGT_mfn_mask))
in __shadow_status will fail, this patch makes the NX support code
comply with this ASSERT.
NB: NX on PAE xen is not supported yet.

Signed-off-by: Xin Li <xin.b.li at intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima at intel.com>

diff -r de5d2b9a9cfb -r f4cef1aa2521 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c	Tue Mar 14 16:00:16 2006 +0100
+++ b/xen/arch/x86/shadow.c	Tue Mar 14 16:09:34 2006 +0100
@@ -3413,7 +3413,9 @@ static inline int l2e_rw_fault(
     l1_pgentry_t sl1e;
     l1_pgentry_t old_sl1e;
     l2_pgentry_t sl2e;
+#ifdef __x86_64__
     u64 nx = 0;
+#endif
     int put_ref_check = 0;
     /* Check if gpfn is 2M aligned */
 
@@ -3428,7 +3430,9 @@ static inline int l2e_rw_fault(
     l2e_remove_flags(tmp_l2e, _PAGE_PSE);
     if (l2e_get_flags(gl2e) & _PAGE_NX) {
         l2e_remove_flags(tmp_l2e, _PAGE_NX);
-        nx = 1ULL << 63;
+#ifdef __x86_64__
+        nx = PGT_high_mfn_nx;
+#endif
     }
 
 
@@ -3436,7 +3440,11 @@ static inline int l2e_rw_fault(
     if ( !__shadow_get_l2e(v, va, &sl2e) )
         sl2e = l2e_empty();
 
+#ifdef __x86_64__
     l1_mfn = __shadow_status(d, start_gpfn | nx, PGT_fl1_shadow);
+#else
+    l1_mfn = __shadow_status(d, start_gpfn, PGT_fl1_shadow);
+#endif
 
     /* Check the corresponding l2e */
     if (l1_mfn) {
@@ -3454,7 +3462,11 @@ static inline int l2e_rw_fault(
     } else {
         /* Allocate a new page as shadow page table if need */
         gmfn = gmfn_to_mfn(d, start_gpfn);
+#ifdef __x86_64__
         l1_mfn = alloc_shadow_page(d, start_gpfn | nx, gmfn, PGT_fl1_shadow);
+#else
+        l1_mfn = alloc_shadow_page(d, start_gpfn, gmfn, PGT_fl1_shadow);
+#endif
         if (unlikely(!l1_mfn)) {
             BUG();
         }
diff -r de5d2b9a9cfb -r f4cef1aa2521 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Tue Mar 14 16:00:16 2006 +0100
+++ b/xen/include/asm-x86/mm.h	Tue Mar 14 16:09:34 2006 +0100
@@ -98,8 +98,17 @@ struct page_info
  /* 16-bit count of uses of this frame as its current type. */
 #define PGT_count_mask      ((1U<<16)-1)
 
+#ifdef __x86_64__
+#define PGT_high_mfn_shift  52
+#define PGT_high_mfn_mask   (0x7ffUL << PGT_high_mfn_shift)
+#define PGT_mfn_mask        (((1U<<23)-1) | PGT_high_mfn_mask)
+#define PGT_high_mfn_nx     (0x800UL << PGT_high_mfn_shift)
+#else
  /* 23-bit mfn mask for shadow types: good for up to 32GB RAM. */
 #define PGT_mfn_mask        ((1U<<23)-1)
+ /* NX for PAE xen is not supported yet */
+#define PGT_high_mfn_nx     (1ULL << 63)
+#endif
 
 #define PGT_score_shift     23
 #define PGT_score_mask      (((1U<<4)-1)<<PGT_score_shift)


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-5/kernel-2.6.spec,v
retrieving revision 1.2063
retrieving revision 1.2064
diff -u -r1.2063 -r1.2064
--- kernel-2.6.spec	20 Mar 2006 19:56:39 -0000	1.2063
+++ kernel-2.6.spec	20 Mar 2006 20:08:40 -0000	1.2064
@@ -423,6 +423,9 @@
 
 # Xen hypervisor patches
 Patch20000: xen-sched-sedf.patch
+Patch20001: xen-9232_fix_vmx.patch
+Patch20002: xen-9236_fix_vmx.patch
+
 
 # END OF PATCH DEFINITIONS
 
@@ -705,12 +708,11 @@
 cp -rl vanilla linux-%{kversion}.%{_target_cpu}
 cp -rl xen-vanilla xen
 
-%if %{buildxen}
-cd xen
 # Any necessary hypervisor patches go here
-%patch20000 -p2
-cd ..
-%endif
+%patch20000 -p1
+%patch20001 -p1
+%patch20002 -p1
+
 cd linux-%{kversion}.%{_target_cpu}
 
 # Update to latest upstream.
@@ -1652,6 +1654,9 @@
 %endif
 
 %changelog
+* Mon Mar 20 2006 Juan Quintela <quintela at redhat.com>
+- fix xen vmx in 64 bits.
+
 * Mon Mar 20 2006 Dave Jones <davej at redhat.com>
 - 2.6.16
 




More information about the fedora-cvs-commits mailing list