ia64/xen-unstable

changeset 6707:3bde4219c681

manual merge
author iap10@freefall.cl.cam.ac.uk
date Thu Sep 08 17:40:37 2005 +0000 (2005-09-08)
parents 5db85ba1c4e0 5321e0858b0d
children aa0990ef260f
files tools/libxc/xc_domain.c tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_private.c tools/libxc/xenctrl.h tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/image.py xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/mm.c xen/common/grant_table.c xen/common/trace.c xen/common/xmalloc.c xen/drivers/char/console.c xen/drivers/char/serial.c xen/include/asm-x86/page.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Thu Sep 08 17:36:23 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Thu Sep 08 17:40:37 2005 +0000
     1.3 @@ -381,11 +381,13 @@ static int vmx_final_setup_guest(
     1.4  out:
     1.5      free_vmcs(vmcs);
     1.6      if(v->arch.arch_vmx.io_bitmap_a != 0) {
     1.7 -        free_xenheap_pages(v->arch.arch_vmx.io_bitmap_a, get_order(0x1000));
     1.8 +        free_xenheap_pages(
     1.9 +            v->arch.arch_vmx.io_bitmap_a, get_order_from_bytes(0x1000));
    1.10          v->arch.arch_vmx.io_bitmap_a = 0;
    1.11      }
    1.12      if(v->arch.arch_vmx.io_bitmap_b != 0) {
    1.13 -        free_xenheap_pages(v->arch.arch_vmx.io_bitmap_b, get_order(0x1000));
    1.14 +        free_xenheap_pages(
    1.15 +            v->arch.arch_vmx.io_bitmap_b, get_order_from_bytes(0x1000));
    1.16          v->arch.arch_vmx.io_bitmap_b = 0;
    1.17      }
    1.18      v->arch.arch_vmx.vmcs = 0;
    1.19 @@ -972,11 +974,13 @@ static void vmx_relinquish_resources(str
    1.20      BUG_ON(v->arch.arch_vmx.vmcs == NULL);
    1.21      free_vmcs(v->arch.arch_vmx.vmcs);
    1.22      if(v->arch.arch_vmx.io_bitmap_a != 0) {
    1.23 -        free_xenheap_pages(v->arch.arch_vmx.io_bitmap_a, get_order(0x1000));
    1.24 +        free_xenheap_pages(
    1.25 +            v->arch.arch_vmx.io_bitmap_a, get_order_from_bytes(0x1000));
    1.26          v->arch.arch_vmx.io_bitmap_a = 0;
    1.27      }
    1.28      if(v->arch.arch_vmx.io_bitmap_b != 0) {
    1.29 -        free_xenheap_pages(v->arch.arch_vmx.io_bitmap_b, get_order(0x1000));
    1.30 +        free_xenheap_pages(
    1.31 +            v->arch.arch_vmx.io_bitmap_b, get_order_from_bytes(0x1000));
    1.32          v->arch.arch_vmx.io_bitmap_b = 0;
    1.33      }
    1.34      v->arch.arch_vmx.vmcs = 0;
     2.1 --- a/xen/arch/x86/domain_build.c	Thu Sep 08 17:36:23 2005 +0000
     2.2 +++ b/xen/arch/x86/domain_build.c	Thu Sep 08 17:40:37 2005 +0000
     2.3 @@ -75,15 +75,12 @@ static struct pfn_info *alloc_chunk(stru
     2.4      struct pfn_info *page;
     2.5      unsigned int order;
     2.6      /*
     2.7 -     * Allocate up to 2MB at a time:
     2.8 -     *  1. This prevents overflow of get_order() when allocating more than
     2.9 -     *     4GB to domain 0 on a PAE machine.
    2.10 -     *  2. It prevents allocating very large chunks from DMA pools before
    2.11 -     *     the >4GB pool is fully depleted.
    2.12 +     * Allocate up to 2MB at a time: It prevents allocating very large chunks
    2.13 +     * from DMA pools before the >4GB pool is fully depleted.
    2.14       */
    2.15      if ( max_pages > (2UL << (20 - PAGE_SHIFT)) )
    2.16          max_pages = 2UL << (20 - PAGE_SHIFT);
    2.17 -    order = get_order(max_pages << PAGE_SHIFT);
    2.18 +    order = get_order_from_pages(max_pages);
    2.19      if ( (max_pages & (max_pages-1)) != 0 )
    2.20          order--;
    2.21      while ( (page = alloc_domheap_pages(d, order, 0)) == NULL )
    2.22 @@ -252,7 +249,7 @@ int construct_dom0(struct domain *d,
    2.23  #endif
    2.24      }
    2.25  
    2.26 -    order = get_order(v_end - dsi.v_start);
    2.27 +    order = get_order_from_bytes(v_end - dsi.v_start);
    2.28      if ( (1UL << order) > nr_pages )
    2.29          panic("Domain 0 allocation is too small for kernel image.\n");
    2.30  
     3.1 --- a/xen/arch/x86/vmx_vmcs.c	Thu Sep 08 17:36:23 2005 +0000
     3.2 +++ b/xen/arch/x86/vmx_vmcs.c	Thu Sep 08 17:40:37 2005 +0000
     3.3 @@ -44,7 +44,7 @@ struct vmcs_struct *alloc_vmcs(void)
     3.4  
     3.5      rdmsr(MSR_IA32_VMX_BASIC_MSR, vmx_msr_low, vmx_msr_high);
     3.6      vmcs_size = vmx_msr_high & 0x1fff;
     3.7 -    vmcs = alloc_xenheap_pages(get_order(vmcs_size)); 
     3.8 +    vmcs = alloc_xenheap_pages(get_order_from_bytes(vmcs_size)); 
     3.9      memset((char *)vmcs, 0, vmcs_size); /* don't remove this */
    3.10  
    3.11      vmcs->vmcs_revision_id = vmx_msr_low;
    3.12 @@ -55,7 +55,7 @@ void free_vmcs(struct vmcs_struct *vmcs)
    3.13  {
    3.14      int order;
    3.15  
    3.16 -    order = get_order(vmcs_size);
    3.17 +    order = get_order_from_bytes(vmcs_size);
    3.18      free_xenheap_pages(vmcs, order);
    3.19  }
    3.20  
    3.21 @@ -76,8 +76,8 @@ static inline int construct_vmcs_control
    3.22      error |= __vmwrite(VM_ENTRY_CONTROLS, MONITOR_VM_ENTRY_CONTROLS);
    3.23  
    3.24      /* need to use 0x1000 instead of PAGE_SIZE */
    3.25 -    io_bitmap_a = (void*) alloc_xenheap_pages(get_order(0x1000)); 
    3.26 -    io_bitmap_b = (void*) alloc_xenheap_pages(get_order(0x1000)); 
    3.27 +    io_bitmap_a = (void*) alloc_xenheap_pages(get_order_from_bytes(0x1000)); 
    3.28 +    io_bitmap_b = (void*) alloc_xenheap_pages(get_order_from_bytes(0x1000)); 
    3.29      memset(io_bitmap_a, 0xff, 0x1000);
    3.30      /* don't bother debug port access */
    3.31      clear_bit(PC_DEBUG_PORT, io_bitmap_a);
     4.1 --- a/xen/arch/x86/x86_32/mm.c	Thu Sep 08 17:36:23 2005 +0000
     4.2 +++ b/xen/arch/x86/x86_32/mm.c	Thu Sep 08 17:40:37 2005 +0000
     4.3 @@ -118,7 +118,8 @@ void __init paging_init(void)
     4.4      }
     4.5  
     4.6      /* Set up mapping cache for domain pages. */
     4.7 -    mapcache_order = get_order(MAPCACHE_MBYTES << (20 - PAGETABLE_ORDER));
     4.8 +    mapcache_order = get_order_from_bytes(
     4.9 +        MAPCACHE_MBYTES << (20 - PAGETABLE_ORDER));
    4.10      mapcache = alloc_xenheap_pages(mapcache_order);
    4.11      memset(mapcache, 0, PAGE_SIZE << mapcache_order);
    4.12      for ( i = 0; i < (MAPCACHE_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
     5.1 --- a/xen/common/grant_table.c	Thu Sep 08 17:36:23 2005 +0000
     5.2 +++ b/xen/common/grant_table.c	Thu Sep 08 17:40:37 2005 +0000
     5.3 @@ -399,7 +399,7 @@ static int
     5.4      {
     5.5          int              i;
     5.6          grant_mapping_t *new_mt;
     5.7 -        grant_table_t   *lgt      = ld->grant_table;
     5.8 +        grant_table_t   *lgt = ld->grant_table;
     5.9  
    5.10          if ( (lgt->maptrack_limit << 1) > MAPTRACK_MAX_ENTRIES )
    5.11          {
    5.12 @@ -437,9 +437,8 @@ static int
    5.13              ref, dom, dev_hst_ro_flags);
    5.14  #endif
    5.15  
    5.16 -    if ( 0 <= ( rc = __gnttab_activate_grant_ref( ld, led, rd, ref,
    5.17 -                                                  dev_hst_ro_flags,
    5.18 -                                                  addr, &frame)))
    5.19 +    if ( (rc = __gnttab_activate_grant_ref(ld, led, rd, ref, dev_hst_ro_flags,
    5.20 +                                           addr, &frame)) >= 0 )
    5.21      {
    5.22          /*
    5.23           * Only make the maptrack live _after_ writing the pte, in case we 
    5.24 @@ -807,7 +806,8 @@ gnttab_donate(gnttab_donate_t *uop, unsi
    5.25      int i;
    5.26      int result = GNTST_okay;
    5.27  
    5.28 -    for (i = 0; i < count; i++) {
    5.29 +    for ( i = 0; i < count; i++ )
    5.30 +    {
    5.31          gnttab_donate_t *gop = &uop[i];
    5.32  #if GRANT_DEBUG
    5.33          printk("gnttab_donate: i=%d mfn=%lx domid=%d gref=%08x\n",
    5.34 @@ -881,30 +881,6 @@ gnttab_donate(gnttab_donate_t *uop, unsi
    5.35           * headroom.  Also, a domain mustn't have PGC_allocated
    5.36           * pages when it is dying.
    5.37           */
    5.38 -#ifdef GRANT_DEBUG
    5.39 -        if (unlikely(e->tot_pages >= e->max_pages)) {
    5.40 -            printk("gnttab_dontate: no headroom tot_pages=%d max_pages=%d\n",
    5.41 -                   e->tot_pages, e->max_pages);
    5.42 -            spin_unlock(&e->page_alloc_lock);
    5.43 -            put_domain(e);
    5.44 -            gop->status = result = GNTST_general_error;
    5.45 -            break;
    5.46 -        }
    5.47 -        if (unlikely(test_bit(DOMFLAGS_DYING, &e->domain_flags))) {
    5.48 -            printk("gnttab_donate: target domain is dying\n");
    5.49 -            spin_unlock(&e->page_alloc_lock);
    5.50 -            put_domain(e);
    5.51 -            gop->status = result = GNTST_general_error;
    5.52 -            break;
    5.53 -        }
    5.54 -        if (unlikely(!gnttab_prepare_for_transfer(e, d, gop->handle))) {
    5.55 -            printk("gnttab_donate: gnttab_prepare_for_transfer fails.\n");
    5.56 -            spin_unlock(&e->page_alloc_lock);
    5.57 -            put_domain(e);
    5.58 -            gop->status = result = GNTST_general_error;
    5.59 -            break;
    5.60 -        }
    5.61 -#else
    5.62          ASSERT(e->tot_pages <= e->max_pages);
    5.63          if (unlikely(test_bit(DOMFLAGS_DYING, &e->domain_flags)) ||
    5.64              unlikely(e->tot_pages == e->max_pages) ||
    5.65 @@ -914,11 +890,10 @@ gnttab_donate(gnttab_donate_t *uop, unsi
    5.66                     e->tot_pages, e->max_pages, gop->handle, e->d_flags);
    5.67              spin_unlock(&e->page_alloc_lock);
    5.68              put_domain(e);
    5.69 -            /* XXX SMH: better error return here would be useful */
    5.70              gop->status = result = GNTST_general_error;
    5.71              break;
    5.72          }
    5.73 -#endif
    5.74 +
    5.75          /* Okay, add the page to 'e'. */
    5.76          if (unlikely(e->tot_pages++ == 0)) {
    5.77              get_knownalive_domain(e);
    5.78 @@ -957,38 +932,38 @@ do_grant_table_op(
    5.79      
    5.80      rc = -EFAULT;
    5.81      switch ( cmd )
    5.82 -        {
    5.83 -        case GNTTABOP_map_grant_ref:
    5.84 -            if ( unlikely(!array_access_ok(
    5.85 -                              uop, count, sizeof(gnttab_map_grant_ref_t))) )
    5.86 -                goto out;
    5.87 -            rc = gnttab_map_grant_ref((gnttab_map_grant_ref_t *)uop, count);
    5.88 -            break;
    5.89 -        case GNTTABOP_unmap_grant_ref:
    5.90 -            if ( unlikely(!array_access_ok(
    5.91 -                              uop, count, sizeof(gnttab_unmap_grant_ref_t))) )
    5.92 -                goto out;
    5.93 -            rc = gnttab_unmap_grant_ref((gnttab_unmap_grant_ref_t *)uop, 
    5.94 -                                        count);
    5.95 -            break;
    5.96 -        case GNTTABOP_setup_table:
    5.97 -            rc = gnttab_setup_table((gnttab_setup_table_t *)uop, count);
    5.98 -            break;
    5.99 +    {
   5.100 +    case GNTTABOP_map_grant_ref:
   5.101 +        if ( unlikely(!array_access_ok(
   5.102 +            uop, count, sizeof(gnttab_map_grant_ref_t))) )
   5.103 +            goto out;
   5.104 +        rc = gnttab_map_grant_ref((gnttab_map_grant_ref_t *)uop, count);
   5.105 +        break;
   5.106 +    case GNTTABOP_unmap_grant_ref:
   5.107 +        if ( unlikely(!array_access_ok(
   5.108 +            uop, count, sizeof(gnttab_unmap_grant_ref_t))) )
   5.109 +            goto out;
   5.110 +        rc = gnttab_unmap_grant_ref(
   5.111 +            (gnttab_unmap_grant_ref_t *)uop, count);
   5.112 +        break;
   5.113 +    case GNTTABOP_setup_table:
   5.114 +        rc = gnttab_setup_table((gnttab_setup_table_t *)uop, count);
   5.115 +        break;
   5.116  #if GRANT_DEBUG
   5.117 -        case GNTTABOP_dump_table:
   5.118 -            rc = gnttab_dump_table((gnttab_dump_table_t *)uop);
   5.119 -            break;
   5.120 +    case GNTTABOP_dump_table:
   5.121 +        rc = gnttab_dump_table((gnttab_dump_table_t *)uop);
   5.122 +        break;
   5.123  #endif
   5.124 -        case GNTTABOP_donate:
   5.125 -            if (unlikely(!array_access_ok(uop, count, 
   5.126 -                                          sizeof(gnttab_donate_t))))
   5.127 -                goto out;
   5.128 -            rc = gnttab_donate(uop, count);
   5.129 -            break;
   5.130 -        default:
   5.131 -            rc = -ENOSYS;
   5.132 -            break;
   5.133 -        }
   5.134 +    case GNTTABOP_donate:
   5.135 +        if (unlikely(!array_access_ok(
   5.136 +            uop, count, sizeof(gnttab_donate_t))))
   5.137 +            goto out;
   5.138 +        rc = gnttab_donate(uop, count);
   5.139 +        break;
   5.140 +    default:
   5.141 +        rc = -ENOSYS;
   5.142 +        break;
   5.143 +    }
   5.144      
   5.145    out:
   5.146      UNLOCK_BIGLOCK(d);
   5.147 @@ -1021,17 +996,17 @@ gnttab_check_unmap(
   5.148      lgt = ld->grant_table;
   5.149      
   5.150  #if GRANT_DEBUG_VERBOSE
   5.151 -    if ( ld->domain_id != 0 ) {
   5.152 -            DPRINTK("Foreign unref rd(%d) ld(%d) frm(%lx) flgs(%x).\n",
   5.153 -                    rd->domain_id, ld->domain_id, frame, readonly);
   5.154 -      }
   5.155 +    if ( ld->domain_id != 0 )
   5.156 +        DPRINTK("Foreign unref rd(%d) ld(%d) frm(%lx) flgs(%x).\n",
   5.157 +                rd->domain_id, ld->domain_id, frame, readonly);
   5.158  #endif
   5.159      
   5.160      /* Fast exit if we're not mapping anything using grant tables */
   5.161      if ( lgt->map_count == 0 )
   5.162          return 0;
   5.163      
   5.164 -    if ( get_domain(rd) == 0 ) {
   5.165 +    if ( get_domain(rd) == 0 )
   5.166 +    {
   5.167          DPRINTK("gnttab_check_unmap: couldn't get_domain rd(%d)\n",
   5.168                  rd->domain_id);
   5.169          return 0;
   5.170 @@ -1268,8 +1243,11 @@ grant_table_create(
   5.171      for ( i = 0; i < NR_GRANT_FRAMES; i++ )
   5.172      {
   5.173          SHARE_PFN_WITH_DOMAIN(
   5.174 -            virt_to_page((char *)(t->shared)+(i*PAGE_SIZE)), d);
   5.175 -        set_pfn_from_mfn((virt_to_phys(t->shared) >> PAGE_SHIFT) + i, INVALID_M2P_ENTRY);
   5.176 +            virt_to_page((char *)t->shared + (i * PAGE_SIZE)),
   5.177 +            d);
   5.178 +        set_pfn_from_mfn(
   5.179 +            (virt_to_phys(t->shared) >> PAGE_SHIFT) + i,
   5.180 +            INVALID_M2P_ENTRY);
   5.181      }
   5.182  
   5.183      /* Okay, install the structure. */
   5.184 @@ -1306,57 +1284,53 @@ gnttab_release_dev_mappings(grant_table_
   5.185      {
   5.186          map = &gt->maptrack[handle];
   5.187  
   5.188 -        if ( map->ref_and_flags & GNTMAP_device_map )
   5.189 -        {
   5.190 -            dom = map->domid;
   5.191 -            ref = map->ref_and_flags >> MAPTRACK_REF_SHIFT;
   5.192 +        if ( !(map->ref_and_flags & GNTMAP_device_map) )
   5.193 +            continue;
   5.194  
   5.195 -            DPRINTK("Grant release (%hu) ref:(%hu) flags:(%x) dom:(%hu)\n",
   5.196 -                    handle, ref,
   5.197 -                    map->ref_and_flags & MAPTRACK_GNTMAP_MASK, dom);
   5.198 +        dom = map->domid;
   5.199 +        ref = map->ref_and_flags >> MAPTRACK_REF_SHIFT;
   5.200  
   5.201 -            if ( unlikely((rd = find_domain_by_id(dom)) == NULL) ||
   5.202 -                 unlikely(ld == rd) )
   5.203 +        DPRINTK("Grant release (%hu) ref:(%hu) flags:(%x) dom:(%hu)\n",
   5.204 +                handle, ref, map->ref_and_flags & MAPTRACK_GNTMAP_MASK, dom);
   5.205 +
   5.206 +        if ( unlikely((rd = find_domain_by_id(dom)) == NULL) ||
   5.207 +             unlikely(ld == rd) )
   5.208 +        {
   5.209 +            if ( rd != NULL )
   5.210 +                put_domain(rd);
   5.211 +            printk(KERN_WARNING "Grant release: No dom%d\n", dom);
   5.212 +            continue;
   5.213 +        }
   5.214 +
   5.215 +        act = &rd->grant_table->active[ref];
   5.216 +        sha = &rd->grant_table->shared[ref];
   5.217 +
   5.218 +        spin_lock(&rd->grant_table->lock);
   5.219 +
   5.220 +        if ( act->pin & (GNTPIN_devw_mask | GNTPIN_devr_mask) )
   5.221 +        {
   5.222 +            frame = act->frame;
   5.223 +
   5.224 +            if ( ( (act->pin & GNTPIN_hstw_mask) == 0 ) &&
   5.225 +                 ( (act->pin & GNTPIN_devw_mask) >  0 ) )
   5.226              {
   5.227 -                if ( rd != NULL )
   5.228 -                    put_domain(rd);
   5.229 -
   5.230 -                printk(KERN_WARNING "Grant release: No dom%d\n", dom);
   5.231 -                continue;
   5.232 +                clear_bit(_GTF_writing, &sha->flags);
   5.233 +                put_page_type(&frame_table[frame]);
   5.234              }
   5.235  
   5.236 -            act = &rd->grant_table->active[ref];
   5.237 -            sha = &rd->grant_table->shared[ref];
   5.238 -
   5.239 -            spin_lock(&rd->grant_table->lock);
   5.240 -
   5.241 -            if ( act->pin & (GNTPIN_devw_mask | GNTPIN_devr_mask) )
   5.242 +            map->ref_and_flags &= ~GNTMAP_device_map;
   5.243 +            act->pin &= ~(GNTPIN_devw_mask | GNTPIN_devr_mask);
   5.244 +            if ( act->pin == 0 )
   5.245              {
   5.246 -                frame = act->frame;
   5.247 -
   5.248 -                if ( ( (act->pin & GNTPIN_hstw_mask) == 0 ) &&
   5.249 -                     ( (act->pin & GNTPIN_devw_mask) >  0 ) )
   5.250 -                {
   5.251 -                    clear_bit(_GTF_writing, &sha->flags);
   5.252 -                    put_page_type(&frame_table[frame]);
   5.253 -                }
   5.254 +                clear_bit(_GTF_reading, &sha->flags);
   5.255 +                map->ref_and_flags = 0;
   5.256 +                put_page(&frame_table[frame]);
   5.257 +            }
   5.258 +        }
   5.259  
   5.260 -                act->pin &= ~(GNTPIN_devw_mask | GNTPIN_devr_mask);
   5.261 +        spin_unlock(&rd->grant_table->lock);
   5.262  
   5.263 -                if ( act->pin == 0 )
   5.264 -                {
   5.265 -                    clear_bit(_GTF_reading, &sha->flags);
   5.266 -                    map->ref_and_flags = 0;
   5.267 -                    put_page(&frame_table[frame]);
   5.268 -                }
   5.269 -                else
   5.270 -                    map->ref_and_flags &= ~GNTMAP_device_map;
   5.271 -            }
   5.272 -
   5.273 -            spin_unlock(&rd->grant_table->lock);
   5.274 -
   5.275 -            put_domain(rd);
   5.276 -        }
   5.277 +        put_domain(rd);
   5.278      }
   5.279  }
   5.280  
     6.1 --- a/xen/common/trace.c	Thu Sep 08 17:36:23 2005 +0000
     6.2 +++ b/xen/common/trace.c	Thu Sep 08 17:40:37 2005 +0000
     6.3 @@ -66,7 +66,7 @@ void init_trace_bufs(void)
     6.4      }
     6.5  
     6.6      nr_pages = num_online_cpus() * opt_tbuf_size;
     6.7 -    order    = get_order(nr_pages * PAGE_SIZE);
     6.8 +    order    = get_order_from_pages(nr_pages);
     6.9      
    6.10      if ( (rawbuf = alloc_xenheap_pages(order)) == NULL )
    6.11      {
     7.1 --- a/xen/common/xmalloc.c	Thu Sep 08 17:36:23 2005 +0000
     7.2 +++ b/xen/common/xmalloc.c	Thu Sep 08 17:40:37 2005 +0000
     7.3 @@ -86,7 +86,7 @@ static void *xmalloc_new_page(size_t siz
     7.4  static void *xmalloc_whole_pages(size_t size)
     7.5  {
     7.6      struct xmalloc_hdr *hdr;
     7.7 -    unsigned int pageorder = get_order(size);
     7.8 +    unsigned int pageorder = get_order_from_bytes(size);
     7.9  
    7.10      hdr = alloc_xenheap_pages(pageorder);
    7.11      if ( hdr == NULL )
    7.12 @@ -159,7 +159,7 @@ void xfree(const void *p)
    7.13      /* Big allocs free directly. */
    7.14      if ( hdr->size >= PAGE_SIZE )
    7.15      {
    7.16 -        free_xenheap_pages(hdr, get_order(hdr->size));
    7.17 +        free_xenheap_pages(hdr, get_order_from_bytes(hdr->size));
    7.18          return;
    7.19      }
    7.20  
     8.1 --- a/xen/drivers/char/console.c	Thu Sep 08 17:36:23 2005 +0000
     8.2 +++ b/xen/drivers/char/console.c	Thu Sep 08 17:40:37 2005 +0000
     8.3 @@ -627,7 +627,7 @@ static int __init debugtrace_init(void)
     8.4      if ( bytes == 0 )
     8.5          return 0;
     8.6  
     8.7 -    order = get_order(bytes);
     8.8 +    order = get_order_from_bytes(bytes);
     8.9      debugtrace_buf = alloc_xenheap_pages(order);
    8.10      ASSERT(debugtrace_buf != NULL);
    8.11  
     9.1 --- a/xen/drivers/char/serial.c	Thu Sep 08 17:36:23 2005 +0000
     9.2 +++ b/xen/drivers/char/serial.c	Thu Sep 08 17:40:37 2005 +0000
     9.3 @@ -366,8 +366,9 @@ void serial_register_uart(int idx, struc
     9.4  void serial_async_transmit(struct serial_port *port)
     9.5  {
     9.6      BUG_ON(!port->driver->tx_empty);
     9.7 -    if ( !port->txbuf )
     9.8 -        port->txbuf = alloc_xenheap_pages(get_order(SERIAL_TXBUFSZ));
     9.9 +    if ( port->txbuf == NULL )
    9.10 +        port->txbuf = alloc_xenheap_pages(
    9.11 +            get_order_from_bytes(SERIAL_TXBUFSZ));
    9.12  }
    9.13  
    9.14  /*
    10.1 --- a/xen/include/asm-x86/page.h	Thu Sep 08 17:36:23 2005 +0000
    10.2 +++ b/xen/include/asm-x86/page.h	Thu Sep 08 17:40:37 2005 +0000
    10.3 @@ -298,8 +298,6 @@ static inline int get_order_from_pages(u
    10.4      return order;
    10.5  }
    10.6  
    10.7 -#define get_order(s) get_order_from_bytes(s)
    10.8 -
    10.9  /* Allocator functions for Xen pagetables. */
   10.10  struct pfn_info *alloc_xen_pagetable(void);
   10.11  void free_xen_pagetable(struct pfn_info *pg);