[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Check attributes of page table level 3 entries for 4 level HVM guest.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID bc2f68334e9649bd9f628bd5762e529d85dd5012
# Parent  405c7e86b24af0f091d337d8d5750661306c0fd9
Check attributes of page table level 3 entries for 4 level HVM guest.
Removed aound tailing spaces.
Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>
---
 xen/arch/x86/shadow.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff -r 405c7e86b24a -r bc2f68334e96 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Mon Jul 10 17:38:41 2006 +0100
+++ b/xen/arch/x86/shadow.c     Mon Jul 10 17:40:27 2006 +0100
@@ -3773,7 +3773,7 @@ static inline int guest_page_fault(
 #endif
 
 #if CONFIG_PAGING_LEVELS == 4
-    if ( d->arch.ops->guest_paging_levels == PAGING_L4 ) 
+    if ( d->arch.ops->guest_paging_levels == PAGING_L4 )
     {
         __rw_entry(v, va, &gle, GUEST_ENTRY | GET_ENTRY | PAGING_L4);
         if ( unlikely(!(entry_get_flags(gle) & _PAGE_PRESENT)) )
@@ -3795,7 +3795,7 @@ static inline int guest_page_fault(
 #endif
 
 #if CONFIG_PAGING_LEVELS >= 3
-    if ( d->arch.ops->guest_paging_levels == PAGING_L3 ) 
+    if ( d->arch.ops->guest_paging_levels == PAGING_L3 )
     {
         if ( SH_GUEST_32PAE )
             gpfn = (hvm_get_guest_ctrl_reg(v, 3)) >> PAGE_SHIFT;
@@ -3804,7 +3804,7 @@ static inline int guest_page_fault(
     }
 #endif
 
-    for ( i = PAGING_L3; i >= PAGING_L1; i-- ) 
+    for ( i = PAGING_L3; i >= PAGING_L1; i-- )
     {
         pgentry_64_t *lva;
         /*
@@ -3822,11 +3822,12 @@ static inline int guest_page_fault(
         if ( unlikely(!(entry_get_flags(gle) & _PAGE_PRESENT)) )
             return 1;
 
-        if ( i < PAGING_L3 ) 
-        {
-            if ( error_code & ERROR_W ) 
+        if ( i < PAGING_L3 ||
+             d->arch.ops->guest_paging_levels == PAGING_L4 )
+        {
+            if ( error_code & ERROR_W )
             {
-                if ( unlikely(!(entry_get_flags(gle) & _PAGE_RW)) ) 
+                if ( unlikely(!(entry_get_flags(gle) & _PAGE_RW)) )
                 {
                     if ( i == PAGING_L1 )
                         if ( gpl1e )
@@ -3834,14 +3835,14 @@ static inline int guest_page_fault(
                     return 1;
                 }
             }
-            if ( error_code & ERROR_U ) 
+            if ( error_code & ERROR_U )
             {
                 if ( unlikely(!(entry_get_flags(gle) & _PAGE_USER)) )
                     return 1;
             }
         }
 
-        if ( i == PAGING_L2 ) 
+        if ( i == PAGING_L2 )
         {
             if ( gpl2e )
                 gpl2e->l2 = gle.lo;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.