ia64/xen-unstable

changeset 10724:bc2f68334e96

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@intel.com>
author kfraser@localhost.localdomain
date Mon Jul 10 17:40:27 2006 +0100 (2006-07-10)
parents 405c7e86b24a
children 16b4abe0f925
files xen/arch/x86/shadow.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Mon Jul 10 17:38:41 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow.c	Mon Jul 10 17:40:27 2006 +0100
     1.3 @@ -3773,7 +3773,7 @@ static inline int guest_page_fault(
     1.4  #endif
     1.5  
     1.6  #if CONFIG_PAGING_LEVELS == 4
     1.7 -    if ( d->arch.ops->guest_paging_levels == PAGING_L4 ) 
     1.8 +    if ( d->arch.ops->guest_paging_levels == PAGING_L4 )
     1.9      {
    1.10          __rw_entry(v, va, &gle, GUEST_ENTRY | GET_ENTRY | PAGING_L4);
    1.11          if ( unlikely(!(entry_get_flags(gle) & _PAGE_PRESENT)) )
    1.12 @@ -3795,7 +3795,7 @@ static inline int guest_page_fault(
    1.13  #endif
    1.14  
    1.15  #if CONFIG_PAGING_LEVELS >= 3
    1.16 -    if ( d->arch.ops->guest_paging_levels == PAGING_L3 ) 
    1.17 +    if ( d->arch.ops->guest_paging_levels == PAGING_L3 )
    1.18      {
    1.19          if ( SH_GUEST_32PAE )
    1.20              gpfn = (hvm_get_guest_ctrl_reg(v, 3)) >> PAGE_SHIFT;
    1.21 @@ -3804,7 +3804,7 @@ static inline int guest_page_fault(
    1.22      }
    1.23  #endif
    1.24  
    1.25 -    for ( i = PAGING_L3; i >= PAGING_L1; i-- ) 
    1.26 +    for ( i = PAGING_L3; i >= PAGING_L1; i-- )
    1.27      {
    1.28          pgentry_64_t *lva;
    1.29          /*
    1.30 @@ -3822,11 +3822,12 @@ static inline int guest_page_fault(
    1.31          if ( unlikely(!(entry_get_flags(gle) & _PAGE_PRESENT)) )
    1.32              return 1;
    1.33  
    1.34 -        if ( i < PAGING_L3 ) 
    1.35 +        if ( i < PAGING_L3 ||
    1.36 +             d->arch.ops->guest_paging_levels == PAGING_L4 )
    1.37          {
    1.38 -            if ( error_code & ERROR_W ) 
    1.39 +            if ( error_code & ERROR_W )
    1.40              {
    1.41 -                if ( unlikely(!(entry_get_flags(gle) & _PAGE_RW)) ) 
    1.42 +                if ( unlikely(!(entry_get_flags(gle) & _PAGE_RW)) )
    1.43                  {
    1.44                      if ( i == PAGING_L1 )
    1.45                          if ( gpl1e )
    1.46 @@ -3834,14 +3835,14 @@ static inline int guest_page_fault(
    1.47                      return 1;
    1.48                  }
    1.49              }
    1.50 -            if ( error_code & ERROR_U ) 
    1.51 +            if ( error_code & ERROR_U )
    1.52              {
    1.53                  if ( unlikely(!(entry_get_flags(gle) & _PAGE_USER)) )
    1.54                      return 1;
    1.55              }
    1.56          }
    1.57  
    1.58 -        if ( i == PAGING_L2 ) 
    1.59 +        if ( i == PAGING_L2 )
    1.60          {
    1.61              if ( gpl2e )
    1.62                  gpl2e->l2 = gle.lo;