ia64/xen-unstable

changeset 493:dd54946a335b

bitkeeper revision 1.265 (3f045be7u9RMdV4nk0DN3sjRc1rBdw)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/rac61/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/sos22/xeno.bk
author sos22@labyrinth.cl.cam.ac.uk
date Thu Jul 03 16:37:59 2003 +0000 (2003-07-03)
parents 690dd12296b6 e8a16b3d27cb
children 1786bde3fc7e
files .rootkeys BitKeeper/etc/ignore tools/internal/Makefile tools/internal/physdev.h tools/internal/xi_phys_grant.c tools/internal/xi_phys_probe.c tools/internal/xi_phys_revoke.c xen/common/domain.c xen/drivers/block/xen_block.c xen/drivers/block/xen_physdisk.c xen/include/hypervisor-ifs/block.h xen/include/xeno/sched.h xenolinux-2.4.21-sparse/arch/xeno/drivers/block/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~ xenolinux-2.4.21-sparse/drivers/block/ll_rw_blk.c
line diff
     1.1 --- a/.rootkeys	Thu Jul 03 15:02:46 2003 +0000
     1.2 +++ b/.rootkeys	Thu Jul 03 16:37:59 2003 +0000
     1.3 @@ -114,12 +114,16 @@ 3eb781fdc539MQQm47rYRCCR3N5i-Q tools/int
     1.4  3ee609b3Yr4aggmLSKmhiIzT8-nURA tools/internal/dom0_ops.h
     1.5  3eb781fddjylXbsepjppUyIXa5lcaQ tools/internal/hypervisor_defs.h
     1.6  3eb781fdKiQbgozBsgs_zzJQ9ubehw tools/internal/mem_defs.h
     1.7 +3f04589dFbtsbWWwAXq3I92UiAogCg tools/internal/physdev.h
     1.8  3ec61e1bJCeJJu0SsptmDpA1xKvwvw tools/internal/rpm.spec
     1.9  3eb781fdgbSkh2O6JQS-65Dz4n0ItQ tools/internal/xi_build.c
    1.10  3eb781fdW1SAyiaC4mTsXq_9fRHh-A tools/internal/xi_create.c
    1.11  3eb781fdcJ0fF7rWfzAOArW-x4-gwA tools/internal/xi_destroy.c
    1.12  3ec43c5dmQxGDvgJJXbV1yLxT30Y1A tools/internal/xi_helper
    1.13  3eb83c3bZeECmphOKOJxSu4Lo1LpBw tools/internal/xi_list
    1.14 +3f0458aaXhD8BQAggO81gv30RQ-ifA tools/internal/xi_phys_grant.c
    1.15 +3f0458aaJHmlzkDwf0qxEzAcjX55sg tools/internal/xi_phys_probe.c
    1.16 +3f0458aaVAbFSwptQbQAnDOiZlwQ3w tools/internal/xi_phys_revoke.c
    1.17  3eb781fd8oRfPgH7qTh7xvgmwD6NgA tools/internal/xi_start.c
    1.18  3eb781fd0Eo9K1jEFCSAVzO51i_ngg tools/internal/xi_stop.c
    1.19  3eb781fd7211MZsLxJSiuy7W4KnJXg tools/internal/xi_vifinit
    1.20 @@ -205,6 +209,7 @@ 3ddb79beME_0abStePF6fU8XLuQnWw xen/drive
    1.21  3ddb79beNQVrdGyoI4njXhgAjD6a4A xen/drivers/block/genhd.c
    1.22  3ddb79beyWwLRP_BiM2t1JKgr_plEw xen/drivers/block/ll_rw_blk.c
    1.23  3e4a8cb7RhubVgsPwO7cK0pgAN8WCQ xen/drivers/block/xen_block.c
    1.24 +3f045882spujO81dMl-fYWGiZ8WcPw xen/drivers/block/xen_physdisk.c
    1.25  3e5d129asHNyZOjBKTkqs-9AFzxemA xen/drivers/block/xen_segment.c
    1.26  3e9c248afxxsnAzIt2na7Ej24yNFzg xen/drivers/cdrom/Makefile
    1.27  3e9c248ajUkn2W3n4vgm72Hp2ftZ8A xen/drivers/cdrom/cdrom.c
    1.28 @@ -492,6 +497,8 @@ 3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux
    1.29  3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c
    1.30  3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.h
    1.31  3e677190SjkzJIvFifRVeYpIZOCtYA xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c
    1.32 +3f045897EIYU5l5jxFBpeF1Z0ZOTwA xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c
    1.33 +3f045a16wW57GFQ3r3Ta2cJOo1ierQ xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~
    1.34  3e677193nOKKTLJzcAu4SYdbZaia8g xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c
    1.35  3e676eb5RXnHzSHgA1BvM0B1aIm4qg xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment.c
    1.36  3e5d129aDldt6geU2-2SzBae34sQzg xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c
     2.1 --- a/BitKeeper/etc/ignore	Thu Jul 03 15:02:46 2003 +0000
     2.2 +++ b/BitKeeper/etc/ignore	Thu Jul 03 16:37:59 2003 +0000
     2.3 @@ -1,177 +1,10 @@
     2.4  BitKeeper/*/*
     2.5  PENDING/*
     2.6 -xen-2.4.16/common/kernel.c.old
     2.7 -xen-2.4.16/common/kernel.c.ok-ish
     2.8 -xen-2.4.16/size.image
     2.9 -xen-2.4.16/drivers/block/ll_rw_blk.c.orig
    2.10 -xen-2.4.16/drivers/ide/ide-disk.c.orig
    2.11 -xen-2.4.16/drivers/ide/ide-probe.c.orig
    2.12 -xen-2.4.16/drivers/ide/ide-taskfile.c.orig
    2.13 -xen-2.4.16/drivers/ide/ide.c.orig
    2.14 -xen-2.4.16/drivers/net/e1000/e1000.o
    2.15 -xen-2.4.16/drivers/net/e1000/e1000_ethtool.o
    2.16 -xen-2.4.16/drivers/net/e1000/e1000_hw.o
    2.17 -xen-2.4.16/drivers/net/e1000/e1000_main.o
    2.18 -xen-2.4.16/drivers/net/e1000/e1000_param.o
    2.19 -xen-2.4.16/include/hypervisor-ifs/block.h.orig
    2.20 -xen-2.4.16/include/xeno/blkdev.h.orig
    2.21 -xen-2.4.16/include/xeno/sched.h.orig
    2.22 -xenolinux-2.4.16-sparse/arch/xeno/drivers/block/Makefile.orig
    2.23 -xenolinux-2.4.16-sparse/arch/xeno/drivers/block/block.c.orig
    2.24 -xenolinux-2.4.16-sparse/scripts/kconfig.tk
    2.25 -xen-2.4.16/foo
    2.26 -xen-2.4.16/common/domain.c.smh
    2.27  URK
    2.28 -tools/domain_builder/dom_builder.o
    2.29 -tools/domain_builder/dom_kill.o
    2.30 -tools/domain_builder/domain_builder
    2.31 -tools/domain_builder/kill_domain
    2.32 -xen/arch/i386/acpitable.o
    2.33 -xen/arch/i386/apic.o
    2.34 -xen/arch/i386/arch.o
    2.35 -xen/arch/i386/boot/boot.o
    2.36 -xen/arch/i386/delay.o
    2.37 -xen/arch/i386/entry.o
    2.38 -xen/arch/i386/extable.o
    2.39 -xen/arch/i386/i387.o
    2.40 -xen/arch/i386/i8259.o
    2.41 -xen/arch/i386/idle0_task.o
    2.42 -xen/arch/i386/io_apic.o
    2.43 -xen/arch/i386/ioremap.o
    2.44 -xen/arch/i386/irq.o
    2.45 -xen/arch/i386/mm.o
    2.46 -xen/arch/i386/mpparse.o
    2.47 -xen/arch/i386/pci-dma.o
    2.48 -xen/arch/i386/pci-i386.o
    2.49 -xen/arch/i386/pci-irq.o
    2.50 -xen/arch/i386/pci-pc.o
    2.51 -xen/arch/i386/process.o
    2.52 -xen/arch/i386/rwlock.o
    2.53 -xen/arch/i386/setup.o
    2.54 -xen/arch/i386/smp.o
    2.55 -xen/arch/i386/smpboot.o
    2.56 -xen/arch/i386/time.o
    2.57 -xen/arch/i386/trampoline.o
    2.58 -xen/arch/i386/traps.o
    2.59 -xen/arch/i386/usercopy.o
    2.60 -xen/common/ac_timer.o
    2.61 -xen/common/block.o
    2.62 -xen/common/brlock.o
    2.63 -xen/common/common.o
    2.64 -xen/common/dom0_ops.o
    2.65 -xen/common/domain.o
    2.66 -xen/common/domain_page.o
    2.67 -xen/common/event.o
    2.68 -xen/common/kernel.o
    2.69 -xen/common/keyhandler.o
    2.70 -xen/common/lib.o
    2.71 -xen/common/memory.o
    2.72 -xen/common/network.o
    2.73 -xen/common/page_alloc.o
    2.74 -xen/common/perfc.o
    2.75 -xen/common/resource.o
    2.76 -xen/common/schedule.o
    2.77 -xen/common/slab.o
    2.78 -xen/common/softirq.o
    2.79 -xen/common/timer.o
    2.80 -xen/common/vsprintf.o
    2.81 -xen/drivers/block/blkpg.o
    2.82 -xen/drivers/block/driver.o
    2.83 -xen/drivers/block/elevator.o
    2.84 -xen/drivers/block/genhd.o
    2.85 -xen/drivers/block/ll_rw_blk.o
    2.86 -xen/drivers/block/xen_block.o
    2.87 -xen/drivers/char/driver.o
    2.88 -xen/drivers/char/xen_kbd.o
    2.89 -xen/drivers/char/xen_serial.o
    2.90 -xen/drivers/ide/driver.o
    2.91 -xen/drivers/ide/ide-disk.o
    2.92 -xen/drivers/ide/ide-dma.o
    2.93 -xen/drivers/ide/ide-features.o
    2.94 -xen/drivers/ide/ide-geometry.o
    2.95 -xen/drivers/ide/ide-pci.o
    2.96 -xen/drivers/ide/ide-probe.o
    2.97 -xen/drivers/ide/ide-taskfile.o
    2.98 -xen/drivers/ide/ide-xeno.o
    2.99 -xen/drivers/ide/ide.o
   2.100 -xen/drivers/ide/piix.o
   2.101 -xen/drivers/net/3c59x.o
   2.102 -xen/drivers/net/Space.o
   2.103 -xen/drivers/net/driver.o
   2.104 -xen/drivers/net/e1000/e1000.o
   2.105 -xen/drivers/net/e1000/e1000_ethtool.o
   2.106 -xen/drivers/net/e1000/e1000_hw.o
   2.107 -xen/drivers/net/e1000/e1000_main.o
   2.108 -xen/drivers/net/e1000/e1000_param.o
   2.109 -xen/drivers/net/ne/8390.o
   2.110 -xen/drivers/net/ne/ne.o
   2.111 -xen/drivers/net/ne/ne_drv.o
   2.112 -xen/drivers/net/net_init.o
   2.113 -xen/drivers/net/setup.o
   2.114 -xen/drivers/net/tg3.o
   2.115 -xen/drivers/pci/classlist.h
   2.116 -xen/drivers/pci/compat.o
   2.117 -xen/drivers/pci/devlist.h
   2.118 -xen/drivers/pci/driver.o
   2.119 -xen/drivers/pci/gen-devlist
   2.120 -xen/drivers/pci/names.o
   2.121 -xen/drivers/pci/pci.o
   2.122 -xen/drivers/pci/quirks.o
   2.123 -xen/drivers/pci/setup-res.o
   2.124 -xen/drivers/scsi/aacraid/aachba.o
   2.125 -xen/drivers/scsi/aacraid/aacraid.o
   2.126 -xen/drivers/scsi/aacraid/commctrl.o
   2.127 -xen/drivers/scsi/aacraid/comminit.o
   2.128 -xen/drivers/scsi/aacraid/commsup.o
   2.129 -xen/drivers/scsi/aacraid/dpcsup.o
   2.130 -xen/drivers/scsi/aacraid/linit.o
   2.131 -xen/drivers/scsi/aacraid/rx.o
   2.132 -xen/drivers/scsi/aacraid/sa.o
   2.133 -xen/drivers/scsi/constants.o
   2.134 -xen/drivers/scsi/driver.o
   2.135 -xen/drivers/scsi/hosts.o
   2.136 -xen/drivers/scsi/scsi.o
   2.137 -xen/drivers/scsi/scsi_dma.o
   2.138 -xen/drivers/scsi/scsi_error.o
   2.139 -xen/drivers/scsi/scsi_ioctl.o
   2.140 -xen/drivers/scsi/scsi_lib.o
   2.141 -xen/drivers/scsi/scsi_merge.o
   2.142 -xen/drivers/scsi/scsi_proc.o
   2.143 -xen/drivers/scsi/scsi_queue.o
   2.144 -xen/drivers/scsi/scsi_scan.o
   2.145 -xen/drivers/scsi/scsi_syms.o
   2.146 -xen/drivers/scsi/scsicam.o
   2.147 -xen/drivers/scsi/sd.o
   2.148 -xen/image
   2.149 -xen/image.gz
   2.150 -xen/include/asm
   2.151 -xen/include/linux
   2.152 -xen/net/dev.o
   2.153 -xen/net/dev_mcast.o
   2.154 -xen/net/devinit.o
   2.155 -xen/net/eth.o
   2.156 -xen/net/network.o
   2.157 -xen/net/skbuff.o
   2.158 -xen/tools/elf-reloc
   2.159  tools/balloon/balloon
   2.160 -xen/common/dom_mem_ops.o
   2.161 -xen/common/string.o
   2.162 -xen/drivers/block/xen_segment.o
   2.163 -xen/drivers/cdrom/cdrom.o
   2.164 -xen/drivers/cdrom/driver.o
   2.165 -xen/drivers/ide/ide-cd.o
   2.166 -xen/drivers/scsi/aic7xxx/aic7770.o
   2.167 -xen/drivers/scsi/aic7xxx/aic7770_osm.o
   2.168 -xen/drivers/scsi/aic7xxx/aic7xxx.o
   2.169 -xen/drivers/scsi/aic7xxx/aic7xxx_93cx6.o
   2.170 -xen/drivers/scsi/aic7xxx/aic7xxx_core.o
   2.171 -xen/drivers/scsi/aic7xxx/aic7xxx_osm.o
   2.172 -xen/drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
   2.173 -xen/drivers/scsi/aic7xxx/aic7xxx_pci.o
   2.174 -xen/drivers/scsi/aic7xxx/aic7xxx_proc.o
   2.175 -xen/drivers/scsi/megaraid.o
   2.176 -xen/image.s
   2.177 -xen/include/hypervisor-ifs/hypervisor-ifs
   2.178 +tools/control/.classpath
   2.179 +tools/control/.project
   2.180 +tools/control/build-cmdline/**
   2.181  tools/control/build-dom/uk/ac/cam/cl/xeno/domctl/Command.class
   2.182  tools/control/build-dom/uk/ac/cam/cl/xeno/domctl/CommandDestroy.class
   2.183  tools/control/build-dom/uk/ac/cam/cl/xeno/domctl/CommandHelp.class
   2.184 @@ -341,6 +174,7 @@ tools/control/dist/docs/api/uk/ac/cam/cl
   2.185  tools/control/dist/docs/empty_dir
   2.186  tools/control/dist/xenctl-0.1-dev.war
   2.187  tools/control/domctl.jar
   2.188 +tools/control/eclipsebin/**
   2.189  tools/control/web/about.jsp
   2.190  tools/control/web/dom-del.jsp
   2.191  tools/control/web/dom-delr.jsp
   2.192 @@ -374,6 +208,11 @@ tools/control/web/vd-vdrr.jsp
   2.193  tools/control/web/vd-vdv.jsp
   2.194  tools/control/web/vd.jsp
   2.195  tools/control/web/xenostyle.css
   2.196 +tools/control/xenctl-cmdline.jar
   2.197 +tools/domain_builder/dom_builder.o
   2.198 +tools/domain_builder/dom_kill.o
   2.199 +tools/domain_builder/domain_builder
   2.200 +tools/domain_builder/kill_domain
   2.201  tools/domctl/build/uk/ac/cam/cl/xeno/domctl/Command.class
   2.202  tools/domctl/build/uk/ac/cam/cl/xeno/domctl/CommandDestroy.class
   2.203  tools/domctl/build/uk/ac/cam/cl/xeno/domctl/CommandHelp.class
   2.204 @@ -410,11 +249,173 @@ tools/vdmanager/build/uk/ac/cam/cl/xeno/
   2.205  tools/vdmanager/build/uk/ac/cam/cl/xeno/vdmanager/XML.class
   2.206  tools/vdmanager/build/uk/ac/cam/cl/xeno/vdmanager/XMLHelper.class
   2.207  tools/vdmanager/vdmanager.jar
   2.208 +xen-2.4.16/common/domain.c.smh
   2.209 +xen-2.4.16/common/kernel.c.ok-ish
   2.210 +xen-2.4.16/common/kernel.c.old
   2.211 +xen-2.4.16/drivers/block/ll_rw_blk.c.orig
   2.212 +xen-2.4.16/drivers/ide/ide-disk.c.orig
   2.213 +xen-2.4.16/drivers/ide/ide-probe.c.orig
   2.214 +xen-2.4.16/drivers/ide/ide-taskfile.c.orig
   2.215 +xen-2.4.16/drivers/ide/ide.c.orig
   2.216 +xen-2.4.16/drivers/net/e1000/e1000.o
   2.217 +xen-2.4.16/drivers/net/e1000/e1000_ethtool.o
   2.218 +xen-2.4.16/drivers/net/e1000/e1000_hw.o
   2.219 +xen-2.4.16/drivers/net/e1000/e1000_main.o
   2.220 +xen-2.4.16/drivers/net/e1000/e1000_param.o
   2.221 +xen-2.4.16/foo
   2.222 +xen-2.4.16/include/hypervisor-ifs/block.h.orig
   2.223 +xen-2.4.16/include/xeno/blkdev.h.orig
   2.224 +xen-2.4.16/include/xeno/sched.h.orig
   2.225 +xen-2.4.16/size.image
   2.226 +xen/arch/i386/acpitable.o
   2.227 +xen/arch/i386/apic.o
   2.228 +xen/arch/i386/arch.o
   2.229 +xen/arch/i386/boot/boot.o
   2.230 +xen/arch/i386/delay.o
   2.231 +xen/arch/i386/entry.o
   2.232 +xen/arch/i386/extable.o
   2.233 +xen/arch/i386/i387.o
   2.234 +xen/arch/i386/i8259.o
   2.235 +xen/arch/i386/idle0_task.o
   2.236 +xen/arch/i386/io_apic.o
   2.237 +xen/arch/i386/ioremap.o
   2.238 +xen/arch/i386/irq.o
   2.239 +xen/arch/i386/mm.o
   2.240 +xen/arch/i386/mpparse.o
   2.241 +xen/arch/i386/pci-dma.o
   2.242 +xen/arch/i386/pci-i386.o
   2.243 +xen/arch/i386/pci-irq.o
   2.244 +xen/arch/i386/pci-pc.o
   2.245 +xen/arch/i386/process.o
   2.246 +xen/arch/i386/rwlock.o
   2.247 +xen/arch/i386/setup.o
   2.248 +xen/arch/i386/smp.o
   2.249 +xen/arch/i386/smpboot.o
   2.250 +xen/arch/i386/time.o
   2.251 +xen/arch/i386/trampoline.o
   2.252 +xen/arch/i386/traps.o
   2.253 +xen/arch/i386/usercopy.o
   2.254 +xen/common/ac_timer.o
   2.255 +xen/common/block.o
   2.256 +xen/common/brlock.o
   2.257 +xen/common/common.o
   2.258 +xen/common/dom0_ops.o
   2.259 +xen/common/dom_mem_ops.o
   2.260 +xen/common/domain.o
   2.261 +xen/common/domain_page.o
   2.262 +xen/common/event.o
   2.263 +xen/common/kernel.o
   2.264 +xen/common/keyhandler.o
   2.265 +xen/common/lib.o
   2.266 +xen/common/memory.o
   2.267 +xen/common/network.o
   2.268 +xen/common/page_alloc.o
   2.269 +xen/common/perfc.o
   2.270 +xen/common/resource.o
   2.271 +xen/common/schedule.o
   2.272 +xen/common/slab.o
   2.273 +xen/common/softirq.o
   2.274 +xen/common/string.o
   2.275 +xen/common/timer.o
   2.276 +xen/common/vsprintf.o
   2.277 +xen/drivers/block/blkpg.o
   2.278 +xen/drivers/block/driver.o
   2.279 +xen/drivers/block/elevator.o
   2.280 +xen/drivers/block/genhd.o
   2.281 +xen/drivers/block/ll_rw_blk.o
   2.282 +xen/drivers/block/xen_block.o
   2.283 +xen/drivers/block/xen_physdisk.o
   2.284 +xen/drivers/block/xen_segment.o
   2.285 +xen/drivers/cdrom/cdrom.o
   2.286 +xen/drivers/cdrom/driver.o
   2.287 +xen/drivers/char/driver.o
   2.288 +xen/drivers/char/xen_kbd.o
   2.289 +xen/drivers/char/xen_serial.o
   2.290 +xen/drivers/ide/driver.o
   2.291 +xen/drivers/ide/ide-cd.o
   2.292 +xen/drivers/ide/ide-disk.o
   2.293 +xen/drivers/ide/ide-dma.o
   2.294 +xen/drivers/ide/ide-features.o
   2.295 +xen/drivers/ide/ide-geometry.o
   2.296 +xen/drivers/ide/ide-pci.o
   2.297 +xen/drivers/ide/ide-probe.o
   2.298 +xen/drivers/ide/ide-taskfile.o
   2.299 +xen/drivers/ide/ide-xeno.o
   2.300 +xen/drivers/ide/ide.o
   2.301 +xen/drivers/ide/piix.o
   2.302 +xen/drivers/net/3c59x.o
   2.303 +xen/drivers/net/Space.o
   2.304 +xen/drivers/net/driver.o
   2.305 +xen/drivers/net/e1000/e1000.o
   2.306 +xen/drivers/net/e1000/e1000_ethtool.o
   2.307 +xen/drivers/net/e1000/e1000_hw.o
   2.308 +xen/drivers/net/e1000/e1000_main.o
   2.309 +xen/drivers/net/e1000/e1000_param.o
   2.310 +xen/drivers/net/ne/8390.o
   2.311 +xen/drivers/net/ne/ne.o
   2.312 +xen/drivers/net/ne/ne_drv.o
   2.313 +xen/drivers/net/net_init.o
   2.314 +xen/drivers/net/setup.o
   2.315 +xen/drivers/net/tg3.o
   2.316 +xen/drivers/pci/classlist.h
   2.317 +xen/drivers/pci/compat.o
   2.318 +xen/drivers/pci/devlist.h
   2.319 +xen/drivers/pci/driver.o
   2.320 +xen/drivers/pci/gen-devlist
   2.321 +xen/drivers/pci/names.o
   2.322 +xen/drivers/pci/pci.o
   2.323 +xen/drivers/pci/quirks.o
   2.324 +xen/drivers/pci/setup-res.o
   2.325 +xen/drivers/scsi/aacraid/aachba.o
   2.326 +xen/drivers/scsi/aacraid/aacraid.o
   2.327 +xen/drivers/scsi/aacraid/commctrl.o
   2.328 +xen/drivers/scsi/aacraid/comminit.o
   2.329 +xen/drivers/scsi/aacraid/commsup.o
   2.330 +xen/drivers/scsi/aacraid/dpcsup.o
   2.331 +xen/drivers/scsi/aacraid/linit.o
   2.332 +xen/drivers/scsi/aacraid/rx.o
   2.333 +xen/drivers/scsi/aacraid/sa.o
   2.334 +xen/drivers/scsi/aic7xxx/aic7770.o
   2.335 +xen/drivers/scsi/aic7xxx/aic7770_osm.o
   2.336 +xen/drivers/scsi/aic7xxx/aic7xxx.o
   2.337 +xen/drivers/scsi/aic7xxx/aic7xxx_93cx6.o
   2.338 +xen/drivers/scsi/aic7xxx/aic7xxx_core.o
   2.339 +xen/drivers/scsi/aic7xxx/aic7xxx_osm.o
   2.340 +xen/drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
   2.341 +xen/drivers/scsi/aic7xxx/aic7xxx_pci.o
   2.342 +xen/drivers/scsi/aic7xxx/aic7xxx_proc.o
   2.343 +xen/drivers/scsi/constants.o
   2.344 +xen/drivers/scsi/driver.o
   2.345 +xen/drivers/scsi/hosts.o
   2.346 +xen/drivers/scsi/megaraid.o
   2.347 +xen/drivers/scsi/scsi.o
   2.348 +xen/drivers/scsi/scsi_dma.o
   2.349 +xen/drivers/scsi/scsi_error.o
   2.350 +xen/drivers/scsi/scsi_ioctl.o
   2.351 +xen/drivers/scsi/scsi_lib.o
   2.352 +xen/drivers/scsi/scsi_merge.o
   2.353 +xen/drivers/scsi/scsi_proc.o
   2.354 +xen/drivers/scsi/scsi_queue.o
   2.355 +xen/drivers/scsi/scsi_scan.o
   2.356 +xen/drivers/scsi/scsi_syms.o
   2.357 +xen/drivers/scsi/scsicam.o
   2.358 +xen/drivers/scsi/sd.o
   2.359 +xen/image
   2.360  xen/image.dis
   2.361 +xen/image.gz
   2.362 +xen/image.s
   2.363 +xen/include/asm
   2.364 +xen/include/hypervisor-ifs/hypervisor-ifs
   2.365 +xen/include/linux
   2.366  xen/include/xeno/compile.h
   2.367 +xen/net/dev.o
   2.368 +xen/net/dev_mcast.o
   2.369 +xen/net/devinit.o
   2.370 +xen/net/eth.o
   2.371 +xen/net/network.o
   2.372 +xen/net/skbuff.o
   2.373 +xen/tools/elf-reloc
   2.374  xen/tools/figlet/figlet
   2.375 -tools/control/.classpath
   2.376 -tools/control/.project
   2.377 -tools/control/eclipsebin/**
   2.378 -tools/control/build-cmdline/**
   2.379 -tools/control/xenctl-cmdline.jar
   2.380 +xenolinux-2.4.16-sparse/arch/xeno/drivers/block/Makefile.orig
   2.381 +xenolinux-2.4.16-sparse/arch/xeno/drivers/block/block.c.orig
   2.382 +xenolinux-2.4.16-sparse/scripts/kconfig.tk
     3.1 --- a/tools/internal/Makefile	Thu Jul 03 15:02:46 2003 +0000
     3.2 +++ b/tools/internal/Makefile	Thu Jul 03 16:37:59 2003 +0000
     3.3 @@ -4,13 +4,18 @@ XI_START = xi_start
     3.4  XI_STOP = xi_stop
     3.5  XI_DESTROY = xi_destroy
     3.6  XI_BUILD = xi_build
     3.7 +XI_PHYS_GRANT = xi_phys_grant
     3.8 +XI_PHYS_REVOKE = xi_phys_revoke
     3.9  
    3.10 -all: $(XI_CREATE).o $(XI_START).o $(XI_STOP).o $(XI_DESTROY).o $(XI_BUILD).o
    3.11 +all: $(XI_CREATE).o $(XI_START).o $(XI_STOP).o $(XI_DESTROY).o $(XI_BUILD).o \
    3.12 +	$(XI_PHYS_GRANT).o $(XI_PHYS_REVOKE).o
    3.13  	$(CC) -o $(XI_CREATE) $(XI_CREATE).o
    3.14  	$(CC) -o $(XI_BUILD) $(XI_BUILD).o
    3.15  	$(CC) -o $(XI_START) $(XI_START).o
    3.16  	$(CC) -o $(XI_STOP) $(XI_STOP).o
    3.17  	$(CC) -o $(XI_DESTROY) $(XI_DESTROY).o
    3.18 +	$(CC) -o $(XI_PHYS_GRANT) $(XI_PHYS_GRANT).o
    3.19 +	$(CC) -o $(XI_PHYS_REVOKE) $(XI_PHYS_REVOKE).o
    3.20  
    3.21  $(XI_CREATE).o: $(XI_CREATE).c dom0_defs.h dom0_ops.h hypervisor_defs.h mem_defs.h
    3.22  	$(CC) -c $(XI_CREATE).c 
    3.23 @@ -27,8 +32,14 @@ internal_domain_build.o: internal_domain
    3.24  $(XI_DESTROY).o: $(XI_DESTROY).c dom0_ops.h dom0_defs.h
    3.25  	$(CC) -c $(XI_DESTROY).c 
    3.26  
    3.27 +$(XI_PHYS_GRANT).o: $(XI_PHYS_GRANT).c physdev.h
    3.28 +	$(CC) -c $(XI_PHYS_GRANT).c 
    3.29 +
    3.30 +$(XI_PHYS_REVOKE).o: $(XI_PHYS_REVOKE).c physdev.h
    3.31 +	$(CC) -c $(XI_PHYS_REVOKE).c 
    3.32 +
    3.33  install: all
    3.34 -	cp -a xi_list xi_vifinit xi_helper $(XI_CREATE) $(XI_BUILD) $(XI_START) $(XI_STOP) $(XI_DESTROY) ../../../install/bin
    3.35 +	cp -a xi_list xi_vifinit xi_helper $(XI_CREATE) $(XI_BUILD) $(XI_START) $(XI_STOP) $(XI_DESTROY) $(XI_PHYSDEV_GRANT) $(XI_PHYS_REVOKE) ../../../install/bin
    3.36  	chmod 755 ../../../install/bin/xi_list
    3.37  	chmod 755 ../../../install/bin/xi_vifinit
    3.38  	chmod 755 ../../../install/bin/xi_helper
    3.39 @@ -42,5 +53,5 @@ rpm: all
    3.40  	rm -rf staging
    3.41  
    3.42  clean:
    3.43 -	$(RM) *.o *.rpm $(XI_CREATE) $(XI_START) $(XI_STOP) $(XI_DESTROY) $(XI_BUILD)
    3.44 +	$(RM) *.o *.rpm $(XI_CREATE) $(XI_START) $(XI_STOP) $(XI_DESTROY) $(XI_BUILD) $(XI_PHYSDEV_GRANT)
    3.45  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/internal/physdev.h	Thu Jul 03 16:37:59 2003 +0000
     4.3 @@ -0,0 +1,26 @@
     4.4 +#define XEN_BLOCK_PHYSDEV_GRANT 10 /* grant access to range of disk blocks */
     4.5 +#define XEN_BLOCK_PHYSDEV_REVOKE 11 /* revoke access to range of disk blocks */
     4.6 +#define XEN_BLOCK_PHYSDEV_PROBE 12 /* probe for a domain's physdev
     4.7 +				      accesses */
     4.8 +
     4.9 +typedef struct xp_disk
    4.10 +{
    4.11 +  int mode;
    4.12 +  int domain;
    4.13 +  unsigned short device;
    4.14 +  unsigned long start_sect;
    4.15 +  unsigned long n_sectors;
    4.16 +} xp_disk_t;
    4.17 +
    4.18 +#define PHYSDISK_MAX_ACES_PER_REQUEST 254
    4.19 +typedef struct {
    4.20 +  int n_aces;
    4.21 +  int domain;
    4.22 +  int start_ind;
    4.23 +  struct {
    4.24 +    unsigned short device;
    4.25 +    unsigned long start_sect;
    4.26 +    unsigned long n_sectors;
    4.27 +    unsigned mode;
    4.28 +  } entries[PHYSDISK_MAX_ACES_PER_REQUEST];
    4.29 +} physdisk_probebuf_t;
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/internal/xi_phys_grant.c	Thu Jul 03 16:37:59 2003 +0000
     5.3 @@ -0,0 +1,43 @@
     5.4 +#include <unistd.h>
     5.5 +#include <stdio.h>
     5.6 +#include <errno.h>
     5.7 +#include <sys/fcntl.h>
     5.8 +
     5.9 +#include "physdev.h"
    5.10 +
    5.11 +int main(int argc, char *argv[])
    5.12 +{
    5.13 +  xp_disk_t buf;
    5.14 +  int fd;
    5.15 +
    5.16 +  if (argc != 6) {
    5.17 +    fprintf(stderr, "Usage: xi_physdev_grant <r/rw> <domain> <device> <start sector> <n_sectors>\n");
    5.18 +    return 1;
    5.19 +  }
    5.20 +
    5.21 +  buf.mode = 0;
    5.22 +  if (argv[1][0] == 'r')
    5.23 +    buf.mode |= 1;
    5.24 +  else if (argv[1][0] == 'w')
    5.25 +    buf.mode |= 2;
    5.26 +  if (argv[1][1] == 'r')
    5.27 +    buf.mode |= 1;
    5.28 +  else if (argv[1][1] == 'w')
    5.29 +    buf.mode |= 2;
    5.30 +  
    5.31 +  buf.domain = atol(argv[2]);
    5.32 +  buf.device = atol(argv[3]);
    5.33 +  buf.start_sect = atol(argv[4]);
    5.34 +  buf.n_sectors = atol(argv[5]);
    5.35 +
    5.36 +  fd = open("/proc/xeno/dom0/phd", O_WRONLY);
    5.37 +  if (fd < 0) {
    5.38 +    fprintf(stderr, "Can\'t open /proc/xeno/dom0/phd: %s.\n", strerror(errno));
    5.39 +    return 1;
    5.40 +  }
    5.41 +
    5.42 +  write(fd, &buf, sizeof(buf));
    5.43 +  close(fd);
    5.44 +
    5.45 +  return 0;
    5.46 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/internal/xi_phys_probe.c	Thu Jul 03 16:37:59 2003 +0000
     6.3 @@ -0,0 +1,48 @@
     6.4 +#include <stdio.h>
     6.5 +#include <sys/fcntl.h>
     6.6 +#include <errno.h>
     6.7 +#include <unistd.h>
     6.8 +#include <string.h>
     6.9 +
    6.10 +#include "physdev.h"
    6.11 +
    6.12 +int main(int argc, char *argv[])
    6.13 +{
    6.14 +  physdisk_probebuf_t buf;
    6.15 +  int fd;
    6.16 +  int x;
    6.17 +
    6.18 +  if (argc != 2) {
    6.19 +    fprintf(stderr, "Usage: xi_phys_probe <domain_nr>\n");
    6.20 +    return 1;
    6.21 +  }
    6.22 +
    6.23 +  fd = open("/proc/xeno/dom0/phd", O_RDONLY);
    6.24 +  if (fd < 0) {
    6.25 +    fprintf(stderr, "Can\'t open /proc/xeno/dom0/phd: %s.\n",
    6.26 +	    strerror(errno));
    6.27 +    return 1;
    6.28 +  }
    6.29 +
    6.30 +  memset(&buf, 0, sizeof(buf));
    6.31 +  buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
    6.32 +  while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST ||
    6.33 +	 buf.n_aces == 0) {
    6.34 +    buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
    6.35 +    buf.domain = atol(argv[1]);
    6.36 +    read(fd, &buf, sizeof(buf));
    6.37 +    if (!buf.n_aces)
    6.38 +      break;
    6.39 +
    6.40 +    printf("Found %d ACEs\n", buf.n_aces);
    6.41 +
    6.42 +    for (x = 0; x < buf.n_aces; x++) {
    6.43 +      printf("%x:[%x,%x) : %x\n", buf.entries[x].device,
    6.44 +	     buf.entries[x].start_sect,
    6.45 +	     buf.entries[x].start_sect  + buf.entries[x].n_sectors,
    6.46 +	     buf.entries[x].mode);
    6.47 +    }
    6.48 +    buf.start_ind += buf.n_aces;
    6.49 +  }
    6.50 +  return 0;
    6.51 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/tools/internal/xi_phys_revoke.c	Thu Jul 03 16:37:59 2003 +0000
     7.3 @@ -0,0 +1,33 @@
     7.4 +#include <unistd.h>
     7.5 +#include <errno.h>
     7.6 +#include <stdio.h>
     7.7 +#include <sys/fcntl.h>
     7.8 +
     7.9 +#include "physdev.h"
    7.10 +
    7.11 +int main(int argc, char *argv[])
    7.12 +{
    7.13 +  xp_disk_t buf;
    7.14 +  int fd;
    7.15 +
    7.16 +  if (argc != 5) {
    7.17 +    fprintf(stderr, "Usage: xi_physdev_revoke <domain> <device> <start sector> <n_sectors>\n");
    7.18 +    return 1;
    7.19 +  }
    7.20 +
    7.21 +  buf.domain = atol(argv[1]);
    7.22 +  buf.device = atol(argv[2]);
    7.23 +  buf.start_sect = atol(argv[3]);
    7.24 +  buf.n_sectors = atol(argv[4]);
    7.25 +
    7.26 +  fd = open("/proc/xeno/dom0/phd", O_WRONLY);
    7.27 +  if (fd < 0) {
    7.28 +    fprintf(stderr, "Can\'t open /proc/xeno/dom0/phd: %s.\n", strerror(errno));
    7.29 +    return 1;
    7.30 +  }
    7.31 +
    7.32 +  write(fd, &buf, sizeof(buf));
    7.33 +  close(fd);
    7.34 +
    7.35 +  return 0;
    7.36 +}
     8.1 --- a/xen/common/domain.c	Thu Jul 03 15:02:46 2003 +0000
     8.2 +++ b/xen/common/domain.c	Thu Jul 03 16:37:59 2003 +0000
     8.3 @@ -52,6 +52,7 @@ struct task_struct *do_newdomain(unsigne
     8.4  
     8.5      spin_lock_init(&p->blk_ring_lock);
     8.6      spin_lock_init(&p->page_lock);
     8.7 +    spin_lock_init(&p->physdev_lock);
     8.8  
     8.9      p->shared_info = (void *)get_free_page(GFP_KERNEL);
    8.10      memset(p->shared_info, 0, PAGE_SIZE);
    8.11 @@ -62,6 +63,8 @@ struct task_struct *do_newdomain(unsigne
    8.12  
    8.13      init_blkdev_info(p);
    8.14  
    8.15 +    INIT_LIST_HEAD(&p->physdisk_aces);
    8.16 +
    8.17      SET_GDT_ENTRIES(p, DEFAULT_GDT_ENTRIES);
    8.18      SET_GDT_ADDRESS(p, DEFAULT_GDT_ADDRESS);
    8.19  
    8.20 @@ -303,6 +306,9 @@ void release_task(struct task_struct *p)
    8.21       */
    8.22      destroy_blkdev_info(p);
    8.23  
    8.24 +    /* Free up the physdisk access control info */
    8.25 +    destroy_physdisk_aces(p);
    8.26 +
    8.27      /* Free all memory associated with this domain. */
    8.28      free_page((unsigned long)p->mm.perdomain_pt);
    8.29      UNSHARE_PFN(virt_to_page(p->shared_info));
     9.1 --- a/xen/drivers/block/xen_block.c	Thu Jul 03 15:02:46 2003 +0000
     9.2 +++ b/xen/drivers/block/xen_block.c	Thu Jul 03 16:37:59 2003 +0000
     9.3 @@ -104,6 +104,9 @@ static void dispatch_probe_seg(struct ta
     9.4  static void dispatch_debug_block_io(struct task_struct *p, int index);
     9.5  static void dispatch_create_segment(struct task_struct *p, int index);
     9.6  static void dispatch_delete_segment(struct task_struct *p, int index);
     9.7 +static void dispatch_grant_physdev(struct task_struct *p, int index);
     9.8 +static void dispatch_revoke_physdev(struct task_struct *p, int index);
     9.9 +static void dispatch_probe_physdev(struct task_struct *p, int index);
    9.10  static void make_response(struct task_struct *p, unsigned long id, 
    9.11                            unsigned short op, unsigned long st);
    9.12  
    9.13 @@ -396,6 +399,18 @@ static int do_block_io_op_domain(struct 
    9.14  	    dispatch_delete_segment(p, i);
    9.15  	    break;
    9.16  
    9.17 +	case XEN_BLOCK_PHYSDEV_GRANT:
    9.18 +  	    dispatch_grant_physdev(p, i);
    9.19 +	    break;
    9.20 +
    9.21 +	case XEN_BLOCK_PHYSDEV_REVOKE:
    9.22 + 	    dispatch_revoke_physdev(p, i);
    9.23 +	    break;
    9.24 +
    9.25 +	case XEN_BLOCK_PHYSDEV_PROBE:
    9.26 + 	    dispatch_probe_physdev(p, i);
    9.27 +	    break;
    9.28 +
    9.29  	default:
    9.30              DPRINTK("error: unknown block io operation [%d]\n",
    9.31                      blk_ring->ring[i].req.operation);
    9.32 @@ -414,6 +429,115 @@ static void dispatch_debug_block_io(stru
    9.33      DPRINTK("dispatch_debug_block_io: unimplemented\n"); 
    9.34  }
    9.35  
    9.36 +static void dispatch_probe_physdev(struct task_struct *p, int index)
    9.37 +{
    9.38 +    blk_ring_t *blk_ring = p->blk_ring_base;
    9.39 +    unsigned long flags, buffer;
    9.40 +    physdisk_probebuf_t *buf;
    9.41 +    int result;
    9.42 +
    9.43 +    if ( p->domain != 0 )
    9.44 +    {
    9.45 +        result = 1;
    9.46 +        goto out;
    9.47 +    }
    9.48 +
    9.49 +    buffer = blk_ring->ring[index].req.buffer_and_sects[0] & ~0x1FF;
    9.50 +
    9.51 +    spin_lock_irqsave(&p->page_lock, flags);
    9.52 +    if ( !__buffer_is_valid(p, buffer, sizeof(*buf), 1) )
    9.53 +    {
    9.54 +        spin_unlock_irqrestore(&p->page_lock, flags);
    9.55 +        result = 1;
    9.56 +        goto out;
    9.57 +    }
    9.58 +    __lock_buffer(buffer, sizeof(*buf), 1);
    9.59 +    spin_unlock_irqrestore(&p->page_lock, flags);
    9.60 +
    9.61 +    buf = phys_to_virt(buffer);
    9.62 +    result = xen_physdisk_probe(buf);
    9.63 +
    9.64 +    unlock_buffer(p, buffer, sizeof(*buf), 1);
    9.65 +
    9.66 + out:
    9.67 +    make_response(p, blk_ring->ring[index].req.id, 
    9.68 +                  XEN_BLOCK_PHYSDEV_PROBE, result); 
    9.69 +}
    9.70 +
    9.71 +static void dispatch_grant_physdev(struct task_struct *p, int index)
    9.72 +{
    9.73 +    blk_ring_t *blk_ring = p->blk_ring_base;
    9.74 +    unsigned long flags, buffer;
    9.75 +    xp_disk_t *xpd;
    9.76 +    int result;
    9.77 +
    9.78 +    if ( p->domain != 0 )
    9.79 +    {
    9.80 +        DPRINTK("dispatch_grant_physdev called by dom%d\n", p->domain);
    9.81 +        result = 1;
    9.82 +        goto out;
    9.83 +    }
    9.84 +
    9.85 +    buffer = blk_ring->ring[index].req.buffer_and_sects[0] & ~0x1FF;
    9.86 +
    9.87 +    spin_lock_irqsave(&p->page_lock, flags);
    9.88 +    if ( !__buffer_is_valid(p, buffer, sizeof(xv_disk_t), 1) )
    9.89 +    {
    9.90 +        DPRINTK("Bad buffer in dispatch_grant_physdev\n");
    9.91 +        spin_unlock_irqrestore(&p->page_lock, flags);
    9.92 +        result = 1;
    9.93 +        goto out;
    9.94 +    }
    9.95 +    __lock_buffer(buffer, sizeof(xv_disk_t), 1);
    9.96 +    spin_unlock_irqrestore(&p->page_lock, flags);
    9.97 +
    9.98 +    xpd = phys_to_virt(buffer);
    9.99 +    result = xen_physdisk_grant(xpd);
   9.100 +
   9.101 +    unlock_buffer(p, buffer, sizeof(xp_disk_t), 1);
   9.102 +
   9.103 + out:
   9.104 +    make_response(p, blk_ring->ring[index].req.id, 
   9.105 +                  XEN_BLOCK_PHYSDEV_GRANT, result); 
   9.106 +}
   9.107 +  
   9.108 +static void dispatch_revoke_physdev(struct task_struct *p, int index)
   9.109 +{
   9.110 +    blk_ring_t *blk_ring = p->blk_ring_base;
   9.111 +    unsigned long flags, buffer;
   9.112 +    xp_disk_t *xpd;
   9.113 +    int result;
   9.114 +
   9.115 +    if ( p->domain != 0 )
   9.116 +    {
   9.117 +        DPRINTK("dispatch_grant_physdev called by dom%d\n", p->domain);
   9.118 +        result = 1;
   9.119 +        goto out;
   9.120 +    }
   9.121 +
   9.122 +    buffer = blk_ring->ring[index].req.buffer_and_sects[0] & ~0x1FF;
   9.123 +
   9.124 +    spin_lock_irqsave(&p->page_lock, flags);
   9.125 +    if ( !__buffer_is_valid(p, buffer, sizeof(xv_disk_t), 1) )
   9.126 +    {
   9.127 +        DPRINTK("Bad buffer in dispatch_grant_physdev\n");
   9.128 +        spin_unlock_irqrestore(&p->page_lock, flags);
   9.129 +        result = 1;
   9.130 +        goto out;
   9.131 +    }
   9.132 +    __lock_buffer(buffer, sizeof(xv_disk_t), 1);
   9.133 +    spin_unlock_irqrestore(&p->page_lock, flags);
   9.134 +
   9.135 +    xpd = phys_to_virt(buffer);
   9.136 +    result = xen_physdisk_revoke(xpd);
   9.137 +
   9.138 +    unlock_buffer(p, buffer, sizeof(xp_disk_t), 1);
   9.139 +
   9.140 + out:
   9.141 +    make_response(p, blk_ring->ring[index].req.id, 
   9.142 +                  XEN_BLOCK_PHYSDEV_REVOKE, result); 
   9.143 +}
   9.144 +
   9.145  static void dispatch_create_segment(struct task_struct *p, int index)
   9.146  {
   9.147      blk_ring_t *blk_ring = p->blk_ring_base;
   9.148 @@ -593,6 +717,12 @@ static void dispatch_rw_block_io(struct 
   9.149  	        DPRINTK("bad device\n");
   9.150  	        goto bad_descriptor;
   9.151  	    }
   9.152 +	    if (p->domain != 0 &&
   9.153 +		!xen_physdisk_access_okay(&phys_seg, p, operation)) {
   9.154 +	      DPRINTK("access denied\n");
   9.155 +	      /* XXX not quite right, but close enough. */
   9.156 +	      goto bad_descriptor;
   9.157 +	    }
   9.158              new_segs = 1;
   9.159          }
   9.160          
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/xen/drivers/block/xen_physdisk.c	Thu Jul 03 16:37:59 2003 +0000
    10.3 @@ -0,0 +1,301 @@
    10.4 +#include <xeno/sched.h>
    10.5 +#include <xeno/list.h>
    10.6 +#include <xeno/blkdev.h>
    10.7 +#include <xeno/sched.h>
    10.8 +#include <xeno/slab.h>
    10.9 +#include <asm/domain_page.h>
   10.10 +#include <asm/io.h>
   10.11 +#include <xeno/segment.h>
   10.12 +
   10.13 +#define MAX(a,b) ((a) > (b) ? (a) : (b))
   10.14 +
   10.15 +#if 0
   10.16 +#define DPRINTK printk
   10.17 +#else
   10.18 +#define DPRINTK(...)
   10.19 +#endif
   10.20 +
   10.21 +/* The idea is that, for each sector of each disk, each domain has two
   10.22 +   bits, saying whether they can read the sector or write it.  That
   10.23 +   would take too much memory, so instead each process has a list of
   10.24 +   (device, start, end, mode) quads which say what it has access to,
   10.25 +   and we fake the logical view on top of that. */
   10.26 +struct physdisk_ace {
   10.27 +  struct list_head list;
   10.28 +
   10.29 +  unsigned short device;
   10.30 +  unsigned long start_sect;
   10.31 +  unsigned long n_sectors;
   10.32 +#define PHYSDISK_MODE_R 1
   10.33 +#define PHYSDISK_MODE_W 2
   10.34 +  int mode;
   10.35 +};
   10.36 +
   10.37 +/* Operation is a blkdev constant i.e. READ, WRITE, ... */
   10.38 +/* Must be called with p->physdev_lock held. */
   10.39 +static struct physdisk_ace *find_ace(const struct task_struct *p,
   10.40 +				     unsigned short dev,
   10.41 +				     unsigned long sect,
   10.42 +				     int operation)
   10.43 +{
   10.44 +  struct list_head *cur_ace_head;
   10.45 +  struct physdisk_ace *cur_ace;
   10.46 +
   10.47 +  list_for_each(cur_ace_head, &p->physdisk_aces) {
   10.48 +    cur_ace = list_entry(cur_ace_head, struct physdisk_ace,
   10.49 +			 list);
   10.50 +    DPRINTK("Is [%lx, %lx) good for %lx?\n",
   10.51 +	    cur_ace->start_sect, cur_ace->start_sect + cur_ace->n_sectors,
   10.52 +	    sect);
   10.53 +    if (sect >= cur_ace->start_sect &&
   10.54 +	sect < cur_ace->start_sect + cur_ace->n_sectors &&
   10.55 +	dev == cur_ace->device &&
   10.56 +	((operation == READ && (cur_ace->mode & PHYSDISK_MODE_R)) ||
   10.57 +	 (operation == WRITE && (cur_ace->mode & PHYSDISK_MODE_W)))) {
   10.58 +      DPRINTK("Yes.\n");
   10.59 +      return cur_ace;
   10.60 +    } else {
   10.61 +      DPRINTK("No.\n");
   10.62 +    }
   10.63 +  }
   10.64 +  return NULL;
   10.65 +}
   10.66 +
   10.67 +/* Hold the lock on entry, it remains held on exit. */
   10.68 +/* XXX we call kmalloc and kfree with GFP_KERNEL and a spinlock held
   10.69 +   in here.  That wouldn't be allowed under Linux, but, from reading
   10.70 +   the source, it seems to be okay under Xen... */
   10.71 +static void xen_physdisk_revoke_access(unsigned short dev,
   10.72 +				       unsigned long start_sect,
   10.73 +				       unsigned long n_sectors,
   10.74 +				       struct task_struct *p)
   10.75 +{
   10.76 +  /* Find every ace which intersects [start_sect, start_sect +
   10.77 +     n_sectors] and either remove it completely or truncate it
   10.78 +     down. */
   10.79 +  struct list_head *cur_ace_head;
   10.80 +  struct physdisk_ace *cur_ace, *new_ace;
   10.81 +  unsigned long kill_zone_end, ace_end;
   10.82 +
   10.83 +  kill_zone_end = start_sect + n_sectors;
   10.84 +  list_for_each(cur_ace_head, &p->physdisk_aces) {
   10.85 +    cur_ace = list_entry(cur_ace_head, struct physdisk_ace,
   10.86 +			 list);
   10.87 +    ace_end = cur_ace->start_sect + cur_ace->n_sectors;
   10.88 +    if (cur_ace->start_sect > kill_zone_end ||
   10.89 +	ace_end < start_sect)
   10.90 +      continue;
   10.91 +    
   10.92 +    if (cur_ace->start_sect >= start_sect &&
   10.93 +	ace_end < kill_zone_end) {
   10.94 +      /* ace entirely within kill zone -> kill it */
   10.95 +      list_del(cur_ace_head);
   10.96 +      cur_ace_head = cur_ace_head->next;
   10.97 +      kfree(cur_ace);
   10.98 +    } else if (ace_end < kill_zone_end) {
   10.99 +      /* ace start before kill start, ace end in kill zone, 
  10.100 +	 move ace end. */
  10.101 +      cur_ace->n_sectors = start_sect - cur_ace->start_sect;
  10.102 +    } else if (cur_ace->start_sect >= start_sect) {
  10.103 +      /* ace start after kill start, ace end outside kill zone,
  10.104 +	 move ace start. */
  10.105 +      cur_ace->start_sect = kill_zone_end;
  10.106 +      cur_ace->n_sectors = ace_end - cur_ace->start_sect;
  10.107 +    } else {
  10.108 +      /* The fun one: the kill zone entirely includes the ace. */
  10.109 +      /* Cut the current ace down to just the bit before the kzone,
  10.110 +	 create a new ace for the bit just after it. */
  10.111 +      new_ace = kmalloc(sizeof(*cur_ace), GFP_KERNEL);
  10.112 +      new_ace->device = dev;
  10.113 +      new_ace->start_sect = kill_zone_end;
  10.114 +      new_ace->n_sectors = ace_end - kill_zone_end;
  10.115 +      new_ace->mode = cur_ace->mode;
  10.116 +
  10.117 +      cur_ace->n_sectors = start_sect - cur_ace->start_sect;
  10.118 +
  10.119 +      list_add(&new_ace->list, cur_ace_head);
  10.120 +      cur_ace_head = new_ace->list.next;
  10.121 +    }
  10.122 +  }
  10.123 +}
  10.124 +
  10.125 +/* Hold the lock on entry, it remains held on exit. */
  10.126 +static int xen_physdisk_grant_access(unsigned short dev,
  10.127 +				     unsigned long start_sect,
  10.128 +				     unsigned long n_sectors,
  10.129 +				     int mode,
  10.130 +				     struct task_struct *p)
  10.131 +{
  10.132 +  struct physdisk_ace *cur_ace;
  10.133 +
  10.134 +  /* Make sure it won't overlap with any existing ACEs. */
  10.135 +  /* XXX this isn't quite right if the domain already has read access
  10.136 +     and we try to grant write access, or vice versa. */
  10.137 +  xen_physdisk_revoke_access(dev, start_sect, n_sectors, p);
  10.138 +  
  10.139 +  cur_ace = kmalloc(sizeof(*cur_ace), GFP_KERNEL);
  10.140 +  cur_ace->device = dev;
  10.141 +  cur_ace->start_sect = start_sect;
  10.142 +  cur_ace->n_sectors = n_sectors;
  10.143 +  cur_ace->mode = mode;
  10.144 +
  10.145 +  list_add_tail(&cur_ace->list, &p->physdisk_aces);
  10.146 +
  10.147 +  return 0;
  10.148 +}
  10.149 +
  10.150 +static void xen_physdisk_probe_access(physdisk_probebuf_t *buf,
  10.151 +				      struct task_struct *p)
  10.152 +{
  10.153 +  int max_aces;
  10.154 +  int n_aces;
  10.155 +  struct list_head *cur_ace_head;
  10.156 +  struct physdisk_ace *cur_ace;
  10.157 +  int x;
  10.158 +
  10.159 +  max_aces = buf->n_aces;
  10.160 +  n_aces = 0;
  10.161 +  list_for_each(cur_ace_head, &p->physdisk_aces) {
  10.162 +    if (x < buf->start_ind) {
  10.163 +      x++;
  10.164 +      continue;
  10.165 +    }
  10.166 +    cur_ace = list_entry(cur_ace_head, struct physdisk_ace,
  10.167 +			 list);
  10.168 +    buf->entries[n_aces].device = cur_ace->device;
  10.169 +    buf->entries[n_aces].start_sect = cur_ace->start_sect;
  10.170 +    buf->entries[n_aces].n_sectors = cur_ace->n_sectors;
  10.171 +    buf->entries[n_aces].mode = cur_ace->mode;
  10.172 +    n_aces++;
  10.173 +    if (n_aces >= max_aces)
  10.174 +      break;
  10.175 +  }
  10.176 +  buf->n_aces = n_aces;
  10.177 +  printk("Found a total of %x aces (max %x).\n", n_aces, max_aces);
  10.178 +}
  10.179 +
  10.180 +int xen_physdisk_grant(xp_disk_t *xpd_in)
  10.181 +{
  10.182 +  struct task_struct *p;
  10.183 +  xp_disk_t *xpd = map_domain_mem(virt_to_phys(xpd_in));
  10.184 +  int res;
  10.185 +
  10.186 +  p = current;
  10.187 +  DPRINTK("Have current.\n");
  10.188 +  DPRINTK("Target domain %x\n", xpd->domain);
  10.189 +
  10.190 +  do {
  10.191 +    p = p->next_task;
  10.192 +  } while (p != current && p->domain != xpd->domain);
  10.193 +  if (p->domain != xpd->domain) {
  10.194 +    DPRINTK("Bad domain! No biscuit!\n");
  10.195 +    res = 1;
  10.196 +    goto out;
  10.197 +  }
  10.198 +  spin_lock(&p->physdev_lock);
  10.199 +  res = xen_physdisk_grant_access(xpd->device,
  10.200 +				  xpd->start_sect,
  10.201 +				  xpd->n_sectors,
  10.202 +				  xpd->mode,
  10.203 +				  p);
  10.204 +  spin_unlock(&p->physdev_lock);
  10.205 +
  10.206 + out:
  10.207 +  unmap_domain_mem(xpd);
  10.208 +  return res;
  10.209 +}
  10.210 +
  10.211 +int xen_physdisk_revoke(xp_disk_t *xpd_in)
  10.212 +{
  10.213 +  struct task_struct *p;
  10.214 +  xp_disk_t *xpd = map_domain_mem(virt_to_phys(xpd_in));
  10.215 +  int res;
  10.216 +
  10.217 +  p = current;
  10.218 +
  10.219 +  do {
  10.220 +    p = p->next_task;
  10.221 +  } while (p != current && p->domain != xpd->domain);
  10.222 +  if (p->domain != xpd->domain) {
  10.223 +    res = 1;
  10.224 +    goto out;
  10.225 +  }
  10.226 +  spin_lock(&p->physdev_lock);
  10.227 +  xen_physdisk_revoke_access(xpd->device,
  10.228 +			     xpd->start_sect,
  10.229 +			     xpd->n_sectors,
  10.230 +			     p);
  10.231 +  spin_unlock(&p->physdev_lock);
  10.232 +  res = 0;
  10.233 + out:
  10.234 +  unmap_domain_mem(xpd);
  10.235 +  return res;
  10.236 +}
  10.237 +
  10.238 +int xen_physdisk_probe(physdisk_probebuf_t *buf_in)
  10.239 +{
  10.240 +  struct task_struct *p;
  10.241 +  physdisk_probebuf_t *buf = map_domain_mem(virt_to_phys(buf_in));
  10.242 +  int res;
  10.243 +
  10.244 +  p = current;
  10.245 +  do {
  10.246 +    p = p->next_task;
  10.247 +  } while (p != current && p->domain != buf->domain);
  10.248 +  if (p->domain != buf->domain) {
  10.249 +    res = 1;
  10.250 +    goto out;
  10.251 +  }
  10.252 +  printk("initially %x aces.\n", buf->n_aces);
  10.253 +  spin_lock(&p->physdev_lock);
  10.254 +  xen_physdisk_probe_access(buf, p);
  10.255 +  spin_unlock(&p->physdev_lock);
  10.256 +  printk("%x aces.\n", buf->n_aces);
  10.257 +  res = 0;
  10.258 + out:
  10.259 +  unmap_domain_mem(buf);
  10.260 +  return res;
  10.261 +}
  10.262 +
  10.263 +int xen_physdisk_access_okay(phys_seg_t *pseg, struct task_struct *p,
  10.264 +			     int operation)
  10.265 +{
  10.266 +  struct physdisk_ace *cur_ace;
  10.267 +  unsigned long sect;
  10.268 +
  10.269 +  DPRINTK("Checking access for domain %d, start sect %d, length %d.\n",
  10.270 +	  p->domain, pseg->sector_number, pseg->nr_sects);
  10.271 +
  10.272 +  for (sect = pseg->sector_number;
  10.273 +       sect < pseg->sector_number + pseg->nr_sects;
  10.274 +       ) {
  10.275 +    /* XXX this would be a lot faster if the aces were sorted on start
  10.276 +       address.  Also in revoke_access. */
  10.277 +    spin_lock(&p->physdev_lock);
  10.278 +    cur_ace = find_ace(p, pseg->dev, sect, operation);
  10.279 +    spin_unlock(&p->physdev_lock);
  10.280 +    if (!cur_ace) {
  10.281 +      /* Default closed. */
  10.282 +      return 0;
  10.283 +    }
  10.284 +    sect += MAX(cur_ace->n_sectors, pseg->nr_sects + pseg->sector_number - sect);
  10.285 +  }
  10.286 +  return 1;
  10.287 +}
  10.288 +
  10.289 +void destroy_physdisk_aces(struct task_struct *p)
  10.290 +{
  10.291 +  struct list_head *cur_ace_head, *next_head;
  10.292 +  struct physdisk_ace *cur_ace;
  10.293 +
  10.294 +  spin_lock(&p->physdev_lock); /* We never release this again. */
  10.295 +
  10.296 +  for (cur_ace_head = p->physdisk_aces.next;
  10.297 +       cur_ace_head != &p->physdisk_aces;
  10.298 +       cur_ace_head = next_head) {
  10.299 +    cur_ace = list_entry(cur_ace_head, struct physdisk_ace,
  10.300 +			 list);
  10.301 +    next_head = cur_ace_head->next;
  10.302 +    kfree(cur_ace);
  10.303 +  }
  10.304 +}
    11.1 --- a/xen/include/hypervisor-ifs/block.h	Thu Jul 03 15:02:46 2003 +0000
    11.2 +++ b/xen/include/hypervisor-ifs/block.h	Thu Jul 03 16:37:59 2003 +0000
    11.3 @@ -47,6 +47,10 @@
    11.4  #define XEN_BLOCK_SEG_CREATE   7  /* create segment (vhd) */
    11.5  #define XEN_BLOCK_SEG_DELETE   8  /* delete segment (vhd) */
    11.6  #define XEN_BLOCK_PROBE_SEG    9  /* get vhd config from hypervisor */
    11.7 +#define XEN_BLOCK_PHYSDEV_GRANT 10 /* grant access to range of disk blocks */
    11.8 +#define XEN_BLOCK_PHYSDEV_REVOKE 11 /* revoke access to range of disk blocks */
    11.9 +#define XEN_BLOCK_PHYSDEV_PROBE 12 /* probe for a domain's physdev
   11.10 +				      accesses */
   11.11  
   11.12  /* NB. Ring size must be small enough for sizeof(blk_ring_t) <= PAGE_SIZE. */
   11.13  #define BLK_RING_SIZE        64
   11.14 @@ -139,4 +143,26 @@ typedef struct xv_disk
   11.15    xv_extent_t extents[XEN_MAX_DISK_COUNT];    /* arbitrary reuse of constant */
   11.16  } xv_disk_t;
   11.17  
   11.18 +typedef struct xp_disk
   11.19 +{
   11.20 +  int mode;
   11.21 +  int domain;
   11.22 +  unsigned short device;
   11.23 +  unsigned long start_sect;
   11.24 +  unsigned long n_sectors;
   11.25 +} xp_disk_t;
   11.26 +
   11.27 +#define PHYSDISK_MAX_ACES_PER_REQUEST 254
   11.28 +typedef struct {
   11.29 +  int n_aces;
   11.30 +  int domain;
   11.31 +  int start_ind;
   11.32 +  struct {
   11.33 +    unsigned short device;
   11.34 +    unsigned long start_sect;
   11.35 +    unsigned long n_sectors;
   11.36 +    unsigned mode;
   11.37 +  } entries[PHYSDISK_MAX_ACES_PER_REQUEST];
   11.38 +} physdisk_probebuf_t;
   11.39 +
   11.40  #endif
    12.1 --- a/xen/include/xeno/sched.h	Thu Jul 03 15:02:46 2003 +0000
    12.2 +++ b/xen/include/xeno/sched.h	Thu Jul 03 16:37:59 2003 +0000
    12.3 @@ -133,6 +133,11 @@ struct task_struct
    12.4      unsigned int blk_resp_prod; /* (private version of) response producer */
    12.5      struct list_head blkdev_list;
    12.6      spinlock_t blk_ring_lock;
    12.7 +    struct list_head physdisk_aces; /* physdisk_ace structures
    12.8 +				       describing what bits of disk
    12.9 +				       the process can do raw access
   12.10 +				       to. */
   12.11 +    spinlock_t physdev_lock;
   12.12      segment_t *segment_list[XEN_MAX_SEGMENTS];                        /* xvd */
   12.13  
   12.14      /* VM */
    13.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/Makefile	Thu Jul 03 15:02:46 2003 +0000
    13.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/Makefile	Thu Jul 03 16:37:59 2003 +0000
    13.3 @@ -1,3 +1,3 @@
    13.4  O_TARGET := blk.o
    13.5 -obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o
    13.6 +obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o xl_physdisk_proc.o
    13.7  include $(TOPDIR)/Rules.make
    14.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c	Thu Jul 03 15:02:46 2003 +0000
    14.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c	Thu Jul 03 16:37:59 2003 +0000
    14.3 @@ -307,6 +307,9 @@ static int hypervisor_request(unsigned l
    14.4      {
    14.5      case XEN_BLOCK_SEG_CREATE:
    14.6      case XEN_BLOCK_SEG_DELETE:
    14.7 +    case XEN_BLOCK_PHYSDEV_GRANT:
    14.8 +    case XEN_BLOCK_PHYSDEV_REVOKE:
    14.9 +    case XEN_BLOCK_PHYSDEV_PROBE:
   14.10      case XEN_BLOCK_PROBE_BLK:
   14.11      case XEN_BLOCK_PROBE_SEG:
   14.12          if ( RING_FULL ) return 1;
   14.13 @@ -478,6 +481,9 @@ static void xlblk_response_int(int irq, 
   14.14          case XEN_BLOCK_SEG_DELETE:
   14.15          case XEN_BLOCK_PROBE_SEG:
   14.16          case XEN_BLOCK_PROBE_BLK:
   14.17 +	case XEN_BLOCK_PHYSDEV_GRANT:
   14.18 +	case XEN_BLOCK_PHYSDEV_REVOKE:
   14.19 +	case XEN_BLOCK_PHYSDEV_PROBE:
   14.20              if ( bret->status )
   14.21                  printk(KERN_ALERT "Bad return from blkdev control request\n");
   14.22              xlblk_control_msg_pending = 0;
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c	Thu Jul 03 16:37:59 2003 +0000
    15.3 @@ -0,0 +1,94 @@
    15.4 +#include <linux/kernel.h>
    15.5 +#include <linux/module.h>
    15.6 +#include <linux/fs.h>
    15.7 +#include <asm/errno.h>
    15.8 +#include <linux/slab.h>
    15.9 +#include <asm/hypervisor-ifs/block.h>
   15.10 +#include <asm/uaccess.h>
   15.11 +#include <linux/proc_fs.h>
   15.12 +
   15.13 +static struct proc_dir_entry *phd;
   15.14 +
   15.15 +extern int xenolinux_control_msg(int operration, char *buffer, int size);
   15.16 +
   15.17 +static ssize_t proc_read_phd(struct file * file, char * buff, size_t size, loff_t * off)
   15.18 +{
   15.19 +  physdisk_probebuf_t *buf;
   15.20 +  int res;
   15.21 +
   15.22 +  if (size != sizeof(physdisk_probebuf_t))
   15.23 +    return -EINVAL;
   15.24 +
   15.25 +  buf = kmalloc(sizeof(physdisk_probebuf_t), GFP_KERNEL);
   15.26 +  if (!buf)
   15.27 +    return -ENOMEM;
   15.28 +
   15.29 +  if (copy_from_user(buf, buff, size)) {
   15.30 +    kfree(buf);
   15.31 +    return -EFAULT;
   15.32 +  }
   15.33 +
   15.34 +  printk("max aces 1 %x\n", buf->n_aces);
   15.35 +
   15.36 +  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (void *)buf,
   15.37 +			      sizeof(physdisk_probebuf_t));
   15.38 +
   15.39 +  printk("max aces %x\n", buf->n_aces);
   15.40 +
   15.41 +  if (res)
   15.42 +    res = -EINVAL;
   15.43 +  else {
   15.44 +    res = sizeof(physdisk_probebuf_t);
   15.45 +    if (copy_to_user(buff, buf, sizeof(physdisk_probebuf_t))) {
   15.46 +      res = -EFAULT;
   15.47 +    }
   15.48 +  }
   15.49 +  kfree(buf);
   15.50 +  return res;
   15.51 +}
   15.52 +
   15.53 +static int proc_write_phd(struct file *file, const char *buffer,
   15.54 +			  size_t count, loff_t *ignore)
   15.55 +{
   15.56 +  char *local;
   15.57 +  int res;
   15.58 +
   15.59 +  if (count != sizeof(xp_disk_t))
   15.60 +    return -EINVAL;
   15.61 +
   15.62 +  local = kmalloc(count + 1, GFP_KERNEL);
   15.63 +  if (!local)
   15.64 +    return -ENOMEM;
   15.65 +  if (copy_from_user(local, buffer, count)) {
   15.66 +    res = -EFAULT;
   15.67 +    goto out;
   15.68 +  }
   15.69 +  local[count] = 0;
   15.70 +
   15.71 +  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_GRANT, local, count);
   15.72 +  if (res == 0)
   15.73 +    res = count;
   15.74 +  else
   15.75 +    res = -EINVAL;
   15.76 + out:
   15.77 +  kfree(local);
   15.78 +  return res;
   15.79 +}
   15.80 +
   15.81 +static struct file_operations proc_phd_fops = {
   15.82 +  read : proc_read_phd,
   15.83 +  write : proc_write_phd
   15.84 +};
   15.85 +
   15.86 +int __init xlphysdisk_proc_init(void)
   15.87 +{
   15.88 +  phd = create_proc_entry("xeno/dom0/phd", 0644, NULL);
   15.89 +  if (!phd) {
   15.90 +    panic("Can\'t create phd proc entry!\n");
   15.91 +  }
   15.92 +  phd->data = NULL;
   15.93 +  phd->proc_fops = &proc_phd_fops;
   15.94 +  phd->owner = THIS_MODULE;
   15.95 +
   15.96 +  return 0;
   15.97 +}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~	Thu Jul 03 16:37:59 2003 +0000
    16.3 @@ -0,0 +1,94 @@
    16.4 +#include <linux/kernel.h>
    16.5 +#include <linux/module.h>
    16.6 +#include <linux/fs.h>
    16.7 +#include <asm/errno.h>
    16.8 +#include <linux/slab.h>
    16.9 +#include <asm/hypervisor-ifs/block.h>
   16.10 +#include <asm/uaccess.h>
   16.11 +#include <linux/proc_fs.h>
   16.12 +
   16.13 +static struct proc_dir_entry *phd;
   16.14 +
   16.15 +extern int xenolinux_control_msg(int operration, char *buffer, int size);
   16.16 +
   16.17 +static ssize_t proc_read_phd(struct file * file, char * buff, size_t size, loff_t * off)
   16.18 +{
   16.19 +  physdisk_probebuf_t *buf;
   16.20 +  int res;
   16.21 +
   16.22 +  if (size != sizeof(physdisk_probebuf_t))
   16.23 +    return -EINVAL;
   16.24 +
   16.25 +  buf = kmalloc(sizeof(physdisk_probebuf_t), GFP_KERNEL);
   16.26 +  if (!buf)
   16.27 +    return -ENOMEM;
   16.28 +
   16.29 +  if (copy_from_user(buf, buff, size)) {
   16.30 +    kfree(buf);
   16.31 +    return -EFAULT;
   16.32 +  }
   16.33 +
   16.34 +  printk("max aces %x\n", buf->n_aces);
   16.35 +
   16.36 +  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (void *)buf,
   16.37 +			      sizeof(physdisk_probebuf_t));
   16.38 +
   16.39 +  printk("max aces %x\n", buf->n_aces);
   16.40 +
   16.41 +  if (res)
   16.42 +    res = -EINVAL;
   16.43 +  else {
   16.44 +    res = sizeof(physdisk_probebuf_t);
   16.45 +    if (copy_to_user(buff, buf, sizeof(physdisk_probebuf_t))) {
   16.46 +      res = -EFAULT;
   16.47 +    }
   16.48 +  }
   16.49 +  kfree(buf);
   16.50 +  return res;
   16.51 +}
   16.52 +
   16.53 +static int proc_write_phd(struct file *file, const char *buffer,
   16.54 +			  size_t count, loff_t *ignore)
   16.55 +{
   16.56 +  char *local;
   16.57 +  int res;
   16.58 +
   16.59 +  if (count != sizeof(xp_disk_t))
   16.60 +    return -EINVAL;
   16.61 +
   16.62 +  local = kmalloc(count + 1, GFP_KERNEL);
   16.63 +  if (!local)
   16.64 +    return -ENOMEM;
   16.65 +  if (copy_from_user(local, buffer, count)) {
   16.66 +    res = -EFAULT;
   16.67 +    goto out;
   16.68 +  }
   16.69 +  local[count] = 0;
   16.70 +
   16.71 +  res = xenolinux_control_msg(XEN_BLOCK_PHYSDEV_GRANT, local, count);
   16.72 +  if (res == 0)
   16.73 +    res = count;
   16.74 +  else
   16.75 +    res = -EINVAL;
   16.76 + out:
   16.77 +  kfree(local);
   16.78 +  return res;
   16.79 +}
   16.80 +
   16.81 +static struct file_operations proc_phd_fops = {
   16.82 +  read : proc_read_phd,
   16.83 +  write : proc_write_phd
   16.84 +};
   16.85 +
   16.86 +int __init xlphysdisk_proc_init(void)
   16.87 +{
   16.88 +  phd = create_proc_entry("xeno/dom0/phd", 0644, NULL);
   16.89 +  if (!phd) {
   16.90 +    panic("Can\'t create phd proc entry!\n");
   16.91 +  }
   16.92 +  phd->data = NULL;
   16.93 +  phd->proc_fops = &proc_phd_fops;
   16.94 +  phd->owner = THIS_MODULE;
   16.95 +
   16.96 +  return 0;
   16.97 +}
    17.1 --- a/xenolinux-2.4.21-sparse/drivers/block/ll_rw_blk.c	Thu Jul 03 15:02:46 2003 +0000
    17.2 +++ b/xenolinux-2.4.21-sparse/drivers/block/ll_rw_blk.c	Thu Jul 03 16:37:59 2003 +0000
    17.3 @@ -1505,6 +1505,7 @@ int __init blk_dev_init(void)
    17.4      xlblk_init();
    17.5      xlseg_init();
    17.6      xlseg_proc_init();
    17.7 +    xlphysdisk_proc_init();
    17.8  #endif
    17.9  
   17.10  	return 0;