ia64/xen-unstable

changeset 855:21376a12e008

bitkeeper revision 1.532 (3f9e5323lNKiselc-ZGn8rFVU5PAVQ)

Many files:
Cleanups and renames to teh Xen interface.
.del-dom_mem_ops.h~73077f4b4349054:
Delete: xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
dom_mem_ops.h:
Rename: xen/include/xeno/dom_mem_ops.h -> xen/include/hypervisor-ifs/dom_mem_ops.h
author kaf24@scramble.cl.cam.ac.uk
date Tue Oct 28 11:29:39 2003 +0000 (2003-10-28)
parents 0cd58ce5a503
children cb5916bb9685
files .rootkeys extras/mini-os/h/hypervisor.h tools/internal/xi_build.c xen/arch/i386/entry.S xen/common/dom_mem_ops.c xen/common/memory.c xen/include/hypervisor-ifs/dom_mem_ops.h xen/include/hypervisor-ifs/hypervisor-if.h xen/include/xeno/dom_mem_ops.h xen/include/xeno/mm.h xen/include/xeno/perfc_defn.h xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h xenolinux-2.4.22-sparse/arch/xeno/mm/fault.c xenolinux-2.4.22-sparse/arch/xeno/mm/hypervisor.c xenolinux-2.4.22-sparse/arch/xeno/mm/ioremap.c xenolinux-2.4.22-sparse/include/asm-xeno/hypervisor.h xenolinux-2.4.22-sparse/mm/memory.c
line diff
     1.1 --- a/.rootkeys	Mon Oct 27 22:45:43 2003 +0000
     1.2 +++ b/.rootkeys	Tue Oct 28 11:29:39 2003 +0000
     1.3 @@ -456,6 +456,7 @@ 3ddb79c3M2n1ROZH6xk3HbyN4CPDqg xen/inclu
     1.4  3ddb79c3uPGcP_l_2xyGgBSWd5aC-Q xen/include/asm-i386/unaligned.h
     1.5  3ddb79c2YTaZwOqWin9-QNgHge5RVw xen/include/hypervisor-ifs/block.h
     1.6  3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
     1.7 +3e6377eaioRoNm0m_HSDEAd4Vqrq_w xen/include/hypervisor-ifs/dom_mem_ops.h
     1.8  3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
     1.9  3ead095dE_VF-QA88rl_5cWYRWtRVQ xen/include/hypervisor-ifs/kbd.h
    1.10  3ddb79c2oRPrzClk3zbTkRHlpumzKA xen/include/hypervisor-ifs/network.h
    1.11 @@ -485,7 +486,6 @@ 3eb165e0eawr3R-p2ZQtSdLWtLRN_A xen/inclu
    1.12  3f0c428eIwGr7n9fj4FkBdX2YvA_Rw xen/include/xeno/crc32.h
    1.13  3ddb79c1V44RD26YqCUm-kqIupM37A xen/include/xeno/ctype.h
    1.14  3ddb79c05DdHQ0UxX_jKsXdR4QlMCA xen/include/xeno/delay.h
    1.15 -3e6377eaioRoNm0m_HSDEAd4Vqrq_w xen/include/xeno/dom_mem_ops.h
    1.16  3ddb79c1uaWQZj551j1O0B5z8AnHOg xen/include/xeno/elevator.h
    1.17  3ddb79c0HIghfBF8zFUdmXhOU8i6hA xen/include/xeno/errno.h
    1.18  3ddb79c0rMjudDKkJku_mkm0J-BZgw xen/include/xeno/etherdevice.h
    1.19 @@ -563,7 +563,6 @@ 3e5a4e65OV_j_DBtjzt5vej771AJsA xenolinux
    1.20  3e5a4e65TNEycLeXqPSXQJQm_xGecA xenolinux-2.4.22-sparse/arch/xeno/defconfig
    1.21  3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/Makefile
    1.22  3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
    1.23 -3e6377fbMjXWAQd0XN0FWv4fDEo6fg xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
    1.24  3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
    1.25  3f689056Vxx_8K8DQTRysOxx_ikmLg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
    1.26  3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
     2.1 --- a/extras/mini-os/h/hypervisor.h	Mon Oct 27 22:45:43 2003 +0000
     2.2 +++ b/extras/mini-os/h/hypervisor.h	Tue Oct 28 11:29:39 2003 +0000
     2.3 @@ -43,12 +43,12 @@ static inline int HYPERVISOR_set_trap_ta
     2.4      return ret;
     2.5  }
     2.6  
     2.7 -static inline int HYPERVISOR_pt_update(page_update_request_t *req, int count)
     2.8 +static inline int HYPERVISOR_mmu_update(mmu_update_t *req, int count)
     2.9  {
    2.10      int ret;
    2.11      __asm__ __volatile__ (
    2.12          TRAP_INSTR
    2.13 -        : "=a" (ret) : "0" (__HYPERVISOR_pt_update), 
    2.14 +        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
    2.15          "b" (req), "c" (count) );
    2.16  
    2.17      return ret;
     3.1 --- a/tools/internal/xi_build.c	Mon Oct 27 22:45:43 2003 +0000
     3.2 +++ b/tools/internal/xi_build.c	Tue Oct 28 11:29:39 2003 +0000
     3.3 @@ -42,12 +42,12 @@ static int get_pfn_list(
     3.4      return (ret < 0) ? -1 : op.u.getmemlist.num_pfns;
     3.5  }
     3.6  
     3.7 -static int send_pgupdates(page_update_request_t *updates, int nr_updates)
     3.8 +static int send_pgupdates(mmu_update_t *updates, int nr_updates)
     3.9  {
    3.10      int ret = -1;
    3.11      privcmd_hypercall_t hypercall;
    3.12  
    3.13 -    hypercall.op     = __HYPERVISOR_pt_update;
    3.14 +    hypercall.op     = __HYPERVISOR_mmu_update;
    3.15      hypercall.arg[0] = (unsigned long)updates;
    3.16      hypercall.arg[1] = (unsigned long)nr_updates;
    3.17  
    3.18 @@ -151,7 +151,7 @@ static int setup_guestos(
    3.19      l1_pgentry_t *vl1tab = NULL, *vl1e = NULL;
    3.20      l2_pgentry_t *vl2tab = NULL, *vl2e = NULL;
    3.21      unsigned long *page_array = NULL;
    3.22 -    page_update_request_t *pgt_update_arr = NULL, *pgt_updates = NULL;
    3.23 +    mmu_update_t *pgt_update_arr = NULL, *pgt_updates = NULL;
    3.24      int alloc_index, num_pt_pages;
    3.25      unsigned long l2tab;
    3.26      unsigned long l1tab = 0;
    3.27 @@ -163,8 +163,7 @@ static int setup_guestos(
    3.28      if ( init_pfn_mapper() < 0 )
    3.29          goto error_out;
    3.30  
    3.31 -    pgt_updates = malloc((tot_pages + 1024) * 3
    3.32 -                         * sizeof(page_update_request_t));
    3.33 +    pgt_updates = malloc((tot_pages + 1024) * 3 * sizeof(mmu_update_t));
    3.34      page_array = malloc(tot_pages * sizeof(unsigned long));
    3.35      pgt_update_arr = pgt_updates;
    3.36      if ( (pgt_update_arr == NULL) || (page_array == NULL) )
    3.37 @@ -257,8 +256,8 @@ static int setup_guestos(
    3.38       * Pin down l2tab addr as page dir page - causes hypervisor to provide
    3.39       * correct protection for the page
    3.40       */ 
    3.41 -    pgt_updates->ptr = l2tab | PGREQ_EXTENDED_COMMAND;
    3.42 -    pgt_updates->val = PGEXT_PIN_L2_TABLE;
    3.43 +    pgt_updates->ptr = l2tab | MMU_EXTENDED_COMMAND;
    3.44 +    pgt_updates->val = MMUEXT_PIN_L2_TABLE;
    3.45      pgt_updates++;
    3.46      num_pgt_updates++;
    3.47  
    3.48 @@ -314,7 +313,7 @@ static int setup_guestos(
    3.49          }
    3.50  
    3.51          pgt_updates->ptr = 
    3.52 -	    (page_array[count] << PAGE_SHIFT) | PGREQ_MPT_UPDATE;
    3.53 +	    (page_array[count] << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
    3.54          pgt_updates->val = count;
    3.55          pgt_updates++;
    3.56          num_pgt_updates++;
     4.1 --- a/xen/arch/i386/entry.S	Mon Oct 27 22:45:43 2003 +0000
     4.2 +++ b/xen/arch/i386/entry.S	Tue Oct 28 11:29:39 2003 +0000
     4.3 @@ -705,7 +705,7 @@ nmi_io_err:
     4.4  .data
     4.5  ENTRY(hypervisor_call_table)
     4.6          .long SYMBOL_NAME(do_set_trap_table)
     4.7 -        .long SYMBOL_NAME(do_process_page_updates)
     4.8 +        .long SYMBOL_NAME(do_mmu_update)
     4.9          .long SYMBOL_NAME(do_console_write)
    4.10          .long SYMBOL_NAME(do_set_gdt)
    4.11          .long SYMBOL_NAME(do_stack_switch)
     5.1 --- a/xen/common/dom_mem_ops.c	Mon Oct 27 22:45:43 2003 +0000
     5.2 +++ b/xen/common/dom_mem_ops.c	Tue Oct 28 11:29:39 2003 +0000
     5.3 @@ -3,26 +3,26 @@
     5.4   *
     5.5   * Code to handle memory related requests from domains eg. balloon driver.
     5.6   *
     5.7 - * Copyright (c) 2003, B Dragovic
     5.8 + * Copyright (c) 2003, B Dragovic & K A Fraser.
     5.9   */
    5.10  
    5.11  #include <xeno/config.h>
    5.12  #include <xeno/types.h>
    5.13  #include <xeno/lib.h>
    5.14  #include <xeno/mm.h>
    5.15 -#include <xeno/dom_mem_ops.h>
    5.16 +#include <hypervisor-ifs/dom_mem_ops.h>
    5.17  #include <xeno/perfc.h>
    5.18  #include <xeno/sched.h>
    5.19  #include <xeno/event.h>
    5.20  #include <asm/domain_page.h>
    5.21  
    5.22 -#if 1
    5.23 +#if 0
    5.24  #define DPRINTK(_f, _a...) printk( _f , ## _a )
    5.25  #else
    5.26  #define DPRINTK(_f, _a...) ((void)0)
    5.27  #endif
    5.28  
    5.29 -static long alloc_dom_mem(struct task_struct *p, balloon_def_op_t bop)
    5.30 +static long alloc_dom_mem(struct task_struct *p, reservation_increase_t op)
    5.31  {
    5.32      struct list_head *temp;
    5.33      struct pfn_info  *pf;     /* pfn_info of current page */
    5.34 @@ -33,16 +33,16 @@ static long alloc_dom_mem(struct task_st
    5.35  
    5.36      /*
    5.37       * POLICY DECISION: Each domain has a page limit.
    5.38 -     * NB. The first part of test is because bop.size could be so big that
    5.39 -     * tot_pages + bop.size overflows a u_long.
    5.40 +     * NB. The first part of test is because op.size could be so big that
    5.41 +     * tot_pages + op.size overflows a u_long.
    5.42       */
    5.43 -    if( (bop.size > p->max_pages) ||
    5.44 -        ((p->tot_pages + bop.size) > p->max_pages) )
    5.45 +    if( (op.size > p->max_pages) ||
    5.46 +        ((p->tot_pages + op.size) > p->max_pages) )
    5.47          return -ENOMEM;
    5.48  
    5.49      spin_lock_irqsave(&free_list_lock, flags);
    5.50  
    5.51 -    if ( free_pfns < (bop.size + (SLACK_DOMAIN_MEM_KILOBYTES >> 
    5.52 +    if ( free_pfns < (op.size + (SLACK_DOMAIN_MEM_KILOBYTES >> 
    5.53                                    (PAGE_SHIFT-10))) ) 
    5.54      {
    5.55          spin_unlock_irqrestore(&free_list_lock, flags);
    5.56 @@ -52,7 +52,7 @@ static long alloc_dom_mem(struct task_st
    5.57      spin_lock(&p->page_lock);
    5.58      
    5.59      temp = free_list.next;
    5.60 -    for ( i = 0; i < bop.size; i++ )
    5.61 +    for ( i = 0; i < op.size; i++ )
    5.62      {
    5.63          /* Get a free page and add it to the domain's page list. */
    5.64          pf = list_entry(temp, struct pfn_info, list);
    5.65 @@ -67,8 +67,8 @@ static long alloc_dom_mem(struct task_st
    5.66  
    5.67          /* Inform the domain of the new page's machine address. */ 
    5.68          mpfn = (unsigned long)(pf - frame_table);
    5.69 -        copy_to_user(bop.pages, &mpfn, sizeof(mpfn));
    5.70 -        bop.pages++; 
    5.71 +        copy_to_user(op.pages, &mpfn, sizeof(mpfn));
    5.72 +        op.pages++; 
    5.73  
    5.74          /* Zero out the page to prevent information leakage. */
    5.75          va = map_domain_mem(mpfn << PAGE_SHIFT);
    5.76 @@ -79,10 +79,10 @@ static long alloc_dom_mem(struct task_st
    5.77      spin_unlock(&p->page_lock);
    5.78      spin_unlock_irqrestore(&free_list_lock, flags);
    5.79      
    5.80 -    return bop.size;
    5.81 +    return op.size;
    5.82  }
    5.83      
    5.84 -static long free_dom_mem(struct task_struct *p, balloon_inf_op_t bop)
    5.85 +static long free_dom_mem(struct task_struct *p, reservation_decrease_t op)
    5.86  {
    5.87      struct list_head *temp;
    5.88      struct pfn_info  *pf;     /* pfn_info of current page */
    5.89 @@ -96,10 +96,10 @@ static long free_dom_mem(struct task_str
    5.90      spin_lock(&p->page_lock);
    5.91  
    5.92      temp = free_list.next;
    5.93 -    for ( i = 0; i < bop.size; i++ )
    5.94 +    for ( i = 0; i < op.size; i++ )
    5.95      {
    5.96 -        copy_from_user(&mpfn, bop.pages, sizeof(mpfn));
    5.97 -        bop.pages++;
    5.98 +        copy_from_user(&mpfn, op.pages, sizeof(mpfn));
    5.99 +        op.pages++;
   5.100          if ( mpfn >= max_page )
   5.101          {
   5.102              DPRINTK("Domain %d page number out of range (%08lx>=%08lx)\n", 
   5.103 @@ -140,29 +140,30 @@ static long free_dom_mem(struct task_str
   5.104          perfc_incrc(need_flush_tlb_flush);
   5.105      }
   5.106  
   5.107 -    return rc ? rc : bop.size;
   5.108 +    return rc ? rc : op.size;
   5.109  }
   5.110      
   5.111  long do_dom_mem_op(dom_mem_op_t *mem_op)
   5.112  {
   5.113      dom_mem_op_t dmop;
   5.114 -    unsigned long ret = 0;
   5.115 +    unsigned long ret;
   5.116  
   5.117      if ( copy_from_user(&dmop, mem_op, sizeof(dom_mem_op_t)) )
   5.118          return -EFAULT;
   5.119  
   5.120      switch ( dmop.op )
   5.121      {
   5.122 -    case BALLOON_DEFLATE_OP:
   5.123 -        ret = alloc_dom_mem(current, dmop.u.balloon_deflate); 
   5.124 +    case MEMOP_RESERVATION_INCREASE:
   5.125 +        ret = alloc_dom_mem(current, dmop.u.increase);
   5.126          break;
   5.127  
   5.128 -    case BALLOON_INFLATE_OP:
   5.129 -        ret = free_dom_mem(current, dmop.u.balloon_inflate); 
   5.130 +    case MEMOP_RESERVATION_DECREASE:
   5.131 +        ret = free_dom_mem(current, dmop.u.decrease);
   5.132          break;
   5.133  
   5.134      default:
   5.135 -        printk("Bad memory operation request %08x.\n", dmop.op);
   5.136 +        ret = -ENOSYS;
   5.137 +        break;
   5.138      }
   5.139  
   5.140      return ret;    
     6.1 --- a/xen/common/memory.c	Mon Oct 27 22:45:43 2003 +0000
     6.2 +++ b/xen/common/memory.c	Tue Oct 28 11:29:39 2003 +0000
     6.3 @@ -21,7 +21,7 @@
     6.4  /*
     6.5   * A description of the page table API:
     6.6   * 
     6.7 - * Domains trap to process_page_updates with a list of update requests.
     6.8 + * Domains trap to do_mmu_update with a list of update requests.
     6.9   * This is a list of (ptr, val) pairs, where the requested operation
    6.10   * is *ptr = val.
    6.11   * 
    6.12 @@ -46,7 +46,7 @@
    6.13   * Pinning the page type:
    6.14   * ----------------------
    6.15   * The type of a page can be pinned/unpinned with the commands
    6.16 - * PGEXT_[UN]PIN_L?_TABLE. Each page can be pinned exactly once (that is,
    6.17 + * MMUEXT_[UN]PIN_L?_TABLE. Each page can be pinned exactly once (that is,
    6.18   * pinning is not reference counted, so it can't be nested).
    6.19   * This is useful to prevent a page's type count falling to zero, at which
    6.20   * point safety checks would need to be carried out next time the count
    6.21 @@ -685,20 +685,20 @@ static int mod_l1_entry(l1_pgentry_t *p_
    6.22  static int do_extended_command(unsigned long ptr, unsigned long val)
    6.23  {
    6.24      int err = 0, cpu = smp_processor_id();
    6.25 -    unsigned int cmd = val & PGEXT_CMD_MASK;
    6.26 +    unsigned int cmd = val & MMUEXT_CMD_MASK;
    6.27      unsigned long pfn = ptr >> PAGE_SHIFT;
    6.28      struct pfn_info *page = frame_table + pfn;
    6.29  
    6.30      /* 'ptr' must be in range except where it isn't a machine address. */
    6.31 -    if ( (pfn >= max_page) && (cmd != PGEXT_SET_LDT) )
    6.32 +    if ( (pfn >= max_page) && (cmd != MMUEXT_SET_LDT) )
    6.33          return 1;
    6.34  
    6.35      switch ( cmd )
    6.36      {
    6.37 -    case PGEXT_PIN_L1_TABLE:
    6.38 +    case MMUEXT_PIN_L1_TABLE:
    6.39          err = get_l1_table(pfn);
    6.40          goto mark_as_pinned;
    6.41 -    case PGEXT_PIN_L2_TABLE:
    6.42 +    case MMUEXT_PIN_L2_TABLE:
    6.43          err = get_l2_table(pfn);
    6.44      mark_as_pinned:
    6.45          if ( unlikely(err) )
    6.46 @@ -720,7 +720,7 @@ static int do_extended_command(unsigned 
    6.47          }
    6.48          break;
    6.49  
    6.50 -    case PGEXT_UNPIN_TABLE:
    6.51 +    case MMUEXT_UNPIN_TABLE:
    6.52          if ( !DOMAIN_OKAY(page->flags) )
    6.53          {
    6.54              err = 1;
    6.55 @@ -743,7 +743,7 @@ static int do_extended_command(unsigned 
    6.56          }
    6.57          break;
    6.58  
    6.59 -    case PGEXT_NEW_BASEPTR:
    6.60 +    case MMUEXT_NEW_BASEPTR:
    6.61          err = get_l2_table(pfn);
    6.62          if ( !err )
    6.63          {
    6.64 @@ -758,17 +758,17 @@ static int do_extended_command(unsigned 
    6.65          }
    6.66          break;
    6.67          
    6.68 -    case PGEXT_TLB_FLUSH:
    6.69 +    case MMUEXT_TLB_FLUSH:
    6.70          deferred_op[cpu].flush_tlb = 1;
    6.71          break;
    6.72      
    6.73 -    case PGEXT_INVLPG:
    6.74 -        __flush_tlb_one(val & ~PGEXT_CMD_MASK);
    6.75 +    case MMUEXT_INVLPG:
    6.76 +        __flush_tlb_one(val & ~MMUEXT_CMD_MASK);
    6.77          break;
    6.78  
    6.79 -    case PGEXT_SET_LDT:
    6.80 +    case MMUEXT_SET_LDT:
    6.81      {
    6.82 -        unsigned long ents = val >> PGEXT_CMD_SHIFT;
    6.83 +        unsigned long ents = val >> MMUEXT_CMD_SHIFT;
    6.84          if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
    6.85               (ents > 8192) ||
    6.86               ((ptr+ents*LDT_ENTRY_SIZE) < ptr) ||
    6.87 @@ -791,7 +791,7 @@ static int do_extended_command(unsigned 
    6.88      }
    6.89  
    6.90      default:
    6.91 -        MEM_LOG("Invalid extended pt command 0x%08lx", val & PGEXT_CMD_MASK);
    6.92 +        MEM_LOG("Invalid extended pt command 0x%08lx", val & MMUEXT_CMD_MASK);
    6.93          err = 1;
    6.94          break;
    6.95      }
    6.96 @@ -800,16 +800,16 @@ static int do_extended_command(unsigned 
    6.97  }
    6.98  
    6.99  
   6.100 -int do_process_page_updates(page_update_request_t *ureqs, int count)
   6.101 +int do_mmu_update(mmu_update_t *ureqs, int count)
   6.102  {
   6.103 -    page_update_request_t req;
   6.104 +    mmu_update_t req;
   6.105      unsigned long flags, pfn, l1e;
   6.106      struct pfn_info *page;
   6.107      int err = 0, i, cpu = smp_processor_id();
   6.108      unsigned int cmd;
   6.109      unsigned long cr0 = 0;
   6.110  
   6.111 -    perfc_incrc( calls_to_process_page_updates ); 
   6.112 +    perfc_incrc( calls_to_mmu_update ); 
   6.113      perfc_addc( num_page_updates, count );
   6.114  
   6.115      for ( i = 0; i < count; i++ )
   6.116 @@ -829,7 +829,8 @@ int do_process_page_updates(page_update_
   6.117          spin_lock_irq(&current->page_lock);
   6.118  
   6.119          /* Get the page-frame number that a non-extended command references. */
   6.120 -        if ( (cmd == PGREQ_NORMAL_UPDATE) || (cmd == PGREQ_UNCHECKED_UPDATE) )
   6.121 +        if ( (cmd == MMU_NORMAL_PT_UPDATE) || 
   6.122 +             (cmd == MMU_UNCHECKED_PT_UPDATE) )
   6.123          {
   6.124              if ( cr0 == 0 )
   6.125              {
   6.126 @@ -852,9 +853,9 @@ int do_process_page_updates(page_update_
   6.127          switch ( cmd )
   6.128          {
   6.129              /*
   6.130 -             * PGREQ_NORMAL_UPDATE: Normal update to any level of page table.
   6.131 +             * MMU_NORMAL_PT_UPDATE: Normal update to any level of page table.
   6.132               */
   6.133 -        case PGREQ_NORMAL_UPDATE:
   6.134 +        case MMU_NORMAL_PT_UPDATE:
   6.135              page  = frame_table + pfn;
   6.136              flags = page->flags;
   6.137  
   6.138 @@ -888,7 +889,7 @@ int do_process_page_updates(page_update_
   6.139              }
   6.140              break;
   6.141  
   6.142 -        case PGREQ_UNCHECKED_UPDATE:
   6.143 +        case MMU_UNCHECKED_PT_UPDATE:
   6.144              req.ptr &= ~(sizeof(l1_pgentry_t) - 1);
   6.145              if ( likely(IS_PRIV(current)) )
   6.146              {
   6.147 @@ -901,7 +902,7 @@ int do_process_page_updates(page_update_
   6.148              }
   6.149              break;
   6.150              
   6.151 -        case PGREQ_MPT_UPDATE:
   6.152 +        case MMU_MACHPHYS_UPDATE:
   6.153              page = frame_table + pfn;
   6.154              if ( unlikely(pfn >= max_page) )
   6.155              {
   6.156 @@ -920,10 +921,10 @@ int do_process_page_updates(page_update_
   6.157              break;
   6.158  
   6.159              /*
   6.160 -             * PGREQ_EXTENDED_COMMAND: Extended command is specified
   6.161 +             * MMU_EXTENDED_COMMAND: Extended command is specified
   6.162               * in the least-siginificant bits of the 'value' field.
   6.163               */
   6.164 -        case PGREQ_EXTENDED_COMMAND:
   6.165 +        case MMU_EXTENDED_COMMAND:
   6.166              req.ptr &= ~(sizeof(l1_pgentry_t) - 1);
   6.167              err = do_extended_command(req.ptr, req.val);
   6.168              break;
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/xen/include/hypervisor-ifs/dom_mem_ops.h	Tue Oct 28 11:29:39 2003 +0000
     7.3 @@ -0,0 +1,30 @@
     7.4 +/******************************************************************************
     7.5 + * dom_mem_ops.h
     7.6 + *
     7.7 + * Guest OS operations dealing with physical memory reservations.
     7.8 + *
     7.9 + * Copyright (c) 2003, B Dragovic & K A Fraser.
    7.10 + */
    7.11 +
    7.12 +#define MEMOP_RESERVATION_INCREASE 0
    7.13 +#define MEMOP_RESERVATION_DECREASE 1
    7.14 +
    7.15 +typedef struct reservation_increase {
    7.16 +    unsigned long   size;
    7.17 +    unsigned long   * pages;
    7.18 +} reservation_increase_t;
    7.19 +
    7.20 +typedef struct reservation_decrease {
    7.21 +    unsigned long   size;
    7.22 +    unsigned long   * pages;
    7.23 +} reservation_decrease_t;
    7.24 +
    7.25 +typedef struct dom_mem_op
    7.26 +{
    7.27 +    unsigned int op;
    7.28 +    union
    7.29 +    {
    7.30 +        reservation_increase_t increase;
    7.31 +        reservation_decrease_t decrease;
    7.32 +    } u;
    7.33 +} dom_mem_op_t;
     8.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Mon Oct 27 22:45:43 2003 +0000
     8.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Tue Oct 28 11:29:39 2003 +0000
     8.3 @@ -41,7 +41,7 @@
     8.4  
     8.5  /* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
     8.6  #define __HYPERVISOR_set_trap_table	   0
     8.7 -#define __HYPERVISOR_pt_update		   1
     8.8 +#define __HYPERVISOR_mmu_update		   1
     8.9  #define __HYPERVISOR_console_write	   2
    8.10  #define __HYPERVISOR_set_gdt		   3
    8.11  #define __HYPERVISOR_stack_switch          4
    8.12 @@ -111,37 +111,35 @@
    8.13  
    8.14  
    8.15  /*
    8.16 - * PAGE UPDATE COMMANDS AND FLAGS
    8.17 - * 
    8.18 - * PGREQ_XXX: specified in least 2 bits of 'ptr' field. These bits are masked
    8.19 + * MMU_XXX: specified in least 2 bits of 'ptr' field. These bits are masked
    8.20   *  off to get the real 'ptr' value.
    8.21   * All requests specify relevent address in 'ptr'. This is either a
    8.22 - * machine/physical address (PA), or linear/virtual address (VA).
    8.23 + * machine/physical address (MA), or linear/virtual address (VA).
    8.24   * Normal requests specify update value in 'value'.
    8.25   * Extended requests specify command in least 8 bits of 'value'. These bits
    8.26 - *  are masked off to get the real 'val' value. Except for PGEXT_SET_LDT 
    8.27 + *  are masked off to get the real 'val' value. Except for MMUEXT_SET_LDT 
    8.28   *  which shifts the least bits out.
    8.29   */
    8.30  /* A normal page-table update request. */
    8.31 -#define PGREQ_NORMAL_UPDATE     0 /* checked '*ptr = val'. ptr is VA.      */
    8.32 +#define MMU_NORMAL_PT_UPDATE     0 /* checked '*ptr = val'. ptr is VA.      */
    8.33  /* DOM0 can make entirely unchecked updates which do not affect refcnts. */
    8.34 -#define PGREQ_UNCHECKED_UPDATE  1 /* unchecked '*ptr = val'. ptr is VA.    */
    8.35 +#define MMU_UNCHECKED_PT_UPDATE  1 /* unchecked '*ptr = val'. ptr is VA.    */
    8.36  /* Update an entry in the machine->physical mapping table. */
    8.37 -#define PGREQ_MPT_UPDATE        2 /* ptr = PA of frame to modify entry for */
    8.38 +#define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for */
    8.39  /* An extended command. */
    8.40 -#define PGREQ_EXTENDED_COMMAND  3 /* least 8 bits of val demux further     */
    8.41 +#define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further     */
    8.42  /* Extended commands: */
    8.43 -#define PGEXT_PIN_L1_TABLE      0 /* ptr = PA of frame to pin              */
    8.44 -#define PGEXT_PIN_L2_TABLE      1 /* ptr = PA of frame to pin              */
    8.45 -#define PGEXT_PIN_L3_TABLE      2 /* ptr = PA of frame to pin              */
    8.46 -#define PGEXT_PIN_L4_TABLE      3 /* ptr = PA of frame to pin              */
    8.47 -#define PGEXT_UNPIN_TABLE       4 /* ptr = PA of frame to unpin            */
    8.48 -#define PGEXT_NEW_BASEPTR       5 /* ptr = PA of new pagetable base        */
    8.49 -#define PGEXT_TLB_FLUSH         6 /* ptr = NULL                            */
    8.50 -#define PGEXT_INVLPG            7 /* ptr = NULL ; val = page to invalidate */
    8.51 -#define PGEXT_SET_LDT           8 /* ptr = VA of table; val = # entries    */
    8.52 -#define PGEXT_CMD_MASK        255
    8.53 -#define PGEXT_CMD_SHIFT         8
    8.54 +#define MMUEXT_PIN_L1_TABLE      0 /* ptr = MA of frame to pin              */
    8.55 +#define MMUEXT_PIN_L2_TABLE      1 /* ptr = MA of frame to pin              */
    8.56 +#define MMUEXT_PIN_L3_TABLE      2 /* ptr = MA of frame to pin              */
    8.57 +#define MMUEXT_PIN_L4_TABLE      3 /* ptr = MA of frame to pin              */
    8.58 +#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin            */
    8.59 +#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base        */
    8.60 +#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                            */
    8.61 +#define MMUEXT_INVLPG            7 /* ptr = NULL ; val = VA to invalidate   */
    8.62 +#define MMUEXT_SET_LDT           8 /* ptr = VA of table; val = # entries    */
    8.63 +#define MMUEXT_CMD_MASK        255
    8.64 +#define MMUEXT_CMD_SHIFT         8
    8.65  
    8.66  /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
    8.67  #define UVMF_FLUSH_TLB          1 /* Flush entire TLB. */
    8.68 @@ -175,12 +173,12 @@ typedef struct trap_info_st
    8.69  } trap_info_t;
    8.70  
    8.71  /*
    8.72 - * Send an array of these to HYPERVISOR_pt_update()
    8.73 + * Send an array of these to HYPERVISOR_mmu_update()
    8.74   */
    8.75  typedef struct
    8.76  {
    8.77      unsigned long ptr, val; /* *ptr = val */
    8.78 -} page_update_request_t;
    8.79 +} mmu_update_t;
    8.80  
    8.81  /*
    8.82   * Send an array of these to HYPERVISOR_multicall()
     9.1 --- a/xen/include/xeno/dom_mem_ops.h	Mon Oct 27 22:45:43 2003 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,31 +0,0 @@
     9.4 -/******************************************************************************
     9.5 - * dom_mem_ops.h
     9.6 - *
     9.7 - * Header file supporting domain related memory operations. N.B. keep in sync
     9.8 - * with xen version. 
     9.9 - *
    9.10 - * Copyright (c) 2003, B Dragovic
    9.11 - */
    9.12 -
    9.13 -#define BALLOON_DEFLATE_OP   0
    9.14 -#define BALLOON_INFLATE_OP   1
    9.15 -
    9.16 -typedef struct balloon_deflate_op {
    9.17 -    unsigned long   size;
    9.18 -    unsigned long   * pages;
    9.19 -} balloon_def_op_t;
    9.20 -
    9.21 -typedef struct balloon_inflate_op {
    9.22 -    unsigned long   size;
    9.23 -    unsigned long   * pages;
    9.24 -} balloon_inf_op_t;
    9.25 -
    9.26 -typedef struct dom_mem_ops
    9.27 -{
    9.28 -    unsigned int op;
    9.29 -    union
    9.30 -    {
    9.31 -        balloon_def_op_t balloon_deflate;
    9.32 -        balloon_inf_op_t balloon_inflate;
    9.33 -    } u;
    9.34 -} dom_mem_op_t;
    10.1 --- a/xen/include/xeno/mm.h	Mon Oct 27 22:45:43 2003 +0000
    10.2 +++ b/xen/include/xeno/mm.h	Tue Oct 28 11:29:39 2003 +0000
    10.3 @@ -147,7 +147,7 @@ int check_descriptor(unsigned long a, un
    10.4  #define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
    10.5  
    10.6  /* Part of the domain API. */
    10.7 -int do_process_page_updates(page_update_request_t *updates, int count);
    10.8 +int do_mmu_update(mmu_update_t *updates, int count);
    10.9  
   10.10  #define DEFAULT_GDT_ENTRIES     ((LAST_RESERVED_GDT_ENTRY*8)+7)
   10.11  #define DEFAULT_GDT_ADDRESS     ((unsigned long)gdt_table)
    11.1 --- a/xen/include/xeno/perfc_defn.h	Mon Oct 27 22:45:43 2003 +0000
    11.2 +++ b/xen/include/xeno/perfc_defn.h	Tue Oct 28 11:29:39 2003 +0000
    11.3 @@ -18,7 +18,7 @@ PERFCOUNTER( net_tx_transmitted, "net tx
    11.4  PERFCOUNTER_CPU( domain_page_tlb_flush, "domain page tlb flushes" )
    11.5  PERFCOUNTER_CPU( need_flush_tlb_flush, "PG_need_flush tlb flushes" )
    11.6  
    11.7 -PERFCOUNTER_CPU( calls_to_process_page_updates, "calls_to_process_page_updates" )
    11.8 +PERFCOUNTER_CPU( calls_to_mmu_update, "calls_to_mmu_update" )
    11.9  PERFCOUNTER_CPU( num_page_updates, "num_page_updates" )
   11.10  
   11.11  
    12.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c	Mon Oct 27 22:45:43 2003 +0000
    12.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c	Tue Oct 28 11:29:39 2003 +0000
    12.3 @@ -24,7 +24,7 @@
    12.4  #include <asm/uaccess.h>
    12.5  #include <asm/tlb.h>
    12.6  
    12.7 -#include "dom_mem_ops.h"
    12.8 +#include <asm/hypervisor-ifs/dom_mem_ops.h>
    12.9  
   12.10  /* USER DEFINES -- THESE SHOULD BE COPIED TO USER-SPACE TOOLS */
   12.11  #define USER_INFLATE_BALLOON  1   /* return mem to hypervisor */
   12.12 @@ -105,9 +105,9 @@ static unsigned long inflate_balloon(uns
   12.13  
   12.14      XENO_flush_page_update_queue();
   12.15  
   12.16 -    dom_mem_op.op = BALLOON_INFLATE_OP;
   12.17 -    dom_mem_op.u.balloon_inflate.size  = num_pages;
   12.18 -    dom_mem_op.u.balloon_inflate.pages = parray;
   12.19 +    dom_mem_op.op = MEMOP_RESERVATION_DECREASE;
   12.20 +    dom_mem_op.u.decrease.size  = num_pages;
   12.21 +    dom_mem_op.u.decrease.pages = parray;
   12.22      if ( (ret = HYPERVISOR_dom_mem_op(&dom_mem_op)) != num_pages )
   12.23      {
   12.24          printk("Unable to inflate balloon, error %lx\n", ret);
   12.25 @@ -149,10 +149,10 @@ static unsigned long process_new_pages(u
   12.26          {
   12.27              phys_to_machine_mapping[i] = *curr;
   12.28              queue_l1_entry_update(
   12.29 -                (pte_t *)((i << PAGE_SHIFT) | PGREQ_MPT_UPDATE), i);
   12.30 +                (pte_t *)((i << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE), i);
   12.31              queue_l1_entry_update(
   12.32                  get_ptep((unsigned long)__va(i << PAGE_SHIFT)),
   12.33 -                ((*curr) << PAGE_SHIFT) | L1_PROT);
   12.34 +                ((*curr) << PAGE_SHIFT) | pgprot_val(PAGE_KERNEL));
   12.35  
   12.36              *curr = (unsigned long)__va(i << PAGE_SHIFT);
   12.37              curr++;
   12.38 @@ -192,9 +192,9 @@ unsigned long deflate_balloon(unsigned l
   12.39      parray = (unsigned long *)kmalloc(num_pages * sizeof(unsigned long), 
   12.40                                        GFP_KERNEL);
   12.41  
   12.42 -    dom_mem_op.op = BALLOON_DEFLATE_OP;
   12.43 -    dom_mem_op.u.balloon_deflate.size = num_pages;
   12.44 -    dom_mem_op.u.balloon_deflate.pages = parray;
   12.45 +    dom_mem_op.op = MEMOP_RESERVATION_INCREASE;
   12.46 +    dom_mem_op.u.increase.size = num_pages;
   12.47 +    dom_mem_op.u.increase.pages = parray;
   12.48      if((ret = HYPERVISOR_dom_mem_op(&dom_mem_op)) != num_pages){
   12.49          printk("Unable to deflate balloon, error %lx\n", ret);
   12.50          goto cleanup;
    13.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h	Mon Oct 27 22:45:43 2003 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,32 +0,0 @@
    13.4 -/******************************************************************************
    13.5 - * dom_mem_ops.h
    13.6 - *
    13.7 - * Header file supporting domain related memory operations. N.B. keep in sync
    13.8 - * with xen version. 
    13.9 - *
   13.10 - * Copyright (c) 2003, B Dragovic
   13.11 - */
   13.12 -
   13.13 -#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)
   13.14 -#define BALLOON_DEFLATE_OP   0
   13.15 -#define BALLOON_INFLATE_OP   1
   13.16 -
   13.17 -typedef struct balloon_deflate_op {
   13.18 -    unsigned long   size;
   13.19 -    unsigned long   * pages;
   13.20 -} balloon_def_op_t;
   13.21 -
   13.22 -typedef struct balloon_inflate_op {
   13.23 -    unsigned long   size;
   13.24 -    unsigned long   * pages;
   13.25 -} balloon_inf_op_t;
   13.26 -
   13.27 -typedef struct dom_mem_ops
   13.28 -{
   13.29 -    unsigned int op;
   13.30 -    union
   13.31 -    {
   13.32 -        balloon_def_op_t balloon_deflate;
   13.33 -        balloon_inf_op_t balloon_inflate;
   13.34 -    }u;
   13.35 -} dom_mem_op_t;
    14.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/mm/fault.c	Mon Oct 27 22:45:43 2003 +0000
    14.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/mm/fault.c	Tue Oct 28 11:29:39 2003 +0000
    14.3 @@ -84,12 +84,12 @@ asmlinkage void do_page_fault(struct pt_
    14.4          error_code &= 3;
    14.5          error_code |= (regs->xcs & 2) << 1;
    14.6  
    14.7 -#if PT_UPDATE_DEBUG > 0
    14.8 +#if MMU_UPDATE_DEBUG > 0
    14.9          if ( (error_code == 0) && (address >= TASK_SIZE) )
   14.10          {
   14.11              unsigned long paddr = __pa(address);
   14.12              int i;
   14.13 -            for ( i = 0; i < pt_update_queue_idx; i++ )
   14.14 +            for ( i = 0; i < mmu_update_queue_idx; i++ )
   14.15              {
   14.16                  if ( update_debug_queue[i].ptr == paddr )
   14.17                  {
    15.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/mm/hypervisor.c	Mon Oct 27 22:45:43 2003 +0000
    15.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/mm/hypervisor.c	Tue Oct 28 11:29:39 2003 +0000
    15.3 @@ -22,18 +22,18 @@
    15.4  static spinlock_t update_lock = SPIN_LOCK_UNLOCKED;
    15.5  
    15.6  #define QUEUE_SIZE 2048
    15.7 -static page_update_request_t update_queue[QUEUE_SIZE];
    15.8 -unsigned int pt_update_queue_idx = 0;
    15.9 -#define idx pt_update_queue_idx
   15.10 +static mmu_update_t update_queue[QUEUE_SIZE];
   15.11 +unsigned int mmu_update_queue_idx = 0;
   15.12 +#define idx mmu_update_queue_idx
   15.13  
   15.14 -#if PT_UPDATE_DEBUG > 0
   15.15 +#if MMU_UPDATE_DEBUG > 0
   15.16  page_update_debug_t update_debug_queue[QUEUE_SIZE] = {{0}};
   15.17  #undef queue_l1_entry_update
   15.18  #undef queue_l2_entry_update
   15.19  static void DEBUG_allow_pt_reads(void)
   15.20  {
   15.21      pte_t *pte;
   15.22 -    page_update_request_t update;
   15.23 +    mmu_update_t update;
   15.24      int i;
   15.25      for ( i = idx-1; i >= 0; i-- )
   15.26      {
   15.27 @@ -42,7 +42,7 @@ static void DEBUG_allow_pt_reads(void)
   15.28          update_debug_queue[i].ptep = NULL;
   15.29          update.ptr = pte;
   15.30          update.val = update_debug_queue[i].pteval;
   15.31 -        HYPERVISOR_pt_update(&update, 1);
   15.32 +        HYPERVISOR_mmu_update(&update, 1);
   15.33      }
   15.34  }
   15.35  static void DEBUG_disallow_pt_read(unsigned long va)
   15.36 @@ -55,20 +55,20 @@ static void DEBUG_disallow_pt_read(unsig
   15.37       * We may fault because of an already outstanding update.
   15.38       * That's okay -- it'll get fixed up in the fault handler.
   15.39       */
   15.40 -    page_update_request_t update;
   15.41 +    mmu_update_t update;
   15.42      pgd = pgd_offset_k(va);
   15.43      pmd = pmd_offset(pgd, va);
   15.44      pte = pte_offset(pmd, va);
   15.45      update.ptr = pte;
   15.46      pteval = *(unsigned long *)pte;
   15.47      update.val = pteval & ~_PAGE_PRESENT;
   15.48 -    HYPERVISOR_pt_update(&update, 1);
   15.49 +    HYPERVISOR_mmu_update(&update, 1);
   15.50      update_debug_queue[idx].ptep = pte;
   15.51      update_debug_queue[idx].pteval = pteval;
   15.52  }
   15.53  #endif
   15.54  
   15.55 -#if PT_UPDATE_DEBUG > 1
   15.56 +#if MMU_UPDATE_DEBUG > 1
   15.57  #undef queue_pt_switch
   15.58  #undef queue_tlb_flush
   15.59  #undef queue_invlpg
   15.60 @@ -89,13 +89,13 @@ void MULTICALL_flush_page_update_queue(v
   15.61      spin_lock_irqsave(&update_lock, flags);
   15.62      if ( idx != 0 ) 
   15.63      {
   15.64 -#if PT_UPDATE_DEBUG > 1
   15.65 +#if MMU_UPDATE_DEBUG > 1
   15.66          printk("Flushing %d entries from pt update queue\n", idx);
   15.67  #endif
   15.68 -#if PT_UPDATE_DEBUG > 0
   15.69 +#if MMU_UPDATE_DEBUG > 0
   15.70          DEBUG_allow_pt_reads();
   15.71  #endif
   15.72 -        queue_multicall2(__HYPERVISOR_pt_update, (unsigned long)update_queue, idx);
   15.73 +        queue_multicall2(__HYPERVISOR_mmu_update, (unsigned long)update_queue, idx);
   15.74          idx = 0;
   15.75      }
   15.76      spin_unlock_irqrestore(&update_lock, flags);
   15.77 @@ -103,13 +103,13 @@ void MULTICALL_flush_page_update_queue(v
   15.78  
   15.79  static inline void __flush_page_update_queue(void)
   15.80  {
   15.81 -#if PT_UPDATE_DEBUG > 1
   15.82 +#if MMU_UPDATE_DEBUG > 1
   15.83      printk("Flushing %d entries from pt update queue\n", idx);
   15.84  #endif
   15.85 -#if PT_UPDATE_DEBUG > 0
   15.86 +#if MMU_UPDATE_DEBUG > 0
   15.87      DEBUG_allow_pt_reads();
   15.88  #endif
   15.89 -    HYPERVISOR_pt_update(update_queue, idx);
   15.90 +    HYPERVISOR_mmu_update(update_queue, idx);
   15.91      idx = 0;
   15.92  }
   15.93  
   15.94 @@ -131,7 +131,7 @@ void queue_l1_entry_update(pte_t *ptr, u
   15.95  {
   15.96      unsigned long flags;
   15.97      spin_lock_irqsave(&update_lock, flags);
   15.98 -#if PT_UPDATE_DEBUG > 0
   15.99 +#if MMU_UPDATE_DEBUG > 0
  15.100      DEBUG_disallow_pt_read((unsigned long)ptr);
  15.101  #endif
  15.102      update_queue[idx].ptr = (unsigned long)ptr;
  15.103 @@ -155,8 +155,8 @@ void queue_pt_switch(unsigned long ptr)
  15.104      unsigned long flags;
  15.105      spin_lock_irqsave(&update_lock, flags);
  15.106      update_queue[idx].ptr  = phys_to_machine(ptr);
  15.107 -    update_queue[idx].ptr |= PGREQ_EXTENDED_COMMAND;
  15.108 -    update_queue[idx].val  = PGEXT_NEW_BASEPTR;
  15.109 +    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  15.110 +    update_queue[idx].val  = MMUEXT_NEW_BASEPTR;
  15.111      increment_index();
  15.112      spin_unlock_irqrestore(&update_lock, flags);
  15.113  }
  15.114 @@ -165,8 +165,8 @@ void queue_tlb_flush(void)
  15.115  {
  15.116      unsigned long flags;
  15.117      spin_lock_irqsave(&update_lock, flags);
  15.118 -    update_queue[idx].ptr  = PGREQ_EXTENDED_COMMAND;
  15.119 -    update_queue[idx].val  = PGEXT_TLB_FLUSH;
  15.120 +    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND;
  15.121 +    update_queue[idx].val  = MMUEXT_TLB_FLUSH;
  15.122      increment_index();
  15.123      spin_unlock_irqrestore(&update_lock, flags);
  15.124  }
  15.125 @@ -175,9 +175,9 @@ void queue_invlpg(unsigned long ptr)
  15.126  {
  15.127      unsigned long flags;
  15.128      spin_lock_irqsave(&update_lock, flags);
  15.129 -    update_queue[idx].ptr  = PGREQ_EXTENDED_COMMAND;
  15.130 +    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND;
  15.131      update_queue[idx].val  = ptr & PAGE_MASK;
  15.132 -    update_queue[idx].val |= PGEXT_INVLPG;
  15.133 +    update_queue[idx].val |= MMUEXT_INVLPG;
  15.134      increment_index();
  15.135      spin_unlock_irqrestore(&update_lock, flags);
  15.136  }
  15.137 @@ -187,8 +187,8 @@ void queue_pgd_pin(unsigned long ptr)
  15.138      unsigned long flags;
  15.139      spin_lock_irqsave(&update_lock, flags);
  15.140      update_queue[idx].ptr  = phys_to_machine(ptr);
  15.141 -    update_queue[idx].ptr |= PGREQ_EXTENDED_COMMAND;
  15.142 -    update_queue[idx].val  = PGEXT_PIN_L2_TABLE;
  15.143 +    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  15.144 +    update_queue[idx].val  = MMUEXT_PIN_L2_TABLE;
  15.145      increment_index();
  15.146      spin_unlock_irqrestore(&update_lock, flags);
  15.147  }
  15.148 @@ -198,8 +198,8 @@ void queue_pgd_unpin(unsigned long ptr)
  15.149      unsigned long flags;
  15.150      spin_lock_irqsave(&update_lock, flags);
  15.151      update_queue[idx].ptr  = phys_to_machine(ptr);
  15.152 -    update_queue[idx].ptr |= PGREQ_EXTENDED_COMMAND;
  15.153 -    update_queue[idx].val  = PGEXT_UNPIN_TABLE;
  15.154 +    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  15.155 +    update_queue[idx].val  = MMUEXT_UNPIN_TABLE;
  15.156      increment_index();
  15.157      spin_unlock_irqrestore(&update_lock, flags);
  15.158  }
  15.159 @@ -209,8 +209,8 @@ void queue_pte_pin(unsigned long ptr)
  15.160      unsigned long flags;
  15.161      spin_lock_irqsave(&update_lock, flags);
  15.162      update_queue[idx].ptr  = phys_to_machine(ptr);
  15.163 -    update_queue[idx].ptr |= PGREQ_EXTENDED_COMMAND;
  15.164 -    update_queue[idx].val  = PGEXT_PIN_L1_TABLE;
  15.165 +    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  15.166 +    update_queue[idx].val  = MMUEXT_PIN_L1_TABLE;
  15.167      increment_index();
  15.168      spin_unlock_irqrestore(&update_lock, flags);
  15.169  }
  15.170 @@ -220,8 +220,8 @@ void queue_pte_unpin(unsigned long ptr)
  15.171      unsigned long flags;
  15.172      spin_lock_irqsave(&update_lock, flags);
  15.173      update_queue[idx].ptr  = phys_to_machine(ptr);
  15.174 -    update_queue[idx].ptr |= PGREQ_EXTENDED_COMMAND;
  15.175 -    update_queue[idx].val  = PGEXT_UNPIN_TABLE;
  15.176 +    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  15.177 +    update_queue[idx].val  = MMUEXT_UNPIN_TABLE;
  15.178      increment_index();
  15.179      spin_unlock_irqrestore(&update_lock, flags);
  15.180  }
  15.181 @@ -230,8 +230,8 @@ void queue_set_ldt(unsigned long ptr, un
  15.182  {
  15.183      unsigned long flags;
  15.184      spin_lock_irqsave(&update_lock, flags);
  15.185 -    update_queue[idx].ptr  = PGREQ_EXTENDED_COMMAND | ptr;
  15.186 -    update_queue[idx].val  = PGEXT_SET_LDT | (len << PGEXT_CMD_SHIFT);
  15.187 +    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND | ptr;
  15.188 +    update_queue[idx].val  = MMUEXT_SET_LDT | (len << MMUEXT_CMD_SHIFT);
  15.189      increment_index();
  15.190      spin_unlock_irqrestore(&update_lock, flags);
  15.191  }
    16.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/mm/ioremap.c	Mon Oct 27 22:45:43 2003 +0000
    16.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/mm/ioremap.c	Tue Oct 28 11:29:39 2003 +0000
    16.3 @@ -20,7 +20,7 @@
    16.4  
    16.5  #if defined(CONFIG_XENO_PRIV)
    16.6  
    16.7 -#define direct_set_pte(_p, _v) queue_unchecked_pt_update((_p), (_v).pte_low)
    16.8 +#define direct_set_pte(_p, _v) queue_unchecked_mmu_update((_p), (_v).pte_low)
    16.9  #define __direct_pte(x) ((pte_t) { (x) } )
   16.10  #define __direct_mk_pte(page_nr,pgprot) \
   16.11    __direct_pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
    17.1 --- a/xenolinux-2.4.22-sparse/include/asm-xeno/hypervisor.h	Mon Oct 27 22:45:43 2003 +0000
    17.2 +++ b/xenolinux-2.4.22-sparse/include/asm-xeno/hypervisor.h	Tue Oct 28 11:29:39 2003 +0000
    17.3 @@ -33,7 +33,7 @@ void do_hypervisor_callback(struct pt_re
    17.4   * be MACHINE addresses.
    17.5   */
    17.6  
    17.7 -extern unsigned int pt_update_queue_idx;
    17.8 +extern unsigned int mmu_update_queue_idx;
    17.9  
   17.10  void queue_l1_entry_update(pte_t *ptr, unsigned long val);
   17.11  void queue_l2_entry_update(pmd_t *ptr, unsigned long val);
   17.12 @@ -45,12 +45,12 @@ void queue_pgd_unpin(unsigned long ptr);
   17.13  void queue_pte_pin(unsigned long ptr);
   17.14  void queue_pte_unpin(unsigned long ptr);
   17.15  void queue_set_ldt(unsigned long ptr, unsigned long bytes);
   17.16 -#define PT_UPDATE_DEBUG 0
   17.17 +#define MMU_UPDATE_DEBUG 0
   17.18  
   17.19 -#define queue_unchecked_pt_update(_p,_v) queue_l1_entry_update( \
   17.20 -  (pte_t *)((unsigned long)(_p)|PGREQ_UNCHECKED_UPDATE),(_v))
   17.21 +#define queue_unchecked_mmu_update(_p,_v) queue_l1_entry_update( \
   17.22 +  (pte_t *)((unsigned long)(_p)|MMU_UNCHECKED_PT_UPDATE),(_v))
   17.23  
   17.24 -#if PT_UPDATE_DEBUG > 0
   17.25 +#if MMU_UPDATE_DEBUG > 0
   17.26  typedef struct {
   17.27      void *ptr;
   17.28      unsigned long val, pteval;
   17.29 @@ -59,39 +59,39 @@ typedef struct {
   17.30  } page_update_debug_t;
   17.31  extern page_update_debug_t update_debug_queue[];
   17.32  #define queue_l1_entry_update(_p,_v) ({                           \
   17.33 - update_debug_queue[pt_update_queue_idx].ptr  = (_p);             \
   17.34 - update_debug_queue[pt_update_queue_idx].val  = (_v);             \
   17.35 - update_debug_queue[pt_update_queue_idx].line = __LINE__;         \
   17.36 - update_debug_queue[pt_update_queue_idx].file = __FILE__;         \
   17.37 + update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   17.38 + update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   17.39 + update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   17.40 + update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   17.41   queue_l1_entry_update((_p),(_v));                                \
   17.42  })
   17.43  #define queue_l2_entry_update(_p,_v) ({                           \
   17.44 - update_debug_queue[pt_update_queue_idx].ptr  = (_p);             \
   17.45 - update_debug_queue[pt_update_queue_idx].val  = (_v);             \
   17.46 - update_debug_queue[pt_update_queue_idx].line = __LINE__;         \
   17.47 - update_debug_queue[pt_update_queue_idx].file = __FILE__;         \
   17.48 + update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   17.49 + update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   17.50 + update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   17.51 + update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   17.52   queue_l2_entry_update((_p),(_v));                                \
   17.53  })
   17.54  #endif
   17.55  
   17.56 -#if PT_UPDATE_DEBUG > 1
   17.57 +#if MMU_UPDATE_DEBUG > 1
   17.58  #undef queue_l1_entry_update
   17.59  #undef queue_l2_entry_update
   17.60  #define queue_l1_entry_update(_p,_v) ({                           \
   17.61 - update_debug_queue[pt_update_queue_idx].ptr  = (_p);             \
   17.62 - update_debug_queue[pt_update_queue_idx].val  = (_v);             \
   17.63 - update_debug_queue[pt_update_queue_idx].line = __LINE__;         \
   17.64 - update_debug_queue[pt_update_queue_idx].file = __FILE__;         \
   17.65 + update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   17.66 + update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   17.67 + update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   17.68 + update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   17.69   printk("L1 %s %d: %08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \
   17.70          (_p), pte_val(_p),                                        \
   17.71          (unsigned long)(_v));                                     \
   17.72   queue_l1_entry_update((_p),(_v));                                \
   17.73  })
   17.74  #define queue_l2_entry_update(_p,_v) ({                           \
   17.75 - update_debug_queue[pt_update_queue_idx].ptr  = (_p);             \
   17.76 - update_debug_queue[pt_update_queue_idx].val  = (_v);             \
   17.77 - update_debug_queue[pt_update_queue_idx].line = __LINE__;         \
   17.78 - update_debug_queue[pt_update_queue_idx].file = __FILE__;         \
   17.79 + update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   17.80 + update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   17.81 + update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   17.82 + update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   17.83   printk("L2 %s %d: %08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \
   17.84          (_p), pmd_val(_p),                                        \
   17.85          (unsigned long)(_v));                                     \
   17.86 @@ -134,7 +134,7 @@ extern page_update_debug_t update_debug_
   17.87  void _flush_page_update_queue(void);
   17.88  static inline int flush_page_update_queue(void)
   17.89  {
   17.90 -    unsigned int idx = pt_update_queue_idx;
   17.91 +    unsigned int idx = mmu_update_queue_idx;
   17.92      if ( idx != 0 ) _flush_page_update_queue();
   17.93      return idx;
   17.94  }
   17.95 @@ -158,12 +158,12 @@ static inline int HYPERVISOR_set_trap_ta
   17.96  }
   17.97  
   17.98  
   17.99 -static inline int HYPERVISOR_pt_update(page_update_request_t *req, int count)
  17.100 +static inline int HYPERVISOR_mmu_update(mmu_update_t *req, int count)
  17.101  {
  17.102      int ret;
  17.103      __asm__ __volatile__ (
  17.104          TRAP_INSTR
  17.105 -        : "=a" (ret) : "0" (__HYPERVISOR_pt_update), 
  17.106 +        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
  17.107          "b" (req), "c" (count) );
  17.108  
  17.109      return ret;
    18.1 --- a/xenolinux-2.4.22-sparse/mm/memory.c	Mon Oct 27 22:45:43 2003 +0000
    18.2 +++ b/xenolinux-2.4.22-sparse/mm/memory.c	Tue Oct 28 11:29:39 2003 +0000
    18.3 @@ -320,7 +320,7 @@ static inline int zap_pte_range(mmu_gath
    18.4  			struct page *page = pte_page(pte);
    18.5  #if defined(CONFIG_XENO_PRIV)
    18.6  			if (pte_io(pte)) {
    18.7 -				queue_unchecked_pt_update(ptep, 0);
    18.8 +				queue_unchecked_mmu_update(ptep, 0);
    18.9  				continue;
   18.10  			}
   18.11  #endif