ia64/xen-unstable

changeset 105:bbabb540b450

bitkeeper revision 1.20 (3e36c6bbUkBKPUFHEdbVYjpf-mrJ-w)
author bd240@boulderdash.cl.cam.ac.uk
date Tue Jan 28 18:06:51 2003 +0000 (2003-01-28)
parents 0ecf87d4739a
children f68a7447d88c
files xen-2.4.16/common/domain.c xen-2.4.16/common/memory.c xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_core.c xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_memory.c
line diff
     1.1 --- a/xen-2.4.16/common/domain.c	Tue Jan 28 15:30:17 2003 +0000
     1.2 +++ b/xen-2.4.16/common/domain.c	Tue Jan 28 18:06:51 2003 +0000
     1.3 @@ -563,10 +563,12 @@ int setup_guestos(struct task_struct *p,
     1.4      unsigned long phys_l1tab, phys_l2tab;
     1.5      unsigned long cur_address, alloc_address;
     1.6      unsigned long virt_load_address, virt_stack_address, virt_shinfo_address;
     1.7 +    unsigned long virt_ftable_start, virt_ftable_end, ft_mapping;
     1.8      start_info_t  *virt_startinfo_address;
     1.9      unsigned long long time;
    1.10      unsigned long count;
    1.11      unsigned long alloc_index;
    1.12 +    unsigned long ft_pages;
    1.13      l2_pgentry_t *l2tab, *l2start;
    1.14      l1_pgentry_t *l1tab = NULL;
    1.15      struct pfn_info *page = NULL;
    1.16 @@ -620,10 +622,12 @@ int setup_guestos(struct task_struct *p,
    1.17      p->mm.pagetable = mk_pagetable(phys_l2tab);
    1.18  
    1.19      /*
    1.20 -     * NB. The upper limit on this loop does one extra page. This is to
    1.21 -     * make sure a pte exists when we want to map the shared_info struct.
    1.22 +     * NB. The upper limit on this loop does one extra page + pages for frame table. 
    1.23 +     * This is to make sure a pte exists when we want to map the shared_info struct
    1.24 +     * and frame table struct.
    1.25       */
    1.26  
    1.27 +    ft_pages = (frame_table_size + (PAGE_SIZE - 1)) << PAGE_SHIFT;
    1.28      l2tab += l2_table_offset(virt_load_address);
    1.29      cur_address = p->pg_head << PAGE_SHIFT;
    1.30      for ( count  = 0;
    1.31 @@ -681,6 +685,21 @@ int setup_guestos(struct task_struct *p,
    1.32          (virt_load_address + ((alloc_index - 1) << PAGE_SHIFT));
    1.33      virt_stack_address  = (unsigned long)virt_startinfo_address;
    1.34  
    1.35 +    /* set up frame_table mapping */
    1.36 +    ft_mapping = (unsigned long)frame_table;
    1.37 +    virt_ftable_start = virt_shinfo_address + PAGE_SIZE; 
    1.38 +    virt_ftable_end = virt_ftable_start + frame_table_size;
    1.39 +    for(cur_address = virt_ftable_start;
    1.40 +        cur_address < virt_ftable_end;
    1.41 +        cur_address += PAGE_SIZE){
    1.42 +        l2tab = l2start + l2_table_offset(cur_address);
    1.43 +        l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab));
    1.44 +        l1tab += l1_table_offset(cur_address);
    1.45 +        *l1tab = mk_l1_pgentry(__pa(ft_mapping)|L1_PROT);
    1.46 +        unmap_domain_mem(l1tab);
    1.47 +        ft_mapping += PAGE_SIZE;
    1.48 +    }
    1.49 +    
    1.50      unmap_domain_mem(l2start);
    1.51  
    1.52      /* Install the new page tables. */
    1.53 @@ -701,6 +720,7 @@ int setup_guestos(struct task_struct *p,
    1.54      virt_startinfo_address->pt_base = virt_load_address + 
    1.55          ((p->tot_pages - 1) << PAGE_SHIFT); 
    1.56      virt_startinfo_address->phys_base = p->pg_head << PAGE_SHIFT;
    1.57 +    virt_startinfo_address->frame_table = virt_ftable_start;
    1.58  
    1.59      /* Add virtual network interfaces and point to them in startinfo. */
    1.60      while (params->num_vifs-- > 0) {
     2.1 --- a/xen-2.4.16/common/memory.c	Tue Jan 28 15:30:17 2003 +0000
     2.2 +++ b/xen-2.4.16/common/memory.c	Tue Jan 28 18:06:51 2003 +0000
     2.3 @@ -826,7 +826,11 @@ int do_process_page_updates_bh(page_upda
     2.4  int do_process_page_updates(page_update_request_t *updates, int count)
     2.5  {
     2.6      page_update_request_t * pg_updates;
     2.7 +    int ret;
     2.8  
     2.9      pg_updates = do_process_page_updates_uh(updates, count);
    2.10 -    return do_process_page_updates_bh(pg_updates, count);
    2.11 +    ret = do_process_page_updates_bh(pg_updates, count);
    2.12 +    kfree(pg_updates);
    2.13 +
    2.14 +    return ret;
    2.15  }
     3.1 --- a/xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h	Tue Jan 28 15:30:17 2003 +0000
     3.2 +++ b/xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h	Tue Jan 28 18:06:51 2003 +0000
     3.3 @@ -200,6 +200,7 @@ typedef struct start_info_st {
     3.4      net_ring_t *net_rings;
     3.5      int num_net_rings;
     3.6      blk_ring_t *blk_ring;         /* block io communication rings */
     3.7 +    unsigned long frame_table;
     3.8      unsigned char cmd_line[1];    /* variable-length */
     3.9  } start_info_t;
    3.10  
     4.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_core.c	Tue Jan 28 15:30:17 2003 +0000
     4.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_core.c	Tue Jan 28 18:06:51 2003 +0000
     4.3 @@ -40,6 +40,8 @@
     4.4  #define DOM_DIR         "dom"
     4.5  #define DOM_MEM         "mem"
     4.6  
     4.7 +frame_table_t * frame_table;
     4.8 +
     4.9  static struct proc_dir_entry *xeno_base;
    4.10  static struct proc_dir_entry *dom0_cmd_intf;
    4.11  static struct proc_dir_entry *proc_ft;
    4.12 @@ -102,7 +104,11 @@ static ssize_t dom_mem_read(struct file 
    4.13  
    4.14      /* remap the range using xen specific routines */
    4.15  
    4.16 +    printk(KERN_ALERT "bd240 debug: dmw entered %lx, %lx\n", mem_data->pfn, mem_data->tot_pages);
    4.17 +
    4.18      addr = direct_mmap(mem_data->pfn << PAGE_SHIFT, mem_data->tot_pages << PAGE_SHIFT, prot, 0, 0);
    4.19 +    
    4.20 +    printk(KERN_ALERT "bd240 debug: dmw exit %lx, %lx\n", mem_data->pfn, mem_data->tot_pages);
    4.21  
    4.22      copy_to_user((unsigned long *)buff, &addr, sizeof(addr));
    4.23  
    4.24 @@ -236,6 +242,8 @@ out:
    4.25  
    4.26  static int __init init_module(void)
    4.27  {
    4.28 +    frame_table = (frame_table_t *)start_info.frame_table;
    4.29 +    
    4.30      /* xeno proc root setup */
    4.31      xeno_base = proc_mkdir(XENO_BASE, &proc_root); 
    4.32  
     5.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_memory.c	Tue Jan 28 15:30:17 2003 +0000
     5.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/drivers/dom0/dom0_memory.c	Tue Jan 28 18:06:51 2003 +0000
     5.3 @@ -187,8 +187,10 @@ unsigned long direct_mmap(unsigned long 
     5.4  
     5.5      /* and perform the mapping */
     5.6      if(flag == MAP_DISCONT){
     5.7 +        printk(KERN_ALERT "bd240 debug: call direct_remap_disc_page_range\n");
     5.8          ret = direct_remap_disc_page_range(addr, phys_addr, tot_pages, prot);
     5.9      } else {
    5.10 +        printk(KERN_ALERT "bd240 debug: call direct_remap_page_range\n");
    5.11          ret = direct_remap_page_range(addr, phys_addr, size, prot);
    5.12      }
    5.13