ia64/xen-unstable

changeset 1986:bd0ea1284933

bitkeeper revision 1.1108.38.2 (41090e48fvpT3Gg3-wliILln5YL7nQ)

- share more files with linux 2.6
- always link 2.4 to linux-xen-sparse
author cl349@freefall.cl.cam.ac.uk
date Thu Jul 29 14:48:40 2004 +0000 (2004-07-29)
parents 4823a2b67eea
children 2afb533685cb
files .rootkeys Makefile linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h linux-2.4.26-xen-sparse/mkbuildtree
line diff
     1.1 --- a/.rootkeys	Thu Jul 29 13:04:03 2004 +0000
     1.2 +++ b/.rootkeys	Thu Jul 29 14:48:40 2004 +0000
     1.3 @@ -63,7 +63,6 @@ 4075806d3fJqqDC1pYYPTZPc575iKg linux-2.4
     1.4  4075806dibjCcfuXv6CINMhxWTw3jQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
     1.5  3e5a4e65G3e2s0ghPMgiJ-gBTUJ0uQ linux-2.4.26-xen-sparse/arch/xen/drivers/console/Makefile
     1.6  3e5a4e656nfFISThfbyXQOA6HN6YHw linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/Makefile
     1.7 -3e5a4e65BXtftInNHUC2PjDfPhdZZA linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c
     1.8  40420a6ebRqDjufoN1WSJvolEW2Wjw linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/Makefile
     1.9  40420a73Wou6JlsZDiu6YwjYomsm7A linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/evtchn.c
    1.10  4083dc16-Kd5y9psK_yk161sme5j5Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/Makefile
    1.11 @@ -91,7 +90,6 @@ 3e5a4e66N__lUXNwzQ-eADRzK9LXuQ linux-2.4
    1.12  3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ linux-2.4.26-xen-sparse/arch/xen/kernel/traps.c
    1.13  3e5a4e66-9_NczrVMbuQkoSLyXckIw linux-2.4.26-xen-sparse/arch/xen/lib/Makefile
    1.14  3e5a4e6637ZDk0BvFEC-aFQs599-ng linux-2.4.26-xen-sparse/arch/xen/lib/delay.c
    1.15 -3f68905cF5i8-NYpIhGjKmh0y8Gu5g linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c
    1.16  3e5a4e66croVgpcJyJuF2ycQw0HuJw linux-2.4.26-xen-sparse/arch/xen/mm/Makefile
    1.17  3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg linux-2.4.26-xen-sparse/arch/xen/mm/fault.c
    1.18  3e5a4e668SE9rixq4ahho9rNhLUUFQ linux-2.4.26-xen-sparse/arch/xen/mm/hypervisor.c
    1.19 @@ -133,7 +131,6 @@ 3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.4
    1.20  4062f7e2PzFOUGT0PaE7A0VprTU3JQ linux-2.4.26-xen-sparse/include/asm-xen/synch_bitops.h
    1.21  3e5a4e68mTr0zcp9SXDbnd-XLrrfxw linux-2.4.26-xen-sparse/include/asm-xen/system.h
    1.22  3f1056a9L_kqHcFheV00KbKBzv9j5w linux-2.4.26-xen-sparse/include/asm-xen/vga.h
    1.23 -3f689063nhrIRsMMZjZxMFk7iEINqQ linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h
    1.24  40659defgWA92arexpMGn8X3QMDj3w linux-2.4.26-xen-sparse/include/asm-xen/xor.h
    1.25  3f056927gMHl7mWB89rb73JahbhQIA linux-2.4.26-xen-sparse/include/linux/blk.h
    1.26  41051ec1m6bJVjZocTG0C0V0O6RsVg linux-2.4.26-xen-sparse/include/linux/blkdev.h
     2.1 --- a/Makefile	Thu Jul 29 13:04:03 2004 +0000
     2.2 +++ b/Makefile	Thu Jul 29 14:48:40 2004 +0000
     2.3 @@ -30,6 +30,8 @@ dist: all
     2.4  LINUX_RELEASE    ?= 2.4
     2.5  LINUX_VER        ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
     2.6  		      sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
     2.7 +LINUX24_VER      ?= $(shell ( /bin/ls -ld linux-2.4.*-xen-sparse ) 2>/dev/null | \
     2.8 +		      sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
     2.9  LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
    2.10  LINUX_SRC_PATH   ?= .:..
    2.11  LINUX_SRC        ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
    2.12 @@ -129,7 +131,7 @@ mrproper: clean
    2.13  	rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
    2.14  
    2.15  make-symlinks: delete-symlinks
    2.16 -	ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
    2.17 +	ln -sf linux-$(LINUX24_VER)-xen-sparse linux-xen-sparse
    2.18  
    2.19  delete-symlinks:
    2.20  	$(RM) linux-xen-sparse
     3.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c	Thu Jul 29 13:04:03 2004 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,233 +0,0 @@
     3.4 -/******************************************************************************
     3.5 - * core.c
     3.6 - * 
     3.7 - * Interface to privileged domain-0 commands.
     3.8 - * 
     3.9 - * Copyright (c) 2002-2004, K A Fraser, B Dragovic
    3.10 - */
    3.11 -
    3.12 -#include <linux/config.h>
    3.13 -#include <linux/module.h>
    3.14 -#include <linux/kernel.h>
    3.15 -#include <linux/sched.h>
    3.16 -#include <linux/slab.h>
    3.17 -#include <linux/string.h>
    3.18 -#include <linux/errno.h>
    3.19 -#include <linux/mm.h>
    3.20 -#include <linux/mman.h>
    3.21 -#include <linux/swap.h>
    3.22 -#include <linux/smp_lock.h>
    3.23 -#include <linux/swapctl.h>
    3.24 -#include <linux/iobuf.h>
    3.25 -#include <linux/highmem.h>
    3.26 -#include <linux/pagemap.h>
    3.27 -#include <linux/seq_file.h>
    3.28 -
    3.29 -#include <asm/pgalloc.h>
    3.30 -#include <asm/pgtable.h>
    3.31 -#include <asm/uaccess.h>
    3.32 -#include <asm/tlb.h>
    3.33 -#include <asm/proc_cmd.h>
    3.34 -#include <asm/hypervisor-ifs/dom0_ops.h>
    3.35 -#include <asm/xen_proc.h>
    3.36 -
    3.37 -static struct proc_dir_entry *privcmd_intf;
    3.38 -
    3.39 -static int privcmd_ioctl(struct inode *inode, struct file *file,
    3.40 -                         unsigned int cmd, unsigned long data)
    3.41 -{
    3.42 -    int ret = -ENOSYS;
    3.43 -
    3.44 -    switch ( cmd )
    3.45 -    {
    3.46 -    case IOCTL_PRIVCMD_HYPERCALL:
    3.47 -    {
    3.48 -        privcmd_hypercall_t hypercall;
    3.49 -  
    3.50 -        if ( copy_from_user(&hypercall, (void *)data, sizeof(hypercall)) )
    3.51 -            return -EFAULT;
    3.52 -
    3.53 -        __asm__ __volatile__ (
    3.54 -            "pushl %%ebx; pushl %%ecx; pushl %%edx; pushl %%esi; pushl %%edi; "
    3.55 -            "movl  4(%%eax),%%ebx ;"
    3.56 -            "movl  8(%%eax),%%ecx ;"
    3.57 -            "movl 12(%%eax),%%edx ;"
    3.58 -            "movl 16(%%eax),%%esi ;"
    3.59 -            "movl 20(%%eax),%%edi ;"
    3.60 -            "movl   (%%eax),%%eax ;"
    3.61 -            TRAP_INSTR "; "
    3.62 -            "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
    3.63 -            : "=a" (ret) : "0" (&hypercall) : "memory" );
    3.64 -
    3.65 -    }
    3.66 -    break;
    3.67 -
    3.68 -    case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
    3.69 -    {
    3.70 -        extern int initdom_ctrlif_domcontroller_port;
    3.71 -        ret = initdom_ctrlif_domcontroller_port;
    3.72 -    }
    3.73 -    break;
    3.74 -    
    3.75 -
    3.76 -    case IOCTL_PRIVCMD_MMAP:
    3.77 -    {
    3.78 -#define PRIVCMD_MMAP_SZ 32
    3.79 -        privcmd_mmap_t mmapcmd;
    3.80 -        privcmd_mmap_entry_t msg[PRIVCMD_MMAP_SZ], *p;
    3.81 -        int i, rc;
    3.82 -
    3.83 -        if ( copy_from_user(&mmapcmd, (void *)data, sizeof(mmapcmd)) )
    3.84 -            return -EFAULT;
    3.85 -
    3.86 -        p = mmapcmd.entry;
    3.87 -
    3.88 -        for (i=0; i<mmapcmd.num; i+=PRIVCMD_MMAP_SZ, p+=PRIVCMD_MMAP_SZ)
    3.89 -        {
    3.90 -            int j, n = ((mmapcmd.num-i)>PRIVCMD_MMAP_SZ)?
    3.91 -                PRIVCMD_MMAP_SZ:(mmapcmd.num-i);
    3.92 -            if ( copy_from_user(&msg, p, n*sizeof(privcmd_mmap_entry_t)) )
    3.93 -                return -EFAULT;
    3.94 -     
    3.95 -            for ( j = 0; j < n; j++ )
    3.96 -            {
    3.97 -                struct vm_area_struct *vma = 
    3.98 -                    find_vma( current->mm, msg[j].va );
    3.99 -
   3.100 -                if ( !vma )
   3.101 -                    return -EINVAL;
   3.102 -
   3.103 -                if ( msg[j].va > PAGE_OFFSET )
   3.104 -                    return -EINVAL;
   3.105 -
   3.106 -                if ( (msg[j].va + (msg[j].npages<<PAGE_SHIFT)) > vma->vm_end )
   3.107 -                    return -EINVAL;
   3.108 -
   3.109 -                if ( (rc = direct_remap_area_pages(vma->vm_mm, 
   3.110 -                                                   msg[j].va&PAGE_MASK, 
   3.111 -                                                   msg[j].mfn<<PAGE_SHIFT, 
   3.112 -                                                   msg[j].npages<<PAGE_SHIFT, 
   3.113 -                                                   vma->vm_page_prot,
   3.114 -                                                   mmapcmd.dom)) < 0 )
   3.115 -                    return rc;
   3.116 -            }
   3.117 -        }
   3.118 -        ret = 0;
   3.119 -    }
   3.120 -    break;
   3.121 -
   3.122 -    case IOCTL_PRIVCMD_MMAPBATCH:
   3.123 -    {
   3.124 -#define MAX_DIRECTMAP_MMU_QUEUE 130
   3.125 -        mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v;
   3.126 -        privcmd_mmapbatch_t m;
   3.127 -        struct vm_area_struct *vma = NULL;
   3.128 -        unsigned long *p, addr;
   3.129 -        unsigned long mfn;
   3.130 -        int i;
   3.131 -
   3.132 -        if ( copy_from_user(&m, (void *)data, sizeof(m)) )
   3.133 -        { ret = -EFAULT; goto batch_err; }
   3.134 -
   3.135 -        vma = find_vma( current->mm, m.addr );
   3.136 -
   3.137 -        if ( !vma )
   3.138 -        { ret = -EINVAL; goto batch_err; }
   3.139 -
   3.140 -        if ( m.addr > PAGE_OFFSET )
   3.141 -        { ret = -EFAULT; goto batch_err; }
   3.142 -
   3.143 -        if ( (m.addr + (m.num<<PAGE_SHIFT)) > vma->vm_end )
   3.144 -        { ret = -EFAULT; goto batch_err; }
   3.145 -
   3.146 -        if ( m.dom != 0 )
   3.147 -        {
   3.148 -            u[0].val  = (unsigned long)(m.dom<<16) & ~0xFFFFUL;
   3.149 -            u[0].ptr  = (unsigned long)(m.dom<< 0) & ~0xFFFFUL;
   3.150 -            u[0].ptr |= MMU_EXTENDED_COMMAND;
   3.151 -            u[0].val |= MMUEXT_SET_SUBJECTDOM;
   3.152 -            v = w = &u[1];
   3.153 -        }
   3.154 -        else
   3.155 -        {
   3.156 -            v = w = &u[0];
   3.157 -        }
   3.158 -
   3.159 -        p = m.arr;
   3.160 -        addr = m.addr;
   3.161 -        for ( i = 0; i < m.num; i++, addr += PAGE_SIZE, p++ )
   3.162 -        {
   3.163 -            if ( get_user(mfn, p) )
   3.164 -                return -EFAULT;
   3.165 -
   3.166 -            v->val = (mfn << PAGE_SHIFT) | pgprot_val(vma->vm_page_prot);
   3.167 -
   3.168 -            __direct_remap_area_pages(vma->vm_mm,
   3.169 -                                      addr, 
   3.170 -                                      PAGE_SIZE, 
   3.171 -                                      v);
   3.172 -
   3.173 -            if ( unlikely(HYPERVISOR_mmu_update(u, v - u + 1, NULL) < 0) )
   3.174 -                put_user( 0xF0000000 | mfn, p );
   3.175 -
   3.176 -            v = w;
   3.177 -        }
   3.178 -        ret = 0;
   3.179 -        break;
   3.180 -
   3.181 -    batch_err:
   3.182 -        printk("batch_err ret=%d vma=%p addr=%lx num=%d arr=%p %lx-%lx\n", 
   3.183 -               ret, vma, m.addr, m.num, m.arr, vma->vm_start, vma->vm_end);
   3.184 -        break;
   3.185 -    }
   3.186 -    break;
   3.187 -
   3.188 -    default:
   3.189 -        ret = -EINVAL;
   3.190 -        break;
   3.191 -    }
   3.192 -    return ret;
   3.193 -}
   3.194 -
   3.195 -static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
   3.196 -{
   3.197 -    /* DONTCOPY is essential for Xen as copy_page_range is broken. */
   3.198 -    vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY;
   3.199 -
   3.200 -    return 0;
   3.201 -}
   3.202 -
   3.203 -static struct file_operations privcmd_file_ops = {
   3.204 -    ioctl : privcmd_ioctl,
   3.205 -    mmap:   privcmd_mmap
   3.206 -};
   3.207 -
   3.208 -
   3.209 -static int __init init_module(void)
   3.210 -{
   3.211 -    if ( !(start_info.flags & SIF_PRIVILEGED) )
   3.212 -        return 0;
   3.213 -
   3.214 -    privcmd_intf = create_xen_proc_entry("privcmd", 0400);
   3.215 -    if ( privcmd_intf != NULL )
   3.216 -    {
   3.217 -        privcmd_intf->owner      = THIS_MODULE;
   3.218 -        privcmd_intf->nlink      = 1;
   3.219 -        privcmd_intf->proc_fops  = &privcmd_file_ops;
   3.220 -    }
   3.221 -
   3.222 -    return 0;
   3.223 -}
   3.224 -
   3.225 -
   3.226 -static void __exit cleanup_module(void)
   3.227 -{
   3.228 -    if ( privcmd_intf == NULL ) return;
   3.229 -    remove_xen_proc_entry("privcmd");
   3.230 -    privcmd_intf = NULL;
   3.231 -}
   3.232 -
   3.233 -
   3.234 -module_init(init_module);
   3.235 -module_exit(cleanup_module);
   3.236 -#
     4.1 --- a/linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c	Thu Jul 29 13:04:03 2004 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,18 +0,0 @@
     4.4 -
     4.5 -#include <linux/config.h>
     4.6 -#include <linux/proc_fs.h>
     4.7 -
     4.8 -static struct proc_dir_entry *xen_base;
     4.9 -
    4.10 -struct proc_dir_entry *create_xen_proc_entry(const char *name, mode_t mode)
    4.11 -{
    4.12 -    if ( xen_base == NULL )
    4.13 -        if ( (xen_base = proc_mkdir("xen", &proc_root)) == NULL )
    4.14 -            panic("Couldn't create /proc/xen");
    4.15 -    return create_proc_entry(name, mode, xen_base);
    4.16 -}
    4.17 -
    4.18 -void remove_xen_proc_entry(const char *name)
    4.19 -{
    4.20 -    remove_proc_entry(name, xen_base);
    4.21 -}
     5.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h	Thu Jul 29 13:04:03 2004 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,13 +0,0 @@
     5.4 -
     5.5 -#ifndef __ASM_XEN_PROC_H__
     5.6 -#define __ASM_XEN_PROC_H__
     5.7 -
     5.8 -#include <linux/config.h>
     5.9 -#include <linux/proc_fs.h>
    5.10 -
    5.11 -extern struct proc_dir_entry *create_xen_proc_entry(
    5.12 -    const char *name, mode_t mode);
    5.13 -extern void remove_xen_proc_entry(
    5.14 -    const char *name);
    5.15 -
    5.16 -#endif /* __ASM_XEN_PROC_H__ */
     6.1 --- a/linux-2.4.26-xen-sparse/mkbuildtree	Thu Jul 29 13:04:03 2004 +0000
     6.2 +++ b/linux-2.4.26-xen-sparse/mkbuildtree	Thu Jul 29 14:48:40 2004 +0000
     6.3 @@ -199,6 +199,7 @@ ln -sf ../asm-i386/ucontext.h
     6.4  ln -sf ../asm-i386/unaligned.h
     6.5  ln -sf ../asm-i386/unistd.h 
     6.6  ln -sf ../asm-i386/user.h 
     6.7 +ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h
     6.8  
     6.9  cd ../../arch/xen/kernel
    6.10  ln -sf ../../i386/kernel/i387.c
    6.11 @@ -220,10 +221,13 @@ ln -sf ../../i386/lib/mmx.c
    6.12  ln -sf ../../i386/lib/old-checksum.c 
    6.13  ln -sf ../../i386/lib/strstr.c 
    6.14  ln -sf ../../i386/lib/usercopy.c 
    6.15 +ln -sf ../../../${LINUX_26}/arch/xen/kernel/xen_proc.c
    6.16  cd ../mm
    6.17  ln -sf ../../i386/mm/extable.c 
    6.18  ln -sf ../../i386/mm/pageattr.c 
    6.19  cd ../drivers/console
    6.20  ln -sf ../../../../${LINUX_26}/drivers/xen/console/console.c 
    6.21 +cd ../dom0
    6.22 +ln -sf ../../../../${LINUX_26}/drivers/xen/privcmd/privcmd.c core.c
    6.23  cd ../netif/frontend
    6.24  ln -sf ../../../../../${LINUX_26}/drivers/xen/net/network.c main.c