ia64/xen-unstable

changeset 17389:7d617282f18e

x86: fold GDT and LDT page types

...it's an unecessary distinction

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Apr 04 13:10:34 2008 +0100 (2008-04-04)
parents b2a63fc4fac9
children 85d8d3f5c651
files xen/arch/x86/mm.c xen/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/arch/x86/mm.c	Fri Apr 04 13:03:57 2008 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Fri Apr 04 13:10:34 2008 +0100
     1.3 @@ -476,7 +476,7 @@ static void invalidate_shadow_ldt(struct
     1.4          if ( pfn == 0 ) continue;
     1.5          l1e_write(&v->arch.perdomain_ptes[i], l1e_empty());
     1.6          page = mfn_to_page(pfn);
     1.7 -        ASSERT_PAGE_IS_TYPE(page, PGT_ldt_page);
     1.8 +        ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
     1.9          ASSERT_PAGE_IS_DOMAIN(page, v->domain);
    1.10          put_page_and_type(page);
    1.11      }
    1.12 @@ -530,7 +530,7 @@ int map_ldt_shadow_page(unsigned int off
    1.13      if ( unlikely(!mfn_valid(mfn)) )
    1.14          return 0;
    1.15  
    1.16 -    okay = get_page_and_type(mfn_to_page(mfn), d, PGT_ldt_page);
    1.17 +    okay = get_page_and_type(mfn_to_page(mfn), d, PGT_seg_desc_page);
    1.18      if ( unlikely(!okay) )
    1.19          return 0;
    1.20  
    1.21 @@ -924,7 +924,7 @@ void put_page_from_l1e(l1_pgentry_t l1e,
    1.22      {
    1.23          /* We expect this is rare so we blow the entire shadow LDT. */
    1.24          if ( unlikely(((page->u.inuse.type_info & PGT_type_mask) == 
    1.25 -                       PGT_ldt_page)) &&
    1.26 +                       PGT_seg_desc_page)) &&
    1.27               unlikely(((page->u.inuse.type_info & PGT_count_mask) != 0)) &&
    1.28               (d == e) )
    1.29          {
    1.30 @@ -1748,8 +1748,7 @@ static int alloc_page_type(struct page_i
    1.31          return alloc_l3_table(page);
    1.32      case PGT_l4_page_table:
    1.33          return alloc_l4_table(page);
    1.34 -    case PGT_gdt_page:
    1.35 -    case PGT_ldt_page:
    1.36 +    case PGT_seg_desc_page:
    1.37          return alloc_segdesc_page(page);
    1.38      default:
    1.39          printk("Bad type in alloc_page_type %lx t=%" PRtype_info " c=%x\n", 
    1.40 @@ -3134,7 +3133,7 @@ long set_gdt(struct vcpu *v,
    1.41      {
    1.42          mfn = frames[i] = gmfn_to_mfn(d, frames[i]);
    1.43          if ( !mfn_valid(mfn) ||
    1.44 -             !get_page_and_type(mfn_to_page(mfn), d, PGT_gdt_page) )
    1.45 +             !get_page_and_type(mfn_to_page(mfn), d, PGT_seg_desc_page) )
    1.46              goto fail;
    1.47      }
    1.48  
    1.49 @@ -3211,12 +3210,8 @@ long do_update_descriptor(u64 pa, u64 de
    1.50      /* Check if the given frame is in use in an unsafe context. */
    1.51      switch ( page->u.inuse.type_info & PGT_type_mask )
    1.52      {
    1.53 -    case PGT_gdt_page:
    1.54 -        if ( unlikely(!get_page_type(page, PGT_gdt_page)) )
    1.55 -            goto out;
    1.56 -        break;
    1.57 -    case PGT_ldt_page:
    1.58 -        if ( unlikely(!get_page_type(page, PGT_ldt_page)) )
    1.59 +    case PGT_seg_desc_page:
    1.60 +        if ( unlikely(!get_page_type(page, PGT_seg_desc_page)) )
    1.61              goto out;
    1.62          break;
    1.63      default:
     2.1 --- a/xen/include/asm-x86/mm.h	Fri Apr 04 13:03:57 2008 +0100
     2.2 +++ b/xen/include/asm-x86/mm.h	Fri Apr 04 13:10:34 2008 +0100
     2.3 @@ -69,8 +69,7 @@ struct page_info
     2.4  #define PGT_l2_page_table   (2U<<29) /* using this page as an L2 page table? */
     2.5  #define PGT_l3_page_table   (3U<<29) /* using this page as an L3 page table? */
     2.6  #define PGT_l4_page_table   (4U<<29) /* using this page as an L4 page table? */
     2.7 -#define PGT_gdt_page        (5U<<29) /* using this page in a GDT? */
     2.8 -#define PGT_ldt_page        (6U<<29) /* using this page in an LDT? */
     2.9 +#define PGT_seg_desc_page   (5U<<29) /* using this page in a GDT/LDT? */
    2.10  #define PGT_writable_page   (7U<<29) /* has writable mappings of this page? */
    2.11  #define PGT_type_mask       (7U<<29) /* Bits 29-31. */
    2.12