ia64/xen-unstable

changeset 17851:98ed32885ec0

x86: Reduce page->shadow_flags to 32 bits so we can steal space for a
spinlock_t (on 64-bit Xen) without expanding the page_info struct.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 12 17:57:03 2008 +0100 (2008-06-12)
parents 8182f5158dc2
children 09dd5999401b
files xen/arch/x86/mm/shadow/common.c xen/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Thu Jun 12 17:17:44 2008 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Thu Jun 12 17:57:03 2008 +0100
     1.3 @@ -463,11 +463,7 @@ void shadow_demote(struct vcpu *v, mfn_t
     1.4      clear_bit(type, &page->shadow_flags);
     1.5  
     1.6      if ( (page->shadow_flags & SHF_page_type_mask) == 0 )
     1.7 -    {
     1.8 -        /* tlbflush timestamp field is valid again */
     1.9 -        page->tlbflush_timestamp = tlbflush_current_time();
    1.10          clear_bit(_PGC_page_table, &page->count_info);
    1.11 -    }
    1.12  }
    1.13  
    1.14  /**************************************************************************/
    1.15 @@ -2076,7 +2072,7 @@ void sh_remove_shadows(struct vcpu *v, m
    1.16      if ( !fast && all && (pg->count_info & PGC_page_table) )
    1.17      {
    1.18          SHADOW_ERROR("can't find all shadows of mfn %05lx "
    1.19 -                     "(shadow_flags=%08lx)\n",
    1.20 +                     "(shadow_flags=%08x)\n",
    1.21                        mfn_x(gmfn), pg->shadow_flags);
    1.22          domain_crash(v->domain);
    1.23      }
     2.1 --- a/xen/include/asm-x86/mm.h	Thu Jun 12 17:17:44 2008 +0100
     2.2 +++ b/xen/include/asm-x86/mm.h	Thu Jun 12 17:57:03 2008 +0100
     2.3 @@ -59,8 +59,12 @@ struct page_info
     2.4           * tlbflush_timestamp since page table pages are explicitly not
     2.5           * tracked for TLB-flush avoidance when a guest runs in shadow mode.
     2.6           */
     2.7 -        unsigned long shadow_flags;
     2.8 +        u32 shadow_flags;
     2.9      };
    2.10 +
    2.11 +#if defined(__x86_64__)
    2.12 +    spinlock_t lock;
    2.13 +#endif
    2.14  };
    2.15  
    2.16   /* The following page types are MUTUALLY EXCLUSIVE. */
    2.17 @@ -89,9 +93,11 @@ struct page_info
    2.18   /* Cleared when the owning guest 'frees' this page. */
    2.19  #define _PGC_allocated      31
    2.20  #define PGC_allocated       (1U<<_PGC_allocated)
    2.21 - /* Set on a *guest* page to mark it out-of-sync with its shadow */
    2.22 -#define _PGC_out_of_sync    30
    2.23 -#define PGC_out_of_sync     (1U<<_PGC_out_of_sync)
    2.24 +#if defined(__i386__)
    2.25 + /* Page is locked? */
    2.26 +# define _PGC_locked        30
    2.27 +# define PGC_locked         (1U<<_PGC_out_of_sync)
    2.28 +#endif
    2.29   /* Set when is using a page as a page table */
    2.30  #define _PGC_page_table     29
    2.31  #define PGC_page_table      (1U<<_PGC_page_table)