ia64/xen-unstable

changeset 2052:dae98734f12e

bitkeeper revision 1.1128 (410f8501U6k1p4VW0CM4HcZS8VUAwQ)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xeno.bk-ptrw
author cl349@freefall.cl.cam.ac.uk
date Tue Aug 03 12:28:49 2004 +0000 (2004-08-03)
parents f775b5d07cde 257201a98550
children a20a79b5e608
files .rootkeys BitKeeper/etc/ignore Makefile README.CD docs/HOWTOs/Xen-HOWTO docs/Makefile docs/interface.tex docs/user.tex docs/xen_config.html linux-2.4.26-xen-sparse/arch/xen/defconfig-xen0 linux-2.4.26-xen-sparse/arch/xen/drivers/balloon/balloon.c linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/vbd.c linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/evtchn.c linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/common.h linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/control.c linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/interface.c linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/main.c linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c linux-2.4.26-xen-sparse/arch/xen/kernel/evtchn.c linux-2.4.26-xen-sparse/arch/xen/kernel/pci-dma.c linux-2.4.26-xen-sparse/arch/xen/kernel/time.c linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c linux-2.4.26-xen-sparse/arch/xen/mm/hypervisor.c linux-2.4.26-xen-sparse/include/asm-xen/ctrl_if.h linux-2.4.26-xen-sparse/include/asm-xen/evtchn.h linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h linux-2.4.26-xen-sparse/include/asm-xen/multicall.h linux-2.4.26-xen-sparse/include/asm-xen/pci.h linux-2.4.26-xen-sparse/include/asm-xen/proc_cmd.h linux-2.4.26-xen-sparse/include/asm-xen/suspend.h linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h linux-2.4.26-xen-sparse/include/linux/blkdev.h linux-2.4.26-xen-sparse/mkbuildtree linux-2.6.7-xen-sparse/arch/xen/Kconfig linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers linux-2.6.7-xen-sparse/arch/xen/boot/Makefile linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig linux-2.6.7-xen-sparse/arch/xen/i386/Kconfig linux-2.6.7-xen-sparse/arch/xen/i386/Makefile linux-2.6.7-xen-sparse/arch/xen/i386/kernel/Makefile linux-2.6.7-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6.7-xen-sparse/arch/xen/i386/kernel/evtchn.c linux-2.6.7-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6.7-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c linux-2.6.7-xen-sparse/arch/xen/i386/mm/Makefile linux-2.6.7-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.7-xen-sparse/arch/xen/i386/mm/ioremap.c linux-2.6.7-xen-sparse/arch/xen/i386/pci/Makefile linux-2.6.7-xen-sparse/arch/xen/i386/pci/direct.c linux-2.6.7-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile linux-2.6.7-xen-sparse/arch/xen/kernel/ctrl_if.c linux-2.6.7-xen-sparse/arch/xen/kernel/empty.c linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c linux-2.6.7-xen-sparse/drivers/char/mem.c linux-2.6.7-xen-sparse/drivers/xen/Makefile linux-2.6.7-xen-sparse/drivers/xen/blkback/Makefile linux-2.6.7-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6.7-xen-sparse/drivers/xen/blkback/common.h linux-2.6.7-xen-sparse/drivers/xen/blkback/control.c linux-2.6.7-xen-sparse/drivers/xen/blkback/interface.c linux-2.6.7-xen-sparse/drivers/xen/blkback/vbd.c linux-2.6.7-xen-sparse/drivers/xen/blkfront/Kconfig linux-2.6.7-xen-sparse/drivers/xen/blkfront/Makefile linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6.7-xen-sparse/drivers/xen/blkfront/block.h linux-2.6.7-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6.7-xen-sparse/drivers/xen/block/Kconfig linux-2.6.7-xen-sparse/drivers/xen/block/Makefile linux-2.6.7-xen-sparse/drivers/xen/block/block.c linux-2.6.7-xen-sparse/drivers/xen/block/block.h linux-2.6.7-xen-sparse/drivers/xen/block/vbd.c linux-2.6.7-xen-sparse/drivers/xen/console/console.c linux-2.6.7-xen-sparse/drivers/xen/evtchn/evtchn.c linux-2.6.7-xen-sparse/drivers/xen/net/Kconfig linux-2.6.7-xen-sparse/drivers/xen/net/Makefile linux-2.6.7-xen-sparse/drivers/xen/net/network.c linux-2.6.7-xen-sparse/drivers/xen/netback/Makefile linux-2.6.7-xen-sparse/drivers/xen/netback/common.h linux-2.6.7-xen-sparse/drivers/xen/netback/control.c linux-2.6.7-xen-sparse/drivers/xen/netback/interface.c linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c linux-2.6.7-xen-sparse/drivers/xen/netfront/Kconfig linux-2.6.7-xen-sparse/drivers/xen/netfront/Makefile linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6.7-xen-sparse/drivers/xen/privcmd/Makefile linux-2.6.7-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/dma-mapping.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/fixmap.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/hypervisor.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/io.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/pci-functions.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgalloc.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/tlbflush.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/vga.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/xor.h linux-2.6.7-xen-sparse/include/asm-xen/blkif.h linux-2.6.7-xen-sparse/include/asm-xen/ctrl_if.h linux-2.6.7-xen-sparse/include/asm-xen/domain_controller.h linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/arch-x86_32.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/arch-x86_64.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/dom0_ops.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/event_channel.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/hypervisor-if.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/physdev.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/sched_ctl.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/trace.h linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h linux-2.6.7-xen-sparse/include/asm-xen/multicall.h linux-2.6.7-xen-sparse/include/asm-xen/netif.h linux-2.6.7-xen-sparse/include/asm-xen/proc_cmd.h linux-2.6.7-xen-sparse/include/asm-xen/suspend.h linux-2.6.7-xen-sparse/include/asm-xen/xen.h linux-2.6.7-xen-sparse/include/asm-xen/xen_proc.h linux-2.6.7-xen-sparse/mkbuildtree linux-2.6.7-xen-sparse/mm/page_alloc.c tools/Make.defs tools/examples/init.d/xend tools/examples/xmdefaults tools/examples/xmexample tools/examples/xmnetbsd tools/examples/xmnetbsd-example tools/libxc/Makefile tools/libxc/xc_domain.c tools/libxc/xc_io.c tools/libxc/xc_private.h tools/misc/Makefile tools/misc/xend tools/misc/xensv tools/python/logging/logging-0.4.9.2/PKG-INFO tools/python/logging/logging-0.4.9.2/README.txt tools/python/logging/logging-0.4.9.2/default.css tools/python/logging/logging-0.4.9.2/liblogging.tex tools/python/logging/logging-0.4.9.2/logging/__init__.py tools/python/logging/logging-0.4.9.2/logging/config.py tools/python/logging/logging-0.4.9.2/logging/handlers.py tools/python/logging/logging-0.4.9.2/python_logging.html tools/python/logging/logging-0.4.9.2/setup.py tools/python/logging/logging-0.4.9.2/test/app.py tools/python/logging/logging-0.4.9.2/test/critical.ini tools/python/logging/logging-0.4.9.2/test/debug.ini tools/python/logging/logging-0.4.9.2/test/error.ini tools/python/logging/logging-0.4.9.2/test/events.xml tools/python/logging/logging-0.4.9.2/test/log_test.py tools/python/logging/logging-0.4.9.2/test/log_test0.py tools/python/logging/logging-0.4.9.2/test/log_test1.py tools/python/logging/logging-0.4.9.2/test/log_test10.py tools/python/logging/logging-0.4.9.2/test/log_test11.py tools/python/logging/logging-0.4.9.2/test/log_test12.py tools/python/logging/logging-0.4.9.2/test/log_test13.py tools/python/logging/logging-0.4.9.2/test/log_test14.py tools/python/logging/logging-0.4.9.2/test/log_test15.py tools/python/logging/logging-0.4.9.2/test/log_test16.py tools/python/logging/logging-0.4.9.2/test/log_test17.py tools/python/logging/logging-0.4.9.2/test/log_test18.py tools/python/logging/logging-0.4.9.2/test/log_test19.py tools/python/logging/logging-0.4.9.2/test/log_test2.py tools/python/logging/logging-0.4.9.2/test/log_test20.py tools/python/logging/logging-0.4.9.2/test/log_test21.py tools/python/logging/logging-0.4.9.2/test/log_test22.py tools/python/logging/logging-0.4.9.2/test/log_test3.ini tools/python/logging/logging-0.4.9.2/test/log_test3.py tools/python/logging/logging-0.4.9.2/test/log_test4.py tools/python/logging/logging-0.4.9.2/test/log_test5.py tools/python/logging/logging-0.4.9.2/test/log_test6.py tools/python/logging/logging-0.4.9.2/test/log_test7.py tools/python/logging/logging-0.4.9.2/test/log_test8.py tools/python/logging/logging-0.4.9.2/test/log_test9.py tools/python/logging/logging-0.4.9.2/test/logconf.ini tools/python/logging/logging-0.4.9.2/test/logconf.py tools/python/logging/logging-0.4.9.2/test/logging.dtd tools/python/logging/logging-0.4.9.2/test/logging.xml tools/python/logging/logging-0.4.9.2/test/logrecv.ini tools/python/logging/logging-0.4.9.2/test/logrecv.py tools/python/logging/logging-0.4.9.2/test/myapp.py tools/python/logging/logging-0.4.9.2/test/mymodule.py tools/python/logging/logging-0.4.9.2/test/stderr.exp tools/python/logging/logging-0.4.9.2/test/stdout.exp tools/python/logging/logging-0.4.9.2/test/warn.ini tools/python/logging/setup.py tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xu/domain_controller.h tools/python/xen/lowlevel/xu/xu.c tools/python/xen/sv/CreateDomain.py tools/python/xen/sv/Daemon.py tools/python/xen/sv/DomInfo.py tools/python/xen/sv/DomList.py tools/python/xen/sv/GenTabbed.py tools/python/xen/sv/HTMLBase.py tools/python/xen/sv/Main.py tools/python/xen/sv/NodeInfo.py tools/python/xen/sv/Wizard.py tools/python/xen/sv/params.py tools/python/xen/sv/util.py tools/python/xen/util/Brctl.py tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendConsole.py tools/python/xen/xend/XendDmesg.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendLogging.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/XendVnet.py tools/python/xen/xend/server/SrvBase.py tools/python/xen/xend/server/SrvConsole.py tools/python/xen/xend/server/SrvConsoleDir.py tools/python/xen/xend/server/SrvDaemon.py tools/python/xen/xend/server/SrvDmesg.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xend/server/SrvDomainDir.py tools/python/xen/xend/server/SrvNode.py tools/python/xen/xend/server/SrvVnetDir.py tools/python/xen/xend/server/SrvXendLog.py tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/console.py tools/python/xen/xend/server/controller.py tools/python/xen/xend/server/domain.py tools/python/xen/xend/server/netif.py tools/python/xen/xend/server/params.py tools/python/xen/xend/sxp.py tools/python/xen/xm/create.py tools/python/xen/xm/destroy.py tools/python/xen/xm/main.py tools/python/xen/xm/opts.py tools/python/xen/xm/shutdown.py tools/sv/Makefile tools/sv/images/finish.png tools/sv/images/next.png tools/sv/images/pause.png tools/sv/images/previous.png tools/sv/images/reboot.png tools/sv/images/shutdown.png tools/sv/images/unpause.png tools/sv/inc/script.js tools/sv/inc/style.css tools/xentrace/Makefile tools/xfrd/Makefile tools/xfrd/xen_domain.c xen/arch/x86/acpi.c xen/arch/x86/apic.c xen/arch/x86/domain.c xen/arch/x86/irq.c xen/arch/x86/memory.c xen/arch/x86/mpparse.c xen/arch/x86/nmi.c xen/arch/x86/pci-pc.c xen/arch/x86/pdb-stub.c xen/arch/x86/shadow.c xen/arch/x86/smpboot.c xen/arch/x86/traps.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/mm.c xen/common/Makefile xen/common/ac_timer.c xen/common/dom0_ops.c xen/common/dom_mem_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/kernel.c xen/common/keyhandler.c xen/common/memory.c xen/common/page_alloc.c xen/common/physdev.c xen/common/resource.c xen/common/sched_atropos.c xen/common/sched_bvt.c xen/common/sched_fair_bvt.c xen/common/sched_rrobin.c xen/common/schedule.c xen/common/slab.c xen/common/trace.c xen/drivers/char/console.c xen/drivers/char/serial.c xen/drivers/pci/pci.c xen/drivers/pci/setup-bus.c xen/drivers/pci/setup-res.c xen/include/asm-x86/config.h xen/include/asm-x86/domain.h xen/include/asm-x86/io.h xen/include/asm-x86/mm.h xen/include/asm-x86/page.h xen/include/asm-x86/shadow.h xen/include/asm-x86/types.h xen/include/hypervisor-ifs/dom0_ops.h xen/include/hypervisor-ifs/hypervisor-if.h xen/include/hypervisor-ifs/io/blkif.h xen/include/hypervisor-ifs/io/domain_controller.h xen/include/hypervisor-ifs/io/netif.h xen/include/xen/console.h xen/include/xen/mm.h xen/include/xen/pci.h xen/include/xen/sched-if.h xen/include/xen/sched.h xen/include/xen/serial.h xen/include/xen/slab.h xen/include/xen/softirq.h
line diff
     1.1 --- a/.rootkeys	Fri Jul 23 14:11:01 2004 +0000
     1.2 +++ b/.rootkeys	Tue Aug 03 12:28:49 2004 +0000
     1.3 @@ -16,6 +16,7 @@ 3f9e7d60PWZJeVh5xdnk0nLUdxlqEA docs/eps/
     1.4  3f9e7d63lTwQbp2fnx7yY93epWS-eQ docs/figs/dummy
     1.5  3f9e7d564bWFB-Czjv1qdmE6o0GqNg docs/interface.tex
     1.6  3f9e7d58t7N6hjjBMxSn-NMxBphchA docs/style.tex
     1.7 +410144afnSd2Yw68AHGO5gXu2m3y6A docs/user.tex
     1.8  40d6ccbfKKBq8jE0ula4eHEzBiQuDA docs/xen_config.html
     1.9  3f9e7d5bz8BwYkNuwyiPVu7JJG441A docs/xenstyle.cls
    1.10  3f815144d1vI2777JI-dO4wk49Iw7g extras/mini-os/Makefile
    1.11 @@ -55,28 +56,18 @@ 4087cf0da2cROOiybf9A-j4R_yHnjg linux-2.4
    1.12  4087cf0dvXL1PKX23t_LvO1wVPb7OA linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/interface.c
    1.13  4087cf0dkVF3I19gpT1cNubeJgQr7g linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/main.c
    1.14  4087cf0dlv1Dw4MAbeRStPPG8IvPPg linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/vbd.c
    1.15 -40880cc6hHg6s2cPHbqPNQxENefjoQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h
    1.16  4075806dI5kfeMD5RV-DA0PYoThx_w linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile
    1.17  4075806d4-j7vN0Mn0bklI1cRUX1vQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
    1.18  4075806d3fJqqDC1pYYPTZPc575iKg linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c
    1.19  4075806dibjCcfuXv6CINMhxWTw3jQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
    1.20  3e5a4e65G3e2s0ghPMgiJ-gBTUJ0uQ linux-2.4.26-xen-sparse/arch/xen/drivers/console/Makefile
    1.21  3e5a4e656nfFISThfbyXQOA6HN6YHw linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/Makefile
    1.22 -3e5a4e65BXtftInNHUC2PjDfPhdZZA linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c
    1.23  40420a6ebRqDjufoN1WSJvolEW2Wjw linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/Makefile
    1.24 -40420a73Wou6JlsZDiu6YwjYomsm7A linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/evtchn.c
    1.25  4083dc16-Kd5y9psK_yk161sme5j5Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/Makefile
    1.26  4083dc16UmHXxS9g_UFVnkUpN-oP2Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/Makefile
    1.27 -4097ba83pPKYqMS3Gl-PVKIgYU1FZw linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/common.h
    1.28 -4097ba83glWYwQTkbPqgLIlYDOPVLg linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/control.c
    1.29 -4097ba837h2tuiweIWp-voNVzCRI6g linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/interface.c
    1.30 -4087cf0d5dudKw_DecIJgOhLlBF_0Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/main.c
    1.31  405853f2wg7JXZJNltspMwOZJklxgw linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/Makefile
    1.32 -4097ba83Qy2eafeFUhGhm6_4iMIIDw linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h
    1.33  3e5a4e65lWzkiPXsZdzPt2RNnJGG1g linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile
    1.34 -4075806dE5mQwlVUf8-t3YXjiMMWDQ linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c
    1.35  3e5a4e65_hqfuxtGG8IUy6wRM86Ecg linux-2.4.26-xen-sparse/arch/xen/kernel/entry.S
    1.36 -3e5a4e65ibVQmwlOn0j3sVH_j_6hAg linux-2.4.26-xen-sparse/arch/xen/kernel/evtchn.c
    1.37  3e5a4e65Hy_1iUvMTPsNqGNXd9uFpg linux-2.4.26-xen-sparse/arch/xen/kernel/head.S
    1.38  3e5a4e65RMGcuA-HCn3-wNx3fFQwdg linux-2.4.26-xen-sparse/arch/xen/kernel/i386_ksyms.c
    1.39  3e5a4e653U6cELGv528IxOLHvCq8iA linux-2.4.26-xen-sparse/arch/xen/kernel/irq.c
    1.40 @@ -90,10 +81,8 @@ 3e5a4e66N__lUXNwzQ-eADRzK9LXuQ linux-2.4
    1.41  3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ linux-2.4.26-xen-sparse/arch/xen/kernel/traps.c
    1.42  3e5a4e66-9_NczrVMbuQkoSLyXckIw linux-2.4.26-xen-sparse/arch/xen/lib/Makefile
    1.43  3e5a4e6637ZDk0BvFEC-aFQs599-ng linux-2.4.26-xen-sparse/arch/xen/lib/delay.c
    1.44 -3f68905cF5i8-NYpIhGjKmh0y8Gu5g linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c
    1.45  3e5a4e66croVgpcJyJuF2ycQw0HuJw linux-2.4.26-xen-sparse/arch/xen/mm/Makefile
    1.46  3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg linux-2.4.26-xen-sparse/arch/xen/mm/fault.c
    1.47 -3e5a4e668SE9rixq4ahho9rNhLUUFQ linux-2.4.26-xen-sparse/arch/xen/mm/hypervisor.c
    1.48  3e5a4e661gLzzff25pJooKIIWe7IWg linux-2.4.26-xen-sparse/arch/xen/mm/init.c
    1.49  3f0bed43UUdQichXAiVNrjV-y2Kzcg linux-2.4.26-xen-sparse/arch/xen/mm/ioremap.c
    1.50  3e5a4e66qRlSTcjafidMB6ulECADvg linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds
    1.51 @@ -104,37 +93,31 @@ 3e5a4e66rw65CxyolW9PKz4GG42RcA linux-2.4
    1.52  40c9c0c1pPwYE3-4i-oI3ubUu7UgvQ linux-2.4.26-xen-sparse/drivers/scsi/aic7xxx/Makefile
    1.53  3e5a4e669uzIE54VwucPYtGwXLAbzA linux-2.4.26-xen-sparse/fs/exec.c
    1.54  3e5a4e66wbeCpsJgVf_U8Jde-CNcsA linux-2.4.26-xen-sparse/include/asm-xen/bugs.h
    1.55 -4048c0ddxnIa2GpBAVR-mY6mNSdeJg linux-2.4.26-xen-sparse/include/asm-xen/ctrl_if.h
    1.56  3e5a4e66HdSkvIV6SJ1evG_xmTmXHA linux-2.4.26-xen-sparse/include/asm-xen/desc.h
    1.57 -4048c0e0_P2wUTiT6UqgPhn0s7yFcA linux-2.4.26-xen-sparse/include/asm-xen/evtchn.h
    1.58  3e5a4e66SYp_UpAVcF8Lc1wa3Qtgzw linux-2.4.26-xen-sparse/include/asm-xen/fixmap.h
    1.59  406aeeaaQvl4RNtmd9hDEugBURbFpQ linux-2.4.26-xen-sparse/include/asm-xen/highmem.h
    1.60  3e5a4e67YtcyDLQsShhCfQwPSELfvA linux-2.4.26-xen-sparse/include/asm-xen/hw_irq.h
    1.61 -3e5a4e677VBavzM1UZIEcH1B-RlXMA linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h
    1.62  4060044fVx7-tokvNLKBf_6qBB4lqQ linux-2.4.26-xen-sparse/include/asm-xen/io.h
    1.63  3e5a4e673p7PEOyHFm3nHkYX6HQYBg linux-2.4.26-xen-sparse/include/asm-xen/irq.h
    1.64  40d70c240tW7TWArl1VUgIFH2nVO1A linux-2.4.26-xen-sparse/include/asm-xen/keyboard.h
    1.65  3e5a4e678ddsQOpbSiRdy1GRcDc9WA linux-2.4.26-xen-sparse/include/asm-xen/mmu_context.h
    1.66  40d06e5b2YWInUX1Xv9amVANwd_2Xg linux-2.4.26-xen-sparse/include/asm-xen/module.h
    1.67  3f8707e7ZmZ6TxyX0ZUEfvhA2Pb_xQ linux-2.4.26-xen-sparse/include/asm-xen/msr.h
    1.68 -3e7270deQqtGPSnFxcW4AvJZuTUWfg linux-2.4.26-xen-sparse/include/asm-xen/multicall.h
    1.69  3e5a4e67mnQfh-R8KcQCaVo2Oho6yg linux-2.4.26-xen-sparse/include/asm-xen/page.h
    1.70  409ba2e7ZfV5hqTvIzxLtpClnxtIzg linux-2.4.26-xen-sparse/include/asm-xen/pci.h
    1.71  3e5a4e67uTYU5oEnIDjxuaez8njjqg linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h
    1.72  3e5a4e67X7JyupgdYkgDX19Huj2sAw linux-2.4.26-xen-sparse/include/asm-xen/pgtable-2level.h
    1.73  3e5a4e67gr4NLGtQ5CvSLimMYZlkOA linux-2.4.26-xen-sparse/include/asm-xen/pgtable.h
    1.74 -3f108af1qNv8DVSGPv4zpqIU1txCkg linux-2.4.26-xen-sparse/include/asm-xen/proc_cmd.h
    1.75  3e5a4e676uK4xErTBDH6XJREn9LSyg linux-2.4.26-xen-sparse/include/asm-xen/processor.h
    1.76  3e5a4e67AJPjW-zL7p-xWuA6IVeH1g linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
    1.77  3e5a4e68uJz-xI0IBVMD7xRLQKJDFg linux-2.4.26-xen-sparse/include/asm-xen/segment.h
    1.78  3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA linux-2.4.26-xen-sparse/include/asm-xen/smp.h
    1.79 -3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.4.26-xen-sparse/include/asm-xen/suspend.h
    1.80  4062f7e2PzFOUGT0PaE7A0VprTU3JQ linux-2.4.26-xen-sparse/include/asm-xen/synch_bitops.h
    1.81  3e5a4e68mTr0zcp9SXDbnd-XLrrfxw linux-2.4.26-xen-sparse/include/asm-xen/system.h
    1.82  3f1056a9L_kqHcFheV00KbKBzv9j5w linux-2.4.26-xen-sparse/include/asm-xen/vga.h
    1.83 -3f689063nhrIRsMMZjZxMFk7iEINqQ linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h
    1.84  40659defgWA92arexpMGn8X3QMDj3w linux-2.4.26-xen-sparse/include/asm-xen/xor.h
    1.85  3f056927gMHl7mWB89rb73JahbhQIA linux-2.4.26-xen-sparse/include/linux/blk.h
    1.86 +41051ec1m6bJVjZocTG0C0V0O6RsVg linux-2.4.26-xen-sparse/include/linux/blkdev.h
    1.87  401c0590D_kwJDU59X8NyvqSv_Cl2A linux-2.4.26-xen-sparse/include/linux/sched.h
    1.88  40a248afgI0_JKthdYAe8beVfXSTpQ linux-2.4.26-xen-sparse/include/linux/skbuff.h
    1.89  3e5a4e686V0nioX2ZpFf056sgvdiQw linux-2.4.26-xen-sparse/include/linux/sunrpc/debug.h
    1.90 @@ -152,6 +135,7 @@ 40f562372u3A7_kfbYYixPHJJxYUxA linux-2.6
    1.91  40f56237utH41NPukqHksuNf29IC9A linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers
    1.92  40f56237penAAlWVBVDpeQZNFIg8CA linux-2.6.7-xen-sparse/arch/xen/Makefile
    1.93  40f56237JTc60m1FRlUxkUaGSQKrNw linux-2.6.7-xen-sparse/arch/xen/boot/Makefile
    1.94 +40f56237hRxbacU_3PdoAl6DjZ3Jnw linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig
    1.95  40f56237wubfjJKlfIzZlI3ZM2VgGA linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig
    1.96  40f56237Mta0yHNaMS_qtM2rge0qYA linux-2.6.7-xen-sparse/arch/xen/i386/Kconfig
    1.97  40f56238u2CJdXNpjsZgHBxeVyY-2g linux-2.6.7-xen-sparse/arch/xen/i386/Makefile
    1.98 @@ -159,12 +143,12 @@ 40f56238eczveJ86k_4hNxCLRQIF-g linux-2.6
    1.99  40f56238rXVTJQKbBuXXLH52qEArcg linux-2.6.7-xen-sparse/arch/xen/i386/kernel/cpu/Makefile
   1.100  40f562385s4lr6Zg92gExe7UQ4A76Q linux-2.6.7-xen-sparse/arch/xen/i386/kernel/cpu/common.c
   1.101  40f56238XDtHSijkAFlbv1PT8Bhw_Q linux-2.6.7-xen-sparse/arch/xen/i386/kernel/entry.S
   1.102 -40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.7-xen-sparse/arch/xen/i386/kernel/evtchn.c
   1.103  40f56238bnvciAuyzAiMkdzGErYt1A linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S
   1.104  40f58a0d31M2EkuPbG94ns_nOi0PVA linux-2.6.7-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c
   1.105  40faa751_zbZlAmLyQgCXdYekVFdWA linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c
   1.106  40f562382aC3_Gt4RG-4ZsfvDRUg3Q linux-2.6.7-xen-sparse/arch/xen/i386/kernel/irq.c
   1.107  40f56238ue3YRsK52HG7iccNzP1AwQ linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ldt.c
   1.108 +4107adf1cNtsuOxOB4T6paAoY2R2PA linux-2.6.7-xen-sparse/arch/xen/i386/kernel/pci-dma.c
   1.109  40f56238a8iOVDEoostsbun_sy2i4g linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c
   1.110  40f56238YQIJoYG2ehDGEcdTgLmGbg linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c
   1.111  40f56238nWMQg7CKbyTy0KJNvCzbtg linux-2.6.7-xen-sparse/arch/xen/i386/kernel/signal.c
   1.112 @@ -180,29 +164,49 @@ 40f56238a3w6-byOzexIlMgni76Lcg linux-2.6
   1.113  40f56238ILx8xlbywNbzTdv5Zr4xXQ linux-2.6.7-xen-sparse/arch/xen/i386/mm/fault.c
   1.114  40f562383SKvDStdtrvzr5fyCbW4rw linux-2.6.7-xen-sparse/arch/xen/i386/mm/hypervisor.c
   1.115  40f56239xcNylAxuGsQHwi1AyMLV8w linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c
   1.116 +41062ab7CjxC1UBaFhOMWWdhHkIUyg linux-2.6.7-xen-sparse/arch/xen/i386/mm/ioremap.c
   1.117  40f5623906UYHv1rsVUeRc0tFT0dWw linux-2.6.7-xen-sparse/arch/xen/i386/mm/pgtable.c
   1.118 +4107adf12ndy94MidCaivDibJ3pPAg linux-2.6.7-xen-sparse/arch/xen/i386/pci/Makefile
   1.119 +4107adf1WcCgkhsdLTRGX52cOG1vJg linux-2.6.7-xen-sparse/arch/xen/i386/pci/direct.c
   1.120 +4107adf1s5u6249DNPUViX1YNagbUQ linux-2.6.7-xen-sparse/arch/xen/i386/pci/irq.c
   1.121  40f56239zOksGg_H4XD4ye6iZNtoZA linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile
   1.122  40f56239bvOjuuuViZ0XMlNiREFC0A linux-2.6.7-xen-sparse/arch/xen/kernel/ctrl_if.c
   1.123  40f56239pYRq5yshPTkv3ujXKc8K6g linux-2.6.7-xen-sparse/arch/xen/kernel/empty.c
   1.124 +40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
   1.125  40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.7-xen-sparse/arch/xen/kernel/process.c
   1.126  40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c
   1.127 +3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c
   1.128 +4108f5c1WfTIrs0HZFeV39sttekCTw linux-2.6.7-xen-sparse/drivers/char/mem.c
   1.129  40f56239Dp_vMTgz8TEbvo1hjHGc3w linux-2.6.7-xen-sparse/drivers/xen/Makefile
   1.130 -40f56239Sfle6wGv5FS0wjS_HI150A linux-2.6.7-xen-sparse/drivers/xen/block/Kconfig
   1.131 -40f562395atl9x4suKGhPkjqLOXESg linux-2.6.7-xen-sparse/drivers/xen/block/Makefile
   1.132 -40f56239-JNIaTzlviVJohVdoYOUpw linux-2.6.7-xen-sparse/drivers/xen/block/block.c
   1.133 -40f56239y9naBTXe40Pi2J_z3p-d1g linux-2.6.7-xen-sparse/drivers/xen/block/block.h
   1.134 -40f56239BVfPsXBiWQitXgDRtOsiqg linux-2.6.7-xen-sparse/drivers/xen/block/vbd.c
   1.135 +410d0893otFGghmv4dUXDUBBdY5aIA linux-2.6.7-xen-sparse/drivers/xen/blkback/Makefile
   1.136 +4087cf0d1XgMkooTZAiJS6NrcpLQNQ linux-2.6.7-xen-sparse/drivers/xen/blkback/blkback.c
   1.137 +4087cf0dZadZ8r6CEt4fNN350Yle3A linux-2.6.7-xen-sparse/drivers/xen/blkback/common.h
   1.138 +4087cf0dxlh29iw0w-9rxOCEGCjPcw linux-2.6.7-xen-sparse/drivers/xen/blkback/control.c
   1.139 +4087cf0dbuoH20fMjNZjcgrRK-1msQ linux-2.6.7-xen-sparse/drivers/xen/blkback/interface.c
   1.140 +4087cf0dk97tacDzxfByWV7JifUYqA linux-2.6.7-xen-sparse/drivers/xen/blkback/vbd.c
   1.141 +40f56239Sfle6wGv5FS0wjS_HI150A linux-2.6.7-xen-sparse/drivers/xen/blkfront/Kconfig
   1.142 +40f562395atl9x4suKGhPkjqLOXESg linux-2.6.7-xen-sparse/drivers/xen/blkfront/Makefile
   1.143 +40f56239-JNIaTzlviVJohVdoYOUpw linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c
   1.144 +40f56239y9naBTXe40Pi2J_z3p-d1g linux-2.6.7-xen-sparse/drivers/xen/blkfront/block.h
   1.145 +40f56239BVfPsXBiWQitXgDRtOsiqg linux-2.6.7-xen-sparse/drivers/xen/blkfront/vbd.c
   1.146  40f56239fsLjvtD8YBRAWphps4FDjg linux-2.6.7-xen-sparse/drivers/xen/console/Makefile
   1.147  3e5a4e651TH-SXHoufurnWjgl5bfOA linux-2.6.7-xen-sparse/drivers/xen/console/console.c
   1.148  40f56239KYxO0YabhPzCTeUuln-lnA linux-2.6.7-xen-sparse/drivers/xen/evtchn/Makefile
   1.149  40f56239DoibTX6R-ZYd3QTXAB8_TA linux-2.6.7-xen-sparse/drivers/xen/evtchn/evtchn.c
   1.150 -40f56239lrg_Ob0BJ8WBFS1zeg2CYw linux-2.6.7-xen-sparse/drivers/xen/net/Kconfig
   1.151 -40f56239Wd4k_ycG_mFsSO1r5xKdtQ linux-2.6.7-xen-sparse/drivers/xen/net/Makefile
   1.152 -405853f6nbeazrNyEWNHBuoSg2PiPA linux-2.6.7-xen-sparse/drivers/xen/net/network.c
   1.153 +410a9817HEVJvred5Oy_uKH3HFJC5Q linux-2.6.7-xen-sparse/drivers/xen/netback/Makefile
   1.154 +4097ba831lpGeLlPg-bfV8XarVVuoQ linux-2.6.7-xen-sparse/drivers/xen/netback/common.h
   1.155 +4097ba83wvv8yi5P5xugCUBAdb6O-A linux-2.6.7-xen-sparse/drivers/xen/netback/control.c
   1.156 +4097ba83byY5bTSugJGZ1exTxIcMKw linux-2.6.7-xen-sparse/drivers/xen/netback/interface.c
   1.157 +4087cf0dGmSbFhFZyIZBJzvqxY-qBw linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c
   1.158 +40f56239lrg_Ob0BJ8WBFS1zeg2CYw linux-2.6.7-xen-sparse/drivers/xen/netfront/Kconfig
   1.159 +40f56239Wd4k_ycG_mFsSO1r5xKdtQ linux-2.6.7-xen-sparse/drivers/xen/netfront/Makefile
   1.160 +405853f6nbeazrNyEWNHBuoSg2PiPA linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c
   1.161 +4108f5c1ppFXVpQzCOAZ6xXYubsjKA linux-2.6.7-xen-sparse/drivers/xen/privcmd/Makefile
   1.162 +3e5a4e65IUfzzMu2kZFlGEB8-rpTaA linux-2.6.7-xen-sparse/drivers/xen/privcmd/privcmd.c
   1.163  40f56239YAjS52QG2FIAQpHDZAdGHg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/desc.h
   1.164 +4107adf1E5O4ztGHNGMzCCNhcvqNow linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/dma-mapping.h
   1.165  40f5623anSzpuEHgiNmQ56fIRfCoaQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/e820.h
   1.166  40f5623akIoBsQ3KxSB2kufkbgONXQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/fixmap.h
   1.167 -40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/hypervisor.h
   1.168  40f5623aJVXQwpJMOLE99XgvGsfQ8Q linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/io.h
   1.169  40f5623am9BzluYFuV6EQfTd-so3dA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h
   1.170  40f5623adZQ1IZGPxbDXONjyZGYuTA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/io_ports.h
   1.171 @@ -213,6 +217,7 @@ 40f5623an3wOvFKmpIvqSxQfWzklVQ linux-2.6
   1.172  40f5623ayR1vnzfF__htza35a8Ft-g linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/mach_time.h
   1.173  40f5623a4YdRdVzYWJzOOoqe8mnrXA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/mach_timer.h
   1.174  40f5623aDLxmbOtUHvkWztKjAO4EjA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/mach_traps.h
   1.175 +41062ab7HMSSuaUv3_Z4agLpjSO88A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/pci-functions.h
   1.176  40f5623aDMCsWOFO0jktZ4e8sjwvEg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h
   1.177  40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h
   1.178  40f5623aFTyFTR-vdiA-KaGxk5JOKQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h
   1.179 @@ -229,23 +234,17 @@ 40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6
   1.180  40f5623bVdKP7Dt7qm8twu3NcnGNbA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h
   1.181  40f5623bSgGrvrGRpD71K-lIYqaGgg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/timer.h
   1.182  40f5623bc8LKPRO09wY5dGDnY_YCpw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/tlbflush.h
   1.183 +41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/vga.h
   1.184  40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/xor.h
   1.185 -40f5623bqoi4GEoBiiUc6TZk1HjsMg linux-2.6.7-xen-sparse/include/asm-xen/blkif.h
   1.186  40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.7-xen-sparse/include/asm-xen/ctrl_if.h
   1.187 -40f5623bDU2mp4xcHrO0ThodQ9Vs7w linux-2.6.7-xen-sparse/include/asm-xen/domain_controller.h
   1.188  40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
   1.189 -40f5623bSHoOzh_pYP9ovjpUz019Aw linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/arch-x86_32.h
   1.190 -40f5623c1uIAB_OVr5AFdoOac7zxHA linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/arch-x86_64.h
   1.191 -40f5623cEbvTM2QIJ8G6kJoYMLvFpw linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/dom0_ops.h
   1.192 -40f5623cBiv7JBB2bwezpyMwyDGN_w linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/event_channel.h
   1.193 -40f5623cvr4j1BQI1I82_K5wRocUKg linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/hypervisor-if.h
   1.194 -40f5623cfHK4EBsPz922OqMVkZX6OA linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/physdev.h
   1.195 -40f5623cFINsV23lGJNQNbhO5kus_Q linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/sched_ctl.h
   1.196 -40f5623cb_pJrLt3h_nAzvJsjsV0rQ linux-2.6.7-xen-sparse/include/asm-xen/hypervisor-ifs/trace.h
   1.197 +40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h
   1.198  40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6.7-xen-sparse/include/asm-xen/multicall.h
   1.199 -40f5623cTZ80EwjWUBlh44A9F9i_Lg linux-2.6.7-xen-sparse/include/asm-xen/netif.h
   1.200 -40f5623cBiQhPHILVLrl3xa6bDBaRg linux-2.6.7-xen-sparse/include/asm-xen/xen.h
   1.201 +3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.7-xen-sparse/include/asm-xen/proc_cmd.h
   1.202 +3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.6.7-xen-sparse/include/asm-xen/suspend.h
   1.203 +3f689063BoW-HWV3auUJ-OqXfcGArw linux-2.6.7-xen-sparse/include/asm-xen/xen_proc.h
   1.204  40f56a0ddHCSs3501MY4hRf22tctOw linux-2.6.7-xen-sparse/mkbuildtree
   1.205 +410a94a4KT6I6X0LVc7djB39tRDp4g linux-2.6.7-xen-sparse/mm/page_alloc.c
   1.206  40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Make.defs
   1.207  3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
   1.208  401d7e160vaxMBAUSLSicuZ7AQjJ3w tools/examples/Makefile
   1.209 @@ -255,8 +254,9 @@ 40ee75a9xFz6S05sDKu-JCLqyVTkDA tools/exa
   1.210  40ee75a967sxgcRY4Q7zXoVUaJ4flA tools/examples/vif-bridge
   1.211  40e15b7edWEtBf_oe3eBwGKuh1dyzQ tools/examples/vifctl
   1.212  40ee75a93cqxHp6MiYXxxwR5j2_8QQ tools/examples/xend-config.sxp
   1.213 -40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmdefaults
   1.214 -40dfd40auJwNnb8NoiSnRkvZaaXkUg tools/examples/xmnetbsd
   1.215 +41090ec8Pj_bkgCBpg2W7WfmNkumEA tools/examples/xmdefaults
   1.216 +40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmexample
   1.217 +40dfd40auJwNnb8NoiSnRkvZaaXkUg tools/examples/xmnetbsd-example
   1.218  3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/libxc/Makefile
   1.219  3fbba6dc1uU7U3IFeF6A-XEOYF2MkQ tools/libxc/rpm.spec
   1.220  3fbba6dcrNxtygEcgJYAJJ1gCQqfsA tools/libxc/xc.h
   1.221 @@ -308,16 +308,69 @@ 3f5ef5a2dTZP0nnsFoeq2jRf3mWDDg tools/mis
   1.222  3f870808zS6T6iFhqYPGelroZlVfGQ tools/misc/xen_cpuperf.c
   1.223  405eedf6_nnNhFQ1I85lhCkLK6jFGA tools/misc/xencons
   1.224  40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/misc/xend
   1.225 +4107986eMWVdBoz4tXYoOscpN_BCYg tools/misc/xensv
   1.226  4056f5155QYZdsk-1fLdjsZPFTnlhg tools/misc/xensymoops.py
   1.227  40cf2937dqM1jWW87O5OoOYND8leuA tools/misc/xm
   1.228  40c9c468icGyC5RAF1bRKsCXPDCvsA tools/python/Makefile
   1.229 +40ffc44dOwe1CcYXGCkYHdG_NxcccA tools/python/logging/logging-0.4.9.2/PKG-INFO
   1.230 +40ffc44dpqpgqgrnLfR70PsiBc3liA tools/python/logging/logging-0.4.9.2/README.txt
   1.231 +40ffc44ddfLckno4Gvzi3vZxwelZHQ tools/python/logging/logging-0.4.9.2/default.css
   1.232 +40ffc44dKSkczdvpd_x7rWGH4_BRIQ tools/python/logging/logging-0.4.9.2/liblogging.tex
   1.233 +40ffc44d2O51abh5t-1VTZfqhbS1ZQ tools/python/logging/logging-0.4.9.2/logging/__init__.py
   1.234 +40ffc44dT8ustodG0hDjYMCzQ8UCbA tools/python/logging/logging-0.4.9.2/logging/config.py
   1.235 +40ffc44dqbwdCcq6XgwpTvrUrABhhw tools/python/logging/logging-0.4.9.2/logging/handlers.py
   1.236 +40ffc44dVEL3QwvZx_Rcl3d41WxMRQ tools/python/logging/logging-0.4.9.2/python_logging.html
   1.237 +40ffc44dXypIfRTyuTD48cN0o-gAXg tools/python/logging/logging-0.4.9.2/setup.py
   1.238 +40ffc44dqqdkY-Ox_eoPuNmQR0_ebw tools/python/logging/logging-0.4.9.2/test/app.py
   1.239 +40ffc44d9vEJEV_44B-23sJHkT1-gA tools/python/logging/logging-0.4.9.2/test/critical.ini
   1.240 +40ffc44dA5BiSVip8DlCh0DfAaQzbg tools/python/logging/logging-0.4.9.2/test/debug.ini
   1.241 +40ffc44dAuxUnJx7Fu2puaiNheBRkg tools/python/logging/logging-0.4.9.2/test/error.ini
   1.242 +40ffc44dkAIw1gbAzj_XiQyoru93_Q tools/python/logging/logging-0.4.9.2/test/events.xml
   1.243 +40ffc44eZwnQ4wGs1zVaAGsnEoyz6Q tools/python/logging/logging-0.4.9.2/test/log_test.py
   1.244 +40ffc44epbz06Y2nCkuYotfQFY4bJQ tools/python/logging/logging-0.4.9.2/test/log_test0.py
   1.245 +40ffc44eVNdi9lXQOZ2n7yT1DXVQRQ tools/python/logging/logging-0.4.9.2/test/log_test1.py
   1.246 +40ffc44eeqydHPpipbO4oVhRt90v0A tools/python/logging/logging-0.4.9.2/test/log_test10.py
   1.247 +40ffc44eSum6e6Y_sh7hRBHnnRurfw tools/python/logging/logging-0.4.9.2/test/log_test11.py
   1.248 +40ffc44euWPhfnbZw64ShBIrZot84A tools/python/logging/logging-0.4.9.2/test/log_test12.py
   1.249 +40ffc44ekj8Hdg-2SLb0qdqJzGkXdA tools/python/logging/logging-0.4.9.2/test/log_test13.py
   1.250 +40ffc44e5DnmO4OEa54mS8Q9AgP3rg tools/python/logging/logging-0.4.9.2/test/log_test14.py
   1.251 +40ffc44e6uWMQdikNEzYeNeFewGQew tools/python/logging/logging-0.4.9.2/test/log_test15.py
   1.252 +40ffc44eHJ_XsDp2Le-qc96G2n7GdQ tools/python/logging/logging-0.4.9.2/test/log_test16.py
   1.253 +40ffc44eCIq8wSc2UI16VfkLPlW-SQ tools/python/logging/logging-0.4.9.2/test/log_test17.py
   1.254 +40ffc44eHWycPlgiEpt8pE8xYTbUkg tools/python/logging/logging-0.4.9.2/test/log_test18.py
   1.255 +40ffc44eeRuZcrB3tQzfrQnh22NBow tools/python/logging/logging-0.4.9.2/test/log_test19.py
   1.256 +40ffc44e6jQPP-ASsVux4-ERGuDrmQ tools/python/logging/logging-0.4.9.2/test/log_test2.py
   1.257 +40ffc44eNHf6r77J1VCNedKPTufY8Q tools/python/logging/logging-0.4.9.2/test/log_test20.py
   1.258 +40ffc44emS2gplqyEwbcLS43QNrnyA tools/python/logging/logging-0.4.9.2/test/log_test21.py
   1.259 +40ffc44e1Ojd79zACM2KAnXZyO3Nuw tools/python/logging/logging-0.4.9.2/test/log_test22.py
   1.260 +40ffc44ektXcwDnK4h4HqMHFSTA3BA tools/python/logging/logging-0.4.9.2/test/log_test3.ini
   1.261 +40ffc44e8ka-b5_nPYzWn0hXDSagMw tools/python/logging/logging-0.4.9.2/test/log_test3.py
   1.262 +40ffc44eVmFkQt7FaHxspmMV7IZLxw tools/python/logging/logging-0.4.9.2/test/log_test4.py
   1.263 +40ffc44eYJ7tjlUpS5bIF9I8YKK39g tools/python/logging/logging-0.4.9.2/test/log_test5.py
   1.264 +40ffc44eo9GvB3GvC2Aoaxu74ffS4A tools/python/logging/logging-0.4.9.2/test/log_test6.py
   1.265 +40ffc44eajjKGx6tj2nOVuYCfy-PoA tools/python/logging/logging-0.4.9.2/test/log_test7.py
   1.266 +40ffc44eEM_uMfIGRNoxRSP7_jpc7w tools/python/logging/logging-0.4.9.2/test/log_test8.py
   1.267 +40ffc44e4NBnAweOds3owURsSHZKyQ tools/python/logging/logging-0.4.9.2/test/log_test9.py
   1.268 +40ffc44eu_SYlzJ464qUFb8fdSGHsg tools/python/logging/logging-0.4.9.2/test/logconf.ini
   1.269 +40ffc44eTnvlvCSmjgGgfcOBm6SSAw tools/python/logging/logging-0.4.9.2/test/logconf.py
   1.270 +40ffc44egchRehfcmsPX0WdV06yp_w tools/python/logging/logging-0.4.9.2/test/logging.dtd
   1.271 +40ffc44ee9peTFswy96mwgBslmqEvQ tools/python/logging/logging-0.4.9.2/test/logging.xml
   1.272 +40ffc44ekRTWScJDGTe7k2aAp_ltRg tools/python/logging/logging-0.4.9.2/test/logrecv.ini
   1.273 +40ffc44eeQBA_QbbwrucZfYtksuEMA tools/python/logging/logging-0.4.9.2/test/logrecv.py
   1.274 +40ffc44eECASCQD_QL3wJd4dyK2KVg tools/python/logging/logging-0.4.9.2/test/myapp.py
   1.275 +40ffc44eUwKMOAwPTIBq0A8N8b56HQ tools/python/logging/logging-0.4.9.2/test/mymodule.py
   1.276 +40ffc44evyvayldKLSsizMmsDpBtkQ tools/python/logging/logging-0.4.9.2/test/stderr.exp
   1.277 +40ffc44eb-39RIR551oZoTiK11amSw tools/python/logging/logging-0.4.9.2/test/stdout.exp
   1.278 +40ffc44eGvzBilqBZEozKaMHz-HdxA tools/python/logging/logging-0.4.9.2/test/warn.ini
   1.279 +40ffc44eLXLuINsYi8eG0oJ6a2dSRA tools/python/logging/setup.py
   1.280  40c9c469n2RRwCmjWdjdyyVRWKmgWg tools/python/setup.py
   1.281  40dc4076hGpwa8-sWRN0jtXZeQJuKg tools/python/xen/__init__.py
   1.282  40dfd40aMOhnw_cQLve9462UR5yYxQ tools/python/xen/lowlevel/__init__.py
   1.283  3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/python/xen/lowlevel/xc/xc.c
   1.284  40dc4076St6AmPTmQPrtQ6LGHPxGmw tools/python/xen/lowlevel/xu/__init__.py
   1.285 -40dc4076pVeE1kEEWzcUaNZin65kCA tools/python/xen/lowlevel/xu/domain_controller.h
   1.286  40dc4076CwBYRTUQDdbdU1L6KcLgSw tools/python/xen/lowlevel/xu/xu.c
   1.287 +41052eb84_irpx0E9N_kqBp9eoin5g tools/python/xen/sv/CreateDomain.py
   1.288 +4107986egkTAMIHW7n-i4ShvCGWpLQ tools/python/xen/sv/Daemon.py
   1.289  40fcefb2qm13BbRZBydAatOavaS0fQ tools/python/xen/sv/DomInfo.py
   1.290  40fcefb2-RIU8GB67mJMRzybME9bxw tools/python/xen/sv/DomList.py
   1.291  40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/sv/GenTabbed.py
   1.292 @@ -325,7 +378,9 @@ 40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/pyt
   1.293  40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/sv/Main.py
   1.294  40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/sv/NodeInfo.py
   1.295  40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/sv/TabView.py
   1.296 +41052eb8UrgtUkuJPg7oY1tutVQHsg tools/python/xen/sv/Wizard.py
   1.297  40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/sv/__init__.py
   1.298 +4107986e6qN1IdvIDdId0AYFmDMkiQ tools/python/xen/sv/params.py
   1.299  40fcefb4rnaZNjqsBu7A5V2rlLyqRw tools/python/xen/sv/util.py
   1.300  40d8915cyoVA0hJxiBFNymL7YvDaRg tools/python/xen/util/Brctl.py
   1.301  40dfd40aGqGkiopOOgJxSF4iCbHM0Q tools/python/xen/util/__init__.py
   1.302 @@ -345,6 +400,7 @@ 40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/pyt
   1.303  40c9c468bbKq3uC7_fuNUkiMMjArdw tools/python/xen/xend/XendDomainConfig.py
   1.304  40c9c4685ykq87_n1kVUbMr9flx9fg tools/python/xen/xend/XendDomainInfo.py
   1.305  40f50d99YiiaMI1fZBh1VCDFLD57qg tools/python/xen/xend/XendError.py
   1.306 +40ffc44eGsgTEY355E3nN4mPLZHhMQ tools/python/xen/xend/XendLogging.py
   1.307  40c9c46854nsHmuxHQHncKk5rAs5NA tools/python/xen/xend/XendMigrate.py
   1.308  40c9c468M96gA1EYDvNa5w5kQNYLFA tools/python/xen/xend/XendNode.py
   1.309  40c9c4686jruMyZIqiaZRMiMoqMJtg tools/python/xen/xend/XendRoot.py
   1.310 @@ -365,6 +421,7 @@ 40c9c4694eu5759Dehr4Uhakei0EMg tools/pyt
   1.311  40c9c469TaZ83ypsrktmPSHLEZiP5w tools/python/xen/xend/server/SrvRoot.py
   1.312  40c9c469W3sgDMbBJYQdz5wbQweL0Q tools/python/xen/xend/server/SrvServer.py
   1.313  40c9c469aq7oXrE1Ngqf3_lBqL0RoQ tools/python/xen/xend/server/SrvVnetDir.py
   1.314 +4108f181GtRoD1U9TBuJXMfBbGJwdQ tools/python/xen/xend/server/SrvXendLog.py
   1.315  40c9c469Y_aimoOFfUZoS-4eV8gEKg tools/python/xen/xend/server/__init__.py
   1.316  40c9c4692hckPol_EK0EGB16ZyDsyQ tools/python/xen/xend/server/blkif.py
   1.317  40c9c469N2-b3GqpLHHHPZykJPLVvA tools/python/xen/xend/server/channel.py
   1.318 @@ -384,18 +441,26 @@ 40cf2937PSslwBliN1g7ofDy2H_RhA tools/pyt
   1.319  40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/python/xen/xm/shutdown.py
   1.320  40fcefb2K1xqVVT4D-p7nL2GzS4scg tools/sv/Main.rpy
   1.321  40ffbcb66Dj5F-1kCK9BcgSqCWkt1w tools/sv/Makefile
   1.322 +4107c921_OR9NTSv2dKFiLCXxrXoxA tools/sv/images/finish.png
   1.323  40fcefb3wXQMsl9WkgQAVtdrupm4sw tools/sv/images/left-end-highlight.jpg
   1.324  40fcefb3K6ESt5sQhD9aCQRscQIlXQ tools/sv/images/left-end-no-highlight.jpg
   1.325  40fcefb3BUT98zPzW8kAFKuxGdh4XA tools/sv/images/middle-highlight.jpg
   1.326  40fcefb38OTgsUKHBpwshLLIsiIaCA tools/sv/images/middle-no-highlight.jpg
   1.327 +41052eb9SDUqSLGtG6rxk6Ep5fOhFA tools/sv/images/next.png
   1.328  40fcefb32SPtrw36c4S6YGFlLvkKuw tools/sv/images/orb_01.jpg
   1.329  40fcefb3Ok5qkX3iM7ZEPVkRInrUpg tools/sv/images/orb_02.jpg
   1.330 +4104ffca9_GhWOxRE-83uZIad2Z1gg tools/sv/images/pause.png
   1.331 +41052eb9NQqHe_f9-ev1CaA3y5YYZg tools/sv/images/previous.png
   1.332 +41013a82ILk71xLqWFH5ZO5VmOIvBw tools/sv/images/reboot.png
   1.333  40fcefb3JnT5XeKTuVF4yUMGOtuNZg tools/sv/images/right-end-highlight.jpg
   1.334  40fcefb3-DuYOS7noo2W7b_0p7TOUg tools/sv/images/right-end-no-highlight.jpg
   1.335  40fcefb3qNbAZR5FYGPAZ9sFPVMTDA tools/sv/images/seperator-left-highlight.jpg
   1.336  40fcefb3dgsa24WLk_BJeYQHrDLuOg tools/sv/images/seperator-right-highlight.jpg
   1.337  40fcefb3FtiX4Pd2kT8wDlp8u8xRhQ tools/sv/images/seperator.jpg
   1.338 +41013a82sUdUqBv8EoAUJii3gsZ-4g tools/sv/images/shutdown.png
   1.339 +4104ffca-jPHLVOrW0n0VghEXXtKxg tools/sv/images/unpause.png
   1.340  40fcefb3yMSrZvApO9ToIi-iQwnchA tools/sv/images/xen.png
   1.341 +41013a83z27rKvWIxAfUBMVZ1eDCDg tools/sv/inc/script.js
   1.342  40fcefb3zGC9XNBkSwTEobCoq8YClA tools/sv/inc/style.css
   1.343  403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile
   1.344  40a107afN60pFdURgBv9KwEzgRl5mQ tools/xentrace/formats
   1.345 @@ -619,6 +684,9 @@ 404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/inclu
   1.346  3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
   1.347  403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h
   1.348  3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
   1.349 +40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h
   1.350 +40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h
   1.351 +40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/hypervisor-ifs/io/netif.h
   1.352  4051db79512nOCGweabrFWO2M2h5ng xen/include/hypervisor-ifs/physdev.h
   1.353  40589968wmhPmV5-ENbBYmMjnedgKw xen/include/hypervisor-ifs/sched_ctl.h
   1.354  404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/hypervisor-ifs/trace.h
     2.1 --- a/BitKeeper/etc/ignore	Fri Jul 23 14:11:01 2004 +0000
     2.2 +++ b/BitKeeper/etc/ignore	Tue Aug 03 12:28:49 2004 +0000
     2.3 @@ -10,28 +10,45 @@
     2.4  BitKeeper/*/*
     2.5  PENDING/*
     2.6  TAGS
     2.7 +Twisted-1.3.0
     2.8 +Twisted-1.3.0.tar.gz
     2.9 +docs/*.aux
    2.10 +docs/*.log
    2.11 +docs/*.pdf
    2.12 +docs/*.ps
    2.13 +docs/*.toc
    2.14 +docs/interface/*
    2.15 +docs/user/*
    2.16  extras/mini-os/h/hypervisor-ifs
    2.17  install
    2.18  install/*
    2.19  linux-*-xen0/*
    2.20  linux-*-xenU/*
    2.21 +linux-2.4.26-xen0
    2.22 +linux-2.4.26-xenU
    2.23 +linux-2.4.26.tar.gz
    2.24 +linux-2.6.7-xenU
    2.25 +linux-2.6.7.tar.bz2
    2.26  linux-xen-sparse
    2.27  patches/*
    2.28  tools/*/build/lib*/*.py
    2.29 +tools/balloon/balloon
    2.30  tools/misc/miniterm/miniterm
    2.31  tools/misc/xen_cpuperf
    2.32 +tools/web-shutdown.tap
    2.33  tools/xentrace/xentrace
    2.34 +tools/xfrd/xfrd
    2.35  xen/arch/x86/boot/mkelf32
    2.36  xen/drivers/pci/classlist.h
    2.37  xen/drivers/pci/devlist.h
    2.38  xen/drivers/pci/gen-devlist
    2.39 +xen/figlet/figlet
    2.40  xen/include/asm
    2.41  xen/include/hypervisor-ifs/arch
    2.42  xen/include/xen/compile.h
    2.43 -xen/figlet/figlet
    2.44 +xen/tools/elf-reloc
    2.45 +xen/tools/figlet/figlet
    2.46  xen/xen
    2.47  xen/xen-syms
    2.48  xen/xen.*
    2.49 -tools/xfrd/xfrd
    2.50 -xen/tools/elf-reloc
    2.51 -xen/tools/figlet/figlet
    2.52 +xen/common/sched_atropos.c.smh
     3.1 --- a/Makefile	Fri Jul 23 14:11:01 2004 +0000
     3.2 +++ b/Makefile	Tue Aug 03 12:28:49 2004 +0000
     3.3 @@ -8,6 +8,8 @@ SOURCEFORGE_MIRROR := http://heanet.dl.s
     3.4  #http://voxel.dl.sourceforge.net/sourceforge/
     3.5  #http://easynews.dl.sourceforge.net/sourceforge
     3.6  
     3.7 +.PHONY: docs delete-symlinks clean
     3.8 +
     3.9  # a not partcularly useful but safe default target
    3.10  all: make-symlinks
    3.11  	$(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
    3.12 @@ -28,6 +30,8 @@ dist: all
    3.13  LINUX_RELEASE    ?= 2.4
    3.14  LINUX_VER        ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
    3.15  		      sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    3.16 +LINUX26_VER      ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) 2>/dev/null | \
    3.17 +		      sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    3.18  LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
    3.19  LINUX_SRC_PATH   ?= .:..
    3.20  LINUX_SRC        ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
    3.21 @@ -65,9 +69,10 @@ mk-linux-trees: pristine-linux-src
    3.22  	$(RM) -rf $(LINUX_TREES)
    3.23  	echo $(LINUX_SRC) | grep -q bz2 && \
    3.24  	    tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
    3.25 -	mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xenU
    3.26 +	mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
    3.27  	( cd linux-$(LINUX_VER)-xen-sparse ; \
    3.28 -          ./mkbuildtree ../linux-$(LINUX_VER)-xenU )
    3.29 +          ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
    3.30 +	cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
    3.31  endif
    3.32  
    3.33  # configure the specified linux tree
    3.34 @@ -108,23 +113,27 @@ world:
    3.35  	$(MAKE) linux-xenU
    3.36  	$(MAKE) config-xen0
    3.37  	$(MAKE) linux-xen0
    3.38 +	$(MAKE) docs
    3.39  
    3.40  linux26:
    3.41  	$(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
    3.42  	$(MAKE) LINUX_RELEASE=2.6 config-xenU
    3.43  	$(MAKE) LINUX_RELEASE=2.6 linux-xenU
    3.44 +	$(MAKE) LINUX_RELEASE=2.6 config-xen0
    3.45 +	$(MAKE) LINUX_RELEASE=2.6 linux-xen0
    3.46  
    3.47  
    3.48  clean: delete-symlinks
    3.49  	$(MAKE) -C xen clean
    3.50  	$(MAKE) -C tools clean
    3.51 +	$(MAKE) -C docs clean
    3.52  
    3.53  # clean, but blow away linux build tree plus src tar ball
    3.54  mrproper: clean
    3.55  	rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
    3.56  
    3.57  make-symlinks: delete-symlinks
    3.58 -	ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
    3.59 +	ln -sf linux-$(LINUX26_VER)-xen-sparse linux-xen-sparse
    3.60  
    3.61  delete-symlinks:
    3.62  	$(RM) linux-xen-sparse
    3.63 @@ -135,6 +144,12 @@ install-twisted:
    3.64  	tar -zxf Twisted-*.tar.gz
    3.65  	( cd Twisted-* ; python setup.py install )
    3.66  
    3.67 +install-logging: LOGGING=logging-0.4.9.2
    3.68 +install-logging:
    3.69 +	[ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
    3.70 +	tar -zxf $(LOGGING).tar.gz
    3.71 +	( cd $(LOGGING) && python setup.py install )
    3.72 +
    3.73  # handy target to upgrade iptables (use rpm or apt-get in preference)
    3.74  install-iptables:
    3.75  	wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
    3.76 @@ -145,3 +160,6 @@ install-iptables:
    3.77  uninstall:
    3.78  	cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen 
    3.79  	rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
    3.80 +
    3.81 +docs:
    3.82 +	$(MAKE) -C docs all || true
     4.1 --- a/README.CD	Fri Jul 23 14:11:01 2004 +0000
     4.2 +++ b/README.CD	Tue Aug 03 12:28:49 2004 +0000
     4.3 @@ -277,10 +277,6 @@ that may be able to help diagnose proble
     4.4  
     4.5   noht		  Disable Hyperthreading.
     4.6  
     4.7 - ifname=ethXX	  Select which Ethernet interface to use.
     4.8 -
     4.9 - ifname=dummy	  Don't use any network interface.
    4.10 -
    4.11   com1=<baud>,DPS[,<io_base>,<irq>]
    4.12   com2=<baud>,DPS[,<io_base>,<irq>]
    4.13                    Xen supports up to two 16550-compatible serial ports.
    4.14 @@ -317,6 +313,13 @@ that may be able to help diagnose proble
    4.15                    omitting the character, enables auto-switching.
    4.16   [NB. Default for this option is 'a']
    4.17  
    4.18 + nmi=<nmi-error-behaviour>
    4.19 +                  Specify what to do with an NMI parity or I/O error.
    4.20 +                  'nmi=fatal':  Xen prints a diagnostic and then hangs.
    4.21 +                  'nmi=dom0':   Inform DOM0 of the NMI.
    4.22 +                  'nmi=ignore': Ignore the NMI.
    4.23 + [NB. Default is 'dom0' ('fatal' for debug builds).]
    4.24 +
    4.25   dom0_mem=xxx 	  Set the initial amount of memory for domain0.
    4.26  
    4.27   pdb=xxx          Enable the pervasive debugger.  See docs/pdb.txt
     5.1 --- a/docs/HOWTOs/Xen-HOWTO	Fri Jul 23 14:11:01 2004 +0000
     5.2 +++ b/docs/HOWTOs/Xen-HOWTO	Tue Aug 03 12:28:49 2004 +0000
     5.3 @@ -223,10 +223,6 @@ The following is a list of command line 
     5.4  
     5.5   noht             Disable Hyperthreading.
     5.6  
     5.7 - ifname=ethXX     Select which Ethernet interface to use.
     5.8 -
     5.9 - ifname=dummy     Don't use any network interface.
    5.10 -
    5.11   com1=<baud>,DPS[,<io_base>,<irq>]
    5.12   com2=<baud>,DPS[,<io_base>,<irq>]
    5.13                    Xen supports up to two 16550-compatible serial ports.
    5.14 @@ -263,6 +259,13 @@ The following is a list of command line 
    5.15                    omitting the character, enables auto-switching.
    5.16   [NB. Default for this option is 'a']
    5.17  
    5.18 + nmi=<nmi-error-behaviour>
    5.19 +                  Specify what to do with an NMI parity or I/O error.
    5.20 +                  'nmi=fatal':  Xen prints a diagnostic and then hangs.
    5.21 +                  'nmi=dom0':   Inform DOM0 of the NMI.
    5.22 +                  'nmi=ignore': Ignore the NMI.
    5.23 + [NB. Default is 'dom0' ('fatal' for debug builds).]
    5.24 +
    5.25   dom0_mem=xxx     Set the maximum amount of memory for domain0.
    5.26  
    5.27   tbuf_size=xxx    Set the size of the per-cpu trace buffers, in pages
     6.1 --- a/docs/Makefile	Fri Jul 23 14:11:01 2004 +0000
     6.2 +++ b/docs/Makefile	Tue Aug 03 12:28:49 2004 +0000
     6.3 @@ -4,7 +4,8 @@
     6.4  # Xfig and tgif diagrams should be in the fig/ subdirectory.
     6.5  # DOCUMENTS should be a list of the target Postscript files.
     6.6  
     6.7 -DOCUMENTS = interface.ps interface.pdf
     6.8 +DOCUMENTS = interface.ps interface.pdf interface.html user.ps \
     6.9 +	    user.pdf user.html
    6.10  
    6.11  GFX  = $(patsubst %.obj, %.eps, $(wildcard figs/*.obj))
    6.12  GFX += $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
    6.13 @@ -18,6 +19,8 @@ clean:
    6.14  	rm -f .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
    6.15  	rm -f *.ilg *.log *.ind *.toc *.bak core
    6.16  	rm -f figs/*.eps $(DOCUMENTS)
    6.17 +	rm -rf user/
    6.18 +	rm -rf interface/
    6.19  
    6.20  install: $(DOCUMENTS)
    6.21  	mkdir -p $(prefix)/usr/share/doc/xen
    6.22 @@ -39,4 +42,5 @@ install: $(DOCUMENTS)
    6.23  %.eps: %.obj
    6.24  	tgif -print -color -eps $<
    6.25  
    6.26 -
    6.27 +%.html: %.tex
    6.28 +	latex2html --split 0 --nonavigation --noinfo --math $<
     7.1 --- a/docs/interface.tex	Fri Jul 23 14:11:01 2004 +0000
     7.2 +++ b/docs/interface.tex	Tue Aug 03 12:28:49 2004 +0000
     7.3 @@ -259,37 +259,43 @@ table updates and also on remapping memo
     7.4  
     7.5  
     7.6  \chapter{Network I/O}
     7.7 -Since the hypervisor must multiplex network resources, its network subsystem
     7.8 -may be viewed as a virtual network switching element with each domain having
     7.9 -one or more virtual network interfaces to this network.
    7.10  
    7.11 -The hypervisor acts conceptually as an IP router, forwarding each domain's
    7.12 -traffic according to a set of rules.
    7.13 +Virtual network device services are provided by shared memory
    7.14 +communications with a `backend' domain.  From the point of view of
    7.15 +other domains, the backend may be viewed as a virtual ethernet switch
    7.16 +element with each domain having one or more virtual network interfaces
    7.17 +connected to it.
    7.18  
    7.19 -\section{Hypervisor Packet Handling}
    7.20 -The hypervisor is responsible primarily for {\it data-path} operations.
    7.21 +\section{Backend Packet Handling}
    7.22 +The backend driver is responsible primarily for {\it data-path} operations.
    7.23  In terms of networking this means packet transmission and reception.
    7.24  
    7.25 -On the transmission side, the hypervisor needs to perform two key actions:
    7.26 +On the transmission side, the backend needs to perform two key actions:
    7.27  \begin{itemize}
    7.28 -\item {\tt Validation:} A domain is only allowed to emit packets matching a certain
    7.29 -specification; for example, ones in which the source IP address matches
    7.30 -one assigned to the virtual interface over which it is sent. The hypervisor
    7.31 -is responsible for ensuring any such requirements are met, either by checking
    7.32 -or by stamping outgoing packets with prescribed values for certain fields.
    7.33 +\item {\tt Validation:} A domain is only allowed to emit packets
    7.34 +matching a certain specification; for example, ones in which the
    7.35 +source IP address matches one assigned to the virtual interface over
    7.36 +which it is sent. The backend is responsible for ensuring any such
    7.37 +requirements are met, either by checking or by stamping outgoing
    7.38 +packets with prescribed values for certain fields.
    7.39 +
    7.40 +Validation functions can be configured using standard firewall rules
    7.41 +(i.e. IP Tables, in the case of Linux).
    7.42  
    7.43 -\item {\tt Scheduling:} Since a number of domains can share a single ``real'' network 
    7.44 -interface, the hypervisor must mediate access when several domains each 
    7.45 -have packets queued for transmission. Of course, this general scheduling
    7.46 -function subsumes basic shaping or rate-limiting schemes.
    7.47 +\item {\tt Scheduling:} Since a number of domains can share a single
    7.48 +``real'' network interface, the hypervisor must mediate access when
    7.49 +several domains each have packets queued for transmission. Of course,
    7.50 +this general scheduling function subsumes basic shaping or
    7.51 +rate-limiting schemes.
    7.52  
    7.53 -\item {\tt Logging and Accounting:} The hypervisor can be configured with classifier 
    7.54 -rules that control how packets are accounted or logged. For example, 
    7.55 -{\it domain0} could request that it receives a log message or copy of the
    7.56 -packet whenever another domain attempts to send a TCP packet containg a 
    7.57 -SYN.
    7.58 +\item {\tt Logging and Accounting:} The hypervisor can be configured
    7.59 +with classifier rules that control how packets are accounted or
    7.60 +logged. For example, {\it domain0} could request that it receives a
    7.61 +log message or copy of the packet whenever another domain attempts to
    7.62 +send a TCP packet containg a SYN.
    7.63  \end{itemize}
    7.64 -On the recive side, the hypervisor's role is relatively straightforward:
    7.65 +
    7.66 +On the recive side, the backend's role is relatively straightforward:
    7.67  once a packet is received, it just needs to determine the virtual interface(s)
    7.68  to which it must be delivered and deliver it via page-flipping. 
    7.69  
    7.70 @@ -336,42 +342,33 @@ an event to the domain.
    7.71  
    7.72  \section{Virtual Block Devices (VBDs)}
    7.73  
    7.74 -All guest OS disk access goes through the VBD interface. The VBD interface
    7.75 -provides the administrator with the ability to selectively grant domains 
    7.76 -access to portions of block storage devices visible to the system.
    7.77 -
    7.78 -A VBD can also be comprised of a set of extents from multiple storage devices.
    7.79 -This provides the same functionality as a concatenated disk driver.
    7.80 -
    7.81 -\section{Virtual Disks (VDs)}
    7.82 +All guest OS disk access goes through the VBD interface. The VBD
    7.83 +interface provides the administrator with the ability to selectively
    7.84 +grant domains access to portions of block storage devices visible to
    7.85 +the the block backend device (usually domain 0).
    7.86  
    7.87 -VDs are an abstraction built on top of the VBD interface. One can reserve disk
    7.88 -space for use by the VD layer. This space is then managed as a pool of free extents.
    7.89 -The VD tools can automatically allocate collections of extents from this pool to
    7.90 -create ``virtual disks'' on demand. 
    7.91 +VBDs can literally be backed by any block device accessible to the
    7.92 +backend domain, including network-based block devices (iSCSI, *NBD,
    7.93 +etc), loopback devices and LVM / MD devices.
    7.94  
    7.95 -\subsection{Virtual Disk Management}
    7.96 -The VD management code consists of a set of python libraries. It can therefore
    7.97 -be accessed by custom scripts as well as the convenience scripts provided. The
    7.98 -VD database is a SQLite database in /var/db/xen\_vdisks.sqlite.
    7.99 -
   7.100 -The VD scripts and general VD usage are documented in the VBD-HOWTO.txt.
   7.101 +Old (Xen 1.2) virtual disks are not supported under Xen 2.0, since
   7.102 +similar functionality can be achieved using the (more advanced) LVM
   7.103 +system, which is already in widespread use.
   7.104  
   7.105  \subsection{Data Transfer}
   7.106  Domains which have been granted access to a logical block device are permitted
   7.107 -to read and write it directly through the hypervisor, rather than requiring
   7.108 -{\it domain0} to mediate every data access. 
   7.109 -
   7.110 -In overview, the same style of descriptor-ring that is used for network
   7.111 -packets is used here. Each domain has one ring that carries operation requests to the 
   7.112 -hypervisor and carries the results back again. 
   7.113 +to read and write it by shared memory communications with the backend domain. 
   7.114  
   7.115 -Rather than copying data in and out of the hypervisor, we use page pinning to
   7.116 -enable DMA transfers directly between the physical device and the domain's 
   7.117 -buffers. Disk read operations are straightforward; the hypervisor just needs
   7.118 -to know which pages have pending DMA transfers, and prevent the guest OS from
   7.119 -giving the page back to the hypervisor, or to use them for storing page tables.
   7.120 +In overview, the same style of descriptor-ring that is used for
   7.121 +network packets is used here. Each domain has one ring that carries
   7.122 +operation requests to the hypervisor and carries the results back
   7.123 +again.
   7.124  
   7.125 +Rather than copying data, the backend simply maps the domain's buffers
   7.126 +in order to enable direct DMA to them.  The act of mapping the buffers
   7.127 +also increases the reference counts of the underlying pages, so that
   7.128 +the unprivileged domain cannot try to return them to the hypervisor,
   7.129 +install them as page tables, or any other unsafe behaviour.
   7.130  %block API here 
   7.131  
   7.132  \chapter{Privileged operations}
   7.133 @@ -811,9 +808,7 @@ in kilobytes.
   7.134  
   7.135  {\it DOM0\_GETPAGEFRAMEINFO}:
   7.136  
   7.137 -{\it DOM0\_IOPL}:
   7.138 -
   7.139 -{\it DOM0\_MSR}:
   7.140 +{\it DOM0\_IOPL}: set IO privilege level
   7.141  
   7.142  {\it DOM0\_DEBUG}: interactively call pervasive debugger
   7.143  
   7.144 @@ -830,11 +825,13 @@ in kilobytes.
   7.145  
   7.146  {\it DOM0\_PCIDEV\_ACCESS}: modify PCI device access permissions
   7.147  
   7.148 +{\it DOM0\_SCHED\_ID}: get the ID of the current Xen scheduler
   7.149  
   7.150 -\section{network\_op(network\_op\_t *op)} 
   7.151 -update network ruleset
   7.152 +{\it DOM0\_SETDOMAINNAME}: set the name of a domain
   7.153  
   7.154 -\section{ block\_io\_op(block\_io\_op\_t *op)}
   7.155 +{\it DOM0\_SETDOMAININITIALMEM}: set initial memory allocation of a domain
   7.156 +
   7.157 +{\it DOM0\_GETPAGEFRAMEINFO2}:
   7.158  
   7.159  \section{ set\_debugreg(int reg, unsigned long value)}
   7.160  set debug register reg to value
   7.161 @@ -847,7 +844,7 @@ set debug register reg to value
   7.162  \section{ set\_fast\_trap(int idx)}
   7.163   install traps to allow guest OS to bypass hypervisor
   7.164  
   7.165 -\section{ dom\_mem\_op(dom\_mem\_op\_t *op)}
   7.166 +\section{ dom\_mem\_op(unsigned int op, void *pages, unsigned long nr\_pages)}
   7.167   increase or decrease memory reservations for guest OS
   7.168  
   7.169  \section{ multicall(multicall\_entry\_t *call\_list, int nr\_calls)}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/docs/user.tex	Tue Aug 03 12:28:49 2004 +0000
     8.3 @@ -0,0 +1,1253 @@
     8.4 +\documentclass[11pt,twoside,final,openright]{xenstyle}
     8.5 +\usepackage{a4,graphicx,setspace}
     8.6 +\setstretch{1.15}
     8.7 +\input{style.tex}
     8.8 +
     8.9 +\begin{document}
    8.10 +
    8.11 +% TITLE PAGE
    8.12 +\pagestyle{empty}
    8.13 +\begin{center}
    8.14 +\vspace*{\fill}
    8.15 +\includegraphics{eps/xenlogo.eps}
    8.16 +\vfill
    8.17 +\vfill
    8.18 +\vfill
    8.19 +\begin{tabular}{l}
    8.20 +{\Huge \bf Users' manual} \\[4mm]
    8.21 +{\huge Xen v2.0 for x86} \\[80mm]
    8.22 +
    8.23 +{\Large Xen is Copyright (c) 2004, The Xen Team} \\[3mm]
    8.24 +{\Large University of Cambridge, UK} \\[20mm]
    8.25 +{\large Last updated on 30th July, 2004}
    8.26 +\end{tabular}
    8.27 +\vfill
    8.28 +\end{center}
    8.29 +\cleardoublepage
    8.30 +
    8.31 +% TABLE OF CONTENTS
    8.32 +\pagestyle{plain}
    8.33 +\pagenumbering{roman}
    8.34 +{ \parskip 0pt plus 1pt
    8.35 +  \tableofcontents }
    8.36 +\cleardoublepage
    8.37 +
    8.38 +% PREPARE FOR MAIN TEXT
    8.39 +\pagenumbering{arabic}
    8.40 +\raggedbottom
    8.41 +\widowpenalty=10000
    8.42 +\clubpenalty=10000
    8.43 +\parindent=0pt
    8.44 +\renewcommand{\topfraction}{.8}
    8.45 +\renewcommand{\bottomfraction}{.8}
    8.46 +\renewcommand{\textfraction}{.2}
    8.47 +\renewcommand{\floatpagefraction}{.8}
    8.48 +\setstretch{1.15}
    8.49 +
    8.50 +\newcommand{\path}[1]{{\tt #1}}
    8.51 +
    8.52 +\part{Introduction and Tutorial}
    8.53 +\chapter{Introduction}
    8.54 +
    8.55 +{\bf
    8.56 +DISCLAIMER: This documentation is currently under active development
    8.57 +and as such there may be mistakes and omissions --- watch out for
    8.58 +these and please report any you find to the developer's mailing list.
    8.59 +Contributions of material, suggestions and corrections are welcome.
    8.60 +}
    8.61 +
    8.62 +Xen is a { \em paravirtualising } virtual machine monitor (VMM) or
    8.63 +``Hypervisor'' for the x86 processor architecture.  Xen can securely
    8.64 +multiplex heterogeneous virtual machines on a single physical with
    8.65 +near-native performance.  The virtual machine technology facilitates
    8.66 +enterprise-grade functionality, including:
    8.67 +
    8.68 +\begin{itemize}
    8.69 +\item Virtual machines with close to native performance.
    8.70 +\item Live migration of running virtual machines.
    8.71 +\item Excellent hardware support (use unmodified Linux device drivers).
    8.72 +\item Suspend to disk / resume from disk of running virtual machines.
    8.73 +\item Transparent copy on write disks.
    8.74 +\item Sandboxed, restartable device drivers.
    8.75 +\item Pervasive debugging - debug whole OSes, from kernel to applications.
    8.76 +\end{itemize}
    8.77 +
    8.78 +Xen support is available for increasingly many operating systems.  The
    8.79 +following OSs have either been ported already or a port is in
    8.80 +progress:
    8.81 +\begin{itemize}
    8.82 +\item Dragonfly BSD
    8.83 +\item FreeBSD 4.8
    8.84 +\item Linux 2.4
    8.85 +\item Linux 2.6
    8.86 +\item NetBSD 2.0
    8.87 +\item Plan 9
    8.88 +\item Windows XP
    8.89 +\end{itemize}
    8.90 +
    8.91 +Right now, Linux 2.4 and 2.6 are available for on Xen 2.0.  NetBSD
    8.92 +port will be updated to run on Xen 2.0, hopefully in time for the Xen
    8.93 +2.0 release.  It is intended that Xen support be integrated into the
    8.94 +official releases of Linux 2.6, NetBSD 2.0, FreeBSD and Dragonfly BSD.
    8.95 +
    8.96 +Even running multiple copies of Linux can be very useful, providing a
    8.97 +means of containing faults to one OS image, providing performance
    8.98 +isolation between the various OS instances and trying out multiple
    8.99 +distros.
   8.100 +
   8.101 +The Windows XP port is only available to those who have signed the
   8.102 +Microsoft Academic Source License.
   8.103 +
   8.104 +Possible usage scenarios for Xen include:
   8.105 +\begin{description}
   8.106 +\item [Kernel development] test and debug kernel modifications in a
   8.107 +      sandboxed virtual machine --- no need for a separate test
   8.108 +      machine
   8.109 +\item [Multiple OS Configurations] run multiple operating systems
   8.110 +      simultaneously, for instance for compatibility or QA purposes
   8.111 +\item [Server consolidation] move multiple servers onto one box,
   8.112 +      provided performance and fault isolation at virtual machine
   8.113 +      boundaries
   8.114 +\item [Cluster computing] improve manageability and efficiency by
   8.115 +      running services in virtual machines, isolated from
   8.116 +      machine-specifics and load balance using live migration
   8.117 +\item [High availability computing] run device drivers in sandboxed
   8.118 +      domains for increased robustness
   8.119 +\item [Hardware support for custom OSes] export drivers from a
   8.120 +      mainstream OS (e.g. Linux) with good hardware support
   8.121 +      to your custom OS, avoiding the need for you to port existing
   8.122 +      drivers to achieve good hardware support
   8.123 +\end{description}
   8.124 +
   8.125 +\section{Structure}
   8.126 +
   8.127 +\subsection{High level}
   8.128 +
   8.129 +A Xen system has multiple layers.  The lowest layer is Xen itself ---
   8.130 +the most privileged piece of code in the system.  On top of Xen run
   8.131 +guest operating system kernels.  These are scheduled pre-emptively by
   8.132 +Xen.  On top of these run the applications of the guest OSs.  Guest
   8.133 +OSs are responsible for scheduling their own applications within the
   8.134 +time allotted to them by Xen.
   8.135 +
   8.136 +One of the domains --- { \em Domain 0 } --- is privileged.  It is
   8.137 +started by Xen at system boot and is responsible for initialising and
   8.138 +managing the whole machine.  Domain 0 builds other domains and manages
   8.139 +their virtual devices.  It also performs suspend, resume and
   8.140 +migration of other virtual machines.  Where it is used, the X server
   8.141 +is also run in domain 0.
   8.142 +
   8.143 +Within Domain 0, a process called ``Xend'' runs to manage the system.
   8.144 +Xend is responsible for managing virtual machines and providing access
   8.145 +to their consoles.  Commands are issued to Xend over an HTTP
   8.146 +interface, either from a command-line tool or from a web browser.
   8.147 +
   8.148 +XXX need diagram(s) here to make this make sense
   8.149 +
   8.150 +\subsection{Paravirtualisation}
   8.151 +
   8.152 +Paravirtualisation allows very high performance virtual machine
   8.153 +technology, even on architectures (like x86) which are traditionally
   8.154 +hard to virtualise.
   8.155 +
   8.156 +Paravirtualisation requires guest operating systems to be { \em ported
   8.157 +} to run on the VMM.  This process is similar to a port of an
   8.158 +operating system to a new hardware platform.  Although operating
   8.159 +system kernels must explicitly support Xen in order to run in a
   8.160 +virtual machine, { \em user space applications and libraries
   8.161 +do not require modification }.
   8.162 +
   8.163 +\section{Hardware Support}
   8.164 +
   8.165 +Xen currently runs on the x86 architecture, but could in principle be
   8.166 +ported to others. In fact, it would have been rather easier to write
   8.167 +Xen for pretty much any other architecture as x86 is particularly
   8.168 +tricky to handle. A good description of Xen's design, implementation
   8.169 +and performance is contained in the October 2003 SOSP paper, available
   8.170 +at:\\
   8.171 +{\tt http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf}\\
   8.172 +Work to port Xen to x86\_64 and IA64 is currently underway.
   8.173 +
   8.174 +Xen is targetted at server-class machines, and the current list of
   8.175 +supported hardware very much reflects this, avoiding the need for us
   8.176 +to write drivers for "legacy" hardware. It is likely that some desktop
   8.177 +chipsets will fail to work properly with the default Xen
   8.178 +configuration: specifying {\tt noacpi} or {\tt ignorebiostables} when
   8.179 +booting Xen may help in these cases.
   8.180 +
   8.181 +Xen requires a ``P6'' or newer processor (e.g. Pentium Pro, Celeron,
   8.182 +Pentium II, Pentium III, Pentium IV, Xeon, AMD Athlon, AMD Duron).
   8.183 +Multiprocessor machines are supported, and we also have basic support
   8.184 +for HyperThreading (SMT), although this remains a topic for ongoing
   8.185 +research. We're also working on an x86\_64 port (though Xen should
   8.186 +already run on these systems just fine in 32-bit mode).
   8.187 +
   8.188 +Xen can currently use up to 4GB of memory.  It is possible for x86
   8.189 +machines to address up to 64GB of physical memory but (unless an
   8.190 +external developer volunteers) there are no plans to support these
   8.191 +systems.  The x86\_64 port is the planned route to supporting more
   8.192 +than 4GB of memory.
   8.193 +
   8.194 +In contrast to previous Xen versions, in Xen 2.0 device drivers run
   8.195 +within a privileged guest OS rather than within Xen itself. This means
   8.196 +that we should be compatible with the majority of device hardware
   8.197 +supported by Linux.  The default XenLinux build contains support for
   8.198 +relatively modern server-class network and disk hardware, but you can
   8.199 +add suppport for other hardware by configuring your XenLinux kernel in
   8.200 +the normal way (e.g. \verb_# make ARCH=xen xconfig_).
   8.201 +
   8.202 +\section{History}
   8.203 +
   8.204 +
   8.205 +``Xen'' is a Virtual Machine Monitor (VMM) originally developed by the
   8.206 +Systems Research Group of the University of Cambridge Computer
   8.207 +Laboratory, as part of the UK-EPSRC funded XenoServers project.
   8.208 +
   8.209 +The XenoServers project aims to provide a ``public infrastructure for
   8.210 +global distributed computing'', and Xen plays a key part in that,
   8.211 +allowing us to efficiently partition a single machine to enable
   8.212 +multiple independent clients to run their operating systems and
   8.213 +applications in an environment providing protection, resource
   8.214 +isolation and accounting.  The project web page contains further
   8.215 +information along with pointers to papers and technical reports:
   8.216 +{\tt http://www.cl.cam.ac.uk/xeno}
   8.217 +
   8.218 +Xen has since grown into a project in its own right, enabling us to
   8.219 +investigate interesting research issues regarding the best techniques
   8.220 +for virtualizing resources such as the CPU, memory, disk and network.
   8.221 +The project has been bolstered by support from Intel Research
   8.222 +Cambridge, and HP Labs, who are now working closely with us. We're
   8.223 +also in receipt of support from Microsoft Research Cambridge to port
   8.224 +Windows XP to run on Xen.
   8.225 +
   8.226 +Xen was first described in the 2003 paper at SOSP \\
   8.227 +({\tt http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf}).
   8.228 +The first public release of Xen (1.0) was made in October 2003.  Xen
   8.229 +was developed as a research project by the University of Cambridge
   8.230 +Computer Laboratory (UK).  Xen was the first Virtual Machine Monitor
   8.231 +to make use of {\em paravirtualisation} to achieve near-native
   8.232 +performance virtualisation of commodity operating systems.  Since
   8.233 +then, Xen has been extensively developed and is now used in production
   8.234 +scenarios on multiple sites.
   8.235 +
   8.236 +Xen 2.0 is the latest release, featuring greatly enhanced hardware
   8.237 +support, configuration flexibility, useability and a larger complement
   8.238 +of supported operating systems.  We think that Xen has the potential
   8.239 +to become {\em the} definitive open source virtualisation solution and
   8.240 +will work to conclusively achieve that position.
   8.241 +
   8.242 +
   8.243 +\chapter{Installation}
   8.244 +
   8.245 +The Xen distribution includes three main components: Xen itself,
   8.246 +utilities to convert a standard Linux tree to run on Xen and the
   8.247 +userspace tools required to operate a Xen-based system.
   8.248 +
   8.249 +This manual describes how to install the Xen 2.0 distribution from
   8.250 +source.  Alternatively, there may be packages available for your
   8.251 +operating system distribution.
   8.252 +
   8.253 +\section{Prerequisites}
   8.254 +\label{sec:prerequisites}
   8.255 +\begin{itemize}
   8.256 +\item A working installation of your favourite Linux distribution.
   8.257 +\item A working installation of the GRUB bootloader.
   8.258 +\item An installation of Twisted v1.3 or above (see {\tt
   8.259 +http://www.twistedmatrix.com}).  There may be a package available for
   8.260 +your distribution; alternatively it can be installed by running {\tt \#
   8.261 +make install-twisted} in the root of the Xen source tree.
   8.262 +\item The Linux bridge control tools (see {\tt
   8.263 +http://bridge.sourceforge.net}).  There may be a packages of these
   8.264 +tools available for your distribution.
   8.265 +\item Linux IP Routing Tools
   8.266 +\item make
   8.267 +\item python-dev
   8.268 +\item gcc
   8.269 +\item zlib-dev
   8.270 +\item libcurl
   8.271 +\item python2.3-pycurl
   8.272 +\item python2.3-twisted
   8.273 +\end{itemize}
   8.274 +
   8.275 +\section{Optional}
   8.276 +\begin{itemize}
   8.277 +\item The Python logging package (see {\tt http://www.red-dove.com/})
   8.278 +for additional Xend logging functionality.
   8.279 +\end{itemize}
   8.280 +
   8.281 +\section{Install Bitkeeper (Optional)}
   8.282 +
   8.283 +To fetch a local copy, first download the BitKeeper tools at: \\ {\tt
   8.284 +http://www.bitmover.com/download }
   8.285 +
   8.286 +The BitKeeper install program is designed to be run with X.  If X is
   8.287 +not available, you can specify the install directory on the command
   8.288 +line.
   8.289 +
   8.290 +\section{Download the Xen source code}
   8.291 +
   8.292 +\subsection{Using Bitkeeper}
   8.293 +
   8.294 +The public master BK repository for the 2.0 release lives at: \\
   8.295 +{\tt bk://xen.bkbits.net/xeno-unstable.bk}.  You can use Bitkeeper to
   8.296 +download it and keep it updated with the latest features and fixes.
   8.297 +
   8.298 +Change to the directory in which you want to put the source code, then
   8.299 +run:
   8.300 +\begin{verbatim}
   8.301 +# bk clone bk://xen.bkbits.net/xeno-unstable.bk
   8.302 +\end{verbatim}
   8.303 +
   8.304 +Under your current directory, a new directory named 'xeno-unstable.bk'
   8.305 +has been created, which contains all the source code for the Xen
   8.306 +hypervisor and the Xen tools.  The directory also contains `sparse'
   8.307 +Linux source trees, containing only the files that differ between
   8.308 +XenLinux and standard Linux.
   8.309 +
   8.310 +Once you have cloned the repository, you can update to the newest
   8.311 +changes to the repository by running:
   8.312 +\begin{verbatim}
   8.313 +# cd xeno-unstable.bk # to change into the local repository
   8.314 +# bk pull             # to update the repository
   8.315 +\end{verbatim}
   8.316 +
   8.317 +\subsection{Without Bitkeeper}
   8.318 +
   8.319 +The Xen source tree is also available in gzipped tarball form from the
   8.320 +Xen downloads page:\\
   8.321 +{\tt http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads.html}.
   8.322 +Prebuilt tarballs are also available but are very large.
   8.323 +
   8.324 +\section{The distribution}
   8.325 +
   8.326 +The Xen source code repository is structured as follows:
   8.327 +
   8.328 +\begin{description}
   8.329 +\item[\path{tools/}] Xen node controller daemon (Xend), command line tools, 
   8.330 +  control libraries
   8.331 +\item[\path{xen/}] The Xen hypervisor itself.
   8.332 +\item[\path{linux-2.4.26-xen/}] Linux 2.4 support for Xen
   8.333 +\item[\path{linux-2.6.7-xen/}] Linux 2.6 support for Xen
   8.334 +\item[\path{doc/}] various documentation files for users and developers
   8.335 +\item[\path{extras/}] currently this contains the Mini OS, aimed at developers
   8.336 +\end{description}
   8.337 +
   8.338 +\section{Build and install}
   8.339 +
   8.340 +The Xen makefile includes a target ``world'' that will do the
   8.341 +following:
   8.342 +
   8.343 +\begin{itemize}
   8.344 +\item Build Xen
   8.345 +\item Build the control tools, including Xend
   8.346 +\item Download the ebtables patch for Linux 2.4
   8.347 +\item Download (if necessary) and unpack the Linux 2.4 source code,
   8.348 +      and patch it for use with Xen
   8.349 +\item Build a Linux kernel to use in domain 0 and a smaller
   8.350 +      unprivileged kernel, which can optionally be used for
   8.351 +      unprivileged virtual machines.
   8.352 +\end{itemize}
   8.353 +
   8.354 +Inspect the Makefile if you want to see what goes on during a
   8.355 +build. Building Xen and the tools is straightforward, but XenLinux is
   8.356 +more complicated. The makefile needs a `pristine' linux kernel tree
   8.357 +which it will then add the Xen architecture files to. You can tell the
   8.358 +makefile the location of the appropriate linux compressed tar file by
   8.359 +setting the LINUX\_SRC environment variable, e.g. \\
   8.360 +\verb!# LINUX_SRC=/tmp/linux-2.4.26.tar.gz make world! \\ or by
   8.361 +placing the tar file somewhere in the search path of {\tt LINUX\_SRC\_PATH}
   8.362 +which defaults to ``{\tt .:..}". If the makefile can't find a suitable
   8.363 +kernel tar file it attempts to download it from kernel.org (this won't
   8.364 +work if you're behind a firewall).
   8.365 +
   8.366 +After untaring the pristine kernel tree, the makefile uses the {\tt
   8.367 +mkbuildtree} script to add the Xen patches the kernel. It then builds
   8.368 +two different XenLinux images, one with a ``-xen0'' extension which
   8.369 +contains hardware device drivers and is intended to be used in the
   8.370 +first virtual machine (``domain 0''), and one with a ``-xenU''
   8.371 +extension that just contains virtual-device drivers.
   8.372 +
   8.373 +The procedure is similar to build the Linux 2.6 port: \\
   8.374 +\verb!# LINUX_SRC=/path/to/linux2.6/source make linux26!
   8.375 +
   8.376 +In both cases, if you have an SMP machine you may wish to give the
   8.377 +{\tt '-j4'} argument to make to get a parallel build.
   8.378 +
   8.379 +The files produced by the build process are stored under the
   8.380 +\path{install/} directory.  To install them in their default
   8.381 +locations, do: \\
   8.382 +\verb_# make install_\\
   8.383 +
   8.384 +Alternatively, users with special installation requirements may wish
   8.385 +to install them manually by copying file to their appropriate
   8.386 +destinations.
   8.387 +
   8.388 +Take a look at the files in \path{install/boot/}:
   8.389 +\begin{itemize}
   8.390 +\item \path{install/boot/xen.gz} The Xen 'kernel'
   8.391 +\item \path{install/boot/vmlinuz-2.4.26-xen0}  Domain 0 XenLinux kernel
   8.392 +\item \path{install/boot/vmlinuz-2.4.26-xenU}  Unprivileged XenLinux kernel
   8.393 +\end{itemize}
   8.394 +
   8.395 +The difference between the two Linux kernels that are built is due to
   8.396 +the configuration file used for each. The "U" suffixed unprivileged
   8.397 +version doesn't contain any of the physical hardware device drivers
   8.398 +--- it is 30\% smaller and hence may be preferred for your
   8.399 +non-privileged domains.  The ``0'' suffixed privileged version can be
   8.400 +used to boot the system, as well as in driver domains and unprivileged
   8.401 +domains.
   8.402 +
   8.403 +The \path{install/boot} directory will also contain the config files
   8.404 +used for building the XenLinux kernels, and also versions of Xen and
   8.405 +XenLinux kernels that contain debug symbols (\path{xen-syms} and
   8.406 +\path{vmlinux-syms-2.4.26-xen0}) which are essential for interpreting crash
   8.407 +dumps.  Retain these files as the developers may wish to see them if
   8.408 +you post on the mailing list.
   8.409 +
   8.410 +\section{Configuration}
   8.411 +
   8.412 +\subsection{GRUB Configuration}
   8.413 +
   8.414 +An entry should be added to \path{grub.conf} (often found under
   8.415 +\path{/boot/} or \path{/boot/grub/}) to allow Xen / XenLinux to boot.
   8.416 +This file is sometimes called \path{menu.lst}, depending on your
   8.417 +distribution.  The entry should look something like the following:
   8.418 +
   8.419 +\begin{verbatim}
   8.420 +title Xen 2.0 / XenoLinux 2.4.26
   8.421 +  kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1
   8.422 +  module /boot/xenolinux.gz root=/dev/sda4 ro console=tty0 console=ttyS0
   8.423 +\end{verbatim}
   8.424 +
   8.425 +The first line of the configuration (kernel...) tells GRUB where to
   8.426 +find Xen itself and what boot parameters should be passed to it.  The
   8.427 +second line of the configuration describes the location of the
   8.428 +XenoLinux kernel that Xen should start and the parameters that should
   8.429 +be passed to it.
   8.430 +
   8.431 +As always when installing a new kernel, it is recommended that you do
   8.432 +not remove the original contents of \path{grub.conf} --- you may want
   8.433 +to boot up with your old Linux kernel in future, particularly if you
   8.434 +have problems.
   8.435 +
   8.436 +\subsection{Serial Console}
   8.437 +
   8.438 +In order to configure serial console output, it is necessary to add a
   8.439 +line into \path{/etc/inittab}.  The XenLinux console driver is
   8.440 +designed to make this procedure the same as configuring a normal
   8.441 +serial console.  Add the line:
   8.442 +
   8.443 +{\tt c:2345:respawn:/sbin/mingetty ttyS0}
   8.444 +
   8.445 +\section{Test the new install}
   8.446 +
   8.447 +It should now be possible to restart the system and use Xen.  Reboot
   8.448 +as usual but choose the new Xen option when the Grub screen appears.
   8.449 +
   8.450 +What follows should look much like a conventional Linux boot.  The
   8.451 +first portion of the output comes from Xen itself, supplying low level
   8.452 +information about itself and the machine it is running on.  The
   8.453 +following portion of the output comes from XenLinux itself.
   8.454 +
   8.455 +You may see some errors during the XenLinux boot.  These are not
   8.456 +necessarily anything to worry about --- they may result from kernel
   8.457 +configuration differences between your XenLinux kernel and the one you
   8.458 +usually use.
   8.459 +
   8.460 +When the boot completes, you should be able to log into your system as
   8.461 +usual.  If you are unable to log in to your system running Xen, you
   8.462 +should still be able to reboot with your normal Linux kernel.
   8.463 +
   8.464 +
   8.465 +\chapter{Starting a domain}
   8.466 +
   8.467 +The first step in creating a new domain is to prepare a root
   8.468 +filesystem for it to boot off.  Typically, this might be stored in a
   8.469 +normal partition, a disk file and LVM volume, or on an NFS server.
   8.470 +
   8.471 +A simple way to do this is simply to boot from your standard OS
   8.472 +install CD and install the distribution into another partition on your
   8.473 +hard drive.
   8.474 +
   8.475 +{\em N.b } you can boot with Xen and XenLinux without installing any
   8.476 +special userspace tools but will need to have the prerequisites
   8.477 +described in Section~\ref{sec:prerequisites} and the Xen control tools
   8.478 +are installed before you proceed.
   8.479 +
   8.480 +\section{From the web interface}
   8.481 +
   8.482 +Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv} for
   8.483 +more details) using the command: \\
   8.484 +\verb_# xensv start_ \\
   8.485 +This will also start Xend (see Chapter~\ref{cha:xend} for more information).
   8.486 +
   8.487 +The domain management interface will then be available at {\tt
   8.488 +http://your\_machine:8080/}.  This provides a user friendly wizard for
   8.489 +starting domains and functions for managing running domains.
   8.490 +
   8.491 +\section{From the command line}
   8.492 +
   8.493 +Full details of the {\tt xm} tool are found in Chapter~\ref{cha:xm}.
   8.494 +
   8.495 +This example explains how to use the \path{xmdefaults} file.  If you
   8.496 +require a more complex setup, you will want to write a custom
   8.497 +configuration file --- details of the configuration file formats are
   8.498 +included in Chapter~\ref{cha:config}.
   8.499 +
   8.500 +The \path{xmdefaults} file is a template description that is intended
   8.501 +to be reused for multiple virtual machines.  Setting the value of the
   8.502 +{\tt vmid} variable fills in parts of this template.
   8.503 +
   8.504 +\subsection{Editing \path{xmdefaults}}
   8.505 +
   8.506 +At minimum, you should edit the following variables in \path{xmdefaults}:
   8.507 +
   8.508 +\begin{description}
   8.509 +\item[kernel] Set this to the path of the kernel you compiled for use
   8.510 +              with Xen. [e.g. {\tt kernel =
   8.511 +              '/root/xeno-unstable.bk/install/boot/vmlinuz-2.4.26-xenU'}]
   8.512 +\item[memory] Set this to the size of the domain's memory in
   8.513 +megabytes. [e.g. {\tt memory = 64 } ]
   8.514 +\item[disk] Set the first entry in this list to calculate the offset
   8.515 +of the domain's root partition, based on the domain ID.  Set the
   8.516 +second to the location of \path{/usr} (if you are sharing it between
   8.517 +domains). [i.e. {\tt disk = ['phy:your\_hard\_drive\%d,sda1,w' \%
   8.518 +(base\_partition\_number + vmid), 'phy:your\_usr\_partition,sda6,r' ]}
   8.519 +\item[dhcp] Uncomment the dhcp variable, so that the domain will
   8.520 +receive its IP address from a DHCP server. [i.e. {\tt dhcp=''dhcp''}]
   8.521 +\end{description}
   8.522 +
   8.523 +You may also want to edit the {\bf vif} variable in order to choose
   8.524 +the MAC address of the virtual ethernet interface yourself.  For
   8.525 +example: \\ \verb_vif = [`mac=00:06:AA:F6:BB:B3']_\\ If you do not set
   8.526 +this variable, Xend will automatically generate a random MAC address
   8.527 +from an unused range.
   8.528 +
   8.529 +\subsection{Starting the domain}
   8.530 +
   8.531 +The {\tt xm} tool provides a variety of commands for managing domains.
   8.532 +Use the {\tt create} command to start new domains.  To start the
   8.533 +virtual machine with virtual machine ID 1.
   8.534 +
   8.535 +\begin{verbatim}
   8.536 +# xm create -c vmid=1
   8.537 +\end{verbatim}
   8.538 +
   8.539 +The {\tt -c} switch causes {\tt xm} to turn into the domain's console
   8.540 +after creation.  The {\tt vmid=1} sets the {\tt vmid} variable used in
   8.541 +the {\tt xmdefaults} file.  The tool uses the
   8.542 +\path{/etc/xen/xmdefaults} file, since no custom configuration file
   8.543 +was specified on the command line.
   8.544 +
   8.545 +\chapter{Domain management tasks}
   8.546 +
   8.547 +The previous chapter described a simple example of how to configure
   8.548 +and start a domain.  This chapter summarises the tools available to
   8.549 +manage running domains.
   8.550 +
   8.551 +\section{Command line management}
   8.552 +
   8.553 +Command line management tasks are also performed using the {\tt xm}
   8.554 +tool.  For online help for the commands available, type:\\
   8.555 +\verb_# xm help_
   8.556 +
   8.557 +\subsection{Basic management commands}
   8.558 +
   8.559 +The most important {\tt xm} commands are: \\
   8.560 +\verb_# xm list_ : Lists all domains running. \\
   8.561 +\verb_# xm consoles_ : Gives information about the domain consoles. \\
   8.562 +\verb_# xm console_: open a console to a domain.
   8.563 +e.g. \verb_# xm console 1_ (open console to domain 1)
   8.564 +
   8.565 +\subsection{\tt xm list}
   8.566 +
   8.567 +The output of {\tt xm list} is in rows of the following format:\\
   8.568 +\verb_domid name memory cpu state cputime_
   8.569 +
   8.570 +\begin{description}
   8.571 +\item[domid] The number of the domain ID this virtual machine is running in.
   8.572 +\item[name]  The descriptive name of the virtual machine.
   8.573 +\item[memory] Memory size in megabytes.
   8.574 +\item[cpu]   The CPU this domain is running on.
   8.575 +\item[state] Domain state consists of 5 fields:
   8.576 +  \begin{description}
   8.577 +  \item[r] running
   8.578 +  \item[b] blocked
   8.579 +  \item[p] paused
   8.580 +  \item[s] shutdown
   8.581 +  \item[c] crashed
   8.582 +  \end{description}
   8.583 +\item[cputime] How much CPU time (in seconds) the domain has used so far.
   8.584 +\end{description}
   8.585 +
   8.586 +The {\tt xm list} command also supports a long output format when the
   8.587 +{\tt -l} switch is used.  This outputs the fulls details of the
   8.588 +running domains in Xend's SXP configuration format.
   8.589 +
   8.590 +\chapter{Other kinds of storage}
   8.591 +
   8.592 +It is possible to use any Linux block device to store virtual machine
   8.593 +disk images.  This chapter covers some of the possibilities; note that
   8.594 +it is also possible to use network-based block devices and other
   8.595 +unconventional block devices.
   8.596 +
   8.597 +\section{File-backed virtual block devices}
   8.598 +
   8.599 +It is possible to use a file in Domain 0 as the primary storage for a
   8.600 +virtual machine.  As well as being convenient, this also has the
   8.601 +advantage that the virtual block device will be {\em sparse} --- space
   8.602 +will only really be allocated as parts of the file are used.  So if a
   8.603 +virtual machine uses only half its disk space then the file really
   8.604 +takes up a half of the size allocated.
   8.605 +
   8.606 +For example, to create a 2GB sparse file-backed virtual block device
   8.607 +(actually only consumes 1KB of disk):
   8.608 +
   8.609 +\verb_# dd if=/dev/zero of=vm1disk bs=1k seek=2048k count=1_
   8.610 +
   8.611 +Choose a free loop back device, and attach file: \\
   8.612 +\verb_# losetup /dev/loop0 vm1disk_ \\
   8.613 +Make a file system on the loop back device: \\
   8.614 +\verb_# mkfs ­t ext3 /dev/loop0_
   8.615 +
   8.616 +Populate the file system e.g. by copying from the current root:
   8.617 +\begin{verbatim}
   8.618 +# mount /dev/loop0 /mnt
   8.619 +# cp -ax / /mnt
   8.620 +\end{verbatim}
   8.621 +Tailor the file system by editing \path{/etc/fstab},
   8.622 +\path{/etc/hostname}, etc (don't forget to edit the files in the
   8.623 +mounted file system, instead of your domain 0 filesystem, e.g. you
   8.624 +would edit \path{/mnt/etc/fstab} instead of \path{/etc/fstab} ).  For
   8.625 +this example put \path{/dev/sda1} to root in fstab.
   8.626 +
   8.627 +Now unmount (this is important!):\\
   8.628 +\verb_# umount /dev/loop0_
   8.629 +
   8.630 +In the configuration file set:\\
   8.631 +\verb_disk = [`phy:loop0,sda1,w']_
   8.632 +
   8.633 +As the virtual machine writes to its `disk', the sparse file will be
   8.634 +filled in and consume more space up to the original 2GB.
   8.635 +
   8.636 +{\em NB.} You will need to use {\tt losetup} to bind the file to
   8.637 +\path{/dev/loop0} (or whatever loopback device you chose) each time
   8.638 +you reboot domain 0.  In the near future, Xend will track which loop
   8.639 +devices are currently free and do binding itself, making this manual
   8.640 +effort unnecessary.
   8.641 +
   8.642 +\section{LVM-backed virtual block devices}
   8.643 +
   8.644 +XXX Put some simple examples here - would be nice if an LVM user could
   8.645 +contribute some, although obviously users would have to read the LVM
   8.646 +docs to do advanced stuff.
   8.647 +
   8.648 +\part{Quick Reference}
   8.649 +
   8.650 +\chapter{Domain Configuration Files}
   8.651 +\label{cha:config}
   8.652 +
   8.653 +XXX Could use a little explanation about possible values
   8.654 +
   8.655 +Xen configuration files contain the following standard variables:
   8.656 +
   8.657 +\begin{description}
   8.658 +\item[kernel] Path to the kernel image (on the server).
   8.659 +\item[ramdisk] Path to a ramdisk image (optional).
   8.660 +\item[builder] The name of the domain build function (e.g. {\tt'linux'} or {\tt'netbsd'}.
   8.661 +\item[memory] Memory size in megabytes.
   8.662 +\item[cpu] CPU to assign this domain to.
   8.663 +\item[nics] Number of virtual network interfaces.
   8.664 +\item[vif] List of MAC addresses (random addresses are assigned if not given).
   8.665 +\item[disk] Regions of disk to export to the domain.
   8.666 +\item[dhcp] Set to {\tt 'dhcp'} if you want to DHCP allocate the IP addres.
   8.667 +\item[netmask] IP netmask.
   8.668 +\item[gateway] IP address for the gateway (if any).
   8.669 +\item[hostname] Set the hostname for the virtual machine.
   8.670 +\item[root] Set the root device.
   8.671 +\item[nfs\_server] IP address for the NFS server.
   8.672 +\item[nfs\_root] Path of the root filesystem on the NFS server.
   8.673 +\item[extra] Extra string to append to the kernel command line.
   8.674 +\item[restart] Three possible options:
   8.675 +  \begin{description}
   8.676 +  \item[always] Always restart the domain, no matter what
   8.677 +                its exit code is.
   8.678 +  \item[never]  Never restart the domain.
   8.679 +  \item[onreboot] (restart the domain if it requests reboot).
   8.680 +  \end{description}
   8.681 +\end{description}
   8.682 +
   8.683 +It is also possible to include Python scripting commands in
   8.684 +configuration files.  This is done in the \path{xmdefaults} file in
   8.685 +order to handle the {\tt vmid} variable.
   8.686 +
   8.687 +
   8.688 +\chapter{Xend (Node control daemon)}
   8.689 +\label{cha:xensv}
   8.690 +
   8.691 +The Xen Daemon (Xend) performs system management functions related to
   8.692 +virtual machines.  It forms a central point of control for a machine
   8.693 +and can be controlled using an HTTP-based protocol.  Xend must be
   8.694 +running in order to start and manage virtual machines.
   8.695 +
   8.696 +Xend must be run as root because it needs access to privileged system
   8.697 +management functions.  A small set of commands may be issued on the
   8.698 +Xend command line:
   8.699 +
   8.700 +\begin{tabular}{ll}
   8.701 +\verb_# xend start_ & start Xend, if not already running \\
   8.702 +\verb_# xend stop_  & stop Xend if already running       \\
   8.703 +\verb_# xend restart_ & restart Xend if running, otherwise start it \\
   8.704 +\end{tabular}
   8.705 +
   8.706 +An SysV init script called {\tt xend} is provided to start Xend at
   8.707 +boot time.  The {\tt make install} will install this script in
   8.708 +{\path{/etc/init.d} automatically.  To enable it, you can make
   8.709 +symbolic links in the appropriate runlevel directories or use the {\tt
   8.710 +chkconfig} tool, where available.
   8.711 +
   8.712 +Once Xend is running, more sophisticated administration can be done
   8.713 +using the Xensv web interface (see Chapter~\ref{cha:xensv}).
   8.714 +
   8.715 +\chapter{Xensv (Web interface server)}
   8.716 +\label{cha:xensv}
   8.717 +
   8.718 +Xensv is the server for the web control interface.  It can be started
   8.719 +using:\\
   8.720 +\verb_# xensv start_ \\
   8.721 +and stopped using:
   8.722 +\verb_# xensv stop_ \\
   8.723 +It will automatically start Xend if it is not already running.
   8.724 +
   8.725 +By default, Xensv will serve out the web interface on port 8080.  This
   8.726 +can be changed by editing {\tt
   8.727 +/usr/lib/python2.2/site-packages/xen/sv/params.py}.
   8.728 +
   8.729 +Once Xensv is running, the web interface can be used to manage running
   8.730 +domains and provides a user friendly domain creation wizard.
   8.731 +
   8.732 +\chapter{The xm tool}
   8.733 +\label{cha:xm}
   8.734 +
   8.735 +XXX Add description of arguments and switches for all the options
   8.736 +
   8.737 +The xm tool is the primary tool for managing Xen from the console.
   8.738 +The general format of an xm command line is:
   8.739 +
   8.740 +\begin{verbatim}
   8.741 +# xm command [switches] [arguments] [variables]
   8.742 +\end{verbatim}
   8.743 +
   8.744 +The available {\em switches } and {\em arguments}are dependent on the
   8.745 +{\em command} chosen.  The {\em variables} may be set using
   8.746 +declarations of the form {\tt variable=value} and may be used to set /
   8.747 +override any of the values in the configuration file being used,
   8.748 +including the standard variables described above and any custom
   8.749 +variables (for instance, the \path{xmdefaults} file uses a {\tt vmid}
   8.750 +variable).
   8.751 +
   8.752 +The available commands are as follows:
   8.753 +
   8.754 +\begin{description}
   8.755 +\item[create] Create a new domain.
   8.756 +\item[destroy] Kill a domain immediately.
   8.757 +\item[list] List running domains.
   8.758 +\item[shutdown] Ask a domain to shutdown.
   8.759 +\item[dmesg] Fetch the Xen (not Linux!) boot output.
   8.760 +\item[consoles] Lists the available consoles.
   8.761 +\item[console] Connect to the console for a domain.
   8.762 +\item[help] Get help on xm commands.
   8.763 +\item[save] Suspend a domain to disk.
   8.764 +\item[restore] Restore a domain from disk.
   8.765 +\item[pause] Pause a domain's execution.
   8.766 +\item[unpause] Unpause a domain.
   8.767 +\item[pincpu] Pin a domain to a CPU.
   8.768 +\item[bvt] Set BVT scheduler parameters for a domain.
   8.769 +\item[bvt\_ctxallow] Set the BVT context switching allowance for the system.
   8.770 +\item[fbvt] Set the FBVT scheduler parameters for a domain.
   8.771 +\item[fbvt\_ctxallow] Set the FBVT context switching allowance for the system.
   8.772 +\item[atropos] Set the atropos parameters for a domain.
   8.773 +\item[rrobin] Set the round robin time slice for the system.
   8.774 +\item[info] Get information about the Xen host.
   8.775 +\item[call] Call a Xend HTTP API function directly.
   8.776 +\end{description}
   8.777 +
   8.778 +\chapter{Glossary}
   8.779 +
   8.780 +\begin{description}
   8.781 +\item[Atropos]             One of the CPU schedulers provided by Xen.
   8.782 +                           Atropos provides domains with absolute shares
   8.783 +                           of the CPU, with timeliness guarantees and a
   8.784 +                           mechanism for sharing out ``slack time''.
   8.785 +
   8.786 +\item[BVT]                 The BVT scheduler is used to give propotional
   8.787 +                           fair shares of the CPU to domains.
   8.788 +
   8.789 +\item[Exokernel]           A minimal piece of privileged code, similar to
   8.790 +                           a {\bf microkernel} but providing a more
   8.791 +                           `hardware-like' interface to the tasks it
   8.792 +                           manages.  This is similar to a paravirtualising
   8.793 +                           VMM like {\bf Xen} but was designed as a new
   8.794 +                           operating system structure, rather than
   8.795 +                           specifically to run multiple conventional OSs.
   8.796 +
   8.797 +\item[FBVT]                A derivative of the { \bf BVT } scheduler that
   8.798 +                           aims to give better fairness performance to IO
   8.799 +                           intensive domains in competition with CPU
   8.800 +                           intensive domains.
   8.801 +
   8.802 +\item[Domain]              A domain is the execution context that
   8.803 +                           contains a running { \bf virtual machine }.
   8.804 +                           The relationship between virtual machines
   8.805 +                           and domains on Xen is similar to that between
   8.806 +                           programs and processes in an operating
   8.807 +                           system: a virtual machine is a persistent
   8.808 +                           entity that resides on disk (somewhat like
   8.809 +                           a program).  When it is loaded for execution,
   8.810 +                           it runs in a domain.  Each domain has a
   8.811 +                           { \bf domain ID }.
   8.812 +
   8.813 +\item[Domain 0]            The first domain to be started on a Xen
   8.814 +                           machine.  Domain 0 is responsible for managing
   8.815 +                           the system.
   8.816 +
   8.817 +\item[Domain ID]           A unique identifier for a { \bf domain },
   8.818 +                           analagous to a process ID in an operating
   8.819 +                           system.  Apart from domain
   8.820 +
   8.821 +\item[Full virtualisation] An approach to virtualisation which
   8.822 +                           requires no modifications to the hosted
   8.823 +                           operating system, providing the illusion of
   8.824 +                           a complete system of real hardware devices.
   8.825 +
   8.826 +\item[Hypervisor]          An alternative term for { \bf VMM }, used
   8.827 +                           because it means ``beyond supervisor'',
   8.828 +                           since it is responsible for managing multiple
   8.829 +                           ``supervisor'' kernels.
   8.830 +
   8.831 +\item[Microkernel]         A small base of code running at the highest
   8.832 +                           hardware privilege level.  A microkernel is
   8.833 +                           responsible for sharing CPU and memory (and
   8.834 +                           sometimes other devices) between less
   8.835 +                           privileged tasks running on the system.
   8.836 +                           This is similar to a VMM, particularly a
   8.837 +                           {\bf paravirtualising} VMM but typically
   8.838 +                           addressing a different problem space and
   8.839 +                           providing different kind of interface.
   8.840 +
   8.841 +\item[NetBSD/Xen]          A port of NetBSD to the Xen architecture.
   8.842 +
   8.843 +\item[Paravirtualisation]  An approach to virtualisation which requires
   8.844 +                           modifications to the operating system in
   8.845 +                           order to run in a virtual machine.  Xen
   8.846 +                           uses paravirtualisation but preserves
   8.847 +                           binary compatibility for user space
   8.848 +                           applications.
   8.849 +
   8.850 +\item[Virtual Machine]     The environment in which a hosted operating
   8.851 +                           system runs, providing the abstraction of a
   8.852 +                           dedicated machine.  A virtual machine may
   8.853 +                           be identical to the underlying hardware (as
   8.854 +                           in { \bf full virtualisation }, or it may
   8.855 +                           differ, as in { \bf paravirtualisation }.
   8.856 +
   8.857 +\item[VMM]                 Virtual Machine Monitor - the software that
   8.858 +                           allows multiple virtual machines to be
   8.859 +                           multiplexed on a single physical machine.
   8.860 +
   8.861 +\item[Xen]                 Xen is a paravirtualising virtual machine
   8.862 +                           monitor, developed primarily by the
   8.863 +                           Systems Research Group at the University
   8.864 +                           of Cambridge Computer Laboratory.
   8.865 +
   8.866 +\item[XenLinux]            Official name for the port of the Linux kernel
   8.867 +                           that runs on Xen.
   8.868 +
   8.869 +\end{description}
   8.870 +
   8.871 +\part{Advanced Topics}
   8.872 +
   8.873 +XXX More to add here, including config file format
   8.874 +
   8.875 +\chapter{Advanced Network Configuration}
   8.876 +
   8.877 +For simple systems with a single ethernet interface with a simple
   8.878 +configuration, the default installation should work ``out of the
   8.879 +box''.  More complicated network setups, for instance with multiple
   8.880 +ethernet interfaces and / or existing bridging setups will require
   8.881 +some special configuration.
   8.882 +
   8.883 +The purpose of this chapter is to describe the mechanisms provided by
   8.884 +xend to allow a flexible configuration for Xen's virtual networking.
   8.885 +
   8.886 +\section{Xen networking scripts}
   8.887 +
   8.888 +Xen's virtual networking is configured by 3 shell scripts.  These are
   8.889 +called automatically by Xend when certain events occur, with arguments
   8.890 +to the scripts providing further contextual information.  These
   8.891 +scripts are found by default in \path{/etc/xen}.  The names and
   8.892 +locations of the scripts can be configured in \path{xend-config.sxp}.
   8.893 +
   8.894 +\subsection{\path{network}}
   8.895 +
   8.896 +This script is called once when Xend is started and once when Xend is
   8.897 +stopped.  Its job is to do any advance preparation required for the
   8.898 +Xen virtual network when Xend starts and to do any corresponding
   8.899 +cleanup when Xend exits.
   8.900 +
   8.901 +In the default configuration, this script creates the bridge
   8.902 +``xen-br0'' and moves eth0 onto that bridge, modifying the routing
   8.903 +accordingly.
   8.904 +
   8.905 +In configurations where the bridge already exists, this script could
   8.906 +be replaced with a link to \path{/bin/true} (for instance).
   8.907 +
   8.908 +When Xend exits, this script is called with the {\tt stop} argument,
   8.909 +which causes it to delete the Xen bridge and remove {\tt eth0} from
   8.910 +it, restoring the normal IP and routing configuration.
   8.911 +
   8.912 +\subsection{\path{vif-bridge}}
   8.913 +
   8.914 +This script is called for every domain virtual interface.  This should
   8.915 +do things like configuring firewalling rules for that interface and
   8.916 +adding it to the appropriate bridge.
   8.917 +
   8.918 +By default, this adds and removes VIFs on the default Xen bridge.
   8.919 +This script can be customized to properly deal with more complicated
   8.920 +bridging setups.
   8.921 +
   8.922 +\chapter{Advanced Scheduling Configuration}
   8.923 +
   8.924 +\section{Scheduler selection}
   8.925 +
   8.926 +Xen offers a boot time choice between multiple schedulers.  To select
   8.927 +a scheduler, pass the boot parameter { \tt sched=sched\_name } to Xen,
   8.928 +substituting the apropriate scheduler name.  Details of the schedulers
   8.929 +and their parameters are included below; future verions of the tools
   8.930 +will provide a higher-level interface to these tools.
   8.931 +
   8.932 +\section{Borrowed Virtual Time}
   8.933 +
   8.934 +BVT provides proportional fair shares of the CPU time.  It has been
   8.935 +observed to penalise domains that block frequently (e.g. IO intensive
   8.936 +domains), so the FBVT derivative has been included as an alternative.
   8.937 +
   8.938 +\subsection{Global Parameters}
   8.939 +
   8.940 +\begin{description}
   8.941 +\item[ctx\_allow]
   8.942 +  the context switch allowance is similar to the "quantum"
   8.943 +  in traditional schedulers.  It is the minimum time that
   8.944 +  a scheduled domain will be allowed to run before be
   8.945 +  pre-empted.  This prevents thrashing of the CPU.
   8.946 +\end{description}
   8.947 +
   8.948 +\subsection{Per-domain parameters}
   8.949 +
   8.950 +\begin{description}
   8.951 +\item[mcuadv]
   8.952 +  the MCU (Minimum Charging Unit) advance determines the
   8.953 +  proportional share of the CPU that a domain receives.  It
   8.954 +  is set inversely proportionally to a domain's sharing weight.
   8.955 +\item[warp]
   8.956 +  the amount of "virtual time" the domain is allowed to warp
   8.957 +  backwards
   8.958 +\item[warpl]
   8.959 +  the warp limit is the maximum time a domain can run warped for
   8.960 +\item[warpu]
   8.961 +  the unwarp requirement is the minimum time a domain must
   8.962 +  run unwarped for before it can warp again
   8.963 +\end{description}
   8.964 +
   8.965 +\section{Fair Borrowed Virtual Time}
   8.966 +
   8.967 +This is a derivative for BVT that aims to provide better fairness for
   8.968 +IO intensive domains as well as for CPU intensive domains.
   8.969 +
   8.970 +\subsection{Global Parameters}
   8.971 +
   8.972 +Same as for BVT.
   8.973 +
   8.974 +\subsection{Per-domain parameters}
   8.975 +
   8.976 +Same as for BVT.
   8.977 +
   8.978 +\section{Atropos}
   8.979 +
   8.980 +Atropos is a Soft Real Time scheduler.  It provides guarantees about
   8.981 +absolute shares of the CPU (with a method for optionally sharing out
   8.982 +slack CPU time on a best-effort basis) and can provide timeliness
   8.983 +guarantees for latency-sensitive domains.
   8.984 +
   8.985 +\subsection{Per-domain parameters}
   8.986 +
   8.987 +\begin{description}
   8.988 +\item[slice]
   8.989 +  The length of time per period that a domain is guaranteed.
   8.990 +\item[period]
   8.991 +  The period over which a domain is guaranteed to receive
   8.992 +  its slice of CPU time.
   8.993 +\item[latency]
   8.994 +  The latency hint is used to control how soon after
   8.995 +  waking up a domain should be scheduled.
   8.996 +\item[xtratime]
   8.997 +  This is a true (1) / false (0) flag that specifies whether
   8.998 +  a domain should be allowed a share of the system slack time.
   8.999 +\end{description}
  8.1000 +
  8.1001 +\section{Round Robin}
  8.1002 +
  8.1003 +The Round Robin scheduler is included as a simple demonstration of
  8.1004 +Xen's internal scheduler API.  It is not intended for production use
  8.1005 +--- the other schedulers included are all more general and should give
  8.1006 +higher throughput.
  8.1007 +
  8.1008 +\subsection{Global parameters}
  8.1009 +
  8.1010 +\begin{description}
  8.1011 +\item[rr\_slice]
  8.1012 +  The maximum time each domain runs before the next
  8.1013 +  scheduling decision is made.
  8.1014 +\end{description}
  8.1015 +
  8.1016 +\chapter{Privileged domains}
  8.1017 +
  8.1018 +There are two possible types of privileges: IO privileges and
  8.1019 +administration privileges.
  8.1020 +
  8.1021 +\section{Driver domains (IO Privileges)}
  8.1022 +
  8.1023 +IO privileges can be assigned to allow a domain to drive PCI devices
  8.1024 +itself.  This is used for to support driver domains.
  8.1025 +
  8.1026 +Setting backend privileges is currently only supported in SXP format
  8.1027 +config files (??? is this true - there's nothing in xmdefaults,
  8.1028 +anyhow).  To allow a domain to function as a backend for others,
  8.1029 +somewhere within the {\tt vm} element of its configuration file must
  8.1030 +be a {\tt backend} element of the form {\tt (backend ({\em type}))}
  8.1031 +where {\tt \em type} may be either {\tt netif} or {\tt blkif},
  8.1032 +according to the type of virtual device this domain will service.
  8.1033 +After this domain has been built, Xend will connect all new and
  8.1034 +existing {\em virtual} devices (of the appropriate type) to that
  8.1035 +backend.
  8.1036 +
  8.1037 +Note that:
  8.1038 +\begin{itemize}
  8.1039 +\item a block backend cannot import virtual block devices from other
  8.1040 +domains
  8.1041 +\item a network backend cannot import virtual network devices from
  8.1042 +other domains
  8.1043 +\end{itemize}
  8.1044 +
  8.1045 +Thus (particularly in the case of block backends, which cannot import
  8.1046 +a virtual block device as their root filesystem), you may need to boot
  8.1047 +a backend domain from a ramdisk or a network device.
  8.1048 +
  8.1049 +The privilege to drive PCI devices may also be specified on a
  8.1050 +per-device basis.  Xen will assign the minimal set of hardware
  8.1051 +privileges to a domain that are required to control its devices.  This
  8.1052 +can be configured in either format of configuration file:
  8.1053 +
  8.1054 +\begin{itemize}
  8.1055 +\item SXP Format:
  8.1056 +  Include {\tt device} elements
  8.1057 +  {\tt (device (pci (bus {\em x}) (dev {\em y}) (func {\em z}))) } \\
  8.1058 +  inside the top-level {\tt vm} element.  Each one specifies the address
  8.1059 +  of a device this domain is allowed to drive ---
  8.1060 +  the numbers {\em x},{\em y} and {\em z} may be in either decimal or
  8.1061 +  hexadecimal format.
  8.1062 +\item Flat Format: Include a list of PCI device addresses of the
  8.1063 +  format: \\ {\tt pci = ['x,y,z', ...] } \\ where each element in the
  8.1064 +  list is a string specifying the components of the PCI device
  8.1065 +  address, separated by commas.  The components ({\tt \em x}, {\tt \em
  8.1066 +  y} and {\tt \em z}) of the list may be formatted as either decimal
  8.1067 +  or hexadecimal.
  8.1068 +\end{itemize}
  8.1069 +
  8.1070 +\section{Administration Domains}
  8.1071 +
  8.1072 +Administration privileges allow a domain to use the ``dom0
  8.1073 +operations'' (so called because they are usually available only to
  8.1074 +domain 0).  A privileged domain can build other domains, set scheduling
  8.1075 +parameters, etc.
  8.1076 +
  8.1077 +% Support for other administrative domains is not yet available...
  8.1078 +
  8.1079 +\chapter{Xen build options}
  8.1080 +
  8.1081 +For most users, the default build of Xen will be adequate.  For some
  8.1082 +advanced uses, Xen provides a number of build-time options:
  8.1083 +
  8.1084 +At build time, these options should be set as environment variables or
  8.1085 +passed on make's command-line.  For example:
  8.1086 +
  8.1087 +\begin{verbatim}
  8.1088 +export option=y; make
  8.1089 +option=y make
  8.1090 +make option1=y option2=y
  8.1091 +\end{verbatim}
  8.1092 +
  8.1093 +\section{List of options}
  8.1094 +
  8.1095 +{\bf debug=y }\\
  8.1096 +Enable debug assertions and console output.
  8.1097 +(Primarily useful for tracing bugs in Xen).        \\
  8.1098 +{\bf debugger=y }\\
  8.1099 +Enable the in-Xen pervasive debugger (PDB).
  8.1100 +This can be used to debug Xen, guest OSes, and
  8.1101 +applications. For more information see the 
  8.1102 +XenDebugger-HOWTO.                                 \\
  8.1103 +{\bf perfc=y }\\
  8.1104 +Enable performance-counters for significant events
  8.1105 +within Xen. The counts can be reset or displayed
  8.1106 +on Xen's console via console control keys.          \\
  8.1107 +{\bf trace=y }\\
  8.1108 +Enable per-cpu trace buffers which log a range of
  8.1109 +events within Xen for collection by control
  8.1110 +software.  For more information see the chapter on debugging,
  8.1111 +in the Xen Interface Manual.
  8.1112 +
  8.1113 +\chapter{Xen boot options}
  8.1114 +
  8.1115 +These options are used to configure Xen's behaviour at runtime.  They
  8.1116 +should be appended to Xen's command line, either manually or by
  8.1117 +editting \path{grub.conf}.
  8.1118 +
  8.1119 +\section{List of options}
  8.1120 +
  8.1121 +{\bf ignorebiostables }\\
  8.1122 + Disable parsing of BIOS-supplied tables. This may help with some
  8.1123 + chipsets that aren't fully supported by Xen. If you specify this
  8.1124 + option then ACPI tables are also ignored, and SMP support is
  8.1125 + disabled. \\
  8.1126 +
  8.1127 +{\bf noreboot } \\
  8.1128 + Don't reboot the machine automatically on errors.  This is
  8.1129 + useful to catch debug output if you aren't catching console messages
  8.1130 + via the serial line. \\
  8.1131 +
  8.1132 +{\bf nosmp } \\
  8.1133 + Disable SMP support.
  8.1134 + This option is implied by 'ignorebiostables'. \\
  8.1135 +
  8.1136 +{\bf noacpi } \\
  8.1137 + Disable ACPI tables, which confuse Xen on some chipsets.
  8.1138 + This option is implied by 'ignorebiostables'. \\
  8.1139 +
  8.1140 +{\bf watchdog } \\
  8.1141 + Enable NMI watchdog which can report certain failures. \\
  8.1142 +
  8.1143 +{\bf noht } \\
  8.1144 + Disable Hyperthreading. \\
  8.1145 +
  8.1146 +{\bf com1=$<$baud$>$,DPS[,$<$io\_base$>$,$<$irq$>$] \\
  8.1147 + com2=$<$baud$>$,DPS[,$<$io\_base$>$,$<$irq$>$] } \\
  8.1148 + Xen supports up to two 16550-compatible serial ports.
  8.1149 + For example: 'com1=9600,8n1,0x408,5' maps COM1 to a
  8.1150 + 9600-baud port, 8 data bits, no parity, 1 stop bit,
  8.1151 + I/O port base 0x408, IRQ 5.
  8.1152 + If the I/O base and IRQ are standard (com1:0x3f8,4;
  8.1153 + com2:0x2f8,3) then they need not be specified. \\
  8.1154 +
  8.1155 +{\bf console=$<$specifier list$>$ } \\
  8.1156 + Specify the destination for Xen console I/O.
  8.1157 + This is a comma-separated list of, for example:
  8.1158 +\begin{description}
  8.1159 + \item[vga]  use VGA console and allow keyboard input
  8.1160 + \item[com1] use serial port com1
  8.1161 + \item[com2H] use serial port com2. Transmitted chars will
  8.1162 +   have the MSB set. Received chars must have
  8.1163 +   MSB set.
  8.1164 + \item[com2L] use serial port com2. Transmitted chars will
  8.1165 +   have the MSB cleared. Received chars must
  8.1166 +   have MSB cleared.
  8.1167 +\end{description}
  8.1168 + The latter two examples allow a single port to be
  8.1169 + shared by two subsystems (eg. console and
  8.1170 + debugger). Sharing is controlled by MSB of each
  8.1171 + transmitted/received character.
  8.1172 + [NB. Default for this option is 'com1,tty'] \\
  8.1173 +
  8.1174 +{\bf conswitch=$<$switch-char$><$auto-switch-char$>$ } \\
  8.1175 + Specify how to switch serial-console input between
  8.1176 + Xen and DOM0. The required sequence is CTRL-<switch-char>
  8.1177 + pressed three times. Specifying '`' disables switching.
  8.1178 + The <auto-switch-char> specifies whether Xen should
  8.1179 + auto-switch input to DOM0 when it boots -- if it is 'x'
  8.1180 + then auto-switching is disabled. Any other value, or
  8.1181 + omitting the character, enables auto-switching.
  8.1182 + [NB. Default for this option is 'a'] \\
  8.1183 +
  8.1184 +{\bf nmi=xxx } \\
  8.1185 + Specify what to do with an NMI parity or I/O error. \\
  8.1186 + 'nmi=fatal':  Xen prints a diagnostic and then hangs. \\
  8.1187 + 'nmi=dom0':   Inform DOM0 of the NMI. \\
  8.1188 + 'nmi=ignore': Ignore the NMI. \\
  8.1189 + [NB. Default is 'dom0' ('fatal' for debug builds).] \\
  8.1190 +
  8.1191 +{\bf dom0\_mem=xxx } \\
  8.1192 + Set the maximum amount of memory for domain0. \\
  8.1193 +
  8.1194 +{\bf tbuf\_size=xxx } \\
  8.1195 + Set the size of the per-cpu trace buffers, in pages
  8.1196 + (default 1).  Note that the trace buffers are only
  8.1197 + enabled in debug builds.  Most users can ignore
  8.1198 + this feature completely. \\
  8.1199 +
  8.1200 +{\bf sched=xxx } \\
  8.1201 + Select the CPU scheduler Xen should use.  The current
  8.1202 + possibilities are 'bvt', 'atropos' and 'rrobin'.  The
  8.1203 + default is 'bvt'.  For more information see
  8.1204 + Sched-HOWTO.txt. \\
  8.1205 +
  8.1206 +{\bf pci\_dom0\_hide=(xx.xx.x)(yy.yy.y)... } \\
  8.1207 +Hide selected PCI devices from domain 0 (for instance, to stop it
  8.1208 +taking ownership of them so that they can be driven by another
  8.1209 +domain).  Device IDs should be given in hex format.  Bridge devices do
  8.1210 +not need to be hidden --- they are hidden implicitly, since guest OSes
  8.1211 +do not need to configure them.
  8.1212 +
  8.1213 +\chapter{Further Support}
  8.1214 +
  8.1215 +If you have questions that are not answered by this manual, the
  8.1216 +sources of information listed below may be of interest to you.  Note
  8.1217 +that bug reports, suggestions and contributions related to the
  8.1218 +software (or the documentation) should be sent to the Xen developers'
  8.1219 +mailing list (address below).
  8.1220 +
  8.1221 +\section{Other documentation}
  8.1222 +
  8.1223 +For developers interested in porting operating systems to Xen, the
  8.1224 +{\em Xen Interface Manual} is distributed in the \path{docs/}
  8.1225 +directory of the Xen source distribution.  Various HOWTOs are
  8.1226 +available in \path{docs/HOWTOS} but this content is being integrated
  8.1227 +into this manual.
  8.1228 +
  8.1229 +\section{Online references}
  8.1230 +
  8.1231 +The official Xen web site is found at: \\
  8.1232 +{\tt
  8.1233 +http://www.cl.cam.ac.uk/Research/SRG/netos/xen/] }.
  8.1234 +
  8.1235 +Links to other
  8.1236 +documentation sources are listed at: \\ {\tt
  8.1237 +http://www.cl.cam.ac.uk/Research/SRG/netos/xen/documentation.html}.
  8.1238 +
  8.1239 +\section{Mailing lists}
  8.1240 +
  8.1241 +There are currently two official Xen mailing lists:
  8.1242 +
  8.1243 +\begin{description}
  8.1244 +\item[xen-devel@lists.sourceforge.net] Used for development
  8.1245 +discussions and requests for help.  Subscribe at: \\
  8.1246 +{\tt http://lists.sourceforge.net/mailman/listinfo/xen-devel}
  8.1247 +\item[xen-announce@lists.sourceforge.net] Used for announcements only.
  8.1248 +Subscribe at: \\
  8.1249 +{\tt http://lists.sourceforge.net/mailman/listinfo/xen-announce}
  8.1250 +\end{description}
  8.1251 +
  8.1252 +Although there is no specific user support list, the developers try to
  8.1253 +assist users who post on xen-devel.  As the bulk of traffic on this
  8.1254 +list increases, a dedicated user support list may be introduced.
  8.1255 +
  8.1256 +\end{document}
     9.1 --- a/docs/xen_config.html	Fri Jul 23 14:11:01 2004 +0000
     9.2 +++ b/docs/xen_config.html	Tue Aug 03 12:28:49 2004 +0000
     9.3 @@ -1,15 +1,15 @@
     9.4  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     9.5  <html>
     9.6  <head>
     9.7 -  <meta http-equiv="content-type"
     9.8 - content="text/html; charset=ISO-8859-1">
     9.9 +  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    9.10    <title>Xen Configuration Syntax</title>
    9.11  </head>
    9.12  <body>
    9.13  <center>
    9.14  <h1>Xen Configuration Syntax</h1>
    9.15  <br>
    9.16 -Version 0.1<br>2004 June 21<br>
    9.17 +<!-- Version 0.1<br>2004 June 21<br> -->
    9.18 +Version 0.2<br>2004 July 19<br>
    9.19  </center>
    9.20  
    9.21  <h1>Xen Configuration</h1>
    9.22 @@ -20,7 +20,7 @@ called SXP.
    9.23  
    9.24  The SXP syntax is s-expressions (sxprs), a simple bracketed abstract syntax.
    9.25  Python lists are used to represent its parsed form, with a support
    9.26 -api providing  access to fields and values (class xenmgr.sxp).
    9.27 +api providing  access to fields and values (class xen.xend.sxp).
    9.28  
    9.29  <h1>SXP syntax</h1>
    9.30  <p>A general s-expression has the syntax:
    9.31 @@ -59,11 +59,17 @@ The top-level element, a virtual machine
    9.32  <ul>
    9.33      <li>name: string, required. Domain name.
    9.34      <li>id: int, optional, default generated. Domain unique id.
    9.35 -    <li>memory: int, optional, default 128. Domain memory in MB.
    9.36 +    <li>memory: int, required. Domain memory in MB.
    9.37 +    <li>cpu: int, optional. Cpu to run on.
    9.38      <li>image: linux | netbsd | ..., required. Domain image (OS-specific element).
    9.39      <li>controller: any device controller type, optional, default none.
    9.40      <li>device: any device type, optional, repeats. Device.
    9.41 -    <li>auto-restart: bool, optional, default false. Auto-restart flag.
    9.42 +    <li>restart: string, optional, default onreboot. Restart mode, one of
    9.43 +        <ul><li>onreboot: restart the domain when it exits with code reboot.
    9.44 +            <li>always: always restart the domain when it exits.
    9.45 +            <li>never:  never restart the domain.
    9.46 +        </ul>
    9.47 +    <li>console: int, optional, default 9600 + domain id. Console port.
    9.48  </ul>
    9.49  
    9.50  <h2>(image (linux)) element</h2>
    9.51 @@ -98,13 +104,13 @@ The domain may not have virtual network 
    9.52  <h2>(device (vif)) element</h2>
    9.53  Defines a virtual network interface.
    9.54  <ul>
    9.55 -    <li>mac: string, optional, default generated. Interface MAC address.
    9.56 -    <li>quota info: optional. Subelements bytes and usecs.
    9.57 +    <li>mac: string, required. Interface MAC address.
    9.58      <li>bridge: string, optional, default system-dependent. Bridge to connect to.
    9.59 +    <li>script: string, optional, default system-dependent. Vif script to use
    9.60 +        when bringing the interface up or down.
    9.61 +    <li>ip: IP address, optional, no default. May be repeated. An IP address
    9.62 +    or CIDR-format subnet the vif may use.
    9.63  </ul>
    9.64 -A random MAC is assined is not specified.
    9.65 -The interface is connected to the system default bridge if no bridge
    9.66 -is specified.
    9.67  
    9.68  <h2>(device (vbd)) element</h2>
    9.69  Defines a virtual block device.
    9.70 @@ -135,14 +141,6 @@ Contains a list of vif elements:
    9.71    <li>vnet: id of vnet the vif is assigned to.
    9.72  </ul>
    9.73  
    9.74 -<h2>(vfr) element</h2>
    9.75 -Defines the ip addresses for vifs (may go away soon).
    9.76 -Contains a list of vif elements:
    9.77 -<ul>
    9.78 -  <li>id: vif index
    9.79 -  <li>ip: vif ip address
    9.80 -</ul>
    9.81 -
    9.82  <h1>Examples</h1>
    9.83  <p> A vm  with 64 MB memory, root on /dev/xda1 (mapped from /dev/hda1),
    9.84  one vif with default MAC.
    10.1 --- a/linux-2.4.26-xen-sparse/arch/xen/defconfig-xen0	Fri Jul 23 14:11:01 2004 +0000
    10.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/defconfig-xen0	Tue Aug 03 12:28:49 2004 +0000
    10.3 @@ -905,12 +905,29 @@ CONFIG_LOG_BUF_SHIFT=0
    10.4  #
    10.5  # Cryptographic options
    10.6  #
    10.7 -# CONFIG_CRYPTO is not set
    10.8 +CONFIG_CRYPTO=y
    10.9 +CONFIG_CRYPTO_HMAC=y
   10.10 +CONFIG_CRYPTO_NULL=m
   10.11 +CONFIG_CRYPTO_MD4=m
   10.12 +CONFIG_CRYPTO_MD5=m
   10.13 +CONFIG_CRYPTO_SHA1=m
   10.14 +CONFIG_CRYPTO_SHA256=m
   10.15 +CONFIG_CRYPTO_SHA512=m
   10.16 +CONFIG_CRYPTO_DES=m
   10.17 +CONFIG_CRYPTO_BLOWFISH=m
   10.18 +CONFIG_CRYPTO_TWOFISH=m
   10.19 +CONFIG_CRYPTO_SERPENT=m
   10.20 +CONFIG_CRYPTO_AES=m
   10.21 +CONFIG_CRYPTO_CAST5=m
   10.22 +CONFIG_CRYPTO_CAST6=m
   10.23 +CONFIG_CRYPTO_ARC4=m
   10.24 +CONFIG_CRYPTO_DEFLATE=m
   10.25 +# CONFIG_CRYPTO_TEST is not set
   10.26  
   10.27  #
   10.28  # Library routines
   10.29  #
   10.30  # CONFIG_CRC32 is not set
   10.31  CONFIG_ZLIB_INFLATE=y
   10.32 -# CONFIG_ZLIB_DEFLATE is not set
   10.33 +CONFIG_ZLIB_DEFLATE=m
   10.34  # CONFIG_FW_LOADER is not set
    11.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/balloon/balloon.c	Fri Jul 23 14:11:01 2004 +0000
    11.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/balloon/balloon.c	Tue Aug 03 12:28:49 2004 +0000
    11.3 @@ -109,7 +109,7 @@ static unsigned long inflate_balloon(uns
    11.4      XEN_flush_page_update_queue();
    11.5  
    11.6      ret = HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
    11.7 -                                parray, num_pages);
    11.8 +                                parray, num_pages, 0);
    11.9      if ( unlikely(ret != num_pages) )
   11.10      {
   11.11          printk("Unable to inflate balloon, error %lx\n", ret);
   11.12 @@ -199,7 +199,7 @@ unsigned long deflate_balloon(unsigned l
   11.13      XEN_flush_page_update_queue();
   11.14  
   11.15      ret = HYPERVISOR_dom_mem_op(MEMOP_increase_reservation, 
   11.16 -                                parray, num_pages);
   11.17 +                                parray, num_pages, 0);
   11.18      if ( unlikely(ret != num_pages) )
   11.19      {
   11.20          printk("Unable to deflate balloon, error %lx\n", ret);
    12.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h	Fri Jul 23 14:11:01 2004 +0000
    12.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h	Tue Aug 03 12:28:49 2004 +0000
    12.3 @@ -13,7 +13,7 @@
    12.4  #include <linux/blkdev.h>
    12.5  #include <asm/ctrl_if.h>
    12.6  #include <asm/io.h>
    12.7 -#include "../blkif.h"
    12.8 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
    12.9  
   12.10  #if 0
   12.11  #define ASSERT(_p) \
   12.12 @@ -26,6 +26,9 @@
   12.13  #define DPRINTK(_f, _a...) ((void)0)
   12.14  #endif
   12.15  
   12.16 +#define PRINTK(_f, _a...) printk(KERN_ALERT "(file=%s, line=%d) " _f, \
   12.17 +                           __FILE__ , __LINE__ , ## _a )
   12.18 +
   12.19  typedef struct blkif_st {
   12.20      /* Unique identifier for this interface. */
   12.21      domid_t          domid;
    13.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/vbd.c	Fri Jul 23 14:11:01 2004 +0000
    13.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/vbd.c	Tue Aug 03 12:28:49 2004 +0000
    13.3 @@ -18,7 +18,7 @@ void vbd_create(blkif_be_vbd_create_t *c
    13.4      blkif = blkif_find_by_handle(create->domid, create->blkif_handle);
    13.5      if ( unlikely(blkif == NULL) )
    13.6      {
    13.7 -        DPRINTK("vbd_create attempted for non-existent blkif (%u,%u)\n", 
    13.8 +        PRINTK("vbd_create attempted for non-existent blkif (%u,%u)\n", 
    13.9                  create->domid, create->blkif_handle); 
   13.10          create->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND;
   13.11          return;
   13.12 @@ -41,7 +41,7 @@ void vbd_create(blkif_be_vbd_create_t *c
   13.13          }
   13.14          else
   13.15          {
   13.16 -            DPRINTK("vbd_create attempted for already existing vbd\n");
   13.17 +            PRINTK("vbd_create attempted for already existing vbd\n");
   13.18              create->status = BLKIF_BE_STATUS_VBD_EXISTS;
   13.19              goto out;
   13.20          }
   13.21 @@ -49,7 +49,7 @@ void vbd_create(blkif_be_vbd_create_t *c
   13.22  
   13.23      if ( unlikely((vbd = kmalloc(sizeof(vbd_t), GFP_KERNEL)) == NULL) )
   13.24      {
   13.25 -        DPRINTK("vbd_create: out of memory\n");
   13.26 +        PRINTK("vbd_create: out of memory\n");
   13.27          create->status = BLKIF_BE_STATUS_OUT_OF_MEMORY;
   13.28          goto out;
   13.29      }
   13.30 @@ -85,7 +85,7 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
   13.31      blkif = blkif_find_by_handle(grow->domid, grow->blkif_handle);
   13.32      if ( unlikely(blkif == NULL) )
   13.33      {
   13.34 -        DPRINTK("vbd_grow attempted for non-existent blkif (%u,%u)\n", 
   13.35 +        PRINTK("vbd_grow attempted for non-existent blkif (%u,%u)\n", 
   13.36                  grow->domid, grow->blkif_handle); 
   13.37          grow->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND;
   13.38          return;
   13.39 @@ -107,7 +107,7 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
   13.40  
   13.41      if ( unlikely(vbd == NULL) || unlikely(vbd->vdevice != vdevice) )
   13.42      {
   13.43 -        DPRINTK("vbd_grow: attempted to append extent to non-existent VBD.\n");
   13.44 +        PRINTK("vbd_grow: attempted to append extent to non-existent VBD.\n");
   13.45          grow->status = BLKIF_BE_STATUS_VBD_NOT_FOUND;
   13.46          goto out;
   13.47      } 
   13.48 @@ -115,7 +115,7 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
   13.49      if ( unlikely((x = kmalloc(sizeof(blkif_extent_le_t), 
   13.50                                 GFP_KERNEL)) == NULL) )
   13.51      {
   13.52 -        DPRINTK("vbd_grow: out of memory\n");
   13.53 +        PRINTK("vbd_grow: out of memory\n");
   13.54          grow->status = BLKIF_BE_STATUS_OUT_OF_MEMORY;
   13.55          goto out;
   13.56      }
   13.57 @@ -127,7 +127,7 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
   13.58      
   13.59      if( !blk_size[MAJOR(x->extent.device)] )
   13.60      {
   13.61 -        DPRINTK("vbd_grow: device %08x doesn't exist.\n", x->extent.device);
   13.62 +        PRINTK("vbd_grow: device %08x doesn't exist.\n", x->extent.device);
   13.63  	grow->status = BLKIF_BE_STATUS_EXTENT_NOT_FOUND;
   13.64  	goto out;
   13.65      }
   13.66 @@ -135,9 +135,16 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
   13.67      /* convert blocks (1KB) to sectors */
   13.68      sz = blk_size[MAJOR(x->extent.device)][MINOR(x->extent.device)] * 2;    
   13.69      
   13.70 +    if ( sz == 0 )
   13.71 +    {
   13.72 +        PRINTK("vbd_grow: device %08x zero size!\n", x->extent.device);
   13.73 +	grow->status = BLKIF_BE_STATUS_EXTENT_NOT_FOUND;
   13.74 +	goto out;
   13.75 +    }
   13.76 +
   13.77      if ( x->extent.sector_start > 0 )
   13.78      {
   13.79 -        DPRINTK("vbd_grow: device %08x start not zero!\n", x->extent.device);
   13.80 +        PRINTK("vbd_grow: device %08x start not zero!\n", x->extent.device);
   13.81  	grow->status = BLKIF_BE_STATUS_EXTENT_NOT_FOUND;
   13.82  	goto out;
   13.83      }
   13.84 @@ -237,7 +244,7 @@ void vbd_destroy(blkif_be_vbd_destroy_t 
   13.85      blkif = blkif_find_by_handle(destroy->domid, destroy->blkif_handle);
   13.86      if ( unlikely(blkif == NULL) )
   13.87      {
   13.88 -        DPRINTK("vbd_destroy attempted for non-existent blkif (%u,%u)\n", 
   13.89 +        PRINTK("vbd_destroy attempted for non-existent blkif (%u,%u)\n", 
   13.90                  destroy->domid, destroy->blkif_handle); 
   13.91          destroy->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND;
   13.92          return;
    14.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h	Fri Jul 23 14:11:01 2004 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,115 +0,0 @@
    14.4 -/******************************************************************************
    14.5 - * blkif.h
    14.6 - * 
    14.7 - * Unified block-device I/O interface for Xen guest OSes.
    14.8 - * 
    14.9 - * Copyright (c) 2003-2004, Keir Fraser
   14.10 - */
   14.11 -
   14.12 -#ifndef __SHARED_BLKIF_H__
   14.13 -#define __SHARED_BLKIF_H__
   14.14 -
   14.15 -#define blkif_vdev_t   u16
   14.16 -#define blkif_sector_t u64
   14.17 -
   14.18 -#define BLKIF_OP_READ      0
   14.19 -#define BLKIF_OP_WRITE     1
   14.20 -#define BLKIF_OP_PROBE     2
   14.21 -
   14.22 -/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
   14.23 -#define BLKIF_RING_SIZE        64
   14.24 -
   14.25 -/*
   14.26 - * Maximum scatter/gather segments per request.
   14.27 - * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   14.28 - * NB. This could be 12 if the ring indexes weren't stored in the same page.
   14.29 - */
   14.30 -#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
   14.31 -
   14.32 -typedef struct {
   14.33 -    u8             operation;    /*  0: BLKIF_OP_???                         */
   14.34 -    u8             nr_segments;  /*  1: number of segments                   */
   14.35 -    blkif_vdev_t   device;       /*  2: only for read/write requests         */
   14.36 -    unsigned long  id;           /*  4: private guest value, echoed in resp  */
   14.37 -    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
   14.38 -    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
   14.39 -    /* @first_sect: first sector in frame to transfer (inclusive).           */
   14.40 -    /* @last_sect: last sector in frame to transfer (inclusive).             */
   14.41 -    /* @frame: machine page frame number.                                    */
   14.42 -    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   14.43 -} PACKED blkif_request_t;
   14.44 -
   14.45 -#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   14.46 -#define blkif_last_sect(_fas)  ((_fas)&7)
   14.47 -
   14.48 -typedef struct {
   14.49 -    unsigned long   id;              /* copied from request */
   14.50 -    u8              operation;       /* copied from request */
   14.51 -    s16             status;          /* BLKIF_RSP_???       */
   14.52 -} PACKED blkif_response_t;
   14.53 -
   14.54 -#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   14.55 -#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   14.56 -
   14.57 -/*
   14.58 - * We use a special capitalised type name because it is _essential_ that all 
   14.59 - * arithmetic on indexes is done on an integer type of the correct size.
   14.60 - */
   14.61 -typedef u32 BLKIF_RING_IDX;
   14.62 -
   14.63 -/*
   14.64 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   14.65 - * size of the ring buffer. The following macro converts a free-running counter
   14.66 - * into a value that can directly index a ring-buffer array.
   14.67 - */
   14.68 -#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
   14.69 -
   14.70 -typedef struct {
   14.71 -    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
   14.72 -    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
   14.73 -    union {                   /*  8 */
   14.74 -        blkif_request_t  req;
   14.75 -        blkif_response_t resp;
   14.76 -    } PACKED ring[BLKIF_RING_SIZE];
   14.77 -} PACKED blkif_ring_t;
   14.78 -
   14.79 -
   14.80 -/*
   14.81 - * BLKIF_OP_PROBE:
   14.82 - * The request format for a probe request is constrained as follows:
   14.83 - *  @operation   == BLKIF_OP_PROBE
   14.84 - *  @nr_segments == size of probe buffer in pages
   14.85 - *  @device      == unused (zero)
   14.86 - *  @id          == any value (echoed in response message)
   14.87 - *  @sector_num  == unused (zero)
   14.88 - *  @frame_and_sects == list of page-sized buffers.
   14.89 - *                       (i.e., @first_sect == 0, @last_sect == 7).
   14.90 - * 
   14.91 - * The response is a list of vdisk_t elements copied into the out-of-band
   14.92 - * probe buffer. On success the response status field contains the number
   14.93 - * of vdisk_t elements.
   14.94 - */
   14.95 -
   14.96 -/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
   14.97 -#define VDISK_TYPE_FLOPPY  0x00
   14.98 -#define VDISK_TYPE_TAPE    0x01
   14.99 -#define VDISK_TYPE_CDROM   0x05
  14.100 -#define VDISK_TYPE_OPTICAL 0x07
  14.101 -#define VDISK_TYPE_DISK    0x20 
  14.102 -
  14.103 -#define VDISK_TYPE_MASK    0x3F
  14.104 -#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
  14.105 -
  14.106 -/* The top two bits of the type field encode various flags. */
  14.107 -#define VDISK_FLAG_RO      0x40
  14.108 -#define VDISK_FLAG_VIRT    0x80
  14.109 -#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
  14.110 -#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
  14.111 -
  14.112 -typedef struct {
  14.113 -    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
  14.114 -    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
  14.115 -    u16            info;         /* 10: Device type and flags (VDISK_*).     */
  14.116 -} PACKED vdisk_t; /* 12 bytes */
  14.117 -
  14.118 -#endif /* __SHARED_BLKIF_H__ */
    15.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Fri Jul 23 14:11:01 2004 +0000
    15.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Tue Aug 03 12:28:49 2004 +0000
    15.3 @@ -9,24 +9,20 @@
    15.4  
    15.5  #include <linux/config.h>
    15.6  #include <linux/module.h>
    15.7 -
    15.8  #include <linux/kernel.h>
    15.9  #include <linux/sched.h>
   15.10  #include <linux/slab.h>
   15.11  #include <linux/string.h>
   15.12  #include <linux/errno.h>
   15.13 -
   15.14  #include <linux/fs.h>
   15.15  #include <linux/hdreg.h>
   15.16  #include <linux/blkdev.h>
   15.17  #include <linux/major.h>
   15.18 -
   15.19  #include <asm/hypervisor-ifs/hypervisor-if.h>
   15.20  #include <asm/io.h>
   15.21  #include <asm/atomic.h>
   15.22  #include <asm/uaccess.h>
   15.23 -
   15.24 -#include "../blkif.h"
   15.25 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
   15.26  
   15.27  #if 0
   15.28  #define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
    16.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/dom0/core.c	Fri Jul 23 14:11:01 2004 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,233 +0,0 @@
    16.4 -/******************************************************************************
    16.5 - * core.c
    16.6 - * 
    16.7 - * Interface to privileged domain-0 commands.
    16.8 - * 
    16.9 - * Copyright (c) 2002-2004, K A Fraser, B Dragovic
   16.10 - */
   16.11 -
   16.12 -#include <linux/config.h>
   16.13 -#include <linux/module.h>
   16.14 -#include <linux/kernel.h>
   16.15 -#include <linux/sched.h>
   16.16 -#include <linux/slab.h>
   16.17 -#include <linux/string.h>
   16.18 -#include <linux/errno.h>
   16.19 -#include <linux/mm.h>
   16.20 -#include <linux/mman.h>
   16.21 -#include <linux/swap.h>
   16.22 -#include <linux/smp_lock.h>
   16.23 -#include <linux/swapctl.h>
   16.24 -#include <linux/iobuf.h>
   16.25 -#include <linux/highmem.h>
   16.26 -#include <linux/pagemap.h>
   16.27 -#include <linux/seq_file.h>
   16.28 -
   16.29 -#include <asm/pgalloc.h>
   16.30 -#include <asm/pgtable.h>
   16.31 -#include <asm/uaccess.h>
   16.32 -#include <asm/tlb.h>
   16.33 -#include <asm/proc_cmd.h>
   16.34 -#include <asm/hypervisor-ifs/dom0_ops.h>
   16.35 -#include <asm/xen_proc.h>
   16.36 -
   16.37 -static struct proc_dir_entry *privcmd_intf;
   16.38 -
   16.39 -static int privcmd_ioctl(struct inode *inode, struct file *file,
   16.40 -                         unsigned int cmd, unsigned long data)
   16.41 -{
   16.42 -    int ret = -ENOSYS;
   16.43 -
   16.44 -    switch ( cmd )
   16.45 -    {
   16.46 -    case IOCTL_PRIVCMD_HYPERCALL:
   16.47 -    {
   16.48 -        privcmd_hypercall_t hypercall;
   16.49 -  
   16.50 -        if ( copy_from_user(&hypercall, (void *)data, sizeof(hypercall)) )
   16.51 -            return -EFAULT;
   16.52 -
   16.53 -        __asm__ __volatile__ (
   16.54 -            "pushl %%ebx; pushl %%ecx; pushl %%edx; pushl %%esi; pushl %%edi; "
   16.55 -            "movl  4(%%eax),%%ebx ;"
   16.56 -            "movl  8(%%eax),%%ecx ;"
   16.57 -            "movl 12(%%eax),%%edx ;"
   16.58 -            "movl 16(%%eax),%%esi ;"
   16.59 -            "movl 20(%%eax),%%edi ;"
   16.60 -            "movl   (%%eax),%%eax ;"
   16.61 -            TRAP_INSTR "; "
   16.62 -            "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
   16.63 -            : "=a" (ret) : "0" (&hypercall) : "memory" );
   16.64 -
   16.65 -    }
   16.66 -    break;
   16.67 -
   16.68 -    case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
   16.69 -    {
   16.70 -        extern int initdom_ctrlif_domcontroller_port;
   16.71 -        ret = initdom_ctrlif_domcontroller_port;
   16.72 -    }
   16.73 -    break;
   16.74 -    
   16.75 -
   16.76 -    case IOCTL_PRIVCMD_MMAP:
   16.77 -    {
   16.78 -#define PRIVCMD_MMAP_SZ 32
   16.79 -        privcmd_mmap_t mmapcmd;
   16.80 -        privcmd_mmap_entry_t msg[PRIVCMD_MMAP_SZ], *p;
   16.81 -        int i, rc;
   16.82 -
   16.83 -        if ( copy_from_user(&mmapcmd, (void *)data, sizeof(mmapcmd)) )
   16.84 -            return -EFAULT;
   16.85 -
   16.86 -        p = mmapcmd.entry;
   16.87 -
   16.88 -        for (i=0; i<mmapcmd.num; i+=PRIVCMD_MMAP_SZ, p+=PRIVCMD_MMAP_SZ)
   16.89 -        {
   16.90 -            int j, n = ((mmapcmd.num-i)>PRIVCMD_MMAP_SZ)?
   16.91 -                PRIVCMD_MMAP_SZ:(mmapcmd.num-i);
   16.92 -            if ( copy_from_user(&msg, p, n*sizeof(privcmd_mmap_entry_t)) )
   16.93 -                return -EFAULT;
   16.94 -     
   16.95 -            for ( j = 0; j < n; j++ )
   16.96 -            {
   16.97 -                struct vm_area_struct *vma = 
   16.98 -                    find_vma( current->mm, msg[j].va );
   16.99 -
  16.100 -                if ( !vma )
  16.101 -                    return -EINVAL;
  16.102 -
  16.103 -                if ( msg[j].va > PAGE_OFFSET )
  16.104 -                    return -EINVAL;
  16.105 -
  16.106 -                if ( (msg[j].va + (msg[j].npages<<PAGE_SHIFT)) > vma->vm_end )
  16.107 -                    return -EINVAL;
  16.108 -
  16.109 -                if ( (rc = direct_remap_area_pages(vma->vm_mm, 
  16.110 -                                                   msg[j].va&PAGE_MASK, 
  16.111 -                                                   msg[j].mfn<<PAGE_SHIFT, 
  16.112 -                                                   msg[j].npages<<PAGE_SHIFT, 
  16.113 -                                                   vma->vm_page_prot,
  16.114 -                                                   mmapcmd.dom)) < 0 )
  16.115 -                    return rc;
  16.116 -            }
  16.117 -        }
  16.118 -        ret = 0;
  16.119 -    }
  16.120 -    break;
  16.121 -
  16.122 -    case IOCTL_PRIVCMD_MMAPBATCH:
  16.123 -    {
  16.124 -#define MAX_DIRECTMAP_MMU_QUEUE 130
  16.125 -        mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v;
  16.126 -        privcmd_mmapbatch_t m;
  16.127 -        struct vm_area_struct *vma = NULL;
  16.128 -        unsigned long *p, addr;
  16.129 -        unsigned long mfn;
  16.130 -        int i;
  16.131 -
  16.132 -        if ( copy_from_user(&m, (void *)data, sizeof(m)) )
  16.133 -        { ret = -EFAULT; goto batch_err; }
  16.134 -
  16.135 -        vma = find_vma( current->mm, m.addr );
  16.136 -
  16.137 -        if ( !vma )
  16.138 -        { ret = -EINVAL; goto batch_err; }
  16.139 -
  16.140 -        if ( m.addr > PAGE_OFFSET )
  16.141 -        { ret = -EFAULT; goto batch_err; }
  16.142 -
  16.143 -        if ( (m.addr + (m.num<<PAGE_SHIFT)) > vma->vm_end )
  16.144 -        { ret = -EFAULT; goto batch_err; }
  16.145 -
  16.146 -        if ( m.dom != 0 )
  16.147 -        {
  16.148 -            u[0].val  = (unsigned long)(m.dom<<16) & ~0xFFFFUL;
  16.149 -            u[0].ptr  = (unsigned long)(m.dom<< 0) & ~0xFFFFUL;
  16.150 -            u[0].ptr |= MMU_EXTENDED_COMMAND;
  16.151 -            u[0].val |= MMUEXT_SET_SUBJECTDOM;
  16.152 -            v = w = &u[1];
  16.153 -        }
  16.154 -        else
  16.155 -        {
  16.156 -            v = w = &u[0];
  16.157 -        }
  16.158 -
  16.159 -        p = m.arr;
  16.160 -        addr = m.addr;
  16.161 -        for ( i = 0; i < m.num; i++, addr += PAGE_SIZE, p++ )
  16.162 -        {
  16.163 -            if ( get_user(mfn, p) )
  16.164 -                return -EFAULT;
  16.165 -
  16.166 -            v->val = (mfn << PAGE_SHIFT) | pgprot_val(vma->vm_page_prot);
  16.167 -
  16.168 -            __direct_remap_area_pages(vma->vm_mm,
  16.169 -                                      addr, 
  16.170 -                                      PAGE_SIZE, 
  16.171 -                                      v);
  16.172 -
  16.173 -            if ( unlikely(HYPERVISOR_mmu_update(u, v - u + 1, NULL) < 0) )
  16.174 -                put_user( 0xF0000000 | mfn, p );
  16.175 -
  16.176 -            v = w;
  16.177 -        }
  16.178 -        ret = 0;
  16.179 -        break;
  16.180 -
  16.181 -    batch_err:
  16.182 -        printk("batch_err ret=%d vma=%p addr=%lx num=%d arr=%p %lx-%lx\n", 
  16.183 -               ret, vma, m.addr, m.num, m.arr, vma->vm_start, vma->vm_end);
  16.184 -        break;
  16.185 -    }
  16.186 -    break;
  16.187 -
  16.188 -    default:
  16.189 -        ret = -EINVAL;
  16.190 -        break;
  16.191 -    }
  16.192 -    return ret;
  16.193 -}
  16.194 -
  16.195 -static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
  16.196 -{
  16.197 -    /* DONTCOPY is essential for Xen as copy_page_range is broken. */
  16.198 -    vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY;
  16.199 -
  16.200 -    return 0;
  16.201 -}
  16.202 -
  16.203 -static struct file_operations privcmd_file_ops = {
  16.204 -    ioctl : privcmd_ioctl,
  16.205 -    mmap:   privcmd_mmap
  16.206 -};
  16.207 -
  16.208 -
  16.209 -static int __init init_module(void)
  16.210 -{
  16.211 -    if ( !(start_info.flags & SIF_PRIVILEGED) )
  16.212 -        return 0;
  16.213 -
  16.214 -    privcmd_intf = create_xen_proc_entry("privcmd", 0400);
  16.215 -    if ( privcmd_intf != NULL )
  16.216 -    {
  16.217 -        privcmd_intf->owner      = THIS_MODULE;
  16.218 -        privcmd_intf->nlink      = 1;
  16.219 -        privcmd_intf->proc_fops  = &privcmd_file_ops;
  16.220 -    }
  16.221 -
  16.222 -    return 0;
  16.223 -}
  16.224 -
  16.225 -
  16.226 -static void __exit cleanup_module(void)
  16.227 -{
  16.228 -    if ( privcmd_intf == NULL ) return;
  16.229 -    remove_xen_proc_entry("privcmd");
  16.230 -    privcmd_intf = NULL;
  16.231 -}
  16.232 -
  16.233 -
  16.234 -module_init(init_module);
  16.235 -module_exit(cleanup_module);
  16.236 -#
    17.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/evtchn/evtchn.c	Fri Jul 23 14:11:01 2004 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,366 +0,0 @@
    17.4 -/******************************************************************************
    17.5 - * evtchn.c
    17.6 - * 
    17.7 - * Xenolinux driver for receiving and demuxing event-channel signals.
    17.8 - * 
    17.9 - * Copyright (c) 2004, K A Fraser
   17.10 - */
   17.11 -
   17.12 -#include <linux/config.h>
   17.13 -#include <linux/module.h>
   17.14 -#include <linux/kernel.h>
   17.15 -#include <linux/sched.h>
   17.16 -#include <linux/slab.h>
   17.17 -#include <linux/string.h>
   17.18 -#include <linux/errno.h>
   17.19 -#include <linux/fs.h>
   17.20 -#include <linux/errno.h>
   17.21 -#include <linux/miscdevice.h>
   17.22 -#include <linux/major.h>
   17.23 -#include <linux/proc_fs.h>
   17.24 -#include <linux/devfs_fs_kernel.h>
   17.25 -#include <linux/stat.h>
   17.26 -#include <linux/poll.h>
   17.27 -#include <linux/irq.h>
   17.28 -#include <asm/evtchn.h>
   17.29 -
   17.30 -/* NB. This must be shared amongst drivers if more things go in /dev/xen */
   17.31 -static devfs_handle_t xen_dev_dir;
   17.32 -
   17.33 -/* Only one process may open /dev/xen/evtchn at any time. */
   17.34 -static unsigned long evtchn_dev_inuse;
   17.35 -
   17.36 -/* Notification ring, accessed via /dev/xen/evtchn. */
   17.37 -#define RING_SIZE     2048  /* 2048 16-bit entries */
   17.38 -#define RING_MASK(_i) ((_i)&(RING_SIZE-1))
   17.39 -static u16 *ring;
   17.40 -static unsigned int ring_cons, ring_prod, ring_overflow;
   17.41 -
   17.42 -/* Processes wait on this queue via /dev/xen/evtchn when ring is empty. */
   17.43 -static DECLARE_WAIT_QUEUE_HEAD(evtchn_wait);
   17.44 -static struct fasync_struct *evtchn_async_queue;
   17.45 -
   17.46 -/* Which ports is user-space bound to? */
   17.47 -static u32 bound_ports[32];
   17.48 -
   17.49 -static spinlock_t lock;
   17.50 -
   17.51 -void evtchn_device_upcall(int port)
   17.52 -{
   17.53 -    shared_info_t *s = HYPERVISOR_shared_info;
   17.54 -
   17.55 -    spin_lock(&lock);
   17.56 -
   17.57 -    mask_evtchn(port);
   17.58 -    clear_evtchn(port);
   17.59 -
   17.60 -    if ( ring != NULL )
   17.61 -    {
   17.62 -        if ( (ring_prod - ring_cons) < RING_SIZE )
   17.63 -        {
   17.64 -            ring[RING_MASK(ring_prod)] = (u16)port;
   17.65 -            if ( ring_cons == ring_prod++ )
   17.66 -            {
   17.67 -                wake_up_interruptible(&evtchn_wait);
   17.68 -                kill_fasync(&evtchn_async_queue, SIGIO, POLL_IN);
   17.69 -            }
   17.70 -        }
   17.71 -        else
   17.72 -        {
   17.73 -            ring_overflow = 1;
   17.74 -        }
   17.75 -    }
   17.76 -
   17.77 -    spin_unlock(&lock);
   17.78 -}
   17.79 -
   17.80 -static void __evtchn_reset_buffer_ring(void)
   17.81 -{
   17.82 -    /* Initialise the ring to empty. Clear errors. */
   17.83 -    ring_cons = ring_prod = ring_overflow = 0;
   17.84 -}
   17.85 -
   17.86 -static ssize_t evtchn_read(struct file *file, char *buf,
   17.87 -                           size_t count, loff_t *ppos)
   17.88 -{
   17.89 -    int rc;
   17.90 -    unsigned int c, p, bytes1 = 0, bytes2 = 0;
   17.91 -    DECLARE_WAITQUEUE(wait, current);
   17.92 -
   17.93 -    add_wait_queue(&evtchn_wait, &wait);
   17.94 -
   17.95 -    count &= ~1; /* even number of bytes */
   17.96 -
   17.97 -    if ( count == 0 )
   17.98 -    {
   17.99 -        rc = 0;
  17.100 -        goto out;
  17.101 -    }
  17.102 -
  17.103 -    if ( count > PAGE_SIZE )
  17.104 -        count = PAGE_SIZE;
  17.105 -
  17.106 -    for ( ; ; )
  17.107 -    {
  17.108 -        set_current_state(TASK_INTERRUPTIBLE);
  17.109 -
  17.110 -        if ( (c = ring_cons) != (p = ring_prod) )
  17.111 -            break;
  17.112 -
  17.113 -        if ( ring_overflow )
  17.114 -        {
  17.115 -            rc = -EFBIG;
  17.116 -            goto out;
  17.117 -        }
  17.118 -
  17.119 -        if ( file->f_flags & O_NONBLOCK )
  17.120 -        {
  17.121 -            rc = -EAGAIN;
  17.122 -            goto out;
  17.123 -        }
  17.124 -
  17.125 -        if ( signal_pending(current) )
  17.126 -        {
  17.127 -            rc = -ERESTARTSYS;
  17.128 -            goto out;
  17.129 -        }
  17.130 -
  17.131 -        schedule();
  17.132 -    }
  17.133 -
  17.134 -    /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */
  17.135 -    if ( ((c ^ p) & RING_SIZE) != 0 )
  17.136 -    {
  17.137 -        bytes1 = (RING_SIZE - RING_MASK(c)) * sizeof(u16);
  17.138 -        bytes2 = RING_MASK(p) * sizeof(u16);
  17.139 -    }
  17.140 -    else
  17.141 -    {
  17.142 -        bytes1 = (p - c) * sizeof(u16);
  17.143 -        bytes2 = 0;
  17.144 -    }
  17.145 -
  17.146 -    /* Truncate chunks according to caller's maximum byte count. */
  17.147 -    if ( bytes1 > count )
  17.148 -    {
  17.149 -        bytes1 = count;
  17.150 -        bytes2 = 0;
  17.151 -    }
  17.152 -    else if ( (bytes1 + bytes2) > count )
  17.153 -    {
  17.154 -        bytes2 = count - bytes1;
  17.155 -    }
  17.156 -
  17.157 -    if ( copy_to_user(buf, &ring[RING_MASK(c)], bytes1) ||
  17.158 -         ((bytes2 != 0) && copy_to_user(&buf[bytes1], &ring[0], bytes2)) )
  17.159 -    {
  17.160 -        rc = -EFAULT;
  17.161 -        goto out;
  17.162 -    }
  17.163 -
  17.164 -    ring_cons += (bytes1 + bytes2) / sizeof(u16);
  17.165 -
  17.166 -    rc = bytes1 + bytes2;
  17.167 -
  17.168 - out:
  17.169 -    __set_current_state(TASK_RUNNING);
  17.170 -    remove_wait_queue(&evtchn_wait, &wait);
  17.171 -    return rc;
  17.172 -}
  17.173 -
  17.174 -static ssize_t evtchn_write(struct file *file, const char *buf,
  17.175 -                            size_t count, loff_t *ppos)
  17.176 -{
  17.177 -    int  rc, i;
  17.178 -    u16 *kbuf = (u16 *)get_free_page(GFP_KERNEL);
  17.179 -
  17.180 -    if ( kbuf == NULL )
  17.181 -        return -ENOMEM;
  17.182 -
  17.183 -    count &= ~1; /* even number of bytes */
  17.184 -
  17.185 -    if ( count == 0 )
  17.186 -    {
  17.187 -        rc = 0;
  17.188 -        goto out;
  17.189 -    }
  17.190 -
  17.191 -    if ( count > PAGE_SIZE )
  17.192 -        count = PAGE_SIZE;
  17.193 -
  17.194 -    if ( copy_from_user(kbuf, buf, count) != 0 )
  17.195 -    {
  17.196 -        rc = -EFAULT;
  17.197 -        goto out;
  17.198 -    }
  17.199 -
  17.200 -    spin_lock_irq(&lock);
  17.201 -    for ( i = 0; i < (count/2); i++ )
  17.202 -        if ( test_bit(kbuf[i], &bound_ports[0]) )
  17.203 -            unmask_evtchn(kbuf[i]);
  17.204 -    spin_unlock_irq(&lock);
  17.205 -
  17.206 -    rc = count;
  17.207 -
  17.208 - out:
  17.209 -    free_page((unsigned long)kbuf);
  17.210 -    return rc;
  17.211 -}
  17.212 -
  17.213 -static int evtchn_ioctl(struct inode *inode, struct file *file,
  17.214 -                        unsigned int cmd, unsigned long arg)
  17.215 -{
  17.216 -    int rc = 0;
  17.217 -    
  17.218 -    spin_lock_irq(&lock);
  17.219 -    
  17.220 -    switch ( cmd )
  17.221 -    {
  17.222 -    case EVTCHN_RESET:
  17.223 -        __evtchn_reset_buffer_ring();
  17.224 -        break;
  17.225 -    case EVTCHN_BIND:
  17.226 -        if ( !test_and_set_bit(arg, &bound_ports[0]) )
  17.227 -            unmask_evtchn(arg);
  17.228 -        else
  17.229 -            rc = -EINVAL;
  17.230 -        break;
  17.231 -    case EVTCHN_UNBIND:
  17.232 -        if ( test_and_clear_bit(arg, &bound_ports[0]) )
  17.233 -            mask_evtchn(arg);
  17.234 -        else
  17.235 -            rc = -EINVAL;
  17.236 -        break;
  17.237 -    default:
  17.238 -        rc = -ENOSYS;
  17.239 -        break;
  17.240 -    }
  17.241 -
  17.242 -    spin_unlock_irq(&lock);   
  17.243 -
  17.244 -    return rc;
  17.245 -}
  17.246 -
  17.247 -static unsigned int evtchn_poll(struct file *file, poll_table *wait)
  17.248 -{
  17.249 -    unsigned int mask = POLLOUT | POLLWRNORM;
  17.250 -    poll_wait(file, &evtchn_wait, wait);
  17.251 -    if ( ring_cons != ring_prod )
  17.252 -        mask |= POLLIN | POLLRDNORM;
  17.253 -    if ( ring_overflow )
  17.254 -        mask = POLLERR;
  17.255 -    return mask;
  17.256 -}
  17.257 -
  17.258 -static int evtchn_fasync(int fd, struct file *filp, int on)
  17.259 -{
  17.260 -    return fasync_helper(fd, filp, on, &evtchn_async_queue);
  17.261 -}
  17.262 -
  17.263 -static int evtchn_open(struct inode *inode, struct file *filp)
  17.264 -{
  17.265 -    u16 *_ring;
  17.266 -
  17.267 -    if ( test_and_set_bit(0, &evtchn_dev_inuse) )
  17.268 -        return -EBUSY;
  17.269 -
  17.270 -    /* Allocate outside locked region so that we can use GFP_KERNEL. */
  17.271 -    if ( (_ring = (u16 *)get_free_page(GFP_KERNEL)) == NULL )
  17.272 -        return -ENOMEM;
  17.273 -
  17.274 -    spin_lock_irq(&lock);
  17.275 -    ring = _ring;
  17.276 -    __evtchn_reset_buffer_ring();
  17.277 -    spin_unlock_irq(&lock);
  17.278 -
  17.279 -    MOD_INC_USE_COUNT;
  17.280 -
  17.281 -    return 0;
  17.282 -}
  17.283 -
  17.284 -static int evtchn_release(struct inode *inode, struct file *filp)
  17.285 -{
  17.286 -    int i;
  17.287 -
  17.288 -    spin_lock_irq(&lock);
  17.289 -    if ( ring != NULL )
  17.290 -    {
  17.291 -        free_page((unsigned long)ring);
  17.292 -        ring = NULL;
  17.293 -    }
  17.294 -    for ( i = 0; i < NR_EVENT_CHANNELS; i++ )
  17.295 -        if ( test_and_clear_bit(i, &bound_ports[0]) )
  17.296 -            mask_evtchn(i);
  17.297 -    spin_unlock_irq(&lock);
  17.298 -
  17.299 -    evtchn_dev_inuse = 0;
  17.300 -
  17.301 -    MOD_DEC_USE_COUNT;
  17.302 -
  17.303 -    return 0;
  17.304 -}
  17.305 -
  17.306 -static struct file_operations evtchn_fops = {
  17.307 -    owner:    THIS_MODULE,
  17.308 -    read:     evtchn_read,
  17.309 -    write:    evtchn_write,
  17.310 -    ioctl:    evtchn_ioctl,
  17.311 -    poll:     evtchn_poll,
  17.312 -    fasync:   evtchn_fasync,
  17.313 -    open:     evtchn_open,
  17.314 -    release:  evtchn_release
  17.315 -};
  17.316 -
  17.317 -static struct miscdevice evtchn_miscdev = {
  17.318 -    minor:    EVTCHN_MINOR,
  17.319 -    name:     "evtchn",
  17.320 -    fops:     &evtchn_fops
  17.321 -};
  17.322 -
  17.323 -static int __init init_module(void)
  17.324 -{
  17.325 -    devfs_handle_t symlink_handle;
  17.326 -    int            err, pos;
  17.327 -    char           link_dest[64];
  17.328 -
  17.329 -    /* (DEVFS) create '/dev/misc/evtchn'. */
  17.330 -    err = misc_register(&evtchn_miscdev);
  17.331 -    if ( err != 0 )
  17.332 -    {
  17.333 -        printk(KERN_ALERT "Could not register /dev/misc/evtchn\n");
  17.334 -        return err;
  17.335 -    }
  17.336 -
  17.337 -    /* (DEVFS) create directory '/dev/xen'. */
  17.338 -    xen_dev_dir = devfs_mk_dir(NULL, "xen", NULL);
  17.339 -
  17.340 -    /* (DEVFS) &link_dest[pos] == '../misc/evtchn'. */
  17.341 -    pos = devfs_generate_path(evtchn_miscdev.devfs_handle, 
  17.342 -                              &link_dest[3], 
  17.343 -                              sizeof(link_dest) - 3);
  17.344 -    if ( pos >= 0 )
  17.345 -        strncpy(&link_dest[pos], "../", 3);
  17.346 -
  17.347 -    /* (DEVFS) symlink '/dev/xen/evtchn' -> '../misc/evtchn'. */
  17.348 -    (void)devfs_mk_symlink(xen_dev_dir, 
  17.349 -                           "evtchn", 
  17.350 -                           DEVFS_FL_DEFAULT, 
  17.351 -                           &link_dest[pos],
  17.352 -                           &symlink_handle, 
  17.353 -                           NULL);
  17.354 -
  17.355 -    /* (DEVFS) automatically destroy the symlink with its destination. */
  17.356 -    devfs_auto_unregister(evtchn_miscdev.devfs_handle, symlink_handle);
  17.357 -
  17.358 -    printk("Event-channel device installed.\n");
  17.359 -
  17.360 -    return 0;
  17.361 -}
  17.362 -
  17.363 -static void cleanup_module(void)
  17.364 -{
  17.365 -    misc_deregister(&evtchn_miscdev);
  17.366 -}
  17.367 -
  17.368 -module_init(init_module);
  17.369 -module_exit(cleanup_module);
    18.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/common.h	Fri Jul 23 14:11:01 2004 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,95 +0,0 @@
    18.4 -/******************************************************************************
    18.5 - * arch/xen/drivers/netif/backend/common.h
    18.6 - */
    18.7 -
    18.8 -#ifndef __NETIF__BACKEND__COMMON_H__
    18.9 -#define __NETIF__BACKEND__COMMON_H__
   18.10 -
   18.11 -#include <linux/config.h>
   18.12 -#include <linux/module.h>
   18.13 -#include <linux/interrupt.h>
   18.14 -#include <linux/slab.h>
   18.15 -#include <linux/ip.h>
   18.16 -#include <linux/in.h>
   18.17 -#include <linux/netdevice.h>
   18.18 -#include <linux/etherdevice.h>
   18.19 -#include <asm/ctrl_if.h>
   18.20 -#include <asm/io.h>
   18.21 -#include "../netif.h"
   18.22 -
   18.23 -#if 0
   18.24 -#define ASSERT(_p) \
   18.25 -    if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s", #_p , \
   18.26 -    __LINE__, __FILE__); *(int*)0=0; }
   18.27 -#define DPRINTK(_f, _a...) printk(KERN_ALERT "(file=%s, line=%d) " _f, \
   18.28 -                           __FILE__ , __LINE__ , ## _a )
   18.29 -#else
   18.30 -#define ASSERT(_p) ((void)0)
   18.31 -#define DPRINTK(_f, _a...) ((void)0)
   18.32 -#endif
   18.33 -
   18.34 -typedef struct netif_st {
   18.35 -    /* Unique identifier for this interface. */
   18.36 -    domid_t          domid;
   18.37 -    unsigned int     handle;
   18.38 -
   18.39 -    /* Physical parameters of the comms window. */
   18.40 -    unsigned long    tx_shmem_frame;
   18.41 -    unsigned long    rx_shmem_frame;
   18.42 -    unsigned int     evtchn;
   18.43 -    int              irq;
   18.44 -
   18.45 -    /* The shared rings and indexes. */
   18.46 -    netif_tx_interface_t *tx;
   18.47 -    netif_rx_interface_t *rx;
   18.48 -
   18.49 -    /* Private indexes into shared ring. */
   18.50 -    NETIF_RING_IDX rx_req_cons;
   18.51 -    NETIF_RING_IDX rx_resp_prod; /* private version of shared variable */
   18.52 -    NETIF_RING_IDX tx_req_cons;
   18.53 -    NETIF_RING_IDX tx_resp_prod; /* private version of shared variable */
   18.54 -
   18.55 -    /* Transmit shaping: allow 'credit_bytes' every 'credit_usec'. */
   18.56 -    unsigned long   credit_bytes;
   18.57 -    unsigned long   credit_usec;
   18.58 -    unsigned long   remaining_credit;
   18.59 -    struct timer_list credit_timeout;
   18.60 -
   18.61 -    /* Miscellaneous private stuff. */
   18.62 -    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
   18.63 -    /*
   18.64 -     * DISCONNECT response is deferred until pending requests are ack'ed.
   18.65 -     * We therefore need to store the id from the original request.
   18.66 -     */
   18.67 -    u8               disconnect_rspid;
   18.68 -    struct netif_st *hash_next;
   18.69 -    struct list_head list;  /* scheduling list */
   18.70 -    atomic_t         refcnt;
   18.71 -    spinlock_t       rx_lock, tx_lock;
   18.72 -    struct net_device *dev;
   18.73 -    struct net_device_stats stats;
   18.74 -} netif_t;
   18.75 -
   18.76 -void netif_create(netif_be_create_t *create);
   18.77 -void netif_destroy(netif_be_destroy_t *destroy);
   18.78 -void netif_connect(netif_be_connect_t *connect);
   18.79 -int  netif_disconnect(netif_be_disconnect_t *disconnect, u8 rsp_id);
   18.80 -void __netif_disconnect_complete(netif_t *netif);
   18.81 -netif_t *netif_find_by_handle(domid_t domid, unsigned int handle);
   18.82 -#define netif_get(_b) (atomic_inc(&(_b)->refcnt))
   18.83 -#define netif_put(_b)                             \
   18.84 -    do {                                          \
   18.85 -        if ( atomic_dec_and_test(&(_b)->refcnt) ) \
   18.86 -            __netif_disconnect_complete(_b);      \
   18.87 -    } while (0)
   18.88 -
   18.89 -void netif_interface_init(void);
   18.90 -void netif_ctrlif_init(void);
   18.91 -
   18.92 -void netif_deschedule(netif_t *netif);
   18.93 -
   18.94 -int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev);
   18.95 -struct net_device_stats *netif_be_get_stats(struct net_device *dev);
   18.96 -void netif_be_int(int irq, void *dev_id, struct pt_regs *regs);
   18.97 -
   18.98 -#endif /* __NETIF__BACKEND__COMMON_H__ */
    19.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/control.c	Fri Jul 23 14:11:01 2004 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,65 +0,0 @@
    19.4 -/******************************************************************************
    19.5 - * arch/xen/drivers/netif/backend/control.c
    19.6 - * 
    19.7 - * Routines for interfacing with the control plane.
    19.8 - * 
    19.9 - * Copyright (c) 2004, Keir Fraser
   19.10 - */
   19.11 -
   19.12 -#include "common.h"
   19.13 -
   19.14 -static void netif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id)
   19.15 -{
   19.16 -    switch ( msg->subtype )
   19.17 -    {
   19.18 -    case CMSG_NETIF_BE_CREATE:
   19.19 -        if ( msg->length != sizeof(netif_be_create_t) )
   19.20 -            goto parse_error;
   19.21 -        netif_create((netif_be_create_t *)&msg->msg[0]);
   19.22 -        break;        
   19.23 -    case CMSG_NETIF_BE_DESTROY:
   19.24 -        if ( msg->length != sizeof(netif_be_destroy_t) )
   19.25 -            goto parse_error;
   19.26 -        netif_destroy((netif_be_destroy_t *)&msg->msg[0]);
   19.27 -        break;        
   19.28 -    case CMSG_NETIF_BE_CONNECT:
   19.29 -        if ( msg->length != sizeof(netif_be_connect_t) )
   19.30 -            goto parse_error;
   19.31 -        netif_connect((netif_be_connect_t *)&msg->msg[0]);
   19.32 -        break;        
   19.33 -    case CMSG_NETIF_BE_DISCONNECT:
   19.34 -        if ( msg->length != sizeof(netif_be_disconnect_t) )
   19.35 -            goto parse_error;
   19.36 -        if ( !netif_disconnect((netif_be_disconnect_t *)&msg->msg[0],msg->id) )
   19.37 -            return; /* Sending the response is deferred until later. */
   19.38 -        break;        
   19.39 -    default:
   19.40 -        goto parse_error;
   19.41 -    }
   19.42 -
   19.43 -    ctrl_if_send_response(msg);
   19.44 -    return;
   19.45 -
   19.46 - parse_error:
   19.47 -    DPRINTK("Parse error while reading message subtype %d, len %d\n",
   19.48 -            msg->subtype, msg->length);
   19.49 -    msg->length = 0;
   19.50 -    ctrl_if_send_response(msg);
   19.51 -}
   19.52 -
   19.53 -void netif_ctrlif_init(void)
   19.54 -{
   19.55 -    ctrl_msg_t                       cmsg;
   19.56 -    netif_be_driver_status_changed_t st;
   19.57 -
   19.58 -    (void)ctrl_if_register_receiver(CMSG_NETIF_BE, netif_ctrlif_rx,
   19.59 -                                    CALLBACK_IN_BLOCKING_CONTEXT);
   19.60 -
   19.61 -    /* Send a driver-UP notification to the domain controller. */
   19.62 -    cmsg.type      = CMSG_NETIF_BE;
   19.63 -    cmsg.subtype   = CMSG_NETIF_BE_DRIVER_STATUS_CHANGED;
   19.64 -    cmsg.length    = sizeof(netif_be_driver_status_changed_t);
   19.65 -    st.status      = NETIF_DRIVER_STATUS_UP;
   19.66 -    memcpy(cmsg.msg, &st, sizeof(st));
   19.67 -    ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
   19.68 -}
    20.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/interface.c	Fri Jul 23 14:11:01 2004 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,282 +0,0 @@
    20.4 -/******************************************************************************
    20.5 - * arch/xen/drivers/netif/backend/interface.c
    20.6 - * 
    20.7 - * Network-device interface management.
    20.8 - * 
    20.9 - * Copyright (c) 2004, Keir Fraser
   20.10 - */
   20.11 -
   20.12 -#include "common.h"
   20.13 -#include <linux/rtnetlink.h>
   20.14 -
   20.15 -#define NETIF_HASHSZ 1024
   20.16 -#define NETIF_HASH(_d,_h) (((int)(_d)^(int)(_h))&(NETIF_HASHSZ-1))
   20.17 -
   20.18 -static netif_t *netif_hash[NETIF_HASHSZ];
   20.19 -
   20.20 -netif_t *netif_find_by_handle(domid_t domid, unsigned int handle)
   20.21 -{
   20.22 -    netif_t *netif = netif_hash[NETIF_HASH(domid, handle)];
   20.23 -    while ( (netif != NULL) && 
   20.24 -            ((netif->domid != domid) || (netif->handle != handle)) )
   20.25 -        netif = netif->hash_next;
   20.26 -    return netif;
   20.27 -}
   20.28 -
   20.29 -void __netif_disconnect_complete(netif_t *netif)
   20.30 -{
   20.31 -    ctrl_msg_t            cmsg;
   20.32 -    netif_be_disconnect_t disc;
   20.33 -
   20.34 -    /*
   20.35 -     * These can't be done in __netif_disconnect() because at that point there
   20.36 -     * may be outstanding requests at the disc whose asynchronous responses
   20.37 -     * must still be notified to the remote driver.
   20.38 -     */
   20.39 -    unbind_evtchn_from_irq(netif->evtchn);
   20.40 -    vfree(netif->tx); /* Frees netif->rx as well. */
   20.41 -    rtnl_lock();
   20.42 -    (void)dev_close(netif->dev);
   20.43 -    rtnl_unlock();
   20.44 -
   20.45 -    /* Construct the deferred response message. */
   20.46 -    cmsg.type         = CMSG_NETIF_BE;
   20.47 -    cmsg.subtype      = CMSG_NETIF_BE_DISCONNECT;
   20.48 -    cmsg.id           = netif->disconnect_rspid;
   20.49 -    cmsg.length       = sizeof(netif_be_disconnect_t);
   20.50 -    disc.domid        = netif->domid;
   20.51 -    disc.netif_handle = netif->handle;
   20.52 -    disc.status       = NETIF_BE_STATUS_OKAY;
   20.53 -    memcpy(cmsg.msg, &disc, sizeof(disc));
   20.54 -
   20.55 -    /*
   20.56 -     * Make sure message is constructed /before/ status change, because
   20.57 -     * after the status change the 'netif' structure could be deallocated at
   20.58 -     * any time. Also make sure we send the response /after/ status change,
   20.59 -     * as otherwise a subsequent CONNECT request could spuriously fail if
   20.60 -     * another CPU doesn't see the status change yet.
   20.61 -     */
   20.62 -    mb();
   20.63 -    if ( netif->status != DISCONNECTING )
   20.64 -        BUG();
   20.65 -    netif->status = DISCONNECTED;
   20.66 -    mb();
   20.67 -
   20.68 -    /* Send the successful response. */
   20.69 -    ctrl_if_send_response(&cmsg);
   20.70 -}
   20.71 -
   20.72 -void netif_create(netif_be_create_t *create)
   20.73 -{
   20.74 -    int                err = 0;
   20.75 -    domid_t            domid  = create->domid;
   20.76 -    unsigned int       handle = create->netif_handle;
   20.77 -    struct net_device *dev;
   20.78 -    netif_t          **pnetif, *netif;
   20.79 -    char               name[IFNAMSIZ] = {};
   20.80 -
   20.81 -    snprintf(name, IFNAMSIZ - 1, "vif%u.%u", domid, handle);
   20.82 -    dev = alloc_netdev(sizeof(netif_t), name, ether_setup);
   20.83 -    if ( dev == NULL )
   20.84 -    {
   20.85 -        DPRINTK("Could not create netif: out of memory\n");
   20.86 -        create->status = NETIF_BE_STATUS_OUT_OF_MEMORY;
   20.87 -        return;
   20.88 -    }
   20.89 -
   20.90 -    netif = dev->priv;
   20.91 -    memset(netif, 0, sizeof(*netif));
   20.92 -    netif->domid  = domid;
   20.93 -    netif->handle = handle;
   20.94 -    netif->status = DISCONNECTED;
   20.95 -    spin_lock_init(&netif->rx_lock);
   20.96 -    spin_lock_init(&netif->tx_lock);
   20.97 -    atomic_set(&netif->refcnt, 0);
   20.98 -    netif->dev = dev;
   20.99 -
  20.100 -    netif->credit_bytes = netif->remaining_credit = ~0UL;
  20.101 -    netif->credit_usec  = 0UL;
  20.102 -    /*init_ac_timer(&new_vif->credit_timeout);*/
  20.103 -
  20.104 -    pnetif = &netif_hash[NETIF_HASH(domid, handle)];
  20.105 -    while ( *pnetif != NULL )
  20.106 -    {
  20.107 -        if ( ((*pnetif)->domid == domid) && ((*pnetif)->handle == handle) )
  20.108 -        {
  20.109 -            DPRINTK("Could not create netif: already exists\n");
  20.110 -            create->status = NETIF_BE_STATUS_INTERFACE_EXISTS;
  20.111 -            kfree(dev);
  20.112 -            return;
  20.113 -        }
  20.114 -        pnetif = &(*pnetif)->hash_next;
  20.115 -    }
  20.116 -
  20.117 -    dev->hard_start_xmit = netif_be_start_xmit;
  20.118 -    dev->get_stats       = netif_be_get_stats;
  20.119 -    memcpy(dev->dev_addr, create->mac, ETH_ALEN);
  20.120 -
  20.121 -    /* Disable queuing. */
  20.122 -    dev->tx_queue_len = 0;
  20.123 -
  20.124 -    /* Force a different MAC from remote end. */
  20.125 -    dev->dev_addr[2] ^= 1;
  20.126 -
  20.127 -    if ( (err = register_netdev(dev)) != 0 )
  20.128 -    {
  20.129 -        DPRINTK("Could not register new net device %s: err=%d\n",
  20.130 -                dev->name, err);
  20.131 -        create->status = NETIF_BE_STATUS_OUT_OF_MEMORY;
  20.132 -        kfree(dev);
  20.133 -        return;
  20.134 -    }
  20.135 -
  20.136 -    netif->hash_next = *pnetif;
  20.137 -    *pnetif = netif;
  20.138 -
  20.139 -    DPRINTK("Successfully created netif\n");
  20.140 -    create->status = NETIF_BE_STATUS_OKAY;
  20.141 -}
  20.142 -
  20.143 -void netif_destroy(netif_be_destroy_t *destroy)
  20.144 -{
  20.145 -    domid_t       domid  = destroy->domid;
  20.146 -    unsigned int  handle = destroy->netif_handle;
  20.147 -    netif_t     **pnetif, *netif;
  20.148 -
  20.149 -    pnetif = &netif_hash[NETIF_HASH(domid, handle)];
  20.150 -    while ( (netif = *pnetif) != NULL )
  20.151 -    {
  20.152 -        if ( (netif->domid == domid) && (netif->handle == handle) )
  20.153 -        {
  20.154 -            if ( netif->status != DISCONNECTED )
  20.155 -                goto still_connected;
  20.156 -            goto destroy;
  20.157 -        }
  20.158 -        pnetif = &netif->hash_next;
  20.159 -    }
  20.160 -
  20.161 -    destroy->status = NETIF_BE_STATUS_INTERFACE_NOT_FOUND;
  20.162 -    return;
  20.163 -
  20.164 - still_connected:
  20.165 -    destroy->status = NETIF_BE_STATUS_INTERFACE_CONNECTED;
  20.166 -    return;
  20.167 -
  20.168 - destroy:
  20.169 -    *pnetif = netif->hash_next;
  20.170 -    unregister_netdev(netif->dev);
  20.171 -    kfree(netif->dev);
  20.172 -    destroy->status = NETIF_BE_STATUS_OKAY;
  20.173 -}
  20.174 -
  20.175 -void netif_connect(netif_be_connect_t *connect)
  20.176 -{
  20.177 -    domid_t       domid  = connect->domid;
  20.178 -    unsigned int  handle = connect->netif_handle;
  20.179 -    unsigned int  evtchn = connect->evtchn;
  20.180 -    unsigned long tx_shmem_frame = connect->tx_shmem_frame;
  20.181 -    unsigned long rx_shmem_frame = connect->rx_shmem_frame;
  20.182 -    struct vm_struct *vma;
  20.183 -    pgprot_t      prot;
  20.184 -    int           error;
  20.185 -    netif_t      *netif;
  20.186 -    struct net_device *eth0_dev;
  20.187 -
  20.188 -    netif = netif_find_by_handle(domid, handle);
  20.189 -    if ( unlikely(netif == NULL) )
  20.190 -    {
  20.191 -        DPRINTK("netif_connect attempted for non-existent netif (%u,%u)\n", 
  20.192 -                connect->domid, connect->netif_handle); 
  20.193 -        connect->status = NETIF_BE_STATUS_INTERFACE_NOT_FOUND;
  20.194 -        return;
  20.195 -    }
  20.196 -
  20.197 -    if ( netif->status != DISCONNECTED )
  20.198 -    {
  20.199 -        connect->status = NETIF_BE_STATUS_INTERFACE_CONNECTED;
  20.200 -        return;
  20.201 -    }
  20.202 -
  20.203 -    if ( (vma = get_vm_area(2*PAGE_SIZE, VM_IOREMAP)) == NULL )
  20.204 -    {
  20.205 -        connect->status = NETIF_BE_STATUS_OUT_OF_MEMORY;
  20.206 -        return;
  20.207 -    }
  20.208 -
  20.209 -    prot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED);
  20.210 -    error  = direct_remap_area_pages(&init_mm, 
  20.211 -                                     VMALLOC_VMADDR(vma->addr),
  20.212 -                                     tx_shmem_frame<<PAGE_SHIFT, PAGE_SIZE,
  20.213 -                                     prot, domid);
  20.214 -    error |= direct_remap_area_pages(&init_mm, 
  20.215 -                                     VMALLOC_VMADDR(vma->addr) + PAGE_SIZE,
  20.216 -                                     rx_shmem_frame<<PAGE_SHIFT, PAGE_SIZE,
  20.217 -                                     prot, domid);
  20.218 -    if ( error != 0 )
  20.219 -    {
  20.220 -        if ( error == -ENOMEM )
  20.221 -            connect->status = NETIF_BE_STATUS_OUT_OF_MEMORY;
  20.222 -        else if ( error == -EFAULT )
  20.223 -            connect->status = NETIF_BE_STATUS_MAPPING_ERROR;
  20.224 -        else
  20.225 -            connect->status = NETIF_BE_STATUS_ERROR;
  20.226 -        vfree(vma->addr);
  20.227 -        return;
  20.228 -    }
  20.229 -
  20.230 -    netif->evtchn         = evtchn;
  20.231 -    netif->irq            = bind_evtchn_to_irq(evtchn);
  20.232 -    netif->tx_shmem_frame = tx_shmem_frame;
  20.233 -    netif->rx_shmem_frame = rx_shmem_frame;
  20.234 -    netif->tx             = 
  20.235 -        (netif_tx_interface_t *)vma->addr;
  20.236 -    netif->rx             = 
  20.237 -        (netif_rx_interface_t *)((char *)vma->addr + PAGE_SIZE);
  20.238 -    netif->status         = CONNECTED;
  20.239 -    netif_get(netif);
  20.240 -
  20.241 -    rtnl_lock();
  20.242 -    (void)dev_open(netif->dev);
  20.243 -    rtnl_unlock();
  20.244 -
  20.245 -    (void)request_irq(netif->irq, netif_be_int, 0, netif->dev->name, netif);
  20.246 -    netif_start_queue(netif->dev);
  20.247 -
  20.248 -    connect->status = NETIF_BE_STATUS_OKAY;
  20.249 -}
  20.250 -
  20.251 -int netif_disconnect(netif_be_disconnect_t *disconnect, u8 rsp_id)
  20.252 -{
  20.253 -    domid_t       domid  = disconnect->domid;
  20.254 -    unsigned int  handle = disconnect->netif_handle;
  20.255 -    netif_t      *netif;
  20.256 -
  20.257 -    netif = netif_find_by_handle(domid, handle);
  20.258 -    if ( unlikely(netif == NULL) )
  20.259 -    {
  20.260 -        DPRINTK("netif_disconnect attempted for non-existent netif"
  20.261 -                " (%u,%u)\n", disconnect->domid, disconnect->netif_handle); 
  20.262 -        disconnect->status = NETIF_BE_STATUS_INTERFACE_NOT_FOUND;
  20.263 -        return 1; /* Caller will send response error message. */
  20.264 -    }
  20.265 -
  20.266 -    if ( netif->status == CONNECTED )
  20.267 -    {
  20.268 -        netif->status = DISCONNECTING;
  20.269 -        netif->disconnect_rspid = rsp_id;
  20.270 -        wmb(); /* Let other CPUs see the status change. */
  20.271 -        netif_stop_queue(netif->dev);
  20.272 -        free_irq(netif->irq, netif);
  20.273 -        netif_deschedule(netif);
  20.274 -        netif_put(netif);
  20.275 -        return 0; /* Caller should not send response message. */
  20.276 -    }
  20.277 -
  20.278 -    disconnect->status = NETIF_BE_STATUS_OKAY;
  20.279 -    return 1;
  20.280 -}
  20.281 -
  20.282 -void netif_interface_init(void)
  20.283 -{
  20.284 -    memset(netif_hash, 0, sizeof(netif_hash));
  20.285 -}
    21.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/main.c	Fri Jul 23 14:11:01 2004 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,775 +0,0 @@
    21.4 -/******************************************************************************
    21.5 - * arch/xen/drivers/netif/backend/main.c
    21.6 - * 
    21.7 - * Back-end of the driver for virtual block devices. This portion of the
    21.8 - * driver exports a 'unified' block-device interface that can be accessed
    21.9 - * by any operating system that implements a compatible front end. A 
   21.10 - * reference front-end implementation can be found in:
   21.11 - *  arch/xen/drivers/netif/frontend
   21.12 - * 
   21.13 - * Copyright (c) 2002-2004, K A Fraser
   21.14 - */
   21.15 -
   21.16 -#include "common.h"
   21.17 -
   21.18 -static void netif_page_release(struct page *page);
   21.19 -static void make_tx_response(netif_t *netif, 
   21.20 -                             u16      id,
   21.21 -                             s8       st);
   21.22 -static int  make_rx_response(netif_t *netif, 
   21.23 -                             u16      id, 
   21.24 -                             s8       st,
   21.25 -                             memory_t addr,
   21.26 -                             u16      size);
   21.27 -
   21.28 -static void net_tx_action(unsigned long unused);
   21.29 -static DECLARE_TASKLET(net_tx_tasklet, net_tx_action, 0);
   21.30 -
   21.31 -static void net_rx_action(unsigned long unused);
   21.32 -static DECLARE_TASKLET(net_rx_tasklet, net_rx_action, 0);
   21.33 -
   21.34 -static struct sk_buff_head rx_queue;
   21.35 -static multicall_entry_t rx_mcl[NETIF_RX_RING_SIZE*2];
   21.36 -static mmu_update_t rx_mmu[NETIF_RX_RING_SIZE*3];
   21.37 -static unsigned char rx_notify[NR_EVENT_CHANNELS];
   21.38 -
   21.39 -/* Don't currently gate addition of an interface to the tx scheduling list. */
   21.40 -#define tx_work_exists(_if) (1)
   21.41 -
   21.42 -#define MAX_PENDING_REQS 256
   21.43 -static unsigned long mmap_vstart;
   21.44 -#define MMAP_VADDR(_req) (mmap_vstart + ((_req) * PAGE_SIZE))
   21.45 -
   21.46 -#define PKT_PROT_LEN (ETH_HLEN + 20)
   21.47 -
   21.48 -static struct {
   21.49 -    netif_tx_request_t req;
   21.50 -    netif_t *netif;
   21.51 -} pending_tx_info[MAX_PENDING_REQS];
   21.52 -static u16 pending_ring[MAX_PENDING_REQS];
   21.53 -typedef unsigned int PEND_RING_IDX;
   21.54 -#define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1))
   21.55 -static PEND_RING_IDX pending_prod, pending_cons;
   21.56 -#define NR_PENDING_REQS (MAX_PENDING_REQS - pending_prod + pending_cons)
   21.57 -
   21.58 -/* Freed TX SKBs get batched on this ring before return to pending_ring. */
   21.59 -static u16 dealloc_ring[MAX_PENDING_REQS];
   21.60 -static spinlock_t dealloc_lock = SPIN_LOCK_UNLOCKED;
   21.61 -static PEND_RING_IDX dealloc_prod, dealloc_cons;
   21.62 -
   21.63 -static struct sk_buff_head tx_queue;
   21.64 -static multicall_entry_t tx_mcl[MAX_PENDING_REQS];
   21.65 -
   21.66 -static struct list_head net_schedule_list;
   21.67 -static spinlock_t net_schedule_list_lock;
   21.68 -
   21.69 -#define MAX_MFN_ALLOC 64
   21.70 -static unsigned long mfn_list[MAX_MFN_ALLOC];
   21.71 -static unsigned int alloc_index = 0;
   21.72 -static spinlock_t mfn_lock = SPIN_LOCK_UNLOCKED;
   21.73 -
   21.74 -static void __refresh_mfn_list(void)
   21.75 -{
   21.76 -    int ret = HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
   21.77 -                                    mfn_list, MAX_MFN_ALLOC);
   21.78 -    if ( unlikely(ret != MAX_MFN_ALLOC) )
   21.79 -        BUG();
   21.80 -    alloc_index = MAX_MFN_ALLOC;
   21.81 -}
   21.82 -
   21.83 -static unsigned long get_new_mfn(void)
   21.84 -{
   21.85 -    unsigned long mfn, flags;
   21.86 -    spin_lock_irqsave(&mfn_lock, flags);
   21.87 -    if ( alloc_index == 0 )
   21.88 -        __refresh_mfn_list();
   21.89 -    mfn = mfn_list[--alloc_index];
   21.90 -    spin_unlock_irqrestore(&mfn_lock, flags);
   21.91 -    return mfn;
   21.92 -}
   21.93 -
   21.94 -static void dealloc_mfn(unsigned long mfn)
   21.95 -{
   21.96 -    unsigned long flags;
   21.97 -    spin_lock_irqsave(&mfn_lock, flags);
   21.98 -    if ( alloc_index != MAX_MFN_ALLOC )
   21.99 -        mfn_list[alloc_index++] = mfn;
  21.100 -    else if ( HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, &mfn, 1) != 1 )
  21.101 -        BUG();
  21.102 -    spin_unlock_irqrestore(&mfn_lock, flags);
  21.103 -}
  21.104 -
  21.105 -static inline void maybe_schedule_tx_action(void)
  21.106 -{
  21.107 -    smp_mb();
  21.108 -    if ( (NR_PENDING_REQS < (MAX_PENDING_REQS/2)) &&
  21.109 -         !list_empty(&net_schedule_list) )
  21.110 -        tasklet_schedule(&net_tx_tasklet);
  21.111 -}
  21.112 -
  21.113 -/*
  21.114 - * This is the primary RECEIVE function for a network interface.
  21.115 - * Note that, from the p.o.v. of /this/ OS it looks like a transmit.
  21.116 - */
  21.117 -int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev)
  21.118 -{
  21.119 -    netif_t *netif = (netif_t *)dev->priv;
  21.120 -
  21.121 -    ASSERT(skb->dev == dev);
  21.122 -
  21.123 -    /* Drop the packet if the target domain has no receive buffers. */
  21.124 -    if ( (netif->rx_req_cons == netif->rx->req_prod) ||
  21.125 -         ((netif->rx_req_cons-netif->rx_resp_prod) == NETIF_RX_RING_SIZE) )
  21.126 -        goto drop;
  21.127 -
  21.128 -    /*
  21.129 -     * We do not copy the packet unless:
  21.130 -     *  1. The data is shared; or
  21.131 -     *  2. It spans a page boundary; or
  21.132 -     *  3. We cannot be sure the whole data page is allocated.
  21.133 -     * The copying method is taken from skb_copy().
  21.134 -     * NB. We also couldn't cope with fragmented packets, but we won't get
  21.135 -     *     any because we not advertise the NETIF_F_SG feature.
  21.136 -     */
  21.137 -    if ( skb_shared(skb) || skb_cloned(skb) || 
  21.138 -         (((unsigned long)skb->end ^ (unsigned long)skb->head) & PAGE_MASK) ||
  21.139 -         ((skb->end - skb->head) < (PAGE_SIZE/2)) )
  21.140 -    {
  21.141 -        struct sk_buff *nskb = alloc_skb(PAGE_SIZE-1024, GFP_ATOMIC);
  21.142 -        int hlen = skb->data - skb->head;
  21.143 -        if ( unlikely(nskb == NULL) )
  21.144 -            goto drop;
  21.145 -        skb_reserve(nskb, hlen);
  21.146 -        __skb_put(nskb, skb->len);
  21.147 -        (void)skb_copy_bits(skb, -hlen, nskb->head, hlen + skb->len);
  21.148 -        nskb->dev = skb->dev;
  21.149 -        dev_kfree_skb(skb);
  21.150 -        skb = nskb;
  21.151 -    }
  21.152 -
  21.153 -    netif->rx_req_cons++;
  21.154 -
  21.155 -    skb_queue_tail(&rx_queue, skb);
  21.156 -    tasklet_schedule(&net_rx_tasklet);
  21.157 -
  21.158 -    return 0;
  21.159 -
  21.160 - drop:
  21.161 -    netif->stats.rx_dropped++;
  21.162 -    dev_kfree_skb(skb);
  21.163 -    return 0;
  21.164 -}
  21.165 -
  21.166 -#if 0
  21.167 -static void xen_network_done_notify(void)
  21.168 -{
  21.169 -    static struct net_device *eth0_dev = NULL;
  21.170 -    if ( unlikely(eth0_dev == NULL) )
  21.171 -        eth0_dev = __dev_get_by_name("eth0");
  21.172 -    netif_rx_schedule(eth0_dev);
  21.173 -}
  21.174 -/* 
  21.175 - * Add following to poll() function in NAPI driver (Tigon3 is example):
  21.176 - *  if ( xen_network_done() )
  21.177 - *      tg3_enable_ints(tp); 
  21.178 - */
  21.179 -int xen_network_done(void)
  21.180 -{
  21.181 -    return skb_queue_empty(&rx_queue);
  21.182 -}
  21.183 -#endif
  21.184 -
  21.185 -static void net_rx_action(unsigned long unused)
  21.186 -{
  21.187 -    netif_t *netif;
  21.188 -    s8 status;
  21.189 -    u16 size, id, evtchn;
  21.190 -    mmu_update_t *mmu;
  21.191 -    multicall_entry_t *mcl;
  21.192 -    unsigned long vdata, mdata, new_mfn;
  21.193 -    struct sk_buff_head rxq;
  21.194 -    struct sk_buff *skb;
  21.195 -    u16 notify_list[NETIF_RX_RING_SIZE];
  21.196 -    int notify_nr = 0;
  21.197 -
  21.198 -    skb_queue_head_init(&rxq);
  21.199 -
  21.200 -    mcl = rx_mcl;
  21.201 -    mmu = rx_mmu;
  21.202 -    while ( (skb = skb_dequeue(&rx_queue)) != NULL )
  21.203 -    {
  21.204 -        netif   = (netif_t *)skb->dev->priv;
  21.205 -        vdata   = (unsigned long)skb->data;
  21.206 -        mdata   = virt_to_machine(vdata);
  21.207 -        new_mfn = get_new_mfn();
  21.208 -        
  21.209 -        mmu[0].ptr  = (new_mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
  21.210 -        mmu[0].val  = __pa(vdata) >> PAGE_SHIFT;        
  21.211 -        mmu[1].val  = (unsigned long)(netif->domid<<16) & ~0xFFFFUL;
  21.212 -        mmu[1].ptr  = (unsigned long)(netif->domid<< 0) & ~0xFFFFUL;
  21.213 -        mmu[1].ptr |= MMU_EXTENDED_COMMAND;
  21.214 -        mmu[1].val |= MMUEXT_SET_SUBJECTDOM;
  21.215 -        mmu[2].ptr  = (mdata & PAGE_MASK) | MMU_EXTENDED_COMMAND;
  21.216 -        mmu[2].val  = MMUEXT_REASSIGN_PAGE;
  21.217 -
  21.218 -        mcl[0].op = __HYPERVISOR_update_va_mapping;
  21.219 -        mcl[0].args[0] = vdata >> PAGE_SHIFT;
  21.220 -        mcl[0].args[1] = (new_mfn << PAGE_SHIFT) | __PAGE_KERNEL;
  21.221 -        mcl[0].args[2] = 0;
  21.222 -        mcl[1].op = __HYPERVISOR_mmu_update;
  21.223 -        mcl[1].args[0] = (unsigned long)mmu;
  21.224 -        mcl[1].args[1] = 3;
  21.225 -        mcl[1].args[2] = 0;
  21.226 -
  21.227 -        mcl += 2;
  21.228 -        mmu += 3;
  21.229 -
  21.230 -        __skb_queue_tail(&rxq, skb);
  21.231 -
  21.232 -        /* Filled the batch queue? */
  21.233 -        if ( (mcl - rx_mcl) == ARRAY_SIZE(rx_mcl) )
  21.234 -            break;
  21.235 -    }
  21.236 -
  21.237 -    if ( mcl == rx_mcl )
  21.238 -        return;
  21.239 -
  21.240 -    mcl[-2].args[2] = UVMF_FLUSH_TLB;
  21.241 -    if ( unlikely(HYPERVISOR_multicall(rx_mcl, mcl - rx_mcl) != 0) )
  21.242 -        BUG();
  21.243 -
  21.244 -    mcl = rx_mcl;
  21.245 -    mmu = rx_mmu;
  21.246 -    while ( (skb = __skb_dequeue(&rxq)) != NULL )
  21.247 -    {
  21.248 -        netif   = (netif_t *)skb->dev->priv;
  21.249 -        size    = skb->tail - skb->data;
  21.250 -
  21.251 -        /* Rederive the machine addresses. */
  21.252 -        new_mfn = mcl[0].args[1] >> PAGE_SHIFT;
  21.253 -        mdata   = ((mmu[2].ptr & PAGE_MASK) |
  21.254 -                   ((unsigned long)skb->data & ~PAGE_MASK));
  21.255 -        
  21.256 -        phys_to_machine_mapping[__pa(skb->data) >> PAGE_SHIFT] = new_mfn;
  21.257 -        
  21.258 -        atomic_set(&(skb_shinfo(skb)->dataref), 1);
  21.259 -        skb_shinfo(skb)->nr_frags = 0;
  21.260 -        skb_shinfo(skb)->frag_list = NULL;
  21.261 -
  21.262 -        netif->stats.rx_bytes += size;
  21.263 -        netif->stats.rx_packets++;
  21.264 -
  21.265 -        /* The update_va_mapping() must not fail. */
  21.266 -        if ( unlikely(mcl[0].args[5] != 0) )
  21.267 -            BUG();
  21.268 -
  21.269 -        /* Check the reassignment error code. */
  21.270 -        status = NETIF_RSP_OKAY;
  21.271 -        if ( unlikely(mcl[1].args[5] != 0) )
  21.272 -        {
  21.273 -            DPRINTK("Failed MMU update transferring to DOM%u\n", netif->domid);
  21.274 -            dealloc_mfn(mdata >> PAGE_SHIFT);
  21.275 -            status = NETIF_RSP_ERROR;
  21.276 -        }
  21.277 -
  21.278 -        evtchn = netif->evtchn;
  21.279 -        id = netif->rx->ring[MASK_NETIF_RX_IDX(netif->rx_resp_prod)].req.id;
  21.280 -        if ( make_rx_response(netif, id, status, mdata, size) &&
  21.281 -             (rx_notify[evtchn] == 0) )
  21.282 -        {
  21.283 -            rx_notify[evtchn] = 1;
  21.284 -            notify_list[notify_nr++] = evtchn;
  21.285 -        }
  21.286 -
  21.287 -        dev_kfree_skb(skb);
  21.288 -
  21.289 -        mcl += 2;
  21.290 -        mmu += 3;
  21.291 -    }
  21.292 -
  21.293 -    while ( notify_nr != 0 )
  21.294 -    {
  21.295 -        evtchn = notify_list[--notify_nr];
  21.296 -        rx_notify[evtchn] = 0;
  21.297 -        notify_via_evtchn(evtchn);
  21.298 -    }
  21.299 -
  21.300 -    /* More work to do? */
  21.301 -    if ( !skb_queue_empty(&rx_queue) )
  21.302 -        tasklet_schedule(&net_rx_tasklet);
  21.303 -#if 0
  21.304 -    else
  21.305 -        xen_network_done_notify();
  21.306 -#endif
  21.307 -}
  21.308 -
  21.309 -struct net_device_stats *netif_be_get_stats(struct net_device *dev)
  21.310 -{
  21.311 -    netif_t *netif = dev->priv;
  21.312 -    return &netif->stats;
  21.313 -}
  21.314 -
  21.315 -static int __on_net_schedule_list(netif_t *netif)
  21.316 -{
  21.317 -    return netif->list.next != NULL;
  21.318 -}
  21.319 -
  21.320 -static void remove_from_net_schedule_list(netif_t *netif)
  21.321 -{
  21.322 -    spin_lock_irq(&net_schedule_list_lock);
  21.323 -    if ( likely(__on_net_schedule_list(netif)) )
  21.324 -    {
  21.325 -        list_del(&netif->list);
  21.326 -        netif->list.next = NULL;
  21.327 -        netif_put(netif);
  21.328 -    }
  21.329 -    spin_unlock_irq(&net_schedule_list_lock);
  21.330 -}
  21.331 -
  21.332 -static void add_to_net_schedule_list_tail(netif_t *netif)
  21.333 -{
  21.334 -    if ( __on_net_schedule_list(netif) )
  21.335 -        return;
  21.336 -
  21.337 -    spin_lock_irq(&net_schedule_list_lock);
  21.338 -    if ( !__on_net_schedule_list(netif) && (netif->status == CONNECTED) )
  21.339 -    {
  21.340 -        list_add_tail(&netif->list, &net_schedule_list);
  21.341 -        netif_get(netif);
  21.342 -    }
  21.343 -    spin_unlock_irq(&net_schedule_list_lock);
  21.344 -}
  21.345 -
  21.346 -static inline void netif_schedule_work(netif_t *netif)
  21.347 -{
  21.348 -    if ( (netif->tx_req_cons != netif->tx->req_prod) &&
  21.349 -         ((netif->tx_req_cons-netif->tx_resp_prod) != NETIF_TX_RING_SIZE) )
  21.350 -    {
  21.351 -        add_to_net_schedule_list_tail(netif);
  21.352 -        maybe_schedule_tx_action();
  21.353 -    }
  21.354 -}
  21.355 -
  21.356 -void netif_deschedule(netif_t *netif)
  21.357 -{
  21.358 -    remove_from_net_schedule_list(netif);
  21.359 -}
  21.360 -
  21.361 -#if 0
  21.362 -static void tx_credit_callback(unsigned long data)
  21.363 -{
  21.364 -    netif_t *netif = (netif_t *)data;
  21.365 -    netif->remaining_credit = netif->credit_bytes;
  21.366 -    netif_schedule_work(netif);
  21.367 -}
  21.368 -#endif
  21.369 -
  21.370 -static void net_tx_action(unsigned long unused)
  21.371 -{
  21.372 -    struct list_head *ent;
  21.373 -    struct sk_buff *skb;
  21.374 -    netif_t *netif;
  21.375 -    netif_tx_request_t txreq;
  21.376 -    u16 pending_idx;
  21.377 -    NETIF_RING_IDX i;
  21.378 -    struct page *page;
  21.379 -    multicall_entry_t *mcl;
  21.380 -    PEND_RING_IDX dc, dp;
  21.381 -
  21.382 -    if ( (dc = dealloc_cons) == (dp = dealloc_prod) )
  21.383 -        goto skip_dealloc;
  21.384 -
  21.385 -    mcl = tx_mcl;
  21.386 -    while ( dc != dp )
  21.387 -    {
  21.388 -        pending_idx = dealloc_ring[MASK_PEND_IDX(dc++)];
  21.389 -        mcl[0].op = __HYPERVISOR_update_va_mapping;
  21.390 -        mcl[0].args[0] = MMAP_VADDR(pending_idx) >> PAGE_SHIFT;
  21.391 -        mcl[0].args[1] = 0;
  21.392 -        mcl[0].args[2] = 0;
  21.393 -        mcl++;        
  21.394 -    }
  21.395 -
  21.396 -    mcl[-1].args[2] = UVMF_FLUSH_TLB;
  21.397 -    if ( unlikely(HYPERVISOR_multicall(tx_mcl, mcl - tx_mcl) != 0) )
  21.398 -        BUG();
  21.399 -
  21.400 -    mcl = tx_mcl;
  21.401 -    while ( dealloc_cons != dp )
  21.402 -    {
  21.403 -        /* The update_va_mapping() must not fail. */
  21.404 -        if ( unlikely(mcl[0].args[5] != 0) )
  21.405 -            BUG();
  21.406 -
  21.407 -        pending_idx = dealloc_ring[MASK_PEND_IDX(dealloc_cons++)];
  21.408 -
  21.409 -        netif = pending_tx_info[pending_idx].netif;
  21.410 -
  21.411 -        spin_lock(&netif->tx_lock);
  21.412 -        make_tx_response(netif, pending_tx_info[pending_idx].req.id, 
  21.413 -                         NETIF_RSP_OKAY);
  21.414 -        spin_unlock(&netif->tx_lock);
  21.415 -        
  21.416 -        pending_ring[MASK_PEND_IDX(pending_prod++)] = pending_idx;
  21.417 -        
  21.418 -        /*
  21.419 -         * Scheduling checks must happen after the above response is posted.
  21.420 -         * This avoids a possible race with a guest OS on another CPU.
  21.421 -         */
  21.422 -        mb();
  21.423 -        if ( (netif->tx_req_cons != netif->tx->req_prod) &&
  21.424 -             ((netif->tx_req_cons-netif->tx_resp_prod) != NETIF_TX_RING_SIZE) )
  21.425 -            add_to_net_schedule_list_tail(netif);
  21.426 -        
  21.427 -        netif_put(netif);
  21.428 -
  21.429 -        mcl++;
  21.430 -    }
  21.431 -
  21.432 - skip_dealloc:
  21.433 -    mcl = tx_mcl;
  21.434 -    while ( (NR_PENDING_REQS < MAX_PENDING_REQS) &&
  21.435 -            !list_empty(&net_schedule_list) )
  21.436 -    {
  21.437 -        /* Get a netif from the list with work to do. */
  21.438 -        ent = net_schedule_list.next;
  21.439 -        netif = list_entry(ent, netif_t, list);
  21.440 -        netif_get(netif);
  21.441 -        remove_from_net_schedule_list(netif);
  21.442 -
  21.443 -        /* Work to do? */
  21.444 -        i = netif->tx_req_cons;
  21.445 -        if ( (i == netif->tx->req_prod) ||
  21.446 -             ((i-netif->tx_resp_prod) == NETIF_TX_RING_SIZE) )
  21.447 -        {
  21.448 -            netif_put(netif);
  21.449 -            continue;
  21.450 -        }
  21.451 -        memcpy(&txreq, &netif->tx->ring[MASK_NETIF_TX_IDX(i)].req, 
  21.452 -               sizeof(txreq));
  21.453 -        netif->tx_req_cons++;
  21.454 -
  21.455 -#if 0
  21.456 -        /* Credit-based scheduling. */
  21.457 -        if ( tx.size > netif->remaining_credit )
  21.458 -        {
  21.459 -            s_time_t now = NOW(), next_credit = 
  21.460 -                netif->credit_timeout.expires + MICROSECS(netif->credit_usec);
  21.461 -            if ( next_credit <= now )
  21.462 -            {
  21.463 -                netif->credit_timeout.expires = now;
  21.464 -                netif->remaining_credit = netif->credit_bytes;
  21.465 -            }
  21.466 -            else
  21.467 -            {
  21.468 -                netif->remaining_credit = 0;
  21.469 -                netif->credit_timeout.expires  = next_credit;
  21.470 -                netif->credit_timeout.data     = (unsigned long)netif;
  21.471 -                netif->credit_timeout.function = tx_credit_callback;
  21.472 -                netif->credit_timeout.cpu      = smp_processor_id();
  21.473 -                add_ac_timer(&netif->credit_timeout);
  21.474 -                break;
  21.475 -            }
  21.476 -        }
  21.477 -        netif->remaining_credit -= tx.size;
  21.478 -#endif
  21.479 -
  21.480 -        netif_schedule_work(netif);
  21.481 -
  21.482 -        if ( unlikely(txreq.size <= PKT_PROT_LEN) || 
  21.483 -             unlikely(txreq.size > ETH_FRAME_LEN) )
  21.484 -        {
  21.485 -            DPRINTK("Bad packet size: %d\n", txreq.size);
  21.486 -            make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
  21.487 -            netif_put(netif);
  21.488 -            continue; 
  21.489 -        }
  21.490 -
  21.491 -        /* No crossing a page boundary as the payload mustn't fragment. */
  21.492 -        if ( unlikely(((txreq.addr & ~PAGE_MASK) + txreq.size) >= PAGE_SIZE) ) 
  21.493 -        {
  21.494 -            DPRINTK("txreq.addr: %lx, size: %u, end: %lu\n", 
  21.495 -                    txreq.addr, txreq.size, 
  21.496 -                    (txreq.addr &~PAGE_MASK) + txreq.size);
  21.497 -            make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
  21.498 -            netif_put(netif);
  21.499 -            continue;
  21.500 -        }
  21.501 -
  21.502 -        pending_idx = pending_ring[MASK_PEND_IDX(pending_cons)];
  21.503 -
  21.504 -        if ( unlikely((skb = alloc_skb(PKT_PROT_LEN+16, GFP_ATOMIC)) == NULL) )
  21.505 -        {
  21.506 -            DPRINTK("Can't allocate a skb in start_xmit.\n");
  21.507 -            make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
  21.508 -            netif_put(netif);
  21.509 -            break;
  21.510 -        }
  21.511 -
  21.512 -        /* Packets passed to netif_rx() must have some headroom. */
  21.513 -        skb_reserve(skb, 16);
  21.514 -
  21.515 -        mcl[0].op = __HYPERVISOR_update_va_mapping_otherdomain;
  21.516 -        mcl[0].args[0] = MMAP_VADDR(pending_idx) >> PAGE_SHIFT;
  21.517 -        mcl[0].args[1] = (txreq.addr & PAGE_MASK) | __PAGE_KERNEL;
  21.518 -        mcl[0].args[2] = 0;
  21.519 -        mcl[0].args[3] = netif->domid;
  21.520 -        mcl++;
  21.521 -
  21.522 -        memcpy(&pending_tx_info[pending_idx].req, &txreq, sizeof(txreq));
  21.523 -        pending_tx_info[pending_idx].netif = netif;
  21.524 -        *((u16 *)skb->data) = pending_idx;
  21.525 -
  21.526 -        __skb_queue_tail(&tx_queue, skb);
  21.527 -
  21.528 -        pending_cons++;
  21.529 -
  21.530 -        /* Filled the batch queue? */
  21.531 -        if ( (mcl - tx_mcl) == ARRAY_SIZE(tx_mcl) )
  21.532 -            break;
  21.533 -    }
  21.534 -
  21.535 -    if ( mcl == tx_mcl )
  21.536 -        return;
  21.537 -
  21.538 -    if ( unlikely(HYPERVISOR_multicall(tx_mcl, mcl - tx_mcl) != 0) )
  21.539 -        BUG();
  21.540 -
  21.541 -    mcl = tx_mcl;
  21.542 -    while ( (skb = __skb_dequeue(&tx_queue)) != NULL )
  21.543 -    {
  21.544 -        pending_idx = *((u16 *)skb->data);
  21.545 -        netif       = pending_tx_info[pending_idx].netif;
  21.546 -        memcpy(&txreq, &pending_tx_info[pending_idx].req, sizeof(txreq));
  21.547 -
  21.548 -        /* Check the remap error code. */
  21.549 -        if ( unlikely(mcl[0].args[5] != 0) )
  21.550 -        {
  21.551 -            DPRINTK("Bad page frame\n");
  21.552 -            make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
  21.553 -            netif_put(netif);
  21.554 -            kfree_skb(skb);
  21.555 -            mcl++;
  21.556 -            pending_ring[MASK_PEND_IDX(pending_prod++)] = pending_idx;
  21.557 -            continue;
  21.558 -        }
  21.559 -
  21.560 -        phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx)) >> PAGE_SHIFT] =
  21.561 -            txreq.addr >> PAGE_SHIFT;
  21.562 -
  21.563 -        __skb_put(skb, PKT_PROT_LEN);
  21.564 -        memcpy(skb->data, 
  21.565 -               (void *)(MMAP_VADDR(pending_idx)|(txreq.addr&~PAGE_MASK)),
  21.566 -               PKT_PROT_LEN);
  21.567 -
  21.568 -        page = virt_to_page(MMAP_VADDR(pending_idx));
  21.569 -
  21.570 -        /* Append the packet payload as a fragment. */
  21.571 -        skb_shinfo(skb)->frags[0].page        = page;
  21.572 -        skb_shinfo(skb)->frags[0].size        = txreq.size - PKT_PROT_LEN;
  21.573 -        skb_shinfo(skb)->frags[0].page_offset = 
  21.574 -            (txreq.addr + PKT_PROT_LEN) & ~PAGE_MASK;
  21.575 -        skb_shinfo(skb)->nr_frags = 1;
  21.576 -        skb->data_len  = txreq.size - PKT_PROT_LEN;
  21.577 -        skb->len      += skb->data_len;
  21.578 -
  21.579 -        skb->dev      = netif->dev;
  21.580 -        skb->protocol = eth_type_trans(skb, skb->dev);
  21.581 -
  21.582 -        /*
  21.583 -         * Destructor information. We hideously abuse the 'mapping' pointer,
  21.584 -         * which isn't otherwise used by us. The page deallocator is modified
  21.585 -         * to interpret a non-NULL value as a destructor function to be called.
  21.586 -         * This works okay because in all other cases the pointer must be NULL
  21.587 -         * when the page is freed (normally Linux will explicitly bug out if
  21.588 -         * it sees otherwise.
  21.589 -         */
  21.590 -        page->mapping = (struct address_space *)netif_page_release;
  21.591 -        atomic_set(&page->count, 1);
  21.592 -
  21.593 -        netif->stats.tx_bytes += txreq.size;
  21.594 -        netif->stats.tx_packets++;
  21.595 -
  21.596 -        netif_rx(skb);
  21.597 -        netif->dev->last_rx = jiffies;
  21.598 -
  21.599 -        mcl++;
  21.600 -    }
  21.601 -}
  21.602 -
  21.603 -static void netif_page_release(struct page *page)
  21.604 -{
  21.605 -    unsigned long flags;
  21.606 -    u16 pending_idx = page - virt_to_page(mmap_vstart);
  21.607 -
  21.608 -    /* Stop the abuse. */
  21.609 -    page->mapping = NULL;
  21.610 -
  21.611 -    spin_lock_irqsave(&dealloc_lock, flags);
  21.612 -    dealloc_ring[MASK_PEND_IDX(dealloc_prod++)] = pending_idx;
  21.613 -    spin_unlock_irqrestore(&dealloc_lock, flags);
  21.614 -
  21.615 -    tasklet_schedule(&net_tx_tasklet);
  21.616 -}
  21.617 -
  21.618 -#if 0
  21.619 -long flush_bufs_for_netif(netif_t *netif)
  21.620 -{
  21.621 -    NETIF_RING_IDX i;
  21.622 -
  21.623 -    /* Return any outstanding receive buffers to the guest OS. */
  21.624 -    spin_lock(&netif->rx_lock);
  21.625 -    for ( i = netif->rx_req_cons; 
  21.626 -          (i != netif->rx->req_prod) &&
  21.627 -              ((i-netif->rx_resp_prod) != NETIF_RX_RING_SIZE);
  21.628 -          i++ )
  21.629 -    {
  21.630 -        make_rx_response(netif,
  21.631 -                         netif->rx->ring[MASK_NETIF_RX_IDX(i)].req.id,
  21.632 -                         NETIF_RSP_DROPPED, 0, 0);
  21.633 -    }
  21.634 -    netif->rx_req_cons = i;
  21.635 -    spin_unlock(&netif->rx_lock);
  21.636 -
  21.637 -    /*
  21.638 -     * Flush pending transmit buffers. The guest may still have to wait for
  21.639 -     * buffers that are queued at a physical NIC.
  21.640 -     */
  21.641 -    spin_lock(&netif->tx_lock);
  21.642 -    for ( i = netif->tx_req_cons; 
  21.643 -          (i != netif->tx->req_prod) &&
  21.644 -              ((i-netif->tx_resp_prod) != NETIF_TX_RING_SIZE);
  21.645 -          i++ )
  21.646 -    {
  21.647 -        make_tx_response(netif,
  21.648 -                         netif->tx->ring[MASK_NETIF_TX_IDX(i)].req.id,
  21.649 -                         NETIF_RSP_DROPPED);
  21.650 -    }
  21.651 -    netif->tx_req_cons = i;
  21.652 -    spin_unlock(&netif->tx_lock);
  21.653 -
  21.654 -    return 0;
  21.655 -}
  21.656 -#endif
  21.657 -
  21.658 -void netif_be_int(int irq, void *dev_id, struct pt_regs *regs)
  21.659 -{
  21.660 -    netif_t *netif = dev_id;
  21.661 -    if ( tx_work_exists(netif) )
  21.662 -    {
  21.663 -        add_to_net_schedule_list_tail(netif);
  21.664 -        maybe_schedule_tx_action();
  21.665 -    }
  21.666 -}
  21.667 -
  21.668 -static void make_tx_response(netif_t *netif, 
  21.669 -                             u16      id,
  21.670 -                             s8       st)
  21.671 -{
  21.672 -    NETIF_RING_IDX i = netif->tx_resp_prod;
  21.673 -    netif_tx_response_t *resp;
  21.674 -
  21.675 -    resp = &netif->tx->ring[MASK_NETIF_TX_IDX(i)].resp;
  21.676 -    resp->id     = id;
  21.677 -    resp->status = st;
  21.678 -    wmb();
  21.679 -    netif->tx->resp_prod = netif->tx_resp_prod = ++i;
  21.680 -
  21.681 -    mb(); /* Update producer before checking event threshold. */
  21.682 -    if ( i == netif->tx->event )
  21.683 -        notify_via_evtchn(netif->evtchn);
  21.684 -}
  21.685 -
  21.686 -static int make_rx_response(netif_t *netif, 
  21.687 -                            u16      id, 
  21.688 -                            s8       st,
  21.689 -                            memory_t addr,
  21.690 -                            u16      size)
  21.691 -{
  21.692 -    NETIF_RING_IDX i = netif->rx_resp_prod;
  21.693 -    netif_rx_response_t *resp;
  21.694 -
  21.695 -    resp = &netif->rx->ring[MASK_NETIF_RX_IDX(i)].resp;
  21.696 -    resp->addr   = addr;
  21.697 -    resp->id     = id;
  21.698 -    resp->status = (s16)size;
  21.699 -    if ( st < 0 )
  21.700 -        resp->status = (s16)st;
  21.701 -    wmb();
  21.702 -    netif->rx->resp_prod = netif->rx_resp_prod = ++i;
  21.703 -
  21.704 -    mb(); /* Update producer before checking event threshold. */
  21.705 -    return (i == netif->rx->event);
  21.706 -}
  21.707 -
  21.708 -static void netif_be_dbg(int irq, void *dev_id, struct pt_regs *regs)
  21.709 -{
  21.710 -    struct list_head *ent;
  21.711 -    netif_t *netif;
  21.712 -    int i = 0;
  21.713 -
  21.714 -    printk(KERN_ALERT "netif_schedule_list:\n");
  21.715 -    spin_lock_irq(&net_schedule_list_lock);
  21.716 -
  21.717 -    list_for_each ( ent, &net_schedule_list )
  21.718 -    {
  21.719 -        netif = list_entry(ent, netif_t, list);
  21.720 -        printk(KERN_ALERT " %d: private(rx_req_cons=%08x rx_resp_prod=%08x\n",
  21.721 -               i, netif->rx_req_cons, netif->rx_resp_prod);               
  21.722 -        printk(KERN_ALERT "   tx_req_cons=%08x tx_resp_prod=%08x)\n",
  21.723 -               netif->tx_req_cons, netif->tx_resp_prod);
  21.724 -        printk(KERN_ALERT "   shared(rx_req_prod=%08x rx_resp_prod=%08x\n",
  21.725 -               netif->rx->req_prod, netif->rx->resp_prod);
  21.726 -        printk(KERN_ALERT "   rx_event=%08x tx_req_prod=%08x\n",
  21.727 -               netif->rx->event, netif->tx->req_prod);
  21.728 -        printk(KERN_ALERT "   tx_resp_prod=%08x, tx_event=%08x)\n",
  21.729 -               netif->tx->resp_prod, netif->tx->event);
  21.730 -        i++;
  21.731 -    }
  21.732 -
  21.733 -    spin_unlock_irq(&net_schedule_list_lock);
  21.734 -    printk(KERN_ALERT " ** End of netif_schedule_list **\n");
  21.735 -}
  21.736 -
  21.737 -static int __init init_module(void)
  21.738 -{
  21.739 -    int i;
  21.740 -
  21.741 -    if ( !(start_info.flags & SIF_NET_BE_DOMAIN) &&
  21.742 -	 !(start_info.flags & SIF_INITDOMAIN) )
  21.743 -        return 0;
  21.744 -
  21.745 -    printk("Initialising Xen netif backend\n");
  21.746 -
  21.747 -    skb_queue_head_init(&rx_queue);
  21.748 -    skb_queue_head_init(&tx_queue);
  21.749 -
  21.750 -    netif_interface_init();
  21.751 -
  21.752 -    if ( (mmap_vstart = allocate_empty_lowmem_region(MAX_PENDING_REQS)) == 0 )
  21.753 -        BUG();
  21.754 -
  21.755 -    pending_cons = 0;
  21.756 -    pending_prod = MAX_PENDING_REQS;
  21.757 -    for ( i = 0; i < MAX_PENDING_REQS; i++ )
  21.758 -        pending_ring[i] = i;
  21.759 -
  21.760 -    spin_lock_init(&net_schedule_list_lock);
  21.761 -    INIT_LIST_HEAD(&net_schedule_list);
  21.762 -
  21.763 -    netif_ctrlif_init();
  21.764 -
  21.765 -    (void)request_irq(bind_virq_to_irq(VIRQ_DEBUG),
  21.766 -                      netif_be_dbg, SA_SHIRQ, 
  21.767 -                      "net-be-dbg", &netif_be_dbg);
  21.768 -
  21.769 -    return 0;
  21.770 -}
  21.771 -
  21.772 -static void cleanup_module(void)
  21.773 -{
  21.774 -    BUG();
  21.775 -}
  21.776 -
  21.777 -module_init(init_module);
  21.778 -module_exit(cleanup_module);
    22.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h	Fri Jul 23 14:11:01 2004 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,88 +0,0 @@
    22.4 -/******************************************************************************
    22.5 - * netif.h
    22.6 - * 
    22.7 - * Unified network-device I/O interface for Xen guest OSes.
    22.8 - * 
    22.9 - * Copyright (c) 2003-2004, Keir Fraser
   22.10 - */
   22.11 -
   22.12 -#ifndef __SHARED_NETIF_H__
   22.13 -#define __SHARED_NETIF_H__
   22.14 -
   22.15 -typedef struct {
   22.16 -    memory_t addr;   /*  0: Machine address of packet.  */
   22.17 -    MEMORY_PADDING;
   22.18 -    u16      id;     /*  8: Echoed in response message. */
   22.19 -    u16      size;   /* 10: Packet size in bytes.       */
   22.20 -} PACKED netif_tx_request_t; /* 12 bytes */
   22.21 -
   22.22 -typedef struct {
   22.23 -    u16      id;     /*  0 */
   22.24 -    s8       status; /*  2 */
   22.25 -    u8       __pad;  /*  3 */
   22.26 -} PACKED netif_tx_response_t; /* 4 bytes */
   22.27 -
   22.28 -typedef struct {
   22.29 -    u16       id;    /*  0: Echoed in response message.        */
   22.30 -} PACKED netif_rx_request_t; /* 2 bytes */
   22.31 -
   22.32 -typedef struct {
   22.33 -    memory_t addr;   /*  0: Machine address of packet.              */
   22.34 -    MEMORY_PADDING;
   22.35 -    u16      id;     /*  8:  */
   22.36 -    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   22.37 -} PACKED netif_rx_response_t; /* 12 bytes */
   22.38 -
   22.39 -/*
   22.40 - * We use a special capitalised type name because it is _essential_ that all 
   22.41 - * arithmetic on indexes is done on an integer type of the correct size.
   22.42 - */
   22.43 -typedef u32 NETIF_RING_IDX;
   22.44 -
   22.45 -/*
   22.46 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   22.47 - * size of the ring buffer. The following macros convert a free-running counter
   22.48 - * into a value that can directly index a ring-buffer array.
   22.49 - */
   22.50 -#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
   22.51 -#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
   22.52 -
   22.53 -#define NETIF_TX_RING_SIZE 256
   22.54 -#define NETIF_RX_RING_SIZE 256
   22.55 -
   22.56 -/* This structure must fit in a memory page. */
   22.57 -typedef struct {
   22.58 -    /*
   22.59 -     * Frontend places packets into ring at tx_req_prod.
   22.60 -     * Frontend receives event when tx_resp_prod passes tx_event.
   22.61 -     */
   22.62 -    NETIF_RING_IDX req_prod;       /*  0 */
   22.63 -    NETIF_RING_IDX resp_prod;      /*  4 */
   22.64 -    NETIF_RING_IDX event;          /*  8 */
   22.65 -    union {                        /* 12 */
   22.66 -        netif_tx_request_t  req;
   22.67 -        netif_tx_response_t resp;
   22.68 -    } PACKED ring[NETIF_TX_RING_SIZE];
   22.69 -} PACKED netif_tx_interface_t;
   22.70 -
   22.71 -/* This structure must fit in a memory page. */
   22.72 -typedef struct {
   22.73 -    /*
   22.74 -     * Frontend places empty buffers into ring at rx_req_prod.
   22.75 -     * Frontend receives event when rx_resp_prod passes rx_event.
   22.76 -     */
   22.77 -    NETIF_RING_IDX req_prod;       /*  0 */
   22.78 -    NETIF_RING_IDX resp_prod;      /*  4 */
   22.79 -    NETIF_RING_IDX event;          /*  8 */
   22.80 -    union {                        /* 12 */
   22.81 -        netif_rx_request_t  req;
   22.82 -        netif_rx_response_t resp;
   22.83 -    } PACKED ring[NETIF_RX_RING_SIZE];
   22.84 -} PACKED netif_rx_interface_t;
   22.85 -
   22.86 -/* Descriptor status values */
   22.87 -#define NETIF_RSP_DROPPED         -2
   22.88 -#define NETIF_RSP_ERROR           -1
   22.89 -#define NETIF_RSP_OKAY             0
   22.90 -
   22.91 -#endif
    23.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Jul 23 14:11:01 2004 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,447 +0,0 @@
    23.4 -/******************************************************************************
    23.5 - * ctrl_if.c
    23.6 - * 
    23.7 - * Management functions for special interface to the domain controller.
    23.8 - * 
    23.9 - * Copyright (c) 2004, K A Fraser
   23.10 - */
   23.11 -
   23.12 -#include <linux/config.h>
   23.13 -#include <linux/kernel.h>
   23.14 -#include <linux/sched.h>
   23.15 -#include <linux/slab.h>
   23.16 -#include <linux/string.h>
   23.17 -#include <linux/errno.h>
   23.18 -#include <linux/irq.h>
   23.19 -#include <linux/interrupt.h>
   23.20 -#include <asm/ctrl_if.h>
   23.21 -#include <asm/evtchn.h>
   23.22 -
   23.23 -#if 0
   23.24 -#define DPRINTK(_f, _a...) printk(KERN_ALERT "(file=%s, line=%d) " _f, \
   23.25 -                           __FILE__ , __LINE__ , ## _a )
   23.26 -#else
   23.27 -#define DPRINTK(_f, _a...) ((void)0)
   23.28 -#endif
   23.29 -
   23.30 -/*
   23.31 - * Only used by initial domain which must create its own control-interface
   23.32 - * event channel. This value is picked up by the user-space domain controller
   23.33 - * via an ioctl.
   23.34 - */
   23.35 -int initdom_ctrlif_domcontroller_port = -1;
   23.36 -
   23.37 -static int        ctrl_if_evtchn;
   23.38 -static int        ctrl_if_irq;
   23.39 -static spinlock_t ctrl_if_lock;
   23.40 -
   23.41 -static struct irqaction ctrl_if_irq_action;
   23.42 -
   23.43 -static CONTROL_RING_IDX ctrl_if_tx_resp_cons;
   23.44 -static CONTROL_RING_IDX ctrl_if_rx_req_cons;
   23.45 -
   23.46 -/* Incoming message requests. */
   23.47 -    /* Primary message type -> message handler. */
   23.48 -static ctrl_msg_handler_t ctrl_if_rxmsg_handler[256];
   23.49 -    /* Primary message type -> callback in process context? */
   23.50 -static unsigned long ctrl_if_rxmsg_blocking_context[256/sizeof(unsigned long)];
   23.51 -    /* Is it late enough during bootstrap to use schedule_task()? */
   23.52 -static int safe_to_schedule_task;
   23.53 -    /* Passed to schedule_task(). */
   23.54 -static struct tq_struct ctrl_if_rxmsg_deferred_tq;
   23.55 -    /* Queue up messages to be handled in process context. */
   23.56 -static ctrl_msg_t ctrl_if_rxmsg_deferred[CONTROL_RING_SIZE];
   23.57 -static CONTROL_RING_IDX ctrl_if_rxmsg_deferred_prod;
   23.58 -static CONTROL_RING_IDX ctrl_if_rxmsg_deferred_cons;
   23.59 -
   23.60 -/* Incoming message responses: message identifier -> message handler/id. */
   23.61 -static struct {
   23.62 -    ctrl_msg_handler_t fn;
   23.63 -    unsigned long      id;
   23.64 -} ctrl_if_txmsg_id_mapping[CONTROL_RING_SIZE];
   23.65 -
   23.66 -static DECLARE_TASK_QUEUE(ctrl_if_tx_tq);
   23.67 -static DECLARE_WAIT_QUEUE_HEAD(ctrl_if_tx_wait);
   23.68 -static void __ctrl_if_tx_tasklet(unsigned long data);
   23.69 -static DECLARE_TASKLET(ctrl_if_tx_tasklet, __ctrl_if_tx_tasklet, 0);
   23.70 -
   23.71 -static void __ctrl_if_rx_tasklet(unsigned long data);
   23.72 -static DECLARE_TASKLET(ctrl_if_rx_tasklet, __ctrl_if_rx_tasklet, 0);
   23.73 -
   23.74 -#define get_ctrl_if() ((control_if_t *)((char *)HYPERVISOR_shared_info + 2048))
   23.75 -#define TX_FULL(_c)   \
   23.76 -    (((_c)->tx_req_prod - ctrl_if_tx_resp_cons) == CONTROL_RING_SIZE)
   23.77 -
   23.78 -static void ctrl_if_notify_controller(void)
   23.79 -{
   23.80 -    notify_via_evtchn(ctrl_if_evtchn);
   23.81 -}
   23.82 -
   23.83 -static void ctrl_if_rxmsg_default_handler(ctrl_msg_t *msg, unsigned long id)
   23.84 -{
   23.85 -    msg->length = 0;
   23.86 -    ctrl_if_send_response(msg);
   23.87 -}
   23.88 -
   23.89 -static void __ctrl_if_tx_tasklet(unsigned long data)
   23.90 -{
   23.91 -    control_if_t *ctrl_if = get_ctrl_if();
   23.92 -    ctrl_msg_t   *msg;
   23.93 -    int           was_full = TX_FULL(ctrl_if);
   23.94 -
   23.95 -    while ( ctrl_if_tx_resp_cons != ctrl_if->tx_resp_prod )
   23.96 -    {
   23.97 -        msg = &ctrl_if->tx_ring[MASK_CONTROL_IDX(ctrl_if_tx_resp_cons)];
   23.98 -
   23.99 -        DPRINTK("Rx-Rsp %u/%u :: %d/%d\n", 
  23.100 -                ctrl_if_tx_resp_cons,
  23.101 -                ctrl_if->tx_resp_prod,
  23.102 -                msg->type, msg->subtype);
  23.103 -
  23.104 -        /* Execute the callback handler, if one was specified. */
  23.105 -        if ( msg->id != 0xFF )
  23.106 -        {
  23.107 -            (*ctrl_if_txmsg_id_mapping[msg->id].fn)(
  23.108 -                msg, ctrl_if_txmsg_id_mapping[msg->id].id);
  23.109 -            smp_mb(); /* Execute, /then/ free. */
  23.110 -            ctrl_if_txmsg_id_mapping[msg->id].fn = NULL;
  23.111 -        }
  23.112 -
  23.113 -        /*
  23.114 -         * Step over the message in the ring /after/ finishing reading it. As 
  23.115 -         * soon as the index is updated then the message may get blown away.
  23.116 -         */
  23.117 -        smp_mb();
  23.118 -        ctrl_if_tx_resp_cons++;
  23.119 -    }
  23.120 -
  23.121 -    if ( was_full && !TX_FULL(ctrl_if) )
  23.122 -    {
  23.123 -        wake_up(&ctrl_if_tx_wait);
  23.124 -        run_task_queue(&ctrl_if_tx_tq);
  23.125 -    }
  23.126 -}
  23.127 -
  23.128 -static void __ctrl_if_rxmsg_deferred(void *unused)
  23.129 -{
  23.130 -    ctrl_msg_t *msg;
  23.131 -
  23.132 -    while ( ctrl_if_rxmsg_deferred_cons != ctrl_if_rxmsg_deferred_prod )
  23.133 -    {
  23.134 -        msg = &ctrl_if_rxmsg_deferred[MASK_CONTROL_IDX(
  23.135 -            ctrl_if_rxmsg_deferred_cons++)];
  23.136 -        (*ctrl_if_rxmsg_handler[msg->type])(msg, 0);
  23.137 -    }
  23.138 -}
  23.139 -
  23.140 -static void __ctrl_if_rx_tasklet(unsigned long data)
  23.141 -{
  23.142 -    control_if_t *ctrl_if = get_ctrl_if();
  23.143 -    ctrl_msg_t    msg, *pmsg;
  23.144 -
  23.145 -    while ( ctrl_if_rx_req_cons != ctrl_if->rx_req_prod )
  23.146 -    {
  23.147 -        pmsg = &ctrl_if->rx_ring[MASK_CONTROL_IDX(ctrl_if_rx_req_cons++)];
  23.148 -        memcpy(&msg, pmsg, offsetof(ctrl_msg_t, msg));
  23.149 -
  23.150 -        DPRINTK("Rx-Req %u/%u :: %d/%d\n", 
  23.151 -                ctrl_if_rx_req_cons-1,
  23.152 -                ctrl_if->rx_req_prod,
  23.153 -                msg.type, msg.subtype);
  23.154 -
  23.155 -        if ( msg.length != 0 )
  23.156 -            memcpy(msg.msg, pmsg->msg, msg.length);
  23.157 -
  23.158 -        if ( test_bit(msg.type, &ctrl_if_rxmsg_blocking_context) )
  23.159 -        {
  23.160 -            pmsg = &ctrl_if_rxmsg_deferred[MASK_CONTROL_IDX(
  23.161 -                ctrl_if_rxmsg_deferred_prod++)];
  23.162 -            memcpy(pmsg, &msg, offsetof(ctrl_msg_t, msg) + msg.length);
  23.163 -            schedule_task(&ctrl_if_rxmsg_deferred_tq);
  23.164 -        }
  23.165 -        else
  23.166 -        {
  23.167 -            (*ctrl_if_rxmsg_handler[msg.type])(&msg, 0);
  23.168 -        }
  23.169 -    }
  23.170 -}
  23.171 -
  23.172 -static void ctrl_if_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  23.173 -{
  23.174 -    control_if_t *ctrl_if = get_ctrl_if();
  23.175 -
  23.176 -    if ( ctrl_if_tx_resp_cons != ctrl_if->tx_resp_prod )
  23.177 -        tasklet_schedule(&ctrl_if_tx_tasklet);
  23.178 -
  23.179 -    if ( ctrl_if_rx_req_cons != ctrl_if->rx_req_prod )
  23.180 -        tasklet_schedule(&ctrl_if_rx_tasklet);
  23.181 -}
  23.182 -
  23.183 -int ctrl_if_send_message_noblock(
  23.184 -    ctrl_msg_t *msg, 
  23.185 -    ctrl_msg_handler_t hnd,
  23.186 -    unsigned long id)
  23.187 -{
  23.188 -    control_if_t *ctrl_if = get_ctrl_if();
  23.189 -    unsigned long flags;
  23.190 -    int           i;
  23.191 -
  23.192 -    spin_lock_irqsave(&ctrl_if_lock, flags);
  23.193 -
  23.194 -    if ( TX_FULL(ctrl_if) )
  23.195 -    {
  23.196 -        spin_unlock_irqrestore(&ctrl_if_lock, flags);
  23.197 -        return -EAGAIN;
  23.198 -    }
  23.199 -
  23.200 -    msg->id = 0xFF;
  23.201 -    if ( hnd != NULL )
  23.202 -    {
  23.203 -        for ( i = 0; ctrl_if_txmsg_id_mapping[i].fn != NULL; i++ )
  23.204 -            continue;
  23.205 -        ctrl_if_txmsg_id_mapping[i].fn = hnd;
  23.206 -        ctrl_if_txmsg_id_mapping[i].id = id;
  23.207 -        msg->id = i;
  23.208 -    }
  23.209 -
  23.210 -    DPRINTK("Tx-Req %u/%u :: %d/%d\n", 
  23.211 -            ctrl_if->tx_req_prod, 
  23.212 -            ctrl_if_tx_resp_cons,
  23.213 -            msg->type, msg->subtype);
  23.214 -
  23.215 -    memcpy(&ctrl_if->tx_ring[MASK_CONTROL_IDX(ctrl_if->tx_req_prod)], 
  23.216 -           msg, sizeof(*msg));
  23.217 -    wmb(); /* Write the message before letting the controller peek at it. */
  23.218 -    ctrl_if->tx_req_prod++;
  23.219 -
  23.220 -    spin_unlock_irqrestore(&ctrl_if_lock, flags);
  23.221 -
  23.222 -    ctrl_if_notify_controller();
  23.223 -
  23.224 -    return 0;
  23.225 -}
  23.226 -
  23.227 -int ctrl_if_send_message_block(
  23.228 -    ctrl_msg_t *msg, 
  23.229 -    ctrl_msg_handler_t hnd, 
  23.230 -    unsigned long id,
  23.231 -    long wait_state)
  23.232 -{
  23.233 -    DECLARE_WAITQUEUE(wait, current);
  23.234 -    int rc;
  23.235 -
  23.236 -    /* Fast path. */
  23.237 -    if ( (rc = ctrl_if_send_message_noblock(msg, hnd, id)) != -EAGAIN )
  23.238 -        return rc;
  23.239 -
  23.240 -    add_wait_queue(&ctrl_if_tx_wait, &wait);
  23.241 -
  23.242 -    for ( ; ; )
  23.243 -    {
  23.244 -        set_current_state(wait_state);
  23.245 -
  23.246 -        if ( (rc = ctrl_if_send_message_noblock(msg, hnd, id)) != -EAGAIN )
  23.247 -            break;
  23.248 -
  23.249 -        rc = -ERESTARTSYS;
  23.250 -        if ( signal_pending(current) && (wait_state == TASK_INTERRUPTIBLE) )
  23.251 -            break;
  23.252 -
  23.253 -        schedule();
  23.254 -    }
  23.255 -
  23.256 -    set_current_state(TASK_RUNNING);
  23.257 -    remove_wait_queue(&ctrl_if_tx_wait, &wait);
  23.258 -
  23.259 -    return rc;
  23.260 -}
  23.261 -
  23.262 -int ctrl_if_enqueue_space_callback(struct tq_struct *task)
  23.263 -{
  23.264 -    control_if_t *ctrl_if = get_ctrl_if();
  23.265 -
  23.266 -    /* Fast path. */
  23.267 -    if ( !TX_FULL(ctrl_if) )
  23.268 -        return 0;
  23.269 -
  23.270 -    (void)queue_task(task, &ctrl_if_tx_tq);
  23.271 -
  23.272 -    /*
  23.273 -     * We may race execution of the task queue, so return re-checked status. If
  23.274 -     * the task is not executed despite the ring being non-full then we will
  23.275 -     * certainly return 'not full'.
  23.276 -     */
  23.277 -    smp_mb();
  23.278 -    return TX_FULL(ctrl_if);
  23.279 -}
  23.280 -
  23.281 -void ctrl_if_send_response(ctrl_msg_t *msg)
  23.282 -{
  23.283 -    control_if_t *ctrl_if = get_ctrl_if();
  23.284 -    unsigned long flags;
  23.285 -    ctrl_msg_t   *dmsg;
  23.286 -
  23.287 -    /*
  23.288 -     * NB. The response may the original request message, modified in-place.
  23.289 -     * In this situation we may have src==dst, so no copying is required.
  23.290 -     */
  23.291 -    spin_lock_irqsave(&ctrl_if_lock, flags);
  23.292 -
  23.293 -    DPRINTK("Tx-Rsp %u :: %d/%d\n", 
  23.294 -            ctrl_if->rx_resp_prod, 
  23.295 -            msg->type, msg->subtype);
  23.296 -
  23.297 -    dmsg = &ctrl_if->rx_ring[MASK_CONTROL_IDX(ctrl_if->rx_resp_prod)];
  23.298 -    if ( dmsg != msg )
  23.299 -        memcpy(dmsg, msg, sizeof(*msg));
  23.300 -
  23.301 -    wmb(); /* Write the message before letting the controller peek at it. */
  23.302 -    ctrl_if->rx_resp_prod++;
  23.303 -
  23.304 -    spin_unlock_irqrestore(&ctrl_if_lock, flags);
  23.305 -
  23.306 -    ctrl_if_notify_controller();
  23.307 -}
  23.308 -
  23.309 -int ctrl_if_register_receiver(
  23.310 -    u8 type, 
  23.311 -    ctrl_msg_handler_t hnd, 
  23.312 -    unsigned int flags)
  23.313 -{
  23.314 -    unsigned long _flags;
  23.315 -    int inuse;
  23.316 -
  23.317 -    spin_lock_irqsave(&ctrl_if_lock, _flags);
  23.318 -
  23.319 -    inuse = (ctrl_if_rxmsg_handler[type] != ctrl_if_rxmsg_default_handler);
  23.320 -
  23.321 -    if ( inuse )
  23.322 -    {
  23.323 -        printk(KERN_INFO "Receiver %p already established for control "
  23.324 -               "messages of type %d.\n", ctrl_if_rxmsg_handler[type], type);
  23.325 -    }
  23.326 -    else
  23.327 -    {
  23.328 -        ctrl_if_rxmsg_handler[type] = hnd;
  23.329 -        clear_bit(type, &ctrl_if_rxmsg_blocking_context);
  23.330 -        if ( flags == CALLBACK_IN_BLOCKING_CONTEXT )
  23.331 -        {
  23.332 -            set_bit(type, &ctrl_if_rxmsg_blocking_context);
  23.333 -            if ( !safe_to_schedule_task )
  23.334 -                BUG();
  23.335 -        }
  23.336 -    }
  23.337 -
  23.338 -    spin_unlock_irqrestore(&ctrl_if_lock, _flags);
  23.339 -
  23.340 -    return !inuse;
  23.341 -}
  23.342 -
  23.343 -void ctrl_if_unregister_receiver(u8 type, ctrl_msg_handler_t hnd)
  23.344 -{
  23.345 -    unsigned long flags;
  23.346 -
  23.347 -    spin_lock_irqsave(&ctrl_if_lock, flags);
  23.348 -
  23.349 -    if ( ctrl_if_rxmsg_handler[type] != hnd )
  23.350 -        printk(KERN_INFO "Receiver %p is not registered for control "
  23.351 -               "messages of type %d.\n", hnd, type);
  23.352 -    else
  23.353 -        ctrl_if_rxmsg_handler[type] = ctrl_if_rxmsg_default_handler;
  23.354 -
  23.355 -    spin_unlock_irqrestore(&ctrl_if_lock, flags);
  23.356 -
  23.357 -    /* Ensure that @hnd will not be executed after this function returns. */
  23.358 -    tasklet_unlock_wait(&ctrl_if_rx_tasklet);
  23.359 -}
  23.360 -
  23.361 -void ctrl_if_suspend(void)
  23.362 -{
  23.363 -    free_irq(ctrl_if_irq, NULL);
  23.364 -    unbind_evtchn_from_irq(ctrl_if_evtchn);
  23.365 -}
  23.366 -
  23.367 -/** Reset the control interface progress pointers.
  23.368 - * Marks the queues empty if 'clear' non-zero.
  23.369 - */
  23.370 -void ctrl_if_reset(int clear){
  23.371 -    control_if_t *ctrl_if = get_ctrl_if();
  23.372 -
  23.373 -    if(clear){
  23.374 -        *ctrl_if = (control_if_t){};
  23.375 -    }
  23.376 -    ctrl_if_tx_resp_cons = ctrl_if->tx_resp_prod;
  23.377 -    ctrl_if_rx_req_cons  = ctrl_if->rx_resp_prod;
  23.378 -}
  23.379 -
  23.380 -void ctrl_if_resume(void)
  23.381 -{
  23.382 -    if ( start_info.flags & SIF_INITDOMAIN )
  23.383 -    {
  23.384 -        /*
  23.385 -         * The initial domain must create its own domain-controller link.
  23.386 -         * The controller is probably not running at this point, but will
  23.387 -         * pick up its end of the event channel from 
  23.388 -         */
  23.389 -        evtchn_op_t op;
  23.390 -        op.cmd = EVTCHNOP_bind_interdomain;
  23.391 -        op.u.bind_interdomain.dom1 = DOMID_SELF;
  23.392 -        op.u.bind_interdomain.dom2 = DOMID_SELF;
  23.393 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  23.394 -            BUG();
  23.395 -        start_info.domain_controller_evtchn = op.u.bind_interdomain.port1;
  23.396 -        initdom_ctrlif_domcontroller_port   = op.u.bind_interdomain.port2;
  23.397 -    }
  23.398 -
  23.399 -    ctrl_if_reset(0);
  23.400 -
  23.401 -    ctrl_if_evtchn = start_info.domain_controller_evtchn;
  23.402 -    ctrl_if_irq    = bind_evtchn_to_irq(ctrl_if_evtchn);
  23.403 -
  23.404 -#define SA_STATIC_ACTION 0x01000000 /* so that free_irq() doesn't do kfree() */
  23.405 -    memset(&ctrl_if_irq_action, 0, sizeof(ctrl_if_irq_action));
  23.406 -    ctrl_if_irq_action.handler = ctrl_if_interrupt;
  23.407 -    ctrl_if_irq_action.name    = "ctrl-if";
  23.408 -    ctrl_if_irq_action.flags   = SA_STATIC_ACTION;
  23.409 -    (void)setup_irq(ctrl_if_irq, &ctrl_if_irq_action);
  23.410 -}
  23.411 -
  23.412 -void __init ctrl_if_init(void)
  23.413 -{
  23.414 -        int i;
  23.415 -
  23.416 -    for ( i = 0; i < 256; i++ )
  23.417 -        ctrl_if_rxmsg_handler[i] = ctrl_if_rxmsg_default_handler;
  23.418 -    ctrl_if_rxmsg_deferred_tq.routine = __ctrl_if_rxmsg_deferred;
  23.419 -
  23.420 -    spin_lock_init(&ctrl_if_lock);
  23.421 -
  23.422 -    ctrl_if_reset(1);
  23.423 -    ctrl_if_resume();
  23.424 -}
  23.425 -
  23.426 -
  23.427 -/* This is called after it is safe to call schedule_task(). */
  23.428 -static int __init ctrl_if_late_setup(void)
  23.429 -{
  23.430 -    safe_to_schedule_task = 1;
  23.431 -    return 0;
  23.432 -}
  23.433 -__initcall(ctrl_if_late_setup);
  23.434 -
  23.435 -
  23.436 -/*
  23.437 - * !! The following are DANGEROUS FUNCTIONS !!
  23.438 - * Use with care [for example, see xencons_force_flush()].
  23.439 - */
  23.440 -
  23.441 -int ctrl_if_transmitter_empty(void)
  23.442 -{
  23.443 -    return (get_ctrl_if()->tx_req_prod == ctrl_if_tx_resp_cons);
  23.444 -}
  23.445 -
  23.446 -void ctrl_if_discard_responses(void)
  23.447 -{
  23.448 -    ctrl_if_tx_resp_cons = get_ctrl_if()->tx_resp_prod;
  23.449 -}
  23.450 -
    24.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/evtchn.c	Fri Jul 23 14:11:01 2004 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,477 +0,0 @@
    24.4 -/******************************************************************************
    24.5 - * evtchn.c
    24.6 - * 
    24.7 - * Communication via Xen event channels.
    24.8 - * 
    24.9 - * Copyright (c) 2002-2004, K A Fraser
   24.10 - */
   24.11 -
   24.12 -#include <linux/config.h>
   24.13 -#include <linux/irq.h>
   24.14 -#include <linux/interrupt.h>
   24.15 -#include <linux/sched.h>
   24.16 -#include <linux/kernel_stat.h>
   24.17 -#include <asm/atomic.h>
   24.18 -#include <asm/system.h>
   24.19 -#include <asm/ptrace.h>
   24.20 -#include <asm/synch_bitops.h>
   24.21 -#include <asm/ctrl_if.h>
   24.22 -#include <asm/hypervisor.h>
   24.23 -#include <asm/hypervisor-ifs/event_channel.h>
   24.24 -#include <asm/hypervisor-ifs/physdev.h>
   24.25 -
   24.26 -/*
   24.27 - * This lock protects updates to the following mapping and reference-count
   24.28 - * arrays. The lock does not need to be acquired to read the mapping tables.
   24.29 - */
   24.30 -static spinlock_t irq_mapping_update_lock;
   24.31 -
   24.32 -/* IRQ <-> event-channel mappings. */
   24.33 -static int evtchn_to_irq[NR_EVENT_CHANNELS];
   24.34 -static int irq_to_evtchn[NR_IRQS];
   24.35 -
   24.36 -/* IRQ <-> VIRQ mapping. */
   24.37 -static int virq_to_irq[NR_VIRQS];
   24.38 -
   24.39 -/* Reference counts for bindings to IRQs. */
   24.40 -static int irq_bindcount[NR_IRQS];
   24.41 -
   24.42 -/* Bitmap indicating which PIRQs require Xen to be notified on unmask. */
   24.43 -static unsigned long pirq_needs_unmask_notify[NR_PIRQS/sizeof(unsigned long)];
   24.44 -
   24.45 -/* Upcall to generic IRQ layer. */
   24.46 -extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
   24.47 -
   24.48 -#define VALID_EVTCHN(_chn) ((_chn) != -1)
   24.49 -
   24.50 -void evtchn_do_upcall(struct pt_regs *regs)
   24.51 -{
   24.52 -    unsigned long  l1, l2;
   24.53 -    unsigned int   l1i, l2i, port;
   24.54 -    int            irq;
   24.55 -    unsigned long  flags;
   24.56 -    shared_info_t *s = HYPERVISOR_shared_info;
   24.57 -
   24.58 -    local_irq_save(flags);
   24.59 -    
   24.60 -    while ( s->vcpu_data[0].evtchn_upcall_pending )
   24.61 -    {
   24.62 -        s->vcpu_data[0].evtchn_upcall_pending = 0;
   24.63 -        /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
   24.64 -        l1 = xchg(&s->evtchn_pending_sel, 0);
   24.65 -        while ( (l1i = ffs(l1)) != 0 )
   24.66 -        {
   24.67 -            l1i--;
   24.68 -            l1 &= ~(1 << l1i);
   24.69 -        
   24.70 -            l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i];
   24.71 -            while ( (l2i = ffs(l2)) != 0 )
   24.72 -            {
   24.73 -                l2i--;
   24.74 -                l2 &= ~(1 << l2i);
   24.75 -            
   24.76 -                port = (l1i << 5) + l2i;
   24.77 -                if ( (irq = evtchn_to_irq[port]) != -1 )
   24.78 -                    do_IRQ(irq, regs);
   24.79 -                else
   24.80 -                    evtchn_device_upcall(port);
   24.81 -            }
   24.82 -        }
   24.83 -    }
   24.84 -
   24.85 -    local_irq_restore(flags);
   24.86 -}
   24.87 -
   24.88 -
   24.89 -static int find_unbound_irq(void)
   24.90 -{
   24.91 -    int irq;
   24.92 -
   24.93 -    for ( irq = 0; irq < NR_IRQS; irq++ )
   24.94 -        if ( irq_bindcount[irq] == 0 )
   24.95 -            break;
   24.96 -
   24.97 -    if ( irq == NR_IRQS )
   24.98 -        panic("No available IRQ to bind to: increase NR_IRQS!\n");
   24.99 -
  24.100 -    return irq;
  24.101 -}
  24.102 -
  24.103 -int bind_virq_to_irq(int virq)
  24.104 -{
  24.105 -    evtchn_op_t op;
  24.106 -    int evtchn, irq;
  24.107 -
  24.108 -    spin_lock(&irq_mapping_update_lock);
  24.109 -
  24.110 -    if ( (irq = virq_to_irq[virq]) == -1 )
  24.111 -    {
  24.112 -        op.cmd              = EVTCHNOP_bind_virq;
  24.113 -        op.u.bind_virq.virq = virq;
  24.114 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  24.115 -            panic("Failed to bind virtual IRQ %d\n", virq);
  24.116 -        evtchn = op.u.bind_virq.port;
  24.117 -
  24.118 -        irq = find_unbound_irq();
  24.119 -        evtchn_to_irq[evtchn] = irq;
  24.120 -        irq_to_evtchn[irq]    = evtchn;
  24.121 -
  24.122 -        virq_to_irq[virq] = irq;
  24.123 -    }
  24.124 -
  24.125 -    irq_bindcount[irq]++;
  24.126 -
  24.127 -    spin_unlock(&irq_mapping_update_lock);
  24.128 -    
  24.129 -    return irq;
  24.130 -}
  24.131 -
  24.132 -void unbind_virq_from_irq(int virq)
  24.133 -{
  24.134 -    evtchn_op_t op;
  24.135 -    int irq    = virq_to_irq[virq];
  24.136 -    int evtchn = irq_to_evtchn[irq];
  24.137 -
  24.138 -    spin_lock(&irq_mapping_update_lock);
  24.139 -
  24.140 -    if ( --irq_bindcount[irq] == 0 )
  24.141 -    {
  24.142 -        op.cmd          = EVTCHNOP_close;
  24.143 -        op.u.close.dom  = DOMID_SELF;
  24.144 -        op.u.close.port = evtchn;
  24.145 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  24.146 -            panic("Failed to unbind virtual IRQ %d\n", virq);
  24.147 -
  24.148 -        evtchn_to_irq[evtchn] = -1;
  24.149 -        irq_to_evtchn[irq]    = -1;
  24.150 -        virq_to_irq[virq]     = -1;
  24.151 -    }
  24.152 -
  24.153 -    spin_unlock(&irq_mapping_update_lock);
  24.154 -}
  24.155 -
  24.156 -int bind_evtchn_to_irq(int evtchn)
  24.157 -{
  24.158 -    int irq;
  24.159 -
  24.160 -    spin_lock(&irq_mapping_update_lock);
  24.161 -
  24.162 -    if ( (irq = evtchn_to_irq[evtchn]) == -1 )
  24.163 -    {
  24.164 -        irq = find_unbound_irq();
  24.165 -        evtchn_to_irq[evtchn] = irq;
  24.166 -        irq_to_evtchn[irq]    = evtchn;
  24.167 -    }
  24.168 -
  24.169 -    irq_bindcount[irq]++;
  24.170 -
  24.171 -    spin_unlock(&irq_mapping_update_lock);
  24.172 -    
  24.173 -    return irq;
  24.174 -}
  24.175 -
  24.176 -void unbind_evtchn_from_irq(int evtchn)
  24.177 -{
  24.178 -    int irq = evtchn_to_irq[evtchn];
  24.179 -
  24.180 -    spin_lock(&irq_mapping_update_lock);
  24.181 -
  24.182 -    if ( --irq_bindcount[irq] == 0 )
  24.183 -    {
  24.184 -        evtchn_to_irq[evtchn] = -1;
  24.185 -        irq_to_evtchn[irq]    = -1;
  24.186 -    }
  24.187 -
  24.188 -    spin_unlock(&irq_mapping_update_lock);
  24.189 -}
  24.190 -
  24.191 -
  24.192 -/*
  24.193 - * Interface to generic handling in irq.c
  24.194 - */
  24.195 -
  24.196 -static unsigned int startup_dynirq(unsigned int irq)
  24.197 -{
  24.198 -    unmask_evtchn(irq_to_evtchn[irq]);
  24.199 -    return 0;
  24.200 -}
  24.201 -
  24.202 -static void shutdown_dynirq(unsigned int irq)
  24.203 -{
  24.204 -    mask_evtchn(irq_to_evtchn[irq]);
  24.205 -}
  24.206 -
  24.207 -static void enable_dynirq(unsigned int irq)
  24.208 -{
  24.209 -    unmask_evtchn(irq_to_evtchn[irq]);
  24.210 -}
  24.211 -
  24.212 -static void disable_dynirq(unsigned int irq)
  24.213 -{
  24.214 -    mask_evtchn(irq_to_evtchn[irq]);
  24.215 -}
  24.216 -
  24.217 -static void ack_dynirq(unsigned int irq)
  24.218 -{
  24.219 -    mask_evtchn(irq_to_evtchn[irq]);
  24.220 -    clear_evtchn(irq_to_evtchn[irq]);
  24.221 -}
  24.222 -
  24.223 -static void end_dynirq(unsigned int irq)
  24.224 -{
  24.225 -    if ( !(irq_desc[irq].status & IRQ_DISABLED) )
  24.226 -        unmask_evtchn(irq_to_evtchn[irq]);
  24.227 -}
  24.228 -
  24.229 -static struct hw_interrupt_type dynirq_type = {
  24.230 -    "Dynamic-irq",
  24.231 -    startup_dynirq,
  24.232 -    shutdown_dynirq,
  24.233 -    enable_dynirq,
  24.234 -    disable_dynirq,
  24.235 -    ack_dynirq,
  24.236 -    end_dynirq,
  24.237 -    NULL
  24.238 -};
  24.239 -
  24.240 -static inline void pirq_unmask_notify(int pirq)
  24.241 -{
  24.242 -    physdev_op_t op;
  24.243 -    if ( unlikely(test_bit(pirq, &pirq_needs_unmask_notify[0])) )
  24.244 -    {
  24.245 -        op.cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY;
  24.246 -        (void)HYPERVISOR_physdev_op(&op);
  24.247 -    }
  24.248 -}
  24.249 -
  24.250 -static inline void pirq_query_unmask(int pirq)
  24.251 -{
  24.252 -    physdev_op_t op;
  24.253 -    op.cmd = PHYSDEVOP_IRQ_STATUS_QUERY;
  24.254 -    op.u.irq_status_query.irq = pirq;
  24.255 -    (void)HYPERVISOR_physdev_op(&op);
  24.256 -    clear_bit(pirq, &pirq_needs_unmask_notify[0]);
  24.257 -    if ( op.u.irq_status_query.flags & PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY )
  24.258 -        set_bit(pirq, &pirq_needs_unmask_notify[0]);
  24.259 -}
  24.260 -
  24.261 -/*
  24.262 - * On startup, if there is no action associated with the IRQ then we are
  24.263 - * probing. In this case we should not share with others as it will confuse us.
  24.264 - */
  24.265 -#define probing_irq(_irq) (irq_desc[(_irq)].action == NULL)
  24.266 -
  24.267 -static unsigned int startup_pirq(unsigned int irq)
  24.268 -{
  24.269 -    evtchn_op_t op;
  24.270 -    int evtchn;
  24.271 -
  24.272 -    op.cmd               = EVTCHNOP_bind_pirq;
  24.273 -    op.u.bind_pirq.pirq  = irq;
  24.274 -    /* NB. We are happy to share unless we are probing. */
  24.275 -    op.u.bind_pirq.flags = probing_irq(irq) ? 0 : BIND_PIRQ__WILL_SHARE;
  24.276 -    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  24.277 -    {
  24.278 -        if ( !probing_irq(irq) ) /* Some failures are expected when probing. */
  24.279 -            printk(KERN_INFO "Failed to obtain physical IRQ %d\n", irq);
  24.280 -        return 0;
  24.281 -    }
  24.282 -    evtchn = op.u.bind_pirq.port;
  24.283 -
  24.284 -    pirq_query_unmask(irq_to_pirq(irq));
  24.285 -
  24.286 -    evtchn_to_irq[evtchn] = irq;
  24.287 -    irq_to_evtchn[irq]    = evtchn;
  24.288 -
  24.289 -    unmask_evtchn(evtchn);
  24.290 -    pirq_unmask_notify(irq_to_pirq(irq));
  24.291 -
  24.292 -    return 0;
  24.293 -}
  24.294 -
  24.295 -static void shutdown_pirq(unsigned int irq)
  24.296 -{
  24.297 -    evtchn_op_t op;
  24.298 -    int evtchn = irq_to_evtchn[irq];
  24.299 -
  24.300 -    if ( !VALID_EVTCHN(evtchn) )
  24.301 -        return;
  24.302 -
  24.303 -    mask_evtchn(evtchn);
  24.304 -
  24.305 -    op.cmd          = EVTCHNOP_close;
  24.306 -    op.u.close.dom  = DOMID_SELF;
  24.307 -    op.u.close.port = evtchn;
  24.308 -    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  24.309 -        panic("Failed to unbind physical IRQ %d\n", irq);
  24.310 -
  24.311 -    evtchn_to_irq[evtchn] = -1;
  24.312 -    irq_to_evtchn[irq]    = -1;
  24.313 -}
  24.314 -
  24.315 -static void enable_pirq(unsigned int irq)
  24.316 -{
  24.317 -    int evtchn = irq_to_evtchn[irq];
  24.318 -    if ( !VALID_EVTCHN(evtchn) )
  24.319 -        return;
  24.320 -    unmask_evtchn(evtchn);
  24.321 -    pirq_unmask_notify(irq_to_pirq(irq));
  24.322 -}
  24.323 -
  24.324 -static void disable_pirq(unsigned int irq)
  24.325 -{
  24.326 -    int evtchn = irq_to_evtchn[irq];
  24.327 -    if ( !VALID_EVTCHN(evtchn) )
  24.328 -        return;
  24.329 -    mask_evtchn(evtchn);
  24.330 -}
  24.331 -
  24.332 -static void ack_pirq(unsigned int irq)
  24.333 -{
  24.334 -    int evtchn = irq_to_evtchn[irq];
  24.335 -    if ( !VALID_EVTCHN(evtchn) )
  24.336 -        return;
  24.337 -    mask_evtchn(evtchn);
  24.338 -    clear_evtchn(evtchn);
  24.339 -}
  24.340 -
  24.341 -static void end_pirq(unsigned int irq)
  24.342 -{
  24.343 -    int evtchn = irq_to_evtchn[irq];
  24.344 -    if ( !VALID_EVTCHN(evtchn) )
  24.345 -        return;
  24.346 -    if ( !(irq_desc[irq].status & IRQ_DISABLED) )
  24.347 -    {
  24.348 -        unmask_evtchn(evtchn);
  24.349 -        pirq_unmask_notify(irq_to_pirq(irq));
  24.350 -    }
  24.351 -}
  24.352 -
  24.353 -static struct hw_interrupt_type pirq_type = {
  24.354 -    "Phys-irq",
  24.355 -    startup_pirq,
  24.356 -    shutdown_pirq,
  24.357 -    enable_pirq,
  24.358 -    disable_pirq,
  24.359 -    ack_pirq,
  24.360 -    end_pirq,
  24.361 -    NULL
  24.362 -};
  24.363 -
  24.364 -static void misdirect_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  24.365 -{
  24.366 -    /* nothing */
  24.367 -}
  24.368 -
  24.369 -static struct irqaction misdirect_action = {
  24.370 -    misdirect_interrupt, 
  24.371 -    SA_INTERRUPT, 
  24.372 -    0, 
  24.373 -    "misdirect", 
  24.374 -    NULL, 
  24.375 -    NULL
  24.376 -};
  24.377 -
  24.378 -void irq_suspend(void)
  24.379 -{
  24.380 -    int virq, irq, evtchn;
  24.381 -
  24.382 -    /* Unbind VIRQs from event channels. */
  24.383 -    for ( virq = 0; virq < NR_VIRQS; virq++ )
  24.384 -    {
  24.385 -        if ( (irq = virq_to_irq[virq]) == -1 )
  24.386 -            continue;
  24.387 -        evtchn = irq_to_evtchn[irq];
  24.388 -
  24.389 -        /* Mark the event channel as unused in our table. */
  24.390 -        evtchn_to_irq[evtchn] = -1;
  24.391 -        irq_to_evtchn[irq]    = -1;
  24.392 -    }
  24.393 -
  24.394 -    /*
  24.395 -     * We should now be unbound from all event channels. Stale bindings to 
  24.396 -     * PIRQs and/or inter-domain event channels will cause us to barf here.
  24.397 -     */
  24.398 -    for ( evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++ )
  24.399 -        if ( evtchn_to_irq[evtchn] != -1 )
  24.400 -            panic("Suspend attempted while bound to evtchn %d.\n", evtchn);
  24.401 -}
  24.402 -
  24.403 -
  24.404 -void irq_resume(void)
  24.405 -{
  24.406 -    evtchn_op_t op;
  24.407 -    int         virq, irq, evtchn;
  24.408 -
  24.409 -    for ( evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++ )
  24.410 -        mask_evtchn(evtchn); /* New event-channel space is not 'live' yet. */
  24.411 -
  24.412 -    for ( virq = 0; virq < NR_VIRQS; virq++ )
  24.413 -    {
  24.414 -        if ( (irq = virq_to_irq[virq]) == -1 )
  24.415 -            continue;
  24.416 -
  24.417 -        /* Get a new binding from Xen. */
  24.418 -        op.cmd              = EVTCHNOP_bind_virq;
  24.419 -        op.u.bind_virq.virq = virq;
  24.420 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  24.421 -            panic("Failed to bind virtual IRQ %d\n", virq);
  24.422 -        evtchn = op.u.bind_virq.port;
  24.423 -        
  24.424 -        /* Record the new mapping. */
  24.425 -        evtchn_to_irq[evtchn] = irq;
  24.426 -        irq_to_evtchn[irq]    = evtchn;
  24.427 -
  24.428 -        /* Ready for use. */
  24.429 -        unmask_evtchn(evtchn);
  24.430 -    }
  24.431 -}
  24.432 -
  24.433 -void __init init_IRQ(void)
  24.434 -{
  24.435 -    int i;
  24.436 -
  24.437 -    spin_lock_init(&irq_mapping_update_lock);
  24.438 -
  24.439 -    /* No VIRQ -> IRQ mappings. */
  24.440 -    for ( i = 0; i < NR_VIRQS; i++ )
  24.441 -        virq_to_irq[i] = -1;
  24.442 -
  24.443 -    /* No event-channel -> IRQ mappings. */
  24.444 -    for ( i = 0; i < NR_EVENT_CHANNELS; i++ )
  24.445 -    {
  24.446 -        evtchn_to_irq[i] = -1;
  24.447 -        mask_evtchn(i); /* No event channels are 'live' right now. */
  24.448 -    }
  24.449 -
  24.450 -    /* No IRQ -> event-channel mappings. */
  24.451 -    for ( i = 0; i < NR_IRQS; i++ )
  24.452 -        irq_to_evtchn[i] = -1;
  24.453 -
  24.454 -    for ( i = 0; i < NR_DYNIRQS; i++ )
  24.455 -    {
  24.456 -        /* Dynamic IRQ space is currently unbound. Zero the refcnts. */
  24.457 -        irq_bindcount[dynirq_to_irq(i)] = 0;
  24.458 -
  24.459 -        irq_desc[dynirq_to_irq(i)].status  = IRQ_DISABLED;
  24.460 -        irq_desc[dynirq_to_irq(i)].action  = 0;
  24.461 -        irq_desc[dynirq_to_irq(i)].depth   = 1;
  24.462 -        irq_desc[dynirq_to_irq(i)].handler = &dynirq_type;
  24.463 -    }
  24.464 -
  24.465 -    for ( i = 0; i < NR_PIRQS; i++ )
  24.466 -    {
  24.467 -        /* Phys IRQ space is statically bound (1:1 mapping). Nail refcnts. */
  24.468 -        irq_bindcount[pirq_to_irq(i)] = 1;
  24.469 -
  24.470 -        irq_desc[pirq_to_irq(i)].status  = IRQ_DISABLED;
  24.471 -        irq_desc[pirq_to_irq(i)].action  = 0;
  24.472 -        irq_desc[pirq_to_irq(i)].depth   = 1;
  24.473 -        irq_desc[pirq_to_irq(i)].handler = &pirq_type;
  24.474 -    }
  24.475 -
  24.476 -    (void)setup_irq(bind_virq_to_irq(VIRQ_MISDIRECT), &misdirect_action);
  24.477 -
  24.478 -    /* This needs to be done early, but after the IRQ subsystem is alive. */
  24.479 -    ctrl_if_init();
  24.480 -}
    25.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/pci-dma.c	Fri Jul 23 14:11:01 2004 +0000
    25.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/pci-dma.c	Tue Aug 03 12:28:49 2004 +0000
    25.3 @@ -18,15 +18,59 @@ void *pci_alloc_consistent(struct pci_de
    25.4  {
    25.5  	void *ret;
    25.6  	int gfp = GFP_ATOMIC;
    25.7 +	unsigned int order = get_order(size);
    25.8 +	unsigned long vstart;
    25.9  
   25.10  	if (hwdev == NULL || ((u32)hwdev->dma_mask < 0xffffffff))
   25.11  		gfp |= GFP_DMA;
   25.12 -	ret = (void *)__get_free_pages(gfp, get_order(size));
   25.13 +
   25.14 +	ret = (void *)vstart = __get_free_pages(gfp, order);
   25.15 +	if (ret == NULL)
   25.16 +		return ret;
   25.17  
   25.18 -	if (ret != NULL) {
   25.19 -		memset(ret, 0, size);
   25.20 -		*dma_handle = virt_to_bus(ret);
   25.21 +	/*
   25.22 +	 * Ensure multi-page extents are contiguous in machine memory.
   25.23 +	 * This code could be cleaned up some, and the number of
   25.24 +	 * hypercalls reduced.
   25.25 +	 */
   25.26 +	if (size > PAGE_SIZE) {
   25.27 +		pgd_t         *pgd; 
   25.28 +		pmd_t         *pmd;
   25.29 +		pte_t         *pte;
   25.30 +		unsigned long  pfn, i;
   25.31 +		/* 1. Zap current PTEs, giving away the underlying pages. */
   25.32 +		for (i = 0; i < (1<<order); i++) {
   25.33 +			pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   25.34 +			pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
   25.35 +			pte = pte_offset(pmd, (vstart + (i*PAGE_SIZE)));
   25.36 +			pfn = pte->pte_low >> PAGE_SHIFT;
   25.37 +			queue_l1_entry_update(pte, 0);
   25.38 +			flush_page_update_queue();
   25.39 +			if (HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
   25.40 +				&pfn, 1, 0) != 1) BUG();
   25.41 +		}
   25.42 +		/* 2. Get a new contiguous memory extent. */
   25.43 +		if (HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
   25.44 +			&pfn, 1, order) != 1) BUG();
   25.45 +		/* 3. Map the new extent in place of old pages. */
   25.46 +		for (i = 0; i < (1<<order); i++) {
   25.47 +			pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   25.48 +			pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
   25.49 +			pte = pte_offset(pmd, (vstart + (i*PAGE_SIZE)));
   25.50 +			queue_l1_entry_update(pte, 
   25.51 +				((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL);
   25.52 +			queue_machphys_update(pfn+i,
   25.53 +				(__pa(ret)>>PAGE_SHIFT)+i);
   25.54 +			phys_to_machine_mapping[(__pa(ret)>>PAGE_SHIFT)+i] =
   25.55 +				pfn+i;
   25.56 +                        flush_page_update_queue();
   25.57 +		}
   25.58 +		flush_page_update_queue();
   25.59  	}
   25.60 +
   25.61 +	memset(ret, 0, size);
   25.62 +	*dma_handle = virt_to_bus(ret);
   25.63 +
   25.64  	return ret;
   25.65  }
   25.66  
    26.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/time.c	Fri Jul 23 14:11:01 2004 +0000
    26.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/time.c	Tue Aug 03 12:28:49 2004 +0000
    26.3 @@ -391,7 +391,8 @@ static inline void do_timer_interrupt(in
    26.4  
    26.5      __get_time_values_from_xen();
    26.6  
    26.7 -    if ( (delta = (s64)(shadow_system_time - processed_system_time)) < 0 )
    26.8 +    if ( (delta = (s64)(shadow_system_time + __get_time_delta_usecs() * 1000 -
    26.9 +						processed_system_time)) < 0 )
   26.10      {
   26.11          printk("Timer ISR: Time went backwards: %lld\n", delta);
   26.12          return;
    27.1 --- a/linux-2.4.26-xen-sparse/arch/xen/lib/xen_proc.c	Fri Jul 23 14:11:01 2004 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,18 +0,0 @@
    27.4 -
    27.5 -#include <linux/config.h>
    27.6 -#include <linux/proc_fs.h>
    27.7 -
    27.8 -static struct proc_dir_entry *xen_base;
    27.9 -
   27.10 -struct proc_dir_entry *create_xen_proc_entry(const char *name, mode_t mode)
   27.11 -{
   27.12 -    if ( xen_base == NULL )
   27.13 -        if ( (xen_base = proc_mkdir("xen", &proc_root)) == NULL )
   27.14 -            panic("Couldn't create /proc/xen");
   27.15 -    return create_proc_entry(name, mode, xen_base);
   27.16 -}
   27.17 -
   27.18 -void remove_xen_proc_entry(const char *name)
   27.19 -{
   27.20 -    remove_proc_entry(name, xen_base);
   27.21 -}
    28.1 --- a/linux-2.4.26-xen-sparse/arch/xen/mm/hypervisor.c	Fri Jul 23 14:11:01 2004 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,345 +0,0 @@
    28.4 -/******************************************************************************
    28.5 - * xen/mm/hypervisor.c
    28.6 - * 
    28.7 - * Update page tables via the hypervisor.
    28.8 - * 
    28.9 - * Copyright (c) 2002, K A Fraser
   28.10 - */
   28.11 -
   28.12 -#include <linux/config.h>
   28.13 -#include <linux/sched.h>
   28.14 -#include <linux/mm.h>
   28.15 -#include <linux/vmalloc.h>
   28.16 -#include <asm/hypervisor.h>
   28.17 -#include <asm/page.h>
   28.18 -#include <asm/pgtable.h>
   28.19 -#include <asm/multicall.h>
   28.20 -
   28.21 -/*
   28.22 - * This suffices to protect us if we ever move to SMP domains.
   28.23 - * Further, it protects us against interrupts. At the very least, this is
   28.24 - * required for the network driver which flushes the update queue before
   28.25 - * pushing new receive buffers.
   28.26 - */
   28.27 -static spinlock_t update_lock = SPIN_LOCK_UNLOCKED;
   28.28 -
   28.29 -#define QUEUE_SIZE 2048
   28.30 -static mmu_update_t update_queue[QUEUE_SIZE];
   28.31 -unsigned int mmu_update_queue_idx = 0;
   28.32 -#define idx mmu_update_queue_idx
   28.33 -
   28.34 -#if MMU_UPDATE_DEBUG > 0
   28.35 -page_update_debug_t update_debug_queue[QUEUE_SIZE] = {{0}};
   28.36 -#undef queue_l1_entry_update
   28.37 -#undef queue_l2_entry_update
   28.38 -static void DEBUG_allow_pt_reads(void)
   28.39 -{
   28.40 -    pte_t *pte;
   28.41 -    mmu_update_t update;
   28.42 -    int i;
   28.43 -    for ( i = idx-1; i >= 0; i-- )
   28.44 -    {
   28.45 -        pte = update_debug_queue[i].ptep;
   28.46 -        if ( pte == NULL ) continue;
   28.47 -        update_debug_queue[i].ptep = NULL;
   28.48 -        update.ptr = virt_to_machine(pte);
   28.49 -        update.val = update_debug_queue[i].pteval;
   28.50 -        HYPERVISOR_mmu_update(&update, 1, NULL);
   28.51 -    }
   28.52 -}
   28.53 -static void DEBUG_disallow_pt_read(unsigned long va)
   28.54 -{
   28.55 -    pte_t *pte;
   28.56 -    pmd_t *pmd;
   28.57 -    pgd_t *pgd;
   28.58 -    unsigned long pteval;
   28.59 -    /*
   28.60 -     * We may fault because of an already outstanding update.
   28.61 -     * That's okay -- it'll get fixed up in the fault handler.
   28.62 -     */
   28.63 -    mmu_update_t update;
   28.64 -    pgd = pgd_offset_k(va);
   28.65 -    pmd = pmd_offset(pgd, va);
   28.66 -    pte = pte_offset(pmd, va);
   28.67 -    update.ptr = virt_to_machine(pte);
   28.68 -    pteval = *(unsigned long *)pte;
   28.69 -    update.val = pteval & ~_PAGE_PRESENT;
   28.70 -    HYPERVISOR_mmu_update(&update, 1, NULL);
   28.71 -    update_debug_queue[idx].ptep = pte;
   28.72 -    update_debug_queue[idx].pteval = pteval;
   28.73 -}
   28.74 -#endif
   28.75 -
   28.76 -#if MMU_UPDATE_DEBUG > 1
   28.77 -#undef queue_pt_switch
   28.78 -#undef queue_tlb_flush
   28.79 -#undef queue_invlpg
   28.80 -#undef queue_pgd_pin
   28.81 -#undef queue_pgd_unpin
   28.82 -#undef queue_pte_pin
   28.83 -#undef queue_pte_unpin
   28.84 -#endif
   28.85 -
   28.86 -
   28.87 -/*
   28.88 - * MULTICALL_flush_page_update_queue:
   28.89 - *   This is a version of the flush which queues as part of a multicall.
   28.90 - */
   28.91 -void MULTICALL_flush_page_update_queue(void)
   28.92 -{
   28.93 -    unsigned long flags;
   28.94 -    unsigned int _idx;
   28.95 -    spin_lock_irqsave(&update_lock, flags);
   28.96 -    if ( (_idx = idx) != 0 ) 
   28.97 -    {
   28.98 -#if MMU_UPDATE_DEBUG > 1
   28.99 -        printk("Flushing %d entries from pt update queue\n", idx);
  28.100 -#endif
  28.101 -#if MMU_UPDATE_DEBUG > 0
  28.102 -        DEBUG_allow_pt_reads();
  28.103 -#endif
  28.104 -        idx = 0;
  28.105 -        wmb(); /* Make sure index is cleared first to avoid double updates. */
  28.106 -        queue_multicall3(__HYPERVISOR_mmu_update, 
  28.107 -                         (unsigned long)update_queue, 
  28.108 -                         (unsigned long)_idx, 
  28.109 -                         (unsigned long)NULL);
  28.110 -    }
  28.111 -    spin_unlock_irqrestore(&update_lock, flags);
  28.112 -}
  28.113 -
  28.114 -static inline void __flush_page_update_queue(void)
  28.115 -{
  28.116 -    unsigned int _idx = idx;
  28.117 -#if MMU_UPDATE_DEBUG > 1
  28.118 -    printk("Flushing %d entries from pt update queue\n", idx);
  28.119 -#endif
  28.120 -#if MMU_UPDATE_DEBUG > 0
  28.121 -    DEBUG_allow_pt_reads();
  28.122 -#endif
  28.123 -    idx = 0;
  28.124 -    wmb(); /* Make sure index is cleared first to avoid double updates. */
  28.125 -    if ( unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0) )
  28.126 -        panic("Failed to execute MMU updates");
  28.127 -}
  28.128 -
  28.129 -void _flush_page_update_queue(void)
  28.130 -{
  28.131 -    unsigned long flags;
  28.132 -    spin_lock_irqsave(&update_lock, flags);
  28.133 -    if ( idx != 0 ) __flush_page_update_queue();
  28.134 -    spin_unlock_irqrestore(&update_lock, flags);
  28.135 -}
  28.136 -
  28.137 -static inline void increment_index(void)
  28.138 -{
  28.139 -    idx++;
  28.140 -    if ( unlikely(idx == QUEUE_SIZE) ) __flush_page_update_queue();
  28.141 -}
  28.142 -
  28.143 -void queue_l1_entry_update(pte_t *ptr, unsigned long val)
  28.144 -{
  28.145 -    unsigned long flags;
  28.146 -    spin_lock_irqsave(&update_lock, flags);
  28.147 -#if MMU_UPDATE_DEBUG > 0
  28.148 -    DEBUG_disallow_pt_read((unsigned long)ptr);
  28.149 -#endif
  28.150 -    update_queue[idx].ptr = virt_to_machine(ptr);
  28.151 -    update_queue[idx].val = val;
  28.152 -    increment_index();
  28.153 -    spin_unlock_irqrestore(&update_lock, flags);
  28.154 -}
  28.155 -
  28.156 -void queue_l2_entry_update(pmd_t *ptr, unsigned long val)
  28.157 -{
  28.158 -    unsigned long flags;
  28.159 -    spin_lock_irqsave(&update_lock, flags);
  28.160 -    update_queue[idx].ptr = virt_to_machine(ptr);
  28.161 -    update_queue[idx].val = val;
  28.162 -    increment_index();
  28.163 -    spin_unlock_irqrestore(&update_lock, flags);
  28.164 -}
  28.165 -
  28.166 -void queue_pt_switch(unsigned long ptr)
  28.167 -{
  28.168 -    unsigned long flags;
  28.169 -    spin_lock_irqsave(&update_lock, flags);
  28.170 -    update_queue[idx].ptr  = phys_to_machine(ptr);
  28.171 -    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  28.172 -    update_queue[idx].val  = MMUEXT_NEW_BASEPTR;
  28.173 -    increment_index();
  28.174 -    spin_unlock_irqrestore(&update_lock, flags);
  28.175 -}
  28.176 -
  28.177 -void queue_tlb_flush(void)
  28.178 -{
  28.179 -    unsigned long flags;
  28.180 -    spin_lock_irqsave(&update_lock, flags);
  28.181 -    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND;
  28.182 -    update_queue[idx].val  = MMUEXT_TLB_FLUSH;
  28.183 -    increment_index();
  28.184 -    spin_unlock_irqrestore(&update_lock, flags);
  28.185 -}
  28.186 -
  28.187 -void queue_invlpg(unsigned long ptr)
  28.188 -{
  28.189 -    unsigned long flags;
  28.190 -    spin_lock_irqsave(&update_lock, flags);
  28.191 -    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND;
  28.192 -    update_queue[idx].ptr |= ptr & PAGE_MASK;
  28.193 -    update_queue[idx].val  = MMUEXT_INVLPG;
  28.194 -    increment_index();
  28.195 -    spin_unlock_irqrestore(&update_lock, flags);
  28.196 -}
  28.197 -
  28.198 -void queue_pgd_pin(unsigned long ptr)
  28.199 -{
  28.200 -    unsigned long flags;
  28.201 -    spin_lock_irqsave(&update_lock, flags);
  28.202 -    update_queue[idx].ptr  = phys_to_machine(ptr);
  28.203 -    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  28.204 -    update_queue[idx].val  = MMUEXT_PIN_L2_TABLE;
  28.205 -    increment_index();
  28.206 -    spin_unlock_irqrestore(&update_lock, flags);
  28.207 -}
  28.208 -
  28.209 -void queue_pgd_unpin(unsigned long ptr)
  28.210 -{
  28.211 -    unsigned long flags;
  28.212 -    spin_lock_irqsave(&update_lock, flags);
  28.213 -    update_queue[idx].ptr  = phys_to_machine(ptr);
  28.214 -    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  28.215 -    update_queue[idx].val  = MMUEXT_UNPIN_TABLE;
  28.216 -    increment_index();
  28.217 -    spin_unlock_irqrestore(&update_lock, flags);
  28.218 -}
  28.219 -
  28.220 -void queue_pte_pin(unsigned long ptr)
  28.221 -{
  28.222 -    unsigned long flags;
  28.223 -    spin_lock_irqsave(&update_lock, flags);
  28.224 -    update_queue[idx].ptr  = phys_to_machine(ptr);
  28.225 -    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  28.226 -    update_queue[idx].val  = MMUEXT_PIN_L1_TABLE;
  28.227 -    increment_index();
  28.228 -    spin_unlock_irqrestore(&update_lock, flags);
  28.229 -}
  28.230 -
  28.231 -void queue_pte_unpin(unsigned long ptr)
  28.232 -{
  28.233 -    unsigned long flags;
  28.234 -    spin_lock_irqsave(&update_lock, flags);
  28.235 -    update_queue[idx].ptr  = phys_to_machine(ptr);
  28.236 -    update_queue[idx].ptr |= MMU_EXTENDED_COMMAND;
  28.237 -    update_queue[idx].val  = MMUEXT_UNPIN_TABLE;
  28.238 -    increment_index();
  28.239 -    spin_unlock_irqrestore(&update_lock, flags);
  28.240 -}
  28.241 -
  28.242 -void queue_set_ldt(unsigned long ptr, unsigned long len)
  28.243 -{
  28.244 -    unsigned long flags;
  28.245 -    spin_lock_irqsave(&update_lock, flags);
  28.246 -    update_queue[idx].ptr  = MMU_EXTENDED_COMMAND | ptr;
  28.247 -    update_queue[idx].val  = MMUEXT_SET_LDT | (len << MMUEXT_CMD_SHIFT);
  28.248 -    increment_index();
  28.249 -    spin_unlock_irqrestore(&update_lock, flags);
  28.250 -}
  28.251 -
  28.252 -void queue_machphys_update(unsigned long mfn, unsigned long pfn)
  28.253 -{
  28.254 -    unsigned long flags;
  28.255 -    spin_lock_irqsave(&update_lock, flags);
  28.256 -    update_queue[idx].ptr = (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
  28.257 -    update_queue[idx].val = pfn;
  28.258 -    increment_index();
  28.259 -    spin_unlock_irqrestore(&update_lock, flags);
  28.260 -}
  28.261 -
  28.262 -#ifdef CONFIG_XEN_PHYSDEV_ACCESS
  28.263 -
  28.264 -unsigned long allocate_empty_lowmem_region(unsigned long pages)
  28.265 -{
  28.266 -    pgd_t         *pgd; 
  28.267 -    pmd_t         *pmd;
  28.268 -    pte_t         *pte;
  28.269 -    unsigned long *pfn_array;
  28.270 -    unsigned long  vstart;
  28.271 -    unsigned long  i;
  28.272 -    int            ret;
  28.273 -    unsigned int   order = get_order(pages*PAGE_SIZE);
  28.274 -
  28.275 -    vstart = __get_free_pages(GFP_KERNEL, order);
  28.276 -    if ( vstart == 0 )
  28.277 -        return 0UL;
  28.278 -
  28.279 -    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
  28.280 -    if ( pfn_array == NULL )
  28.281 -        BUG();
  28.282 -
  28.283 -    for ( i = 0; i < (1<<order); i++ )
  28.284 -    {
  28.285 -        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
  28.286 -        pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
  28.287 -        pte = pte_offset(pmd, (vstart + (i*PAGE_SIZE))); 
  28.288 -        pfn_array[i] = pte->pte_low >> PAGE_SHIFT;
  28.289 -        queue_l1_entry_update(pte, 0);
  28.290 -        phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = 0xdeadbeef;
  28.291 -    }
  28.292 -
  28.293 -    flush_page_update_queue();
  28.294 -
  28.295 -    ret = HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
  28.296 -                                pfn_array, 1<<order);
  28.297 -    if ( unlikely(ret != (1<<order)) )
  28.298 -    {
  28.299 -        printk(KERN_WARNING "Unable to reduce memory reservation (%d)\n", ret);
  28.300 -        BUG();
  28.301 -    }
  28.302 -
  28.303 -    vfree(pfn_array);
  28.304 -
  28.305 -    return vstart;
  28.306 -}
  28.307 -
  28.308 -void deallocate_lowmem_region(unsigned long vstart, unsigned long pages)
  28.309 -{
  28.310 -    pgd_t         *pgd; 
  28.311 -    pmd_t         *pmd;
  28.312 -    pte_t         *pte;
  28.313 -    unsigned long *pfn_array;
  28.314 -    unsigned long  i;
  28.315 -    int            ret;
  28.316 -    unsigned int   order = get_order(pages*PAGE_SIZE);
  28.317 -
  28.318 -    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
  28.319 -    if ( pfn_array == NULL )
  28.320 -        BUG();
  28.321 -
  28.322 -    ret = HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
  28.323 -                                pfn_array, 1<<order);
  28.324 -    if ( unlikely(ret != (1<<order)) )
  28.325 -    {
  28.326 -        printk(KERN_WARNING "Unable to increase memory reservation (%d)\n",
  28.327 -               ret);
  28.328 -        BUG();
  28.329 -    }
  28.330 -
  28.331 -    for ( i = 0; i < (1<<order); i++ )
  28.332 -    {
  28.333 -        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
  28.334 -        pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
  28.335 -        pte = pte_offset(pmd, (vstart + (i*PAGE_SIZE)));
  28.336 -        queue_l1_entry_update(pte, (pfn_array[i]<<PAGE_SHIFT)|__PAGE_KERNEL);
  28.337 -        queue_machphys_update(pfn_array[i], __pa(vstart)>>PAGE_SHIFT);
  28.338 -        phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = pfn_array[i];
  28.339 -    }
  28.340 -
  28.341 -    flush_page_update_queue();
  28.342 -
  28.343 -    vfree(pfn_array);
  28.344 -
  28.345 -    free_pages(vstart, order);
  28.346 -}
  28.347 -
  28.348 -#endif /* CONFIG_XEN_PHYSDEV_ACCESS */
    29.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/ctrl_if.h	Fri Jul 23 14:11:01 2004 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,121 +0,0 @@
    29.4 -/******************************************************************************
    29.5 - * ctrl_if.h
    29.6 - * 
    29.7 - * Management functions for special interface to the domain controller.
    29.8 - * 
    29.9 - * Copyright (c) 2004, K A Fraser
   29.10 - */
   29.11 -
   29.12 -#ifndef __ASM_XEN__CTRL_IF_H__
   29.13 -#define __ASM_XEN__CTRL_IF_H__
   29.14 -
   29.15 -#include <linux/tqueue.h>
   29.16 -#include <asm/hypervisor.h>
   29.17 -
   29.18 -typedef control_msg_t ctrl_msg_t;
   29.19 -
   29.20 -/*
   29.21 - * Callback function type. Called for asynchronous processing of received
   29.22 - * request messages, and responses to previously-transmitted request messages.
   29.23 - * The parameters are (@msg, @id).
   29.24 - *  @msg: Original request/response message (not a copy). The message can be
   29.25 - *        modified in-place by the handler (e.g., a response callback can
   29.26 - *        turn a request message into a response message in place). The message
   29.27 - *        is no longer accessible after the callback handler returns -- if the
   29.28 - *        message is required to persist for longer then it must be copied.
   29.29 - *  @id:  (Response callbacks only) The 'id' that was specified when the
   29.30 - *        original request message was queued for transmission.
   29.31 - */
   29.32 -typedef void (*ctrl_msg_handler_t)(ctrl_msg_t *, unsigned long);
   29.33 -
   29.34 -/*
   29.35 - * Send @msg to the domain controller. Execute @hnd when a response is
   29.36 - * received, passing the response message and the specified @id. This
   29.37 - * operation will not block: it will return -EAGAIN if there is no space.
   29.38 - * Notes:
   29.39 - *  1. The @msg is copied if it is transmitted and so can be freed after this
   29.40 - *     function returns.
   29.41 - *  2. If @hnd is NULL then no callback is executed.
   29.42 - */
   29.43 -int ctrl_if_send_message_noblock(
   29.44 -    ctrl_msg_t *msg, 
   29.45 -    ctrl_msg_handler_t hnd,
   29.46 -    unsigned long id);
   29.47 -
   29.48 -/*
   29.49 - * Send @msg to the domain controller. Execute @hnd when a response is
   29.50 - * received, passing the response message and the specified @id. This
   29.51 - * operation will block until the message is sent, or a signal is received
   29.52 - * for the calling process (unless @wait_state is TASK_UNINTERRUPTIBLE).
   29.53 - * Notes:
   29.54 - *  1. The @msg is copied if it is transmitted and so can be freed after this
   29.55 - *     function returns.
   29.56 - *  2. If @hnd is NULL then no callback is executed.
   29.57 - */
   29.58 -int ctrl_if_send_message_block(
   29.59 -    ctrl_msg_t *msg, 
   29.60 -    ctrl_msg_handler_t hnd, 
   29.61 -    unsigned long id, 
   29.62 -    long wait_state);
   29.63 -
   29.64 -/*
   29.65 - * Request a callback when there is /possibly/ space to immediately send a
   29.66 - * message to the domain controller. This function returns 0 if there is
   29.67 - * already space to trasnmit a message --- in this case the callback task /may/
   29.68 - * still be executed. If this function returns 1 then the callback /will/ be
   29.69 - * executed when space becomes available.
   29.70 - */
   29.71 -int ctrl_if_enqueue_space_callback(struct tq_struct *task);
   29.72 -
   29.73 -/*
   29.74 - * Send a response (@msg) to a message from the domain controller. This will 
   29.75 - * never block.
   29.76 - * Notes:
   29.77 - *  1. The @msg is copied and so can be freed after this function returns.
   29.78 - *  2. The @msg may be the original request message, modified in-place.
   29.79 - */
   29.80 -void ctrl_if_send_response(ctrl_msg_t *msg);
   29.81 -
   29.82 -/*
   29.83 - * Register a receiver for typed messages from the domain controller. The 
   29.84 - * handler (@hnd) is called for every received message of specified @type.
   29.85 - * Returns TRUE (non-zero) if the handler was successfully registered.
   29.86 - * If CALLBACK_IN_BLOCKING CONTEXT is specified in @flags then callbacks will
   29.87 - * occur in a context in which it is safe to yield (i.e., process context).
   29.88 - */
   29.89 -#define CALLBACK_IN_BLOCKING_CONTEXT 1
   29.90 -int ctrl_if_register_receiver(
   29.91 -    u8 type, 
   29.92 -    ctrl_msg_handler_t hnd,
   29.93 -    unsigned int flags);
   29.94 -
   29.95 -/*
   29.96 - * Unregister a receiver for typed messages from the domain controller. The 
   29.97 - * handler (@hnd) will not be executed after this function returns.
   29.98 - */
   29.99 -void ctrl_if_unregister_receiver(u8 type, ctrl_msg_handler_t hnd);
  29.100 -
  29.101 -/* Suspend/resume notifications. */
  29.102 -void ctrl_if_suspend(void);
  29.103 -void ctrl_if_resume(void);
  29.104 -
  29.105 -/* Start-of-day setup. */
  29.106 -void ctrl_if_init(void);
  29.107 -
  29.108 -/*
  29.109 - * Returns TRUE if there are no outstanding message requests at the domain
  29.110 - * controller. This can be used to ensure that messages have really flushed
  29.111 - * through when it is not possible to use the response-callback interface.
  29.112 - * WARNING: If other subsystems are using the control interface then this
  29.113 - * function might never return TRUE!
  29.114 - */
  29.115 -int ctrl_if_transmitter_empty(void);  /* !! DANGEROUS FUNCTION !! */
  29.116 -
  29.117 -/*
  29.118 - * Manually discard response messages from the domain controller. 
  29.119 - * WARNING: This is usually done automatically -- this function should only
  29.120 - * be called when normal interrupt mechanisms are disabled!
  29.121 - */
  29.122 -void ctrl_if_discard_responses(void); /* !! DANGEROUS FUNCTION !! */
  29.123 -
  29.124 -#endif /* __ASM_XEN__CONTROL_IF_H__ */
    30.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/evtchn.h	Fri Jul 23 14:11:01 2004 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,83 +0,0 @@
    30.4 -/******************************************************************************
    30.5 - * evtchn.h
    30.6 - * 
    30.7 - * Communication via Xen event channels.
    30.8 - * Also definitions for the device that demuxes notifications to userspace.
    30.9 - * 
   30.10 - * Copyright (c) 2004, K A Fraser
   30.11 - */
   30.12 -
   30.13 -#ifndef __ASM_EVTCHN_H__
   30.14 -#define __ASM_EVTCHN_H__
   30.15 -
   30.16 -#include <linux/config.h>
   30.17 -#include <asm/hypervisor.h>
   30.18 -#include <asm/ptrace.h>
   30.19 -#include <asm/synch_bitops.h>
   30.20 -#include <asm/hypervisor-ifs/event_channel.h>
   30.21 -
   30.22 -/*
   30.23 - * LOW-LEVEL DEFINITIONS
   30.24 - */
   30.25 -
   30.26 -/* Entry point for notifications into Linux subsystems. */
   30.27 -void evtchn_do_upcall(struct pt_regs *regs);
   30.28 -
   30.29 -/* Entry point for notifications into the userland character device. */
   30.30 -void evtchn_device_upcall(int port);
   30.31 -
   30.32 -static inline void mask_evtchn(int port)
   30.33 -{
   30.34 -    shared_info_t *s = HYPERVISOR_shared_info;
   30.35 -    synch_set_bit(port, &s->evtchn_mask[0]);
   30.36 -}
   30.37 -
   30.38 -static inline void unmask_evtchn(int port)
   30.39 -{
   30.40 -    shared_info_t *s = HYPERVISOR_shared_info;
   30.41 -
   30.42 -    synch_clear_bit(port, &s->evtchn_mask[0]);
   30.43 -
   30.44 -    /*
   30.45 -     * The following is basically the equivalent of 'hw_resend_irq'. Just like
   30.46 -     * a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
   30.47 -     */
   30.48 -    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
   30.49 -         !synch_test_and_set_bit(port>>5, &s->evtchn_pending_sel) )
   30.50 -    {
   30.51 -        s->vcpu_data[0].evtchn_upcall_pending = 1;
   30.52 -        if ( !s->vcpu_data[0].evtchn_upcall_mask )
   30.53 -            evtchn_do_upcall(NULL);
   30.54 -    }
   30.55 -}
   30.56 -
   30.57 -static inline void clear_evtchn(int port)
   30.58 -{
   30.59 -    shared_info_t *s = HYPERVISOR_shared_info;
   30.60 -    synch_clear_bit(port, &s->evtchn_pending[0]);
   30.61 -}
   30.62 -
   30.63 -static inline void notify_via_evtchn(int port)
   30.64 -{
   30.65 -    evtchn_op_t op;
   30.66 -    op.cmd = EVTCHNOP_send;
   30.67 -    op.u.send.local_port = port;
   30.68 -    (void)HYPERVISOR_event_channel_op(&op);
   30.69 -}
   30.70 -
   30.71 -/*
   30.72 - * CHARACTER-DEVICE DEFINITIONS
   30.73 - */
   30.74 -
   30.75 -/* /dev/xen/evtchn resides at device number major=10, minor=200 */
   30.76 -#define EVTCHN_MINOR 200
   30.77 -
   30.78 -/* /dev/xen/evtchn ioctls: */
   30.79 -/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
   30.80 -#define EVTCHN_RESET  _IO('E', 1)
   30.81 -/* EVTCHN_BIND: Bind to teh specified event-channel port. */
   30.82 -#define EVTCHN_BIND   _IO('E', 2)
   30.83 -/* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
   30.84 -#define EVTCHN_UNBIND _IO('E', 3)
   30.85 -
   30.86 -#endif /* __ASM_EVTCHN_H__ */
    31.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h	Fri Jul 23 14:11:01 2004 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,449 +0,0 @@
    31.4 -/******************************************************************************
    31.5 - * hypervisor.h
    31.6 - * 
    31.7 - * Linux-specific hypervisor handling.
    31.8 - * 
    31.9 - * Copyright (c) 2002, K A Fraser
   31.10 - */
   31.11 -
   31.12 -#ifndef __HYPERVISOR_H__
   31.13 -#define __HYPERVISOR_H__
   31.14 -
   31.15 -#include <linux/types.h>
   31.16 -#include <linux/kernel.h>
   31.17 -#include <asm/hypervisor-ifs/hypervisor-if.h>
   31.18 -#include <asm/hypervisor-ifs/dom0_ops.h>
   31.19 -#include <asm/domain_controller.h>
   31.20 -#include <asm/ptrace.h>
   31.21 -#include <asm/page.h>
   31.22 -
   31.23 -/* arch/xen/kernel/setup.c */
   31.24 -union start_info_union
   31.25 -{
   31.26 -    extended_start_info_t start_info;
   31.27 -    char padding[512];
   31.28 -};
   31.29 -extern union start_info_union start_info_union;
   31.30 -#define start_info (start_info_union.start_info)
   31.31 -
   31.32 -/* arch/xen/mm/hypervisor.c */
   31.33 -/*
   31.34 - * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already
   31.35 - * be MACHINE addresses.
   31.36 - */
   31.37 -
   31.38 -extern unsigned int mmu_update_queue_idx;
   31.39 -
   31.40 -void queue_l1_entry_update(pte_t *ptr, unsigned long val);
   31.41 -void queue_l2_entry_update(pmd_t *ptr, unsigned long val);
   31.42 -void queue_pt_switch(unsigned long ptr);
   31.43 -void queue_tlb_flush(void);
   31.44 -void queue_invlpg(unsigned long ptr);
   31.45 -void queue_pgd_pin(unsigned long ptr);
   31.46 -void queue_pgd_unpin(unsigned long ptr);
   31.47 -void queue_pte_pin(unsigned long ptr);
   31.48 -void queue_pte_unpin(unsigned long ptr);
   31.49 -void queue_set_ldt(unsigned long ptr, unsigned long bytes);
   31.50 -void queue_machphys_update(unsigned long mfn, unsigned long pfn);
   31.51 -#define MMU_UPDATE_DEBUG 0
   31.52 -
   31.53 -#if MMU_UPDATE_DEBUG > 0
   31.54 -typedef struct {
   31.55 -    void *ptr;
   31.56 -    unsigned long val, pteval;
   31.57 -    void *ptep;
   31.58 -    int line; char *file;
   31.59 -} page_update_debug_t;
   31.60 -extern page_update_debug_t update_debug_queue[];
   31.61 -#define queue_l1_entry_update(_p,_v) ({                           \
   31.62 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   31.63 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   31.64 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   31.65 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   31.66 - queue_l1_entry_update((_p),(_v));                                \
   31.67 -})
   31.68 -#define queue_l2_entry_update(_p,_v) ({                           \
   31.69 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   31.70 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   31.71 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   31.72 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   31.73 - queue_l2_entry_update((_p),(_v));                                \
   31.74 -})
   31.75 -#endif
   31.76 -
   31.77 -#if MMU_UPDATE_DEBUG > 1
   31.78 -#undef queue_l1_entry_update
   31.79 -#undef queue_l2_entry_update
   31.80 -#define queue_l1_entry_update(_p,_v) ({                           \
   31.81 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   31.82 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   31.83 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   31.84 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   31.85 - printk("L1 %s %d: %08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \
   31.86 -        (_p), pte_val(_p),                                        \
   31.87 -        (unsigned long)(_v));                                     \
   31.88 - queue_l1_entry_update((_p),(_v));                                \
   31.89 -})
   31.90 -#define queue_l2_entry_update(_p,_v) ({                           \
   31.91 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
   31.92 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
   31.93 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
   31.94 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
   31.95 - printk("L2 %s %d: %08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \
   31.96 -        (_p), pmd_val(_p),                                        \
   31.97 -        (unsigned long)(_v));                                     \
   31.98 - queue_l2_entry_update((_p),(_v));                                \
   31.99 -})
  31.100 -#define queue_pt_switch(_p) ({                                    \
  31.101 - printk("PTSWITCH %s %d: %08lx\n", __FILE__, __LINE__, (_p));     \
  31.102 - queue_pt_switch(_p);                                             \
  31.103 -})   
  31.104 -#define queue_tlb_flush() ({                                      \
  31.105 - printk("TLB FLUSH %s %d\n", __FILE__, __LINE__);                 \
  31.106 - queue_tlb_flush();                                               \
  31.107 -})   
  31.108 -#define queue_invlpg(_p) ({                                       \
  31.109 - printk("INVLPG %s %d: %08lx\n", __FILE__, __LINE__, (_p));       \
  31.110 - queue_invlpg(_p);                                                \
  31.111 -})   
  31.112 -#define queue_pgd_pin(_p) ({                                      \
  31.113 - printk("PGD PIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));      \
  31.114 - queue_pgd_pin(_p);                                               \
  31.115 -})   
  31.116 -#define queue_pgd_unpin(_p) ({                                    \
  31.117 - printk("PGD UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
  31.118 - queue_pgd_unpin(_p);                                             \
  31.119 -})   
  31.120 -#define queue_pte_pin(_p) ({                                      \
  31.121 - printk("PTE PIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));      \
  31.122 - queue_pte_pin(_p);                                               \
  31.123 -})   
  31.124 -#define queue_pte_unpin(_p) ({                                    \
  31.125 - printk("PTE UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
  31.126 - queue_pte_unpin(_p);                                             \
  31.127 -})   
  31.128 -#define queue_set_ldt(_p,_l) ({                                        \
  31.129 - printk("SETL LDT %s %d: %08lx %d\n", __FILE__, __LINE__, (_p), (_l)); \
  31.130 - queue_set_ldt((_p), (_l));                                            \
  31.131 -})   
  31.132 -#endif
  31.133 -
  31.134 -void _flush_page_update_queue(void);
  31.135 -static inline int flush_page_update_queue(void)
  31.136 -{
  31.137 -    unsigned int idx = mmu_update_queue_idx;
  31.138 -    if ( idx != 0 ) _flush_page_update_queue();
  31.139 -    return idx;
  31.140 -}
  31.141 -#define XEN_flush_page_update_queue() (_flush_page_update_queue())
  31.142 -void MULTICALL_flush_page_update_queue(void);
  31.143 -
  31.144 -#ifdef CONFIG_XEN_PHYSDEV_ACCESS
  31.145 -/* Allocate a contiguous empty region of low memory. Return virtual start. */
  31.146 -unsigned long allocate_empty_lowmem_region(unsigned long pages);
  31.147 -/* Deallocate a contiguous region of low memory. Return it to the allocator. */
  31.148 -void deallocate_lowmem_region(unsigned long vstart, unsigned long pages);
  31.149 -#endif
  31.150 -
  31.151 -/*
  31.152 - * Assembler stubs for hyper-calls.
  31.153 - */
  31.154 -
  31.155 -static inline int HYPERVISOR_set_trap_table(trap_info_t *table)
  31.156 -{
  31.157 -    int ret;
  31.158 -    __asm__ __volatile__ (
  31.159 -        TRAP_INSTR
  31.160 -        : "=a" (ret) : "0" (__HYPERVISOR_set_trap_table),
  31.161 -        "b" (table) : "memory" );
  31.162 -
  31.163 -    return ret;
  31.164 -}
  31.165 -
  31.166 -static inline int HYPERVISOR_mmu_update(mmu_update_t *req, 
  31.167 -                                        int count, 
  31.168 -                                        int *success_count)
  31.169 -{
  31.170 -    int ret;
  31.171 -    __asm__ __volatile__ (
  31.172 -        TRAP_INSTR
  31.173 -        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
  31.174 -        "b" (req), "c" (count), "d" (success_count) : "memory" );
  31.175 -
  31.176 -    return ret;
  31.177 -}
  31.178 -
  31.179 -static inline int HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
  31.180 -{
  31.181 -    int ret;
  31.182 -    __asm__ __volatile__ (
  31.183 -        TRAP_INSTR
  31.184 -        : "=a" (ret) : "0" (__HYPERVISOR_set_gdt), 
  31.185 -        "b" (frame_list), "c" (entries) : "memory" );
  31.186 -
  31.187 -
  31.188 -    return ret;
  31.189 -}
  31.190 -
  31.191 -static inline int HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
  31.192 -{
  31.193 -    int ret;
  31.194 -    __asm__ __volatile__ (
  31.195 -        TRAP_INSTR
  31.196 -        : "=a" (ret) : "0" (__HYPERVISOR_stack_switch),
  31.197 -        "b" (ss), "c" (esp) : "memory" );
  31.198 -
  31.199 -    return ret;
  31.200 -}
  31.201 -
  31.202 -static inline int HYPERVISOR_set_callbacks(
  31.203 -    unsigned long event_selector, unsigned long event_address,
  31.204 -    unsigned long failsafe_selector, unsigned long failsafe_address)
  31.205 -{
  31.206 -    int ret;
  31.207 -    __asm__ __volatile__ (
  31.208 -        TRAP_INSTR
  31.209 -        : "=a" (ret) : "0" (__HYPERVISOR_set_callbacks),
  31.210 -        "b" (event_selector), "c" (event_address), 
  31.211 -        "d" (failsafe_selector), "S" (failsafe_address) : "memory" );
  31.212 -
  31.213 -    return ret;
  31.214 -}
  31.215 -
  31.216 -static inline int HYPERVISOR_fpu_taskswitch(void)
  31.217 -{
  31.218 -    int ret;
  31.219 -    __asm__ __volatile__ (
  31.220 -        TRAP_INSTR
  31.221 -        : "=a" (ret) : "0" (__HYPERVISOR_fpu_taskswitch) : "memory" );
  31.222 -
  31.223 -    return ret;
  31.224 -}
  31.225 -
  31.226 -static inline int HYPERVISOR_yield(void)
  31.227 -{
  31.228 -    int ret;
  31.229 -    __asm__ __volatile__ (
  31.230 -        TRAP_INSTR
  31.231 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
  31.232 -        "b" (SCHEDOP_yield) : "memory" );
  31.233 -
  31.234 -    return ret;
  31.235 -}
  31.236 -
  31.237 -static inline int HYPERVISOR_block(void)
  31.238 -{
  31.239 -    int ret;
  31.240 -    __asm__ __volatile__ (
  31.241 -        TRAP_INSTR
  31.242 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
  31.243 -        "b" (SCHEDOP_block) : "memory" );
  31.244 -
  31.245 -    return ret;
  31.246 -}
  31.247 -
  31.248 -static inline int HYPERVISOR_shutdown(void)
  31.249 -{
  31.250 -    int ret;
  31.251 -    __asm__ __volatile__ (
  31.252 -        TRAP_INSTR
  31.253 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
  31.254 -        "b" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
  31.255 -        : "memory" );
  31.256 -
  31.257 -    return ret;
  31.258 -}
  31.259 -
  31.260 -static inline int HYPERVISOR_reboot(void)
  31.261 -{
  31.262 -    int ret;
  31.263 -    __asm__ __volatile__ (
  31.264 -        TRAP_INSTR
  31.265 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
  31.266 -        "b" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
  31.267 -        : "memory" );
  31.268 -
  31.269 -    return ret;
  31.270 -}
  31.271 -
  31.272 -static inline int HYPERVISOR_suspend(unsigned long srec)
  31.273 -{
  31.274 -    int ret;
  31.275 -    /* NB. On suspend, control software expects a suspend record in %esi. */
  31.276 -    __asm__ __volatile__ (
  31.277 -        TRAP_INSTR
  31.278 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
  31.279 -        "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)), 
  31.280 -        "S" (srec) : "memory" );
  31.281 -
  31.282 -    return ret;
  31.283 -}
  31.284 -
  31.285 -static inline long HYPERVISOR_set_timer_op(u64 timeout)
  31.286 -{
  31.287 -    int ret;
  31.288 -    unsigned long timeout_hi = (unsigned long)(timeout>>32);
  31.289 -    unsigned long timeout_lo = (unsigned long)timeout;
  31.290 -    __asm__ __volatile__ (
  31.291 -        TRAP_INSTR
  31.292 -        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
  31.293 -        "b" (timeout_hi), "c" (timeout_lo) : "memory" );
  31.294 -
  31.295 -    return ret;
  31.296 -}
  31.297 -
  31.298 -static inline int HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
  31.299 -{
  31.300 -    int ret;
  31.301 -    dom0_op->interface_version = DOM0_INTERFACE_VERSION;
  31.302 -    __asm__ __volatile__ (
  31.303 -        TRAP_INSTR
  31.304 -        : "=a" (ret) : "0" (__HYPERVISOR_dom0_op),
  31.305 -        "b" (dom0_op) : "memory" );
  31.306 -
  31.307 -    return ret;
  31.308 -}
  31.309 -
  31.310 -static inline int HYPERVISOR_set_debugreg(int reg, unsigned long value)
  31.311 -{
  31.312 -    int ret;
  31.313 -    __asm__ __volatile__ (
  31.314 -        TRAP_INSTR
  31.315 -        : "=a" (ret) : "0" (__HYPERVISOR_set_debugreg),
  31.316 -        "b" (reg), "c" (value) : "memory" );
  31.317 -
  31.318 -    return ret;
  31.319 -}
  31.320 -
  31.321 -static inline unsigned long HYPERVISOR_get_debugreg(int reg)
  31.322 -{
  31.323 -    unsigned long ret;
  31.324 -    __asm__ __volatile__ (
  31.325 -        TRAP_INSTR
  31.326 -        : "=a" (ret) : "0" (__HYPERVISOR_get_debugreg),
  31.327 -        "b" (reg) : "memory" );
  31.328 -
  31.329 -    return ret;
  31.330 -}
  31.331 -
  31.332 -static inline int HYPERVISOR_update_descriptor(
  31.333 -    unsigned long pa, unsigned long word1, unsigned long word2)
  31.334 -{
  31.335 -    int ret;
  31.336 -    __asm__ __volatile__ (
  31.337 -        TRAP_INSTR
  31.338 -        : "=a" (ret) : "0" (__HYPERVISOR_update_descriptor), 
  31.339 -        "b" (pa), "c" (word1), "d" (word2) : "memory" );
  31.340 -
  31.341 -    return ret;
  31.342 -}
  31.343 -
  31.344 -static inline int HYPERVISOR_set_fast_trap(int idx)
  31.345 -{
  31.346 -    int ret;
  31.347 -    __asm__ __volatile__ (
  31.348 -        TRAP_INSTR
  31.349 -        : "=a" (ret) : "0" (__HYPERVISOR_set_fast_trap), 
  31.350 -        "b" (idx) : "memory" );
  31.351 -
  31.352 -    return ret;
  31.353 -}
  31.354 -
  31.355 -static inline int HYPERVISOR_dom_mem_op(unsigned int   op,
  31.356 -                                        unsigned long *pages,
  31.357 -                                        unsigned long  nr_pages)
  31.358 -{
  31.359 -    int ret;
  31.360 -    __asm__ __volatile__ (
  31.361 -        TRAP_INSTR
  31.362 -        : "=a" (ret) : "0" (__HYPERVISOR_dom_mem_op),
  31.363 -        "b" (op), "c" (pages), "d" (nr_pages) : "memory" );
  31.364 -
  31.365 -    return ret;
  31.366 -}
  31.367 -
  31.368 -static inline int HYPERVISOR_multicall(void *call_list, int nr_calls)
  31.369 -{
  31.370 -    int ret;
  31.371 -    __asm__ __volatile__ (
  31.372 -        TRAP_INSTR
  31.373 -        : "=a" (ret) : "0" (__HYPERVISOR_multicall),
  31.374 -        "b" (call_list), "c" (nr_calls) : "memory" );
  31.375 -
  31.376 -    return ret;
  31.377 -}
  31.378 -
  31.379 -static inline int HYPERVISOR_update_va_mapping(
  31.380 -    unsigned long page_nr, pte_t new_val, unsigned long flags)
  31.381 -{
  31.382 -    int ret;
  31.383 -    __asm__ __volatile__ (
  31.384 -        TRAP_INSTR
  31.385 -        : "=a" (ret) : "0" (__HYPERVISOR_update_va_mapping), 
  31.386 -        "b" (page_nr), "c" ((new_val).pte_low), "d" (flags) : "memory" );
  31.387 -
  31.388 -    if ( unlikely(ret < 0) )
  31.389 -        panic("Failed update VA mapping: %08lx, %08lx, %08lx",
  31.390 -              page_nr, (new_val).pte_low, flags);
  31.391 -    
  31.392 -    return ret;
  31.393 -}
  31.394 -
  31.395 -static inline int HYPERVISOR_event_channel_op(void *op)
  31.396 -{
  31.397 -    int ret;
  31.398 -    __asm__ __volatile__ (
  31.399 -        TRAP_INSTR
  31.400 -        : "=a" (ret) : "0" (__HYPERVISOR_event_channel_op),
  31.401 -        "b" (op) : "memory" );
  31.402 -
  31.403 -    return ret;
  31.404 -}
  31.405 -
  31.406 -static inline int HYPERVISOR_xen_version(int cmd)
  31.407 -{
  31.408 -    int ret;
  31.409 -    __asm__ __volatile__ (
  31.410 -        TRAP_INSTR
  31.411 -        : "=a" (ret) : "0" (__HYPERVISOR_xen_version), 
  31.412 -        "b" (cmd) : "memory" );
  31.413 -
  31.414 -    return ret;
  31.415 -}
  31.416 -
  31.417 -static inline int HYPERVISOR_console_io(int cmd, int count, char *str)
  31.418 -{
  31.419 -    int ret;
  31.420 -    __asm__ __volatile__ (
  31.421 -        TRAP_INSTR
  31.422 -        : "=a" (ret) : "0" (__HYPERVISOR_console_io),
  31.423 -        "b" (cmd), "c" (count), "d" (str) : "memory" );
  31.424 -
  31.425 -    return ret;
  31.426 -}
  31.427 -
  31.428 -static inline int HYPERVISOR_physdev_op(void *physdev_op)
  31.429 -{
  31.430 -    int ret;
  31.431 -    __asm__ __volatile__ (
  31.432 -        TRAP_INSTR
  31.433 -        : "=a" (ret) : "0" (__HYPERVISOR_physdev_op),
  31.434 -        "b" (physdev_op) : "memory" );
  31.435 -
  31.436 -    return ret;
  31.437 -}
  31.438 -
  31.439 -static inline int HYPERVISOR_update_va_mapping_otherdomain(
  31.440 -    unsigned long page_nr, pte_t new_val, unsigned long flags, domid_t domid)
  31.441 -{
  31.442 -    int ret;
  31.443 -    __asm__ __volatile__ (
  31.444 -        TRAP_INSTR
  31.445 -        : "=a" (ret) : "0" (__HYPERVISOR_update_va_mapping_otherdomain), 
  31.446 -        "b" (page_nr), "c" ((new_val).pte_low), "d" (flags), "S" (domid) :
  31.447 -        "memory" );
  31.448 -    
  31.449 -    return ret;
  31.450 -}
  31.451 -
  31.452 -#endif /* __HYPERVISOR_H__ */
    32.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/multicall.h	Fri Jul 23 14:11:01 2004 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,84 +0,0 @@
    32.4 -/******************************************************************************
    32.5 - * multicall.h
    32.6 - */
    32.7 -
    32.8 -#ifndef __MULTICALL_H__
    32.9 -#define __MULTICALL_H__
   32.10 -
   32.11 -#include <asm/hypervisor.h>
   32.12 -
   32.13 -extern multicall_entry_t multicall_list[];
   32.14 -extern int nr_multicall_ents;
   32.15 -
   32.16 -static inline void queue_multicall0(unsigned long op)
   32.17 -{
   32.18 -    int i = nr_multicall_ents;
   32.19 -    multicall_list[i].op      = op;
   32.20 -    nr_multicall_ents = i+1;
   32.21 -}
   32.22 -
   32.23 -static inline void queue_multicall1(unsigned long op, unsigned long arg1)
   32.24 -{
   32.25 -    int i = nr_multicall_ents;
   32.26 -    multicall_list[i].op      = op;
   32.27 -    multicall_list[i].args[0] = arg1;
   32.28 -    nr_multicall_ents = i+1;
   32.29 -}
   32.30 -
   32.31 -static inline void queue_multicall2(
   32.32 -    unsigned long op, unsigned long arg1, unsigned long arg2)
   32.33 -{
   32.34 -    int i = nr_multicall_ents;
   32.35 -    multicall_list[i].op      = op;
   32.36 -    multicall_list[i].args[0] = arg1;
   32.37 -    multicall_list[i].args[1] = arg2;
   32.38 -    nr_multicall_ents = i+1;
   32.39 -}
   32.40 -
   32.41 -static inline void queue_multicall3(
   32.42 -    unsigned long op, unsigned long arg1, unsigned long arg2,
   32.43 -    unsigned long arg3)
   32.44 -{
   32.45 -    int i = nr_multicall_ents;
   32.46 -    multicall_list[i].op      = op;
   32.47 -    multicall_list[i].args[0] = arg1;
   32.48 -    multicall_list[i].args[1] = arg2;
   32.49 -    multicall_list[i].args[2] = arg3;
   32.50 -    nr_multicall_ents = i+1;
   32.51 -}
   32.52 -
   32.53 -static inline void queue_multicall4(
   32.54 -    unsigned long op, unsigned long arg1, unsigned long arg2,
   32.55 -    unsigned long arg3, unsigned long arg4)
   32.56 -{
   32.57 -    int i = nr_multicall_ents;
   32.58 -    multicall_list[i].op      = op;
   32.59 -    multicall_list[i].args[0] = arg1;
   32.60 -    multicall_list[i].args[1] = arg2;
   32.61 -    multicall_list[i].args[2] = arg3;
   32.62 -    multicall_list[i].args[3] = arg4;
   32.63 -    nr_multicall_ents = i+1;
   32.64 -}
   32.65 -
   32.66 -static inline void queue_multicall5(
   32.67 -    unsigned long op, unsigned long arg1, unsigned long arg2,
   32.68 -    unsigned long arg3, unsigned long arg4, unsigned long arg5)
   32.69 -{
   32.70 -    int i = nr_multicall_ents;
   32.71 -    multicall_list[i].op      = op;
   32.72 -    multicall_list[i].args[0] = arg1;
   32.73 -    multicall_list[i].args[1] = arg2;
   32.74 -    multicall_list[i].args[2] = arg3;
   32.75 -    multicall_list[i].args[3] = arg4;
   32.76 -    multicall_list[i].args[4] = arg5;
   32.77 -    nr_multicall_ents = i+1;
   32.78 -}
   32.79 -
   32.80 -static inline void execute_multicall_list(void)
   32.81 -{
   32.82 -    if ( unlikely(nr_multicall_ents == 0) ) return;
   32.83 -    (void)HYPERVISOR_multicall(multicall_list, nr_multicall_ents);
   32.84 -    nr_multicall_ents = 0;
   32.85 -}
   32.86 -
   32.87 -#endif /* __MULTICALL_H__ */
    34.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/proc_cmd.h	Fri Jul 23 14:11:01 2004 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,63 +0,0 @@
    34.4 -/******************************************************************************
    34.5 - * proc_cmd.h
    34.6 - * 
    34.7 - * Interface to /proc/cmd and /proc/xen/privcmd.
    34.8 - */
    34.9 -
   34.10 -#ifndef __PROC_CMD_H__
   34.11 -#define __PROC_CMD_H__
   34.12 -
   34.13 -typedef struct privcmd_hypercall
   34.14 -{
   34.15 -    unsigned long op;
   34.16 -    unsigned long arg[5];
   34.17 -} privcmd_hypercall_t;
   34.18 -
   34.19 -typedef struct privcmd_mmap_entry {
   34.20 -    unsigned long va;
   34.21 -    unsigned long mfn;
   34.22 -    unsigned long npages;
   34.23 -} privcmd_mmap_entry_t; 
   34.24 -
   34.25 -typedef struct privcmd_mmap {
   34.26 -    int num;
   34.27 -    domid_t dom; /* target domain */
   34.28 -    privcmd_mmap_entry_t *entry;
   34.29 -} privcmd_mmap_t; 
   34.30 -
   34.31 -typedef struct privcmd_mmapbatch {
   34.32 -    int num;     // number of pages to populate
   34.33 -    domid_t dom; // target domain 
   34.34 -    unsigned long addr;  // virtual address
   34.35 -    unsigned long *arr; // array of mfns - top nibble set on err
   34.36 -} privcmd_mmapbatch_t; 
   34.37 -
   34.38 -typedef struct privcmd_blkmsg
   34.39 -{
   34.40 -    unsigned long op;
   34.41 -    void         *buf;
   34.42 -    int           buf_size;
   34.43 -} privcmd_blkmsg_t;
   34.44 -
   34.45 -/*
   34.46 - * @cmd: IOCTL_PRIVCMD_HYPERCALL
   34.47 - * @arg: &privcmd_hypercall_t
   34.48 - * Return: Value returned from execution of the specified hypercall.
   34.49 - */
   34.50 -#define IOCTL_PRIVCMD_HYPERCALL         \
   34.51 -    _IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
   34.52 -
   34.53 -/*
   34.54 - * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
   34.55 - * @arg: n/a
   34.56 - * Return: Port associated with domain-controller end of control event channel
   34.57 - *         for the initial domain.
   34.58 - */
   34.59 -#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
   34.60 -    _IOC(_IOC_NONE, 'P', 1, 0)
   34.61 -#define IOCTL_PRIVCMD_MMAP             \
   34.62 -    _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))
   34.63 -#define IOCTL_PRIVCMD_MMAPBATCH             \
   34.64 -    _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmapbatch_t))
   34.65 -
   34.66 -#endif /* __PROC_CMD_H__ */
    35.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/suspend.h	Fri Jul 23 14:11:01 2004 +0000
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,25 +0,0 @@
    35.4 -/******************************************************************************
    35.5 - * suspend.h
    35.6 - * 
    35.7 - * NB. This file is part of the Xenolinux interface with Xenoserver control 
    35.8 - * software. It can be included in such software without invoking the GPL.
    35.9 - * 
   35.10 - * Copyright (c) 2003, K A Fraser
   35.11 - */
   35.12 -
   35.13 -#ifndef __ASM_XEN_SUSPEND_H__
   35.14 -#define __ASM_XEN_SUSPEND_H__
   35.15 -
   35.16 -typedef struct suspend_record_st {
   35.17 -    /* To be filled in before resume. */
   35.18 -    extended_start_info_t resume_info;
   35.19 -    /*
   35.20 -     * The number of a machine frame containing, in sequence, the number of
   35.21 -     * each machine frame that contains PFN -> MFN translation table data.
   35.22 -     */
   35.23 -    unsigned long pfn_to_mfn_frame_list;
   35.24 -    /* Number of entries in the PFN -> MFN translation table. */
   35.25 -    unsigned long nr_pfns;
   35.26 -} suspend_record_t;
   35.27 -
   35.28 -#endif /* __ASM_XEN_SUSPEND_H__ */
    36.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/xen_proc.h	Fri Jul 23 14:11:01 2004 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,13 +0,0 @@
    36.4 -
    36.5 -#ifndef __ASM_XEN_PROC_H__
    36.6 -#define __ASM_XEN_PROC_H__
    36.7 -
    36.8 -#include <linux/config.h>
    36.9 -#include <linux/proc_fs.h>
   36.10 -
   36.11 -extern struct proc_dir_entry *create_xen_proc_entry(
   36.12 -    const char *name, mode_t mode);
   36.13 -extern void remove_xen_proc_entry(
   36.14 -    const char *name);
   36.15 -
   36.16 -#endif /* __ASM_XEN_PROC_H__ */
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/linux-2.4.26-xen-sparse/include/linux/blkdev.h	Tue Aug 03 12:28:49 2004 +0000
    37.3 @@ -0,0 +1,372 @@
    37.4 +#ifndef _LINUX_BLKDEV_H
    37.5 +#define _LINUX_BLKDEV_H
    37.6 +
    37.7 +#include <linux/major.h>
    37.8 +#include <linux/sched.h>
    37.9 +#include <linux/genhd.h>
   37.10 +#include <linux/tqueue.h>
   37.11 +#include <linux/list.h>
   37.12 +#include <linux/mm.h>
   37.13 +
   37.14 +#include <asm/io.h>
   37.15 +
   37.16 +struct request_queue;
   37.17 +typedef struct request_queue request_queue_t;
   37.18 +struct elevator_s;
   37.19 +typedef struct elevator_s elevator_t;
   37.20 +
   37.21 +/*
   37.22 + * Ok, this is an expanded form so that we can use the same
   37.23 + * request for paging requests.
   37.24 + */
   37.25 +struct request {
   37.26 +	struct list_head queue;
   37.27 +	int elevator_sequence;
   37.28 +
   37.29 +	volatile int rq_status;	/* should split this into a few status bits */
   37.30 +#define RQ_INACTIVE		(-1)
   37.31 +#define RQ_ACTIVE		1
   37.32 +#define RQ_SCSI_BUSY		0xffff
   37.33 +#define RQ_SCSI_DONE		0xfffe
   37.34 +#define RQ_SCSI_DISCONNECTING	0xffe0
   37.35 +
   37.36 +	kdev_t rq_dev;
   37.37 +	int cmd;		/* READ or WRITE */
   37.38 +	int errors;
   37.39 +	unsigned long start_time;
   37.40 +	unsigned long sector;
   37.41 +	unsigned long nr_sectors;
   37.42 +	unsigned long hard_sector, hard_nr_sectors;
   37.43 +	unsigned int nr_segments;
   37.44 +	unsigned int nr_hw_segments;
   37.45 +	unsigned long current_nr_sectors, hard_cur_sectors;
   37.46 +	void * special;
   37.47 +	char * buffer;
   37.48 +	struct completion * waiting;
   37.49 +	struct buffer_head * bh;
   37.50 +	struct buffer_head * bhtail;
   37.51 +	request_queue_t *q;
   37.52 +};
   37.53 +
   37.54 +#include <linux/elevator.h>
   37.55 +
   37.56 +typedef int (merge_request_fn) (request_queue_t *q, 
   37.57 +				struct request  *req,
   37.58 +				struct buffer_head *bh,
   37.59 +				int);
   37.60 +typedef int (merge_requests_fn) (request_queue_t *q, 
   37.61 +				 struct request  *req,
   37.62 +				 struct request  *req2,
   37.63 +				 int);
   37.64 +typedef void (request_fn_proc) (request_queue_t *q);
   37.65 +typedef request_queue_t * (queue_proc) (kdev_t dev);
   37.66 +typedef int (make_request_fn) (request_queue_t *q, int rw, struct buffer_head *bh);
   37.67 +typedef void (plug_device_fn) (request_queue_t *q, kdev_t device);
   37.68 +typedef void (unplug_device_fn) (void *q);
   37.69 +
   37.70 +struct request_list {
   37.71 +	unsigned int count;
   37.72 +	unsigned int pending[2];
   37.73 +	struct list_head free;
   37.74 +};
   37.75 +
   37.76 +struct request_queue
   37.77 +{
   37.78 +	/*
   37.79 +	 * the queue request freelist, one for reads and one for writes
   37.80 +	 */
   37.81 +	struct request_list	rq;
   37.82 +
   37.83 +	/*
   37.84 +	 * The total number of requests on each queue
   37.85 +	 */
   37.86 +	int nr_requests;
   37.87 +
   37.88 +	/*
   37.89 +	 * Batching threshold for sleep/wakeup decisions
   37.90 +	 */
   37.91 +	int batch_requests;
   37.92 +
   37.93 +	/*
   37.94 +	 * The total number of 512byte blocks on each queue
   37.95 +	 */
   37.96 +	atomic_t nr_sectors;
   37.97 +
   37.98 +	/*
   37.99 +	 * Batching threshold for sleep/wakeup decisions
  37.100 +	 */
  37.101 +	int batch_sectors;
  37.102 +
  37.103 +	/*
  37.104 +	 * The max number of 512byte blocks on each queue
  37.105 +	 */
  37.106 +	int max_queue_sectors;
  37.107 +
  37.108 +	/*
  37.109 +	 * Together with queue_head for cacheline sharing
  37.110 +	 */
  37.111 +	struct list_head	queue_head;
  37.112 +	elevator_t		elevator;
  37.113 +
  37.114 +	request_fn_proc		* request_fn;
  37.115 +	merge_request_fn	* back_merge_fn;
  37.116 +	merge_request_fn	* front_merge_fn;
  37.117 +	merge_requests_fn	* merge_requests_fn;
  37.118 +	make_request_fn		* make_request_fn;
  37.119 +	plug_device_fn		* plug_device_fn;
  37.120 +	/*
  37.121 +	 * The queue owner gets to use this for whatever they like.
  37.122 +	 * ll_rw_blk doesn't touch it.
  37.123 +	 */
  37.124 +	void			* queuedata;
  37.125 +
  37.126 +	/*
  37.127 +	 * This is used to remove the plug when tq_disk runs.
  37.128 +	 */
  37.129 +	struct tq_struct	plug_tq;
  37.130 +
  37.131 +	/*
  37.132 +	 * Boolean that indicates whether this queue is plugged or not.
  37.133 +	 */
  37.134 +	int			plugged:1;
  37.135 +
  37.136 +	/*
  37.137 +	 * Boolean that indicates whether current_request is active or
  37.138 +	 * not.
  37.139 +	 */
  37.140 +	int			head_active:1;
  37.141 +
  37.142 +	/*
  37.143 +	 * Boolean that indicates you will use blk_started_sectors
  37.144 +	 * and blk_finished_sectors in addition to blk_started_io
  37.145 +	 * and blk_finished_io.  It enables the throttling code to 
  37.146 +	 * help keep the sectors in flight to a reasonable value
  37.147 +	 */
  37.148 +	int			can_throttle:1;
  37.149 +
  37.150 +	unsigned long		bounce_pfn;
  37.151 +
  37.152 +	/*
  37.153 +	 * Is meant to protect the queue in the future instead of
  37.154 +	 * io_request_lock
  37.155 +	 */
  37.156 +	spinlock_t		queue_lock;
  37.157 +
  37.158 +	/*
  37.159 +	 * Tasks wait here for free read and write requests
  37.160 +	 */
  37.161 +	wait_queue_head_t	wait_for_requests;
  37.162 +};
  37.163 +
  37.164 +#define blk_queue_plugged(q)	(q)->plugged
  37.165 +#define blk_fs_request(rq)	((rq)->cmd == READ || (rq)->cmd == WRITE)
  37.166 +#define blk_queue_empty(q)	list_empty(&(q)->queue_head)
  37.167 +
  37.168 +extern inline int rq_data_dir(struct request *rq)
  37.169 +{
  37.170 +	if (rq->cmd == READ)
  37.171 +		return READ;
  37.172 +	else if (rq->cmd == WRITE)
  37.173 +		return WRITE;
  37.174 +	else {
  37.175 +		BUG();
  37.176 +		return -1; /* ahem */
  37.177 +	}
  37.178 +}
  37.179 +
  37.180 +extern unsigned long blk_max_low_pfn, blk_max_pfn;
  37.181 +
  37.182 +#define BLK_BOUNCE_HIGH		((u64)blk_max_low_pfn << PAGE_SHIFT)
  37.183 +#define BLK_BOUNCE_ANY		((u64)blk_max_pfn << PAGE_SHIFT)
  37.184 +
  37.185 +extern void blk_queue_bounce_limit(request_queue_t *, u64);
  37.186 +
  37.187 +#ifdef CONFIG_HIGHMEM
  37.188 +extern struct buffer_head *create_bounce(int, struct buffer_head *);
  37.189 +extern inline struct buffer_head *blk_queue_bounce(request_queue_t *q, int rw,
  37.190 +						   struct buffer_head *bh)
  37.191 +{
  37.192 +	struct page *page = bh->b_page;
  37.193 +
  37.194 +#ifndef CONFIG_DISCONTIGMEM
  37.195 +	if (page - mem_map <= q->bounce_pfn)
  37.196 +#else
  37.197 +	if ((page - page_zone(page)->zone_mem_map) + (page_zone(page)->zone_start_paddr >> PAGE_SHIFT) <= q->bounce_pfn)
  37.198 +#endif
  37.199 +		return bh;
  37.200 +
  37.201 +	return create_bounce(rw, bh);
  37.202 +}
  37.203 +#else
  37.204 +#define blk_queue_bounce(q, rw, bh)	(bh)
  37.205 +#endif
  37.206 +
  37.207 +#ifdef CONFIG_XEN
  37.208 +/* Used for buffer merging, where it is imperative we use machine addresses! */
  37.209 +#define bh_phys(bh)		(page_to_bus((bh)->b_page) + bh_offset((bh)))
  37.210 +#else
  37.211 +#define bh_phys(bh)		(page_to_phys((bh)->b_page) + bh_offset((bh)))
  37.212 +#endif
  37.213 +
  37.214 +#define BH_CONTIG(b1, b2)	(bh_phys((b1)) + (b1)->b_size == bh_phys((b2)))
  37.215 +#define BH_PHYS_4G(b1, b2)	((bh_phys((b1)) | 0xffffffff) == ((bh_phys((b2)) + (b2)->b_size - 1) | 0xffffffff))
  37.216 +
  37.217 +struct blk_dev_struct {
  37.218 +	/*
  37.219 +	 * queue_proc has to be atomic
  37.220 +	 */
  37.221 +	request_queue_t		request_queue;
  37.222 +	queue_proc		*queue;
  37.223 +	void			*data;
  37.224 +};
  37.225 +
  37.226 +struct sec_size {
  37.227 +	unsigned block_size;
  37.228 +	unsigned block_size_bits;
  37.229 +};
  37.230 +
  37.231 +/*
  37.232 + * Used to indicate the default queue for drivers that don't bother
  37.233 + * to implement multiple queues.  We have this access macro here
  37.234 + * so as to eliminate the need for each and every block device
  37.235 + * driver to know about the internal structure of blk_dev[].
  37.236 + */
  37.237 +#define BLK_DEFAULT_QUEUE(_MAJOR)  &blk_dev[_MAJOR].request_queue
  37.238 +
  37.239 +extern struct sec_size * blk_sec[MAX_BLKDEV];
  37.240 +extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
  37.241 +extern void grok_partitions(struct gendisk *dev, int drive, unsigned minors, long size);
  37.242 +extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size);
  37.243 +extern void generic_make_request(int rw, struct buffer_head * bh);
  37.244 +extern inline request_queue_t *blk_get_queue(kdev_t dev);
  37.245 +extern void blkdev_release_request(struct request *);
  37.246 +
  37.247 +/*
  37.248 + * Access functions for manipulating queue properties
  37.249 + */
  37.250 +extern int blk_grow_request_list(request_queue_t *q, int nr_requests, int max_queue_sectors);
  37.251 +extern void blk_init_queue(request_queue_t *, request_fn_proc *);
  37.252 +extern void blk_cleanup_queue(request_queue_t *);
  37.253 +extern void blk_queue_headactive(request_queue_t *, int);
  37.254 +extern void blk_queue_throttle_sectors(request_queue_t *, int);
  37.255 +extern void blk_queue_make_request(request_queue_t *, make_request_fn *);
  37.256 +extern void generic_unplug_device(void *);
  37.257 +extern inline int blk_seg_merge_ok(struct buffer_head *, struct buffer_head *);
  37.258 +
  37.259 +extern int * blk_size[MAX_BLKDEV];
  37.260 +
  37.261 +extern int * blksize_size[MAX_BLKDEV];
  37.262 +
  37.263 +extern int * hardsect_size[MAX_BLKDEV];
  37.264 +
  37.265 +extern int * max_readahead[MAX_BLKDEV];
  37.266 +
  37.267 +extern int * max_sectors[MAX_BLKDEV];
  37.268 +
  37.269 +extern int * max_segments[MAX_BLKDEV];
  37.270 +
  37.271 +#define MAX_SEGMENTS 128
  37.272 +#define MAX_SECTORS 255
  37.273 +#define MAX_QUEUE_SECTORS (4 << (20 - 9)) /* 4 mbytes when full sized */
  37.274 +#define MAX_NR_REQUESTS 1024 /* 1024k when in 512 units, normally min is 1M in 1k units */
  37.275 +
  37.276 +#define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK)
  37.277 +
  37.278 +#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue)
  37.279 +#define blkdev_entry_next_request(entry) blkdev_entry_to_request((entry)->next)
  37.280 +#define blkdev_entry_prev_request(entry) blkdev_entry_to_request((entry)->prev)
  37.281 +#define blkdev_next_request(req) blkdev_entry_to_request((req)->queue.next)
  37.282 +#define blkdev_prev_request(req) blkdev_entry_to_request((req)->queue.prev)
  37.283 +
  37.284 +extern void drive_stat_acct (kdev_t dev, int rw,
  37.285 +					unsigned long nr_sectors, int new_io);
  37.286 +
  37.287 +static inline int get_hardsect_size(kdev_t dev)
  37.288 +{
  37.289 +	int retval = 512;
  37.290 +	int major = MAJOR(dev);
  37.291 +
  37.292 +	if (hardsect_size[major]) {
  37.293 +		int minor = MINOR(dev);
  37.294 +		if (hardsect_size[major][minor])
  37.295 +			retval = hardsect_size[major][minor];
  37.296 +	}
  37.297 +	return retval;
  37.298 +}
  37.299 +
  37.300 +static inline int blk_oversized_queue(request_queue_t * q)
  37.301 +{
  37.302 +	if (q->can_throttle)
  37.303 +		return atomic_read(&q->nr_sectors) > q->max_queue_sectors;
  37.304 +	return q->rq.count == 0;
  37.305 +}
  37.306 +
  37.307 +static inline int blk_oversized_queue_reads(request_queue_t * q)
  37.308 +{
  37.309 +	if (q->can_throttle)
  37.310 +		return atomic_read(&q->nr_sectors) > q->max_queue_sectors + q->batch_sectors;
  37.311 +	return q->rq.count == 0;
  37.312 +}
  37.313 +
  37.314 +static inline int blk_oversized_queue_batch(request_queue_t * q)
  37.315 +{
  37.316 +	return atomic_read(&q->nr_sectors) > q->max_queue_sectors - q->batch_sectors;
  37.317 +}
  37.318 +
  37.319 +#define blk_finished_io(nsects)	do { } while (0)
  37.320 +#define blk_started_io(nsects)	do { } while (0)
  37.321 +
  37.322 +static inline void blk_started_sectors(struct request *rq, int count)
  37.323 +{
  37.324 +	request_queue_t *q = rq->q;
  37.325 +	if (q && q->can_throttle) {
  37.326 +		atomic_add(count, &q->nr_sectors);
  37.327 +		if (atomic_read(&q->nr_sectors) < 0) {
  37.328 +			printk("nr_sectors is %d\n", atomic_read(&q->nr_sectors));
  37.329 +			BUG();
  37.330 +		}
  37.331 +	}
  37.332 +}
  37.333 +
  37.334 +static inline void blk_finished_sectors(struct request *rq, int count)
  37.335 +{
  37.336 +	request_queue_t *q = rq->q;
  37.337 +	if (q && q->can_throttle) {
  37.338 +		atomic_sub(count, &q->nr_sectors);
  37.339 +		
  37.340 +		smp_mb();
  37.341 +		if (q->rq.count >= q->batch_requests && !blk_oversized_queue_batch(q)) {
  37.342 +			if (waitqueue_active(&q->wait_for_requests))
  37.343 +				wake_up(&q->wait_for_requests);
  37.344 +		}
  37.345 +		if (atomic_read(&q->nr_sectors) < 0) {
  37.346 +			printk("nr_sectors is %d\n", atomic_read(&q->nr_sectors));
  37.347 +			BUG();
  37.348 +		}
  37.349 +	}
  37.350 +}
  37.351 +
  37.352 +static inline unsigned int blksize_bits(unsigned int size)
  37.353 +{
  37.354 +	unsigned int bits = 8;
  37.355 +	do {
  37.356 +		bits++;
  37.357 +		size >>= 1;
  37.358 +	} while (size > 256);
  37.359 +	return bits;
  37.360 +}
  37.361 +
  37.362 +static inline unsigned int block_size(kdev_t dev)
  37.363 +{
  37.364 +	int retval = BLOCK_SIZE;
  37.365 +	int major = MAJOR(dev);
  37.366 +
  37.367 +	if (blksize_size[major]) {
  37.368 +		int minor = MINOR(dev);
  37.369 +		if (blksize_size[major][minor])
  37.370 +			retval = blksize_size[major][minor];
  37.371 +	}
  37.372 +	return retval;
  37.373 +}
  37.374 +
  37.375 +#endif
    38.1 --- a/linux-2.4.26-xen-sparse/mkbuildtree	Fri Jul 23 14:11:01 2004 +0000
    38.2 +++ b/linux-2.4.26-xen-sparse/mkbuildtree	Tue Aug 03 12:28:49 2004 +0000
    38.3 @@ -104,21 +104,24 @@ rm -f mkbuildtree
    38.4  
    38.5  LINUX_26=${RS}/../linux-2.6.7-xen-sparse
    38.6  
    38.7 -## There are a whole bunch of special symlinks, mostly for files
    38.8 -## which are identical in the i386 and xen-i386 architecture-dependent
    38.9 -## subdirectories.
   38.10  
   38.11 -# This first symlink is special: it links to shared files in Xen's source tree
   38.12 +# Create links to the shared definitions of the hypervisor interface
   38.13  rm -rf ${AD}/include/asm-xen/hypervisor-ifs
   38.14  mkdir  ${AD}/include/asm-xen/hypervisor-ifs
   38.15  cd     ${AD}/include/asm-xen/hypervisor-ifs
   38.16  relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
   38.17  
   38.18 -# Another special symlink: to the shared definitions for the control interface
   38.19 -cd ..
   38.20 +# Create a link to the shared definitions for the control interface
   38.21 +cd ${AD}/include/asm-xen
   38.22  ln -sf ../../${RS}/../tools/python/xen/lowlevel/xu/domain_controller.h
   38.23  
   38.24 -# The remainder are the i386 -> xen-i386 links
   38.25 +
   38.26 +## Symlinks for files:
   38.27 +## - which are identical in the i386 and xen-i386 architecture-dependent
   38.28 +##   subdirectories.
   38.29 +## - which are identical in the Linux 2.6 and Linux 2.4 ports.
   38.30 +
   38.31 +cd ${AD}/include/asm-xen
   38.32  ln -sf ../asm-i386/a.out.h 
   38.33  ln -sf ../asm-i386/apicdef.h 
   38.34  ln -sf ../asm-i386/apic.h 
   38.35 @@ -199,18 +202,27 @@ ln -sf ../asm-i386/ucontext.h
   38.36  ln -sf ../asm-i386/unaligned.h
   38.37  ln -sf ../asm-i386/unistd.h 
   38.38  ln -sf ../asm-i386/user.h 
   38.39 +ln -sf ../../${LINUX_26}/include/asm-xen/ctrl_if.h
   38.40 +ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h
   38.41 +ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h
   38.42 +ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h
   38.43 +ln -sf ../../${LINUX_26}/include/asm-xen/proc_cmd.h
   38.44 +ln -sf ../../${LINUX_26}/include/asm-xen/suspend.h
   38.45 +ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h
   38.46  
   38.47 -cd ../../arch/xen/kernel
   38.48 +cd ${AD}/arch/xen/kernel
   38.49  ln -sf ../../i386/kernel/i387.c
   38.50  ln -sf ../../i386/kernel/init_task.c
   38.51 -ln -sf ../../i386/kernel/pci-dma.c
   38.52  ln -sf ../../i386/kernel/pci-i386.c
   38.53  ln -sf ../../i386/kernel/pci-i386.h
   38.54  ln -sf ../../i386/kernel/ptrace.c
   38.55  ln -sf ../../i386/kernel/semaphore.c 
   38.56  ln -sf ../../i386/kernel/sys_i386.c 
   38.57 +ln -sf ../../../${LINUX_26}/arch/xen/kernel/ctrl_if.c
   38.58 +ln -sf ../../../${LINUX_26}/arch/xen/kernel/evtchn.c
   38.59  ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
   38.60 -cd ../lib
   38.61 +
   38.62 +cd ${AD}/arch/xen/lib
   38.63  ln -sf ../../i386/lib/checksum.S 
   38.64  ln -sf ../../i386/lib/dec_and_lock.c 
   38.65  ln -sf ../../i386/lib/getuser.S 
   38.66 @@ -220,10 +232,27 @@ ln -sf ../../i386/lib/mmx.c
   38.67  ln -sf ../../i386/lib/old-checksum.c 
   38.68  ln -sf ../../i386/lib/strstr.c 
   38.69  ln -sf ../../i386/lib/usercopy.c 
   38.70 -cd ../mm
   38.71 +ln -sf ../../../${LINUX_26}/arch/xen/kernel/xen_proc.c
   38.72 +
   38.73 +cd ${AD}/arch/xen/mm
   38.74  ln -sf ../../i386/mm/extable.c 
   38.75  ln -sf ../../i386/mm/pageattr.c 
   38.76 -cd ../drivers/console
   38.77 +ln -sf ../../../${LINUX_26}/arch/xen/i386/mm/hypervisor.c
   38.78 +
   38.79 +cd ${AD}/arch/xen/drivers/console
   38.80  ln -sf ../../../../${LINUX_26}/drivers/xen/console/console.c 
   38.81 -cd ../netif/frontend
   38.82 -ln -sf ../../../../../${LINUX_26}/drivers/xen/net/network.c main.c
   38.83 +
   38.84 +cd ${AD}/arch/xen/drivers/dom0
   38.85 +ln -sf ../../../../${LINUX_26}/drivers/xen/privcmd/privcmd.c core.c
   38.86 +
   38.87 +cd ${AD}/arch/xen/drivers/evtchn
   38.88 +ln -sf ../../../../${LINUX_26}/drivers/xen/evtchn/evtchn.c
   38.89 +
   38.90 +cd ${AD}/arch/xen/drivers/netif/frontend
   38.91 +ln -sf ../../../../../${LINUX_26}/drivers/xen/netfront/netfront.c main.c
   38.92 +
   38.93 +cd ${AD}/arch/xen/drivers/netif/backend
   38.94 +ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/common.h
   38.95 +ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/control.c
   38.96 +ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/interface.c
   38.97 +ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/netback.c main.c
    39.1 --- a/linux-2.6.7-xen-sparse/arch/xen/Kconfig	Fri Jul 23 14:11:01 2004 +0000
    39.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/Kconfig	Tue Aug 03 12:28:49 2004 +0000
    39.3 @@ -20,7 +20,29 @@ config NO_IDLE_HZ
    39.4  	bool
    39.5  	default y
    39.6  
    39.7 -source "init/Kconfig"
    39.8 +
    39.9 +menu "XEN"
   39.10 +
   39.11 +config XEN_PRIVILEGED_GUEST
   39.12 +	bool "Privileged Guest (domain 0)"
   39.13 +	default n
   39.14 +	help
   39.15 +	  Support for privileged operation (domain 0)
   39.16 +
   39.17 +config XEN_PHYSDEV_ACCESS
   39.18 +	bool "Device-driver domain (physical device access)"
   39.19 +	default y if XEN_PRIVILEGED_GUEST
   39.20 +	default n
   39.21 +	help
   39.22 +	  Device-driver domain (physical device access)
   39.23 +
   39.24 +endmenu
   39.25 +
   39.26 +# Xen's block device backend driver needs 2^12 pages
   39.27 +config FORCE_MAX_ZONEORDER
   39.28 +        int
   39.29 +        default "12" if XEN_PHYSDEV_ACCESS
   39.30 +        default "11" if !XEN_PHYSDEV_ACCESS
   39.31  
   39.32  #config VT
   39.33  #	bool
   39.34 @@ -50,6 +72,8 @@ config X86_64
   39.35  
   39.36  endchoice
   39.37  
   39.38 +source "init/Kconfig"
   39.39 +
   39.40  if X86
   39.41  source "arch/xen/i386/Kconfig"
   39.42  endif
    40.1 --- a/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers	Fri Jul 23 14:11:01 2004 +0000
    40.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers	Tue Aug 03 12:28:49 2004 +0000
    40.3 @@ -4,11 +4,19 @@ menu "Device Drivers"
    40.4  
    40.5  source "drivers/base/Kconfig"
    40.6  
    40.7 -#source "drivers/block/Kconfig"
    40.8 +if XEN_PHYSDEV_ACCESS
    40.9 +source "drivers/block/Kconfig"
   40.10 +source "drivers/ide/Kconfig"
   40.11 +source "drivers/scsi/Kconfig"
   40.12 +source "drivers/cdrom/Kconfig"
   40.13 +source "drivers/md/Kconfig"
   40.14 +endif
   40.15  
   40.16  source "net/Kconfig"
   40.17  
   40.18 -#source "drivers/input/Kconfig"
   40.19 +if XEN_PRIVILEGED_GUEST
   40.20 +source "drivers/input/Kconfig"
   40.21 +endif
   40.22  
   40.23  config INPUT
   40.24  	tristate "Input devices (needed for keyboard, mouse, ...)" if EMBEDDED
   40.25 @@ -28,7 +36,9 @@ config INPUT
   40.26  	  To compile this driver as a module, choose M here: the
   40.27  	  module will be called input.
   40.28  
   40.29 -#source "drivers/char/Kconfig"
   40.30 +if XEN_PRIVILEGED_GUEST
   40.31 +source "drivers/char/Kconfig"
   40.32 +endif
   40.33  
   40.34  config UNIX98_PTYS
   40.35  	bool "Unix98 PTY support" if EMBEDDED
   40.36 @@ -54,7 +64,10 @@ config UNIX98_PTYS
   40.37  	  you're on an embedded system and want to conserve memory.
   40.38  
   40.39  
   40.40 -#source "drivers/video/Kconfig"
   40.41 +if XEN_PHYSDEV_ACCESS
   40.42 +source "drivers/i2c/Kconfig"
   40.43 +source "drivers/video/Kconfig"
   40.44 +endif
   40.45  
   40.46  #config XEN_EVTCHN
   40.47  #	bool "Xen Event Channel"
    41.1 --- a/linux-2.6.7-xen-sparse/arch/xen/boot/Makefile	Fri Jul 23 14:11:01 2004 +0000
    41.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/boot/Makefile	Tue Aug 03 12:28:49 2004 +0000
    41.3 @@ -1,3 +1,8 @@
    41.4  
    41.5 -vmlinuz: vmlinux FORCE
    41.6 +OBJCOPYFLAGS := -g --strip-unneeded
    41.7 +
    41.8 +vmlinuz: vmlinux-stripped FORCE
    41.9  	$(call if_changed,gzip)
   41.10 +
   41.11 +vmlinux-stripped: vmlinux FORCE
   41.12 +	$(call if_changed,objcopy)
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig	Tue Aug 03 12:28:49 2004 +0000
    42.3 @@ -0,0 +1,716 @@
    42.4 +#
    42.5 +# Automatically generated make config: don't edit
    42.6 +#
    42.7 +CONFIG_XEN=y
    42.8 +CONFIG_ARCH_XEN=y
    42.9 +CONFIG_NO_IDLE_HZ=y
   42.10 +
   42.11 +#
   42.12 +# XEN
   42.13 +#
   42.14 +CONFIG_XEN_PRIVILEGED_GUEST=y
   42.15 +CONFIG_XEN_PHYSDEV_ACCESS=y
   42.16 +CONFIG_FORCE_MAX_ZONEORDER=12
   42.17 +CONFIG_X86=y
   42.18 +# CONFIG_X86_64 is not set
   42.19 +
   42.20 +#
   42.21 +# Code maturity level options
   42.22 +#
   42.23 +# CONFIG_EXPERIMENTAL is not set
   42.24 +CONFIG_CLEAN_COMPILE=y
   42.25 +CONFIG_STANDALONE=y
   42.26 +CONFIG_BROKEN_ON_SMP=y
   42.27 +
   42.28 +#
   42.29 +# General setup
   42.30 +#
   42.31 +CONFIG_SWAP=y
   42.32 +# CONFIG_SYSVIPC is not set
   42.33 +# CONFIG_BSD_PROCESS_ACCT is not set
   42.34 +# CONFIG_SYSCTL is not set
   42.35 +# CONFIG_AUDIT is not set
   42.36 +CONFIG_LOG_BUF_SHIFT=14
   42.37 +# CONFIG_HOTPLUG is not set
   42.38 +# CONFIG_IKCONFIG is not set
   42.39 +# CONFIG_EMBEDDED is not set
   42.40 +CONFIG_KALLSYMS=y
   42.41 +CONFIG_FUTEX=y
   42.42 +CONFIG_EPOLL=y
   42.43 +CONFIG_IOSCHED_NOOP=y
   42.44 +CONFIG_IOSCHED_AS=y
   42.45 +CONFIG_IOSCHED_DEADLINE=y
   42.46 +CONFIG_IOSCHED_CFQ=y
   42.47 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
   42.48 +
   42.49 +#
   42.50 +# Loadable module support
   42.51 +#
   42.52 +CONFIG_MODULES=y
   42.53 +CONFIG_MODULE_UNLOAD=y
   42.54 +CONFIG_OBSOLETE_MODPARM=y
   42.55 +CONFIG_KMOD=y
   42.56 +
   42.57 +#
   42.58 +# X86 Processor Configuration
   42.59 +#
   42.60 +CONFIG_XENARCH="i386"
   42.61 +CONFIG_MMU=y
   42.62 +CONFIG_UID16=y
   42.63 +CONFIG_GENERIC_ISA_DMA=y
   42.64 +# CONFIG_M386 is not set
   42.65 +# CONFIG_M486 is not set
   42.66 +# CONFIG_M586 is not set
   42.67 +# CONFIG_M586TSC is not set
   42.68 +# CONFIG_M586MMX is not set
   42.69 +# CONFIG_M686 is not set
   42.70 +# CONFIG_MPENTIUMII is not set
   42.71 +# CONFIG_MPENTIUMIII is not set
   42.72 +# CONFIG_MPENTIUMM is not set
   42.73 +CONFIG_MPENTIUM4=y
   42.74 +# CONFIG_MK6 is not set
   42.75 +# CONFIG_MK7 is not set
   42.76 +# CONFIG_MK8 is not set
   42.77 +# CONFIG_MCRUSOE is not set
   42.78 +# CONFIG_MWINCHIPC6 is not set
   42.79 +# CONFIG_MWINCHIP2 is not set
   42.80 +# CONFIG_MWINCHIP3D is not set
   42.81 +# CONFIG_MCYRIXIII is not set
   42.82 +# CONFIG_MVIAC3_2 is not set
   42.83 +# CONFIG_X86_GENERIC is not set
   42.84 +CONFIG_X86_CMPXCHG=y
   42.85 +CONFIG_X86_XADD=y
   42.86 +CONFIG_X86_L1_CACHE_SHIFT=7
   42.87 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
   42.88 +CONFIG_X86_WP_WORKS_OK=y
   42.89 +CONFIG_X86_INVLPG=y
   42.90 +CONFIG_X86_BSWAP=y
   42.91 +CONFIG_X86_POPAD_OK=y
   42.92 +CONFIG_X86_GOOD_APIC=y
   42.93 +CONFIG_X86_INTEL_USERCOPY=y
   42.94 +CONFIG_X86_USE_PPRO_CHECKSUM=y
   42.95 +# CONFIG_HPET_TIMER is not set
   42.96 +# CONFIG_HPET_EMULATE_RTC is not set
   42.97 +# CONFIG_SMP is not set
   42.98 +CONFIG_PREEMPT=y
   42.99 +CONFIG_X86_CPUID=y
  42.100 +
  42.101 +#
  42.102 +# Firmware Drivers
  42.103 +#
  42.104 +CONFIG_NOHIGHMEM=y
  42.105 +# CONFIG_HIGHMEM4G is not set
  42.106 +# CONFIG_HIGHMEM64G is not set
  42.107 +CONFIG_HAVE_DEC_LOCK=y
  42.108 +
  42.109 +#
  42.110 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
  42.111 +#
  42.112 +CONFIG_PCI=y
  42.113 +# CONFIG_PCI_GOBIOS is not set
  42.114 +# CONFIG_PCI_GOMMCONFIG is not set
  42.115 +CONFIG_PCI_GODIRECT=y
  42.116 +# CONFIG_PCI_GOANY is not set
  42.117 +CONFIG_PCI_DIRECT=y
  42.118 +CONFIG_PCI_LEGACY_PROC=y
  42.119 +# CONFIG_PCI_NAMES is not set
  42.120 +CONFIG_ISA=y
  42.121 +# CONFIG_EISA is not set
  42.122 +# CONFIG_MCA is not set
  42.123 +# CONFIG_SCx200 is not set
  42.124 +
  42.125 +#
  42.126 +# Kernel hacking
  42.127 +#
  42.128 +# CONFIG_DEBUG_KERNEL is not set
  42.129 +CONFIG_EARLY_PRINTK=y
  42.130 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
  42.131 +# CONFIG_FRAME_POINTER is not set
  42.132 +# CONFIG_4KSTACKS is not set
  42.133 +CONFIG_X86_BIOS_REBOOT=y
  42.134 +CONFIG_X86_STD_RESOURCES=y
  42.135 +CONFIG_PC=y
  42.136 +
  42.137 +#
  42.138 +# Executable file formats
  42.139 +#
  42.140 +CONFIG_BINFMT_ELF=y
  42.141 +# CONFIG_BINFMT_AOUT is not set
  42.142 +# CONFIG_BINFMT_MISC is not set
  42.143 +
  42.144 +#
  42.145 +# Device Drivers
  42.146 +#
  42.147 +
  42.148 +#
  42.149 +# Generic Driver Options
  42.150 +#
  42.151 +
  42.152 +#
  42.153 +# Block devices
  42.154 +#
  42.155 +# CONFIG_BLK_DEV_FD is not set
  42.156 +# CONFIG_BLK_DEV_XD is not set
  42.157 +# CONFIG_BLK_CPQ_DA is not set
  42.158 +# CONFIG_BLK_CPQ_CISS_DA is not set
  42.159 +# CONFIG_BLK_DEV_DAC960 is not set
  42.160 +# CONFIG_BLK_DEV_LOOP is not set
  42.161 +# CONFIG_BLK_DEV_NBD is not set
  42.162 +# CONFIG_BLK_DEV_CARMEL is not set
  42.163 +# CONFIG_BLK_DEV_RAM is not set
  42.164 +# CONFIG_LBD is not set
  42.165 +
  42.166 +#
  42.167 +# ATA/ATAPI/MFM/RLL support
  42.168 +#
  42.169 +CONFIG_IDE=y
  42.170 +CONFIG_BLK_DEV_IDE=y
  42.171 +
  42.172 +#
  42.173 +# Please see Documentation/ide.txt for help/info on IDE drives
  42.174 +#
  42.175 +# CONFIG_BLK_DEV_HD_IDE is not set
  42.176 +CONFIG_BLK_DEV_IDEDISK=y
  42.177 +# CONFIG_IDEDISK_MULTI_MODE is not set
  42.178 +CONFIG_BLK_DEV_IDECD=y
  42.179 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  42.180 +# CONFIG_BLK_DEV_IDESCSI is not set
  42.181 +# CONFIG_IDE_TASK_IOCTL is not set
  42.182 +
  42.183 +#
  42.184 +# IDE chipset support/bugfixes
  42.185 +#
  42.186 +CONFIG_IDE_GENERIC=y
  42.187 +# CONFIG_BLK_DEV_CMD640 is not set
  42.188 +CONFIG_BLK_DEV_IDEPCI=y
  42.189 +# CONFIG_IDEPCI_SHARE_IRQ is not set
  42.190 +# CONFIG_BLK_DEV_OFFBOARD is not set
  42.191 +CONFIG_BLK_DEV_GENERIC=y
  42.192 +# CONFIG_BLK_DEV_RZ1000 is not set
  42.193 +CONFIG_BLK_DEV_IDEDMA_PCI=y
  42.194 +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
  42.195 +CONFIG_IDEDMA_PCI_AUTO=y
  42.196 +# CONFIG_IDEDMA_ONLYDISK is not set
  42.197 +CONFIG_BLK_DEV_ADMA=y
  42.198 +# CONFIG_BLK_DEV_AEC62XX is not set
  42.199 +# CONFIG_BLK_DEV_ALI15X3 is not set
  42.200 +# CONFIG_BLK_DEV_AMD74XX is not set
  42.201 +# CONFIG_BLK_DEV_ATIIXP is not set
  42.202 +# CONFIG_BLK_DEV_CMD64X is not set
  42.203 +# CONFIG_BLK_DEV_TRIFLEX is not set
  42.204 +# CONFIG_BLK_DEV_CY82C693 is not set
  42.205 +# CONFIG_BLK_DEV_CS5530 is not set
  42.206 +# CONFIG_BLK_DEV_HPT34X is not set
  42.207 +# CONFIG_BLK_DEV_HPT366 is not set
  42.208 +# CONFIG_BLK_DEV_SC1200 is not set
  42.209 +CONFIG_BLK_DEV_PIIX=y
  42.210 +# CONFIG_BLK_DEV_NS87415 is not set
  42.211 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
  42.212 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
  42.213 +# CONFIG_BLK_DEV_SVWKS is not set
  42.214 +# CONFIG_BLK_DEV_SIIMAGE is not set
  42.215 +# CONFIG_BLK_DEV_SIS5513 is not set
  42.216 +# CONFIG_BLK_DEV_SLC90E66 is not set
  42.217 +# CONFIG_BLK_DEV_TRM290 is not set
  42.218 +# CONFIG_BLK_DEV_VIA82CXXX is not set
  42.219 +# CONFIG_IDE_ARM is not set
  42.220 +# CONFIG_IDE_CHIPSETS is not set
  42.221 +CONFIG_BLK_DEV_IDEDMA=y
  42.222 +# CONFIG_IDEDMA_IVB is not set
  42.223 +CONFIG_IDEDMA_AUTO=y
  42.224 +# CONFIG_BLK_DEV_HD is not set
  42.225 +
  42.226 +#
  42.227 +# SCSI device support
  42.228 +#
  42.229 +CONFIG_SCSI=y
  42.230 +CONFIG_SCSI_PROC_FS=y
  42.231 +
  42.232 +#
  42.233 +# SCSI support type (disk, tape, CD-ROM)
  42.234 +#
  42.235 +CONFIG_BLK_DEV_SD=y
  42.236 +# CONFIG_CHR_DEV_ST is not set
  42.237 +# CONFIG_CHR_DEV_OSST is not set
  42.238 +# CONFIG_BLK_DEV_SR is not set
  42.239 +# CONFIG_CHR_DEV_SG is not set
  42.240 +
  42.241 +#
  42.242 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  42.243 +#
  42.244 +# CONFIG_SCSI_MULTI_LUN is not set
  42.245 +# CONFIG_SCSI_CONSTANTS is not set
  42.246 +# CONFIG_SCSI_LOGGING is not set
  42.247 +
  42.248 +#
  42.249 +# SCSI Transport Attributes
  42.250 +#
  42.251 +# CONFIG_SCSI_SPI_ATTRS is not set
  42.252 +# CONFIG_SCSI_FC_ATTRS is not set
  42.253 +
  42.254 +#
  42.255 +# SCSI low-level drivers
  42.256 +#
  42.257 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
  42.258 +# CONFIG_SCSI_7000FASST is not set
  42.259 +# CONFIG_SCSI_ACARD is not set
  42.260 +# CONFIG_SCSI_AHA152X is not set
  42.261 +# CONFIG_SCSI_AHA1542 is not set
  42.262 +# CONFIG_SCSI_AIC7XXX is not set
  42.263 +# CONFIG_SCSI_AIC7XXX_OLD is not set
  42.264 +# CONFIG_SCSI_AIC79XX is not set
  42.265 +# CONFIG_SCSI_DPT_I2O is not set
  42.266 +# CONFIG_SCSI_ADVANSYS is not set
  42.267 +# CONFIG_SCSI_IN2000 is not set
  42.268 +# CONFIG_SCSI_MEGARAID is not set
  42.269 +# CONFIG_SCSI_BUSLOGIC is not set
  42.270 +# CONFIG_SCSI_DMX3191D is not set
  42.271 +# CONFIG_SCSI_DTC3280 is not set
  42.272 +# CONFIG_SCSI_EATA is not set
  42.273 +# CONFIG_SCSI_EATA_PIO is not set
  42.274 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  42.275 +# CONFIG_SCSI_GDTH is not set
  42.276 +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  42.277 +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
  42.278 +# CONFIG_SCSI_IPS is not set
  42.279 +# CONFIG_SCSI_INIA100 is not set
  42.280 +# CONFIG_SCSI_NCR53C406A is not set
  42.281 +# CONFIG_SCSI_SYM53C8XX_2 is not set
  42.282 +# CONFIG_SCSI_IPR is not set
  42.283 +# CONFIG_SCSI_PAS16 is not set
  42.284 +# CONFIG_SCSI_PSI240I is not set
  42.285 +# CONFIG_SCSI_QLOGIC_FAS is not set
  42.286 +# CONFIG_SCSI_QLOGIC_ISP is not set
  42.287 +# CONFIG_SCSI_QLOGIC_FC is not set
  42.288 +# CONFIG_SCSI_QLOGIC_1280 is not set
  42.289 +CONFIG_SCSI_QLA2XXX=y
  42.290 +# CONFIG_SCSI_QLA21XX is not set
  42.291 +# CONFIG_SCSI_QLA22XX is not set
  42.292 +# CONFIG_SCSI_QLA2300 is not set
  42.293 +# CONFIG_SCSI_QLA2322 is not set
  42.294 +# CONFIG_SCSI_QLA6312 is not set
  42.295 +# CONFIG_SCSI_QLA6322 is not set
  42.296 +# CONFIG_SCSI_SYM53C416 is not set
  42.297 +# CONFIG_SCSI_DC390T is not set
  42.298 +# CONFIG_SCSI_T128 is not set
  42.299 +# CONFIG_SCSI_U14_34F is not set
  42.300 +# CONFIG_SCSI_ULTRASTOR is not set
  42.301 +# CONFIG_SCSI_NSP32 is not set
  42.302 +# CONFIG_SCSI_DEBUG is not set
  42.303 +
  42.304 +#
  42.305 +# Old CD-ROM drivers (not SCSI, not IDE)
  42.306 +#
  42.307 +# CONFIG_CD_NO_IDESCSI is not set
  42.308 +
  42.309 +#
  42.310 +# Multi-device support (RAID and LVM)
  42.311 +#
  42.312 +# CONFIG_MD is not set
  42.313 +
  42.314 +#
  42.315 +# Networking support
  42.316 +#
  42.317 +CONFIG_NET=y
  42.318 +
  42.319 +#
  42.320 +# Networking options
  42.321 +#
  42.322 +CONFIG_PACKET=y
  42.323 +# CONFIG_PACKET_MMAP is not set
  42.324 +# CONFIG_NETLINK_DEV is not set
  42.325 +CONFIG_UNIX=y
  42.326 +# CONFIG_NET_KEY is not set
  42.327 +CONFIG_INET=y
  42.328 +# CONFIG_IP_MULTICAST is not set
  42.329 +# CONFIG_IP_ADVANCED_ROUTER is not set
  42.330 +CONFIG_IP_PNP=y
  42.331 +# CONFIG_IP_PNP_DHCP is not set
  42.332 +# CONFIG_IP_PNP_BOOTP is not set
  42.333 +# CONFIG_IP_PNP_RARP is not set
  42.334 +# CONFIG_NET_IPIP is not set
  42.335 +# CONFIG_NET_IPGRE is not set
  42.336 +# CONFIG_SYN_COOKIES is not set
  42.337 +# CONFIG_INET_AH is not set
  42.338 +# CONFIG_INET_ESP is not set
  42.339 +# CONFIG_INET_IPCOMP is not set
  42.340 +# CONFIG_NETFILTER is not set
  42.341 +CONFIG_BRIDGE=y
  42.342 +# CONFIG_VLAN_8021Q is not set
  42.343 +# CONFIG_DECNET is not set
  42.344 +# CONFIG_LLC2 is not set
  42.345 +# CONFIG_IPX is not set
  42.346 +# CONFIG_ATALK is not set
  42.347 +
  42.348 +#
  42.349 +# QoS and/or fair queueing
  42.350 +#
  42.351 +# CONFIG_NET_SCHED is not set
  42.352 +
  42.353 +#
  42.354 +# Network testing
  42.355 +#
  42.356 +# CONFIG_NET_PKTGEN is not set
  42.357 +# CONFIG_NETPOLL is not set
  42.358 +# CONFIG_NET_POLL_CONTROLLER is not set
  42.359 +# CONFIG_HAMRADIO is not set
  42.360 +# CONFIG_IRDA is not set
  42.361 +# CONFIG_BT is not set
  42.362 +CONFIG_NETDEVICES=y
  42.363 +# CONFIG_DUMMY is not set
  42.364 +# CONFIG_BONDING is not set
  42.365 +# CONFIG_EQUALIZER is not set
  42.366 +# CONFIG_TUN is not set
  42.367 +
  42.368 +#
  42.369 +# ARCnet devices
  42.370 +#
  42.371 +# CONFIG_ARCNET is not set
  42.372 +
  42.373 +#
  42.374 +# Ethernet (10 or 100Mbit)
  42.375 +#
  42.376 +CONFIG_NET_ETHERNET=y
  42.377 +CONFIG_MII=y
  42.378 +# CONFIG_HAPPYMEAL is not set
  42.379 +# CONFIG_SUNGEM is not set
  42.380 +CONFIG_NET_VENDOR_3COM=y
  42.381 +# CONFIG_EL1 is not set
  42.382 +# CONFIG_EL2 is not set
  42.383 +# CONFIG_ELPLUS is not set
  42.384 +# CONFIG_EL3 is not set
  42.385 +# CONFIG_3C515 is not set
  42.386 +CONFIG_VORTEX=y
  42.387 +# CONFIG_TYPHOON is not set
  42.388 +# CONFIG_LANCE is not set
  42.389 +# CONFIG_NET_VENDOR_SMC is not set
  42.390 +# CONFIG_NET_VENDOR_RACAL is not set
  42.391 +
  42.392 +#
  42.393 +# Tulip family network device support
  42.394 +#
  42.395 +CONFIG_NET_TULIP=y
  42.396 +CONFIG_TULIP=y
  42.397 +# CONFIG_TULIP_MMIO is not set
  42.398 +# CONFIG_TULIP_NAPI is not set
  42.399 +# CONFIG_DE4X5 is not set
  42.400 +# CONFIG_WINBOND_840 is not set
  42.401 +# CONFIG_DM9102 is not set
  42.402 +# CONFIG_DEPCA is not set
  42.403 +# CONFIG_HP100 is not set
  42.404 +# CONFIG_NET_ISA is not set
  42.405 +CONFIG_NET_PCI=y
  42.406 +CONFIG_PCNET32=y
  42.407 +# CONFIG_AMD8111_ETH is not set
  42.408 +# CONFIG_ADAPTEC_STARFIRE is not set
  42.409 +# CONFIG_APRICOT is not set
  42.410 +# CONFIG_CS89x0 is not set
  42.411 +# CONFIG_DGRS is not set
  42.412 +# CONFIG_EEPRO100 is not set
  42.413 +CONFIG_E100=y
  42.414 +# CONFIG_E100_NAPI is not set
  42.415 +# CONFIG_FEALNX is not set
  42.416 +# CONFIG_NATSEMI is not set
  42.417 +# CONFIG_NE2K_PCI is not set
  42.418 +CONFIG_8139TOO=y
  42.419 +CONFIG_8139TOO_PIO=y
  42.420 +# CONFIG_8139TOO_TUNE_TWISTER is not set
  42.421 +# CONFIG_8139TOO_8129 is not set
  42.422 +# CONFIG_8139_OLD_RX_RESET is not set
  42.423 +# CONFIG_SIS900 is not set
  42.424 +# CONFIG_EPIC100 is not set
  42.425 +# CONFIG_SUNDANCE is not set
  42.426 +# CONFIG_TLAN is not set
  42.427 +CONFIG_VIA_RHINE=y
  42.428 +# CONFIG_VIA_RHINE_MMIO is not set
  42.429 +# CONFIG_NET_POCKET is not set
  42.430 +
  42.431 +#
  42.432 +# Ethernet (1000 Mbit)
  42.433 +#
  42.434 +CONFIG_ACENIC=y
  42.435 +# CONFIG_ACENIC_OMIT_TIGON_I is not set
  42.436 +# CONFIG_DL2K is not set
  42.437 +CONFIG_E1000=y
  42.438 +# CONFIG_E1000_NAPI is not set
  42.439 +# CONFIG_NS83820 is not set
  42.440 +# CONFIG_HAMACHI is not set
  42.441 +# CONFIG_R8169 is not set
  42.442 +# CONFIG_SK98LIN is not set
  42.443 +CONFIG_TIGON3=y
  42.444 +
  42.445 +#
  42.446 +# Ethernet (10000 Mbit)
  42.447 +#
  42.448 +# CONFIG_IXGB is not set
  42.449 +# CONFIG_S2IO is not set
  42.450 +
  42.451 +#
  42.452 +# Token Ring devices
  42.453 +#
  42.454 +# CONFIG_TR is not set
  42.455 +
  42.456 +#
  42.457 +# Wireless LAN (non-hamradio)
  42.458 +#
  42.459 +# CONFIG_NET_RADIO is not set
  42.460 +
  42.461 +#
  42.462 +# Wan interfaces
  42.463 +#
  42.464 +# CONFIG_WAN is not set
  42.465 +# CONFIG_FDDI is not set
  42.466 +# CONFIG_PPP is not set
  42.467 +# CONFIG_SLIP is not set
  42.468 +# CONFIG_NET_FC is not set
  42.469 +
  42.470 +#
  42.471 +# Input device support
  42.472 +#
  42.473 +CONFIG_INPUT=y
  42.474 +
  42.475 +#
  42.476 +# Userland interfaces
  42.477 +#
  42.478 +CONFIG_INPUT_MOUSEDEV=y
  42.479 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
  42.480 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  42.481 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  42.482 +# CONFIG_INPUT_JOYDEV is not set
  42.483 +# CONFIG_INPUT_TSDEV is not set
  42.484 +# CONFIG_INPUT_EVDEV is not set
  42.485 +# CONFIG_INPUT_EVBUG is not set
  42.486 +
  42.487 +#
  42.488 +# Input I/O drivers
  42.489 +#
  42.490 +# CONFIG_GAMEPORT is not set
  42.491 +CONFIG_SOUND_GAMEPORT=y
  42.492 +CONFIG_SERIO=y
  42.493 +CONFIG_SERIO_I8042=y
  42.494 +CONFIG_SERIO_SERPORT=y
  42.495 +# CONFIG_SERIO_CT82C710 is not set
  42.496 +# CONFIG_SERIO_PCIPS2 is not set
  42.497 +
  42.498 +#
  42.499 +# Input Device Drivers
  42.500 +#
  42.501 +CONFIG_INPUT_KEYBOARD=y
  42.502 +CONFIG_KEYBOARD_ATKBD=y
  42.503 +# CONFIG_KEYBOARD_SUNKBD is not set
  42.504 +# CONFIG_KEYBOARD_LKKBD is not set
  42.505 +# CONFIG_KEYBOARD_XTKBD is not set
  42.506 +# CONFIG_KEYBOARD_NEWTON is not set
  42.507 +CONFIG_INPUT_MOUSE=y
  42.508 +CONFIG_MOUSE_PS2=y
  42.509 +# CONFIG_MOUSE_SERIAL is not set
  42.510 +# CONFIG_MOUSE_INPORT is not set
  42.511 +# CONFIG_MOUSE_LOGIBM is not set
  42.512 +# CONFIG_MOUSE_PC110PAD is not set
  42.513 +# CONFIG_MOUSE_VSXXXAA is not set
  42.514 +# CONFIG_INPUT_JOYSTICK is not set
  42.515 +# CONFIG_INPUT_TOUCHSCREEN is not set
  42.516 +# CONFIG_INPUT_MISC is not set
  42.517 +
  42.518 +#
  42.519 +# Character devices
  42.520 +#
  42.521 +CONFIG_VT=y
  42.522 +CONFIG_VT_CONSOLE=y
  42.523 +CONFIG_HW_CONSOLE=y
  42.524 +# CONFIG_SERIAL_NONSTANDARD is not set
  42.525 +
  42.526 +#
  42.527 +# Serial drivers
  42.528 +#
  42.529 +# CONFIG_SERIAL_8250 is not set
  42.530 +
  42.531 +#
  42.532 +# Non-8250 serial port support
  42.533 +#
  42.534 +CONFIG_UNIX98_PTYS=y
  42.535 +CONFIG_LEGACY_PTYS=y
  42.536 +CONFIG_LEGACY_PTY_COUNT=256
  42.537 +# CONFIG_QIC02_TAPE is not set
  42.538 +
  42.539 +#
  42.540 +# IPMI
  42.541 +#
  42.542 +# CONFIG_IPMI_HANDLER is not set
  42.543 +
  42.544 +#
  42.545 +# Watchdog Cards
  42.546 +#
  42.547 +# CONFIG_WATCHDOG is not set
  42.548 +# CONFIG_HW_RANDOM is not set
  42.549 +# CONFIG_NVRAM is not set
  42.550 +# CONFIG_RTC is not set
  42.551 +# CONFIG_GEN_RTC is not set
  42.552 +# CONFIG_DTLK is not set
  42.553 +# CONFIG_R3964 is not set
  42.554 +# CONFIG_APPLICOM is not set
  42.555 +
  42.556 +#
  42.557 +# Ftape, the floppy tape device driver
  42.558 +#
  42.559 +# CONFIG_FTAPE is not set
  42.560 +# CONFIG_AGP is not set
  42.561 +# CONFIG_DRM is not set
  42.562 +# CONFIG_MWAVE is not set
  42.563 +# CONFIG_RAW_DRIVER is not set
  42.564 +# CONFIG_HANGCHECK_TIMER is not set
  42.565 +
  42.566 +#
  42.567 +# I2C support
  42.568 +#
  42.569 +# CONFIG_I2C is not set
  42.570 +
  42.571 +#
  42.572 +# Graphics support
  42.573 +#
  42.574 +# CONFIG_FB is not set
  42.575 +# CONFIG_VIDEO_SELECT is not set
  42.576 +
  42.577 +#
  42.578 +# Console display driver support
  42.579 +#
  42.580 +CONFIG_VGA_CONSOLE=y
  42.581 +# CONFIG_MDA_CONSOLE is not set
  42.582 +CONFIG_DUMMY_CONSOLE=y
  42.583 +
  42.584 +#
  42.585 +# File systems
  42.586 +#
  42.587 +CONFIG_EXT2_FS=y
  42.588 +# CONFIG_EXT2_FS_XATTR is not set
  42.589 +CONFIG_EXT3_FS=y
  42.590 +CONFIG_EXT3_FS_XATTR=y
  42.591 +# CONFIG_EXT3_FS_POSIX_ACL is not set
  42.592 +# CONFIG_EXT3_FS_SECURITY is not set
  42.593 +CONFIG_JBD=y
  42.594 +# CONFIG_JBD_DEBUG is not set
  42.595 +CONFIG_FS_MBCACHE=y
  42.596 +# CONFIG_REISERFS_FS is not set
  42.597 +# CONFIG_JFS_FS is not set
  42.598 +# CONFIG_XFS_FS is not set
  42.599 +# CONFIG_MINIX_FS is not set
  42.600 +# CONFIG_ROMFS_FS is not set
  42.601 +# CONFIG_QUOTA is not set
  42.602 +# CONFIG_AUTOFS_FS is not set
  42.603 +# CONFIG_AUTOFS4_FS is not set
  42.604 +
  42.605 +#
  42.606 +# CD-ROM/DVD Filesystems
  42.607 +#
  42.608 +# CONFIG_ISO9660_FS is not set
  42.609 +# CONFIG_UDF_FS is not set
  42.610 +
  42.611 +#
  42.612 +# DOS/FAT/NT Filesystems
  42.613 +#
  42.614 +# CONFIG_FAT_FS is not set
  42.615 +# CONFIG_NTFS_FS is not set
  42.616 +
  42.617 +#
  42.618 +# Pseudo filesystems
  42.619 +#
  42.620 +CONFIG_PROC_FS=y
  42.621 +CONFIG_PROC_KCORE=y
  42.622 +CONFIG_SYSFS=y
  42.623 +# CONFIG_DEVPTS_FS_XATTR is not set
  42.624 +CONFIG_TMPFS=y
  42.625 +# CONFIG_HUGETLBFS is not set
  42.626 +# CONFIG_HUGETLB_PAGE is not set
  42.627 +CONFIG_RAMFS=y
  42.628 +
  42.629 +#
  42.630 +# Miscellaneous filesystems
  42.631 +#
  42.632 +# CONFIG_HFSPLUS_FS is not set
  42.633 +# CONFIG_CRAMFS is not set
  42.634 +# CONFIG_VXFS_FS is not set
  42.635 +# CONFIG_HPFS_FS is not set
  42.636 +# CONFIG_QNX4FS_FS is not set
  42.637 +# CONFIG_SYSV_FS is not set
  42.638 +# CONFIG_UFS_FS is not set
  42.639 +
  42.640 +#
  42.641 +# Network File Systems
  42.642 +#
  42.643 +CONFIG_NFS_FS=y
  42.644 +CONFIG_NFS_V3=y
  42.645 +# CONFIG_NFSD is not set
  42.646 +CONFIG_ROOT_NFS=y
  42.647 +CONFIG_LOCKD=y
  42.648 +CONFIG_LOCKD_V4=y
  42.649 +# CONFIG_EXPORTFS is not set
  42.650 +CONFIG_SUNRPC=y
  42.651 +# CONFIG_SMB_FS is not set
  42.652 +# CONFIG_CIFS is not set
  42.653 +# CONFIG_NCP_FS is not set
  42.654 +# CONFIG_CODA_FS is not set
  42.655 +
  42.656 +#
  42.657 +# Partition Types
  42.658 +#
  42.659 +# CONFIG_PARTITION_ADVANCED is not set
  42.660 +CONFIG_MSDOS_PARTITION=y
  42.661 +
  42.662 +#
  42.663 +# Native Language Support
  42.664 +#
  42.665 +CONFIG_NLS=y
  42.666 +CONFIG_NLS_DEFAULT="iso8859-1"
  42.667 +CONFIG_NLS_CODEPAGE_437=y
  42.668 +# CONFIG_NLS_CODEPAGE_737 is not set
  42.669 +# CONFIG_NLS_CODEPAGE_775 is not set
  42.670 +# CONFIG_NLS_CODEPAGE_850 is not set
  42.671 +# CONFIG_NLS_CODEPAGE_852 is not set
  42.672 +# CONFIG_NLS_CODEPAGE_855 is not set
  42.673 +# CONFIG_NLS_CODEPAGE_857 is not set
  42.674 +# CONFIG_NLS_CODEPAGE_860 is not set
  42.675 +# CONFIG_NLS_CODEPAGE_861 is not set
  42.676 +# CONFIG_NLS_CODEPAGE_862 is not set
  42.677 +# CONFIG_NLS_CODEPAGE_863 is not set
  42.678 +# CONFIG_NLS_CODEPAGE_864 is not set
  42.679 +# CONFIG_NLS_CODEPAGE_865 is not set
  42.680 +# CONFIG_NLS_CODEPAGE_866 is not set
  42.681 +# CONFIG_NLS_CODEPAGE_869 is not set
  42.682 +# CONFIG_NLS_CODEPAGE_936 is not set
  42.683 +# CONFIG_NLS_CODEPAGE_950 is not set
  42.684 +# CONFIG_NLS_CODEPAGE_932 is not set
  42.685 +# CONFIG_NLS_CODEPAGE_949 is not set
  42.686 +# CONFIG_NLS_CODEPAGE_874 is not set
  42.687 +# CONFIG_NLS_ISO8859_8 is not set
  42.688 +# CONFIG_NLS_CODEPAGE_1250 is not set
  42.689 +# CONFIG_NLS_CODEPAGE_1251 is not set
  42.690 +CONFIG_NLS_ISO8859_1=y
  42.691 +# CONFIG_NLS_ISO8859_2 is not set
  42.692 +# CONFIG_NLS_ISO8859_3 is not set
  42.693 +# CONFIG_NLS_ISO8859_4 is not set
  42.694 +# CONFIG_NLS_ISO8859_5 is not set
  42.695 +# CONFIG_NLS_ISO8859_6 is not set
  42.696 +# CONFIG_NLS_ISO8859_7 is not set
  42.697 +# CONFIG_NLS_ISO8859_9 is not set
  42.698 +# CONFIG_NLS_ISO8859_13 is not set
  42.699 +# CONFIG_NLS_ISO8859_14 is not set
  42.700 +# CONFIG_NLS_ISO8859_15 is not set
  42.701 +# CONFIG_NLS_KOI8_R is not set
  42.702 +# CONFIG_NLS_KOI8_U is not set
  42.703 +# CONFIG_NLS_UTF8 is not set
  42.704 +
  42.705 +#
  42.706 +# Security options
  42.707 +#
  42.708 +# CONFIG_SECURITY is not set
  42.709 +
  42.710 +#
  42.711 +# Cryptographic options
  42.712 +#
  42.713 +# CONFIG_CRYPTO is not set
  42.714 +
  42.715 +#
  42.716 +# Library routines
  42.717 +#
  42.718 +CONFIG_CRC32=y
  42.719 +CONFIG_LIBCRC32C=y
    43.1 --- a/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig	Fri Jul 23 14:11:01 2004 +0000
    43.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig	Tue Aug 03 12:28:49 2004 +0000
    43.3 @@ -3,6 +3,16 @@
    43.4  #
    43.5  CONFIG_XEN=y
    43.6  CONFIG_ARCH_XEN=y
    43.7 +CONFIG_NO_IDLE_HZ=y
    43.8 +
    43.9 +#
   43.10 +# XEN
   43.11 +#
   43.12 +# CONFIG_XEN_PRIVILEGED_GUEST is not set
   43.13 +# CONFIG_XEN_PHYSDEV_ACCESS is not set
   43.14 +CONFIG_FORCE_MAX_ZONEORDER=11
   43.15 +CONFIG_X86=y
   43.16 +# CONFIG_X86_64 is not set
   43.17  
   43.18  #
   43.19  # Code maturity level options
   43.20 @@ -43,8 +53,6 @@ CONFIG_MODULE_UNLOAD=y
   43.21  CONFIG_OBSOLETE_MODPARM=y
   43.22  # CONFIG_MODVERSIONS is not set
   43.23  CONFIG_KMOD=y
   43.24 -CONFIG_X86=y
   43.25 -# CONFIG_X86_64 is not set
   43.26  
   43.27  #
   43.28  # X86 Processor Configuration
    44.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/Kconfig	Fri Jul 23 14:11:01 2004 +0000
    44.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/Kconfig	Tue Aug 03 12:28:49 2004 +0000
    44.3 @@ -626,6 +626,148 @@ config REGPARM
    44.4  	-mregparm=3 is used.
    44.5  
    44.6  
    44.7 +if XEN_PHYSDEV_ACCESS
    44.8 +
    44.9 +menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
   44.10 +
   44.11 +config X86_VISWS_APIC
   44.12 +	bool
   44.13 +	depends on X86_VISWS
   44.14 +	default y
   44.15 +
   44.16 +config X86_LOCAL_APIC
   44.17 +	bool
   44.18 +	depends on (X86_VISWS || SMP) && !X86_VOYAGER
   44.19 +	default y
   44.20 +
   44.21 +config X86_IO_APIC
   44.22 +	bool
   44.23 +	depends on SMP && !(X86_VISWS || X86_VOYAGER)
   44.24 +	default y
   44.25 +
   44.26 +config PCI
   44.27 +	bool "PCI support" if !X86_VISWS
   44.28 +	depends on !X86_VOYAGER
   44.29 +	default y if X86_VISWS
   44.30 +	help
   44.31 +	  Find out whether you have a PCI motherboard. PCI is the name of a
   44.32 +	  bus system, i.e. the way the CPU talks to the other stuff inside
   44.33 +	  your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
   44.34 +	  VESA. If you have PCI, say Y, otherwise N.
   44.35 +
   44.36 +	  The PCI-HOWTO, available from
   44.37 +	  <http://www.tldp.org/docs.html#howto>, contains valuable
   44.38 +	  information about which PCI hardware does work under Linux and which
   44.39 +	  doesn't.
   44.40 +
   44.41 +choice
   44.42 +	prompt "PCI access mode"
   44.43 +	depends on PCI && !X86_VISWS
   44.44 +	default PCI_GOANY
   44.45 +	---help---
   44.46 +	  On PCI systems, the BIOS can be used to detect the PCI devices and
   44.47 +	  determine their configuration. However, some old PCI motherboards
   44.48 +	  have BIOS bugs and may crash if this is done. Also, some embedded
   44.49 +	  PCI-based systems don't have any BIOS at all. Linux can also try to
   44.50 +	  detect the PCI hardware directly without using the BIOS.
   44.51 +
   44.52 +	  With this option, you can specify how Linux should detect the
   44.53 +	  PCI devices. If you choose "BIOS", the BIOS will be used,
   44.54 +	  if you choose "Direct", the BIOS won't be used, and if you
   44.55 +	  choose "MMConfig", then PCI Express MMCONFIG will be used.
   44.56 +	  If you choose "Any", the kernel will try MMCONFIG, then the
   44.57 +	  direct access method and falls back to the BIOS if that doesn't
   44.58 +	  work. If unsure, go with the default, which is "Any".
   44.59 +
   44.60 +config PCI_GOBIOS
   44.61 +	bool "BIOS"
   44.62 +
   44.63 +config PCI_GOMMCONFIG
   44.64 +	bool "MMConfig"
   44.65 +
   44.66 +config PCI_GODIRECT
   44.67 +	bool "Direct"
   44.68 +
   44.69 +config PCI_GOANY
   44.70 +	bool "Any"
   44.71 +
   44.72 +endchoice
   44.73 +
   44.74 +config PCI_BIOS
   44.75 +	bool
   44.76 +	depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
   44.77 +	default y
   44.78 +
   44.79 +config PCI_DIRECT
   44.80 +	bool
   44.81 + 	depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
   44.82 +	default y
   44.83 +
   44.84 +source "drivers/pci/Kconfig"
   44.85 +
   44.86 +config ISA
   44.87 +	bool "ISA support"
   44.88 +	depends on !(X86_VOYAGER || X86_VISWS)
   44.89 +	help
   44.90 +	  Find out whether you have ISA slots on your motherboard.  ISA is the
   44.91 +	  name of a bus system, i.e. the way the CPU talks to the other stuff
   44.92 +	  inside your box.  Other bus systems are PCI, EISA, MicroChannel
   44.93 +	  (MCA) or VESA.  ISA is an older system, now being displaced by PCI;
   44.94 +	  newer boards don't support it.  If you have ISA, say Y, otherwise N.
   44.95 +
   44.96 +config EISA
   44.97 +	bool "EISA support"
   44.98 +	depends on ISA
   44.99 +	---help---
  44.100 +	  The Extended Industry Standard Architecture (EISA) bus was
  44.101 +	  developed as an open alternative to the IBM MicroChannel bus.
  44.102 +
  44.103 +	  The EISA bus provided some of the features of the IBM MicroChannel
  44.104 +	  bus while maintaining backward compatibility with cards made for
  44.105 +	  the older ISA bus.  The EISA bus saw limited use between 1988 and
  44.106 +	  1995 when it was made obsolete by the PCI bus.
  44.107 +
  44.108 +	  Say Y here if you are building a kernel for an EISA-based machine.
  44.109 +
  44.110 +	  Otherwise, say N.
  44.111 +
  44.112 +source "drivers/eisa/Kconfig"
  44.113 +
  44.114 +config MCA
  44.115 +	bool "MCA support"
  44.116 +	depends on !(X86_VISWS || X86_VOYAGER)
  44.117 +	help
  44.118 +	  MicroChannel Architecture is found in some IBM PS/2 machines and
  44.119 +	  laptops.  It is a bus system similar to PCI or ISA. See
  44.120 +	  <file:Documentation/mca.txt> (and especially the web page given
  44.121 +	  there) before attempting to build an MCA bus kernel.
  44.122 +
  44.123 +config MCA
  44.124 +	depends on X86_VOYAGER
  44.125 +	default y if X86_VOYAGER
  44.126 +
  44.127 +source "drivers/mca/Kconfig"
  44.128 +
  44.129 +config SCx200
  44.130 +	tristate "NatSemi SCx200 support"
  44.131 +	depends on !X86_VOYAGER
  44.132 +	help
  44.133 +	  This provides basic support for the National Semiconductor SCx200 
  44.134 +	  processor.  Right now this is just a driver for the GPIO pins.
  44.135 +
  44.136 +	  If you don't know what to do here, say N.
  44.137 +
  44.138 +	  This support is also available as a module.  If compiled as a
  44.139 +	  module, it will be called scx200.
  44.140 +
  44.141 +source "drivers/pcmcia/Kconfig"
  44.142 +
  44.143 +source "drivers/pci/hotplug/Kconfig"
  44.144 +
  44.145 +endmenu
  44.146 +
  44.147 +endif
  44.148 +
  44.149  menu "Kernel hacking"
  44.150  
  44.151  config DEBUG_KERNEL
    45.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/Makefile	Fri Jul 23 14:11:01 2004 +0000
    45.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/Makefile	Tue Aug 03 12:28:49 2004 +0000
    45.3 @@ -72,13 +72,13 @@ core-y					+= arch/xen/i386/kernel/ \
    45.4  # \
    45.5  #					   arch/xen/$(mcore-y)/
    45.6  drivers-$(CONFIG_MATH_EMULATION)	+= arch/i386/math-emu/
    45.7 -drivers-$(CONFIG_PCI)			+= arch/i386/pci/
    45.8 +drivers-$(CONFIG_PCI)			+= arch/xen/i386/pci/
    45.9  # must be linked after kernel/
   45.10  drivers-$(CONFIG_OPROFILE)		+= arch/i386/oprofile/
   45.11  drivers-$(CONFIG_PM)			+= arch/i386/power/
   45.12  
   45.13  # for clean
   45.14 -obj-	+= kernel/
   45.15 +obj-	+= kernel/ mm/ pci/
   45.16  #obj-	+= ../../i386/lib/ ../../i386/mm/ 
   45.17  #../../i386/$(mcore-y)/
   45.18  #obj-	+= ../../i386/pci/ ../../i386/oprofile/ ../../i386/power/
    46.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/Makefile	Fri Jul 23 14:11:01 2004 +0000
    46.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/Makefile	Tue Aug 03 12:28:49 2004 +0000
    46.3 @@ -8,18 +8,15 @@ CFLAGS	+= -Iarch/$(XENARCH)/kernel
    46.4  
    46.5  extra-y := head.o init_task.o vmlinux.lds.s
    46.6  
    46.7 -obj-y	:= traps.o irq.o ldt.o setup.o entry.o time.o process.o signal.o \
    46.8 -		i386_ksyms.o
    46.9 +obj-y	:= traps.o irq.o ldt.o setup.o entry.o time.o pci-dma.o process.o \
   46.10 +		signal.o i386_ksyms.o
   46.11  
   46.12  c-obj-y	:= semaphore.o vm86.o \
   46.13  		ptrace.o ioport.o sys_i386.o \
   46.14 -		pci-dma.o i387.o dmi_scan.o bootflag.o \
   46.15 +		i387.o dmi_scan.o bootflag.o \
   46.16  		doublefault.o
   46.17  s-obj-y	:=
   46.18  
   46.19 -#obj-y				+= hypervisor.o
   46.20 -obj-y				+= evtchn.o
   46.21 -
   46.22  obj-y				+= cpu/
   46.23  obj-y				+= timers/
   46.24  c-obj-$(CONFIG_ACPI_BOOT)	+= acpi/
    47.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Fri Jul 23 14:11:01 2004 +0000
    47.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Tue Aug 03 12:28:49 2004 +0000
    47.3 @@ -8,7 +8,7 @@
    47.4  #include <asm/msr.h>
    47.5  #include <asm/io.h>
    47.6  #include <asm/mmu_context.h>
    47.7 -#include <asm/hypervisor.h>
    47.8 +#include <asm-xen/hypervisor.h>
    47.9  
   47.10  #include "cpu.h"
   47.11  
    48.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/evtchn.c	Fri Jul 23 14:11:01 2004 +0000
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,479 +0,0 @@
    48.4 -/******************************************************************************
    48.5 - * evtchn.c
    48.6 - * 
    48.7 - * Communication via Xen event channels.
    48.8 - * 
    48.9 - * Copyright (c) 2002-2004, K A Fraser
   48.10 - */
   48.11 -
   48.12 -#include <linux/config.h>
   48.13 -#include <linux/irq.h>
   48.14 -#include <linux/interrupt.h>
   48.15 -#include <linux/sched.h>
   48.16 -#include <linux/kernel_stat.h>
   48.17 -#include <asm/atomic.h>
   48.18 -#include <asm/system.h>
   48.19 -#include <asm/ptrace.h>
   48.20 -#include <asm/synch_bitops.h>
   48.21 -#include <asm/hypervisor.h>
   48.22 -#include <asm/hypervisor-ifs/event_channel.h>
   48.23 -#include <asm/hypervisor-ifs/physdev.h>
   48.24 -#include <asm-xen/ctrl_if.h>
   48.25 -
   48.26 -/*
   48.27 - * This lock protects updates to the following mapping and reference-count
   48.28 - * arrays. The lock does not need to be acquired to read the mapping tables.
   48.29 - */
   48.30 -static spinlock_t irq_mapping_update_lock;
   48.31 -
   48.32 -/* IRQ <-> event-channel mappings. */
   48.33 -static int evtchn_to_irq[NR_EVENT_CHANNELS];
   48.34 -static int irq_to_evtchn[NR_IRQS];
   48.35 -
   48.36 -/* IRQ <-> VIRQ mapping. */
   48.37 -static int virq_to_irq[NR_VIRQS];
   48.38 -
   48.39 -/* Reference counts for bindings to IRQs. */
   48.40 -static int irq_bindcount[NR_IRQS];
   48.41 -
   48.42 -/* Bitmap indicating which PIRQs require Xen to be notified on unmask. */
   48.43 -static unsigned long pirq_needs_unmask_notify[NR_PIRQS/sizeof(unsigned long)];
   48.44 -
   48.45 -/* Upcall to generic IRQ layer. */
   48.46 -extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
   48.47 -
   48.48 -#define VALID_EVTCHN(_chn) ((_chn) != -1)
   48.49 -
   48.50 -void evtchn_do_upcall(struct pt_regs *regs)
   48.51 -{
   48.52 -    unsigned long  l1, l2;
   48.53 -    unsigned int   l1i, l2i, port;
   48.54 -    int            irq;
   48.55 -    unsigned long  flags;
   48.56 -    shared_info_t *s = HYPERVISOR_shared_info;
   48.57 -
   48.58 -    local_irq_save(flags);
   48.59 -    
   48.60 -    while ( s->vcpu_data[0].evtchn_upcall_pending )
   48.61 -    {
   48.62 -        s->vcpu_data[0].evtchn_upcall_pending = 0;
   48.63 -        /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
   48.64 -        l1 = xchg(&s->evtchn_pending_sel, 0);
   48.65 -        while ( (l1i = ffs(l1)) != 0 )
   48.66 -        {
   48.67 -            l1i--;
   48.68 -            l1 &= ~(1 << l1i);
   48.69 -        
   48.70 -            l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i];
   48.71 -            while ( (l2i = ffs(l2)) != 0 )
   48.72 -            {
   48.73 -                l2i--;
   48.74 -                l2 &= ~(1 << l2i);
   48.75 -            
   48.76 -                port = (l1i << 5) + l2i;
   48.77 -                if ( (irq = evtchn_to_irq[port]) != -1 )
   48.78 -                    do_IRQ(irq, regs);
   48.79 -                else
   48.80 -                    evtchn_device_upcall(port);
   48.81 -            }
   48.82 -        }
   48.83 -    }
   48.84 -
   48.85 -    local_irq_restore(flags);
   48.86 -}
   48.87 -
   48.88 -
   48.89 -static int find_unbound_irq(void)
   48.90 -{
   48.91 -    int irq;
   48.92 -
   48.93 -    for ( irq = 0; irq < NR_IRQS; irq++ )
   48.94 -        if ( irq_bindcount[irq] == 0 )
   48.95 -            break;
   48.96 -
   48.97 -    if ( irq == NR_IRQS )
   48.98 -        panic("No available IRQ to bind to: increase NR_IRQS!\n");
   48.99 -
  48.100 -    return irq;
  48.101 -}
  48.102 -
  48.103 -int bind_virq_to_irq(int virq)
  48.104 -{
  48.105 -    evtchn_op_t op;
  48.106 -    int evtchn, irq;
  48.107 -
  48.108 -    spin_lock(&irq_mapping_update_lock);
  48.109 -
  48.110 -    if ( (irq = virq_to_irq[virq]) == -1 )
  48.111 -    {
  48.112 -        op.cmd              = EVTCHNOP_bind_virq;
  48.113 -        op.u.bind_virq.virq = virq;
  48.114 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.115 -            panic("Failed to bind virtual IRQ %d\n", virq);
  48.116 -        evtchn = op.u.bind_virq.port;
  48.117 -
  48.118 -        irq = find_unbound_irq();
  48.119 -        evtchn_to_irq[evtchn] = irq;
  48.120 -        irq_to_evtchn[irq]    = evtchn;
  48.121 -
  48.122 -        virq_to_irq[virq] = irq;
  48.123 -    }
  48.124 -
  48.125 -    irq_bindcount[irq]++;
  48.126 -
  48.127 -    spin_unlock(&irq_mapping_update_lock);
  48.128 -    
  48.129 -    return irq;
  48.130 -}
  48.131 -
  48.132 -void unbind_virq_from_irq(int virq)
  48.133 -{
  48.134 -    evtchn_op_t op;
  48.135 -    int irq    = virq_to_irq[virq];
  48.136 -    int evtchn = irq_to_evtchn[irq];
  48.137 -
  48.138 -    spin_lock(&irq_mapping_update_lock);
  48.139 -
  48.140 -    if ( --irq_bindcount[irq] == 0 )
  48.141 -    {
  48.142 -        op.cmd          = EVTCHNOP_close;
  48.143 -        op.u.close.dom  = DOMID_SELF;
  48.144 -        op.u.close.port = evtchn;
  48.145 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.146 -            panic("Failed to unbind virtual IRQ %d\n", virq);
  48.147 -
  48.148 -        evtchn_to_irq[evtchn] = -1;
  48.149 -        irq_to_evtchn[irq]    = -1;
  48.150 -        virq_to_irq[virq]     = -1;
  48.151 -    }
  48.152 -
  48.153 -    spin_unlock(&irq_mapping_update_lock);
  48.154 -}
  48.155 -
  48.156 -int bind_evtchn_to_irq(int evtchn)
  48.157 -{
  48.158 -    int irq;
  48.159 -
  48.160 -    spin_lock(&irq_mapping_update_lock);
  48.161 -
  48.162 -    if ( (irq = evtchn_to_irq[evtchn]) == -1 )
  48.163 -    {
  48.164 -        irq = find_unbound_irq();
  48.165 -        evtchn_to_irq[evtchn] = irq;
  48.166 -        irq_to_evtchn[irq]    = evtchn;
  48.167 -    }
  48.168 -
  48.169 -    irq_bindcount[irq]++;
  48.170 -
  48.171 -    spin_unlock(&irq_mapping_update_lock);
  48.172 -    
  48.173 -    return irq;
  48.174 -}
  48.175 -
  48.176 -void unbind_evtchn_from_irq(int evtchn)
  48.177 -{
  48.178 -    int irq = evtchn_to_irq[evtchn];
  48.179 -
  48.180 -    spin_lock(&irq_mapping_update_lock);
  48.181 -
  48.182 -    if ( --irq_bindcount[irq] == 0 )
  48.183 -    {
  48.184 -        evtchn_to_irq[evtchn] = -1;
  48.185 -        irq_to_evtchn[irq]    = -1;
  48.186 -    }
  48.187 -
  48.188 -    spin_unlock(&irq_mapping_update_lock);
  48.189 -}
  48.190 -
  48.191 -
  48.192 -/*
  48.193 - * Interface to generic handling in irq.c
  48.194 - */
  48.195 -
  48.196 -static unsigned int startup_dynirq(unsigned int irq)
  48.197 -{
  48.198 -    unmask_evtchn(irq_to_evtchn[irq]);
  48.199 -    return 0;
  48.200 -}
  48.201 -
  48.202 -static void shutdown_dynirq(unsigned int irq)
  48.203 -{
  48.204 -    mask_evtchn(irq_to_evtchn[irq]);
  48.205 -}
  48.206 -
  48.207 -static void enable_dynirq(unsigned int irq)
  48.208 -{
  48.209 -    unmask_evtchn(irq_to_evtchn[irq]);
  48.210 -}
  48.211 -
  48.212 -static void disable_dynirq(unsigned int irq)
  48.213 -{
  48.214 -    mask_evtchn(irq_to_evtchn[irq]);
  48.215 -}
  48.216 -
  48.217 -static void ack_dynirq(unsigned int irq)
  48.218 -{
  48.219 -    mask_evtchn(irq_to_evtchn[irq]);
  48.220 -    clear_evtchn(irq_to_evtchn[irq]);
  48.221 -}
  48.222 -
  48.223 -static void end_dynirq(unsigned int irq)
  48.224 -{
  48.225 -    if ( !(irq_desc[irq].status & IRQ_DISABLED) )
  48.226 -        unmask_evtchn(irq_to_evtchn[irq]);
  48.227 -}
  48.228 -
  48.229 -static struct hw_interrupt_type dynirq_type = {
  48.230 -    "Dynamic-irq",
  48.231 -    startup_dynirq,
  48.232 -    shutdown_dynirq,
  48.233 -    enable_dynirq,
  48.234 -    disable_dynirq,
  48.235 -    ack_dynirq,
  48.236 -    end_dynirq,
  48.237 -    NULL
  48.238 -};
  48.239 -
  48.240 -static inline void pirq_unmask_notify(int pirq)
  48.241 -{
  48.242 -    physdev_op_t op;
  48.243 -    if ( unlikely(test_bit(pirq, &pirq_needs_unmask_notify[0])) )
  48.244 -    {
  48.245 -        op.cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY;
  48.246 -        (void)HYPERVISOR_physdev_op(&op);
  48.247 -    }
  48.248 -}
  48.249 -
  48.250 -static inline void pirq_query_unmask(int pirq)
  48.251 -{
  48.252 -    physdev_op_t op;
  48.253 -    op.cmd = PHYSDEVOP_IRQ_STATUS_QUERY;
  48.254 -    op.u.irq_status_query.irq = pirq;
  48.255 -    (void)HYPERVISOR_physdev_op(&op);
  48.256 -    clear_bit(pirq, &pirq_needs_unmask_notify[0]);
  48.257 -    if ( op.u.irq_status_query.flags & PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY )
  48.258 -        set_bit(pirq, &pirq_needs_unmask_notify[0]);
  48.259 -}
  48.260 -
  48.261 -/*
  48.262 - * On startup, if there is no action associated with the IRQ then we are
  48.263 - * probing. In this case we should not share with others as it will confuse us.
  48.264 - */
  48.265 -#define probing_irq(_irq) (irq_desc[(_irq)].action == NULL)
  48.266 -
  48.267 -static unsigned int startup_pirq(unsigned int irq)
  48.268 -{
  48.269 -    evtchn_op_t op;
  48.270 -    int evtchn;
  48.271 -
  48.272 -    op.cmd               = EVTCHNOP_bind_pirq;
  48.273 -    op.u.bind_pirq.pirq  = irq;
  48.274 -    /* NB. We are happy to share unless we are probing. */
  48.275 -    op.u.bind_pirq.flags = probing_irq(irq) ? 0 : BIND_PIRQ__WILL_SHARE;
  48.276 -    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.277 -    {
  48.278 -        if ( !probing_irq(irq) ) /* Some failures are expected when probing. */
  48.279 -            printk(KERN_INFO "Failed to obtain physical IRQ %d\n", irq);
  48.280 -        return 0;
  48.281 -    }
  48.282 -    evtchn = op.u.bind_pirq.port;
  48.283 -
  48.284 -    pirq_query_unmask(irq_to_pirq(irq));
  48.285 -
  48.286 -    evtchn_to_irq[evtchn] = irq;
  48.287 -    irq_to_evtchn[irq]    = evtchn;
  48.288 -
  48.289 -    unmask_evtchn(evtchn);
  48.290 -    pirq_unmask_notify(irq_to_pirq(irq));
  48.291 -
  48.292 -    return 0;
  48.293 -}
  48.294 -
  48.295 -static void shutdown_pirq(unsigned int irq)
  48.296 -{
  48.297 -    evtchn_op_t op;
  48.298 -    int evtchn = irq_to_evtchn[irq];
  48.299 -
  48.300 -    if ( !VALID_EVTCHN(evtchn) )
  48.301 -        return;
  48.302 -
  48.303 -    mask_evtchn(evtchn);
  48.304 -
  48.305 -    op.cmd          = EVTCHNOP_close;
  48.306 -    op.u.close.dom  = DOMID_SELF;
  48.307 -    op.u.close.port = evtchn;
  48.308 -    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.309 -        panic("Failed to unbind physical IRQ %d\n", irq);
  48.310 -
  48.311 -    evtchn_to_irq[evtchn] = -1;
  48.312 -    irq_to_evtchn[irq]    = -1;
  48.313 -}
  48.314 -
  48.315 -static void enable_pirq(unsigned int irq)
  48.316 -{
  48.317 -    int evtchn = irq_to_evtchn[irq];
  48.318 -    if ( !VALID_EVTCHN(evtchn) )
  48.319 -        return;
  48.320 -    unmask_evtchn(evtchn);
  48.321 -    pirq_unmask_notify(irq_to_pirq(irq));
  48.322 -}
  48.323 -
  48.324 -static void disable_pirq(unsigned int irq)
  48.325 -{
  48.326 -    int evtchn = irq_to_evtchn[irq];
  48.327 -    if ( !VALID_EVTCHN(evtchn) )
  48.328 -        return;
  48.329 -    mask_evtchn(evtchn);
  48.330 -}
  48.331 -
  48.332 -static void ack_pirq(unsigned int irq)
  48.333 -{
  48.334 -    int evtchn = irq_to_evtchn[irq];
  48.335 -    if ( !VALID_EVTCHN(evtchn) )
  48.336 -        return;
  48.337 -    mask_evtchn(evtchn);
  48.338 -    clear_evtchn(evtchn);
  48.339 -}
  48.340 -
  48.341 -static void end_pirq(unsigned int irq)
  48.342 -{
  48.343 -    int evtchn = irq_to_evtchn[irq];
  48.344 -    if ( !VALID_EVTCHN(evtchn) )
  48.345 -        return;
  48.346 -    if ( !(irq_desc[irq].status & IRQ_DISABLED) )
  48.347 -    {
  48.348 -        unmask_evtchn(evtchn);
  48.349 -        pirq_unmask_notify(irq_to_pirq(irq));
  48.350 -    }
  48.351 -}
  48.352 -
  48.353 -static struct hw_interrupt_type pirq_type = {
  48.354 -    "Phys-irq",
  48.355 -    startup_pirq,
  48.356 -    shutdown_pirq,
  48.357 -    enable_pirq,
  48.358 -    disable_pirq,
  48.359 -    ack_pirq,
  48.360 -    end_pirq,
  48.361 -    NULL
  48.362 -};
  48.363 -
  48.364 -static irqreturn_t misdirect_interrupt(int irq, void *dev_id,
  48.365 -				       struct pt_regs *regs)
  48.366 -{
  48.367 -	/* nothing */
  48.368 -	return IRQ_HANDLED;
  48.369 -}
  48.370 -
  48.371 -static struct irqaction misdirect_action = {
  48.372 -    misdirect_interrupt, 
  48.373 -    SA_INTERRUPT, 
  48.374 -    0, 
  48.375 -    "misdirect", 
  48.376 -    NULL, 
  48.377 -    NULL
  48.378 -};
  48.379 -
  48.380 -void irq_suspend(void)
  48.381 -{
  48.382 -    int virq, irq, evtchn;
  48.383 -
  48.384 -    /* Unbind VIRQs from event channels. */
  48.385 -    for ( virq = 0; virq < NR_VIRQS; virq++ )
  48.386 -    {
  48.387 -        if ( (irq = virq_to_irq[virq]) == -1 )
  48.388 -            continue;
  48.389 -        evtchn = irq_to_evtchn[irq];
  48.390 -
  48.391 -        /* Mark the event channel as unused in our table. */
  48.392 -        evtchn_to_irq[evtchn] = -1;
  48.393 -        irq_to_evtchn[irq]    = -1;
  48.394 -    }
  48.395 -
  48.396 -    /*
  48.397 -     * We should now be unbound from all event channels. Stale bindings to 
  48.398 -     * PIRQs and/or inter-domain event channels will cause us to barf here.
  48.399 -     */
  48.400 -    for ( evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++ )
  48.401 -        if ( evtchn_to_irq[evtchn] != -1 )
  48.402 -            panic("Suspend attempted while bound to evtchn %d.\n", evtchn);
  48.403 -}
  48.404 -
  48.405 -
  48.406 -void irq_resume(void)
  48.407 -{
  48.408 -    evtchn_op_t op;
  48.409 -    int         virq, irq, evtchn;
  48.410 -
  48.411 -    for ( evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++ )
  48.412 -        mask_evtchn(evtchn); /* New event-channel space is not 'live' yet. */
  48.413 -
  48.414 -    for ( virq = 0; virq < NR_VIRQS; virq++ )
  48.415 -    {
  48.416 -        if ( (irq = virq_to_irq[virq]) == -1 )
  48.417 -            continue;
  48.418 -
  48.419 -        /* Get a new binding from Xen. */
  48.420 -        op.cmd              = EVTCHNOP_bind_virq;
  48.421 -        op.u.bind_virq.virq = virq;
  48.422 -        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.423 -            panic("Failed to bind virtual IRQ %d\n", virq);
  48.424 -        evtchn = op.u.bind_virq.port;
  48.425 -        
  48.426 -        /* Record the new mapping. */
  48.427 -        evtchn_to_irq[evtchn] = irq;
  48.428 -        irq_to_evtchn[irq]    = evtchn;
  48.429 -
  48.430 -        /* Ready for use. */
  48.431 -        unmask_evtchn(evtchn);
  48.432 -    }
  48.433 -}
  48.434 -
  48.435 -void __init init_IRQ(void)
  48.436 -{
  48.437 -    int i;
  48.438 -
  48.439 -    spin_lock_init(&irq_mapping_update_lock);
  48.440 -
  48.441 -    /* No VIRQ -> IRQ mappings. */
  48.442 -    for ( i = 0; i < NR_VIRQS; i++ )
  48.443 -        virq_to_irq[i] = -1;
  48.444 -
  48.445 -    /* No event-channel -> IRQ mappings. */
  48.446 -    for ( i = 0; i < NR_EVENT_CHANNELS; i++ )
  48.447 -    {
  48.448 -        evtchn_to_irq[i] = -1;
  48.449 -        mask_evtchn(i); /* No event channels are 'live' right now. */
  48.450 -    }
  48.451 -
  48.452 -    /* No IRQ -> event-channel mappings. */
  48.453 -    for ( i = 0; i < NR_IRQS; i++ )
  48.454 -        irq_to_evtchn[i] = -1;
  48.455 -
  48.456 -    for ( i = 0; i < NR_DYNIRQS; i++ )
  48.457 -    {
  48.458 -        /* Dynamic IRQ space is currently unbound. Zero the refcnts. */
  48.459 -        irq_bindcount[dynirq_to_irq(i)] = 0;
  48.460 -
  48.461 -        irq_desc[dynirq_to_irq(i)].status  = IRQ_DISABLED;
  48.462 -        irq_desc[dynirq_to_irq(i)].action  = 0;
  48.463 -        irq_desc[dynirq_to_irq(i)].depth   = 1;
  48.464 -        irq_desc[dynirq_to_irq(i)].handler = &dynirq_type;
  48.465 -    }
  48.466 -
  48.467 -    for ( i = 0; i < NR_PIRQS; i++ )
  48.468 -    {
  48.469 -        /* Phys IRQ space is statically bound (1:1 mapping). Nail refcnts. */
  48.470 -        irq_bindcount[pirq_to_irq(i)] = 1;
  48.471 -
  48.472 -        irq_desc[pirq_to_irq(i)].status  = IRQ_DISABLED;
  48.473 -        irq_desc[pirq_to_irq(i)].action  = 0;
  48.474 -        irq_desc[pirq_to_irq(i)].depth   = 1;
  48.475 -        irq_desc[pirq_to_irq(i)].handler = &pirq_type;
  48.476 -    }
  48.477 -
  48.478 -    (void)setup_irq(bind_virq_to_irq(VIRQ_MISDIRECT), &misdirect_action);
  48.479 -
  48.480 -    /* This needs to be done early, but after the IRQ subsystem is alive. */
  48.481 -    ctrl_if_init();
  48.482 -}
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Tue Aug 03 12:28:49 2004 +0000
    49.3 @@ -0,0 +1,83 @@
    49.4 +/*
    49.5 + * Dynamic DMA mapping support.
    49.6 + *
    49.7 + * On i386 there is no hardware dynamic DMA address translation,
    49.8 + * so consistent alloc/free are merely page allocation/freeing.
    49.9 + * The rest of the dynamic DMA mapping interface is implemented
   49.10 + * in asm/pci.h.
   49.11 + */
   49.12 +
   49.13 +#include <linux/types.h>
   49.14 +#include <linux/mm.h>
   49.15 +#include <linux/string.h>
   49.16 +#include <linux/pci.h>
   49.17 +#include <asm/io.h>
   49.18 +
   49.19 +void *dma_alloc_coherent(struct device *dev, size_t size,
   49.20 +			   dma_addr_t *dma_handle, int gfp)
   49.21 +{
   49.22 +	void *ret;
   49.23 +	unsigned int order = get_order(size);
   49.24 +	unsigned long vstart;
   49.25 +
   49.26 +	/* ignore region specifiers */
   49.27 +	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
   49.28 +
   49.29 +	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
   49.30 +		gfp |= GFP_DMA;
   49.31 +
   49.32 +	ret = (void *)vstart = __get_free_pages(gfp, order);
   49.33 +	if (ret == NULL)
   49.34 +		return ret;
   49.35 +
   49.36 +	/*
   49.37 +	 * Ensure multi-page extents are contiguous in machine memory.
   49.38 +	 * This code could be cleaned up some, and the number of
   49.39 +	 * hypercalls reduced.
   49.40 +	 */
   49.41 +	if (size > PAGE_SIZE) {
   49.42 +		pgd_t         *pgd; 
   49.43 +		pmd_t         *pmd;
   49.44 +		pte_t         *pte;
   49.45 +		unsigned long  pfn, i;
   49.46 +		/* 1. Zap current PTEs, giving away the underlying pages. */
   49.47 +		for (i = 0; i < (1<<order); i++) {
   49.48 +			pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   49.49 +			pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
   49.50 +			pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
   49.51 +			pfn = pte->pte_low >> PAGE_SHIFT;
   49.52 +			queue_l1_entry_update(pte, 0);
   49.53 +			flush_page_update_queue();
   49.54 +			if (HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
   49.55 +						  &pfn, 1, 0) != 1) BUG();
   49.56 +		}
   49.57 +		/* 2. Get a new contiguous memory extent. */
   49.58 +		if (HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
   49.59 +					  &pfn, 1, order) != 1) BUG();
   49.60 +		/* 3. Map the new extent in place of old pages. */
   49.61 +		for (i = 0; i < (1<<order); i++) {
   49.62 +			pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   49.63 +			pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
   49.64 +			pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
   49.65 +			queue_l1_entry_update(
   49.66 +				pte, ((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL);
   49.67 +			queue_machphys_update(
   49.68 +				pfn+i, (__pa(ret)>>PAGE_SHIFT)+i);
   49.69 +			phys_to_machine_mapping[(__pa(ret)>>PAGE_SHIFT)+i] =
   49.70 +				pfn+i;
   49.71 +                        flush_page_update_queue();
   49.72 +		}
   49.73 +		flush_page_update_queue();
   49.74 +	}
   49.75 +
   49.76 +	memset(ret, 0, size);
   49.77 +	*dma_handle = virt_to_bus(ret);
   49.78 +
   49.79 +	return ret;
   49.80 +}
   49.81 +
   49.82 +void dma_free_coherent(struct device *dev, size_t size,
   49.83 +			 void *vaddr, dma_addr_t dma_handle)
   49.84 +{
   49.85 +	free_pages((unsigned long)vaddr, get_order(size));
   49.86 +}
    50.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Jul 23 14:11:01 2004 +0000
    50.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Aug 03 12:28:49 2004 +0000
    50.3 @@ -48,7 +48,7 @@
    50.4  #include <asm/io_apic.h>
    50.5  #include <asm/ist.h>
    50.6  #include <asm/std_resources.h>
    50.7 -#include <asm/hypervisor.h>
    50.8 +#include <asm-xen/hypervisor.h>
    50.9  #include "setup_arch_pre.h"
   50.10  
   50.11  int disable_pse __initdata = 0;
   50.12 @@ -1126,6 +1126,16 @@ void __init setup_arch(char **cmdline_p)
   50.13  	}
   50.14  	aux_device_present = AUX_DEVICE_INFO;
   50.15  
   50.16 +#ifdef CONFIG_XEN_PHYSDEV_ACCESS
   50.17 +	/* This is drawn from a dump from vgacon:startup in standard Linux. */
   50.18 +	screen_info.orig_video_mode = 3; 
   50.19 +	screen_info.orig_video_isVGA = 1;
   50.20 +	screen_info.orig_video_lines = 25;
   50.21 +	screen_info.orig_video_cols = 80;
   50.22 +	screen_info.orig_video_ega_bx = 3;
   50.23 +	screen_info.orig_video_points = 16;
   50.24 +#endif
   50.25 +
   50.26  #ifdef CONFIG_BLK_DEV_RAM
   50.27  	rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
   50.28  	rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
    51.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c	Fri Jul 23 14:11:01 2004 +0000
    51.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c	Tue Aug 03 12:28:49 2004 +0000
    51.3 @@ -88,6 +88,7 @@ EXPORT_SYMBOL(i8253_lock);
    51.4  struct timer_opts *cur_timer = &timer_none;
    51.5  
    51.6  extern u64 shadow_system_time;
    51.7 +extern u32 shadow_time_delta_usecs;
    51.8  extern void __get_time_values_from_xen(void);
    51.9  
   51.10  /* Keep track of last time we did processing/updating of jiffies and xtime. */
   51.11 @@ -300,7 +301,9 @@ irqreturn_t timer_interrupt(int irq, voi
   51.12  
   51.13  	__get_time_values_from_xen();
   51.14  
   51.15 -	delta = (s64)(shadow_system_time - processed_system_time);
   51.16 +	shadow_time_delta_usecs = cur_timer->get_offset() * NSEC_PER_USEC;
   51.17 +	delta = (s64)(shadow_system_time + shadow_time_delta_usecs -
   51.18 +		      processed_system_time);
   51.19  	if (delta < 0) {
   51.20  		printk("Timer ISR: Time went backwards: %lld\n", delta);
   51.21  		goto out;
    52.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Fri Jul 23 14:11:01 2004 +0000
    52.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Tue Aug 03 12:28:49 2004 +0000
    52.3 @@ -85,6 +85,7 @@ static u32 shadow_tsc_stamp;
    52.4  u64 shadow_system_time;
    52.5  static u32 shadow_time_version;
    52.6  static struct timeval shadow_tv;
    52.7 +u32 shadow_time_delta_usecs;
    52.8  static unsigned int rdtsc_bitshift;
    52.9  extern u64 processed_system_time;
   52.10  
   52.11 @@ -192,7 +193,8 @@ static void mark_offset_tsc(void)
   52.12  
   52.13  	write_seqlock(&monotonic_lock);
   52.14  
   52.15 -	delta = (s64)(shadow_system_time - processed_system_time);
   52.16 +	delta = (s64)(shadow_system_time + shadow_time_delta_usecs -
   52.17 +		      processed_system_time);
   52.18  
   52.19  	/* Process elapsed jiffies since last call. */
   52.20  	while (delta >= NS_PER_TICK) {
    53.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/Makefile	Fri Jul 23 14:11:01 2004 +0000
    53.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/Makefile	Tue Aug 03 12:28:49 2004 +0000
    53.3 @@ -6,8 +6,8 @@ XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
    53.4  
    53.5  CFLAGS	+= -Iarch/$(XENARCH)/mm
    53.6  
    53.7 -obj-y	:= init.o fault.o pgtable.o hypervisor.o
    53.8 -c-obj-y	:= ioremap.o extable.o pageattr.o 
    53.9 +obj-y	:= init.o fault.o ioremap.o pgtable.o hypervisor.o
   53.10 +c-obj-y	:= extable.o pageattr.o 
   53.11  
   53.12  c-obj-$(CONFIG_DISCONTIGMEM)	+= discontig.o
   53.13  c-obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
    54.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Jul 23 14:11:01 2004 +0000
    54.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Aug 03 12:28:49 2004 +0000
    54.3 @@ -1,16 +1,18 @@
    54.4  /******************************************************************************
    54.5 - * xen/i386/mm/hypervisor.c
    54.6 + * mm/hypervisor.c
    54.7   * 
    54.8   * Update page tables via the hypervisor.
    54.9   * 
   54.10 - * Copyright (c) 2002, K A Fraser
   54.11 + * Copyright (c) 2002-2004, K A Fraser
   54.12   */
   54.13  
   54.14  #include <linux/config.h>
   54.15  #include <linux/sched.h>
   54.16 -#include <asm/hypervisor.h>
   54.17 +#include <linux/mm.h>
   54.18 +#include <linux/vmalloc.h>
   54.19  #include <asm/page.h>
   54.20  #include <asm/pgtable.h>
   54.21 +#include <asm-xen/hypervisor.h>
   54.22  #include <asm-xen/multicall.h>
   54.23  
   54.24  /*
   54.25 @@ -21,11 +23,14 @@
   54.26   */
   54.27  static spinlock_t update_lock = SPIN_LOCK_UNLOCKED;
   54.28  
   54.29 -#if 0
   54.30 +/* Linux 2.6 isn't using the traditional batched interface. */
   54.31 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
   54.32  #define QUEUE_SIZE 2048
   54.33 +#define pte_offset_kernel pte_offset
   54.34  #else
   54.35  #define QUEUE_SIZE 1
   54.36  #endif
   54.37 +
   54.38  static mmu_update_t update_queue[QUEUE_SIZE];
   54.39  unsigned int mmu_update_queue_idx = 0;
   54.40  #define idx mmu_update_queue_idx
   54.41 @@ -126,8 +131,11 @@ static inline void __flush_page_update_q
   54.42  #endif
   54.43      idx = 0;
   54.44      wmb(); /* Make sure index is cleared first to avoid double updates. */
   54.45 -    if (unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0))
   54.46 -	panic("Failed to execute MMU updates");
   54.47 +    if ( unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0) )
   54.48 +    {
   54.49 +        printk(KERN_ALERT "Failed to execute MMU updates.\n");
   54.50 +        BUG();
   54.51 +    }
   54.52  }
   54.53  
   54.54  void _flush_page_update_queue(void)
   54.55 @@ -262,3 +270,91 @@ void queue_machphys_update(unsigned long
   54.56      increment_index();
   54.57      spin_unlock_irqrestore(&update_lock, flags);
   54.58  }
   54.59 +
   54.60 +#ifdef CONFIG_XEN_PHYSDEV_ACCESS
   54.61 +
   54.62 +unsigned long allocate_empty_lowmem_region(unsigned long pages)
   54.63 +{
   54.64 +    pgd_t         *pgd; 
   54.65 +    pmd_t         *pmd;
   54.66 +    pte_t         *pte;
   54.67 +    unsigned long *pfn_array;
   54.68 +    unsigned long  vstart;
   54.69 +    unsigned long  i;
   54.70 +    int            ret;
   54.71 +    unsigned int   order = get_order(pages*PAGE_SIZE);
   54.72 +
   54.73 +    vstart = __get_free_pages(GFP_KERNEL, order);
   54.74 +    if ( vstart == 0 )
   54.75 +        return 0UL;
   54.76 +
   54.77 +    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
   54.78 +    if ( pfn_array == NULL )
   54.79 +        BUG();
   54.80 +
   54.81 +    for ( i = 0; i < (1<<order); i++ )
   54.82 +    {
   54.83 +        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   54.84 +        pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
   54.85 +        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); 
   54.86 +        pfn_array[i] = pte->pte_low >> PAGE_SHIFT;
   54.87 +        queue_l1_entry_update(pte, 0);
   54.88 +        phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = 0xdeadbeef;
   54.89 +    }
   54.90 +
   54.91 +    flush_page_update_queue();
   54.92 +
   54.93 +    ret = HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
   54.94 +                                pfn_array, 1<<order, 0);
   54.95 +    if ( unlikely(ret != (1<<order)) )
   54.96 +    {
   54.97 +        printk(KERN_WARNING "Unable to reduce memory reservation (%d)\n", ret);
   54.98 +        BUG();
   54.99 +    }
  54.100 +
  54.101 +    vfree(pfn_array);
  54.102 +
  54.103 +    return vstart;
  54.104 +}
  54.105 +
  54.106 +void deallocate_lowmem_region(unsigned long vstart, unsigned long pages)
  54.107 +{
  54.108 +    pgd_t         *pgd; 
  54.109 +    pmd_t         *pmd;
  54.110 +    pte_t         *pte;
  54.111 +    unsigned long *pfn_array;
  54.112 +    unsigned long  i;
  54.113 +    int            ret;
  54.114 +    unsigned int   order = get_order(pages*PAGE_SIZE);
  54.115 +
  54.116 +    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
  54.117 +    if ( pfn_array == NULL )
  54.118 +        BUG();
  54.119 +
  54.120 +    ret = HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
  54.121 +                                pfn_array, 1<<order, 0);
  54.122 +    if ( unlikely(ret != (1<<order)) )
  54.123 +    {
  54.124 +        printk(KERN_WARNING "Unable to increase memory reservation (%d)\n",
  54.125 +               ret);
  54.126 +        BUG();
  54.127 +    }
  54.128 +
  54.129 +    for ( i = 0; i < (1<<order); i++ )
  54.130 +    {
  54.131 +        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
  54.132 +        pmd = pmd_offset(pgd, (vstart + (i*PAGE_SIZE)));
  54.133 +        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  54.134 +        queue_l1_entry_update(pte, (pfn_array[i]<<PAGE_SHIFT)|__PAGE_KERNEL);
  54.135 +        queue_machphys_update(pfn_array[i], __pa(vstart)>>PAGE_SHIFT);
  54.136 +        phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = pfn_array[i];
  54.137 +    }
  54.138 +
  54.139 +    flush_page_update_queue();
  54.140 +
  54.141 +    vfree(pfn_array);
  54.142 +
  54.143 +    free_pages(vstart, order);
  54.144 +}
  54.145 +
  54.146 +#endif /* CONFIG_XEN_PHYSDEV_ACCESS */
    55.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Fri Jul 23 14:11:01 2004 +0000
    55.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Tue Aug 03 12:28:49 2004 +0000
    55.3 @@ -40,7 +40,7 @@
    55.4  #include <asm/tlb.h>
    55.5  #include <asm/tlbflush.h>
    55.6  #include <asm/sections.h>
    55.7 -#include <asm/hypervisor.h>
    55.8 +#include <asm-xen/hypervisor.h>
    55.9  
   55.10  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
   55.11  unsigned long highstart_pfn, highend_pfn;
   55.12 @@ -458,6 +458,10 @@ extern void zone_sizes_init(void);
   55.13   */
   55.14  void __init paging_init(void)
   55.15  {
   55.16 +#ifdef CONFIG_XEN_PHYSDEV_ACCESS
   55.17 +	int i;
   55.18 +#endif
   55.19 +
   55.20  	pagetable_init();
   55.21  
   55.22  	wrprotect_bootpt((pgd_t *)start_info.pt_base, swapper_pg_dir, 1);
   55.23 @@ -494,6 +498,12 @@ void __init paging_init(void)
   55.24  	set_fixmap_ma(FIX_SHARED_INFO, start_info.shared_info);
   55.25  	HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
   55.26  	memset(empty_zero_page, 0, sizeof(empty_zero_page));
   55.27 +
   55.28 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
   55.29 +	/* Setup mapping of lower 1st MB */
   55.30 +	for (i = 0; i < NR_FIX_ISAMAPS; i++)
   55.31 +		set_fixmap_ma(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
   55.32 +#endif
   55.33  }
   55.34  
   55.35  /*
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/ioremap.c	Tue Aug 03 12:28:49 2004 +0000
    56.3 @@ -0,0 +1,475 @@
    56.4 +/*
    56.5 + * arch/i386/mm/ioremap.c
    56.6 + *
    56.7 + * Re-map IO memory to kernel address space so that we can access it.
    56.8 + * This is needed for high PCI addresses that aren't mapped in the
    56.9 + * 640k-1MB IO memory area on PC's
   56.10 + *
   56.11 + * (C) Copyright 1995 1996 Linus Torvalds
   56.12 + */
   56.13 +
   56.14 +#include <linux/vmalloc.h>
   56.15 +#include <linux/init.h>
   56.16 +#include <linux/slab.h>
   56.17 +#include <asm/io.h>
   56.18 +#include <asm/pgalloc.h>
   56.19 +#include <asm/fixmap.h>
   56.20 +#include <asm/cacheflush.h>
   56.21 +#include <asm/tlbflush.h>
   56.22 +#include <asm/pgtable.h>
   56.23 +
   56.24 +static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
   56.25 +	unsigned long phys_addr, unsigned long flags)
   56.26 +{
   56.27 +	unsigned long end;
   56.28 +	unsigned long pfn;
   56.29 +
   56.30 +	address &= ~PMD_MASK;
   56.31 +	end = address + size;
   56.32 +	if (end > PMD_SIZE)
   56.33 +		end = PMD_SIZE;
   56.34 +	if (address >= end)
   56.35 +		BUG();
   56.36 +	pfn = phys_addr >> PAGE_SHIFT;
   56.37 +	do {
   56.38 +		if (!pte_none(*pte)) {
   56.39 +			printk("remap_area_pte: page already exists\n");
   56.40 +			BUG();
   56.41 +		}
   56.42 +		set_pte(pte, pfn_pte_ma(pfn, __pgprot(_PAGE_PRESENT | _PAGE_RW | 
   56.43 +					_PAGE_DIRTY | _PAGE_ACCESSED | flags)));
   56.44 +		address += PAGE_SIZE;
   56.45 +		pfn++;
   56.46 +		pte++;
   56.47 +	} while (address && (address < end));
   56.48 +}
   56.49 +
   56.50 +static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
   56.51 +	unsigned long phys_addr, unsigned long flags)
   56.52 +{
   56.53 +	unsigned long end;
   56.54 +
   56.55 +	address &= ~PGDIR_MASK;
   56.56 +	end = address + size;
   56.57 +	if (end > PGDIR_SIZE)
   56.58 +		end = PGDIR_SIZE;
   56.59 +	phys_addr -= address;
   56.60 +	if (address >= end)
   56.61 +		BUG();
   56.62 +	do {
   56.63 +		pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
   56.64 +		if (!pte)
   56.65 +			return -ENOMEM;
   56.66 +		remap_area_pte(pte, address, end - address, address + phys_addr, flags);
   56.67 +		address = (address + PMD_SIZE) & PMD_MASK;
   56.68 +		pmd++;
   56.69 +	} while (address && (address < end));
   56.70 +	return 0;
   56.71 +}
   56.72 +
   56.73 +static int remap_area_pages(unsigned long address, unsigned long phys_addr,
   56.74 +				 unsigned long size, unsigned long flags)
   56.75 +{
   56.76 +	int error;
   56.77 +	pgd_t * dir;
   56.78 +	unsigned long end = address + size;
   56.79 +
   56.80 +	phys_addr -= address;
   56.81 +	dir = pgd_offset(&init_mm, address);
   56.82 +	flush_cache_all();
   56.83 +	if (address >= end)
   56.84 +		BUG();
   56.85 +	spin_lock(&init_mm.page_table_lock);
   56.86 +	do {
   56.87 +		pmd_t *pmd;
   56.88 +		pmd = pmd_alloc(&init_mm, dir, address);
   56.89 +		error = -ENOMEM;
   56.90 +		if (!pmd)
   56.91 +			break;
   56.92 +		if (remap_area_pmd(pmd, address, end - address,
   56.93 +					 phys_addr + address, flags))
   56.94 +			break;
   56.95 +		error = 0;
   56.96 +		address = (address + PGDIR_SIZE) & PGDIR_MASK;
   56.97 +		dir++;
   56.98 +	} while (address && (address < end));
   56.99 +	spin_unlock(&init_mm.page_table_lock);
  56.100 +	flush_tlb_all();
  56.101 +	return error;
  56.102 +}
  56.103 +
  56.104 +/*
  56.105 + * Generic mapping function (not visible outside):
  56.106 + */
  56.107 +
  56.108 +/*
  56.109 + * Remap an arbitrary physical address space into the kernel virtual
  56.110 + * address space. Needed when the kernel wants to access high addresses
  56.111 + * directly.
  56.112 + *
  56.113 + * NOTE! We need to allow non-page-aligned mappings too: we will obviously
  56.114 + * have to convert them into an offset in a page-aligned mapping, but the
  56.115 + * caller shouldn't need to know that small detail.
  56.116 + */
  56.117 +void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
  56.118 +{
  56.119 +	void * addr;
  56.120 +	struct vm_struct * area;
  56.121 +	unsigned long offset, last_addr;
  56.122 +
  56.123 +	/* Don't allow wraparound or zero size */
  56.124 +	last_addr = phys_addr + size - 1;
  56.125 +	if (!size || last_addr < phys_addr)
  56.126 +		return NULL;
  56.127 +
  56.128 +        if (phys_addr >= 0x0 && last_addr < 0x100000)
  56.129 +                return isa_bus_to_virt(phys_addr);
  56.130 +
  56.131 +	/*
  56.132 +	 * Don't remap the low PCI/ISA area, it's always mapped..
  56.133 +	 */
  56.134 +	if (phys_addr >= 0xA0000 && last_addr < 0x100000)
  56.135 +		return phys_to_virt(phys_addr);
  56.136 +
  56.137 +	/*
  56.138 +	 * Don't allow anybody to remap normal RAM that we're using..
  56.139 +	 */
  56.140 +	if (phys_addr < virt_to_phys(high_memory)) {
  56.141 +		char *t_addr, *t_end;
  56.142 +		struct page *page;
  56.143 +
  56.144 +		t_addr = __va(phys_addr);
  56.145 +		t_end = t_addr + (size - 1);
  56.146 +	   
  56.147 +		for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
  56.148 +			if(!PageReserved(page))
  56.149 +				return NULL;
  56.150 +	}
  56.151 +
  56.152 +	/*
  56.153 +	 * Mappings have to be page-aligned
  56.154 +	 */
  56.155 +	offset = phys_addr & ~PAGE_MASK;
  56.156 +	phys_addr &= PAGE_MASK;
  56.157 +	size = PAGE_ALIGN(last_addr+1) - phys_addr;
  56.158 +
  56.159 +	/*
  56.160 +	 * Ok, go for it..
  56.161 +	 */
  56.162 +	area = get_vm_area(size, VM_IOREMAP);
  56.163 +	if (!area)
  56.164 +		return NULL;
  56.165 +	area->phys_addr = phys_addr;
  56.166 +	addr = area->addr;
  56.167 +	if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
  56.168 +		vunmap(addr);
  56.169 +		return NULL;
  56.170 +	}
  56.171 +	return (void *) (offset + (char *)addr);
  56.172 +}
  56.173 +
  56.174 +
  56.175 +/**
  56.176 + * ioremap_nocache     -   map bus memory into CPU space
  56.177 + * @offset:    bus address of the memory
  56.178 + * @size:      size of the resource to map
  56.179 + *
  56.180 + * ioremap_nocache performs a platform specific sequence of operations to
  56.181 + * make bus memory CPU accessible via the readb/readw/readl/writeb/
  56.182 + * writew/writel functions and the other mmio helpers. The returned
  56.183 + * address is not guaranteed to be usable directly as a virtual
  56.184 + * address. 
  56.185 + *
  56.186 + * This version of ioremap ensures that the memory is marked uncachable
  56.187 + * on the CPU as well as honouring existing caching rules from things like
  56.188 + * the PCI bus. Note that there are other caches and buffers on many 
  56.189 + * busses. In particular driver authors should read up on PCI writes
  56.190 + *
  56.191 + * It's useful if some control registers are in such an area and
  56.192 + * write combining or read caching is not desirable:
  56.193 + * 
  56.194 + * Must be freed with iounmap.
  56.195 + */
  56.196 +
  56.197 +void *ioremap_nocache (unsigned long phys_addr, unsigned long size)
  56.198 +{
  56.199 +	unsigned long last_addr;
  56.200 +	void *p = __ioremap(phys_addr, size, _PAGE_PCD);
  56.201 +	if (!p) 
  56.202 +		return p; 
  56.203 +
  56.204 +	/* Guaranteed to be > phys_addr, as per __ioremap() */
  56.205 +	last_addr = phys_addr + size - 1;
  56.206 +
  56.207 +	if (last_addr < virt_to_phys(high_memory)) { 
  56.208 +		struct page *ppage = virt_to_page(__va(phys_addr));		
  56.209 +		unsigned long npages;
  56.210 +
  56.211 +		phys_addr &= PAGE_MASK;
  56.212 +
  56.213 +		/* This might overflow and become zero.. */
  56.214 +		last_addr = PAGE_ALIGN(last_addr);
  56.215 +
  56.216 +		/* .. but that's ok, because modulo-2**n arithmetic will make
  56.217 +	 	* the page-aligned "last - first" come out right.
  56.218 +	 	*/
  56.219 +		npages = (last_addr - phys_addr) >> PAGE_SHIFT;
  56.220 +
  56.221 +		if (change_page_attr(ppage, npages, PAGE_KERNEL_NOCACHE) < 0) { 
  56.222 +			iounmap(p); 
  56.223 +			p = NULL;
  56.224 +		}
  56.225 +		global_flush_tlb();
  56.226 +	}
  56.227 +
  56.228 +	return p;					
  56.229 +}
  56.230 +
  56.231 +void iounmap(void *addr)
  56.232 +{
  56.233 +	struct vm_struct *p;
  56.234 +        if ((unsigned long)addr <= 0x100000)
  56.235 +                return;
  56.236 +	if (addr <= high_memory) 
  56.237 +		return; 
  56.238 +	p = remove_vm_area((void *) (PAGE_MASK & (unsigned long) addr));
  56.239 +	if (!p) { 
  56.240 +		printk("__iounmap: bad address %p\n", addr);
  56.241 +		return;
  56.242 +	} 
  56.243 +
  56.244 +	if (p->flags && p->phys_addr < virt_to_phys(high_memory)) { 
  56.245 +		change_page_attr(virt_to_page(__va(p->phys_addr)),
  56.246 +				 p->size >> PAGE_SHIFT,
  56.247 +				 PAGE_KERNEL); 				 
  56.248 +		global_flush_tlb();
  56.249 +	} 
  56.250 +	kfree(p); 
  56.251 +}
  56.252 +
  56.253 +void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
  56.254 +{
  56.255 +	unsigned long offset, last_addr;
  56.256 +	unsigned int nrpages;
  56.257 +	enum fixed_addresses idx;
  56.258 +
  56.259 +	/* Don't allow wraparound or zero size */
  56.260 +	last_addr = phys_addr + size - 1;
  56.261 +	if (!size || last_addr < phys_addr)
  56.262 +		return NULL;
  56.263 +
  56.264 +        if (phys_addr >= 0x0 && last_addr < 0x100000)
  56.265 +                return isa_bus_to_virt(phys_addr);
  56.266 +
  56.267 +	/*
  56.268 +	 * Don't remap the low PCI/ISA area, it's always mapped..
  56.269 +	 */
  56.270 +	if (phys_addr >= 0xA0000 && last_addr < 0x100000)
  56.271 +		return phys_to_virt(phys_addr);
  56.272 +
  56.273 +	/*
  56.274 +	 * Mappings have to be page-aligned
  56.275 +	 */
  56.276 +	offset = phys_addr & ~PAGE_MASK;
  56.277 +	phys_addr &= PAGE_MASK;
  56.278 +	size = PAGE_ALIGN(last_addr) - phys_addr;
  56.279 +
  56.280 +	/*
  56.281 +	 * Mappings have to fit in the FIX_BTMAP area.
  56.282 +	 */
  56.283 +	nrpages = size >> PAGE_SHIFT;
  56.284 +	if (nrpages > NR_FIX_BTMAPS)
  56.285 +		return NULL;
  56.286 +
  56.287 +	/*
  56.288 +	 * Ok, go for it..
  56.289 +	 */
  56.290 +	idx = FIX_BTMAP_BEGIN;
  56.291 +	while (nrpages > 0) {
  56.292 +		set_fixmap_ma(idx, phys_addr);
  56.293 +		phys_addr += PAGE_SIZE;
  56.294 +		--idx;
  56.295 +		--nrpages;
  56.296 +	}
  56.297 +	return (void*) (offset + fix_to_virt(FIX_BTMAP_BEGIN));
  56.298 +}
  56.299 +
  56.300 +void __init bt_iounmap(void *addr, unsigned long size)
  56.301 +{
  56.302 +	unsigned long virt_addr;
  56.303 +	unsigned long offset;
  56.304 +	unsigned int nrpages;
  56.305 +	enum fixed_addresses idx;
  56.306 +
  56.307 +	virt_addr = (unsigned long)addr;
  56.308 +        if (virt_addr < 0x100000)
  56.309 +                return;
  56.310 +	if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))
  56.311 +		return;
  56.312 +	offset = virt_addr & ~PAGE_MASK;
  56.313 +	nrpages = PAGE_ALIGN(offset + size - 1) >> PAGE_SHIFT;
  56.314 +
  56.315 +	idx = FIX_BTMAP_BEGIN;
  56.316 +	while (nrpages > 0) {
  56.317 +		clear_fixmap(idx);
  56.318 +		--idx;
  56.319 +		--nrpages;
  56.320 +	}
  56.321 +}
  56.322 +
  56.323 +
  56.324 +#if defined(CONFIG_XEN_PRIVILEGED_GUEST)
  56.325 +
  56.326 +/* These hacky macros avoid phys->machine translations. */
  56.327 +#define __direct_pte(x) ((pte_t) { (x) } )
  56.328 +#define __direct_mk_pte(page_nr,pgprot) \
  56.329 +  __direct_pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
  56.330 +#define direct_mk_pte_phys(physpage, pgprot) \
  56.331 +  __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot)
  56.332 +
  56.333 +static inline void direct_remap_area_pte(pte_t *pte, 
  56.334 +                                        unsigned long address, 
  56.335 +                                        unsigned long size,
  56.336 +					mmu_update_t **v)
  56.337 +{
  56.338 +    unsigned long end;
  56.339 +
  56.340 +    address &= ~PMD_MASK;
  56.341 +    end = address + size;
  56.342 +    if (end > PMD_SIZE)
  56.343 +        end = PMD_SIZE;
  56.344 +    if (address >= end)
  56.345 +        BUG();
  56.346 +
  56.347 +    do {
  56.348 +        (*v)->ptr = virt_to_machine(pte);
  56.349 +        (*v)++;
  56.350 +        address += PAGE_SIZE;
  56.351 +        pte++;
  56.352 +    } while (address && (address < end));
  56.353 +}
  56.354 +
  56.355 +static inline int direct_remap_area_pmd(struct mm_struct *mm,
  56.356 +                                        pmd_t *pmd, 
  56.357 +                                        unsigned long address, 
  56.358 +                                        unsigned long size,
  56.359 +					mmu_update_t **v)
  56.360 +{
  56.361 +    unsigned long end;
  56.362 +
  56.363 +    address &= ~PGDIR_MASK;
  56.364 +    end = address + size;
  56.365 +    if (end > PGDIR_SIZE)
  56.366 +        end = PGDIR_SIZE;
  56.367 +    if (address >= end)
  56.368 +        BUG();
  56.369 +    do {
  56.370 +        pte_t *pte = pte_alloc_kernel(mm, pmd, address);
  56.371 +        if (!pte)
  56.372 +            return -ENOMEM;
  56.373 +        direct_remap_area_pte(pte, address, end - address, v);
  56.374 +
  56.375 +        address = (address + PMD_SIZE) & PMD_MASK;
  56.376 +        pmd++;
  56.377 +    } while (address && (address < end));
  56.378 +    return 0;
  56.379 +}
  56.380 + 
  56.381 +int __direct_remap_area_pages(struct mm_struct *mm,
  56.382 +			      unsigned long address, 
  56.383 +			      unsigned long size, 
  56.384 +			      mmu_update_t *v)
  56.385 +{
  56.386 +    pgd_t * dir;
  56.387 +    unsigned long end = address + size;
  56.388 +
  56.389 +    dir = pgd_offset(mm, address);
  56.390 +    flush_cache_all();
  56.391 +    if (address >= end)
  56.392 +        BUG();
  56.393 +    spin_lock(&mm->page_table_lock);
  56.394 +    do {
  56.395 +        pmd_t *pmd = pmd_alloc(mm, dir, address);
  56.396 +        if (!pmd)
  56.397 +	    return -ENOMEM;
  56.398 +        direct_remap_area_pmd(mm, pmd, address, end - address, &v);
  56.399 +        address = (address + PGDIR_SIZE) & PGDIR_MASK;
  56.400 +        dir++;
  56.401 +
  56.402 +    } while (address && (address < end));
  56.403 +    spin_unlock(&mm->page_table_lock);
  56.404 +    flush_tlb_all();
  56.405 +    return 0;
  56.406 +}
  56.407 +
  56.408 +
  56.409 +int direct_remap_area_pages(struct mm_struct *mm,
  56.410 +                            unsigned long address, 
  56.411 +                            unsigned long machine_addr,
  56.412 +                            unsigned long size, 
  56.413 +                            pgprot_t prot,
  56.414 +                            domid_t  domid)
  56.415 +{
  56.416 +    int i;
  56.417 +    unsigned long start_address;
  56.418 +#define MAX_DIRECTMAP_MMU_QUEUE 130
  56.419 +    mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v;
  56.420 +
  56.421 +    if ( domid != 0 )
  56.422 +    {
  56.423 +        u[0].val  = (unsigned long)(domid<<16) & ~0xFFFFUL;
  56.424 +        u[0].ptr  = (unsigned long)(domid<< 0) & ~0xFFFFUL;
  56.425 +        u[0].ptr |= MMU_EXTENDED_COMMAND;
  56.426 +        u[0].val |= MMUEXT_SET_SUBJECTDOM;
  56.427 +        v = w = &u[1];
  56.428 +    }
  56.429 +    else
  56.430 +    {
  56.431 +        v = w = &u[0];
  56.432 +    }
  56.433 +
  56.434 +    start_address = address;
  56.435 +
  56.436 +    for( i = 0; i < size; i += PAGE_SIZE )
  56.437 +    {
  56.438 +	if ( (v - u) == MAX_DIRECTMAP_MMU_QUEUE )
  56.439 +	{
  56.440 +	    /* Fill in the PTE pointers. */
  56.441 +	    __direct_remap_area_pages( mm,
  56.442 +				       start_address, 
  56.443 +				       address-start_address, 
  56.444 +				       w);
  56.445 +	    
  56.446 +	    if ( HYPERVISOR_mmu_update(u, v - u, NULL) < 0 )
  56.447 +		return -EFAULT;	    
  56.448 +	    v = w;
  56.449 +	    start_address = address;
  56.450 +	}
  56.451 +
  56.452 +	/*
  56.453 +         * Fill in the machine address: PTE ptr is done later by
  56.454 +         * __direct_remap_area_pages(). 
  56.455 +         */
  56.456 +        v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot);
  56.457 +
  56.458 +        machine_addr += PAGE_SIZE;
  56.459 +        address += PAGE_SIZE; 
  56.460 +        v++;
  56.461 +    }
  56.462 +
  56.463 +    if ( v != w )
  56.464 +    {
  56.465 +	/* get the ptep's filled in */
  56.466 +	__direct_remap_area_pages(mm,
  56.467 +                                  start_address, 
  56.468 +                                  address-start_address, 
  56.469 +                                  w);	 
  56.470 +	if ( unlikely(HYPERVISOR_mmu_update(u, v - u, NULL) < 0) )
  56.471 +	    return -EFAULT;	    
  56.472 +    }
  56.473 +    
  56.474 +    return 0;
  56.475 +}
  56.476 +
  56.477 +
  56.478 +#endif /* CONFIG_XEN_PRIVILEGED_GUEST */
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/pci/Makefile	Tue Aug 03 12:28:49 2004 +0000
    57.3 @@ -0,0 +1,31 @@
    57.4 +XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
    57.5 +
    57.6 +CFLAGS	+= -Iarch/$(XENARCH)/pci
    57.7 +
    57.8 +c-obj-y				:= i386.o
    57.9 +
   57.10 +c-obj-$(CONFIG_PCI_BIOS)		+= pcbios.o
   57.11 +c-obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig.o
   57.12 +obj-$(CONFIG_PCI_DIRECT)	+= direct.o
   57.13 +
   57.14 +c-pci-y				:= fixup.o
   57.15 +c-pci-$(CONFIG_ACPI_PCI)	+= acpi.o
   57.16 +c-pci-y				+= legacy.o
   57.17 +pci-y				+= irq.o
   57.18 +
   57.19 +c-pci-$(CONFIG_X86_VISWS)	:= visws.o fixup.o
   57.20 +pci-$(CONFIG_X86_VISWS)		:=
   57.21 +c-pci-$(CONFIG_X86_NUMAQ)	:= numa.o
   57.22 +pci-$(CONFIG_X86_NUMAQ)		:= irq.o
   57.23 +
   57.24 +obj-y				+= $(pci-y)
   57.25 +c-obj-y				+= $(c-pci-y) common.o
   57.26 +
   57.27 +c-link	:=
   57.28 +
   57.29 +$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
   57.30 +	@ln -fsn $(srctree)/arch/i386/pci/$(notdir $@) $@
   57.31 +
   57.32 +obj-y	+= $(c-obj-y)
   57.33 +
   57.34 +clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/pci/direct.c	Tue Aug 03 12:28:49 2004 +0000
    58.3 @@ -0,0 +1,83 @@
    58.4 +/*
    58.5 + * direct.c - Low-level direct PCI config space access
    58.6 + */
    58.7 +
    58.8 +#include <linux/pci.h>
    58.9 +#include <linux/init.h>
   58.10 +#include "pci.h"
   58.11 +
   58.12 +#include <asm/hypervisor-ifs/hypervisor-if.h>
   58.13 +#include <asm/hypervisor-ifs/physdev.h>
   58.14 +
   58.15 +/*
   58.16 + * Functions for accessing PCI configuration space with type xen accesses
   58.17 + */
   58.18 +
   58.19 +static int pci_conf_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
   58.20 +{
   58.21 +	unsigned long flags;
   58.22 +	physdev_op_t op;
   58.23 +	int ret;
   58.24 +
   58.25 +	if (!value || (bus > 255) || (devfn > 255) || (reg > 255))
   58.26 +		return -EINVAL;
   58.27 +
   58.28 +	spin_lock_irqsave(&pci_config_lock, flags);
   58.29 +
   58.30 +	op.cmd = PHYSDEVOP_PCI_CFGREG_READ;
   58.31 +	op.u.pci_cfgreg_read.bus  = bus;
   58.32 +	op.u.pci_cfgreg_read.dev  = (devfn & ~0x7) >> 3;
   58.33 +	op.u.pci_cfgreg_read.func = devfn & 0x7;
   58.34 +	op.u.pci_cfgreg_read.reg  = reg;
   58.35 +	op.u.pci_cfgreg_read.len  = len;
   58.36 +
   58.37 +	ret = HYPERVISOR_physdev_op(&op);
   58.38 +	if (ret == 0)
   58.39 +		*value = op.u.pci_cfgreg_read.value;
   58.40 +
   58.41 +	spin_unlock_irqrestore(&pci_config_lock, flags);
   58.42 +
   58.43 +	return ret;
   58.44 +}
   58.45 +
   58.46 +static int pci_conf_write (int seg, int bus, int devfn, int reg, int len, u32 value)
   58.47 +{
   58.48 +	unsigned long flags;
   58.49 +	physdev_op_t op;
   58.50 +	int ret;
   58.51 +
   58.52 +	if ((bus > 255) || (devfn > 255) || (reg > 255)) 
   58.53 +		return -EINVAL;
   58.54 +
   58.55 +	spin_lock_irqsave(&pci_config_lock, flags);
   58.56 +
   58.57 +	op.cmd = PHYSDEVOP_PCI_CFGREG_WRITE;
   58.58 +	op.u.pci_cfgreg_write.bus   = bus;
   58.59 +	op.u.pci_cfgreg_write.dev   = (devfn & ~0x7) >> 3;
   58.60 +	op.u.pci_cfgreg_write.func  = devfn & 0x7;
   58.61 +	op.u.pci_cfgreg_write.reg   = reg;
   58.62 +	op.u.pci_cfgreg_write.len   = len;
   58.63 +	op.u.pci_cfgreg_write.value = value;
   58.64 +
   58.65 +	ret = HYPERVISOR_physdev_op(&op);
   58.66 +
   58.67 +	spin_unlock_irqrestore(&pci_config_lock, flags);
   58.68 +
   58.69 +	return ret;
   58.70 +}
   58.71 +
   58.72 +struct pci_raw_ops pci_direct_xen = {
   58.73 +	.read =		pci_conf_read,