ia64/xen-unstable

changeset 6926:6fb3b1d9e336

The domain structure maintains several shadow mode stats,
such as shadow page counts for l1 & l2, hl2 tables, snapshots,
etc. These counts are not decremented properly when we
free shadow pages. The following patch fixes this problem.

Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Sep 19 09:00:26 2005 +0000 (2005-09-19)
parents 7e7d93aa4072
children cedb89d6b707
files xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c
line diff
     1.1 --- a/xen/arch/x86/shadow32.c	Sun Sep 18 07:38:25 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow32.c	Mon Sep 19 09:00:26 2005 +0000
     1.3 @@ -399,22 +399,26 @@ void free_shadow_page(unsigned long smfn
     1.4          perfc_decr(shadow_l1_pages);
     1.5          shadow_demote(d, gpfn, gmfn);
     1.6          free_shadow_l1_table(d, smfn);
     1.7 +        d->arch.shadow_page_count--;
     1.8          break;
     1.9  
    1.10      case PGT_l2_shadow:
    1.11          perfc_decr(shadow_l2_pages);
    1.12          shadow_demote(d, gpfn, gmfn);
    1.13          free_shadow_l2_table(d, smfn, page->u.inuse.type_info);
    1.14 +        d->arch.shadow_page_count--;
    1.15          break;
    1.16  
    1.17      case PGT_hl2_shadow:
    1.18          perfc_decr(hl2_table_pages);
    1.19          shadow_demote(d, gpfn, gmfn);
    1.20          free_shadow_hl2_table(d, smfn);
    1.21 +        d->arch.hl2_page_count--;
    1.22          break;
    1.23  
    1.24      case PGT_snapshot:
    1.25          perfc_decr(snapshot_pages);
    1.26 +        d->arch.snapshot_page_count--;
    1.27          break;
    1.28  
    1.29      default:
    1.30 @@ -423,8 +427,6 @@ void free_shadow_page(unsigned long smfn
    1.31          break;
    1.32      }
    1.33  
    1.34 -    d->arch.shadow_page_count--;
    1.35 -
    1.36      // No TLB flushes are needed the next time this page gets allocated.
    1.37      //
    1.38      page->tlbflush_timestamp = 0;
     2.1 --- a/xen/arch/x86/shadow_public.c	Sun Sep 18 07:38:25 2005 +0000
     2.2 +++ b/xen/arch/x86/shadow_public.c	Mon Sep 19 09:00:26 2005 +0000
     2.3 @@ -595,18 +595,21 @@ void free_shadow_page(unsigned long smfn
     2.4          perfc_decr(shadow_l1_pages);
     2.5          shadow_demote(d, gpfn, gmfn);
     2.6          free_shadow_l1_table(d, smfn);
     2.7 +        d->arch.shadow_page_count--;
     2.8          break;
     2.9  #if defined (__i386__)
    2.10      case PGT_l2_shadow:
    2.11          perfc_decr(shadow_l2_pages);
    2.12          shadow_demote(d, gpfn, gmfn);
    2.13          free_shadow_l2_table(d, smfn, page->u.inuse.type_info);
    2.14 +        d->arch.shadow_page_count--;
    2.15          break;
    2.16  
    2.17      case PGT_hl2_shadow:
    2.18          perfc_decr(hl2_table_pages);
    2.19          shadow_demote(d, gpfn, gmfn);
    2.20          free_shadow_hl2_table(d, smfn);
    2.21 +        d->arch.hl2_page_count--;
    2.22          break;
    2.23  #else
    2.24      case PGT_l2_shadow:
    2.25 @@ -614,12 +617,13 @@ void free_shadow_page(unsigned long smfn
    2.26      case PGT_l4_shadow:
    2.27          shadow_demote(d, gpfn, gmfn);
    2.28          free_shadow_tables(d, smfn, shadow_type_to_level(type));
    2.29 +        d->arch.shadow_page_count--;
    2.30          break;
    2.31  
    2.32      case PGT_fl1_shadow:
    2.33          free_shadow_fl1_table(d, smfn);
    2.34 +        d->arch.shadow_page_count--;
    2.35          break;
    2.36 -
    2.37  #endif
    2.38  
    2.39      case PGT_snapshot:
    2.40 @@ -632,8 +636,6 @@ void free_shadow_page(unsigned long smfn
    2.41          break;
    2.42      }
    2.43  
    2.44 -    d->arch.shadow_page_count--;
    2.45 -
    2.46      // No TLB flushes are needed the next time this page gets allocated.
    2.47      //
    2.48      page->tlbflush_timestamp = 0;