ia64/xen-unstable

changeset 6797:b35215021b32

Merge with latest xen-unstable
author djm@kirby.fc.hp.com
date Tue Sep 13 10:14:16 2005 -0600 (2005-09-13)
parents d4d880fcef28 e7c7196fa329
children 5cd24dd33033
files .hgignore Config.mk Makefile buildconfigs/Rules.mk buildconfigs/mk.linux-2.6-xen buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU docs/Doxyfile docs/Doxyfilter docs/Makefile docs/misc/vtpm.txt docs/pythfilter.py docs/src/user.tex extras/mini-os/Makefile extras/mini-os/README extras/mini-os/domain_config extras/mini-os/events.c extras/mini-os/include/ctype.h extras/mini-os/include/err.h extras/mini-os/include/errno-base.h extras/mini-os/include/errno.h extras/mini-os/include/events.h extras/mini-os/include/fcntl.h extras/mini-os/include/hypervisor.h extras/mini-os/include/lib.h extras/mini-os/include/list.h extras/mini-os/include/mm.h extras/mini-os/include/os.h extras/mini-os/include/sched.h extras/mini-os/include/semaphore.h extras/mini-os/include/time.h extras/mini-os/include/traps.h extras/mini-os/include/types.h extras/mini-os/include/wait.h extras/mini-os/include/xenbus.h extras/mini-os/include/xmalloc.h extras/mini-os/kernel.c extras/mini-os/lib/printf.c extras/mini-os/lib/string.c extras/mini-os/lib/xmalloc.c extras/mini-os/mm.c extras/mini-os/sched.c extras/mini-os/time.c extras/mini-os/traps.c extras/mini-os/xenbus/Makefile extras/mini-os/xenbus/xenbus_comms.c extras/mini-os/xenbus/xenbus_comms.h extras/mini-os/xenbus/xenbus_xs.c linux-2.4-xen-sparse/Makefile linux-2.4-xen-sparse/arch/xen/Makefile linux-2.4-xen-sparse/arch/xen/boot/Makefile linux-2.4-xen-sparse/arch/xen/config.in linux-2.4-xen-sparse/arch/xen/defconfig-xen0 linux-2.4-xen-sparse/arch/xen/defconfig-xenU linux-2.4-xen-sparse/arch/xen/drivers/balloon/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/backend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/common.h linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c linux-2.4-xen-sparse/arch/xen/drivers/console/Makefile linux-2.4-xen-sparse/arch/xen/drivers/dom0/Makefile linux-2.4-xen-sparse/arch/xen/drivers/evtchn/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/backend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/frontend/Makefile linux-2.4-xen-sparse/arch/xen/kernel/Makefile linux-2.4-xen-sparse/arch/xen/kernel/entry.S linux-2.4-xen-sparse/arch/xen/kernel/head.S linux-2.4-xen-sparse/arch/xen/kernel/i386_ksyms.c linux-2.4-xen-sparse/arch/xen/kernel/irq.c linux-2.4-xen-sparse/arch/xen/kernel/ldt.c linux-2.4-xen-sparse/arch/xen/kernel/pci-pc.c linux-2.4-xen-sparse/arch/xen/kernel/process.c linux-2.4-xen-sparse/arch/xen/kernel/setup.c linux-2.4-xen-sparse/arch/xen/kernel/signal.c linux-2.4-xen-sparse/arch/xen/kernel/time.c linux-2.4-xen-sparse/arch/xen/kernel/traps.c linux-2.4-xen-sparse/arch/xen/lib/Makefile linux-2.4-xen-sparse/arch/xen/lib/delay.c linux-2.4-xen-sparse/arch/xen/mm/Makefile linux-2.4-xen-sparse/arch/xen/mm/fault.c linux-2.4-xen-sparse/arch/xen/mm/init.c linux-2.4-xen-sparse/arch/xen/mm/ioremap.c linux-2.4-xen-sparse/arch/xen/vmlinux.lds linux-2.4-xen-sparse/drivers/block/ll_rw_blk.c linux-2.4-xen-sparse/drivers/char/Makefile linux-2.4-xen-sparse/drivers/char/mem.c linux-2.4-xen-sparse/drivers/char/tty_io.c linux-2.4-xen-sparse/drivers/scsi/aic7xxx/Makefile linux-2.4-xen-sparse/include/asm-xen/bugs.h linux-2.4-xen-sparse/include/asm-xen/desc.h linux-2.4-xen-sparse/include/asm-xen/fixmap.h linux-2.4-xen-sparse/include/asm-xen/highmem.h linux-2.4-xen-sparse/include/asm-xen/hw_irq.h linux-2.4-xen-sparse/include/asm-xen/io.h linux-2.4-xen-sparse/include/asm-xen/irq.h linux-2.4-xen-sparse/include/asm-xen/keyboard.h linux-2.4-xen-sparse/include/asm-xen/mmu_context.h linux-2.4-xen-sparse/include/asm-xen/module.h linux-2.4-xen-sparse/include/asm-xen/page.h linux-2.4-xen-sparse/include/asm-xen/pci.h linux-2.4-xen-sparse/include/asm-xen/pgalloc.h linux-2.4-xen-sparse/include/asm-xen/pgtable-2level.h linux-2.4-xen-sparse/include/asm-xen/pgtable.h linux-2.4-xen-sparse/include/asm-xen/processor.h linux-2.4-xen-sparse/include/asm-xen/queues.h linux-2.4-xen-sparse/include/asm-xen/segment.h linux-2.4-xen-sparse/include/asm-xen/smp.h linux-2.4-xen-sparse/include/asm-xen/system.h linux-2.4-xen-sparse/include/asm-xen/vga.h linux-2.4-xen-sparse/include/asm-xen/xor.h linux-2.4-xen-sparse/include/linux/blk.h linux-2.4-xen-sparse/include/linux/highmem.h linux-2.4-xen-sparse/include/linux/irq.h linux-2.4-xen-sparse/include/linux/mm.h linux-2.4-xen-sparse/include/linux/sched.h linux-2.4-xen-sparse/include/linux/skbuff.h linux-2.4-xen-sparse/include/linux/timer.h linux-2.4-xen-sparse/kernel/time.c linux-2.4-xen-sparse/kernel/timer.c linux-2.4-xen-sparse/mkbuildtree linux-2.4-xen-sparse/mm/highmem.c linux-2.4-xen-sparse/mm/memory.c linux-2.4-xen-sparse/mm/mprotect.c linux-2.4-xen-sparse/mm/mremap.c linux-2.4-xen-sparse/mm/page_alloc.c linux-2.4-xen-sparse/net/core/skbuff.c linux-2.6-xen-sparse/arch/xen/Kconfig linux-2.6-xen-sparse/arch/xen/Kconfig.drivers linux-2.6-xen-sparse/arch/xen/Makefile linux-2.6-xen-sparse/arch/xen/boot/Makefile linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/i386/Kconfig linux-2.6-xen-sparse/arch/xen/i386/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/acpi/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/acpi/boot.c linux-2.6-xen-sparse/arch/xen/i386/kernel/apic.c linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c linux-2.6-xen-sparse/arch/xen/i386/kernel/init_task.c linux-2.6-xen-sparse/arch/xen/i386/kernel/io_apic.c linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c linux-2.6-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c linux-2.6-xen-sparse/arch/xen/i386/kernel/microcode.c linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/i386/kernel/signal.c linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c linux-2.6-xen-sparse/arch/xen/i386/kernel/vsyscall.S linux-2.6-xen-sparse/arch/xen/i386/mach-default/Makefile linux-2.6-xen-sparse/arch/xen/i386/mm/Makefile linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile linux-2.6-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6-xen-sparse/arch/xen/kernel/Makefile linux-2.6-xen-sparse/arch/xen/kernel/devmem.c linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/arch/xen/kernel/fixup.c linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c linux-2.6-xen-sparse/arch/xen/kernel/smp.c linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig linux-2.6-xen-sparse/arch/xen/x86_64/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/ia32/ia32entry.S linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c linux-2.6-xen-sparse/arch/xen/x86_64/ia32/vsyscall-int80.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/kernel/acpi/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic_xen.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/io_apic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/ioport.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/irq.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/ldt.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/mpparse.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-nommu.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/signal.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/traps.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/vsyscall.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/x8664_ksyms.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S linux-2.6-xen-sparse/arch/xen/x86_64/mm/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/pageattr.c linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile-BUS linux-2.6-xen-sparse/drivers/Makefile linux-2.6-xen-sparse/drivers/acpi/tables.c linux-2.6-xen-sparse/drivers/char/mem.c linux-2.6-xen-sparse/drivers/char/tpm/Kconfig.domU linux-2.6-xen-sparse/drivers/char/tpm/Makefile linux-2.6-xen-sparse/drivers/char/tpm/tpm.c linux-2.6-xen-sparse/drivers/char/tpm/tpm.h linux-2.6-xen-sparse/drivers/char/tpm/tpm_atmel.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_nopci.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_nopci.h linux-2.6-xen-sparse/drivers/char/tpm/tpm_nsc.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c linux-2.6-xen-sparse/drivers/char/tty_io.c linux-2.6-xen-sparse/drivers/xen/Makefile linux-2.6-xen-sparse/drivers/xen/balloon/Makefile linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/Makefile linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkback/interface.c linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/Kconfig linux-2.6-xen-sparse/drivers/xen/blkfront/Makefile linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blkfront/block.h linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/blktap/Makefile linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h linux-2.6-xen-sparse/drivers/xen/blktap/common.h linux-2.6-xen-sparse/drivers/xen/blktap/interface.c linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c linux-2.6-xen-sparse/drivers/xen/console/Makefile linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.h linux-2.6-xen-sparse/drivers/xen/evtchn/Makefile linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c linux-2.6-xen-sparse/drivers/xen/netback/Makefile linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netback/loopback.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c linux-2.6-xen-sparse/drivers/xen/netfront/Kconfig linux-2.6-xen-sparse/drivers/xen/netfront/Makefile linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/privcmd/Makefile linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/drivers/xen/tpmback/Makefile linux-2.6-xen-sparse/drivers/xen/tpmback/common.h linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c linux-2.6-xen-sparse/drivers/xen/tpmfront/Makefile linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.h linux-2.6-xen-sparse/drivers/xen/usbback/common.h linux-2.6-xen-sparse/drivers/xen/usbback/control.c linux-2.6-xen-sparse/drivers/xen/usbback/interface.c linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c linux-2.6-xen-sparse/drivers/xen/usbfront/xhci.h linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.h linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-generic/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/agp.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/desc.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/dma-mapping.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/fixmap.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/floppy.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/highmem.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/hw_irq.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/kmap_types.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/smpboot_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/param.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgalloc.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/processor.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/ptrace.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/scatterlist.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/segment.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/spinlock.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/swiotlb.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/tlbflush.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/vga.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/arch_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/desc.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/fixmap.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/floppy.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hw_irq.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/irq.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/io_ports.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/irq_vectors.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_timer.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_pre.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/smpboot_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/param.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgalloc.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/processor.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/ptrace.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/segment.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/smp.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/timer.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/tlbflush.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/vga.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/xor.h linux-2.6-xen-sparse/include/asm-xen/balloon.h linux-2.6-xen-sparse/include/asm-xen/evtchn.h linux-2.6-xen-sparse/include/asm-xen/foreign_page.h linux-2.6-xen-sparse/include/asm-xen/gnttab.h linux-2.6-xen-sparse/include/asm-xen/hypervisor.h linux-2.6-xen-sparse/include/asm-xen/linux-public/privcmd.h linux-2.6-xen-sparse/include/asm-xen/queues.h linux-2.6-xen-sparse/include/asm-xen/xen_proc.h linux-2.6-xen-sparse/include/asm-xen/xenbus.h linux-2.6-xen-sparse/include/linux/gfp.h linux-2.6-xen-sparse/include/linux/highmem.h linux-2.6-xen-sparse/include/linux/irq.h linux-2.6-xen-sparse/include/linux/mm.h linux-2.6-xen-sparse/include/linux/skbuff.h linux-2.6-xen-sparse/include/linux/tpmfe.h linux-2.6-xen-sparse/kernel/irq/manage.c linux-2.6-xen-sparse/mkbuildtree linux-2.6-xen-sparse/mm/highmem.c linux-2.6-xen-sparse/mm/memory.c linux-2.6-xen-sparse/mm/mmap.c linux-2.6-xen-sparse/mm/page_alloc.c linux-2.6-xen-sparse/net/core/dev.c linux-2.6-xen-sparse/net/core/skbuff.c patches/linux-2.6.12/i386-cpu-hotplug-updated-for-mm.patch patches/linux-2.6.12/net-csum.patch patches/linux-2.6.12/patch-2.6.12.5 patches/linux-2.6.12/rcu-nohz.patch patches/linux-2.6.12/smp-alts.patch tools/Makefile tools/Rules.mk tools/blktap/Makefile tools/blktap/README.sept05 tools/blktap/blkdump.c tools/blktap/blkif.c tools/blktap/blktaplib.c tools/blktap/blktaplib.h tools/blktap/list.h tools/blktap/parallax/Makefile tools/blktap/parallax/block-async.h tools/blktap/parallax/blockstore.h tools/blktap/ublkback/Makefile tools/blktap/ublkback/ublkback.c tools/blktap/ublkback/ublkbacklib.c tools/blktap/ublkback/ublkbacklib.h tools/blktap/xenbus.c tools/check/check_brctl tools/check/check_iproute tools/check/check_logging tools/check/check_python tools/check/check_zlib_devel tools/check/check_zlib_lib tools/check/chk tools/console/Makefile tools/console/client/main.c tools/console/daemon/io.c tools/console/daemon/io.h tools/console/daemon/main.c tools/console/daemon/utils.c tools/console/daemon/utils.h tools/console/testsuite/Makefile tools/console/testsuite/README tools/console/testsuite/console-dom0.c tools/console/testsuite/console-domU.c tools/console/testsuite/procpipe.c tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c tools/debugger/gdb/gdbbuild tools/debugger/libxendebug/Makefile tools/debugger/libxendebug/xendebug.c tools/debugger/libxendebug/xendebug.h tools/debugger/pdb/Domain.ml tools/debugger/pdb/Domain.mli tools/debugger/pdb/Makefile tools/debugger/pdb/PDB.ml tools/debugger/pdb/Process.ml tools/debugger/pdb/Process.mli tools/debugger/pdb/Util.ml tools/debugger/pdb/Xen_domain.ml tools/debugger/pdb/Xen_domain.mli tools/debugger/pdb/debugger.ml tools/debugger/pdb/linux-2.6-module/Makefile tools/debugger/pdb/linux-2.6-module/debug.c tools/debugger/pdb/linux-2.6-module/module.c tools/debugger/pdb/linux-2.6-module/pdb_debug.h tools/debugger/pdb/linux-2.6-module/pdb_module.h tools/debugger/pdb/linux-2.6-patches/Makefile tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch tools/debugger/pdb/linux-2.6-patches/kdebug.patch tools/debugger/pdb/linux-2.6-patches/makefile.patch tools/debugger/pdb/linux-2.6-patches/ptrace.patch tools/debugger/pdb/linux-2.6-patches/traps.patch tools/debugger/pdb/pdb_caml_domain.c tools/debugger/pdb/pdb_caml_evtchn.c tools/debugger/pdb/pdb_caml_process.c tools/debugger/pdb/pdb_caml_xc.c tools/debugger/pdb/pdb_caml_xcs.c tools/debugger/pdb/pdb_caml_xen.h tools/debugger/pdb/pdb_xen.c tools/debugger/pdb/readme tools/debugger/pdb/server.ml tools/examples/Makefile tools/examples/README tools/examples/block-enbd tools/examples/block-file tools/examples/block-phy tools/examples/init.d/xend tools/examples/network-bridge tools/examples/vif-bridge tools/examples/vif-route tools/examples/xen-backend.agent tools/examples/xend-config.sxp tools/examples/xmexample.vmx.in tools/examples/xmexample1 tools/examples/xmexample2 tools/examples/xmexample3 tools/firmware/acpi/acpi2_0.h tools/firmware/rombios/rombios.c tools/firmware/vmxassist/Makefile tools/firmware/vmxassist/setup.c tools/firmware/vmxassist/vm86.c tools/firmware/vmxassist/vmxloader.c tools/ioemu/cpu-all.h tools/ioemu/exec.c tools/ioemu/hw/i8254.c tools/ioemu/hw/i8259.c tools/ioemu/hw/ide.c tools/ioemu/hw/ioapic.h tools/ioemu/hw/pc.c tools/ioemu/hw/pckbd.c tools/ioemu/hw/pcnet.c tools/ioemu/hw/pcnet.h tools/ioemu/hw/vga.c tools/ioemu/monitor.c tools/ioemu/target-i386-dm/Makefile tools/ioemu/target-i386-dm/helper2.c tools/ioemu/target-i386-dm/qemu-dm.debug tools/ioemu/vl.c tools/ioemu/vl.h tools/ioemu/vnc.c tools/libxc/Makefile tools/libxc/linux_boot_params.h tools/libxc/xc_core.c tools/libxc/xc_domain.c tools/libxc/xc_gnttab.c tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c tools/libxc/xc_load_aout9.c tools/libxc/xc_load_bin.c tools/libxc/xc_load_elf.c tools/libxc/xc_private.c tools/libxc/xc_private.h tools/libxc/xc_ptrace.c tools/libxc/xc_vmx_build.c tools/libxc/xenctrl.h tools/libxc/xenguest.h tools/libxc/xg_private.c tools/libxc/xg_private.h tools/misc/Makefile tools/misc/cpuperf/Makefile tools/misc/cpuperf/cpuperf.c tools/misc/cpuperf/cpuperf_xeno.h tools/misc/mbootpack/Makefile tools/misc/mbootpack/buildimage.c tools/misc/mbootpack/mbootpack.c tools/misc/mbootpack/mbootpack.h tools/misc/xc_shadow.c tools/misc/xend tools/misc/xenperf.c tools/python/Makefile tools/python/pylintrc tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xs/xs.c tools/python/xen/sv/CreateDomain.py tools/python/xen/sv/DomInfo.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/RestoreDomain.py tools/python/xen/sv/Wizard.py tools/python/xen/sv/__init__.py tools/python/xen/sv/util.py tools/python/xen/util/Brctl.py tools/python/xen/web/SrvBase.py tools/python/xen/web/SrvDir.py tools/python/xen/web/__init__.py tools/python/xen/web/connection.py tools/python/xen/web/httpserver.py tools/python/xen/web/protocol.py tools/python/xen/web/reactor.py tools/python/xen/web/resource.py tools/python/xen/web/static.py tools/python/xen/web/tcp.py tools/python/xen/web/unix.py tools/python/xen/xend/Args.py tools/python/xen/xend/EventServer.py tools/python/xen/xend/PrettyPrint.py tools/python/xen/xend/Vifctl.py tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDB.py tools/python/xen/xend/XendDmesg.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendError.py tools/python/xen/xend/XendLogging.py tools/python/xen/xend/XendNode.py tools/python/xen/xend/XendProtocol.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/XendVnet.py tools/python/xen/xend/encode.py tools/python/xen/xend/image.py tools/python/xen/xend/scheduler.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/SrvRoot.py tools/python/xen/xend/server/SrvServer.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/channel.py tools/python/xen/xend/server/controller.py tools/python/xen/xend/server/event.py tools/python/xen/xend/server/netif.py tools/python/xen/xend/server/params.py tools/python/xen/xend/server/pciif.py tools/python/xen/xend/server/relocate.py tools/python/xen/xend/server/tpmif.py tools/python/xen/xend/server/usbif.py tools/python/xen/xend/sxp.py tools/python/xen/xend/uuid.py tools/python/xen/xend/xenstore/__init__.py tools/python/xen/xend/xenstore/xsnode.py tools/python/xen/xend/xenstore/xsobj.py tools/python/xen/xend/xenstore/xsresource.py tools/python/xen/xend/xenstore/xstransact.py tools/python/xen/xend/xenstore/xswatch.py tools/python/xen/xm/create.py tools/python/xen/xm/destroy.py tools/python/xen/xm/help.py tools/python/xen/xm/main.py tools/python/xen/xm/migrate.py tools/python/xen/xm/opts.py tools/python/xen/xm/shutdown.py tools/python/xen/xm/sysrq.py tools/security/Makefile tools/security/example.txt tools/security/getlabel.sh tools/security/install.txt tools/security/labelfuncs.sh tools/security/policies/chwall/chwall-security_label_template.xml tools/security/policies/chwall/chwall-security_policy.xml tools/security/policies/chwall_ste/chwall_ste-security_label_template.xml tools/security/policies/chwall_ste/chwall_ste-security_policy.xml tools/security/policies/null/null-security_label_template.xml tools/security/policies/null/null-security_policy.xml tools/security/policies/security_policy.xsd tools/security/policies/ste/ste-security_label_template.xml tools/security/policies/ste/ste-security_policy.xml tools/security/policy.txt tools/security/readme.txt tools/security/secpol_compat.h tools/security/secpol_tool.c tools/security/secpol_xml2bin.c tools/security/secpol_xml2bin.h tools/security/setlabel.sh tools/security/updategrub.sh tools/sv/Makefile tools/sv/images/destroy.png 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/small-destroy.png tools/sv/images/small-pause.png tools/sv/images/small-unpause.png tools/sv/images/unpause.png tools/sv/images/xen.png tools/sv/inc/script.js tools/sv/inc/style.css tools/sv/index.psp tools/vnet/00INSTALL tools/vnet/Make.env tools/vnet/Makefile tools/vnet/doc/vnet-module.txt tools/vnet/doc/vnet-xend.txt tools/vnet/examples/Makefile tools/vnet/examples/network-vnet tools/vnet/examples/vnet-insert tools/vnet/examples/vnet97.sxp tools/vnet/examples/vnet98.sxp tools/vnet/examples/vnet99.sxp tools/vnet/libxutil/Makefile tools/vnet/libxutil/debug.h tools/vnet/libxutil/mem_stream.c tools/vnet/libxutil/mem_stream.h tools/vnet/libxutil/sxpr.c tools/vnet/libxutil/sxpr.h tools/vnet/libxutil/sxpr_parser.c tools/vnet/libxutil/sxpr_parser.h tools/vnet/libxutil/sys_string.c tools/vnet/libxutil/sys_string.h tools/vnet/vnet-module/00README tools/vnet/vnet-module/Makefile tools/vnet/vnet-module/Makefile-2.4 tools/vnet/vnet-module/Makefile-2.6 tools/vnet/vnet-module/Makefile.ver tools/vnet/vnet-module/Makefile.vnet tools/vnet/vnet-module/etherip.c tools/vnet/vnet-module/if_etherip.h tools/vnet/vnet-module/if_varp.h tools/vnet/vnet-module/skb_util.h tools/vnet/vnet-module/tunnel.c tools/vnet/vnet-module/tunnel.h tools/vnet/vnet-module/varp.c tools/vnet/vnet-module/varp.h tools/vnet/vnet-module/varp_socket.c tools/vnet/vnet-module/varp_util.c tools/vnet/vnet-module/varp_util.h tools/vnet/vnet-module/vif.c tools/vnet/vnet-module/vif.h tools/vnet/vnet-module/vnet.c tools/vnet/vnet-module/vnet.h tools/vnet/vnet-module/vnet_dev.c tools/vnet/vnet-module/vnet_dev.h tools/vnet/vnet-module/vnet_ioctl.c tools/vnet/vnetd/Makefile tools/vnet/vnetd/vcache.c tools/vnet/vnetd/vcache.h tools/vnet/vnetd/vnetd.c tools/vnet/vnetd/vnetd.h tools/vtpm/Makefile tools/vtpm/README tools/vtpm/Rules.mk tools/vtpm/tpm_emulator.patch tools/vtpm/vtpm.patch tools/vtpm_manager/COPYING tools/vtpm_manager/Makefile tools/vtpm_manager/README tools/vtpm_manager/Rules.mk tools/vtpm_manager/crypto/Makefile tools/vtpm_manager/crypto/crypto.c tools/vtpm_manager/crypto/crypto.h tools/vtpm_manager/crypto/hash.c tools/vtpm_manager/crypto/rsa.c tools/vtpm_manager/crypto/sym_crypto.c tools/vtpm_manager/crypto/sym_crypto.h tools/vtpm_manager/manager/Makefile tools/vtpm_manager/manager/dmictl.c tools/vtpm_manager/manager/securestorage.c tools/vtpm_manager/manager/tpmpassthrough.c tools/vtpm_manager/manager/vtpm_manager.c tools/vtpm_manager/manager/vtpm_manager.h tools/vtpm_manager/manager/vtpmd.c tools/vtpm_manager/manager/vtpmpriv.h tools/vtpm_manager/manager/vtsp.c tools/vtpm_manager/manager/vtsp.h tools/vtpm_manager/tcs/Makefile tools/vtpm_manager/tcs/contextmgr.c tools/vtpm_manager/tcs/contextmgr.h tools/vtpm_manager/tcs/tcs.c tools/vtpm_manager/tcs/tcs.h tools/vtpm_manager/tcs/tpmddl.h tools/vtpm_manager/tcs/transmit.c tools/vtpm_manager/util/Makefile tools/vtpm_manager/util/bsg.c tools/vtpm_manager/util/bsg.h tools/vtpm_manager/util/buffer.c tools/vtpm_manager/util/buffer.h tools/vtpm_manager/util/depend tools/vtpm_manager/util/hashtable.c tools/vtpm_manager/util/hashtable.h tools/vtpm_manager/util/hashtable_itr.c tools/vtpm_manager/util/hashtable_itr.h tools/vtpm_manager/util/hashtable_private.h tools/vtpm_manager/util/log.c tools/vtpm_manager/util/log.h tools/vtpm_manager/util/tcg.h tools/xcutils/Makefile tools/xcutils/xc_restore.c tools/xcutils/xc_save.c tools/xenstat/Makefile tools/xenstat/libxenstat/COPYING tools/xenstat/libxenstat/Makefile tools/xenstat/libxenstat/bindings/swig/perl/.empty tools/xenstat/libxenstat/bindings/swig/python/.empty tools/xenstat/libxenstat/bindings/swig/xenstat.i tools/xenstat/libxenstat/src/xen-interface.c tools/xenstat/libxenstat/src/xen-interface.h tools/xenstat/libxenstat/src/xenstat.c tools/xenstat/libxenstat/src/xenstat.h tools/xenstat/xentop/Makefile tools/xenstat/xentop/TODO tools/xenstat/xentop/xentop.1 tools/xenstat/xentop/xentop.c tools/xenstore/COPYING tools/xenstore/Makefile tools/xenstore/TODO tools/xenstore/fake_libxc.c tools/xenstore/testsuite/01simple.test tools/xenstore/testsuite/02directory.test tools/xenstore/testsuite/03write.test tools/xenstore/testsuite/04rm.test tools/xenstore/testsuite/05filepermissions.test tools/xenstore/testsuite/06dirpermissions.test tools/xenstore/testsuite/07watch.test tools/xenstore/testsuite/08transaction.slowtest tools/xenstore/testsuite/08transaction.test tools/xenstore/testsuite/09domain.test tools/xenstore/testsuite/10domain-homedir.test tools/xenstore/testsuite/11domain-watch.test tools/xenstore/testsuite/12readonly.test tools/xenstore/testsuite/13watch-ack.test tools/xenstore/testsuite/14complexperms.test tools/xenstore/testsuite/15nowait.test tools/xenstore/testsuite/test.sh tools/xenstore/testsuite/vg-suppressions tools/xenstore/utils.c tools/xenstore/utils.h tools/xenstore/xenstore_client.c tools/xenstore/xenstored.h tools/xenstore/xenstored_core.c tools/xenstore/xenstored_core.h tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_domain.h tools/xenstore/xenstored_transaction.c tools/xenstore/xenstored_transaction.h tools/xenstore/xenstored_watch.c tools/xenstore/xenstored_watch.h tools/xenstore/xs.c tools/xenstore/xs.h tools/xenstore/xs_crashme.c tools/xenstore/xs_dom0_test.c tools/xenstore/xs_lib.c tools/xenstore/xs_lib.h tools/xenstore/xs_random.c tools/xenstore/xs_test.c tools/xentrace/Makefile tools/xentrace/formats tools/xentrace/xenctx.c tools/xentrace/xentrace.c xen/Makefile xen/Rules.mk xen/acm/acm_chinesewall_hooks.c xen/acm/acm_core.c xen/acm/acm_null_hooks.c xen/acm/acm_policy.c xen/acm/acm_simple_type_enforcement_hooks.c xen/arch/ia64/Makefile xen/arch/ia64/Rules.mk xen/arch/ia64/asm-offsets.c xen/arch/ia64/asm-xsi-offsets.c xen/arch/ia64/linux-xen/efi.c xen/arch/ia64/linux-xen/entry.S xen/arch/ia64/linux-xen/entry.h xen/arch/ia64/linux-xen/head.S xen/arch/ia64/linux-xen/irq_ia64.c xen/arch/ia64/linux-xen/mm_contig.c xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/linux-xen/unaligned.c xen/arch/ia64/linux/extable.c xen/arch/ia64/linux/ia64_ksyms.c xen/arch/ia64/linux/irq_lsapic.c xen/arch/ia64/linux/pcdp.h xen/arch/ia64/tools/README.xenia64 xen/arch/ia64/tools/README.xenia64linux xen/arch/ia64/xen/xensetup.c xen/arch/x86/Makefile xen/arch/x86/Rules.mk xen/arch/x86/acpi/boot.c xen/arch/x86/apic.c xen/arch/x86/audit.c xen/arch/x86/boot/x86_32.S xen/arch/x86/boot/x86_64.S xen/arch/x86/cdb.c xen/arch/x86/cpu/amd.c xen/arch/x86/cpu/common.c xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/genapic/es7000plat.c xen/arch/x86/i8259.c xen/arch/x86/io_apic.c xen/arch/x86/mm.c xen/arch/x86/mpparse.c xen/arch/x86/physdev.c xen/arch/x86/setup.c xen/arch/x86/shadow.c xen/arch/x86/shadow32.c xen/arch/x86/shadow_guest32.c xen/arch/x86/shadow_public.c xen/arch/x86/smpboot.c xen/arch/x86/time.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/arch/x86/vmx_intercept.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/asm-offsets.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c xen/common/Makefile xen/common/ac_timer.c xen/common/acm_ops.c xen/common/dom0_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/grant_table.c xen/common/kernel.c xen/common/lib.c xen/common/memory.c xen/common/multicall.c xen/common/page_alloc.c xen/common/perfc.c xen/common/sched_sedf.c xen/common/schedule.c xen/common/symbols.c xen/common/trace.c xen/common/xmalloc.c xen/drivers/char/Makefile xen/drivers/char/console.c xen/drivers/char/ns16550.c xen/drivers/char/serial.c xen/include/acm/acm_core.h xen/include/acm/acm_hooks.h xen/include/asm-ia64/config.h xen/include/asm-ia64/domain.h xen/include/asm-ia64/event.h xen/include/asm-ia64/ia64_int.h xen/include/asm-ia64/linux-xen/asm/gcc_intrin.h xen/include/asm-ia64/linux-xen/asm/ia64regs.h xen/include/asm-ia64/linux-xen/asm/io.h xen/include/asm-ia64/linux-xen/asm/kregs.h xen/include/asm-ia64/linux-xen/asm/mca_asm.h xen/include/asm-ia64/linux-xen/asm/page.h xen/include/asm-ia64/linux-xen/asm/pal.h xen/include/asm-ia64/linux-xen/asm/pgalloc.h xen/include/asm-ia64/linux-xen/asm/processor.h xen/include/asm-ia64/linux-xen/asm/system.h xen/include/asm-ia64/linux-xen/asm/types.h xen/include/asm-ia64/linux-xen/asm/uaccess.h xen/include/asm-ia64/linux-xen/linux/cpumask.h xen/include/asm-ia64/linux-xen/linux/hardirq.h xen/include/asm-ia64/linux-xen/linux/interrupt.h xen/include/asm-ia64/linux/asm-generic/bug.h xen/include/asm-ia64/linux/asm-generic/errno.h xen/include/asm-ia64/linux/asm-generic/iomap.h xen/include/asm-ia64/linux/asm-generic/pci.h xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h xen/include/asm-ia64/linux/asm-generic/pgtable.h xen/include/asm-ia64/linux/asm-generic/sections.h xen/include/asm-ia64/linux/asm-generic/topology.h xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h xen/include/asm-ia64/linux/asm/acpi.h xen/include/asm-ia64/linux/asm/bitops.h xen/include/asm-ia64/linux/asm/break.h xen/include/asm-ia64/linux/asm/bug.h xen/include/asm-ia64/linux/asm/cacheflush.h xen/include/asm-ia64/linux/asm/param.h xen/include/asm-ia64/linux/asm/pci.h xen/include/asm-ia64/linux/asm/percpu.h xen/include/asm-ia64/linux/asm/sal.h xen/include/asm-ia64/linux/asm/sections.h xen/include/asm-ia64/linux/asm/signal.h xen/include/asm-ia64/linux/asm/smp.h xen/include/asm-ia64/linux/asm/thread_info.h xen/include/asm-ia64/linux/asm/topology.h xen/include/asm-ia64/linux/asm/unaligned.h xen/include/asm-ia64/linux/asm/unistd.h xen/include/asm-ia64/linux/bitmap.h xen/include/asm-ia64/linux/bitops.h xen/include/asm-ia64/linux/dma-mapping.h xen/include/asm-ia64/linux/efi.h xen/include/asm-ia64/linux/err.h xen/include/asm-ia64/linux/gfp.h xen/include/asm-ia64/linux/mmzone.h xen/include/asm-ia64/linux/numa.h xen/include/asm-ia64/linux/page-flags.h xen/include/asm-ia64/linux/slab.h xen/include/asm-ia64/linux/threads.h xen/include/asm-ia64/linux/timex.h xen/include/asm-ia64/linux/topology.h xen/include/asm-ia64/linux/wait.h xen/include/asm-ia64/mm.h xen/include/asm-ia64/mmu_context.h xen/include/asm-ia64/privop.h xen/include/asm-ia64/regionreg.h xen/include/asm-ia64/regs.h xen/include/asm-ia64/time.h xen/include/asm-ia64/tlb.h xen/include/asm-ia64/vcpu.h xen/include/asm-ia64/vhpt.h xen/include/asm-ia64/vmmu.h xen/include/asm-ia64/vmx.h xen/include/asm-ia64/vmx_uaccess.h xen/include/asm-ia64/vmx_vcpu.h xen/include/asm-ia64/vmx_vpd.h xen/include/asm-ia64/xenprocessor.h xen/include/asm-ia64/xensystem.h xen/include/asm-x86/apicdef.h xen/include/asm-x86/asm_defns.h xen/include/asm-x86/bitops.h xen/include/asm-x86/config.h xen/include/asm-x86/e820.h xen/include/asm-x86/event.h xen/include/asm-x86/fixmap.h xen/include/asm-x86/genapic.h xen/include/asm-x86/hpet.h xen/include/asm-x86/io.h xen/include/asm-x86/mach-bigsmp/mach_apic.h xen/include/asm-x86/mach-default/mach_apic.h xen/include/asm-x86/mach-es7000/mach_apic.h xen/include/asm-x86/mach-generic/mach_apic.h xen/include/asm-x86/mach-summit/mach_apic.h xen/include/asm-x86/mach-summit/mach_mpparse.h xen/include/asm-x86/mm.h xen/include/asm-x86/page-guest32.h xen/include/asm-x86/page.h xen/include/asm-x86/processor.h xen/include/asm-x86/shadow.h xen/include/asm-x86/shadow_64.h xen/include/asm-x86/shadow_ops.h xen/include/asm-x86/shadow_public.h xen/include/asm-x86/time.h xen/include/asm-x86/types.h xen/include/asm-x86/uaccess.h xen/include/asm-x86/vmx.h xen/include/asm-x86/vmx_platform.h xen/include/asm-x86/vmx_virpit.h xen/include/asm-x86/vmx_vmcs.h xen/include/asm-x86/x86_32/asm_defns.h xen/include/asm-x86/x86_32/page-3level.h xen/include/asm-x86/x86_32/uaccess.h xen/include/asm-x86/x86_64/asm_defns.h xen/include/asm-x86/x86_64/page.h xen/include/public/acm.h xen/include/public/acm_ops.h xen/include/public/arch-ia64.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/dom0_ops.h xen/include/public/grant_table.h xen/include/public/io/blkif.h xen/include/public/io/domain_controller.h xen/include/public/io/ioreq.h xen/include/public/io/netif.h xen/include/public/io/tpmif.h xen/include/public/memory.h xen/include/public/physdev.h xen/include/public/trace.h xen/include/public/version.h xen/include/public/xen.h xen/include/xen/ac_timer.h xen/include/xen/config.h xen/include/xen/domain.h xen/include/xen/event.h xen/include/xen/grant_table.h xen/include/xen/mm.h xen/include/xen/perfc.h xen/include/xen/perfc_defn.h xen/include/xen/sched.h xen/include/xen/serial.h xen/include/xen/symbols.h xen/include/xen/time.h xen/include/xen/trace.h xen/tools/Makefile xen/tools/symbols.c
line diff
     1.1 --- a/.hgignore	Fri Sep 09 10:31:36 2005 -0600
     1.2 +++ b/.hgignore	Tue Sep 13 10:14:16 2005 -0600
     1.3 @@ -19,6 +19,7 @@
     1.4  ^docs/.*\.toc$
     1.5  ^docs/figs/xenserver\.eps$
     1.6  ^docs/html/.*$
     1.7 +^docs/api/.*$
     1.8  ^docs/interface/WARNINGS$
     1.9  ^docs/interface/images\.pl$
    1.10  ^docs/interface/images\.tex$
    1.11 @@ -60,8 +61,6 @@
    1.12  ^pristine-.*$
    1.13  ^ref-.*$
    1.14  ^tools/.*/build/lib.*/.*\.py$
    1.15 -^tools/Makefile\.smh$
    1.16 -^tools/balloon/balloon$
    1.17  ^tools/blktap/Makefile\.smh$
    1.18  ^tools/blktap/blkcow$
    1.19  ^tools/blktap/blkcowgnbd$
    1.20 @@ -85,8 +84,7 @@
    1.21  ^tools/blktap/ublkback/ublkback$
    1.22  ^tools/blktap/xen/.*$
    1.23  ^tools/check/\..*$
    1.24 -^tools/cmdline/.*$
    1.25 -^tools/cmdline/xen/.*$
    1.26 +^tools/examples/xmexample\.vmx$
    1.27  ^tools/console/xenconsoled$
    1.28  ^tools/console/xenconsole$
    1.29  ^tools/debugger/pdb/pdb$
    1.30 @@ -109,8 +107,6 @@
    1.31  ^tools/firmware/vmxassist/roms\.h$
    1.32  ^tools/firmware/vmxassist/vmxassist$
    1.33  ^tools/firmware/vmxassist/vmxloader$
    1.34 -^tools/gdb/gdb-6\.2\.1-linux-i386-xen/.*$
    1.35 -^tools/gdb/gdb-6\.2\.1/.*$
    1.36  ^tools/ioemu/config-host\..*$
    1.37  ^tools/ioemu/keysym_adapter_sdl\.h$
    1.38  ^tools/ioemu/keysym_adapter_vnc\.h$
    1.39 @@ -141,20 +137,18 @@
    1.40  ^tools/vnet/vnet-module/\..*\.cmd$
    1.41  ^tools/vnet/vnet-module/\.tmp_versions/.*$
    1.42  ^tools/vnet/vnet-module/vnet_module\.mod\..*$
    1.43 -^tools/vnetd/vnetd$
    1.44  ^tools/vtpm/vtpm*
    1.45  ^tools/vtpm/tpm_emulator-*
    1.46  ^tools/vtpm_manager/manager/vtpm_managerd
    1.47 -^tools/web-shutdown\.tap$
    1.48 -^tools/x2d2/minixend$
    1.49  ^tools/xcutils/xc_restore$
    1.50  ^tools/xcutils/xc_save$
    1.51  ^tools/xenstat/xentop/xentop$
    1.52  ^tools/xenstore/testsuite/tmp/.*$
    1.53  ^tools/xenstore/xen$
    1.54 -^tools/xenstore/xenbus_dev.h$
    1.55  ^tools/xenstore/xenstored$
    1.56  ^tools/xenstore/xenstored_test$
    1.57 +^tools/xenstore/xenstore-exists$
    1.58 +^tools/xenstore/xenstore-list$
    1.59  ^tools/xenstore/xenstore-read$
    1.60  ^tools/xenstore/xenstore-rm$
    1.61  ^tools/xenstore/xenstore-write$
     2.1 --- a/Makefile	Fri Sep 09 10:31:36 2005 -0600
     2.2 +++ b/Makefile	Tue Sep 13 10:14:16 2005 -0600
     2.3 @@ -35,8 +35,8 @@ ifeq ($(XEN_TARGET_X86_PAE),y)
     2.4  export pae=y
     2.5  endif
     2.6  
     2.7 -.PHONY:	all dist install xen kernels tools docs world clean mkpatches mrproper
     2.8 -.PHONY:	kbuild kdelete kclean
     2.9 +.PHONY:	all dist install xen kernels tools dev-docs docs world clean
    2.10 +.PHONY:	mkpatches mrproper kbuild kdelete kclean
    2.11  
    2.12  # build and install everything into the standard system directories
    2.13  install: install-xen install-kernels install-tools install-docs
    2.14 @@ -66,6 +66,9 @@ kernels:
    2.15  docs:
    2.16  	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
    2.17  
    2.18 +dev-docs:
    2.19 +	$(MAKE) -C docs dev-docs
    2.20 +
    2.21  # Build all the various kernels and modules
    2.22  kbuild: kernels
    2.23  
    2.24 @@ -123,7 +126,7 @@ help:
    2.25  	@echo '  install-xen      - build and install the Xen hypervisor'
    2.26  	@echo '  install-tools    - build and install the control tools'
    2.27  	@echo '  install-kernels  - build and install guest kernels'
    2.28 -	@echo '  install-docs     - build and install documentation'
    2.29 +	@echo '  install-docs     - build and install user documentation'
    2.30  	@echo ''
    2.31  	@echo 'Building targets:'
    2.32  	@echo '  dist             - build and install everything into local dist directory'
    2.33 @@ -133,7 +136,8 @@ help:
    2.34  	@echo '  tools            - build and install tools'
    2.35  	@echo '  kernels          - build and install guest kernels'
    2.36  	@echo '  kbuild           - synonym for make kernels'
    2.37 -	@echo '  docs             - build and install docs'
    2.38 +	@echo '  docs             - build and install user documentation'
    2.39 +	@echo '  dev-docs         - build developer-only documentation'
    2.40  	@echo ''
    2.41  	@echo 'Cleaning targets:'
    2.42  	@echo '  clean            - clean the Xen, tools and docs (but not'
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/docs/Doxyfile	Tue Sep 13 10:14:16 2005 -0600
     3.3 @@ -0,0 +1,1218 @@
     3.4 +# Doxyfile 1.4.2
     3.5 +
     3.6 +# This file describes the settings to be used by the documentation system
     3.7 +# doxygen (www.doxygen.org) for a project
     3.8 +#
     3.9 +# All text after a hash (#) is considered a comment and will be ignored
    3.10 +# The format is:
    3.11 +#       TAG = value [value, ...]
    3.12 +# For lists items can also be appended using:
    3.13 +#       TAG += value [value, ...]
    3.14 +# Values that contain spaces should be placed between quotes (" ")
    3.15 +
    3.16 +#---------------------------------------------------------------------------
    3.17 +# Project related configuration options
    3.18 +#---------------------------------------------------------------------------
    3.19 +
    3.20 +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
    3.21 +# by quotes) that should identify the project.
    3.22 +
    3.23 +PROJECT_NAME           = Xen Python Tools
    3.24 +
    3.25 +# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
    3.26 +# This could be handy for archiving the generated documentation or 
    3.27 +# if some version control system is used.
    3.28 +
    3.29 +PROJECT_NUMBER         = 
    3.30 +
    3.31 +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
    3.32 +# base path where the generated documentation will be put. 
    3.33 +# If a relative path is entered, it will be relative to the location 
    3.34 +# where doxygen was started. If left blank the current directory will be used.
    3.35 +
    3.36 +OUTPUT_DIRECTORY       = api/tools/python
    3.37 +
    3.38 +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
    3.39 +# 4096 sub-directories (in 2 levels) under the output directory of each output 
    3.40 +# format and will distribute the generated files over these directories. 
    3.41 +# Enabling this option can be useful when feeding doxygen a huge amount of 
    3.42 +# source files, where putting all generated files in the same directory would 
    3.43 +# otherwise cause performance problems for the file system.
    3.44 +
    3.45 +CREATE_SUBDIRS         = NO
    3.46 +
    3.47 +# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
    3.48 +# documentation generated by doxygen is written. Doxygen will use this 
    3.49 +# information to generate all constant output in the proper language. 
    3.50 +# The default language is English, other supported languages are: 
    3.51 +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
    3.52 +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
    3.53 +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
    3.54 +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
    3.55 +# Swedish, and Ukrainian.
    3.56 +
    3.57 +OUTPUT_LANGUAGE        = English
    3.58 +
    3.59 +# This tag can be used to specify the encoding used in the generated output. 
    3.60 +# The encoding is not always determined by the language that is chosen, 
    3.61 +# but also whether or not the output is meant for Windows or non-Windows users. 
    3.62 +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
    3.63 +# forces the Windows encoding (this is the default for the Windows binary), 
    3.64 +# whereas setting the tag to NO uses a Unix-style encoding (the default for 
    3.65 +# all platforms other than Windows).
    3.66 +
    3.67 +USE_WINDOWS_ENCODING   = NO
    3.68 +
    3.69 +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
    3.70 +# include brief member descriptions after the members that are listed in 
    3.71 +# the file and class documentation (similar to JavaDoc). 
    3.72 +# Set to NO to disable this.
    3.73 +
    3.74 +BRIEF_MEMBER_DESC      = YES
    3.75 +
    3.76 +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
    3.77 +# the brief description of a member or function before the detailed description. 
    3.78 +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
    3.79 +# brief descriptions will be completely suppressed.
    3.80 +
    3.81 +REPEAT_BRIEF           = YES
    3.82 +
    3.83 +# This tag implements a quasi-intelligent brief description abbreviator 
    3.84 +# that is used to form the text in various listings. Each string 
    3.85 +# in this list, if found as the leading text of the brief description, will be 
    3.86 +# stripped from the text and the result after processing the whole list, is 
    3.87 +# used as the annotated text. Otherwise, the brief description is used as-is. 
    3.88 +# If left blank, the following values are used ("$name" is automatically 
    3.89 +# replaced with the name of the entity): "The $name class" "The $name widget" 
    3.90 +# "The $name file" "is" "provides" "specifies" "contains" 
    3.91 +# "represents" "a" "an" "the"
    3.92 +
    3.93 +ABBREVIATE_BRIEF       = 
    3.94 +
    3.95 +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
    3.96 +# Doxygen will generate a detailed section even if there is only a brief 
    3.97 +# description.
    3.98 +
    3.99 +ALWAYS_DETAILED_SEC    = NO
   3.100 +
   3.101 +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
   3.102 +# inherited members of a class in the documentation of that class as if those 
   3.103 +# members were ordinary class members. Constructors, destructors and assignment 
   3.104 +# operators of the base classes will not be shown.
   3.105 +
   3.106 +INLINE_INHERITED_MEMB  = NO
   3.107 +
   3.108 +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
   3.109 +# path before files name in the file list and in the header files. If set 
   3.110 +# to NO the shortest path that makes the file name unique will be used.
   3.111 +
   3.112 +FULL_PATH_NAMES        = YES
   3.113 +
   3.114 +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
   3.115 +# can be used to strip a user-defined part of the path. Stripping is 
   3.116 +# only done if one of the specified strings matches the left-hand part of 
   3.117 +# the path. The tag can be used to show relative paths in the file list. 
   3.118 +# If left blank the directory from which doxygen is run is used as the 
   3.119 +# path to strip.
   3.120 +
   3.121 +STRIP_FROM_PATH        = 
   3.122 +
   3.123 +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
   3.124 +# the path mentioned in the documentation of a class, which tells 
   3.125 +# the reader which header file to include in order to use a class. 
   3.126 +# If left blank only the name of the header file containing the class 
   3.127 +# definition is used. Otherwise one should specify the include paths that 
   3.128 +# are normally passed to the compiler using the -I flag.
   3.129 +
   3.130 +STRIP_FROM_INC_PATH    = 
   3.131 +
   3.132 +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
   3.133 +# (but less readable) file names. This can be useful is your file systems 
   3.134 +# doesn't support long names like on DOS, Mac, or CD-ROM.
   3.135 +
   3.136 +SHORT_NAMES            = NO
   3.137 +
   3.138 +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
   3.139 +# will interpret the first line (until the first dot) of a JavaDoc-style 
   3.140 +# comment as the brief description. If set to NO, the JavaDoc 
   3.141 +# comments will behave just like the Qt-style comments (thus requiring an 
   3.142 +# explicit @brief command for a brief description.
   3.143 +
   3.144 +JAVADOC_AUTOBRIEF      = YES
   3.145 +
   3.146 +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
   3.147 +# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
   3.148 +# comments) as a brief description. This used to be the default behaviour. 
   3.149 +# The new default is to treat a multi-line C++ comment block as a detailed 
   3.150 +# description. Set this tag to YES if you prefer the old behaviour instead.
   3.151 +
   3.152 +MULTILINE_CPP_IS_BRIEF = NO
   3.153 +
   3.154 +# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
   3.155 +# will output the detailed description near the top, like JavaDoc.
   3.156 +# If set to NO, the detailed description appears after the member 
   3.157 +# documentation.
   3.158 +
   3.159 +DETAILS_AT_TOP         = YES
   3.160 +
   3.161 +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
   3.162 +# member inherits the documentation from any documented member that it 
   3.163 +# re-implements.
   3.164 +
   3.165 +INHERIT_DOCS           = YES
   3.166 +
   3.167 +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
   3.168 +# tag is set to YES, then doxygen will reuse the documentation of the first 
   3.169 +# member in the group (if any) for the other members of the group. By default 
   3.170 +# all members of a group must be documented explicitly.
   3.171 +
   3.172 +DISTRIBUTE_GROUP_DOC   = NO
   3.173 +
   3.174 +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
   3.175 +# a new page for each member. If set to NO, the documentation of a member will 
   3.176 +# be part of the file/class/namespace that contains it.
   3.177 +
   3.178 +SEPARATE_MEMBER_PAGES  = NO
   3.179 +
   3.180 +# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
   3.181 +# Doxygen uses this value to replace tabs by spaces in code fragments.
   3.182 +
   3.183 +TAB_SIZE               = 8
   3.184 +
   3.185 +# This tag can be used to specify a number of aliases that acts 
   3.186 +# as commands in the documentation. An alias has the form "name=value". 
   3.187 +# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
   3.188 +# put the command \sideeffect (or @sideeffect) in the documentation, which 
   3.189 +# will result in a user-defined paragraph with heading "Side Effects:". 
   3.190 +# You can put \n's in the value part of an alias to insert newlines.
   3.191 +
   3.192 +ALIASES                = 
   3.193 +
   3.194 +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
   3.195 +# sources only. Doxygen will then generate output that is more tailored for C. 
   3.196 +# For instance, some of the names that are used will be different. The list 
   3.197 +# of all members will be omitted, etc.
   3.198 +
   3.199 +OPTIMIZE_OUTPUT_FOR_C  = NO
   3.200 +
   3.201 +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
   3.202 +# only. Doxygen will then generate output that is more tailored for Java. 
   3.203 +# For instance, namespaces will be presented as packages, qualified scopes 
   3.204 +# will look different, etc.
   3.205 +
   3.206 +OPTIMIZE_OUTPUT_JAVA   = YES
   3.207 +
   3.208 +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
   3.209 +# the same type (for instance a group of public functions) to be put as a 
   3.210 +# subgroup of that type (e.g. under the Public Functions section). Set it to 
   3.211 +# NO to prevent subgrouping. Alternatively, this can be done per class using 
   3.212 +# the \nosubgrouping command.
   3.213 +
   3.214 +SUBGROUPING            = YES
   3.215 +
   3.216 +#---------------------------------------------------------------------------
   3.217 +# Build related configuration options
   3.218 +#---------------------------------------------------------------------------
   3.219 +
   3.220 +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
   3.221 +# documentation are documented, even if no documentation was available. 
   3.222 +# Private class members and static file members will be hidden unless 
   3.223 +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
   3.224 +
   3.225 +EXTRACT_ALL            = YES
   3.226 +
   3.227 +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
   3.228 +# will be included in the documentation.
   3.229 +
   3.230 +EXTRACT_PRIVATE        = YES
   3.231 +
   3.232 +# If the EXTRACT_STATIC tag is set to YES all static members of a file 
   3.233 +# will be included in the documentation.
   3.234 +
   3.235 +EXTRACT_STATIC         = YES
   3.236 +
   3.237 +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
   3.238 +# defined locally in source files will be included in the documentation. 
   3.239 +# If set to NO only classes defined in header files are included.
   3.240 +
   3.241 +EXTRACT_LOCAL_CLASSES  = YES
   3.242 +
   3.243 +# This flag is only useful for Objective-C code. When set to YES local 
   3.244 +# methods, which are defined in the implementation section but not in 
   3.245 +# the interface are included in the documentation. 
   3.246 +# If set to NO (the default) only methods in the interface are included.
   3.247 +
   3.248 +EXTRACT_LOCAL_METHODS  = NO
   3.249 +
   3.250 +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
   3.251 +# undocumented members of documented classes, files or namespaces. 
   3.252 +# If set to NO (the default) these members will be included in the 
   3.253 +# various overviews, but no documentation section is generated. 
   3.254 +# This option has no effect if EXTRACT_ALL is enabled.
   3.255 +
   3.256 +HIDE_UNDOC_MEMBERS     = NO
   3.257 +
   3.258 +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
   3.259 +# undocumented classes that are normally visible in the class hierarchy. 
   3.260 +# If set to NO (the default) these classes will be included in the various 
   3.261 +# overviews. This option has no effect if EXTRACT_ALL is enabled.
   3.262 +
   3.263 +HIDE_UNDOC_CLASSES     = NO
   3.264 +
   3.265 +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
   3.266 +# friend (class|struct|union) declarations. 
   3.267 +# If set to NO (the default) these declarations will be included in the 
   3.268 +# documentation.
   3.269 +
   3.270 +HIDE_FRIEND_COMPOUNDS  = NO
   3.271 +
   3.272 +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
   3.273 +# documentation blocks found inside the body of a function. 
   3.274 +# If set to NO (the default) these blocks will be appended to the 
   3.275 +# function's detailed documentation block.
   3.276 +
   3.277 +HIDE_IN_BODY_DOCS      = NO
   3.278 +
   3.279 +# The INTERNAL_DOCS tag determines if documentation 
   3.280 +# that is typed after a \internal command is included. If the tag is set 
   3.281 +# to NO (the default) then the documentation will be excluded. 
   3.282 +# Set it to YES to include the internal documentation.
   3.283 +
   3.284 +INTERNAL_DOCS          = NO
   3.285 +
   3.286 +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
   3.287 +# file names in lower-case letters. If set to YES upper-case letters are also 
   3.288 +# allowed. This is useful if you have classes or files whose names only differ 
   3.289 +# in case and if your file system supports case sensitive file names. Windows 
   3.290 +# and Mac users are advised to set this option to NO.
   3.291 +
   3.292 +CASE_SENSE_NAMES       = YES
   3.293 +
   3.294 +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
   3.295 +# will show members with their full class and namespace scopes in the 
   3.296 +# documentation. If set to YES the scope will be hidden.
   3.297 +
   3.298 +HIDE_SCOPE_NAMES       = NO
   3.299 +
   3.300 +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
   3.301 +# will put a list of the files that are included by a file in the documentation 
   3.302 +# of that file.
   3.303 +
   3.304 +SHOW_INCLUDE_FILES     = YES
   3.305 +
   3.306 +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
   3.307 +# is inserted in the documentation for inline members.
   3.308 +
   3.309 +INLINE_INFO            = YES
   3.310 +
   3.311 +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
   3.312 +# will sort the (detailed) documentation of file and class members 
   3.313 +# alphabetically by member name. If set to NO the members will appear in 
   3.314 +# declaration order.
   3.315 +
   3.316 +SORT_MEMBER_DOCS       = YES
   3.317 +
   3.318 +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
   3.319 +# brief documentation of file, namespace and class members alphabetically 
   3.320 +# by member name. If set to NO (the default) the members will appear in 
   3.321 +# declaration order.
   3.322 +
   3.323 +SORT_BRIEF_DOCS        = NO
   3.324 +
   3.325 +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
   3.326 +# sorted by fully-qualified names, including namespaces. If set to 
   3.327 +# NO (the default), the class list will be sorted only by class name, 
   3.328 +# not including the namespace part. 
   3.329 +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
   3.330 +# Note: This option applies only to the class list, not to the 
   3.331 +# alphabetical list.
   3.332 +
   3.333 +SORT_BY_SCOPE_NAME     = NO
   3.334 +
   3.335 +# The GENERATE_TODOLIST tag can be used to enable (YES) or 
   3.336 +# disable (NO) the todo list. This list is created by putting \todo 
   3.337 +# commands in the documentation.
   3.338 +
   3.339 +GENERATE_TODOLIST      = YES
   3.340 +
   3.341 +# The GENERATE_TESTLIST tag can be used to enable (YES) or 
   3.342 +# disable (NO) the test list. This list is created by putting \test 
   3.343 +# commands in the documentation.
   3.344 +
   3.345 +GENERATE_TESTLIST      = YES
   3.346 +
   3.347 +# The GENERATE_BUGLIST tag can be used to enable (YES) or 
   3.348 +# disable (NO) the bug list. This list is created by putting \bug 
   3.349 +# commands in the documentation.
   3.350 +
   3.351 +GENERATE_BUGLIST       = YES
   3.352 +
   3.353 +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
   3.354 +# disable (NO) the deprecated list. This list is created by putting 
   3.355 +# \deprecated commands in the documentation.
   3.356 +
   3.357 +GENERATE_DEPRECATEDLIST= YES
   3.358 +
   3.359 +# The ENABLED_SECTIONS tag can be used to enable conditional 
   3.360 +# documentation sections, marked by \if sectionname ... \endif.
   3.361 +
   3.362 +ENABLED_SECTIONS       = 
   3.363 +
   3.364 +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
   3.365 +# the initial value of a variable or define consists of for it to appear in 
   3.366 +# the documentation. If the initializer consists of more lines than specified 
   3.367 +# here it will be hidden. Use a value of 0 to hide initializers completely. 
   3.368 +# The appearance of the initializer of individual variables and defines in the 
   3.369 +# documentation can be controlled using \showinitializer or \hideinitializer 
   3.370 +# command in the documentation regardless of this setting.
   3.371 +
   3.372 +MAX_INITIALIZER_LINES  = 30
   3.373 +
   3.374 +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
   3.375 +# at the bottom of the documentation of classes and structs. If set to YES the 
   3.376 +# list will mention the files that were used to generate the documentation.
   3.377 +
   3.378 +SHOW_USED_FILES        = YES
   3.379 +
   3.380 +# If the sources in your project are distributed over multiple directories 
   3.381 +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
   3.382 +# in the documentation.
   3.383 +
   3.384 +SHOW_DIRECTORIES       = YES
   3.385 +
   3.386 +# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
   3.387 +# doxygen should invoke to get the current version for each file (typically from the 
   3.388 +# version control system). Doxygen will invoke the program by executing (via 
   3.389 +# popen()) the command <command> <input-file>, where <command> is the value of 
   3.390 +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
   3.391 +# provided by doxygen. Whatever the progam writes to standard output 
   3.392 +# is used as the file version. See the manual for examples.
   3.393 +
   3.394 +FILE_VERSION_FILTER    = 
   3.395 +
   3.396 +#---------------------------------------------------------------------------
   3.397 +# configuration options related to warning and progress messages
   3.398 +#---------------------------------------------------------------------------
   3.399 +
   3.400 +# The QUIET tag can be used to turn on/off the messages that are generated 
   3.401 +# by doxygen. Possible values are YES and NO. If left blank NO is used.
   3.402 +
   3.403 +QUIET                  = YES
   3.404 +
   3.405 +# The WARNINGS tag can be used to turn on/off the warning messages that are 
   3.406 +# generated by doxygen. Possible values are YES and NO. If left blank 
   3.407 +# NO is used.
   3.408 +
   3.409 +WARNINGS               = YES
   3.410 +
   3.411 +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
   3.412 +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
   3.413 +# automatically be disabled.
   3.414 +
   3.415 +WARN_IF_UNDOCUMENTED   = YES
   3.416 +
   3.417 +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
   3.418 +# potential errors in the documentation, such as not documenting some 
   3.419 +# parameters in a documented function, or documenting parameters that 
   3.420 +# don't exist or using markup commands wrongly.
   3.421 +
   3.422 +WARN_IF_DOC_ERROR      = YES
   3.423 +
   3.424 +# This WARN_NO_PARAMDOC option can be abled to get warnings for 
   3.425 +# functions that are documented, but have no documentation for their parameters 
   3.426 +# or return value. If set to NO (the default) doxygen will only warn about 
   3.427 +# wrong or incomplete parameter documentation, but not about the absence of 
   3.428 +# documentation.
   3.429 +
   3.430 +WARN_NO_PARAMDOC       = NO
   3.431 +
   3.432 +# The WARN_FORMAT tag determines the format of the warning messages that 
   3.433 +# doxygen can produce. The string should contain the $file, $line, and $text 
   3.434 +# tags, which will be replaced by the file and line number from which the 
   3.435 +# warning originated and the warning text. Optionally the format may contain 
   3.436 +# $version, which will be replaced by the version of the file (if it could 
   3.437 +# be obtained via FILE_VERSION_FILTER)
   3.438 +
   3.439 +WARN_FORMAT            = "$file:$line: $text"
   3.440 +
   3.441 +# The WARN_LOGFILE tag can be used to specify a file to which warning 
   3.442 +# and error messages should be written. If left blank the output is written 
   3.443 +# to stderr.
   3.444 +
   3.445 +WARN_LOGFILE           = 
   3.446 +
   3.447 +#---------------------------------------------------------------------------
   3.448 +# configuration options related to the input files
   3.449 +#---------------------------------------------------------------------------
   3.450 +
   3.451 +# The INPUT tag can be used to specify the files and/or directories that contain 
   3.452 +# documented source files. You may enter file names like "myfile.cpp" or 
   3.453 +# directories like "/usr/src/myproject". Separate the files or directories 
   3.454 +# with spaces.
   3.455 +
   3.456 +INPUT                  = ../tools/python/xen/
   3.457 +
   3.458 +# If the value of the INPUT tag contains directories, you can use the 
   3.459 +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
   3.460 +# and *.h) to filter out the source-files in the directories. If left 
   3.461 +# blank the following patterns are tested: 
   3.462 +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
   3.463 +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
   3.464 +
   3.465 +FILE_PATTERNS          = *.py *.c
   3.466 +
   3.467 +# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
   3.468 +# should be searched for input files as well. Possible values are YES and NO. 
   3.469 +# If left blank NO is used.
   3.470 +
   3.471 +RECURSIVE              = YES
   3.472 +
   3.473 +# The EXCLUDE tag can be used to specify files and/or directories that should 
   3.474 +# excluded from the INPUT source files. This way you can easily exclude a 
   3.475 +# subdirectory from a directory tree whose root is specified with the INPUT tag.
   3.476 +
   3.477 +EXCLUDE                = 
   3.478 +
   3.479 +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
   3.480 +# directories that are symbolic links (a Unix filesystem feature) are excluded 
   3.481 +# from the input.
   3.482 +
   3.483 +EXCLUDE_SYMLINKS       = NO
   3.484 +
   3.485 +# If the value of the INPUT tag contains directories, you can use the 
   3.486 +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
   3.487 +# certain files from those directories.
   3.488 +
   3.489 +EXCLUDE_PATTERNS       = 
   3.490 +
   3.491 +# The EXAMPLE_PATH tag can be used to specify one or more files or 
   3.492 +# directories that contain example code fragments that are included (see 
   3.493 +# the \include command).
   3.494 +
   3.495 +EXAMPLE_PATH           = 
   3.496 +
   3.497 +# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
   3.498 +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
   3.499 +# and *.h) to filter out the source-files in the directories. If left 
   3.500 +# blank all files are included.
   3.501 +
   3.502 +EXAMPLE_PATTERNS       = 
   3.503 +
   3.504 +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
   3.505 +# searched for input files to be used with the \include or \dontinclude 
   3.506 +# commands irrespective of the value of the RECURSIVE tag. 
   3.507 +# Possible values are YES and NO. If left blank NO is used.
   3.508 +
   3.509 +EXAMPLE_RECURSIVE      = NO
   3.510 +
   3.511 +# The IMAGE_PATH tag can be used to specify one or more files or 
   3.512 +# directories that contain image that are included in the documentation (see 
   3.513 +# the \image command).
   3.514 +
   3.515 +IMAGE_PATH             = 
   3.516 +
   3.517 +# The INPUT_FILTER tag can be used to specify a program that doxygen should 
   3.518 +# invoke to filter for each input file. Doxygen will invoke the filter program 
   3.519 +# by executing (via popen()) the command <filter> <input-file>, where <filter> 
   3.520 +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
   3.521 +# input file. Doxygen will then use the output that the filter program writes 
   3.522 +# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
   3.523 +# ignored.
   3.524 +
   3.525 +INPUT_FILTER           = "sh ./Doxyfilter ../tools/python"
   3.526 +
   3.527 +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
   3.528 +# basis.  Doxygen will compare the file name with each pattern and apply the 
   3.529 +# filter if there is a match.  The filters are a list of the form: 
   3.530 +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
   3.531 +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
   3.532 +# is applied to all files.
   3.533 +
   3.534 +FILTER_PATTERNS        = 
   3.535 +
   3.536 +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
   3.537 +# INPUT_FILTER) will be used to filter the input files when producing source 
   3.538 +# files to browse (i.e. when SOURCE_BROWSER is set to YES).
   3.539 +
   3.540 +FILTER_SOURCE_FILES    = YES
   3.541 +
   3.542 +#---------------------------------------------------------------------------
   3.543 +# configuration options related to source browsing
   3.544 +#---------------------------------------------------------------------------
   3.545 +
   3.546 +# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
   3.547 +# be generated. Documented entities will be cross-referenced with these sources. 
   3.548 +# Note: To get rid of all source code in the generated output, make sure also 
   3.549 +# VERBATIM_HEADERS is set to NO.
   3.550 +
   3.551 +SOURCE_BROWSER         = NO
   3.552 +
   3.553 +# Setting the INLINE_SOURCES tag to YES will include the body 
   3.554 +# of functions and classes directly in the documentation.
   3.555 +
   3.556 +INLINE_SOURCES         = NO
   3.557 +
   3.558 +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
   3.559 +# doxygen to hide any special comment blocks from generated source code 
   3.560 +# fragments. Normal C and C++ comments will always remain visible.
   3.561 +
   3.562 +STRIP_CODE_COMMENTS    = YES
   3.563 +
   3.564 +# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
   3.565 +# then for each documented function all documented 
   3.566 +# functions referencing it will be listed.
   3.567 +
   3.568 +REFERENCED_BY_RELATION = YES
   3.569 +
   3.570 +# If the REFERENCES_RELATION tag is set to YES (the default) 
   3.571 +# then for each documented function all documented entities 
   3.572 +# called/used by that function will be listed.
   3.573 +
   3.574 +REFERENCES_RELATION    = YES
   3.575 +
   3.576 +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
   3.577 +# will generate a verbatim copy of the header file for each class for 
   3.578 +# which an include is specified. Set to NO to disable this.
   3.579 +
   3.580 +VERBATIM_HEADERS       = YES
   3.581 +
   3.582 +#---------------------------------------------------------------------------
   3.583 +# configuration options related to the alphabetical class index
   3.584 +#---------------------------------------------------------------------------
   3.585 +
   3.586 +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
   3.587 +# of all compounds will be generated. Enable this if the project 
   3.588 +# contains a lot of classes, structs, unions or interfaces.
   3.589 +
   3.590 +ALPHABETICAL_INDEX     = NO
   3.591 +
   3.592 +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
   3.593 +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
   3.594 +# in which this list will be split (can be a number in the range [1..20])
   3.595 +
   3.596 +COLS_IN_ALPHA_INDEX    = 5
   3.597 +
   3.598 +# In case all classes in a project start with a common prefix, all 
   3.599 +# classes will be put under the same header in the alphabetical index. 
   3.600 +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
   3.601 +# should be ignored while generating the index headers.
   3.602 +
   3.603 +IGNORE_PREFIX          = 
   3.604 +
   3.605 +#---------------------------------------------------------------------------
   3.606 +# configuration options related to the HTML output
   3.607 +#---------------------------------------------------------------------------
   3.608 +
   3.609 +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
   3.610 +# generate HTML output.
   3.611 +
   3.612 +GENERATE_HTML          = YES
   3.613 +
   3.614 +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
   3.615 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   3.616 +# put in front of it. If left blank `html' will be used as the default path.
   3.617 +
   3.618 +HTML_OUTPUT            = html
   3.619 +
   3.620 +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
   3.621 +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
   3.622 +# doxygen will generate files with .html extension.
   3.623 +
   3.624 +HTML_FILE_EXTENSION    = .html
   3.625 +
   3.626 +# The HTML_HEADER tag can be used to specify a personal HTML header for 
   3.627 +# each generated HTML page. If it is left blank doxygen will generate a 
   3.628 +# standard header.
   3.629 +
   3.630 +HTML_HEADER            = 
   3.631 +
   3.632 +# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
   3.633 +# each generated HTML page. If it is left blank doxygen will generate a 
   3.634 +# standard footer.
   3.635 +
   3.636 +HTML_FOOTER            = 
   3.637 +
   3.638 +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
   3.639 +# style sheet that is used by each HTML page. It can be used to 
   3.640 +# fine-tune the look of the HTML output. If the tag is left blank doxygen 
   3.641 +# will generate a default style sheet. Note that doxygen will try to copy 
   3.642 +# the style sheet file to the HTML output directory, so don't put your own 
   3.643 +# stylesheet in the HTML output directory as well, or it will be erased!
   3.644 +
   3.645 +HTML_STYLESHEET        = 
   3.646 +
   3.647 +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
   3.648 +# files or namespaces will be aligned in HTML using tables. If set to 
   3.649 +# NO a bullet list will be used.
   3.650 +
   3.651 +HTML_ALIGN_MEMBERS     = YES
   3.652 +
   3.653 +# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
   3.654 +# will be generated that can be used as input for tools like the 
   3.655 +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
   3.656 +# of the generated HTML documentation.
   3.657 +
   3.658 +GENERATE_HTMLHELP      = NO
   3.659 +
   3.660 +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
   3.661 +# be used to specify the file name of the resulting .chm file. You 
   3.662 +# can add a path in front of the file if the result should not be 
   3.663 +# written to the html output directory.
   3.664 +
   3.665 +CHM_FILE               = 
   3.666 +
   3.667 +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
   3.668 +# be used to specify the location (absolute path including file name) of 
   3.669 +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
   3.670 +# the HTML help compiler on the generated index.hhp.
   3.671 +
   3.672 +HHC_LOCATION           = 
   3.673 +
   3.674 +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
   3.675 +# controls if a separate .chi index file is generated (YES) or that 
   3.676 +# it should be included in the master .chm file (NO).
   3.677 +
   3.678 +GENERATE_CHI           = NO
   3.679 +
   3.680 +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
   3.681 +# controls whether a binary table of contents is generated (YES) or a 
   3.682 +# normal table of contents (NO) in the .chm file.
   3.683 +
   3.684 +BINARY_TOC             = NO
   3.685 +
   3.686 +# The TOC_EXPAND flag can be set to YES to add extra items for group members 
   3.687 +# to the contents of the HTML help documentation and to the tree view.
   3.688 +
   3.689 +TOC_EXPAND             = NO
   3.690 +
   3.691 +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
   3.692 +# top of each HTML page. The value NO (the default) enables the index and 
   3.693 +# the value YES disables it.
   3.694 +
   3.695 +DISABLE_INDEX          = NO
   3.696 +
   3.697 +# This tag can be used to set the number of enum values (range [1..20]) 
   3.698 +# that doxygen will group on one line in the generated HTML documentation.
   3.699 +
   3.700 +ENUM_VALUES_PER_LINE   = 4
   3.701 +
   3.702 +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
   3.703 +# generated containing a tree-like index structure (just like the one that 
   3.704 +# is generated for HTML Help). For this to work a browser that supports 
   3.705 +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
   3.706 +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
   3.707 +# probably better off using the HTML help feature.
   3.708 +
   3.709 +GENERATE_TREEVIEW      = NO
   3.710 +
   3.711 +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
   3.712 +# used to set the initial width (in pixels) of the frame in which the tree 
   3.713 +# is shown.
   3.714 +
   3.715 +TREEVIEW_WIDTH         = 250
   3.716 +
   3.717 +#---------------------------------------------------------------------------
   3.718 +# configuration options related to the LaTeX output
   3.719 +#---------------------------------------------------------------------------
   3.720 +
   3.721 +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
   3.722 +# generate Latex output.
   3.723 +
   3.724 +GENERATE_LATEX         = YES
   3.725 +
   3.726 +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
   3.727 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   3.728 +# put in front of it. If left blank `latex' will be used as the default path.
   3.729 +
   3.730 +LATEX_OUTPUT           = latex
   3.731 +
   3.732 +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
   3.733 +# invoked. If left blank `latex' will be used as the default command name.
   3.734 +
   3.735 +LATEX_CMD_NAME         = latex
   3.736 +
   3.737 +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
   3.738 +# generate index for LaTeX. If left blank `makeindex' will be used as the 
   3.739 +# default command name.
   3.740 +
   3.741 +MAKEINDEX_CMD_NAME     = makeindex
   3.742 +
   3.743 +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
   3.744 +# LaTeX documents. This may be useful for small projects and may help to 
   3.745 +# save some trees in general.
   3.746 +
   3.747 +COMPACT_LATEX          = NO
   3.748 +
   3.749 +# The PAPER_TYPE tag can be used to set the paper type that is used 
   3.750 +# by the printer. Possible values are: a4, a4wide, letter, legal and 
   3.751 +# executive. If left blank a4wide will be used.
   3.752 +
   3.753 +PAPER_TYPE             = a4wide
   3.754 +
   3.755 +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
   3.756 +# packages that should be included in the LaTeX output.
   3.757 +
   3.758 +EXTRA_PACKAGES         = 
   3.759 +
   3.760 +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
   3.761 +# the generated latex document. The header should contain everything until 
   3.762 +# the first chapter. If it is left blank doxygen will generate a 
   3.763 +# standard header. Notice: only use this tag if you know what you are doing!
   3.764 +
   3.765 +LATEX_HEADER           = 
   3.766 +
   3.767 +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
   3.768 +# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
   3.769 +# contain links (just like the HTML output) instead of page references 
   3.770 +# This makes the output suitable for online browsing using a pdf viewer.
   3.771 +
   3.772 +PDF_HYPERLINKS         = YES
   3.773 +
   3.774 +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
   3.775 +# plain latex in the generated Makefile. Set this option to YES to get a 
   3.776 +# higher quality PDF documentation.
   3.777 +
   3.778 +USE_PDFLATEX           = YES
   3.779 +
   3.780 +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
   3.781 +# command to the generated LaTeX files. This will instruct LaTeX to keep 
   3.782 +# running if errors occur, instead of asking the user for help. 
   3.783 +# This option is also used when generating formulas in HTML.
   3.784 +
   3.785 +LATEX_BATCHMODE        = NO
   3.786 +
   3.787 +# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
   3.788 +# include the index chapters (such as File Index, Compound Index, etc.) 
   3.789 +# in the output.
   3.790 +
   3.791 +LATEX_HIDE_INDICES     = NO
   3.792 +
   3.793 +#---------------------------------------------------------------------------
   3.794 +# configuration options related to the RTF output
   3.795 +#---------------------------------------------------------------------------
   3.796 +
   3.797 +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
   3.798 +# The RTF output is optimized for Word 97 and may not look very pretty with 
   3.799 +# other RTF readers or editors.
   3.800 +
   3.801 +GENERATE_RTF           = NO
   3.802 +
   3.803 +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
   3.804 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   3.805 +# put in front of it. If left blank `rtf' will be used as the default path.
   3.806 +
   3.807 +RTF_OUTPUT             = rtf
   3.808 +
   3.809 +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
   3.810 +# RTF documents. This may be useful for small projects and may help to 
   3.811 +# save some trees in general.
   3.812 +
   3.813 +COMPACT_RTF            = NO
   3.814 +
   3.815 +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
   3.816 +# will contain hyperlink fields. The RTF file will 
   3.817 +# contain links (just like the HTML output) instead of page references. 
   3.818 +# This makes the output suitable for online browsing using WORD or other 
   3.819 +# programs which support those fields. 
   3.820 +# Note: wordpad (write) and others do not support links.
   3.821 +
   3.822 +RTF_HYPERLINKS         = NO
   3.823 +
   3.824 +# Load stylesheet definitions from file. Syntax is similar to doxygen's 
   3.825 +# config file, i.e. a series of assignments. You only have to provide 
   3.826 +# replacements, missing definitions are set to their default value.
   3.827 +
   3.828 +RTF_STYLESHEET_FILE    = 
   3.829 +
   3.830 +# Set optional variables used in the generation of an rtf document. 
   3.831 +# Syntax is similar to doxygen's config file.
   3.832 +
   3.833 +RTF_EXTENSIONS_FILE    = 
   3.834 +
   3.835 +#---------------------------------------------------------------------------
   3.836 +# configuration options related to the man page output
   3.837 +#---------------------------------------------------------------------------
   3.838 +
   3.839 +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
   3.840 +# generate man pages
   3.841 +
   3.842 +GENERATE_MAN           = NO
   3.843 +
   3.844 +# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
   3.845 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   3.846 +# put in front of it. If left blank `man' will be used as the default path.
   3.847 +
   3.848 +MAN_OUTPUT             = man
   3.849 +
   3.850 +# The MAN_EXTENSION tag determines the extension that is added to 
   3.851 +# the generated man pages (default is the subroutine's section .3)
   3.852 +
   3.853 +MAN_EXTENSION          = .3
   3.854 +
   3.855 +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
   3.856 +# then it will generate one additional man file for each entity 
   3.857 +# documented in the real man page(s). These additional files 
   3.858 +# only source the real man page, but without them the man command 
   3.859 +# would be unable to find the correct page. The default is NO.
   3.860 +
   3.861 +MAN_LINKS              = NO
   3.862 +
   3.863 +#---------------------------------------------------------------------------
   3.864 +# configuration options related to the XML output
   3.865 +#---------------------------------------------------------------------------
   3.866 +
   3.867 +# If the GENERATE_XML tag is set to YES Doxygen will 
   3.868 +# generate an XML file that captures the structure of 
   3.869 +# the code including all documentation.
   3.870 +
   3.871 +GENERATE_XML           = NO
   3.872 +
   3.873 +# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
   3.874 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   3.875 +# put in front of it. If left blank `xml' will be used as the default path.
   3.876 +
   3.877 +XML_OUTPUT             = xml
   3.878 +
   3.879 +# The XML_SCHEMA tag can be used to specify an XML schema, 
   3.880 +# which can be used by a validating XML parser to check the 
   3.881 +# syntax of the XML files.
   3.882 +
   3.883 +XML_SCHEMA             = 
   3.884 +
   3.885 +# The XML_DTD tag can be used to specify an XML DTD, 
   3.886 +# which can be used by a validating XML parser to check the 
   3.887 +# syntax of the XML files.
   3.888 +
   3.889 +XML_DTD                = 
   3.890 +
   3.891 +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
   3.892 +# dump the program listings (including syntax highlighting 
   3.893 +# and cross-referencing information) to the XML output. Note that 
   3.894 +# enabling this will significantly increase the size of the XML output.
   3.895 +
   3.896 +XML_PROGRAMLISTING     = YES
   3.897 +
   3.898 +#---------------------------------------------------------------------------
   3.899 +# configuration options for the AutoGen Definitions output
   3.900 +#---------------------------------------------------------------------------
   3.901 +
   3.902 +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
   3.903 +# generate an AutoGen Definitions (see autogen.sf.net) file 
   3.904 +# that captures the structure of the code including all 
   3.905 +# documentation. Note that this feature is still experimental 
   3.906 +# and incomplete at the moment.
   3.907 +
   3.908 +GENERATE_AUTOGEN_DEF   = NO
   3.909 +
   3.910 +#---------------------------------------------------------------------------
   3.911 +# configuration options related to the Perl module output
   3.912 +#---------------------------------------------------------------------------
   3.913 +
   3.914 +# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
   3.915 +# generate a Perl module file that captures the structure of 
   3.916 +# the code including all documentation. Note that this 
   3.917 +# feature is still experimental and incomplete at the 
   3.918 +# moment.
   3.919 +
   3.920 +GENERATE_PERLMOD       = NO
   3.921 +
   3.922 +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
   3.923 +# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
   3.924 +# to generate PDF and DVI output from the Perl module output.
   3.925 +
   3.926 +PERLMOD_LATEX          = NO
   3.927 +
   3.928 +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
   3.929 +# nicely formatted so it can be parsed by a human reader.  This is useful 
   3.930 +# if you want to understand what is going on.  On the other hand, if this 
   3.931 +# tag is set to NO the size of the Perl module output will be much smaller 
   3.932 +# and Perl will parse it just the same.
   3.933 +
   3.934 +PERLMOD_PRETTY         = YES
   3.935 +
   3.936 +# The names of the make variables in the generated doxyrules.make file 
   3.937 +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
   3.938 +# This is useful so different doxyrules.make files included by the same 
   3.939 +# Makefile don't overwrite each other's variables.
   3.940 +
   3.941 +PERLMOD_MAKEVAR_PREFIX = 
   3.942 +
   3.943 +#---------------------------------------------------------------------------
   3.944 +# Configuration options related to the preprocessor   
   3.945 +#---------------------------------------------------------------------------
   3.946 +
   3.947 +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
   3.948 +# evaluate all C-preprocessor directives found in the sources and include 
   3.949 +# files.
   3.950 +
   3.951 +ENABLE_PREPROCESSING   = YES
   3.952 +
   3.953 +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
   3.954 +# names in the source code. If set to NO (the default) only conditional 
   3.955 +# compilation will be performed. Macro expansion can be done in a controlled 
   3.956 +# way by setting EXPAND_ONLY_PREDEF to YES.
   3.957 +
   3.958 +MACRO_EXPANSION        = NO
   3.959 +
   3.960 +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
   3.961 +# then the macro expansion is limited to the macros specified with the 
   3.962 +# PREDEFINED and EXPAND_AS_PREDEFINED tags.
   3.963 +
   3.964 +EXPAND_ONLY_PREDEF     = NO
   3.965 +
   3.966 +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
   3.967 +# in the INCLUDE_PATH (see below) will be search if a #include is found.
   3.968 +
   3.969 +SEARCH_INCLUDES        = YES
   3.970 +
   3.971 +# The INCLUDE_PATH tag can be used to specify one or more directories that 
   3.972 +# contain include files that are not input files but should be processed by 
   3.973 +# the preprocessor.
   3.974 +
   3.975 +INCLUDE_PATH           = 
   3.976 +
   3.977 +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
   3.978 +# patterns (like *.h and *.hpp) to filter out the header-files in the 
   3.979 +# directories. If left blank, the patterns specified with FILE_PATTERNS will 
   3.980 +# be used.
   3.981 +
   3.982 +INCLUDE_FILE_PATTERNS  = 
   3.983 +
   3.984 +# The PREDEFINED tag can be used to specify one or more macro names that 
   3.985 +# are defined before the preprocessor is started (similar to the -D option of 
   3.986 +# gcc). The argument of the tag is a list of macros of the form: name 
   3.987 +# or name=definition (no spaces). If the definition and the = are 
   3.988 +# omitted =1 is assumed. To prevent a macro definition from being 
   3.989 +# undefined via #undef or recursively expanded use the := operator 
   3.990 +# instead of the = operator.
   3.991 +
   3.992 +PREDEFINED             = 
   3.993 +
   3.994 +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
   3.995 +# this tag can be used to specify a list of macro names that should be expanded. 
   3.996 +# The macro definition that is found in the sources will be used. 
   3.997 +# Use the PREDEFINED tag if you want to use a different macro definition.
   3.998 +
   3.999 +EXPAND_AS_DEFINED      = 
  3.1000 +
  3.1001 +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
  3.1002 +# doxygen's preprocessor will remove all function-like macros that are alone 
  3.1003 +# on a line, have an all uppercase name, and do not end with a semicolon. Such 
  3.1004 +# function macros are typically used for boiler-plate code, and will confuse 
  3.1005 +# the parser if not removed.
  3.1006 +
  3.1007 +SKIP_FUNCTION_MACROS   = YES
  3.1008 +
  3.1009 +#---------------------------------------------------------------------------
  3.1010 +# Configuration::additions related to external references   
  3.1011 +#---------------------------------------------------------------------------
  3.1012 +
  3.1013 +# The TAGFILES option can be used to specify one or more tagfiles. 
  3.1014 +# Optionally an initial location of the external documentation 
  3.1015 +# can be added for each tagfile. The format of a tag file without 
  3.1016 +# this location is as follows: 
  3.1017 +#   TAGFILES = file1 file2 ... 
  3.1018 +# Adding location for the tag files is done as follows: 
  3.1019 +#   TAGFILES = file1=loc1 "file2 = loc2" ... 
  3.1020 +# where "loc1" and "loc2" can be relative or absolute paths or 
  3.1021 +# URLs. If a location is present for each tag, the installdox tool 
  3.1022 +# does not have to be run to correct the links.
  3.1023 +# Note that each tag file must have a unique name
  3.1024 +# (where the name does NOT include the path)
  3.1025 +# If a tag file is not located in the directory in which doxygen 
  3.1026 +# is run, you must also specify the path to the tagfile here.
  3.1027 +
  3.1028 +TAGFILES               = 
  3.1029 +
  3.1030 +# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
  3.1031 +# a tag file that is based on the input files it reads.
  3.1032 +
  3.1033 +GENERATE_TAGFILE       = 
  3.1034 +
  3.1035 +# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
  3.1036 +# in the class index. If set to NO only the inherited external classes 
  3.1037 +# will be listed.
  3.1038 +
  3.1039 +ALLEXTERNALS           = NO
  3.1040 +
  3.1041 +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
  3.1042 +# in the modules index. If set to NO, only the current project's groups will 
  3.1043 +# be listed.
  3.1044 +
  3.1045 +EXTERNAL_GROUPS        = YES
  3.1046 +
  3.1047 +# The PERL_PATH should be the absolute path and name of the perl script 
  3.1048 +# interpreter (i.e. the result of `which perl').
  3.1049 +
  3.1050 +PERL_PATH              = /usr/bin/perl
  3.1051 +
  3.1052 +#---------------------------------------------------------------------------
  3.1053 +# Configuration options related to the dot tool   
  3.1054 +#---------------------------------------------------------------------------
  3.1055 +
  3.1056 +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
  3.1057 +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
  3.1058 +# or super classes. Setting the tag to NO turns the diagrams off. Note that 
  3.1059 +# this option is superseded by the HAVE_DOT option below. This is only a 
  3.1060 +# fallback. It is recommended to install and use dot, since it yields more 
  3.1061 +# powerful graphs.
  3.1062 +
  3.1063 +CLASS_DIAGRAMS         = YES
  3.1064 +
  3.1065 +# If set to YES, the inheritance and collaboration graphs will hide 
  3.1066 +# inheritance and usage relations if the target is undocumented 
  3.1067 +# or is not a class.
  3.1068 +
  3.1069 +HIDE_UNDOC_RELATIONS   = YES
  3.1070 +
  3.1071 +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
  3.1072 +# available from the path. This tool is part of Graphviz, a graph visualization 
  3.1073 +# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
  3.1074 +# have no effect if this option is set to NO (the default)
  3.1075 +
  3.1076 +HAVE_DOT               = NO
  3.1077 +
  3.1078 +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
  3.1079 +# will generate a graph for each documented class showing the direct and 
  3.1080 +# indirect inheritance relations. Setting this tag to YES will force the 
  3.1081 +# the CLASS_DIAGRAMS tag to NO.
  3.1082 +
  3.1083 +CLASS_GRAPH            = YES
  3.1084 +
  3.1085 +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
  3.1086 +# will generate a graph for each documented class showing the direct and 
  3.1087 +# indirect implementation dependencies (inheritance, containment, and 
  3.1088 +# class references variables) of the class with other documented classes.
  3.1089 +
  3.1090 +COLLABORATION_GRAPH    = YES
  3.1091 +
  3.1092 +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
  3.1093 +# will generate a graph for groups, showing the direct groups dependencies
  3.1094 +
  3.1095 +GROUP_GRAPHS           = YES
  3.1096 +
  3.1097 +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
  3.1098 +# collaboration diagrams in a style similar to the OMG's Unified Modeling 
  3.1099 +# Language.
  3.1100 +
  3.1101 +UML_LOOK               = NO
  3.1102 +
  3.1103 +# If set to YES, the inheritance and collaboration graphs will show the 
  3.1104 +# relations between templates and their instances.
  3.1105 +
  3.1106 +TEMPLATE_RELATIONS     = NO
  3.1107 +
  3.1108 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
  3.1109 +# tags are set to YES then doxygen will generate a graph for each documented 
  3.1110 +# file showing the direct and indirect include dependencies of the file with 
  3.1111 +# other documented files.
  3.1112 +
  3.1113 +INCLUDE_GRAPH          = YES
  3.1114 +
  3.1115 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
  3.1116 +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
  3.1117 +# documented header file showing the documented files that directly or 
  3.1118 +# indirectly include this file.
  3.1119 +
  3.1120 +INCLUDED_BY_GRAPH      = YES
  3.1121 +
  3.1122 +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
  3.1123 +# generate a call dependency graph for every global function or class method. 
  3.1124 +# Note that enabling this option will significantly increase the time of a run. 
  3.1125 +# So in most cases it will be better to enable call graphs for selected 
  3.1126 +# functions only using the \callgraph command.
  3.1127 +
  3.1128 +CALL_GRAPH             = NO
  3.1129 +
  3.1130 +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
  3.1131 +# will graphical hierarchy of all classes instead of a textual one.
  3.1132 +
  3.1133 +GRAPHICAL_HIERARCHY    = YES
  3.1134 +
  3.1135 +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
  3.1136 +# then doxygen will show the dependencies a directory has on other directories 
  3.1137 +# in a graphical way. The dependency relations are determined by the #include
  3.1138 +# relations between the files in the directories.
  3.1139 +
  3.1140 +DIRECTORY_GRAPH        = YES
  3.1141 +
  3.1142 +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
  3.1143 +# generated by dot. Possible values are png, jpg, or gif
  3.1144 +# If left blank png will be used.
  3.1145 +
  3.1146 +DOT_IMAGE_FORMAT       = png
  3.1147 +
  3.1148 +# The tag DOT_PATH can be used to specify the path where the dot tool can be 
  3.1149 +# found. If left blank, it is assumed the dot tool can be found in the path.
  3.1150 +
  3.1151 +DOT_PATH               = 
  3.1152 +
  3.1153 +# The DOTFILE_DIRS tag can be used to specify one or more directories that 
  3.1154 +# contain dot files that are included in the documentation (see the 
  3.1155 +# \dotfile command).
  3.1156 +
  3.1157 +DOTFILE_DIRS           = 
  3.1158 +
  3.1159 +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
  3.1160 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
  3.1161 +# this value, doxygen will try to truncate the graph, so that it fits within 
  3.1162 +# the specified constraint. Beware that most browsers cannot cope with very 
  3.1163 +# large images.
  3.1164 +
  3.1165 +MAX_DOT_GRAPH_WIDTH    = 1024
  3.1166 +
  3.1167 +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
  3.1168 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
  3.1169 +# this value, doxygen will try to truncate the graph, so that it fits within 
  3.1170 +# the specified constraint. Beware that most browsers cannot cope with very 
  3.1171 +# large images.
  3.1172 +
  3.1173 +MAX_DOT_GRAPH_HEIGHT   = 1024
  3.1174 +
  3.1175 +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
  3.1176 +# graphs generated by dot. A depth value of 3 means that only nodes reachable 
  3.1177 +# from the root by following a path via at most 3 edges will be shown. Nodes 
  3.1178 +# that lay further from the root node will be omitted. Note that setting this 
  3.1179 +# option to 1 or 2 may greatly reduce the computation time needed for large 
  3.1180 +# code bases. Also note that a graph may be further truncated if the graph's 
  3.1181 +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
  3.1182 +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
  3.1183 +# the graph is not depth-constrained.
  3.1184 +
  3.1185 +MAX_DOT_GRAPH_DEPTH    = 0
  3.1186 +
  3.1187 +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
  3.1188 +# background. This is disabled by default, which results in a white background. 
  3.1189 +# Warning: Depending on the platform used, enabling this option may lead to 
  3.1190 +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
  3.1191 +# read).
  3.1192 +
  3.1193 +DOT_TRANSPARENT        = NO
  3.1194 +
  3.1195 +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
  3.1196 +# files in one run (i.e. multiple -o and -T options on the command line). This 
  3.1197 +# makes dot run faster, but since only newer versions of dot (>1.8.10) 
  3.1198 +# support this, this feature is disabled by default.
  3.1199 +
  3.1200 +DOT_MULTI_TARGETS      = NO
  3.1201 +
  3.1202 +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
  3.1203 +# generate a legend page explaining the meaning of the various boxes and 
  3.1204 +# arrows in the dot generated graphs.
  3.1205 +
  3.1206 +GENERATE_LEGEND        = YES
  3.1207 +
  3.1208 +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
  3.1209 +# remove the intermediate dot files that are used to generate 
  3.1210 +# the various graphs.
  3.1211 +
  3.1212 +DOT_CLEANUP            = YES
  3.1213 +
  3.1214 +#---------------------------------------------------------------------------
  3.1215 +# Configuration::additions related to the search engine   
  3.1216 +#---------------------------------------------------------------------------
  3.1217 +
  3.1218 +# The SEARCHENGINE tag specifies whether or not a search engine should be 
  3.1219 +# used. If set to NO the values of all tags below this one will be ignored.
  3.1220 +
  3.1221 +SEARCHENGINE           = NO
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/docs/Doxyfilter	Tue Sep 13 10:14:16 2005 -0600
     4.3 @@ -0,0 +1,16 @@
     4.4 +#!/bin/sh
     4.5 +
     4.6 +#
     4.7 +# Doxyfilter <source-root> <filename>
     4.8 +#
     4.9 +
    4.10 +dir=$(dirname "$0")
    4.11 +
    4.12 +PYFILTER="$dir/pythfilter.py"
    4.13 +
    4.14 +if [ "${2/.py/}" != "$2" ]
    4.15 +then
    4.16 +    python "$PYFILTER" -r "$1" -f "$2"
    4.17 +else
    4.18 +    cat "$2"
    4.19 +fi
     5.1 --- a/docs/Makefile	Fri Sep 09 10:31:36 2005 -0600
     5.2 +++ b/docs/Makefile	Tue Sep 13 10:14:16 2005 -0600
     5.3 @@ -8,6 +8,7 @@ DVIPS		:= dvips
     5.4  LATEX		:= latex
     5.5  FIG2DEV		:= fig2dev
     5.6  LATEX2HTML	:= latex2html
     5.7 +DOXYGEN		:= doxygen
     5.8  
     5.9  pkgdocdir	:= /usr/share/doc/xen
    5.10  
    5.11 @@ -18,10 +19,14 @@ DOC_HTML	:= $(patsubst src/%.tex,html/%/
    5.12  
    5.13  GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
    5.14  
    5.15 +.PHONY:	all build dev-docs python-dev-docs ps pdf html clean install
    5.16 +
    5.17  all: build
    5.18  build: ps pdf html
    5.19  	rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
    5.20  
    5.21 +dev-docs: python-dev-docs
    5.22 +
    5.23  ps: $(DOC_PS)
    5.24  
    5.25  pdf: $(DOC_PDF)
    5.26 @@ -30,10 +35,18 @@ html:
    5.27  	@if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
    5.28  	$(MAKE) $(DOC_HTML); fi
    5.29  
    5.30 +python-dev-docs:
    5.31 +	mkdir -p api/tools/python
    5.32 +	@if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then         \
    5.33 +        echo "Running doxygen to generate Python tools APIs ... "; \
    5.34 +	$(DOXYGEN) Doxyfile;                                       \
    5.35 +	$(MAKE) -C api/tools/python/latex ; fi
    5.36 +
    5.37  clean:
    5.38  	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
    5.39  	rm -rf *.ilg *.log *.ind *.toc *.bak core
    5.40  	rm -rf $(GFX) ps pdf html
    5.41 +	rm -rf api
    5.42  
    5.43  install: all
    5.44  	rm -rf $(DESTDIR)$(pkgdocdir)
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/docs/pythfilter.py	Tue Sep 13 10:14:16 2005 -0600
     6.3 @@ -0,0 +1,658 @@
     6.4 +#!/usr/bin/env python
     6.5 +
     6.6 +# pythfilter.py v1.5.5, written by Matthias Baas (baas@ira.uka.de)
     6.7 +
     6.8 +# Doxygen filter which can be used to document Python source code.
     6.9 +# Classes (incl. methods) and functions can be documented.
    6.10 +# Every comment that begins with ## is literally turned into an
    6.11 +# Doxygen comment. Consecutive comment lines are turned into
    6.12 +# comment blocks (-> /** ... */).
    6.13 +# All the stuff is put inside a namespace with the same name as
    6.14 +# the source file.
    6.15 +
    6.16 +# Conversions:
    6.17 +# ============
    6.18 +# ##-blocks                  ->  /** ... */
    6.19 +# "class name(base): ..."    ->  "class name : public base {...}"
    6.20 +# "def name(params): ..."    ->  "name(params) {...}"
    6.21 +
    6.22 +# Changelog:
    6.23 +# 21.01.2003: Raw (r"") or unicode (u"") doc string will now be properly
    6.24 +#             handled. (thanks to Richard Laager for the patch)
    6.25 +# 22.12.2003: Fixed a bug where no function names would be output for "def"
    6.26 +#             blocks that were not in a class.
    6.27 +#             (thanks to Richard Laager for the patch)
    6.28 +# 12.12.2003: Implemented code to handle static and class methods with
    6.29 +#             this logic: Methods with "self" as the first argument are
    6.30 +#             non-static. Methods with "cls" are Python class methods,
    6.31 +#             which translate into static methods for Doxygen. Other
    6.32 +#             methods are assumed to be static methods. As should be
    6.33 +#             obvious, this logic doesn't take into account if the method
    6.34 +#             is actually setup as a classmethod() or a staticmethod(),
    6.35 +#             just if it follows the normal conventions.
    6.36 +#             (thanks to Richard Laager for the patch)
    6.37 +# 11.12.2003: Corrected #includes to use os.path.sep instead of ".". Corrected
    6.38 +#             namespace code to use "::" instead of ".".
    6.39 +#             (thanks to Richard Laager for the patch)
    6.40 +# 11.12.2003: Methods beginning with two underscores that end with
    6.41 +#             something other than two underscores are considered private
    6.42 +#             and are handled accordingly.
    6.43 +#             (thanks to Richard Laager for the patch)
    6.44 +# 03.12.2003: The first parameter of class methods (self) is removed from
    6.45 +#             the documentation.
    6.46 +# 03.11.2003: The module docstring will be used as namespace documentation
    6.47 +#             (thanks to Joe Bronkema for the patch)
    6.48 +# 08.07.2003: Namespaces get a default documentation so that the namespace
    6.49 +#             and its contents will show up in the generated documentation.
    6.50 +# 05.02.2003: Directories will be delted during synchronization.
    6.51 +# 31.01.2003: -f option & filtering entire directory trees.
    6.52 +# 10.08.2002: In base classes the '.' will be replaced by '::'
    6.53 +# 18.07.2002: * and ** will be translated into arguments
    6.54 +# 18.07.2002: Argument lists may contain default values using constructors.
    6.55 +# 18.06.2002: Support for ## public:
    6.56 +# 21.01.2002: from ... import will be translated to "using namespace ...;"
    6.57 +#             TODO: "from ... import *" vs "from ... import names"
    6.58 +#             TODO: Using normal imports: name.name -> name::name
    6.59 +# 20.01.2002: #includes will be placed in front of the namespace
    6.60 +
    6.61 +######################################################################
    6.62 +
    6.63 +# The program is written as a state machine with the following states:
    6.64 +#
    6.65 +# - OUTSIDE               The current position is outside any comment,
    6.66 +#                         class definition or function.
    6.67 +#
    6.68 +# - BUILD_COMMENT         Begins with first "##".
    6.69 +#                         Ends with the first token that is no "##"
    6.70 +#                         at the same column as before.
    6.71 +#
    6.72 +# - BUILD_CLASS_DECL      Begins with "class".
    6.73 +#                         Ends with ":"
    6.74 +# - BUILD_CLASS_BODY      Begins just after BUILD_CLASS_DECL.
    6.75 +#                         The first following token (which is no comment)
    6.76 +#                         determines indentation depth.
    6.77 +#                         Ends with a token that has a smaller indendation.
    6.78 +#
    6.79 +# - BUILD_DEF_DECL        Begins with "def".
    6.80 +#                         Ends with ":".
    6.81 +# - BUILD_DEF_BODY        Begins just after BUILD_DEF_DECL.
    6.82 +#                         The first following token (which is no comment)
    6.83 +#                         determines indentation depth.
    6.84 +#                         Ends with a token that has a smaller indendation.
    6.85 +
    6.86 +import getopt
    6.87 +import glob
    6.88 +import os.path
    6.89 +import re
    6.90 +import shutil
    6.91 +import string
    6.92 +import sys
    6.93 +import token
    6.94 +import tokenize
    6.95 +
    6.96 +from stat import *
    6.97 +
    6.98 +OUTSIDE          = 0
    6.99 +BUILD_COMMENT    = 1
   6.100 +BUILD_CLASS_DECL = 2
   6.101 +BUILD_CLASS_BODY = 3
   6.102 +BUILD_DEF_DECL   = 4
   6.103 +BUILD_DEF_BODY   = 5
   6.104 +IMPORT           = 6
   6.105 +IMPORT_OP        = 7
   6.106 +IMPORT_APPEND    = 8
   6.107 +
   6.108 +# Output file stream
   6.109 +outfile = sys.stdout
   6.110 +
   6.111 +# Output buffer
   6.112 +outbuffer = []
   6.113 +
   6.114 +out_row = 1
   6.115 +out_col = 0
   6.116 +
   6.117 +# Variables used by rec_name_n_param()
   6.118 +name         = ""
   6.119 +param        = ""
   6.120 +doc_string   = ""
   6.121 +record_state = 0
   6.122 +bracket_counter = 0
   6.123 +
   6.124 +# Tuple: (row,column)
   6.125 +class_spos  = (0,0)
   6.126 +def_spos    = (0,0)
   6.127 +import_spos = (0,0)
   6.128 +
   6.129 +# Which import was used? ("import" or "from")
   6.130 +import_token = ""
   6.131 +
   6.132 +# Comment block buffer
   6.133 +comment_block = []
   6.134 +comment_finished = 0
   6.135 +
   6.136 +# Imported modules
   6.137 +modules = []
   6.138 +
   6.139 +# Program state
   6.140 +stateStack = [OUTSIDE]
   6.141 +
   6.142 +# Keep track of whether module has a docstring
   6.143 +module_has_docstring = False
   6.144 +
   6.145 +# Keep track of member protection
   6.146 +protection_level = "public"
   6.147 +private_member = False
   6.148 +
   6.149 +# Keep track of the module namespace
   6.150 +namespace = ""
   6.151 +
   6.152 +######################################################################
   6.153 +# Output string s. '\n' may only be at the end of the string (not
   6.154 +# somewhere in the middle).
   6.155 +#
   6.156 +# In: s    - String
   6.157 +#     spos - Startpos
   6.158 +######################################################################
   6.159 +def output(s,spos, immediate=0):
   6.160 +    global outbuffer, out_row, out_col, outfile
   6.161 +
   6.162 +    os = string.rjust(s,spos[1]-out_col+len(s))
   6.163 +
   6.164 +    if immediate:
   6.165 +        outfile.write(os)
   6.166 +    else:
   6.167 +        outbuffer.append(os)
   6.168 +
   6.169 +    assert -1 == string.find(s[0:-2], "\n"), s
   6.170 +
   6.171 +    if (s[-1:]=="\n"):
   6.172 +        out_row = out_row+1
   6.173 +        out_col = 0
   6.174 +    else:
   6.175 +        out_col = spos[1]+len(s)
   6.176 +
   6.177 +
   6.178 +######################################################################
   6.179 +# Records a name and parameters. The name is either a class name or
   6.180 +# a function name. Then the parameter is either the base class or
   6.181 +# the function parameters.
   6.182 +# The name is stored in the global variable "name", the parameters
   6.183 +# in "param".
   6.184 +# The variable "record_state" holds the current state of this internal
   6.185 +# state machine.
   6.186 +# The recording is started by calling start_recording().
   6.187 +#
   6.188 +# In: type, tok
   6.189 +######################################################################
   6.190 +def rec_name_n_param(type, tok):
   6.191 +    global record_state,name,param,doc_string,bracket_counter
   6.192 +    s = record_state
   6.193 +    # State 0: Do nothing.
   6.194 +    if   (s==0):
   6.195 +         return
   6.196 +    # State 1: Remember name.
   6.197 +    elif (s==1):
   6.198 +        name = tok
   6.199 +        record_state = 2
   6.200 +    # State 2: Wait for opening bracket or colon
   6.201 +    elif (s==2):
   6.202 +        if (tok=='('):
   6.203 +            bracket_counter = 1
   6.204 +            record_state=3
   6.205 +        if (tok==':'): record_state=4
   6.206 +    # State 3: Store parameter (or base class) and wait for an ending bracket
   6.207 +    elif (s==3):
   6.208 +        if (tok=='*' or tok=='**'):
   6.209 +            tok=''
   6.210 +        if (tok=='('):
   6.211 +            bracket_counter = bracket_counter+1
   6.212 +        if (tok==')'):
   6.213 +            bracket_counter = bracket_counter-1
   6.214 +        if bracket_counter==0:
   6.215 +            record_state=4
   6.216 +        else:
   6.217 +            param=param+tok
   6.218 +    # State 4: Look for doc string
   6.219 +    elif (s==4):
   6.220 +        if (type==token.NEWLINE or type==token.INDENT or type==token.SLASHEQUAL):
   6.221 +            return
   6.222 +        elif (tok==":"):
   6.223 +            return
   6.224 +        elif (type==token.STRING):
   6.225 +            while tok[:1]=='r' or tok[:1]=='u':
   6.226 +                tok=tok[1:]
   6.227 +            while tok[:1]=='"':
   6.228 +                tok=tok[1:]
   6.229 +            while tok[-1:]=='"':
   6.230 +                tok=tok[:-1]
   6.231 +            doc_string=tok
   6.232 +        record_state=0
   6.233 +
   6.234 +######################################################################
   6.235 +# Starts the recording of a name & param part.
   6.236 +# The function rec_name_n_param() has to be fed with tokens. After
   6.237 +# the necessary tokens are fed the name and parameters can be found
   6.238 +# in the global variables "name" und "param".
   6.239 +######################################################################
   6.240 +def start_recording():
   6.241 +    global record_state,param,name, doc_string
   6.242 +    record_state=1
   6.243 +    name=""
   6.244 +    param=""
   6.245 +    doc_string=""
   6.246 +
   6.247 +######################################################################
   6.248 +# Test if recording is finished
   6.249 +######################################################################
   6.250 +def is_recording_finished():
   6.251 +    global record_state
   6.252 +    return record_state==0
   6.253 +
   6.254 +######################################################################
   6.255 +## Gather comment block
   6.256 +######################################################################
   6.257 +def gather_comment(type,tok,spos):
   6.258 +    global comment_block,comment_finished
   6.259 +    if (type!=tokenize.COMMENT):
   6.260 +        comment_finished = 1
   6.261 +    else:
   6.262 +        # Output old comment block if a new one is started.
   6.263 +        if (comment_finished):
   6.264 +            print_comment(spos)
   6.265 +            comment_finished=0
   6.266 +        if (tok[0:2]=="##" and tok[0:3]!="###"):
   6.267 +            append_comment_lines(tok[2:])
   6.268 +
   6.269 +######################################################################
   6.270 +## Output comment block and empty buffer.
   6.271 +######################################################################
   6.272 +def print_comment(spos):
   6.273 +    global comment_block,comment_finished
   6.274 +    if (comment_block!=[]):
   6.275 +        output("/** ",spos)
   6.276 +        for c in comment_block:
   6.277 +            output(c,spos)
   6.278 +        output("*/\n",spos)
   6.279 +    comment_block    = []
   6.280 +    comment_finished = 0
   6.281 +
   6.282 +######################################################################
   6.283 +def set_state(s):
   6.284 +    global stateStack
   6.285 +    stateStack[len(stateStack)-1]=s
   6.286 +
   6.287 +######################################################################
   6.288 +def get_state():
   6.289 +    global stateStack
   6.290 +    return stateStack[len(stateStack)-1]
   6.291 +
   6.292 +######################################################################
   6.293 +def push_state(s):
   6.294 +    global stateStack
   6.295 +    stateStack.append(s)
   6.296 +
   6.297 +######################################################################
   6.298 +def pop_state():
   6.299 +    global stateStack
   6.300 +    stateStack.pop()
   6.301 +
   6.302 +
   6.303 +######################################################################
   6.304 +def tok_eater(type, tok, spos, epos, line):
   6.305 +    global stateStack,name,param,class_spos,def_spos,import_spos
   6.306 +    global doc_string, modules, import_token, module_has_docstring
   6.307 +    global protection_level, private_member
   6.308 +    global out_row
   6.309 +
   6.310 +    while out_row + 1 < spos[0]:
   6.311 +        output("\n", (0, 0))
   6.312 +
   6.313 +    rec_name_n_param(type,tok)
   6.314 +    if (string.replace(string.strip(tok)," ","")=="##private:"):
   6.315 +         protection_level = "private"
   6.316 +         output("private:\n",spos)
   6.317 +    elif (string.replace(string.strip(tok)," ","")=="##protected:"):
   6.318 +         protection_level = "protected"
   6.319 +         output("protected:\n",spos)
   6.320 +    elif (string.replace(string.strip(tok)," ","")=="##public:"):
   6.321 +         protection_level = "public"
   6.322 +         output("public:\n",spos)
   6.323 +    else:
   6.324 +         gather_comment(type,tok,spos)
   6.325 +
   6.326 +    state = get_state()
   6.327 +
   6.328 +#    sys.stderr.write("%d: %s\n"%(state, tok))
   6.329 +
   6.330 +    # OUTSIDE
   6.331 +    if   (state==OUTSIDE):
   6.332 +        if  (tok=="class"):
   6.333 +            start_recording()
   6.334 +            class_spos = spos
   6.335 +            push_state(BUILD_CLASS_DECL)
   6.336 +        elif (tok=="def"):
   6.337 +            start_recording()
   6.338 +            def_spos = spos
   6.339 +            push_state(BUILD_DEF_DECL)
   6.340 +        elif (tok=="import") or (tok=="from"):
   6.341 +            import_token = tok
   6.342 +            import_spos = spos
   6.343 +            modules     = []
   6.344 +            push_state(IMPORT)
   6.345 +        elif (spos[1] == 0 and tok[:3] == '"""'):
   6.346 +            # Capture module docstring as namespace documentation
   6.347 +            module_has_docstring = True
   6.348 +            append_comment_lines("\\namespace %s\n" % namespace)
   6.349 +            append_comment_lines(tok[3:-3])
   6.350 +            print_comment(spos)
   6.351 +
   6.352 +    # IMPORT
   6.353 +    elif (state==IMPORT):
   6.354 +        if (type==token.NAME):
   6.355 +            modules.append(tok)
   6.356 +            set_state(IMPORT_OP)
   6.357 +    # IMPORT_OP
   6.358 +    elif (state==IMPORT_OP):
   6.359 +        if (tok=="."):
   6.360 +            set_state(IMPORT_APPEND)
   6.361 +        elif (tok==","):
   6.362 +            set_state(IMPORT)
   6.363 +        else:
   6.364 +            for m in modules:
   6.365 +                output('#include "'+m.replace('.',os.path.sep)+'.py"\n', import_spos, immediate=1)
   6.366 +                if import_token=="from":
   6.367 +                    output('using namespace '+m.replace('.', '::')+';\n', import_spos)
   6.368 +            pop_state()
   6.369 +    # IMPORT_APPEND
   6.370 +    elif (state==IMPORT_APPEND):
   6.371 +        if (type==token.NAME):
   6.372 +            modules[len(modules)-1]+="."+tok
   6.373 +            set_state(IMPORT_OP)
   6.374 +    # BUILD_CLASS_DECL
   6.375 +    elif (state==BUILD_CLASS_DECL):
   6.376 +        if (is_recording_finished()):
   6.377 +            s = "class "+name
   6.378 +            if (param!=""): s = s+" : public "+param.replace('.','::')
   6.379 +            if (doc_string!=""):
   6.380 +                append_comment_lines(doc_string)
   6.381 +            print_comment(class_spos)
   6.382 +            output(s+"\n",class_spos)
   6.383 +            output("{\n",(class_spos[0]+1,class_spos[1]))
   6.384 +            protection_level = "public"
   6.385 +            output("  public:\n",(class_spos[0]+2,class_spos[1]))
   6.386 +            set_state(BUILD_CLASS_BODY)
   6.387 +    # BUILD_CLASS_BODY
   6.388 +    elif (state==BUILD_CLASS_BODY):
   6.389 +        if (type!=token.INDENT and type!=token.NEWLINE and type!=40 and
   6.390 +            type!=tokenize.NL and type!=tokenize.COMMENT and
   6.391 +            (spos[1]<=class_spos[1])):
   6.392 +            output("}; // end of class\n",(out_row+1,class_spos[1]))
   6.393 +            pop_state()
   6.394 +        elif (tok=="def"):
   6.395 +            start_recording()
   6.396 +            def_spos = spos
   6.397 +            push_state(BUILD_DEF_DECL)
   6.398 +    # BUILD_DEF_DECL
   6.399 +    elif (state==BUILD_DEF_DECL):
   6.400 +        if (is_recording_finished()):
   6.401 +            param = param.replace("\n", " ")
   6.402 +            param = param.replace("=", " = ")
   6.403 +            params = param.split(",")
   6.404 +            if BUILD_CLASS_BODY in stateStack:
   6.405 +                if len(name) > 1 \
   6.406 +                   and name[0:2] == '__' \
   6.407 +                   and name[len(name)-2:len(name)] != '__' \
   6.408 +                   and protection_level != 'private':
   6.409 +                       private_member = True
   6.410 +                       output("  private:\n",(def_spos[0]+2,def_spos[1]))
   6.411 +
   6.412 +            if (doc_string != ""):
   6.413 +                append_comment_lines(doc_string)
   6.414 +
   6.415 +            print_comment(def_spos)
   6.416 +
   6.417 +            output_function_decl(name, params)
   6.418 +#       output("{\n",(def_spos[0]+1,def_spos[1]))
   6.419 +            set_state(BUILD_DEF_BODY)
   6.420 +    # BUILD_DEF_BODY
   6.421 +    elif (state==BUILD_DEF_BODY):
   6.422 +        if (type!=token.INDENT and type!=token.NEWLINE \
   6.423 +            and type!=40 and type!=tokenize.NL \
   6.424 +            and (spos[1]<=def_spos[1])):
   6.425 +#            output("} // end of method/function\n",(out_row+1,def_spos[1]))
   6.426 +            if private_member and protection_level != 'private':
   6.427 +                private_member = False
   6.428 +                output("  " + protection_level + ":\n",(def_spos[0]+2,def_spos[1]))
   6.429 +            pop_state()
   6.430 +#       else:
   6.431 +#            output(tok,spos)
   6.432 +
   6.433 +
   6.434 +def output_function_decl(name, params):
   6.435 +    global def_spos
   6.436 +
   6.437 +    # Do we document a class method? then remove the 'self' parameter
   6.438 +    if params[0] == 'self':
   6.439 +        preamble = ''
   6.440 +        params = params[1:]
   6.441 +    else:
   6.442 +        preamble = 'static '
   6.443 +        if params[0] == 'cls':
   6.444 +            params = params[1:]
   6.445 +
   6.446 +    param_string = string.join(params, ", Type ")
   6.447 +
   6.448 +    if param_string == '':
   6.449 +        param_string = '(' + param_string + ');\n'
   6.450 +    else:
   6.451 +        param_string = '(Type ' + param_string + ');\n'
   6.452 +
   6.453 +    output(preamble, def_spos)
   6.454 +    output(name, def_spos)
   6.455 +    output(param_string, def_spos)
   6.456 +
   6.457 +
   6.458 +def append_comment_lines(lines):
   6.459 +    map(append_comment_line, doc_string.split('\n'))
   6.460 +
   6.461 +paramRE = re.compile(r'(@param \w+):')
   6.462 +
   6.463 +def append_comment_line(line):
   6.464 +    global paramRE
   6.465 +    
   6.466 +    comment_block.append(paramRE.sub(r'\1', line) + '\n')
   6.467 +
   6.468 +def dump(filename):
   6.469 +    f = open(filename)
   6.470 +    r = f.readlines()
   6.471 +    for s in r:
   6.472 +        sys.stdout.write(s)
   6.473 +
   6.474 +def filter(filename):
   6.475 +    global name, module_has_docstring, source_root
   6.476 +
   6.477 +    path,name = os.path.split(filename)
   6.478 +    root,ext  = os.path.splitext(name)
   6.479 +
   6.480 +    if source_root and path.find(source_root) == 0:
   6.481 +        path = path[len(source_root):]
   6.482 +
   6.483 +        if path[0] == os.sep:
   6.484 +            path = path[1:]
   6.485 +
   6.486 +        ns = path.split(os.sep)
   6.487 +    else:
   6.488 +        ns = []
   6.489 +
   6.490 +    ns.append(root)
   6.491 +
   6.492 +    for n in ns:
   6.493 +        output("namespace " + n + " {\n",(0,0))
   6.494 +
   6.495 +    # set module name for tok_eater to use if there's a module doc string
   6.496 +    name = root
   6.497 +
   6.498 +#    sys.stderr.write('Filtering "'+filename+'"...')
   6.499 +    f = open(filename)
   6.500 +    tokenize.tokenize(f.readline, tok_eater)
   6.501 +    f.close()
   6.502 +    print_comment((0,0))
   6.503 +
   6.504 +    output("\n",(0,0))
   6.505 +    
   6.506 +    for n in ns:
   6.507 +        output("}  // end of namespace\n",(0,0))
   6.508 +
   6.509 +    if not module_has_docstring:
   6.510 +        # Put in default namespace documentation
   6.511 +        output('/** \\namespace '+root+' \n',(0,0))
   6.512 +        output('    \\brief Module "%s" */\n'%(root),(0,0))
   6.513 +
   6.514 +    for s in outbuffer:
   6.515 +        outfile.write(s)
   6.516 +
   6.517 +
   6.518 +def filterFile(filename, out=sys.stdout):
   6.519 +    global outfile
   6.520 +
   6.521 +    outfile = out
   6.522 +
   6.523 +    try:
   6.524 +        root,ext  = os.path.splitext(filename)
   6.525 +
   6.526 +        if ext==".py":
   6.527 +            filter(filename)
   6.528 +        else:
   6.529 +            dump(filename)
   6.530 +
   6.531 +#        sys.stderr.write("OK\n")
   6.532 +    except IOError,e:
   6.533 +        sys.stderr.write(e[1]+"\n")
   6.534 +
   6.535 +
   6.536 +######################################################################
   6.537 +
   6.538 +# preparePath
   6.539 +def preparePath(path):
   6.540 +    """Prepare a path.
   6.541 +
   6.542 +    Checks if the path exists and creates it if it does not exist.
   6.543 +    """
   6.544 +    if not os.path.exists(path):
   6.545 +        parent = os.path.dirname(path)
   6.546 +        if parent!="":
   6.547 +            preparePath(parent)
   6.548 +        os.mkdir(path)
   6.549 +
   6.550 +# isNewer
   6.551 +def isNewer(file1,file2):
   6.552 +    """Check if file1 is newer than file2.
   6.553 +
   6.554 +    file1 must be an existing file.
   6.555 +    """
   6.556 +    if not os.path.exists(file2):
   6.557 +        return True
   6.558 +    return os.stat(file1)[ST_MTIME]>os.stat(file2)[ST_MTIME]
   6.559 +
   6.560 +# convert
   6.561 +def convert(srcpath, destpath):
   6.562 +    """Convert a Python source tree into a C+ stub tree.
   6.563 +
   6.564 +    All *.py files in srcpath (including sub-directories) are filtered
   6.565 +    and written to destpath. If destpath exists, only the files
   6.566 +    that have been modified are filtered again. Files that were deleted
   6.567 +    from srcpath are also deleted in destpath if they are still present.
   6.568 +    The function returns the number of processed *.py files.
   6.569 +    """
   6.570 +    count=0
   6.571 +    sp = os.path.join(srcpath,"*")
   6.572 +    sfiles = glob.glob(sp)
   6.573 +    dp = os.path.join(destpath,"*")
   6.574 +    dfiles = glob.glob(dp)
   6.575 +    leftovers={}
   6.576 +    for df in dfiles:
   6.577 +        leftovers[os.path.basename(df)]=1
   6.578 +
   6.579 +    for srcfile in sfiles:
   6.580 +        basename = os.path.basename(srcfile)
   6.581 +        if basename in leftovers:
   6.582 +            del leftovers[basename]
   6.583 +
   6.584 +        # Is it a subdirectory?
   6.585 +        if os.path.isdir(srcfile):
   6.586 +            sdir = os.path.join(srcpath,basename)
   6.587 +            ddir = os.path.join(destpath,basename)
   6.588 +            count+=convert(sdir, ddir)
   6.589 +            continue
   6.590 +        # Check the extension (only *.py will be converted)
   6.591 +        root, ext = os.path.splitext(srcfile)
   6.592 +        if ext.lower()!=".py":
   6.593 +            continue
   6.594 +
   6.595 +        destfile = os.path.join(destpath,basename)
   6.596 +        if destfile==srcfile:
   6.597 +            print "WARNING: Input and output names are identical!"
   6.598 +            sys.exit(1)
   6.599 +
   6.600 +        count+=1
   6.601 +#        sys.stdout.write("%s\015"%(srcfile))
   6.602 +
   6.603 +        if isNewer(srcfile, destfile):
   6.604 +            preparePath(os.path.dirname(destfile))
   6.605 +#            out=open(destfile,"w")
   6.606 +#            filterFile(srcfile, out)
   6.607 +#            out.close()
   6.608 +            os.system("python %s -f %s>%s"%(sys.argv[0],srcfile,destfile))
   6.609 +
   6.610 +    # Delete obsolete files in destpath
   6.611 +    for df in leftovers:
   6.612 +        dname=os.path.join(destpath,df)
   6.613 +        if os.path.isdir(dname):
   6.614 +            try:
   6.615 +                shutil.rmtree(dname)
   6.616 +            except:
   6.617 +                print "Can't remove obsolete directory '%s'"%dname
   6.618 +        else:
   6.619 +            try:
   6.620 +                os.remove(dname)
   6.621 +            except:
   6.622 +                print "Can't remove obsolete file '%s'"%dname
   6.623 +
   6.624 +    return count
   6.625 +
   6.626 +
   6.627 +######################################################################
   6.628 +######################################################################
   6.629 +######################################################################
   6.630 +
   6.631 +filter_file = False
   6.632 +source_root = None
   6.633 +
   6.634 +try:
   6.635 +    opts, args = getopt.getopt(sys.argv[1:], "hfr:", ["help"])
   6.636 +except getopt.GetoptError,e:
   6.637 +    print e
   6.638 +    sys.exit(1)
   6.639 +
   6.640 +for o,a in opts:
   6.641 +    if o=="-f":
   6.642 +        filter_file = True
   6.643 +
   6.644 +    if o=="-r":
   6.645 +        source_root = os.path.abspath(a)
   6.646 +
   6.647 +if filter_file:
   6.648 +    # Filter the specified file and print the result to stdout
   6.649 +    filename = string.join(args)
   6.650 +    filterFile(os.path.abspath(filename))
   6.651 +else:
   6.652 +
   6.653 +    if len(args)!=2:
   6.654 +        sys.stderr.write("%s options input output\n"%(os.path.basename(sys.argv[0])))
   6.655 +        sys.exit(1)
   6.656 +
   6.657 +    # Filter an entire Python source tree
   6.658 +    print '"%s" -> "%s"\n'%(args[0],args[1])
   6.659 +    c=convert(args[0],args[1])
   6.660 +    print "%d files"%(c)
   6.661 +
     7.1 --- a/extras/mini-os/include/hypervisor.h	Fri Sep 09 10:31:36 2005 -0600
     7.2 +++ b/extras/mini-os/include/hypervisor.h	Tue Sep 13 10:14:16 2005 -0600
     7.3 @@ -414,15 +414,15 @@ HYPERVISOR_event_channel_op(
     7.4  
     7.5  static inline int
     7.6  HYPERVISOR_xen_version(
     7.7 -    int cmd)
     7.8 +    int cmd, void *arg)
     7.9  {
    7.10      int ret;
    7.11 -    unsigned long ignore;
    7.12 +    unsigned long ignore, ign2;
    7.13  
    7.14      __asm__ __volatile__ (
    7.15          TRAP_INSTR
    7.16 -        : "=a" (ret), "=b" (ignore)
    7.17 -	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
    7.18 +        : "=a" (ret), "=b" (ignore), "=c" (ign2)
    7.19 +	: "0" (__HYPERVISOR_xen_version), "1" (cmd), "2" (arg)
    7.20  	: "memory" );
    7.21  
    7.22      return ret;
     8.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Fri Sep 09 10:31:36 2005 -0600
     8.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Tue Sep 13 10:14:16 2005 -0600
     8.3 @@ -543,7 +543,7 @@ EXPORT_SYMBOL(profile_pc);
     8.4  irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     8.5  {
     8.6  	s64 delta, delta_cpu;
     8.7 -	int cpu = smp_processor_id();
     8.8 +	int i, cpu = smp_processor_id();
     8.9  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
    8.10  
    8.11  	write_seqlock(&xtime_lock);
    8.12 @@ -566,9 +566,9 @@ irqreturn_t timer_interrupt(int irq, voi
    8.13  		       (s64)get_nsec_offset(shadow),
    8.14  		       processed_system_time,
    8.15  		       per_cpu(processed_system_time, cpu));
    8.16 -		for (cpu = 0; cpu < num_online_cpus(); cpu++)
    8.17 -			printk(" %d: %lld\n", cpu,
    8.18 -			       per_cpu(processed_system_time, cpu));
    8.19 +		for (i = 0; i < num_online_cpus(); i++)
    8.20 +			printk(" %d: %lld\n", i,
    8.21 +			       per_cpu(processed_system_time, i));
    8.22  	}
    8.23  
    8.24  	/* System-wide jiffy work. */
     9.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Fri Sep 09 10:31:36 2005 -0600
     9.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Tue Sep 13 10:14:16 2005 -0600
     9.3 @@ -37,7 +37,7 @@
     9.4  #include <asm/atomic.h>
     9.5  #include <asm/system.h>
     9.6  #include <asm/ptrace.h>
     9.7 -#include <asm-xen/synch_bitops.h>
     9.8 +#include <asm/synch_bitops.h>
     9.9  #include <asm-xen/xen-public/event_channel.h>
    9.10  #include <asm-xen/xen-public/physdev.h>
    9.11  #include <asm-xen/hypervisor.h>
    9.12 @@ -123,7 +123,7 @@ extern asmlinkage unsigned int do_IRQ(st
    9.13   */
    9.14  void force_evtchn_callback(void)
    9.15  {
    9.16 -    (void)HYPERVISOR_xen_version(0);
    9.17 +    (void)HYPERVISOR_xen_version(0, NULL);
    9.18  }
    9.19  EXPORT_SYMBOL(force_evtchn_callback);
    9.20  
    10.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Fri Sep 09 10:31:36 2005 -0600
    10.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Tue Sep 13 10:14:16 2005 -0600
    10.3 @@ -19,7 +19,7 @@
    10.4  #include <asm-xen/xen_proc.h>
    10.5  #include <asm-xen/linux-public/privcmd.h>
    10.6  #include <asm-xen/gnttab.h>
    10.7 -#include <asm-xen/synch_bitops.h>
    10.8 +#include <asm/synch_bitops.h>
    10.9  
   10.10  #if 1
   10.11  #define ASSERT(_p) \
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Sep 09 10:31:36 2005 -0600
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Sep 13 10:14:16 2005 -0600
    11.3 @@ -65,7 +65,6 @@ static void frontend_changed(struct xenb
    11.4  
    11.5  	/* If other end is gone, delete ourself. */
    11.6  	if (node && !xenbus_exists(be->frontpath, "")) {
    11.7 -		xenbus_rm(be->dev->nodename, "");
    11.8  		device_unregister(&be->dev->dev);
    11.9  		return;
   11.10  	}
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Sep 09 10:31:36 2005 -0600
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Tue Sep 13 10:14:16 2005 -0600
    12.3 @@ -182,9 +182,9 @@ static kdev_t kcons_device(struct consol
    12.4  #endif
    12.5  
    12.6  static struct console kcons_info = {
    12.7 -    device:  kcons_device,
    12.8 -    flags:   CON_PRINTBUFFER,
    12.9 -    index:   -1
   12.10 +    .device	= kcons_device,
   12.11 +    .flags	= CON_PRINTBUFFER,
   12.12 +    .index	= -1,
   12.13  };
   12.14  
   12.15  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Fri Sep 09 10:31:36 2005 -0600
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Tue Sep 13 10:14:16 2005 -0600
    13.3 @@ -356,14 +356,14 @@ static int evtchn_release(struct inode *
    13.4  }
    13.5  
    13.6  static struct file_operations evtchn_fops = {
    13.7 -    owner:    THIS_MODULE,
    13.8 -    read:     evtchn_read,
    13.9 -    write:    evtchn_write,
   13.10 -    ioctl:    evtchn_ioctl,
   13.11 -    poll:     evtchn_poll,
   13.12 -    fasync:   evtchn_fasync,
   13.13 -    open:     evtchn_open,
   13.14 -    release:  evtchn_release
   13.15 +    .owner   = THIS_MODULE,
   13.16 +    .read    = evtchn_read,
   13.17 +    .write   = evtchn_write,
   13.18 +    .ioctl   = evtchn_ioctl,
   13.19 +    .poll    = evtchn_poll,
   13.20 +    .fasync  = evtchn_fasync,
   13.21 +    .open    = evtchn_open,
   13.22 +    .release = evtchn_release,
   13.23  };
   13.24  
   13.25  static struct miscdevice evtchn_miscdev = {
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Fri Sep 09 10:31:36 2005 -0600
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Tue Sep 13 10:14:16 2005 -0600
    14.3 @@ -241,8 +241,8 @@ static int privcmd_mmap(struct file * fi
    14.4  }
    14.5  
    14.6  static struct file_operations privcmd_file_ops = {
    14.7 -    ioctl : privcmd_ioctl,
    14.8 -    mmap:   privcmd_mmap
    14.9 +    .ioctl = privcmd_ioctl,
   14.10 +    .mmap  = privcmd_mmap,
   14.11  };
   14.12  
   14.13  
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Fri Sep 09 10:31:36 2005 -0600
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Sep 13 10:14:16 2005 -0600
    15.3 @@ -5,6 +5,7 @@
    15.4   * to xenstore.
    15.5   * 
    15.6   * Copyright (c) 2005, Christian Limpach
    15.7 + * Copyright (c) 2005, Rusty Russell, IBM Corporation
    15.8   * 
    15.9   * This file may be distributed separately from the Linux kernel, or
   15.10   * incorporated into other software packages, subject to the following license:
   15.11 @@ -36,110 +37,105 @@
   15.12  #include <linux/wait.h>
   15.13  #include <linux/fs.h>
   15.14  
   15.15 -#include "xenstored.h"
   15.16  #include "xenbus_comms.h"
   15.17  
   15.18  #include <asm/uaccess.h>
   15.19  #include <asm-xen/xenbus.h>
   15.20 -#include <asm-xen/linux-public/xenbus_dev.h>
   15.21  #include <asm-xen/xen_proc.h>
   15.22 +#include <asm-xen/linux-public/xenstored.h>
   15.23  
   15.24  struct xenbus_dev_data {
   15.25 -	int in_transaction;
   15.26 +	/* Are there bytes left to be read in this message? */
   15.27 +	int bytes_left;
   15.28 +	/* Are we still waiting for the reply to a message we wrote? */
   15.29 +	int awaiting_reply;
   15.30 +	/* Buffer for outgoing messages. */
   15.31 +	unsigned int len;
   15.32 +	union {
   15.33 +		struct xsd_sockmsg msg;
   15.34 +		char buffer[PAGE_SIZE];
   15.35 +	} u;
   15.36  };
   15.37  
   15.38  static struct proc_dir_entry *xenbus_dev_intf;
   15.39  
   15.40 -void *xs_talkv(enum xsd_sockmsg_type type, const struct kvec *iovec,
   15.41 -	       unsigned int num_vecs, unsigned int *len);
   15.42 -
   15.43 -static int xenbus_dev_talkv(struct xenbus_dev_data *u, unsigned long data)
   15.44 +/* Reply can be long (dir, getperm): don't buffer, just examine
   15.45 + * headers so we can discard rest if they die. */
   15.46 +static ssize_t xenbus_dev_read(struct file *filp,
   15.47 +			       char __user *ubuf,
   15.48 +			       size_t len, loff_t *ppos)
   15.49  {
   15.50 -	struct xenbus_dev_talkv xt;
   15.51 -	unsigned int len;
   15.52 -	void *resp, *base;
   15.53 -	struct kvec *iovec;
   15.54 -	int ret = -EFAULT, v = 0;
   15.55 -
   15.56 -	if (copy_from_user(&xt, (void *)data, sizeof(xt)))
   15.57 -		return -EFAULT;
   15.58 +	struct xenbus_dev_data *data = filp->private_data;
   15.59 +	struct xsd_sockmsg msg;
   15.60 +	int err;
   15.61  
   15.62 -	iovec = kmalloc(xt.num_vecs * sizeof(struct kvec), GFP_KERNEL);
   15.63 -	if (iovec == NULL)
   15.64 -		return -ENOMEM;
   15.65 -
   15.66 -	if (copy_from_user(iovec, xt.iovec,
   15.67 -			   xt.num_vecs * sizeof(struct kvec)))
   15.68 -		goto out;
   15.69 +	/* Refill empty buffer? */
   15.70 +	if (data->bytes_left == 0) {
   15.71 +		if (len < sizeof(msg))
   15.72 +			return -EINVAL;
   15.73  
   15.74 -	for (v = 0; v < xt.num_vecs; v++) {
   15.75 -		base = iovec[v].iov_base;
   15.76 -		iovec[v].iov_base = kmalloc(iovec[v].iov_len, GFP_KERNEL);
   15.77 -		if (iovec[v].iov_base == NULL ||
   15.78 -		    copy_from_user(iovec[v].iov_base, base, iovec[v].iov_len))
   15.79 -		{
   15.80 -			if (iovec[v].iov_base)
   15.81 -				kfree(iovec[v].iov_base);
   15.82 -			else
   15.83 -				ret = -ENOMEM;
   15.84 -			v--;
   15.85 -			goto out;
   15.86 -		}
   15.87 +		err = xb_read(&msg, sizeof(msg));
   15.88 +		if (err)
   15.89 +			return err;
   15.90 +		data->bytes_left = msg.len;
   15.91 +		if (ubuf && copy_to_user(ubuf, &msg, sizeof(msg)) != 0)
   15.92 +			return -EFAULT;
   15.93 +		/* We can receive spurious XS_WATCH_EVENT messages. */
   15.94 +		if (msg.type != XS_WATCH_EVENT)
   15.95 +			data->awaiting_reply = 0;
   15.96 +		return sizeof(msg);
   15.97  	}
   15.98  
   15.99 -	resp = xs_talkv(xt.type, iovec, xt.num_vecs, &len);
  15.100 -	if (IS_ERR(resp)) {
  15.101 -		ret = PTR_ERR(resp);
  15.102 -		goto out;
  15.103 -	}
  15.104 +	/* Don't read over next header, or over temporary buffer. */
  15.105 +	if (len > sizeof(data->u.buffer))
  15.106 +		len = sizeof(data->u.buffer);
  15.107 +	if (len > data->bytes_left)
  15.108 +		len = data->bytes_left;
  15.109  
  15.110 -	switch (xt.type) {
  15.111 -	case XS_TRANSACTION_START:
  15.112 -		u->in_transaction = 1;
  15.113 -		break;
  15.114 -	case XS_TRANSACTION_END:
  15.115 -		u->in_transaction = 0;
  15.116 -		break;
  15.117 -	default:
  15.118 -		break;
  15.119 -	}
  15.120 +	err = xb_read(data->u.buffer, len);
  15.121 +	if (err)
  15.122 +		return err;
  15.123  
  15.124 -	ret = len;
  15.125 -	if (len > xt.len)
  15.126 -		len = xt.len;
  15.127 -
  15.128 -	if (copy_to_user(xt.buf, resp, len))
  15.129 -		ret = -EFAULT;
  15.130 -
  15.131 -	kfree(resp);
  15.132 - out:
  15.133 -	while (v-- > 0)
  15.134 -		kfree(iovec[v].iov_base);
  15.135 -	kfree(iovec);
  15.136 -	return ret;
  15.137 +	data->bytes_left -= len;
  15.138 +	if (ubuf && copy_to_user(ubuf, data->u.buffer, len) != 0)
  15.139 +		return -EFAULT;
  15.140 +	return len;
  15.141  }
  15.142  
  15.143 -static int xenbus_dev_ioctl(struct inode *inode, struct file *filp,
  15.144 -			    unsigned int cmd, unsigned long data)
  15.145 +/* We do v. basic sanity checking so they don't screw up kernel later. */
  15.146 +static ssize_t xenbus_dev_write(struct file *filp,
  15.147 +				const char __user *ubuf,
  15.148 +				size_t len, loff_t *ppos)
  15.149  {
  15.150 -	struct xenbus_dev_data *u = filp->private_data;
  15.151 -	int ret = -ENOSYS;
  15.152 +	struct xenbus_dev_data *data = filp->private_data;
  15.153 +	int err;
  15.154  
  15.155 -	switch (cmd) {
  15.156 -	case IOCTL_XENBUS_DEV_TALKV:
  15.157 -		ret = xenbus_dev_talkv(u, data);
  15.158 -		break;
  15.159 -	default:
  15.160 -		ret = -EINVAL;
  15.161 -		break;
  15.162 +	/* We gather data in buffer until we're ready to send it. */
  15.163 +	if (len > data->len + sizeof(data->u))
  15.164 +		return -EINVAL;
  15.165 +	if (copy_from_user(data->u.buffer + data->len, ubuf, len) != 0)
  15.166 +		return -EFAULT;
  15.167 +	data->len += len;
  15.168 +	if (data->len >= sizeof(data->u.msg) + data->u.msg.len) {
  15.169 +		err = xb_write(data->u.buffer, data->len);
  15.170 +		if (err)
  15.171 +			return err;
  15.172 +		data->len = 0;
  15.173 +		data->awaiting_reply = 1;
  15.174  	}
  15.175 -	return ret;
  15.176 +	return len;
  15.177  }
  15.178  
  15.179  static int xenbus_dev_open(struct inode *inode, struct file *filp)
  15.180  {
  15.181  	struct xenbus_dev_data *u;
  15.182  
  15.183 +	if (xen_start_info->store_evtchn == 0)
  15.184 +		return -ENOENT;
  15.185 +
  15.186 +	/* Don't try seeking. */
  15.187 +	nonseekable_open(inode, filp);
  15.188 +
  15.189  	u = kmalloc(sizeof(*u), GFP_KERNEL);
  15.190  	if (u == NULL)
  15.191  		return -ENOMEM;
  15.192 @@ -155,22 +151,27 @@ static int xenbus_dev_open(struct inode 
  15.193  
  15.194  static int xenbus_dev_release(struct inode *inode, struct file *filp)
  15.195  {
  15.196 -	struct xenbus_dev_data *u = filp->private_data;
  15.197 +	struct xenbus_dev_data *data = filp->private_data;
  15.198  
  15.199 -	if (u->in_transaction)
  15.200 -		xenbus_transaction_end(1);
  15.201 +	/* Discard any unread replies. */
  15.202 +	while (data->bytes_left || data->awaiting_reply)
  15.203 +		xenbus_dev_read(filp, NULL, sizeof(data->u.buffer), NULL);
  15.204 +
  15.205 +	/* Harmless if no transaction in progress. */
  15.206 +	xenbus_transaction_end(1);
  15.207  
  15.208  	up(&xenbus_lock);
  15.209  
  15.210 -	kfree(u);
  15.211 +	kfree(data);
  15.212  
  15.213  	return 0;
  15.214  }
  15.215  
  15.216  static struct file_operations xenbus_dev_file_ops = {
  15.217 -	ioctl: xenbus_dev_ioctl,
  15.218 -	open: xenbus_dev_open,
  15.219 -	release: xenbus_dev_release
  15.220 +	.read = xenbus_dev_read,
  15.221 +	.write = xenbus_dev_write,
  15.222 +	.open = xenbus_dev_open,
  15.223 +	.release = xenbus_dev_release,
  15.224  };
  15.225  
  15.226  static int __init
    16.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Sep 09 10:31:36 2005 -0600
    16.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Sep 13 10:14:16 2005 -0600
    16.3 @@ -166,6 +166,10 @@ static int xenbus_hotplug_backend(struct
    16.4  			    buffer, buffer_size, &length,
    16.5  			    "XENBUS_TYPE=%s", xdev->devicetype);
    16.6  
    16.7 +	add_hotplug_env_var(envp, num_envp, &i,
    16.8 +			    buffer, buffer_size, &length,
    16.9 +			    "XENBUS_PATH=%s", xdev->nodename);
   16.10 +
   16.11  	/* terminate, set to next free slot, shrink available space */
   16.12  	envp[i] = NULL;
   16.13  	envp = &envp[i];
    17.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Fri Sep 09 10:31:36 2005 -0600
    17.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Sep 13 10:14:16 2005 -0600
    17.3 @@ -38,7 +38,7 @@
    17.4  #include <linux/fcntl.h>
    17.5  #include <linux/kthread.h>
    17.6  #include <asm-xen/xenbus.h>
    17.7 -#include "xenstored.h"
    17.8 +#include <asm-xen/linux-public/xenstored.h>
    17.9  #include "xenbus_comms.h"
   17.10  
   17.11  #define streq(a, b) (strcmp((a), (b)) == 0)
   17.12 @@ -106,10 +106,10 @@ void xenbus_debug_write(const char *str,
   17.13  }
   17.14  
   17.15  /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
   17.16 -void *xs_talkv(enum xsd_sockmsg_type type,
   17.17 -	       const struct kvec *iovec,
   17.18 -	       unsigned int num_vecs,
   17.19 -	       unsigned int *len)
   17.20 +static void *xs_talkv(enum xsd_sockmsg_type type,
   17.21 +		      const struct kvec *iovec,
   17.22 +		      unsigned int num_vecs,
   17.23 +		      unsigned int *len)
   17.24  {
   17.25  	struct xsd_sockmsg msg;
   17.26  	void *ret = NULL;
    18.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Fri Sep 09 10:31:36 2005 -0600
    18.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Tue Sep 13 10:14:16 2005 -0600
    18.3 @@ -270,9 +270,9 @@ HYPERVISOR_event_channel_op(
    18.4  
    18.5  static inline int
    18.6  HYPERVISOR_xen_version(
    18.7 -	int cmd)
    18.8 +	int cmd, void *arg)
    18.9  {
   18.10 -	return _hypercall1(int, xen_version, cmd);
   18.11 +	return _hypercall2(int, xen_version, cmd, arg);
   18.12  }
   18.13  
   18.14  static inline int
    19.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Fri Sep 09 10:31:36 2005 -0600
    19.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Tue Sep 13 10:14:16 2005 -0600
    19.3 @@ -4,7 +4,7 @@
    19.4  #include <linux/config.h>
    19.5  #include <linux/kernel.h>
    19.6  #include <linux/bitops.h>
    19.7 -#include <asm-xen/synch_bitops.h>
    19.8 +#include <asm/synch_bitops.h>
    19.9  #include <asm/segment.h>
   19.10  #include <asm/cpufeature.h>
   19.11  #include <asm-xen/hypervisor.h>
    20.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Fri Sep 09 10:31:36 2005 -0600
    20.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Tue Sep 13 10:14:16 2005 -0600
    20.3 @@ -260,9 +260,9 @@ HYPERVISOR_event_channel_op(
    20.4  
    20.5  static inline int
    20.6  HYPERVISOR_xen_version(
    20.7 -	int cmd)
    20.8 +	int cmd, void *arg)
    20.9  {
   20.10 -	return _hypercall1(int, xen_version, cmd);
   20.11 +	return _hypercall2(int, xen_version, cmd, arg);
   20.12  }
   20.13  
   20.14  static inline int
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h	Tue Sep 13 10:14:16 2005 -0600
    21.3 @@ -0,0 +1,2 @@
    21.4 +
    21.5 +#include <asm-i386/synch_bitops.h>
    22.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Fri Sep 09 10:31:36 2005 -0600
    22.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Tue Sep 13 10:14:16 2005 -0600
    22.3 @@ -4,7 +4,7 @@
    22.4  #include <linux/config.h>
    22.5  #include <linux/kernel.h>
    22.6  #include <asm/segment.h>
    22.7 -#include <asm-xen/synch_bitops.h>
    22.8 +#include <asm/synch_bitops.h>
    22.9  #include <asm-xen/hypervisor.h>
   22.10  #include <asm-xen/xen-public/arch-x86_64.h>
   22.11  
    23.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Fri Sep 09 10:31:36 2005 -0600
    23.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Tue Sep 13 10:14:16 2005 -0600
    23.3 @@ -35,7 +35,7 @@
    23.4  #include <linux/interrupt.h>
    23.5  #include <asm-xen/hypervisor.h>
    23.6  #include <asm/ptrace.h>
    23.7 -#include <asm-xen/synch_bitops.h>
    23.8 +#include <asm/synch_bitops.h>
    23.9  #include <asm-xen/xen-public/event_channel.h>
   23.10  #include <linux/smp.h>
   23.11  
    24.1 --- a/linux-2.6-xen-sparse/include/asm-xen/linux-public/xenbus_dev.h	Fri Sep 09 10:31:36 2005 -0600
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,47 +0,0 @@
    24.4 -/*
    24.5 - * xenbus_dev.h
    24.6 - * 
    24.7 - * Copyright (c) 2005, Christian Limpach
    24.8 - * 
    24.9 - * This file may be distributed separately from the Linux kernel, or
   24.10 - * incorporated into other software packages, subject to the following license:
   24.11 - * 
   24.12 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   24.13 - * of this source file (the "Software"), to deal in the Software without
   24.14 - * restriction, including without limitation the rights to use, copy, modify,
   24.15 - * merge, publish, distribute, sublicense, and/or sell copies of the Software,
   24.16 - * and to permit persons to whom the Software is furnished to do so, subject to
   24.17 - * the following conditions:
   24.18 - * 
   24.19 - * The above copyright notice and this permission notice shall be included in
   24.20 - * all copies or substantial portions of the Software.
   24.21 - * 
   24.22 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   24.23 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   24.24 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   24.25 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   24.26 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   24.27 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
   24.28 - * IN THE SOFTWARE.
   24.29 - */
   24.30 -
   24.31 -#ifndef _XENBUS_DEV_H_
   24.32 -#define _XENBUS_DEV_H_
   24.33 -
   24.34 -struct xenbus_dev_talkv {
   24.35 -	enum xsd_sockmsg_type type;
   24.36 -	const struct kvec *iovec;
   24.37 -	unsigned int num_vecs;
   24.38 -	char *buf;
   24.39 -	unsigned int len;
   24.40 -};
   24.41 -
   24.42 -/*
   24.43 - * @cmd: IOCTL_XENBUS_DEV_TALKV
   24.44 - * @arg: struct xenbus_dev_talkv
   24.45 - * Return: 0 on success, error code on failure.
   24.46 - */
   24.47 -#define	IOCTL_XENBUS_DEV_TALKV \
   24.48 -	_IOC(_IOC_NONE, 'X', 0, sizeof(struct xenbus_dev_talkv))
   24.49 -
   24.50 -#endif /* _XENBUS_DEV_H_ */
    25.1 --- a/linux-2.6-xen-sparse/include/asm-xen/synch_bitops.h	Fri Sep 09 10:31:36 2005 -0600
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,2 +0,0 @@
    25.4 -
    25.5 -#include <asm-i386/synch_bitops.h>
    26.1 --- a/linux-2.6-xen-sparse/mkbuildtree	Fri Sep 09 10:31:36 2005 -0600
    26.2 +++ b/linux-2.6-xen-sparse/mkbuildtree	Tue Sep 13 10:14:16 2005 -0600
    26.3 @@ -108,5 +108,5 @@ mkdir  ${AD}/include/asm-xen/xen-public
    26.4  cd     ${AD}/include/asm-xen/xen-public
    26.5  relative_lndir ../../../${RS}/../xen/include/public
    26.6  
    26.7 -cd ${AD}/drivers/xen/xenbus
    26.8 +cd ${AD}/include/asm-xen/linux-public
    26.9  ln -sf ../../../${RS}/../tools/xenstore/xenstored.h
    27.1 --- a/tools/console/daemon/io.c	Fri Sep 09 10:31:36 2005 -0600
    27.2 +++ b/tools/console/daemon/io.c	Tue Sep 13 10:14:16 2005 -0600
    27.3 @@ -87,6 +87,7 @@ static void buffer_append(struct domain 
    27.4  	struct buffer *buffer = &dom->buffer;
    27.5  	struct ring_head *ring = (struct ring_head *)dom->page;
    27.6  	size_t size;
    27.7 +	u32 oldcons;
    27.8  
    27.9  	while ((size = ring->prod - ring->cons) != 0) {
   27.10  		if ((buffer->capacity - buffer->size) < size) {
   27.11 @@ -98,7 +99,8 @@ static void buffer_append(struct domain 
   27.12  			}
   27.13  		}
   27.14  
   27.15 -		while (ring->cons < ring->prod) {
   27.16 +		oldcons = ring->cons;
   27.17 +		while (ring->cons < (oldcons + size)) {
   27.18  			buffer->data[buffer->size] =
   27.19  				ring->buf[XENCONS_IDX(ring->cons)];
   27.20  			buffer->size++;
    28.1 --- a/tools/console/daemon/main.c	Fri Sep 09 10:31:36 2005 -0600
    28.2 +++ b/tools/console/daemon/main.c	Tue Sep 13 10:14:16 2005 -0600
    28.3 @@ -30,6 +30,12 @@
    28.4  #include "utils.h"
    28.5  #include "io.h"
    28.6  
    28.7 +void usage(char *prg)
    28.8 +{
    28.9 +	fprintf(stderr, 
   28.10 +		"usage: %s [-h] [-V] [-v] [-i]\n", prg);
   28.11 +}
   28.12 +
   28.13  int main(int argc, char **argv)
   28.14  {
   28.15  	const char *sopts = "hVvi";
   28.16 @@ -49,7 +55,7 @@ int main(int argc, char **argv)
   28.17  	while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
   28.18  		switch (ch) {
   28.19  		case 'h':
   28.20 -			//usage(argv[0]);
   28.21 +			usage(argv[0]);
   28.22  			exit(0);
   28.23  		case 'V':
   28.24  			//version(argv[0]);
    29.1 --- a/tools/console/daemon/utils.c	Fri Sep 09 10:31:36 2005 -0600
    29.2 +++ b/tools/console/daemon/utils.c	Tue Sep 13 10:14:16 2005 -0600
    29.3 @@ -105,7 +105,8 @@ void daemonize(const char *pidfile)
    29.4  	close(fd);
    29.5  
    29.6  	umask(027);
    29.7 -	chdir("/");
    29.8 +	if (chdir("/") < 0)
    29.9 +		exit (1);
   29.10  
   29.11  	fd = open(pidfile, O_RDWR | O_CREAT);
   29.12  	if (fd == -1) {
   29.13 @@ -117,7 +118,8 @@ void daemonize(const char *pidfile)
   29.14  	}
   29.15  
   29.16  	len = sprintf(buf, "%d\n", getpid());
   29.17 -	write(fd, buf, len);
   29.18 +	if (write(fd, buf, len) < 0)
   29.19 +		exit(1);
   29.20  
   29.21  	signal(SIGCHLD, child_exit);
   29.22  	signal(SIGTSTP, SIG_IGN);
    30.1 --- a/tools/examples/Makefile	Fri Sep 09 10:31:36 2005 -0600
    30.2 +++ b/tools/examples/Makefile	Tue Sep 13 10:14:16 2005 -0600
    30.3 @@ -21,10 +21,11 @@ XEN_CONFIGS += xmexample.vmx
    30.4  XEN_SCRIPT_DIR = /etc/xen/scripts
    30.5  XEN_SCRIPTS = network-bridge vif-bridge
    30.6  XEN_SCRIPTS += network-route vif-route
    30.7 +XEN_SCRIPTS += block-phy
    30.8  XEN_SCRIPTS += block-file
    30.9  XEN_SCRIPTS += block-enbd
   30.10  
   30.11 -XEN_BOOT_DIR = /usr/lib/xen/boot
   30.12 +XEN_BOOT_DIR = /usr/$(LIBDIR)/xen/boot
   30.13  XEN_BOOT = mem-map.sxp
   30.14  
   30.15  XEN_HOTPLUG_DIR = /etc/hotplug
   30.16 @@ -36,12 +37,15 @@ build:
   30.17  install: all install-initd install-configs install-scripts install-boot \
   30.18  	 install-hotplug
   30.19  
   30.20 +xmexample.vmx: xmexample.vmx.in
   30.21 +	sed -e 's/@@LIBDIR@@/$(LIBDIR)/' < $< > $@
   30.22 +
   30.23  install-initd:
   30.24  	[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
   30.25  	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
   30.26  	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
   30.27  
   30.28 -install-configs:
   30.29 +install-configs: $(XEN_CONFIGS)
   30.30  	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
   30.31  		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
   30.32  	[ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
   30.33 @@ -76,3 +80,4 @@ install-hotplug:
   30.34  	done
   30.35  
   30.36  clean:
   30.37 +	$(RM) xmexample.vmx
    31.1 --- a/tools/examples/block-enbd	Fri Sep 09 10:31:36 2005 -0600
    31.2 +++ b/tools/examples/block-enbd	Tue Sep 13 10:14:16 2005 -0600
    31.3 @@ -3,31 +3,31 @@
    31.4  # Usage: block-enbd [bind server ctl_port |unbind node]
    31.5  #
    31.6  # The file argument to the bind command is the file we are to bind to a
    31.7 -# loop device.  We print the path to the loop device node to stdout.
    31.8 +# loop device.
    31.9  #
   31.10  # The node argument to unbind is the name of the device node we are to
   31.11  # unbind.
   31.12  #
   31.13  # This assumes you're running a correctly configured server at the other end!
   31.14  
   31.15 +set -e
   31.16 +
   31.17  case $1 in
   31.18 -	bind)
   31.19 -		for dev in /dev/nd*; do
   31.20 -			if nbd-client $2:$3 $dev; then
   31.21 -				echo $dev
   31.22 -				exit 0
   31.23 -			fi
   31.24 -		done
   31.25 -		exit 1
   31.26 -	;;
   31.27 -
   31.28 -	unbind)
   31.29 -		nbd-client -d $2
   31.30 -		exit 0
   31.31 -	;;
   31.32 -
   31.33 -	*)
   31.34 -		echo 'Unknown command: ' $1 >&2
   31.35 -		echo 'Valid commands are: bind, unbind' >&2
   31.36 -		exit 1
   31.37 +  bind)
   31.38 +    for dev in /dev/nd*; do
   31.39 +      if nbd-client $2:$3 $dev; then
   31.40 +        major=$(stat -L -c %t "$dev")
   31.41 +        minor=$(stat -L -c %T "$dev")
   31.42 +        pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
   31.43 +        xenstore-write "$XENBUS_PATH"/physical-device $pdev \
   31.44 +          "$XENBUS_PATH"/node $dev
   31.45 +        exit 0
   31.46 +      fi
   31.47 +    done
   31.48 +    exit 1
   31.49 +    ;;
   31.50 +  unbind)
   31.51 +    nbd-client -d $2
   31.52 +    exit 0
   31.53 +    ;;
   31.54  esac
    32.1 --- a/tools/examples/block-file	Fri Sep 09 10:31:36 2005 -0600
    32.2 +++ b/tools/examples/block-file	Tue Sep 13 10:14:16 2005 -0600
    32.3 @@ -3,29 +3,29 @@
    32.4  # Usage: block_loop [bind file|unbind node]
    32.5  #
    32.6  # The file argument to the bind command is the file we are to bind to a
    32.7 -# loop device.  We print the path to the loop device node to stdout.
    32.8 +# loop device.
    32.9  #
   32.10  # The node argument to unbind is the name of the device node we are to
   32.11  # unbind.
   32.12  
   32.13 +set -e
   32.14 +
   32.15  case $1 in
   32.16 -	bind)
   32.17 -		for dev in /dev/loop*; do
   32.18 -			if losetup $dev $2; then
   32.19 -				echo $dev
   32.20 -				exit 0
   32.21 -			fi
   32.22 -		done
   32.23 -		exit 1
   32.24 -	;;
   32.25 -
   32.26 -	unbind)
   32.27 -		losetup -d $2
   32.28 -		exit 0
   32.29 -	;;
   32.30 -
   32.31 -	*)
   32.32 -		echo 'Unknown command: ' $1 >&2
   32.33 -		echo 'Valid commands are: bind, unbind' >&2
   32.34 -		exit 1
   32.35 +  bind)
   32.36 +    for dev in /dev/loop*; do
   32.37 +      if losetup $dev $2; then
   32.38 +        major=$(stat -L -c %t "$dev")
   32.39 +        minor=$(stat -L -c %T "$dev")
   32.40 +        pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
   32.41 +        xenstore-write "$XENBUS_PATH"/physical-device $pdev \
   32.42 +          "$XENBUS_PATH"/node $dev
   32.43 +        exit 0
   32.44 +      fi
   32.45 +    done
   32.46 +    exit 1
   32.47 +    ;;
   32.48 +  unbind)
   32.49 +    losetup -d $2
   32.50 +    exit 0
   32.51 +    ;;
   32.52  esac
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/tools/examples/block-phy	Tue Sep 13 10:14:16 2005 -0600
    33.3 @@ -0,0 +1,30 @@
    33.4 +#! /bin/sh
    33.5 +
    33.6 +set -e
    33.7 +
    33.8 +expand_dev() {
    33.9 +  local dev
   33.10 +  case $1 in
   33.11 +  /*)
   33.12 +    dev=$1
   33.13 +    ;;
   33.14 +  *)
   33.15 +    dev=/dev/$1
   33.16 +    ;;
   33.17 +  esac
   33.18 +  echo -n $dev
   33.19 +}
   33.20 +
   33.21 +case $1 in
   33.22 +  bind)
   33.23 +    dev=$(expand_dev $2)
   33.24 +    major=$(stat -L -c %t "$dev")
   33.25 +    minor=$(stat -L -c %T "$dev")
   33.26 +    pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
   33.27 +    xenstore-write "$XENBUS_PATH"/physical-device $pdev \
   33.28 +        "$XENBUS_PATH"/node $dev
   33.29 +    exit 0
   33.30 +    ;;
   33.31 +  unbind)
   33.32 +    ;;
   33.33 +esac
    34.1 --- a/tools/examples/xen-backend.agent	Fri Sep 09 10:31:36 2005 -0600
    34.2 +++ b/tools/examples/xen-backend.agent	Tue Sep 13 10:14:16 2005 -0600
    34.3 @@ -9,8 +9,26 @@ PATH=/etc/xen/scripts:$PATH
    34.4  
    34.5  case "$ACTION" in
    34.6    add)
    34.7 +    case "$XENBUS_TYPE" in
    34.8 +      vbd)
    34.9 +        t=$(xenstore-read "$XENBUS_PATH"/type)
   34.10 +        params=$(xenstore-read "$XENBUS_PATH"/params)
   34.11 +        [ -x /etc/xen/scripts/block-"$t" ] && \
   34.12 +            /etc/xen/scripts/block-"$t" bind $params
   34.13 +        ;;
   34.14 +    esac
   34.15      ;;
   34.16    remove)
   34.17 +    case "$XENBUS_TYPE" in
   34.18 +      vbd)
   34.19 +        t=$(xenstore-read "$XENBUS_PATH"/type)
   34.20 +        node=$(xenstore-read "$XENBUS_PATH"/node)
   34.21 +        [ -x /etc/xen/scripts/block-"$t" ] && \
   34.22 +            /etc/xen/scripts/block-"$t" unbind $node
   34.23 +        ;;
   34.24 +    esac
   34.25 +    # remove device backend store entries
   34.26 +    xenstore-rm "$XENBUS_PATH"
   34.27      ;;
   34.28    online)
   34.29      case "$PHYSDEVDRIVER" in
    35.1 --- a/tools/examples/xmexample.vmx	Fri Sep 09 10:31:36 2005 -0600
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,96 +0,0 @@
    35.4 -#  -*- mode: python; -*-
    35.5 -#============================================================================
    35.6 -# Python configuration setup for 'xm create'.
    35.7 -# This script sets the parameters used when a domain is created using 'xm create'.
    35.8 -# You use a separate script for each domain you want to create, or 
    35.9 -# you can set the parameters for the domain on the xm command line.
   35.10 -#============================================================================
   35.11 -
   35.12 -#----------------------------------------------------------------------------
   35.13 -# Kernel image file.
   35.14 -kernel = "/usr/lib/xen/boot/vmxloader"
   35.15 -
   35.16 -# The domain build function. VMX domain uses 'vmx'.
   35.17 -builder='vmx'
   35.18 -
   35.19 -# Initial memory allocation (in megabytes) for the new domain.
   35.20 -memory = 128
   35.21 -
   35.22 -# A name for your domain. All domains must have different names.
   35.23 -name = "ExampleVMXDomain"
   35.24 -
   35.25 -# Which CPU to start domain on? 
   35.26 -#cpu = -1   # leave to Xen to pick
   35.27 -
   35.28 -# Optionally define mac and/or bridge for the network interfaces.
   35.29 -# Random MACs are assigned if not given.
   35.30 -#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
   35.31 -
   35.32 -#----------------------------------------------------------------------------
   35.33 -# Define the disk devices you want the domain to have access to, and
   35.34 -# what you want them accessible as.
   35.35 -# Each disk entry is of the form phy:UNAME,DEV,MODE
   35.36 -# where UNAME is the device, DEV is the device name the domain will see,
   35.37 -# and MODE is r for read-only, w for read-write.
   35.38 -
   35.39 -#disk = [ 'phy:hda1,hda1,r' ]
   35.40 -disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
   35.41 -
   35.42 -#----------------------------------------------------------------------------
   35.43 -# Set according to whether you want the domain restarted when it exits.
   35.44 -# The default is 'onreboot', which restarts the domain when it shuts down
   35.45 -# with exit code reboot.
   35.46 -# Other values are 'always', and 'never'.
   35.47 -
   35.48 -#restart = 'onreboot'
   35.49 -
   35.50 -#============================================================================
   35.51 -
   35.52 -
   35.53 -# New stuff
   35.54 -device_model = '/usr/lib/xen/bin/qemu-dm'
   35.55 -
   35.56 -# Advanced users only. Don't touch if you don't know what you're doing
   35.57 -memmap = '/usr/lib/xen/boot/mem-map.sxp'
   35.58 -
   35.59 -#-----------------------------------------------------------------------------
   35.60 -# Disk image for 
   35.61 -#cdrom=
   35.62 -
   35.63 -#-----------------------------------------------------------------------------
   35.64 -# boot on floppy (a), hard disk (c) or CD-ROM (d) 
   35.65 -#boot=[a|c|d]
   35.66 -#-----------------------------------------------------------------------------
   35.67 -#  write to temporary files instead of disk image files
   35.68 -#snapshot=1
   35.69 -
   35.70 -#----------------------------------------------------------------------------
   35.71 -# enable SDL library for graphics, default = 0
   35.72 -sdl=0
   35.73 -
   35.74 -#----------------------------------------------------------------------------
   35.75 -# enable VNC library for graphics, default = 1
   35.76 -vnc=1
   35.77 -
   35.78 -#----------------------------------------------------------------------------
   35.79 -# enable spawning vncviewer(only valid when vnc=1), default = 1
   35.80 -vncviewer=1
   35.81 -
   35.82 -#----------------------------------------------------------------------------
   35.83 -# no graphics, use serial port
   35.84 -#nographic=0
   35.85 -
   35.86 -
   35.87 -#-----------------------------------------------------------------------------
   35.88 -#   enable audio support
   35.89 -#enable-audio=1
   35.90 -
   35.91 -
   35.92 -#-----------------------------------------------------------------------------
   35.93 -#    set the real time clock to local time [default=0 i.e. set to utc]
   35.94 -#localtime=1
   35.95 -
   35.96 -
   35.97 -#-----------------------------------------------------------------------------
   35.98 -#    start in full screen
   35.99 -#full-screen=1   
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/tools/examples/xmexample.vmx.in	Tue Sep 13 10:14:16 2005 -0600
    36.3 @@ -0,0 +1,96 @@
    36.4 +#  -*- mode: python; -*-
    36.5 +#============================================================================
    36.6 +# Python configuration setup for 'xm create'.
    36.7 +# This script sets the parameters used when a domain is created using 'xm create'.
    36.8 +# You use a separate script for each domain you want to create, or 
    36.9 +# you can set the parameters for the domain on the xm command line.
   36.10 +#============================================================================
   36.11 +
   36.12 +#----------------------------------------------------------------------------
   36.13 +# Kernel image file.
   36.14 +kernel = "/usr/@@LIBDIR@@/xen/boot/vmxloader"
   36.15 +
   36.16 +# The domain build function. VMX domain uses 'vmx'.
   36.17 +builder='vmx'
   36.18 +
   36.19 +# Initial memory allocation (in megabytes) for the new domain.
   36.20 +memory = 128
   36.21 +
   36.22 +# A name for your domain. All domains must have different names.
   36.23 +name = "ExampleVMXDomain"
   36.24 +
   36.25 +# Which CPU to start domain on? 
   36.26 +#cpu = -1   # leave to Xen to pick
   36.27 +
   36.28 +# Optionally define mac and/or bridge for the network interfaces.
   36.29 +# Random MACs are assigned if not given.
   36.30 +#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
   36.31 +
   36.32 +#----------------------------------------------------------------------------
   36.33 +# Define the disk devices you want the domain to have access to, and
   36.34 +# what you want them accessible as.
   36.35 +# Each disk entry is of the form phy:UNAME,DEV,MODE
   36.36 +# where UNAME is the device, DEV is the device name the domain will see,
   36.37 +# and MODE is r for read-only, w for read-write.
   36.38 +
   36.39 +#disk = [ 'phy:hda1,hda1,r' ]
   36.40 +disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
   36.41 +
   36.42 +#----------------------------------------------------------------------------
   36.43 +# Set according to whether you want the domain restarted when it exits.
   36.44 +# The default is 'onreboot', which restarts the domain when it shuts down
   36.45 +# with exit code reboot.
   36.46 +# Other values are 'always', and 'never'.
   36.47 +
   36.48 +#restart = 'onreboot'
   36.49 +
   36.50 +#============================================================================
   36.51 +
   36.52 +
   36.53 +# New stuff
   36.54 +device_model = '/usr/@@LIBDIR@@/xen/bin/qemu-dm'
   36.55 +
   36.56 +# Advanced users only. Don't touch if you don't know what you're doing
   36.57 +memmap = '/usr/@@LIBDIR@@/xen/boot/mem-map.sxp'
   36.58 +
   36.59 +#-----------------------------------------------------------------------------
   36.60 +# Disk image for 
   36.61 +#cdrom=
   36.62 +
   36.63 +#-----------------------------------------------------------------------------
   36.64 +# boot on floppy (a), hard disk (c) or CD-ROM (d) 
   36.65 +#boot=[a|c|d]
   36.66 +#-----------------------------------------------------------------------------
   36.67 +#  write to temporary files instead of disk image files
   36.68 +#snapshot=1
   36.69 +
   36.70 +#----------------------------------------------------------------------------
   36.71 +# enable SDL library for graphics, default = 0
   36.72 +sdl=0
   36.73 +
   36.74 +#----------------------------------------------------------------------------
   36.75 +# enable VNC library for graphics, default = 1
   36.76 +vnc=1
   36.77 +
   36.78 +#----------------------------------------------------------------------------
   36.79 +# enable spawning vncviewer(only valid when vnc=1), default = 1
   36.80 +vncviewer=1
   36.81 +
   36.82 +#----------------------------------------------------------------------------
   36.83 +# no graphics, use serial port
   36.84 +#nographic=0
   36.85 +
   36.86 +
   36.87 +#-----------------------------------------------------------------------------
   36.88 +#   enable audio support
   36.89 +#enable-audio=1
   36.90 +
   36.91 +
   36.92 +#-----------------------------------------------------------------------------
   36.93 +#    set the real time clock to local time [default=0 i.e. set to utc]
   36.94 +#localtime=1
   36.95 +
   36.96 +
   36.97 +#-----------------------------------------------------------------------------
   36.98 +#    start in full screen
   36.99 +#full-screen=1   
    37.1 --- a/tools/ioemu/hw/pcnet.c	Fri Sep 09 10:31:36 2005 -0600
    37.2 +++ b/tools/ioemu/hw/pcnet.c	Tue Sep 13 10:14:16 2005 -0600
    37.3 @@ -380,10 +380,13 @@ static int pcnet_can_receive(void *opaqu
    37.4      return sizeof(s->buffer)-16;
    37.5  }
    37.6  
    37.7 +#define MIN_BUF_SIZE 60
    37.8 +
    37.9  static void pcnet_receive(void *opaque, const uint8_t *buf, int size)
   37.10  {
   37.11      PCNetState *s = opaque;
   37.12      int is_padr = 0, is_bcast = 0, is_ladr = 0;
   37.13 +    uint8_t buf1[60];
   37.14  
   37.15      if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size)
   37.16          return;
   37.17 @@ -392,6 +395,14 @@ static void pcnet_receive(void *opaque, 
   37.18      printf("pcnet_receive size=%d\n", size);
   37.19  #endif
   37.20  
   37.21 +    /* if too small buffer, then expand it */
   37.22 +    if (size < MIN_BUF_SIZE) {
   37.23 +        memcpy(buf1, buf, size);
   37.24 +        memset(buf1 + size, 0, MIN_BUF_SIZE - size);
   37.25 +        buf = buf1;
   37.26 +        size = MIN_BUF_SIZE;
   37.27 +    }
   37.28 +
   37.29      if (CSR_PROM(s) 
   37.30          || (is_padr=padr_match(s, buf, size)) 
   37.31          || (is_bcast=padr_bcast(s, buf, size))
    38.1 --- a/tools/ioemu/target-i386-dm/Makefile	Fri Sep 09 10:31:36 2005 -0600
    38.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Tue Sep 13 10:14:16 2005 -0600
    38.3 @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
    38.4  include config.mak
    38.5  override TARGET_ARCH=i386
    38.6  
    38.7 -INSTALL_DIR := $(DESTDIR)/usr/lib/xen/bin
    38.8 +INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
    38.9  TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
   38.10  VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
   38.11  DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) -I$(XEN_ROOT)/xen/include/public
    39.1 --- a/tools/libxc/xc_linux_restore.c	Fri Sep 09 10:31:36 2005 -0600
    39.2 +++ b/tools/libxc/xc_linux_restore.c	Tue Sep 13 10:14:16 2005 -0600
    39.3 @@ -42,18 +42,18 @@ read_exact(int fd, void *buf, size_t cou
    39.4      unsigned char *b = buf;
    39.5  
    39.6      while (r < count) {
    39.7 -	s = read(fd, &b[r], count - r);
    39.8 -	if (s <= 0)
    39.9 -	    break;
   39.10 -	r += s;
   39.11 +        s = read(fd, &b[r], count - r);
   39.12 +        if (s <= 0)
   39.13 +            break;
   39.14 +        r += s;
   39.15      }
   39.16  
   39.17      return r;
   39.18  }
   39.19  
   39.20  int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
   39.21 -		     unsigned int store_evtchn, unsigned long *store_mfn,
   39.22 -		     unsigned int console_evtchn, unsigned long *console_mfn)
   39.23 +                     unsigned int store_evtchn, unsigned long *store_mfn,
   39.24 +                     unsigned int console_evtchn, unsigned long *console_mfn)
   39.25  {
   39.26      dom0_op_t op;
   39.27      int rc = 1, i, n, k;
   39.28 @@ -91,6 +91,8 @@ int xc_linux_restore(int xc_handle, int 
   39.29      /* A temporary mapping of the guest's start_info page. */
   39.30      start_info_t *start_info;
   39.31  
   39.32 +    int pt_levels = 2; /* XXX auto-detect this */
   39.33 +
   39.34      char *region_base;
   39.35  
   39.36      xc_mmu_t *mmu = NULL;
   39.37 @@ -112,8 +114,8 @@ int xc_linux_restore(int xc_handle, int 
   39.38      }
   39.39  
   39.40      if (read_exact(io_fd, pfn_to_mfn_frame_list, PAGE_SIZE) != PAGE_SIZE) {
   39.41 -	ERR("read pfn_to_mfn_frame_list failed");
   39.42 -	goto out;
   39.43 +        ERR("read pfn_to_mfn_frame_list failed");
   39.44 +        goto out;
   39.45      }
   39.46  
   39.47      /* We want zeroed memory so use calloc rather than malloc. */
   39.48 @@ -289,10 +291,10 @@ int xc_linux_restore(int xc_handle, int 
   39.49                          if ( xpfn >= nr_pfns )
   39.50                          {
   39.51                              ERR("Frame number in type %lu page "
   39.52 -                                       "table is out of range. i=%d k=%d "
   39.53 -                                       "pfn=0x%lx nr_pfns=%lu", 
   39.54 -                                       region_pfn_type[i]>>28, i, 
   39.55 -                                       k, xpfn, nr_pfns);
   39.56 +                                "table is out of range. i=%d k=%d "
   39.57 +                                "pfn=0x%lx nr_pfns=%lu", 
   39.58 +                                region_pfn_type[i]>>28, i, 
   39.59 +                                k, xpfn, nr_pfns);
   39.60                              goto out;
   39.61                          }
   39.62  
   39.63 @@ -317,10 +319,10 @@ int xc_linux_restore(int xc_handle, int 
   39.64                          if ( xpfn >= nr_pfns )
   39.65                          {
   39.66                              ERR("Frame number in type %lu page"
   39.67 -                                       " table is out of range. i=%d k=%d "
   39.68 -                                       "pfn=%lu nr_pfns=%lu",
   39.69 -                                       region_pfn_type[i]>>28, i, k, 
   39.70 -                                       xpfn, nr_pfns);
   39.71 +                                " table is out of range. i=%d k=%d "
   39.72 +                                "pfn=%lu nr_pfns=%lu",
   39.73 +                                region_pfn_type[i]>>28, i, k, 
   39.74 +                                xpfn, nr_pfns);
   39.75                              goto out;
   39.76                          }
   39.77  
   39.78 @@ -334,8 +336,8 @@ int xc_linux_restore(int xc_handle, int 
   39.79  
   39.80              default:
   39.81                  ERR("Bogus page type %lx page table is "
   39.82 -                           "out of range. i=%d nr_pfns=%lu", 
   39.83 -                           region_pfn_type[i], i, nr_pfns);
   39.84 +                    "out of range. i=%d nr_pfns=%lu", 
   39.85 +                    region_pfn_type[i], i, nr_pfns);
   39.86                  goto out;
   39.87  
   39.88              } /* end of page type switch statement */
   39.89 @@ -362,8 +364,8 @@ int xc_linux_restore(int xc_handle, int 
   39.90              }
   39.91  
   39.92              if ( xc_add_mmu_update(xc_handle, mmu,
   39.93 -				   (mfn<<PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
   39.94 -				   pfn) )
   39.95 +                                   (mfn<<PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
   39.96 +                                   pfn) )
   39.97              {
   39.98                  printf("machpys mfn=%ld pfn=%ld\n",mfn,pfn);
   39.99                  goto out;
  39.100 @@ -377,6 +379,33 @@ int xc_linux_restore(int xc_handle, int 
  39.101  
  39.102      DPRINTF("Received all pages\n");
  39.103  
  39.104 +    if ( pt_levels == 3 )
  39.105 +    {
  39.106 +        /* Get all PGDs below 4GB. */
  39.107 +        for ( i = 0; i < nr_pfns; i++ )
  39.108 +        {
  39.109 +            if ( ((pfn_type[i] & LTABTYPE_MASK) == L3TAB) &&
  39.110 +                 (pfn_to_mfn_table[i] > 0xfffffUL) )
  39.111 +            {
  39.112 +                unsigned long new_mfn = xc_make_page_below_4G(
  39.113 +                    xc_handle, dom, pfn_to_mfn_table[i]);
  39.114 +                if ( new_mfn == 0 )
  39.115 +                {
  39.116 +                    fprintf(stderr, "Couldn't get a page below 4GB :-(\n");
  39.117 +                    goto out;
  39.118 +                }
  39.119 +                pfn_to_mfn_table[i] = new_mfn;
  39.120 +                if ( xc_add_mmu_update(
  39.121 +                    xc_handle, mmu, (new_mfn << PAGE_SHIFT) |
  39.122 +                    MMU_MACHPHYS_UPDATE, i) )
  39.123 +                {
  39.124 +                    fprintf(stderr, "Couldn't m2p on PAE root pgdir\n");
  39.125 +                    goto out;
  39.126 +                }
  39.127 +            }
  39.128 +        }
  39.129 +    }
  39.130 +
  39.131      if ( xc_finish_mmu_updates(xc_handle, mmu) )
  39.132          goto out;
  39.133  
  39.134 @@ -410,57 +439,57 @@ int xc_linux_restore(int xc_handle, int 
  39.135  
  39.136      /* Get the list of PFNs that are not in the psuedo-phys map */
  39.137      {
  39.138 -	unsigned int count;
  39.139 +        unsigned int count;
  39.140          unsigned long *pfntab;
  39.141 -	int rc;
  39.142 -
  39.143 -	if ( read_exact(io_fd, &count, sizeof(count)) != sizeof(count) )
  39.144 -	{
  39.145 -	    ERR("Error when reading pfn count");
  39.146 -	    goto out;
  39.147 -	}
  39.148 +        int rc;
  39.149  
  39.150 -	pfntab = malloc( sizeof(unsigned int) * count );
  39.151 -	if ( pfntab == NULL )
  39.152 -	{
  39.153 -	    ERR("Out of memory");
  39.154 -	    goto out;
  39.155 -	}
  39.156 +        if ( read_exact(io_fd, &count, sizeof(count)) != sizeof(count) )
  39.157 +        {
  39.158 +            ERR("Error when reading pfn count");
  39.159 +            goto out;
  39.160 +        }
  39.161  
  39.162 -	if ( read_exact(io_fd, pfntab, sizeof(unsigned int)*count) !=
  39.163 +        pfntab = malloc( sizeof(unsigned int) * count );
  39.164 +        if ( pfntab == NULL )
  39.165 +        {
  39.166 +            ERR("Out of memory");
  39.167 +            goto out;
  39.168 +        }
  39.169 +
  39.170 +        if ( read_exact(io_fd, pfntab, sizeof(unsigned int)*count) !=
  39.171               sizeof(unsigned int)*count )
  39.172 -	{
  39.173 -	    ERR("Error when reading pfntab");
  39.174 -	    goto out;
  39.175 -	}
  39.176 +        {
  39.177 +            ERR("Error when reading pfntab");
  39.178 +            goto out;
  39.179 +        }
  39.180  
  39.181 -	for ( i = 0; i < count; i++ )
  39.182 -	{
  39.183 -	    unsigned long pfn = pfntab[i];
  39.184 -	    pfntab[i]=pfn_to_mfn_table[pfn];
  39.185 -	    pfn_to_mfn_table[pfn] = 0x80000001;  // not in pmap
  39.186 -	}
  39.187 +        for ( i = 0; i < count; i++ )
  39.188 +        {
  39.189 +            unsigned long pfn = pfntab[i];
  39.190 +            pfntab[i]=pfn_to_mfn_table[pfn];
  39.191 +            pfn_to_mfn_table[pfn] = 0x80000001;  // not in pmap
  39.192 +        }
  39.193  
  39.194 -	if ( count > 0 )
  39.195 -	{
  39.196 +        if ( count > 0 )
  39.197 +        {
  39.198              struct xen_memory_reservation reservation = {
  39.199                  .extent_start = pfntab,
  39.200                  .nr_extents   = count,
  39.201                  .extent_order = 0,
  39.202                  .domid        = dom
  39.203              };
  39.204 -	    if ( (rc = xc_memory_op(xc_handle,
  39.205 +            if ( (rc = xc_memory_op(xc_handle,
  39.206                                      XENMEM_decrease_reservation,
  39.207                                      &reservation)) != count )
  39.208 -	    {
  39.209 -		ERR("Could not decrease reservation : %d",rc);
  39.210 -		goto out;
  39.211 -	    }
  39.212 -	    else
  39.213 -	    {
  39.214 -		printf("Decreased reservation by %d pages\n", count);
  39.215 -	    }
  39.216 -	}	
  39.217 +            {
  39.218 +                ERR("Could not decrease reservation : %d",rc);
  39.219 +                goto out;
  39.220 +            }
  39.221 +            else
  39.222 +            {
  39.223 +                printf("Decreased reservation by %d pages\n", count);
  39.224 +            }
  39.225 +        } 
  39.226      }
  39.227  
  39.228      if ( read_exact(io_fd, &ctxt,            sizeof(ctxt)) != sizeof(ctxt) ||
  39.229 @@ -484,10 +513,10 @@ int xc_linux_restore(int xc_handle, int 
  39.230      start_info->shared_info = shared_info_frame << PAGE_SHIFT;
  39.231      start_info->flags       = 0;
  39.232      *store_mfn = start_info->store_mfn   =
  39.233 -	pfn_to_mfn_table[start_info->store_mfn];
  39.234 +        pfn_to_mfn_table[start_info->store_mfn];
  39.235      start_info->store_evtchn = store_evtchn;
  39.236      *console_mfn = start_info->console_mfn   =
  39.237 -	pfn_to_mfn_table[start_info->console_mfn];
  39.238 +        pfn_to_mfn_table[start_info->console_mfn];
  39.239      start_info->console_evtchn = console_evtchn;
  39.240      munmap(start_info, PAGE_SIZE);
  39.241  
  39.242 @@ -522,7 +551,7 @@ int xc_linux_restore(int xc_handle, int 
  39.243  
  39.244      /* clear any pending events and the selector */
  39.245      memset(&(shared_info->evtchn_pending[0]), 0,
  39.246 -	   sizeof (shared_info->evtchn_pending));
  39.247 +           sizeof (shared_info->evtchn_pending));
  39.248      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
  39.249          shared_info->vcpu_data[i].evtchn_pending_sel = 0;
  39.250  
  39.251 @@ -548,7 +577,7 @@ int xc_linux_restore(int xc_handle, int 
  39.252      }
  39.253      
  39.254      if ( (live_pfn_to_mfn_table = 
  39.255 -	  xc_map_foreign_batch(xc_handle, dom, 
  39.256 +          xc_map_foreign_batch(xc_handle, dom, 
  39.257                                 PROT_WRITE,
  39.258                                 pfn_to_mfn_frame_list,
  39.259                                 (nr_pfns+1023)/1024 )) == 0 )
    40.1 --- a/tools/libxc/xc_private.c	Fri Sep 09 10:31:36 2005 -0600
    40.2 +++ b/tools/libxc/xc_private.c	Tue Sep 13 10:14:16 2005 -0600
    40.3 @@ -425,23 +425,49 @@ int xc_dom0_op(int xc_handle, dom0_op_t 
    40.4  
    40.5  int xc_version(int xc_handle, int cmd, void *arg)
    40.6  {
    40.7 -    return do_xen_version(xc_handle, cmd, arg);
    40.8 +    int rc, argsize = 0;
    40.9 +
   40.10 +    switch ( cmd )
   40.11 +    {
   40.12 +    case XENVER_extraversion: argsize = sizeof(xen_extraversion_t); break;
   40.13 +    case XENVER_compile_info: argsize = sizeof(xen_compile_info_t); break;
   40.14 +    case XENVER_capabilities: argsize = sizeof(xen_capabilities_info_t); break;
   40.15 +    case XENVER_changeset:    argsize = sizeof(xen_changeset_info_t); break;
   40.16 +    case XENVER_parameters:   argsize = sizeof(xen_parameters_info_t); break;
   40.17 +    }
   40.18 +
   40.19 +    if ( (argsize != 0) && (mlock(arg, argsize) != 0) )
   40.20 +    {
   40.21 +        PERROR("Could not lock memory for version hypercall");
   40.22 +        return -ENOMEM;
   40.23 +    }
   40.24 +
   40.25 +    rc = do_xen_version(xc_handle, cmd, arg);
   40.26 +
   40.27 +    if ( argsize != 0 )
   40.28 +        safe_munlock(arg, argsize);
   40.29 +
   40.30 +    return rc;
   40.31  }
   40.32  
   40.33 -unsigned long xc_make_page_below_4G(int xc_handle, u32 domid, 
   40.34 -				    unsigned long mfn)
   40.35 +unsigned long xc_make_page_below_4G(
   40.36 +    int xc_handle, u32 domid, unsigned long mfn)
   40.37  {
   40.38      unsigned long new_mfn;
   40.39 +
   40.40      if ( xc_domain_memory_decrease_reservation( 
   40.41 -	xc_handle, domid, 1, 0, &mfn ) != 1 )
   40.42 +	xc_handle, domid, 1, 0, &mfn) != 1 )
   40.43      {
   40.44  	fprintf(stderr,"xc_make_page_below_4G decrease failed. mfn=%lx\n",mfn);
   40.45  	return 0;
   40.46      }
   40.47 -    if ( xc_domain_memory_increase_reservation( xc_handle, domid, 1, 0, 32, &new_mfn ) != 1 )
   40.48 +
   40.49 +    if ( xc_domain_memory_increase_reservation(
   40.50 +        xc_handle, domid, 1, 0, 32, &new_mfn) != 1 )
   40.51      {
   40.52  	fprintf(stderr,"xc_make_page_below_4G increase failed. mfn=%lx\n",mfn);
   40.53  	return 0;
   40.54      }
   40.55 +
   40.56      return new_mfn;
   40.57  }
    41.1 --- a/tools/libxc/xc_vmx_build.c	Fri Sep 09 10:31:36 2005 -0600
    41.2 +++ b/tools/libxc/xc_vmx_build.c	Tue Sep 13 10:14:16 2005 -0600
    41.3 @@ -578,15 +578,6 @@ static int setup_guest(int xc_handle,
    41.4      sp->sp_global.eport = control_evtchn;
    41.5      munmap(sp, PAGE_SIZE);
    41.6  
    41.7 -    /*
    41.8 -     * Pin down l2tab addr as page dir page - causes hypervisor to provide
    41.9 -     * correct protection for the page
   41.10 -     */ 
   41.11 -#ifdef __i386__
   41.12 -    if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) )
   41.13 -        goto error_out;
   41.14 -#endif
   41.15 -
   41.16      /* Send the page update requests down to the hypervisor. */
   41.17      if ( xc_finish_mmu_updates(xc_handle, mmu) )
   41.18          goto error_out;
    42.1 --- a/tools/python/Makefile	Fri Sep 09 10:31:36 2005 -0600
    42.2 +++ b/tools/python/Makefile	Tue Sep 13 10:14:16 2005 -0600
    42.3 @@ -1,7 +1,8 @@
    42.4 -
    42.5  XEN_ROOT = ../..
    42.6  include $(XEN_ROOT)/tools/Rules.mk
    42.7  
    42.8 +.PHONY: all build install clean
    42.9 +
   42.10  all: build
   42.11  build:
   42.12  	CFLAGS="$(CFLAGS)" python setup.py build
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/tools/python/pylintrc	Tue Sep 13 10:14:16 2005 -0600
    43.3 @@ -0,0 +1,307 @@
    43.4 +# lint Python modules using external checkers.                            
    43.5 +#                                                                                
    43.6 +#     This is the main checker controling the other ones and the reports         
    43.7 +#     generation. It is itself both a raw checker and an astng checker in order  
    43.8 +#     to:                                                                        
    43.9 +#     * handle message activation / deactivation at the module level             
   43.10 +#     * handle some basic but necessary stats'data (number of classes, methods...)
   43.11 +#                                                                                 
   43.12 +# This checker also defines the following reports:                                    
   43.13 +#   * R0001: Total errors / warnings                                              
   43.14 +#   * R0002: % errors / warnings by module                                        
   43.15 +#   * R0003: Messages                                                             
   43.16 +#   * R0004: Global evaluation                                                    
   43.17 +# 
   43.18 +[MASTER]
   43.19 +# Add <file or directory> to the black list. It should be a base name, not a
   43.20 +# path. You may set this option multiple times.
   43.21 +ignore=CVS
   43.22 +
   43.23 +# Pickle collected data for later comparisons.
   43.24 +persistent=yes
   43.25 +
   43.26 +# Set the cache size for astng objects.
   43.27 +cache-size=500
   43.28 +
   43.29 +
   43.30 +
   43.31 +[REPORTS]
   43.32 +# Tells wether to display a full report or only the messages
   43.33 +reports=yes
   43.34 +
   43.35 +# Use HTML as output format instead of text
   43.36 +html=no
   43.37 +
   43.38 +# Use a parseable text output format, so your favorite text editor will be able
   43.39 +# to jump to the line corresponding to a message.
   43.40 +parseable=no
   43.41 +
   43.42 +# Colorizes text output using ansi escape codes
   43.43 +color=no
   43.44 +
   43.45 +# Put messages in a separate file for each module / package specified on the
   43.46 +# command line instead of printing them on stdout. Reports (if any) will be
   43.47 +# written in a file name "pylint_global.[txt|html]".
   43.48 +files-output=no
   43.49 +
   43.50 +# Python expression which should return a note less than 10 (10 is the highest
   43.51 +# note).You have access to the variables errors warning, statement which
   43.52 +# respectivly contain the number of errors / warnings messages and the total
   43.53 +# number of statements analyzed. This is used by the global evaluation report
   43.54 +# (R0004).
   43.55 +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
   43.56 +
   43.57 +# Add a comment according to your evaluation note. This is used by the global
   43.58 +# evaluation report (R0004).
   43.59 +comment=no
   43.60 +
   43.61 +# Include message's id in output
   43.62 +include-ids=yes
   43.63 +
   43.64 +
   43.65 +
   43.66 +# checks for                                                              
   43.67 +#     * unused variables / imports                                               
   43.68 +#     * undefined variables                                                      
   43.69 +#     * redefinition of variable from builtins or from an outer scope            
   43.70 +#     * use of variable before assigment                                         
   43.71 +#     
   43.72 +[VARIABLES]
   43.73 +# Enable / disable this checker
   43.74 +enable-variables=yes
   43.75 +
   43.76 +# Tells wether we should check for unused import in __init__ files.
   43.77 +init-import=no
   43.78 +
   43.79 +# List of variable names used for dummy variables (i.e. not used).
   43.80 +dummy-variables=_,dummy
   43.81 +
   43.82 +
   43.83 +
   43.84 +# checks for :                                                            
   43.85 +#     * doc strings                                                              
   43.86 +#     * modules / classes / functions / methods / arguments / variables name     
   43.87 +#     * number of arguments, local variables, branchs, returns and statements in
   43.88 +# functions, methods                                                       
   43.89 +#     * required module attributes                                             
   43.90 +#     * dangerous default values as arguments                                    
   43.91 +#     * redefinition of function / method / class                                
   43.92 +#     * uses of the global statement                                             
   43.93 +#                                                                                 
   43.94 +# This checker also defines the following reports:                                    
   43.95 +#   * R0101: Statistics by type                                                   
   43.96 +# 
   43.97 +[BASIC]
   43.98 +# Enable / disable this checker
   43.99 +enable-basic=yes
  43.100 +
  43.101 +# Required attributes for module, separated by a comma
  43.102 +required-attributes=
  43.103 +
  43.104 +# Regular expression which should only match functions or classes name which do
  43.105 +# not require a docstring
  43.106 +no-docstring-rgx=.*
  43.107 +
  43.108 +# Minimal length for module / class / function / method / argument / variable
  43.109 +# names
  43.110 +min-name-length=1
  43.111 +
  43.112 +# Regular expression which should only match correct module names
  43.113 +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  43.114 +
  43.115 +# Regular expression which should only match correct class names
  43.116 +class-rgx=[A-Z_][a-zA-Z0-9]+$
  43.117 +
  43.118 +# Regular expression which should only match correct function names
  43.119 +function-rgx=[a-z_][A-Za-z0-9_]*$
  43.120 +
  43.121 +# Regular expression which should only match correct method names
  43.122 +method-rgx=[a-z_][A-Za-z0-9_]*$
  43.123 +
  43.124 +# Regular expression which should only match correct argument names
  43.125 +argument-rgx=[a-z_][A-Za-z0-9_]*$
  43.126 +
  43.127 +# Regular expression which should only match correct variable names
  43.128 +variable-rgx=[a-z_][A-Za-z0-9_]*$
  43.129 +
  43.130 +# Good variable names which should always be accepted, separated by a comma
  43.131 +good-names=i,j,k,ex,Run,_
  43.132 +
  43.133 +# Bad variable names which should always be refused, separated by a comma
  43.134 +bad-names=foo,bar,baz,toto,tutu,tata
  43.135 +
  43.136 +# List of builtins function names that should not be used, separated by a comma
  43.137 +bad-functions=map,filter,apply,input
  43.138 +
  43.139 +
  43.140 +
  43.141 +# checks for sign of poor/misdesign:                                      
  43.142 +#     * number of methods, attributes, local variables...                        
  43.143 +#     * size, complexity of functions, methods                                   
  43.144 +#     
  43.145 +[DESIGN]
  43.146 +# Enable / disable this checker
  43.147 +enable-design=yes
  43.148 +
  43.149 +# Maximum number of arguments for function / method
  43.150 +max-args=15
  43.151 +
  43.152 +# Maximum number of locals for function / method body
  43.153 +max-locals=15
  43.154 +
  43.155 +# Maximum number of return / yield for function / method body
  43.156 +max-returns=6
  43.157 +
  43.158 +# Maximum number of branch for function / method body
  43.159 +max-branchs=12
  43.160 +
  43.161 +# Maximum number of statements in function / method body
  43.162 +max-statements=50
  43.163 +
  43.164 +# Maximum number of parents for a class (see R0901).
  43.165 +max-parents=7
  43.166 +
  43.167 +# Maximum number of attributes for a class (see R0902).
  43.168 +max-attributes=7
  43.169 +
  43.170 +# Minimum number of public methods for a class (see R0903).
  43.171 +min-public-methods=2
  43.172 +
  43.173 +# Maximum number of public methods for a class (see R0904).
  43.174 +max-public-methods=20
  43.175 +
  43.176 +
  43.177 +
  43.178 +# checks for :                                                            
  43.179 +#     * methods without self as first argument                                   
  43.180 +#     * overriden methods signature                                              
  43.181 +#     * access only to existant members via self                                 
  43.182 +#     * attributes not defined in the __init__ method                            
  43.183 +#     * supported interfaces implementation                                      
  43.184 +#     * unreachable code                                                         
  43.185 +#     
  43.186 +[CLASSES]
  43.187 +# Enable / disable this checker
  43.188 +enable-classes=yes
  43.189 +
  43.190 +# List of interface methods to ignore, separated by a comma. This is used for
  43.191 +# instance to not check methods defines in Zope's Interface base class.
  43.192 +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
  43.193 +
  43.194 +# Tells wether missing members accessed in mixin class should be ignored. A
  43.195 +# mixin class is detected if its name ends with "mixin" (case insensitive).
  43.196 +ignore-mixin-members=yes
  43.197 +
  43.198 +
  43.199 +
  43.200 +# checks for                                                              
  43.201 +#     * external modules dependencies                                            
  43.202 +#     * relative / wildcard imports                                                         
  43.203 +#     * cyclic imports                                                           
  43.204 +#     * uses of deprecated modules
  43.205 +#                                                                                 
  43.206 +# This checker also defines the following reports:                                    
  43.207 +#   * R0401: External dependencies                                                
  43.208 +#   * R0402: Modules dependencies graph                                           
  43.209 +# 
  43.210 +[IMPORTS]
  43.211 +# Enable / disable this checker
  43.212 +enable-imports=no
  43.213 +
  43.214 +# Deprecated modules which should not be used, separated by a comma
  43.215 +deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
  43.216 +
  43.217 +# Create a graph of every (i.e. internal and external) dependencies in the given
  43.218 +# file (report R0402 must not be disabled)
  43.219 +import-graph=
  43.220 +
  43.221 +# Create a graph of external dependencies in the given file (report R0402 must
  43.222 +# not be disabled)
  43.223 +ext-import-graph=
  43.224 +
  43.225 +# Create a graph of internal dependencies in the given file (report R0402 must
  43.226 +# not be disabled)
  43.227 +int-import-graph=
  43.228 +
  43.229 +
  43.230 +
  43.231 +# checks for                                                              
  43.232 +#     * excepts without exception filter                                         
  43.233 +#     * string exceptions                                                        
  43.234 +#     
  43.235 +[EXCEPTIONS]
  43.236 +# Enable / disable this checker
  43.237 +enable-exceptions=yes
  43.238 +
  43.239 +
  43.240 +
  43.241 +# checks for :                                                            
  43.242 +#     * unauthorized constructions                                               
  43.243 +#     * strict indentation                                                       
  43.244 +#     * line length                                                              
  43.245 +#     * use of <> instead of !=
  43.246 +#     
  43.247 +[FORMAT]
  43.248 +# Enable / disable this checker
  43.249 +enable-format=no
  43.250 +
  43.251 +# Maximum number of characters on a single line.
  43.252 +max-line-length=80
  43.253 +
  43.254 +# Maximum number of lines in a module
  43.255 +max-module-lines=1000
  43.256 +
  43.257 +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
  43.258 +indent-string='    '
  43.259 +
  43.260 +
  43.261 +
  43.262 +# does not check anything but gives some raw metrics :                    
  43.263 +#     * total number of lines                                                    
  43.264 +#     * total number of code lines                                               
  43.265 +#     * total number of docstring lines                                          
  43.266 +#     * total number of comments lines                                           
  43.267 +#     * total number of empty lines                                              
  43.268 +#                                                                                 
  43.269 +# This checker also defines the following reports:                                    
  43.270 +#   * R0701: Raw metrics                                                          
  43.271 +# 
  43.272 +[METRICS]
  43.273 +# Enable / disable this checker
  43.274 +enable-metrics=yes
  43.275 +
  43.276 +
  43.277 +
  43.278 +# checks for:                                                             
  43.279 +#     * warning notes in the code like FIXME, XXX                                
  43.280 +#     * PEP 263: source code with non ascii character but no encoding declaration
  43.281 +#     
  43.282 +[MISCELLANEOUS]
  43.283 +# Enable / disable this checker
  43.284 +enable-miscellaneous=yes
  43.285 +
  43.286 +# List of note tags to take in consideration, separated by a comma. Default to
  43.287 +# FIXME, XXX, TODO
  43.288 +notes=FIXME,XXX,TODO
  43.289 +
  43.290 +
  43.291 +
  43.292 +# checks for similarities and duplicated code. This computation may be
  43.293 +#     memory / CPU intensive, so you should disable it if you experiments some
  43.294 +#     problems.
  43.295 +#                                                                                 
  43.296 +# This checker also defines the following reports:                                    
  43.297 +#   * R0801: Duplication                                                          
  43.298 +# 
  43.299 +[SIMILARITIES]
  43.300 +# Enable / disable this checker
  43.301 +enable-similarities=yes
  43.302 +
  43.303 +# Minimum lines number of a similarity.
  43.304 +min-similarity-lines=4
  43.305 +
  43.306 +# Ignore comments when computing similarities.
  43.307 +ignore-comments=yes
  43.308 +
  43.309 +
  43.310 +
    44.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 10:31:36 2005 -0600
    44.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Sep 13 10:14:16 2005 -0600
    44.3 @@ -756,7 +756,7 @@ static PyObject *pyxc_xeninfo(PyObject *
    44.4                           "xen_major", xen_version >> 16,
    44.5                           "xen_minor", (xen_version & 0xffff),
    44.6                           "xen_extra", xen_extra,
    44.7 -                         "xen_caps",  xen_caps.caps,
    44.8 +                         "xen_caps",  xen_caps,
    44.9                           "xen_params", str,
   44.10                           "xen_changeset", xen_chgset,
   44.11                           "cc_compiler", xen_cc.compiler,
    45.1 --- a/tools/python/xen/sv/DomInfo.py	Fri Sep 09 10:31:36 2005 -0600
    45.2 +++ b/tools/python/xen/sv/DomInfo.py	Tue Sep 13 10:14:16 2005 -0600
    45.3 @@ -75,7 +75,7 @@ class DomGeneralTab( CompositeTab ):
    45.4         
    45.5  class DomGenTab( GeneralTab ):
    45.6  
    45.7 -    def __init__( self, urlWriter ):
    45.8 +    def __init__( self, _ ):
    45.9      
   45.10          titles = {}
   45.11      
   45.12 @@ -103,7 +103,7 @@ class DomGenTab( GeneralTab ):
   45.13              
   45.14  class DomSXPTab( PreTab ):
   45.15  
   45.16 -    def __init__( self, urlWriter ):
   45.17 +    def __init__( self, _ ):
   45.18          self.dom = 0
   45.19          PreTab.__init__( self, "" )
   45.20  
   45.21 @@ -126,7 +126,7 @@ class DomSXPTab( PreTab ):
   45.22         
   45.23  class DomActionTab( ActionTab ):
   45.24  
   45.25 -    def __init__( self, urlWriter ):
   45.26 +    def __init__( self, _ ):
   45.27      	actions = { "shutdown" : "Shutdown",
   45.28          	    "reboot" : "Reboot",
   45.29                      "pause" : "Pause",
   45.30 @@ -188,19 +188,19 @@ class DomDeviceListTab( NullTab ):
   45.31  
   45.32      title = "Device List"
   45.33  
   45.34 -    def __init__( self, urlWriter ):
   45.35 +    def __init__( self, _ ):
   45.36          pass
   45.37  
   45.38  class DomDeviceOptionsTab( NullTab ):
   45.39  
   45.40      title = "Device Options"
   45.41  
   45.42 -    def __init__( self, urlWriter ):
   45.43 +    def __init__( self, _ ):
   45.44          pass
   45.45  
   45.46  class DomDeviceActionTab( ActionTab ):
   45.47  
   45.48 -    def __init__( self, urlWriter ):
   45.49 +    def __init__( self, _ ):
   45.50          ActionTab.__init__( self, { "addvcpu" : "Add VCPU", "addvbd" : "Add VBD", "addvif" : "Add VIF" } )
   45.51  
   45.52  class DomMigrateTab( CompositeTab ):
   45.53 @@ -218,7 +218,7 @@ class DomMigrateExtraTab( Sheet ):
   45.54                                                                                                              
   45.55  class DomMigrateActionTab( ActionTab ):
   45.56  
   45.57 -    def __init__( self, urlWriter ):
   45.58 +    def __init__( self, _ ):
   45.59          actions = { "migrate" : "Migrate" }
   45.60          ActionTab.__init__( self, actions )
   45.61                  
   45.62 @@ -249,7 +249,7 @@ class DomSaveExtraTab( Sheet ):
   45.63                 
   45.64  class DomSaveActionTab( ActionTab ):
   45.65  
   45.66 -    def __init__( self, urlWriter ):
   45.67 +    def __init__( self, _ ):
   45.68          actions = { "save" : "Save" }
   45.69          ActionTab.__init__( self, actions )
   45.70  
    46.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Sep 09 10:31:36 2005 -0600
    46.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Sep 13 10:14:16 2005 -0600
    46.3 @@ -47,6 +47,7 @@ from xen.xend.XendRoot import get_compon
    46.4  
    46.5  from xen.xend.uuid import getUuid
    46.6  from xen.xend.xenstore import DBVar, XenNode, DBMap
    46.7 +from xen.xend.xenstore.xstransact import xstransact
    46.8  
    46.9  """Shutdown code for poweroff."""
   46.10  DOMAIN_POWEROFF = 0
   46.11 @@ -101,34 +102,6 @@ def shutdown_reason(code):
   46.12      """
   46.13      return shutdown_reasons.get(code, "?")
   46.14  
   46.15 -config_handlers = {}
   46.16 -
   46.17 -def add_config_handler(name, h):
   46.18 -    """Add a handler for a config field.
   46.19 -
   46.20 -    @param name:     field name
   46.21 -    @param h:        handler: fn(vm, config, field, index)
   46.22 -    """
   46.23 -    config_handlers[name] = h
   46.24 -
   46.25 -def get_config_handler(name):
   46.26 -    """Get a handler for a config field.
   46.27 -
   46.28 -    returns handler or None
   46.29 -    """
   46.30 -    return config_handlers.get(name)
   46.31 -
   46.32 -"""Table of handlers for devices.
   46.33 -Indexed by device type.
   46.34 -"""
   46.35 -device_handlers = {}
   46.36 -
   46.37 -def add_device_handler(name, type):
   46.38 -    device_handlers[name] = type
   46.39 -
   46.40 -def get_device_handler(name):
   46.41 -    return device_handlers[name]
   46.42 -
   46.43  def dom_get(dom):
   46.44      """Get info from xen for an existing domain.
   46.45  
   46.46 @@ -156,7 +129,8 @@ class XendDomainInfo:
   46.47          """
   46.48          uuid = getUuid()
   46.49          db = parentdb.addChild(uuid)
   46.50 -        vm = cls(db)
   46.51 +        path = parentdb.getPath()
   46.52 +        vm = cls(uuid, path, db)
   46.53          vm.construct(config)
   46.54          vm.saveToDB(sync=True)
   46.55  
   46.56 @@ -171,7 +145,8 @@ class XendDomainInfo:
   46.57          @param info:      domain info from xc
   46.58          """
   46.59          dom = info['dom']
   46.60 -        vm = cls(db)
   46.61 +        path = "/".join(db.getPath().split("/")[0:-1])
   46.62 +        vm = cls(db.getName(), path, db)
   46.63          vm.setdom(dom)
   46.64          db.readDB()
   46.65          vm.importFromDB()
   46.66 @@ -206,7 +181,8 @@ class XendDomainInfo:
   46.67          if not uuid:
   46.68              uuid = getUuid()
   46.69          db = parentdb.addChild(uuid)
   46.70 -        vm = cls(db)
   46.71 +        path = parentdb.getPath()
   46.72 +        vm = cls(uuid, path, db)
   46.73          ssidref = int(sxp.child_value(config, 'ssidref'))
   46.74          log.debug('restoring with ssidref='+str(ssidref))
   46.75          id = xc.domain_create(ssidref = ssidref)
   46.76 @@ -239,9 +215,10 @@ class XendDomainInfo:
   46.77          DBVar('device_model_pid', ty='int'),
   46.78          ]
   46.79      
   46.80 -    def __init__(self, db):
   46.81 +    def __init__(self, uuid, path, db):
   46.82 +        self.uuid = uuid
   46.83 +        self.path = path + "/" + uuid
   46.84          self.db = db
   46.85 -        self.uuid = db.getName()
   46.86  
   46.87          self.recreate = 0
   46.88          self.restore = 0
   46.89 @@ -364,12 +341,6 @@ class XendDomainInfo:
   46.90  
   46.91      __repr__ = __str__
   46.92  
   46.93 -    def getDeviceTypes(self):
   46.94 -        return self.controllers.keys()
   46.95 -
   46.96 -    def getDeviceControllers(self):
   46.97 -        return self.controllers.values()
   46.98 -
   46.99      def getDeviceController(self, type, error=True):
  46.100          ctrl = self.controllers.get(type)
  46.101          if not ctrl and error:
  46.102 @@ -392,35 +363,28 @@ class XendDomainInfo:
  46.103              typedev = sxp.child_value(devconfig, 'dev')
  46.104              if re.match('^ioemu:', typedev):
  46.105  	        return;
  46.106 +
  46.107              backdom = domain_exists(sxp.child_value(devconfig, 'backend', '0'))
  46.108  
  46.109              devnum = blkdev_name_to_number(sxp.child_value(devconfig, 'dev'))
  46.110  
  46.111 -            # create backend db
  46.112 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
  46.113 -                                         (type, self.uuid, devnum))
  46.114 -
  46.115 -            # create frontend db
  46.116 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
  46.117 -            
  46.118 -            db['virtual-device'] = "%i" % devnum
  46.119 -            #db['backend'] = sxp.child_value(devconfig, 'backend', '0')
  46.120 -            db['backend'] = backdb.getPath()
  46.121 -            db['backend-id'] = "%i" % backdom.id
  46.122 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
  46.123 +                                                self.uuid, devnum)
  46.124 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
  46.125  
  46.126 -            backdb['frontend'] = db.getPath()
  46.127 -            (type, params) = string.split(sxp.child_value(devconfig, 'uname'), ':', 1)
  46.128 -            node = Blkctl.block('bind', type, params)
  46.129 -            backdb['frontend-id'] = "%i" % self.id
  46.130 -            backdb['physical-device'] = "%li" % blkdev_name_to_number(node)
  46.131 -            backdb.saveDB(save=True)
  46.132 +            front = { 'backend' : backpath,
  46.133 +                      'backend-id' : "%i" % backdom.id,
  46.134 +                      'virtual-device' : "%i" % devnum }
  46.135 +            xstransact.Write(frontpath, front)
  46.136  
  46.137 -            # Ok, super gross, this really doesn't belong in the frontend db...
  46.138 -            db['type'] = type
  46.139 -            db['node'] = node
  46.140 -            db['params'] = params
  46.141 -            db.saveDB(save=True)
  46.142 -            
  46.143 +            (type, params) = string.split(sxp.child_value(devconfig,
  46.144 +                                                          'uname'), ':', 1)
  46.145 +            back = { 'type' : type,
  46.146 +                     'params' : params,
  46.147 +                     'frontend' : frontpath,
  46.148 +                     'frontend-id' : "%i" % self.id }
  46.149 +            xstransact.Write(backpath, back)
  46.150 +
  46.151              return
  46.152  
  46.153          if type == 'vif':
  46.154 @@ -435,8 +399,6 @@ class XendDomainInfo:
  46.155  
  46.156              backdom = domain_exists(sxp.child_value(devconfig, 'backend', '0'))
  46.157  
  46.158 -            log.error(devconfig)
  46.159 -            
  46.160              devnum = self.netif_idx
  46.161              self.netif_idx += 1
  46.162  
  46.163 @@ -448,30 +410,26 @@ class XendDomainInfo:
  46.164              mac = sxp.child_value(devconfig, 'mac')
  46.165              ipaddr = _get_config_ipaddr(devconfig)
  46.166  
  46.167 -            # create backend db
  46.168 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
  46.169 -                                         (type, self.uuid, devnum))
  46.170 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
  46.171 +                                                self.uuid, devnum)
  46.172 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
  46.173  
  46.174 -            # create frontend db
  46.175 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
  46.176 -            
  46.177 -            backdb['script'] = script
  46.178 -            backdb['domain'] = self.name
  46.179 -            backdb['mac'] = mac
  46.180 -            backdb['bridge'] = bridge
  46.181 +            front = { 'backend' : backpath,
  46.182 +                      'backend-id' : "%i" % backdom.id,
  46.183 +                      'handle' : "%i" % devnum,
  46.184 +                      'mac' : mac }
  46.185 +            xstransact.Write(frontpath, front)
  46.186 +
  46.187 +            back = { 'script' : script,
  46.188 +                     'domain' : self.name,
  46.189 +                     'mac' : mac,
  46.190 +                     'bridge' : bridge,
  46.191 +                     'frontend' : frontpath,
  46.192 +                     'frontend-id' : "%i" % self.id,
  46.193 +                     'handle' : "%i" % devnum }
  46.194              if ipaddr:
  46.195 -                backdb['ip'] = ' '.join(ipaddr)
  46.196 -            backdb['frontend'] = db.getPath()
  46.197 -            backdb['frontend-id'] = "%i" % self.id
  46.198 -            backdb['handle'] = "%i" % devnum
  46.199 -            backdb.saveDB(save=True)
  46.200 -
  46.201 -            db['backend'] = backdb.getPath()
  46.202 -            db['backend-id'] = "%i" % backdom.id
  46.203 -            db['handle'] = "%i" % devnum
  46.204 -            db['mac'] = mac
  46.205 -
  46.206 -            db.saveDB(save=True)
  46.207 +                back['ip'] = ' '.join(ipaddr)
  46.208 +            xstransact.Write(backpath, back)
  46.209  
  46.210              return
  46.211          
  46.212 @@ -481,22 +439,19 @@ class XendDomainInfo:
  46.213              devnum = int(sxp.child_value(devconfig, 'instance', '0'))
  46.214              log.error("The domain has a TPM with instance %d." % devnum)
  46.215  
  46.216 -            # create backend db
  46.217 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
  46.218 -                                         (type, self.uuid, devnum))
  46.219 -            # create frontend db
  46.220 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
  46.221 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
  46.222 +                                                self.uuid, devnum)
  46.223 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
  46.224  
  46.225 -            backdb['frontend'] = db.getPath()
  46.226 -            backdb['frontend-id'] = "%i" % self.id
  46.227 -            backdb['instance'] = sxp.child_value(devconfig, 'instance', '0')
  46.228 -            backdb.saveDB(save=True)
  46.229 +            front = { 'backend' : backpath,
  46.230 +                      'backend-id' : "%i" % backdom.id,
  46.231 +                      'handle' : "%i" % devnum }
  46.232 +            xstransact.Write(frontpath, front)
  46.233  
  46.234 -            db['handle'] = "%i" % devnum
  46.235 -            db['backend'] = backdb.getPath()
  46.236 -            db['backend-id'] = "%i" % int(sxp.child_value(devconfig,
  46.237 -                                                          'backend', '0'))
  46.238 -            db.saveDB(save=True)
  46.239 +            back = { 'instance' : "%i" % devnum,
  46.240 +                     'frontend' : frontpath,
  46.241 +                     'frontend-id' : "%i" % self.id }
  46.242 +            xstransact.Write(backpath, back)
  46.243  
  46.244              return
  46.245  
  46.246 @@ -594,7 +549,7 @@ class XendDomainInfo:
  46.247  
  46.248      def sxpr_devices(self):
  46.249          sxpr = []
  46.250 -        for ty in self.getDeviceTypes():
  46.251 +        for ty in self.controllers.keys():
  46.252              devs = self.getDeviceSxprs(ty)
  46.253              sxpr += devs
  46.254          if sxpr:
  46.255 @@ -795,29 +750,17 @@ class XendDomainInfo:
  46.256          """Release all vm devices.
  46.257          """
  46.258          reboot = self.restart_pending()
  46.259 -        for ctrl in self.getDeviceControllers():
  46.260 +        for ctrl in self.controllers.values():
  46.261              if ctrl.isDestroyed(): continue
  46.262              ctrl.destroyController(reboot=reboot)
  46.263 -        ddb = self.db.addChild("/device")
  46.264 -        for type in ddb.keys():
  46.265 -            if type == 'vbd':
  46.266 -                typedb = ddb.addChild(type)
  46.267 -                for dev in typedb.keys():
  46.268 -                    devdb = typedb.addChild(str(dev))
  46.269 -                    Blkctl.block('unbind', devdb['type'].getData(),
  46.270 -                                 devdb['node'].getData())
  46.271 -                    typedb[dev].delete()
  46.272 -                typedb.saveDB(save=True)
  46.273 -            if type == 'vif':
  46.274 -                typedb = ddb.addChild(type)
  46.275 -                for dev in typedb.keys():
  46.276 -                    typedb[dev].delete()
  46.277 -                typedb.saveDB(save=True)
  46.278 -            if type == 'vtpm':
  46.279 -                typedb = ddb.addChild(type)
  46.280 -                for dev in typedb.keys():
  46.281 -                    typedb[dev].delete()
  46.282 -                typedb.saveDB(save=True)
  46.283 +        t = xstransact("%s/device" % self.path)
  46.284 +        for d in t.list("vbd"):
  46.285 +            t.remove(d)
  46.286 +        for d in t.list("vif"):
  46.287 +            t.remove(d)
  46.288 +        for d in t.list("vtpm"):
  46.289 +            t.remove(d)
  46.290 +        t.commit()
  46.291  
  46.292      def show(self):
  46.293          """Print virtual machine info.
  46.294 @@ -874,6 +817,7 @@ class XendDomainInfo:
  46.295          self.store_channel = self.eventChannelOld("store_channel")
  46.296          self.console_channel = self.eventChannel("console", "port")
  46.297  
  46.298 +
  46.299      def create_configured_devices(self):
  46.300          devices = sxp.children(self.config, 'device')
  46.301          for d in devices:
  46.302 @@ -881,18 +825,20 @@ class XendDomainInfo:
  46.303              if dev_config is None:
  46.304                  raise VmError('invalid device')
  46.305              dev_type = sxp.name(dev_config)
  46.306 -            ctrl_type = get_device_handler(dev_type)
  46.307 -            if ctrl_type is None:
  46.308 +
  46.309 +            if not controller.isDevControllerClass(dev_type):
  46.310                  raise VmError('unknown device type: ' + dev_type)
  46.311 -            self.createDevice(ctrl_type, dev_config)
  46.312 -        
  46.313 +            
  46.314 +            self.createDevice(dev_type, dev_config)
  46.315 +
  46.316 +
  46.317      def create_devices(self):
  46.318          """Create the devices for a vm.
  46.319  
  46.320          @raise: VmError for invalid devices
  46.321          """
  46.322          if self.rebooting():
  46.323 -            for ctrl in self.getDeviceControllers():
  46.324 +            for ctrl in self.controllers.values():
  46.325                  ctrl.initController(reboot=True)
  46.326          else:
  46.327              self.create_configured_devices()
  46.328 @@ -1043,7 +989,7 @@ class XendDomainInfo:
  46.329              msg = "Had a bootloader specified, but can't find disk"
  46.330              log.error(msg)
  46.331              raise VmError(msg)
  46.332 -        config = sxp.merge(['vm', blconfig ], self.config)
  46.333 +        config = sxp.merge(['vm', blcfg ], self.config)
  46.334          return config
  46.335  
  46.336      def configure_backends(self):
  46.337 @@ -1092,7 +1038,7 @@ class XendDomainInfo:
  46.338          for field in sxp.children(self.config):
  46.339              field_name = sxp.name(field)
  46.340              field_index = index.get(field_name, 0)
  46.341 -            field_handler = get_config_handler(field_name)
  46.342 +            field_handler = config_handlers.get(field_name)
  46.343              # Ignore unknown fields. Warn?
  46.344              if field_handler:
  46.345                  v = field_handler(self, self.config, field, field_index)
  46.346 @@ -1161,23 +1107,17 @@ class XendDomainInfo:
  46.347          # get run-time value of vcpus and update store
  46.348          self.exportVCPUSToDB(dom_get(self.id)['vcpus'])
  46.349  
  46.350 -def vm_field_ignore(vm, config, val, index):
  46.351 -    """Dummy config field handler used for fields with built-in handling.
  46.352  
  46.353 -    @param vm:        virtual machine
  46.354 -    @param config:    vm config
  46.355 -    @param val:       config field
  46.356 -    @param index:     field index
  46.357 +def vm_field_ignore(_, _1, _2, _3):
  46.358 +    """Dummy config field handler used for fields with built-in handling.
  46.359 +    Matches the signature required by config_handlers.
  46.360      """
  46.361      pass
  46.362  
  46.363 -def vm_field_maxmem(vm, config, val, index):
  46.364 -    """Configure vm memory limit.
  46.365  
  46.366 -    @param vm:        virtual machine
  46.367 -    @param config:    vm config
  46.368 -    @param val:       config field
  46.369 -    @param index:     field index
  46.370 +def vm_field_maxmem(vm, _1, val, _2):
  46.371 +    """Config field handler to configure vm memory limit.  Matches the
  46.372 +    signature required by config_handlers.
  46.373      """
  46.374      maxmem = sxp.child0(val)
  46.375      if maxmem is None:
  46.376 @@ -1188,8 +1128,10 @@ def vm_field_maxmem(vm, config, val, ind
  46.377          raise VmError("invalid maxmem: " + str(maxmem))
  46.378      xc.domain_setmaxmem(vm.id, maxmem_kb = maxmem * 1024)
  46.379  
  46.380 +
  46.381  #============================================================================
  46.382  # Register image handlers.
  46.383 +
  46.384  from image import          \
  46.385       addImageHandlerClass, \
  46.386       ImageHandler,         \
  46.387 @@ -1199,43 +1141,38 @@ from image import          \
  46.388  addImageHandlerClass(LinuxImageHandler)
  46.389  addImageHandlerClass(VmxImageHandler)
  46.390  
  46.391 -# Ignore the fields we already handle.
  46.392 -add_config_handler('name',       vm_field_ignore)
  46.393 -add_config_handler('memory',     vm_field_ignore)
  46.394 -add_config_handler('ssidref',    vm_field_ignore)
  46.395 -add_config_handler('cpu',        vm_field_ignore)
  46.396 -add_config_handler('cpu_weight', vm_field_ignore)
  46.397 -add_config_handler('restart',    vm_field_ignore)
  46.398 -add_config_handler('image',      vm_field_ignore)
  46.399 -add_config_handler('device',     vm_field_ignore)
  46.400 -add_config_handler('backend',    vm_field_ignore)
  46.401 -add_config_handler('vcpus',      vm_field_ignore)
  46.402 -add_config_handler('bootloader', vm_field_ignore)
  46.403  
  46.404 -# Register other config handlers.
  46.405 -add_config_handler('maxmem',     vm_field_maxmem)
  46.406 +"""Table of handlers for field configuration.
  46.407 +
  46.408 +field_name[String]: fn(vm, config, field, index) -> value(ignored)
  46.409 +"""
  46.410 +config_handlers = {
  46.411 +    
  46.412 +    # Ignore the fields we already handle.
  46.413 +    
  46.414 +    'name':       vm_field_ignore,
  46.415 +    'memory':     vm_field_ignore,
  46.416 +    'ssidref':    vm_field_ignore,
  46.417 +    'cpu':        vm_field_ignore,
  46.418 +    'cpu_weight': vm_field_ignore,
  46.419 +    'restart':    vm_field_ignore,
  46.420 +    'image':      vm_field_ignore,
  46.421 +    'device':     vm_field_ignore,
  46.422 +    'backend':    vm_field_ignore,
  46.423 +    'vcpus':      vm_field_ignore,
  46.424 +    'bootloader': vm_field_ignore,
  46.425 +    
  46.426 +    # Register other config handlers.
  46.427 +    'maxmem':     vm_field_maxmem
  46.428 +    }
  46.429 +
  46.430  
  46.431  #============================================================================
  46.432  # Register device controllers and their device config types.
  46.433  
  46.434 -from server import blkif
  46.435 -controller.addDevControllerClass("vbd", blkif.BlkifController)
  46.436 -add_device_handler("vbd", "vbd")
  46.437 -
  46.438 -from server import netif
  46.439 -controller.addDevControllerClass("vif", netif.NetifController)
  46.440 -add_device_handler("vif", "vif")
  46.441 -
  46.442 -from server import tpmif
  46.443 +from xen.xend.server import blkif, netif, tpmif, pciif, usbif
  46.444 +controller.addDevControllerClass("vbd",  blkif.BlkifController)
  46.445 +controller.addDevControllerClass("vif",  netif.NetifController)
  46.446  controller.addDevControllerClass("vtpm", tpmif.TPMifController)
  46.447 -add_device_handler("vtpm", "vtpm")
  46.448 -
  46.449 -from server import pciif
  46.450 -controller.addDevControllerClass("pci", pciif.PciController)
  46.451 -add_device_handler("pci", "pci")
  46.452 -
  46.453 -from xen.xend.server import usbif
  46.454 -controller.addDevControllerClass("usb", usbif.UsbifController)
  46.455 -add_device_handler("usb", "usb")
  46.456 -
  46.457 -#============================================================================
  46.458 +controller.addDevControllerClass("pci",  pciif.PciController)
  46.459 +controller.addDevControllerClass("usb",  usbif.UsbifController)
    47.1 --- a/tools/python/xen/xend/XendVnet.py	Fri Sep 09 10:31:36 2005 -0600
    47.2 +++ b/tools/python/xen/xend/XendVnet.py	Tue Sep 13 10:14:16 2005 -0600
    47.3 @@ -145,7 +145,7 @@ class XendVnet:
    47.4      def vnet_get(self, id):
    47.5          """Get a vnet.
    47.6  
    47.7 -        @param id: vnet id
    47.8 +        @param id vnet id
    47.9          """
   47.10          id = str(id)
   47.11          return self.vnet.get(id)
    48.1 --- a/tools/python/xen/xend/scheduler.py	Fri Sep 09 10:31:36 2005 -0600
    48.2 +++ b/tools/python/xen/xend/scheduler.py	Tue Sep 13 10:14:16 2005 -0600
    48.3 @@ -20,8 +20,8 @@ import threading
    48.4  def later(delay, fn, args=(), kwargs={}):
    48.5      """Schedule a function to be called later.
    48.6  
    48.7 -    @param _delay: delay in seconds
    48.8 -    @param _fn:    function
    48.9 +    @param delay:  delay in seconds
   48.10 +    @param fn:     function
   48.11      @param args:   arguments (list)
   48.12      @param kwargs  keyword arguments (map)
   48.13      """
   48.14 @@ -32,7 +32,7 @@ def later(delay, fn, args=(), kwargs={})
   48.15  def now(fn, args=(), kwargs={}):
   48.16      """Schedule a function to be called now.
   48.17  
   48.18 -    @param _fn:    function
   48.19 +    @param fn:     function
   48.20      @param args:   arguments (list)
   48.21      @param kwargs  keyword arguments (map)
   48.22      """
    49.1 --- a/tools/python/xen/xend/server/controller.py	Fri Sep 09 10:31:36 2005 -0600
    49.2 +++ b/tools/python/xen/xend/server/controller.py	Tue Sep 13 10:14:16 2005 -0600
    49.3 @@ -63,6 +63,13 @@ def addDevControllerClass(name, cls):
    49.4      cls.type = name
    49.5      getDevControllerTable().addDevControllerClass(cls)
    49.6  
    49.7 +
    49.8 +def isDevControllerClass(name):
    49.9 +    """@return True if a device controller class has been registered with
   49.10 +    the controller table under the given name."""
   49.11 +    return name in getDevControllerTable().controllerClasses
   49.12 +
   49.13 +
   49.14  def createDevController(name, vm, recreate=False):
   49.15      return getDevControllerTable().createDevController(name, vm, recreate=recreate)
   49.16  
    50.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Fri Sep 09 10:31:36 2005 -0600
    50.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Tue Sep 13 10:14:16 2005 -0600
    50.3 @@ -4,6 +4,7 @@
    50.4  # Public License.  See the file "COPYING" in the main directory of
    50.5  # this archive for more details.
    50.6  
    50.7 +import errno
    50.8  import threading
    50.9  from xen.lowlevel import xs
   50.10  
   50.11 @@ -18,9 +19,18 @@ def xshandle():
   50.12  class xstransact:
   50.13  
   50.14      def __init__(self, path):
   50.15 +        self.in_transaction = False
   50.16          self.path = path.rstrip("/")
   50.17 -        xshandle().transaction_start(path)
   50.18 -        self.in_transaction = True
   50.19 +        while True:
   50.20 +            try:
   50.21 +                xshandle().transaction_start(path)
   50.22 +                self.in_transaction = True
   50.23 +                return
   50.24 +            except RuntimeError, ex:
   50.25 +                if ex.args[0] == errno.ENOENT and path != "/":
   50.26 +                    path = "/".join(path.split("/")[0:-1]) or "/"
   50.27 +                else:
   50.28 +                    raise
   50.29  
   50.30      def __del__(self):
   50.31          if self.in_transaction:
   50.32 @@ -78,36 +88,81 @@ class xstransact:
   50.33          else:
   50.34              raise TypeError
   50.35  
   50.36 +    def _remove(self, key):
   50.37 +        path = "%s/%s" % (self.path, key)
   50.38 +        return xshandle().rm(path)
   50.39 +
   50.40 +    def remove(self, *args):
   50.41 +        if len(args) == 0:
   50.42 +            raise TypeError
   50.43 +        for key in args:
   50.44 +            self._remove(key)
   50.45 +
   50.46 +    def _list(self, key):
   50.47 +        path = "%s/%s" % (self.path, key)
   50.48 +        return map(lambda x: key + "/" + x, xshandle().ls(path))
   50.49 +
   50.50 +    def list(self, *args):
   50.51 +        if len(args) == 0:
   50.52 +            raise TypeError
   50.53 +        ret = []
   50.54 +        for key in args:
   50.55 +            ret.extend(self._list(key))
   50.56 +        return ret
   50.57 +
   50.58 +
   50.59      def Read(cls, path, *args):
   50.60 -        t = cls(path)
   50.61 -        v = t.read(*args)
   50.62 -        t.commit()
   50.63 -        return v
   50.64 +        while True:
   50.65 +            try:
   50.66 +                t = cls(path)
   50.67 +                v = t.read(*args)
   50.68 +                t.commit()
   50.69 +                return v
   50.70 +            except RuntimeError, ex:
   50.71 +                if ex.args[0] == errno.ETIMEDOUT:
   50.72 +                    pass
   50.73 +                raise
   50.74  
   50.75      Read = classmethod(Read)
   50.76  
   50.77      def Write(cls, path, *args, **opts):
   50.78 -        t = cls(path)
   50.79 -        t.write(*args, **opts)
   50.80 -        t.commit()
   50.81 +        while True:
   50.82 +            try:
   50.83 +                t = cls(path)
   50.84 +                t.write(*args, **opts)
   50.85 +                t.commit()
   50.86 +                return
   50.87 +            except RuntimeError, ex:
   50.88 +                if ex.args[0] == errno.ETIMEDOUT:
   50.89 +                    pass
   50.90 +                raise
   50.91  
   50.92      Write = classmethod(Write)
   50.93  
   50.94 -    def SafeRead(cls, path, *args):
   50.95 +    def Remove(cls, *args):
   50.96          while True:
   50.97              try:
   50.98 -                return cls.Read(path, *args)
   50.99 +                t = cls(path)
  50.100 +                t.remove(*args)
  50.101 +                t.commit()
  50.102 +                return
  50.103              except RuntimeError, ex:
  50.104 -                pass
  50.105 +                if ex.args[0] == errno.ETIMEDOUT:
  50.106 +                    pass
  50.107 +                raise
  50.108  
  50.109 -    SafeRead = classmethod(SafeRead)
  50.110 +    Remove = classmethod(Remove)
  50.111  
  50.112 -    def SafeWrite(cls, path, *args, **opts):
  50.113 +    def List(cls, path, *args):
  50.114          while True:
  50.115              try:
  50.116 -                cls.Write(path, *args, **opts)
  50.117 -                return
  50.118 +                t = cls(path)
  50.119 +                v = t.list(*args)
  50.120 +                t.commit()
  50.121 +                return v
  50.122              except RuntimeError, ex:
  50.123 -                pass
  50.124 +                if ex.args[0] == errno.ETIMEDOUT:
  50.125 +                    pass
  50.126 +                raise
  50.127  
  50.128 -    SafeWrite = classmethod(SafeWrite)
  50.129 +    List = classmethod(List)
    51.1 --- a/tools/python/xen/xm/create.py	Fri Sep 09 10:31:36 2005 -0600
    51.2 +++ b/tools/python/xen/xm/create.py	Tue Sep 13 10:14:16 2005 -0600
    51.3 @@ -772,30 +772,33 @@ def balloon_out(dom0_min_mem, opts):
    51.4      """Balloon out memory from dom0 if necessary"""
    51.5      SLACK = 4
    51.6      timeout = 20 # 2s
    51.7 -    ret = 0
    51.8 +    ret = 1
    51.9  
   51.10      xc = xen.lowlevel.xc.new()
   51.11 -    pinfo = xc.physinfo()
   51.12 -    free_mem = pinfo['free_pages'] / 256
   51.13 +    free_mem = xc.physinfo()['free_pages'] / 256
   51.14      domU_need_mem = opts.vals.memory + SLACK 
   51.15  
   51.16 +    # we already have enough free memory, return success
   51.17 +    if free_mem >= domU_need_mem:
   51.18 +        del xc
   51.19 +        return 0
   51.20 +
   51.21      dom0_cur_alloc = get_dom0_alloc()
   51.22      dom0_new_alloc = dom0_cur_alloc - (domU_need_mem - free_mem)
   51.23 -
   51.24 -    if free_mem < domU_need_mem and dom0_new_alloc < dom0_min_mem:
   51.25 -        ret = 1
   51.26 -    if free_mem < domU_need_mem and ret == 0:
   51.27 -
   51.28 -        server.xend_domain_mem_target_set(0, dom0_new_alloc)
   51.29 +    if dom0_new_alloc < dom0_min_mem:
   51.30 +        dom0_new_alloc = dom0_min_mem
   51.31  
   51.32 -        while dom0_cur_alloc > dom0_new_alloc and timeout > 0:
   51.33 -            time.sleep(0.1) # sleep 100ms
   51.34 -            dom0_cur_alloc = get_dom0_alloc()
   51.35 -            timeout -= 1
   51.36 -        
   51.37 -        if dom0_cur_alloc > dom0_new_alloc:
   51.38 -            ret = 1
   51.39 -    
   51.40 +    server.xend_domain_mem_target_set(0, dom0_new_alloc)
   51.41 +
   51.42 +    while timeout > 0:
   51.43 +        time.sleep(0.1) # sleep 100ms
   51.44 +
   51.45 +        free_mem = xc.physinfo()['free_pages'] / 256
   51.46 +        if free_mem >= domU_need_mem:
   51.47 +            ret = 0
   51.48 +            break
   51.49 +        timeout -= 1
   51.50 +
   51.51      del xc
   51.52      return ret
   51.53  
    52.1 --- a/tools/python/xen/xm/main.py	Fri Sep 09 10:31:36 2005 -0600
    52.2 +++ b/tools/python/xen/xm/main.py	Tue Sep 13 10:14:16 2005 -0600
    52.3 @@ -450,7 +450,10 @@ def xm_info(args):
    52.4      info = server.xend_node()
    52.5      
    52.6      for x in info[1:]:
    52.7 -        print "%-23s:" % x[0], x[1]
    52.8 +        if len(x) < 2: 
    52.9 +            print "%-23s: (none)" % x[0]
   52.10 +        else: 
   52.11 +            print "%-23s:" % x[0], x[1]
   52.12  
   52.13  # TODO: remove as soon as console server shows up
   52.14  def xm_console(args):
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/tools/vnet/Make.env	Tue Sep 13 10:14:16 2005 -0600
    53.3 @@ -0,0 +1,20 @@
    53.4 +# -*- mode: Makefile; -*-
    53.5 +
    53.6 +export XEN_ROOT        = $(shell cd $(VNET_ROOT)/../.. && pwd)
    53.7 +export LINUX_SERIES   ?= 2.6
    53.8 +
    53.9 +DISTDIR               ?= $(XEN_ROOT)/dist
   53.10 +export DESTDIR        ?= $(DISTDIR)/install
   53.11 +
   53.12 +export VNET_MODULE_DIR = $(VNET_ROOT)/vnet-module
   53.13 +export VNETD_DIR       = $(VNET_ROOT)/vnetd
   53.14 +export LIBXUTIL_DIR    = $(VNET_ROOT)/libxutil
   53.15 +
   53.16 +export GC_DIR          = $(VNET_ROOT)/build/gc
   53.17 +export GC_INCLUDE      = $(GC_DIR)/include
   53.18 +export GC_LIB_DIR      = $(GC_DIR)/lib
   53.19 +export GC_LIB_A        = $(GC_LIB_DIR)/libgc.a
   53.20 +export GC_LIB_SO       = $(GC_LIB_DIR)/libgc.so
   53.21 +
   53.22 +#$(warning XEN_ROOT  = $(XEN_ROOT))
   53.23 +#$(warning DESTDIR   = $(DESTDIR))
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/tools/vnet/examples/vnet-insert	Tue Sep 13 10:14:16 2005 -0600
    54.3 @@ -0,0 +1,28 @@
    54.4 +#!/bin/bash
    54.5 +
    54.6 +# Insert the vnet module if it can be found and
    54.7 +# it's not already there.
    54.8 +vnet_insert () {
    54.9 +    local module="vnet_module"
   54.10 +    local mod_dir=/lib/modules/$(uname -r)
   54.11 +    local mod_obj=""
   54.12 +
   54.13 +    if lsmod | grep -q ${module} ; then
   54.14 +        echo "VNET: ${module} loaded"
   54.15 +        return
   54.16 +    fi
   54.17 +    local mods=$(find ${mod_dir} -name "${module}.*o")
   54.18 +    if [[ ${mods} ]] ; then
   54.19 +        for mod_obj in ${mods} ; do
   54.20 +            break
   54.21 +        done
   54.22 +    fi
   54.23 +    if [ -z "${mod_obj}" ] ; then
   54.24 +        echo "VNET: ${module} not found"
   54.25 +        exit 1
   54.26 +    fi
   54.27 +    echo "VNET: Loading ${module} from ${mod_obj}"
   54.28 +    insmod ${mod_obj} "$@"
   54.29 +}
   54.30 +
   54.31 +vnet_insert "$@"
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/tools/vnet/libxutil/mem_stream.c	Tue Sep 13 10:14:16 2005 -0600
    55.3 @@ -0,0 +1,319 @@
    55.4 +/*
    55.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
    55.6 + *
    55.7 + * This library is free software; you can redistribute it and/or modify
    55.8 + * it under the terms of the GNU Lesser General Public License as published by
    55.9 + * the Free Software Foundation; either version 2.1 of the License, or
   55.10 + * (at your option) any later version.
   55.11 + *
   55.12 + * This library is distributed in the hope that it will be useful,
   55.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   55.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   55.15 + * GNU Lesser General Public License for more details.
   55.16 + *
   55.17 + * You should have received a copy of the GNU Lesser General Public License
   55.18 + * along with this library; if not, write to the Free Software
   55.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   55.20 + */
   55.21 +
   55.22 +/** @file
   55.23 + * IOStream subtype for input and output to memory.
   55.24 + * Usable from user or kernel code (with __KERNEL__ defined).
   55.25 + */
   55.26 +
   55.27 +#include "sys_string.h"
   55.28 +#include "mem_stream.h"
   55.29 +#include "allocate.h"
   55.30 +
   55.31 +/** Internal state for a memory stream.
   55.32 + *
   55.33 + * The memory stream buffer is treated as a circular buffer.
   55.34 + * The lo and hi markers indicate positions in the buffer, but
   55.35 + * are not reduced modulo the buffer size. This avoids the ambiguity
   55.36 + * between a full and empty buffer when using reduced values.
   55.37 + *
   55.38 + * If x is a marker, then buf + (x % buf_n) is the corresponding
   55.39 + * pointer into the buffer. When the buffer is empty, lo == hi,
   55.40 + * and the corresponding pointers are equal. When the buffer is
   55.41 + * full, hi == lo + buf_n, and the corresponding pointers
   55.42 + * are also equal.
   55.43 + *
   55.44 + * Data is written after the high pointer and read from the lo pointer.
   55.45 + * The value hi - lo is the number of bytes in the buffer.
   55.46 + */
   55.47 +typedef struct MemData {
   55.48 +    /** Data buffer. */
   55.49 +    char *buf;
   55.50 +    /** Low marker - start of readable area. */
   55.51 +    unsigned long lo;
   55.52 +    /** High marker - end of readable area, start of writeable area. */
   55.53 +    unsigned long hi;
   55.54 +    /** Size of the buffer. */
   55.55 +    unsigned int buf_n;
   55.56 +    /** Maximum size the buffer can grow to. */
   55.57 +    unsigned int buf_max;
   55.58 +    /** Error code. */
   55.59 +    int err;
   55.60 +} MemData;
   55.61 +
   55.62 +/** Get number of bytes available to read.
   55.63 + *
   55.64 + * @param data mem stream
   55.65 + * @return bytes
   55.66 + */
   55.67 +static inline int mem_len(struct MemData *data){
   55.68 +    return data->hi - data->lo;
   55.69 +}
   55.70 +
   55.71 +/** Get available space left in the buffer.
   55.72 + *
   55.73 + * @param data mem stream
   55.74 + * @return bytes
   55.75 + */
   55.76 +static inline int mem_room(struct MemData *data){
   55.77 +    return data->buf_n - mem_len(data);
   55.78 +}
   55.79 +
   55.80 +/** Get a pointer to the start of the data in the buffer.
   55.81 + *
   55.82 + * @param data mem stream
   55.83 + * @return lo pointer
   55.84 + */
   55.85 +static inline char * mem_lo(struct MemData *data){
   55.86 +    return data->buf + (data->lo % data->buf_n);
   55.87 +}
   55.88 +
   55.89 +/** Get a pointer to the end of the data in the buffer.
   55.90 + *
   55.91 + * @param data mem stream
   55.92 + * @return hi pointer
   55.93 + */
   55.94 +static inline char * mem_hi(struct MemData *data){
   55.95 +    return data->buf + (data->hi % data->buf_n);
   55.96 +}
   55.97 +
   55.98 +/** Get a pointer to the end of the buffer.
   55.99 + *
  55.100 + * @param data mem stream
  55.101 + * @return end pointer
  55.102 + */
  55.103 +static inline char * mem_end(struct MemData *data){
  55.104 +    return data->buf + data->buf_n;
  55.105 +}
  55.106 +
  55.107 +static int mem_error(IOStream *io);
  55.108 +static int mem_close(IOStream *io);
  55.109 +static void mem_free(IOStream *io);
  55.110 +static int mem_write(IOStream *io, const void *msg, size_t n);
  55.111 +static int mem_read(IOStream *io, void *buf, size_t n);
  55.112 +
  55.113 +/** Minimum delta used to increment the buffer. */
  55.114 +static int delta_min = 256;
  55.115 +
  55.116 +/** Methods for a memory stream. */
  55.117 +static IOMethods mem_methods = {
  55.118 +    read:  mem_read,
  55.119 +    write: mem_write,
  55.120 +    error: mem_error,
  55.121 +    close: mem_close,
  55.122 +    free:  mem_free,
  55.123 +};
  55.124 +
  55.125 +/** Get the memory stream state.
  55.126 + *
  55.127 + * @param io memory stream
  55.128 + * @return state
  55.129 + */
  55.130 +static inline MemData *get_mem_data(IOStream *io){
  55.131 +    return (MemData*)io->data;
  55.132 +}
  55.133 +
  55.134 +/** Get the number of bytes available to read.
  55.135 + *
  55.136 + * @param io memory stream
  55.137 + * @return number of bytes
  55.138 + */
  55.139 +int mem_stream_avail(IOStream *io){
  55.140 +    MemData *data = get_mem_data(io);
  55.141 +    return (data->err ? -data->err : mem_len(data));
  55.142 +}
  55.143 +
  55.144 +/** Copy bytes from a memory stream into a buffer.
  55.145 + *
  55.146 + * @param data mem stream
  55.147 + * @param buf buffer
  55.148 + * @param n number of bytes to copy
  55.149 + */
  55.150 +static void mem_get(MemData *data, char *buf, size_t n){
  55.151 +    char *start = mem_lo(data);
  55.152 +    char *end = mem_end(data);
  55.153 +    if (start + n < end) {
  55.154 +        memcpy(buf, start, n);
  55.155 +    } else {
  55.156 +        int k = end - start;
  55.157 +        memcpy(buf, start, k);
  55.158 +        memcpy(buf + k, data->buf, n - k);
  55.159 +    }
  55.160 +}
  55.161 +
  55.162 +/** Copy bytes from a buffer into a memory stream.
  55.163 + *
  55.164 + * @param data mem stream
  55.165 + * @param buf buffer
  55.166 + * @param n number of bytes to copy
  55.167 + */
  55.168 +static void mem_put(MemData *data, const char *buf, size_t n){
  55.169 +    char *start = mem_hi(data);
  55.170 +    char *end = mem_end(data);
  55.171 +    if(start + n < end){
  55.172 +        memcpy(start, buf, n);
  55.173 +    } else {
  55.174 +        int k = end - start;
  55.175 +        memcpy(start, buf, k);
  55.176 +        memcpy(data->buf, buf + k, n - k);
  55.177 +    }
  55.178 +}
  55.179 +
  55.180 +/** Expand the buffer used by a memory stream.
  55.181 + *
  55.182 + * @param data mem stream
  55.183 + * @param extra number of bytes to expand by
  55.184 + * @return 0 on success, negative error otherwise
  55.185 + */
  55.186 +static int mem_expand(MemData *data, size_t extra){
  55.187 +    int err = -ENOMEM;
  55.188 +    int delta = (extra < delta_min ? delta_min : extra);
  55.189 +    if(data->buf_max > 0){
  55.190 +        int delta_max = data->buf_max - data->buf_n;
  55.191 +        if(delta > delta_max){
  55.192 +            delta = extra;
  55.193 +            if(delta > delta_max) goto exit;
  55.194 +        }
  55.195 +    }
  55.196 +    int buf_n = data->buf_n + delta;
  55.197 +    char *buf = allocate(buf_n);
  55.198 +    if(!buf) goto exit;
  55.199 +    mem_get(data, buf, mem_len(data));
  55.200 +    data->hi = mem_len(data);
  55.201 +    data->lo = 0;
  55.202 +    deallocate(data->buf);
  55.203 +    data->buf = buf;
  55.204 +    data->buf_n = buf_n;
  55.205 +    err = 0;
  55.206 +  exit:
  55.207 +    if(err){
  55.208 +        data->err = -err;
  55.209 +    }
  55.210 +    return err;
  55.211 +}
  55.212 +
  55.213 +/** Write bytes from a buffer into a memory stream.
  55.214 + * The internal buffer is expanded as needed to hold the data,
  55.215 + * up to the stream maximum (if specified). If the buffer cannot
  55.216 + * be expanded -ENOMEM is returned.
  55.217 + *
  55.218 + * @param io mem stream
  55.219 + * @param buf buffer
  55.220 + * @param n number of bytes to write
  55.221 + * @return number of bytes written on success, negative error code otherwise
  55.222 + */
  55.223 +static int mem_write(IOStream *io, const void *msg, size_t n){
  55.224 +    MemData *data = get_mem_data(io);
  55.225 +    if(data->err) return -data->err;
  55.226 +    int room = mem_room(data);
  55.227 +    if(n > room){
  55.228 +        int err = mem_expand(data, n - room);
  55.229 +        if(err) return err;
  55.230 +    }
  55.231 +    mem_put(data, msg, n);
  55.232 +    data->hi += n;
  55.233 +    return n;
  55.234 +}
  55.235 +
  55.236 +/** Read bytes from a memory stream into a buffer.
  55.237 + *
  55.238 + * @param io mem stream
  55.239 + * @param buf buffer
  55.240 + * @param n maximum number of bytes to read
  55.241 + * @return number of bytes read on success, negative error code otherwise
  55.242 + */
  55.243 +static int mem_read(IOStream *io, void *buf, size_t n){
  55.244 +    MemData *data = get_mem_data(io);
  55.245 +    if(data->err) return -data->err;
  55.246 +    int k = mem_len(data);
  55.247 +    if(n > k){
  55.248 +        n = k;
  55.249 +    }
  55.250 +    mem_get(data, buf, n);
  55.251 +    data->lo += n;
  55.252 +    return n;
  55.253 +}
  55.254 +
  55.255 +/** Test if a memory stream has an error.
  55.256 + *
  55.257 + * @param io mem stream
  55.258 + * @return 0 if ok, error code otherwise
  55.259 + */
  55.260 +static int mem_error(IOStream *io){
  55.261 +    MemData *data = get_mem_data(io);
  55.262 +    return data->err;
  55.263 +}
  55.264 +
  55.265 +/** Close a memory stream.
  55.266 + *
  55.267 + * @param io mem stream
  55.268 + * @return 0
  55.269 + */
  55.270 +static int mem_close(IOStream *io){
  55.271 +    MemData *data = get_mem_data(io);
  55.272 +    if(!data->err){
  55.273 +        data->err = ENOTCONN;
  55.274 +    }
  55.275 +    return 0;
  55.276 +}
  55.277 +
  55.278 +/** Free a memory stream.
  55.279 + *
  55.280 + * @param io mem stream
  55.281 + */
  55.282 +static void mem_free(IOStream *io){
  55.283 +    MemData *data = get_mem_data(io);
  55.284 +    deallocate(data->buf);
  55.285 +    memzero(data, sizeof(*data));
  55.286 +    deallocate(data);
  55.287 +}
  55.288 +
  55.289 +/** Allocate and initialise a memory stream.
  55.290 + *
  55.291 + * @param buf_n initial buffer size (0 means default)
  55.292 + * @param buf_max maximum buffer size (0 means no max)
  55.293 + * @return new stream (free using IOStream_close)
  55.294 + */
  55.295 +IOStream *mem_stream_new_size(size_t buf_n, size_t buf_max){
  55.296 +    int err = -ENOMEM;
  55.297 +    MemData *data = ALLOCATE(MemData);
  55.298 +    if(!data) goto exit;
  55.299 +    IOStream *io = ALLOCATE(IOStream);
  55.300 +    if(!io) goto exit;
  55.301 +    if(buf_n <= delta_min){
  55.302 +        buf_n = delta_min;
  55.303 +    }
  55.304 +    if(buf_max > 0 && buf_max < buf_n){
  55.305 +        buf_max = buf_n;
  55.306 +    }
  55.307 +    data->buf = allocate(buf_n);
  55.308 +    if(!data->buf) goto exit;
  55.309 +    data->buf_n = buf_n;
  55.310 +    data->buf_max = buf_max;
  55.311 +    io->methods = &mem_methods;
  55.312 +    io->data = data;
  55.313 +    io->nofree = 0;
  55.314 +    err = 0;
  55.315 +  exit:
  55.316 +    if(err){
  55.317 +        deallocate(data);
  55.318 +        deallocate(io);
  55.319 +        io = NULL;
  55.320 +    }
  55.321 +    return io;
  55.322 +}
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/tools/vnet/libxutil/mem_stream.h	Tue Sep 13 10:14:16 2005 -0600
    56.3 @@ -0,0 +1,32 @@
    56.4 +/*
    56.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
    56.6 + *
    56.7 + * This library is free software; you can redistribute it and/or modify
    56.8 + * it under the terms of the GNU Lesser General Public License as published by
    56.9 + * the Free Software Foundation; either version 2.1 of the License, or
   56.10 + * (at your option) any later version.
   56.11 + *
   56.12 + * This library is distributed in the hope that it will be useful,
   56.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   56.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   56.15 + * GNU Lesser General Public License for more details.
   56.16 + *
   56.17 + * You should have received a copy of the GNU Lesser General Public License
   56.18 + * along with this library; if not, write to the Free Software
   56.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   56.20 + */
   56.21 +
   56.22 +#ifndef _XUTIL_MEM_STREAM_H_
   56.23 +#define _XUTIL_MEM_STREAM_H_
   56.24 +
   56.25 +#include "iostream.h"
   56.26 +
   56.27 +extern IOStream *mem_stream_new_size(size_t buf_n, size_t buf_max);
   56.28 +
   56.29 +extern int mem_stream_avail(IOStream *io);
   56.30 +
   56.31 +static inline IOStream *mem_stream_new(void){
   56.32 +    return mem_stream_new_size(0, 0);
   56.33 +}
   56.34 +
   56.35 +#endif /* !_XUTIL_MEM_STREAM_H_ */
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/tools/vnet/vnet-module/varp_util.c	Tue Sep 13 10:14:16 2005 -0600
    57.3 @@ -0,0 +1,77 @@
    57.4 +/*
    57.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
    57.6 + *
    57.7 + * This program is free software; you can redistribute it and/or modify
    57.8 + * it under the terms of the GNU General Public License as published by the 
    57.9 + * Free Software Foundation; either version 2 of the License, or (at your
   57.10 + * option) any later version.
   57.11 + * 
   57.12 + * This program is distributed in the hope that it will be useful, but
   57.13 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   57.14 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
   57.15 + * for more details.
   57.16 + *
   57.17 + * You should have received a copy of the GNU General Public License along
   57.18 + * with this program; if not, write to the Free software Foundation, Inc.,
   57.19 + * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
   57.20 + *
   57.21 + */
   57.22 +
   57.23 +static int hex16(char *s, uint16_t *val)
   57.24 +{
   57.25 +    int err = -EINVAL;
   57.26 +    uint16_t v = 0;
   57.27 +    
   57.28 +    for( ; *s; s++){
   57.29 +        v <<= 4;
   57.30 +        if('0' <= *s && *s <= '9'){
   57.31 +            v |= *s - '0';
   57.32 +        } else if('A' <= *s && *s <= 'F'){
   57.33 +            v |= *s - 'A' + 10;
   57.34 +        } else if('a' <= *s && *s <= 'f'){
   57.35 +            v |= *s - 'a' + 10;
   57.36 +        } else {
   57.37 +            goto exit;
   57.38 +        }
   57.39 +    }
   57.40 +    err = 0;
   57.41 +  exit:
   57.42 +    *val = (err ? 0 : v);
   57.43 +    return err;
   57.44 +}
   57.45 +
   57.46 +int VnetId_aton(const char *s, VnetId *vnet){
   57.47 +    int err = -EINVAL;
   57.48 +    const char *p, *q;
   57.49 +    uint16_t v;
   57.50 +    char buf[5];
   57.51 +    int buf_n = sizeof(buf) - 1;
   57.52 +    int i, n;
   57.53 +    const int elts_n = 8;
   57.54 +
   57.55 +    q = s;
   57.56 +    p = strchr(q, ':');
   57.57 +    i = (p ? 0 : elts_n - 1);
   57.58 +    do {
   57.59 +        if(!p){
   57.60 +            if(i < elts_n - 1) goto exit;
   57.61 +            p = s + strlen(s);
   57.62 +        }
   57.63 +        n = p - q;
   57.64 +        if(n > buf_n) goto exit;
   57.65 +        memcpy(buf, q, n);
   57.66 +        buf[n] = '\0';
   57.67 +        err = hex16(buf, &v);
   57.68 +        if(err) goto exit;
   57.69 +        vnet->u.vnet16[i] = htons(v);
   57.70 +        q = p+1;
   57.71 +        p = strchr(q, ':');
   57.72 +        i++;
   57.73 +    } while(i < elts_n);
   57.74 +    err = 0;
   57.75 +  exit:
   57.76 +    if(err){
   57.77 +        *vnet = (VnetId){};
   57.78 +    }
   57.79 +    return err;
   57.80 +}
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/tools/vnet/vnet-module/varp_util.h	Tue Sep 13 10:14:16 2005 -0600
    58.3 @@ -0,0 +1,142 @@
    58.4 +/*
    58.5 + * Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
    58.6 + *
    58.7 + * This program is free software; you can redistribute it and/or modify
    58.8 + * it under the terms of the GNU General Public License as published by the 
    58.9 + * Free Software Foundation; either version 2 of the License, or (at your
   58.10 + * option) any later version.
   58.11 + * 
   58.12 + * This program is distributed in the hope that it will be useful, but
   58.13 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   58.14 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
   58.15 + * for more details.
   58.16 + *
   58.17 + * You should have received a copy of the GNU General Public License along
   58.18 + * with this program; if not, write to the Free software Foundation, Inc.,
   58.19 + * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
   58.20 + *
   58.21 + */
   58.22 +#ifndef _VNET_VARP_UTIL_H
   58.23 +#define _VNET_VARP_UTIL_H
   58.24 +
   58.25 +#include "hash_table.h"
   58.26 +
   58.27 +/** Size of a string buffer to store a varp address. */
   58.28 +#define VARP_ADDR_BUF 56
   58.29 +
   58.30 +/** Size of a string buffer to store a vnet id. */
   58.31 +#define VNET_ID_BUF 56
   58.32 +
   58.33 +#ifndef NIPQUAD
   58.34 +#define NIPQUAD(addr) \
   58.35 +	((unsigned char *)&addr)[0], \
   58.36 +	((unsigned char *)&addr)[1], \
   58.37 +	((unsigned char *)&addr)[2], \
   58.38 +	((unsigned char *)&addr)[3]
   58.39 +#endif
   58.40 +
   58.41 +#ifndef NIP6
   58.42 +#define NIP6(addr) \
   58.43 +	ntohs((addr).s6_addr16[0]), \
   58.44 +	ntohs((addr).s6_addr16[1]), \
   58.45 +	ntohs((addr).s6_addr16[2]), \
   58.46 +	ntohs((addr).s6_addr16[3]), \
   58.47 +	ntohs((addr).s6_addr16[4]), \
   58.48 +	ntohs((addr).s6_addr16[5]), \
   58.49 +	ntohs((addr).s6_addr16[6]), \
   58.50 +	ntohs((addr).s6_addr16[7])
   58.51 +#endif
   58.52 +
   58.53 +
   58.54 +static inline const char *VarpAddr_ntoa(VarpAddr *addr, char buf[VARP_ADDR_BUF])
   58.55 +{
   58.56 +    switch(addr->family){
   58.57 +    default:
   58.58 +    case AF_INET:
   58.59 +        sprintf(buf, "%u.%u.%u.%u",
   58.60 +                NIPQUAD(addr->u.ip4));
   58.61 +        break;
   58.62 +    case AF_INET6:
   58.63 +        sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
   58.64 +                NIP6(addr->u.ip6));
   58.65 +        break;
   58.66 +    }
   58.67 +    return buf;
   58.68 +}
   58.69 +
   58.70 +static inline const char *VnetId_ntoa(VnetId *vnet, char buf[VNET_ID_BUF])
   58.71 +{
   58.72 +    sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
   58.73 +            ntohs(vnet->u.vnet16[0]), \
   58.74 +            ntohs(vnet->u.vnet16[1]), \
   58.75 +            ntohs(vnet->u.vnet16[2]), \
   58.76 +            ntohs(vnet->u.vnet16[3]), \
   58.77 +            ntohs(vnet->u.vnet16[4]), \
   58.78 +            ntohs(vnet->u.vnet16[5]), \
   58.79 +            ntohs(vnet->u.vnet16[6]), \
   58.80 +            ntohs(vnet->u.vnet16[7]));
   58.81 +    return buf;
   58.82 +}
   58.83 +
   58.84 +extern int VnetId_aton(const char *s, VnetId *vnet);
   58.85 +
   58.86 +/** Convert an unsigned in host order to a vnet id.
   58.87 + */
   58.88 +static inline struct VnetId toVnetId(uint32_t vnetid){
   58.89 +    struct VnetId vnet = {};
   58.90 +    vnet.u.vnet32[3] = htonl(vnetid);
   58.91 +    return vnet;
   58.92 +}
   58.93 +
   58.94 +static inline uint32_t VnetId_hash(uint32_t h, VnetId *vnet)
   58.95 +{
   58.96 +    h = hash_hul(h, vnet->u.vnet32[0]);
   58.97 +    h = hash_hul(h, vnet->u.vnet32[1]);
   58.98 +    h = hash_hul(h, vnet->u.vnet32[2]);
   58.99 +    h = hash_hul(h, vnet->u.vnet32[3]);
  58.100 +    return h;
  58.101 +}
  58.102 +
  58.103 +static inline int VnetId_eq(VnetId *vnet1, VnetId *vnet2)
  58.104 +{
  58.105 +    return memcmp(vnet1, vnet2, sizeof(VnetId)) == 0;
  58.106 +}
  58.107 +
  58.108 +static inline uint32_t VarpAddr_hash(uint32_t h, VarpAddr *addr)
  58.109 +{
  58.110 +    h = hash_hul(h, addr->family);
  58.111 +    if(addr->family == AF_INET6){
  58.112 +        h = hash_hul(h, addr->u.ip6.s6_addr32[0]);
  58.113 +        h = hash_hul(h, addr->u.ip6.s6_addr32[1]);
  58.114 +        h = hash_hul(h, addr->u.ip6.s6_addr32[2]);
  58.115 +        h = hash_hul(h, addr->u.ip6.s6_addr32[3]);
  58.116 +    } else {
  58.117 +        h = hash_hul(h, addr->u.ip4.s_addr);
  58.118 +    }
  58.119 +    return h;
  58.120 +}
  58.121 +
  58.122 +static inline int VarpAddr_eq(VarpAddr *addr1, VarpAddr*addr2)
  58.123 +{
  58.124 +    return memcmp(addr1, addr2, sizeof(VarpAddr)) == 0;
  58.125 +}
  58.126 +
  58.127 +static inline uint32_t Vmac_hash(uint32_t h, Vmac *vmac)
  58.128 +{
  58.129 +    h = hash_hul(h,
  58.130 +                 (vmac->mac[0] << 24) |
  58.131 +                 (vmac->mac[1] << 16) |
  58.132 +                 (vmac->mac[2] <<  8) |
  58.133 +                 (vmac->mac[3]      ));
  58.134 +    h = hash_hul(h, 
  58.135 +                 (vmac->mac[4] <<   8) |
  58.136 +                 (vmac->mac[5]       ));
  58.137 +    return h;
  58.138 +}
  58.139 +
  58.140 +static inline int Vmac_eq(Vmac *vmac1, Vmac *vmac2)
  58.141 +{
  58.142 +    return memcmp(vmac1, vmac2, sizeof(Vmac)) == 0;
  58.143 +}
  58.144 +
  58.145 +#endif /* _VNET_VARP_UTIL_H */
    59.1 --- a/tools/xenstore/Makefile	Fri Sep 09 10:31:36 2005 -0600
    59.2 +++ b/tools/xenstore/Makefile	Tue Sep 13 10:14:16 2005 -0600
    59.3 @@ -17,15 +17,15 @@ BASECFLAGS+= -O3 $(PROFILE)
    59.4  BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
    59.5  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
    59.6  BASECFLAGS+= -I.
    59.7 -BASECFLAGS+= -I$(XEN_ROOT)/linux-2.6-xen-sparse/include/asm-xen/linux-public
    59.8  
    59.9  CFLAGS  += $(BASECFLAGS)
   59.10  LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
   59.11 -TESTDIR  = `pwd`/testsuite/tmp
   59.12 +TESTDIR  = testsuite/tmp
   59.13  TESTFLAGS= -DTESTING
   59.14  TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
   59.15  
   59.16 -CLIENTS := xenstore-read xenstore-rm xenstore-write
   59.17 +CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
   59.18 +CLIENTS += xenstore-write
   59.19  CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
   59.20  
   59.21  all: libxenstore.so xenstored $(CLIENTS)
   59.22 @@ -80,10 +80,13 @@ check: print-dir testsuite-fast randomch
   59.23  
   59.24  fullcheck: testsuite-run randomcheck stresstest
   59.25  
   59.26 -testsuite-run: xenstored_test xs_test
   59.27 +$(TESTDIR):
   59.28 +	mkdir $@
   59.29 +
   59.30 +testsuite-run: xenstored_test xs_test $(TESTDIR)
   59.31  	$(TESTENV) testsuite/test.sh && echo
   59.32  
   59.33 -testsuite-fast: xenstored_test xs_test
   59.34 +testsuite-fast: xenstored_test xs_test $(TESTDIR)
   59.35  	@$(TESTENV) testsuite/test.sh --fast
   59.36  
   59.37  testsuite-clean:
   59.38 @@ -92,21 +95,21 @@ testsuite-clean:
   59.39  # Make this visible so they can see repeat tests without --fast if they
   59.40  # fail.
   59.41  RANDSEED=$(shell date +%s)
   59.42 -randomcheck: xs_random xenstored_test
   59.43 +randomcheck: xs_random xenstored_test $(TESTDIR)
   59.44  	$(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
   59.45  	$(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
   59.46  	$(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
   59.47  
   59.48 -crashme:  xs_crashme xenstored_test
   59.49 +crashme:  xs_crashme xenstored_test $(TESTDIR)
   59.50  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
   59.51  	export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
   59.52  	if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
   59.53  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
   59.54  
   59.55 -randomcheck-fast: xs_random xenstored_test
   59.56 +randomcheck-fast: xs_random xenstored_test $(TESTDIR)
   59.57  	@$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
   59.58  
   59.59 -stresstest: xs_stress xenstored_test
   59.60 +stresstest: xs_stress xenstored_test $(TESTDIR)
   59.61  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
   59.62  	export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
   59.63  
    60.1 --- a/tools/xenstore/fake_libxc.c	Fri Sep 09 10:31:36 2005 -0600
    60.2 +++ b/tools/xenstore/fake_libxc.c	Tue Sep 13 10:14:16 2005 -0600
    60.3 @@ -83,6 +83,39 @@ int xc_interface_close(int xc_handle)
    60.4  	return 0;
    60.5  }
    60.6  
    60.7 +int xc_domain_getinfo(int xc_handle __attribute__((unused)),
    60.8 +		      u32 first_domid, unsigned int max_doms,
    60.9 +                      xc_dominfo_t *info)
   60.10 +{
   60.11 +	assert(max_doms == 1);
   60.12 +        info->domid = first_domid;
   60.13 +
   60.14 +        info->dying    = 0;
   60.15 +        info->shutdown = 0;
   60.16 +        info->paused   = 0;
   60.17 +        info->blocked  = 0;
   60.18 +        info->running  = 1;
   60.19 +
   60.20 +        info->shutdown_reason = 0;
   60.21 +
   60.22 +        if ( info->shutdown && (info->shutdown_reason == SHUTDOWN_crash) )
   60.23 +        {
   60.24 +            info->shutdown = 0;
   60.25 +            info->crashed  = 1;
   60.26 +        }
   60.27 +
   60.28 +	return 1;
   60.29 +}
   60.30 +
   60.31 +int xc_evtchn_bind_virq(int xc_handle __attribute__((unused)),
   60.32 +			int virq __attribute__((unused)),
   60.33 +			int *port)
   60.34 +{
   60.35 +	if (port)
   60.36 +		*port = 0;
   60.37 +	return 0;
   60.38 +}
   60.39 +
   60.40  static void send_to_fd(int signo __attribute__((unused)))
   60.41  {
   60.42  	int saved_errno = errno;
    61.1 --- a/tools/xenstore/testsuite/07watch.test	Fri Sep 09 10:31:36 2005 -0600
    61.2 +++ b/tools/xenstore/testsuite/07watch.test	Tue Sep 13 10:14:16 2005 -0600
    61.3 @@ -34,12 +34,13 @@ 1 ackwatch token
    61.4  1 close
    61.5  2 close
    61.6  
    61.7 -# We don't get a watch from our own commands.
    61.8 -watch /dir token
    61.9 -mkdir /dir/newdir
   61.10 -expect waitwatch failed: Connection timed out
   61.11 -waitwatch
   61.12 -close
   61.13 +# Changed in b594bb976a743d509f1ffabb5bc698874ab90d8f
   61.14 +## We don't get a watch from our own commands.
   61.15 +#watch /dir token
   61.16 +#mkdir /dir/newdir
   61.17 +#expect waitwatch failed: Connection timed out
   61.18 +#waitwatch
   61.19 +#close
   61.20  
   61.21  # ignore watches while doing commands, should work.
   61.22  watch /dir token
    62.1 --- a/tools/xenstore/testsuite/14complexperms.test	Fri Sep 09 10:31:36 2005 -0600
    62.2 +++ b/tools/xenstore/testsuite/14complexperms.test	Tue Sep 13 10:14:16 2005 -0600
    62.3 @@ -30,10 +30,8 @@ getperm /dir/file
    62.4  expect *Permission denied
    62.5  setperm /dir/file 0 NONE 
    62.6  watch /dir/file token 
    62.7 -setid 0
    62.8 -write /dir/file create contents
    62.9 -rm /dir/file
   62.10 -setid 1
   62.11 +1 write /dir/file create contents
   62.12 +1 rm /dir/file
   62.13  expect waitwatch failed: Connection timed out
   62.14  waitwatch
   62.15  unwatch /dir/file token 
   62.16 @@ -78,10 +76,8 @@ getperm /dir/file
   62.17  expect *Permission denied
   62.18  setperm /dir/file 0 NONE 
   62.19  watch /dir/file token 
   62.20 -setid 0
   62.21 -write /dir/file create contents
   62.22 -rm /dir/file
   62.23 -setid 1
   62.24 +1 write /dir/file create contents
   62.25 +1 rm /dir/file
   62.26  expect waitwatch failed: Connection timed out
   62.27  waitwatch
   62.28  unwatch /dir/file token 
    63.1 --- a/tools/xenstore/xenstore_client.c	Fri Sep 09 10:31:36 2005 -0600
    63.2 +++ b/tools/xenstore/xenstore_client.c	Tue Sep 13 10:14:16 2005 -0600
    63.3 @@ -22,7 +22,7 @@ usage(const char *progname)
    63.4      errx(1, "Usage: %s [-h] [-p] key [...]", progname);
    63.5  #elif defined(CLIENT_write)
    63.6      errx(1, "Usage: %s [-h] key value [...]", progname);
    63.7 -#elif defined(CLIENT_rm)
    63.8 +#elif defined(CLIENT_rm) || defined(CLIENT_exists) || defined(CLIENT_list)
    63.9      errx(1, "Usage: %s [-h] key [...]", progname);
   63.10  #endif
   63.11  }
   63.12 @@ -33,8 +33,7 @@ main(int argc, char **argv)
   63.13      struct xs_handle *xsh;
   63.14      bool success;
   63.15      int ret = 0;
   63.16 -#if defined(CLIENT_read)
   63.17 -    char *val;
   63.18 +#if defined(CLIENT_read) || defined(CLIENT_list)
   63.19      int prefix = 0;
   63.20  #endif
   63.21  
   63.22 @@ -46,14 +45,14 @@ main(int argc, char **argv)
   63.23  	int c, index = 0;
   63.24  	static struct option long_options[] = {
   63.25  	    {"help", 0, 0, 'h'},
   63.26 -#if defined(CLIENT_read)
   63.27 +#if defined(CLIENT_read) || defined(CLIENT_list)
   63.28  	    {"prefix", 0, 0, 'p'},
   63.29  #endif
   63.30  	    {0, 0, 0, 0}
   63.31  	};
   63.32  
   63.33  	c = getopt_long(argc, argv, "h"
   63.34 -#if defined(CLIENT_read)
   63.35 +#if defined(CLIENT_read) || defined(CLIENT_list)
   63.36  			"p"
   63.37  #endif
   63.38  			, long_options, &index);
   63.39 @@ -64,7 +63,7 @@ main(int argc, char **argv)
   63.40  	case 'h':
   63.41  	    usage(argv[0]);
   63.42  	    /* NOTREACHED */
   63.43 -#if defined(CLIENT_read)
   63.44 +#if defined(CLIENT_read) || defined(CLIENT_list)
   63.45  	case 'p':
   63.46  	    prefix = 1;
   63.47  	    break;
   63.48 @@ -77,7 +76,7 @@ main(int argc, char **argv)
   63.49  	/* NOTREACHED */
   63.50      }
   63.51  #if defined(CLIENT_write)
   63.52 -    if ((argc - optind) % 1) {
   63.53 +    if ((argc - optind) % 2 == 1) {
   63.54  	usage(argv[0]);
   63.55  	/* NOTREACHED */
   63.56      }
   63.57 @@ -90,7 +89,7 @@ main(int argc, char **argv)
   63.58  
   63.59      while (optind < argc) {
   63.60  #if defined(CLIENT_read)
   63.61 -	val = xs_read(xsh, argv[optind], NULL);
   63.62 +	char *val = xs_read(xsh, argv[optind], NULL);
   63.63  	if (val == NULL) {
   63.64  	    warnx("couldn't read path %s", argv[optind]);
   63.65  	    ret = 1;
   63.66 @@ -118,6 +117,29 @@ main(int argc, char **argv)
   63.67  	    goto out;
   63.68  	}
   63.69  	optind++;
   63.70 +#elif defined(CLIENT_exists)
   63.71 +	char *val = xs_read(xsh, argv[optind], NULL);
   63.72 +	if (val == NULL) {
   63.73 +	    ret = 1;
   63.74 +	    goto out;
   63.75 +	}
   63.76 +	free(val);
   63.77 +	optind++;
   63.78 +#elif defined(CLIENT_list)
   63.79 +	unsigned int i, num;
   63.80 +	char **list = xs_directory(xsh, argv[optind], &num);
   63.81 +	if (list == NULL) {
   63.82 +	    warnx("could not list path %s", argv[optind]);
   63.83 +	    ret = 1;
   63.84 +	    goto out;
   63.85 +	}
   63.86 +	for (i = 0; i < num; i++) {
   63.87 +	    if (prefix)
   63.88 +		printf("%s/", argv[optind]);
   63.89 +	    printf("%s\n", list[i]);
   63.90 +	}
   63.91 +	free(list);
   63.92 +	optind++;
   63.93  #endif
   63.94      }
   63.95  
    64.1 --- a/tools/xenstore/xenstored_core.c	Fri Sep 09 10:31:36 2005 -0600
    64.2 +++ b/tools/xenstore/xenstored_core.c	Tue Sep 13 10:14:16 2005 -0600
    64.3 @@ -1640,8 +1640,10 @@ static void daemonize(void)
    64.4  
    64.5  	/* Session leader so ^C doesn't whack us. */
    64.6  	setsid();
    64.7 +#ifndef TESTING	/* Relative paths for socket names */
    64.8  	/* Move off any mount points we might be in. */
    64.9  	chdir("/");
   64.10 +#endif
   64.11  	/* Discard our parent's old-fashioned umask prejudices. */
   64.12  	umask(0);
   64.13  }
    65.1 --- a/tools/xenstore/xenstored_domain.c	Fri Sep 09 10:31:36 2005 -0600
    65.2 +++ b/tools/xenstore/xenstored_domain.c	Tue Sep 13 10:14:16 2005 -0600
    65.3 @@ -218,6 +218,26 @@ static int destroy_domain(void *_domain)
    65.4  	return 0;
    65.5  }
    65.6  
    65.7 +static void domain_cleanup(void)
    65.8 +{
    65.9 +	xc_dominfo_t dominfo;
   65.10 +	struct domain *domain, *tmp;
   65.11 +	int released = 0;
   65.12 +
   65.13 +	list_for_each_entry_safe(domain, tmp, &domains, list) {
   65.14 +		if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
   65.15 +				      &dominfo) == 1 &&
   65.16 +		    dominfo.domid == domain->domid &&
   65.17 +		    !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
   65.18 +			continue;
   65.19 +		talloc_free(domain->conn);
   65.20 +		released++;
   65.21 +	}
   65.22 +
   65.23 +	if (released)
   65.24 +		fire_watches(NULL, "@releaseDomain", false);
   65.25 +}
   65.26 +
   65.27  /* We scan all domains rather than use the information given here. */
   65.28  void handle_event(int event_fd)
   65.29  {
   65.30 @@ -371,26 +391,6 @@ void do_release(struct connection *conn,
   65.31  	send_ack(conn, XS_RELEASE);
   65.32  }
   65.33  
   65.34 -void domain_cleanup(void)
   65.35 -{
   65.36 -	xc_dominfo_t dominfo;
   65.37 -	struct domain *domain, *tmp;
   65.38 -	int released = 0;
   65.39 -
   65.40 -	list_for_each_entry_safe(domain, tmp, &domains, list) {
   65.41 -		if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
   65.42 -				      &dominfo) == 1 &&
   65.43 -		    dominfo.domid == domain->domid &&
   65.44 -		    !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
   65.45 -			continue;
   65.46 -		talloc_free(domain->conn);
   65.47 -		released++;
   65.48 -	}
   65.49 -
   65.50 -	if (released)
   65.51 -		fire_watches(NULL, "@releaseDomain", false);
   65.52 -}
   65.53 -
   65.54  void do_get_domain_path(struct connection *conn, const char *domid_str)
   65.55  {
   65.56  	struct domain *domain;
   65.57 @@ -457,6 +457,7 @@ int domain_init(void)
   65.58  
   65.59  #ifdef TESTING
   65.60  	eventchn_fd = fake_open_eventchn();
   65.61 +	(void)&st;
   65.62  #else
   65.63  	/* Make sure any existing device file links to correct device. */
   65.64  	if ((lstat(EVTCHN_DEV_NAME, &st) != 0) || !S_ISCHR(st.st_mode) ||
    66.1 --- a/tools/xenstore/xenstored_domain.h	Fri Sep 09 10:31:36 2005 -0600
    66.2 +++ b/tools/xenstore/xenstored_domain.h	Tue Sep 13 10:14:16 2005 -0600
    66.3 @@ -28,10 +28,6 @@ void do_introduce(struct connection *con
    66.4  /* domid */
    66.5  void do_release(struct connection *conn, const char *domid_str);
    66.6  
    66.7 -/* Enumerate domains and release connections for non-existant or dying
    66.8 - * domains. */
    66.9 -void domain_cleanup(void);
   66.10 -
   66.11  /* domid */
   66.12  void do_get_domain_path(struct connection *conn, const char *domid_str);
   66.13  
    67.1 --- a/tools/xenstore/xenstored_watch.c	Fri Sep 09 10:31:36 2005 -0600
    67.2 +++ b/tools/xenstore/xenstored_watch.c	Tue Sep 13 10:14:16 2005 -0600
    67.3 @@ -105,7 +105,6 @@ static void add_event(struct connection 
    67.4  	 */
    67.5  	if (!check_node_perms(conn, node, XS_PERM_READ|XS_PERM_ENOENT_OK) &&
    67.6  	    !check_event_node(node)) {
    67.7 -		fprintf(stderr, "No permission for %s\n", node);
    67.8  		return;
    67.9  	}
   67.10  
   67.11 @@ -135,11 +134,8 @@ void fire_watches(struct connection *con
   67.12  	if (conn && conn->transaction)
   67.13  		return;
   67.14  
   67.15 -	/* Create an event for each watch.  Don't send to self. */
   67.16 +	/* Create an event for each watch. */
   67.17  	list_for_each_entry(i, &connections, list) {
   67.18 -		if (i == conn)
   67.19 -			continue;
   67.20 -
   67.21  		list_for_each_entry(watch, &i->watches, list) {
   67.22  			if (is_child(node, watch->node))
   67.23  				add_event(i, watch, node);
    68.1 --- a/tools/xenstore/xs.c	Fri Sep 09 10:31:36 2005 -0600
    68.2 +++ b/tools/xenstore/xs.c	Tue Sep 13 10:14:16 2005 -0600
    68.3 @@ -36,12 +36,10 @@
    68.4  #include "xenstored.h"
    68.5  #include "xs_lib.h"
    68.6  #include "utils.h"
    68.7 -#include "xenbus_dev.h"
    68.8  
    68.9  struct xs_handle
   68.10  {
   68.11  	int fd;
   68.12 -	enum { SOCK, DEV } type;
   68.13  };
   68.14  
   68.15  /* Get the socket from the store daemon handle.
   68.16 @@ -68,7 +66,6 @@ static struct xs_handle *get_socket(cons
   68.17  		h = malloc(sizeof(*h));
   68.18  		if (h) {
   68.19  			h->fd = sock;
   68.20 -			h->type = SOCK;
   68.21  			return h;
   68.22  		}
   68.23  	}
   68.24 @@ -82,16 +79,15 @@ static struct xs_handle *get_socket(cons
   68.25  static struct xs_handle *get_dev(const char *connect_to)
   68.26  {
   68.27  	int fd, saved_errno;
   68.28 -	struct xs_handle *h = NULL;
   68.29 +	struct xs_handle *h;
   68.30  
   68.31 -	fd = open(connect_to, O_RDONLY);
   68.32 +	fd = open(connect_to, O_RDWR);
   68.33  	if (fd < 0)
   68.34  		return NULL;
   68.35  
   68.36  	h = malloc(sizeof(*h));
   68.37  	if (h) {
   68.38  		h->fd = fd;
   68.39 -		h->type = DEV;
   68.40  		return h;
   68.41  	}
   68.42  
   68.43 @@ -101,19 +97,32 @@ static struct xs_handle *get_dev(const c
   68.44  	return NULL;
   68.45  }
   68.46  
   68.47 +static struct xs_handle *get_handle(const char *connect_to)
   68.48 +{
   68.49 +	struct stat buf;
   68.50 +
   68.51 +	if (stat(connect_to, &buf) != 0)
   68.52 +		return NULL;
   68.53 +
   68.54 +	if (S_ISSOCK(buf.st_mode))
   68.55 +		return get_socket(connect_to);
   68.56 +	else
   68.57 +		return get_dev(connect_to);
   68.58 +}
   68.59 +
   68.60  struct xs_handle *xs_daemon_open(void)
   68.61  {
   68.62 -	return get_socket(xs_daemon_socket());
   68.63 +	return get_handle(xs_daemon_socket());
   68.64  }
   68.65  
   68.66  struct xs_handle *xs_daemon_open_readonly(void)
   68.67  {
   68.68 -	return get_socket(xs_daemon_socket_ro());
   68.69 +	return get_handle(xs_daemon_socket_ro());
   68.70  }
   68.71  
   68.72  struct xs_handle *xs_domain_open(void)
   68.73  {
   68.74 -	return get_dev(xs_domain_dev());
   68.75 +	return get_handle(xs_domain_dev());
   68.76  }
   68.77  
   68.78  void xs_daemon_close(struct xs_handle *h)
   68.79 @@ -190,9 +199,9 @@ static void *read_reply(int fd, enum xsd
   68.80  }
   68.81  
   68.82  /* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
   68.83 -static void *xs_talkv_sock(struct xs_handle *h, enum xsd_sockmsg_type type,
   68.84 -			   const struct iovec *iovec, unsigned int num_vecs,
   68.85 -			   unsigned int *len)
   68.86 +static void *xs_talkv(struct xs_handle *h, enum xsd_sockmsg_type type,
   68.87 +		      const struct iovec *iovec, unsigned int num_vecs,
   68.88 +		      unsigned int *len)
   68.89  {
   68.90  	struct xsd_sockmsg msg;
   68.91  	void *ret = NULL;
   68.92 @@ -253,54 +262,6 @@ close_fd:
   68.93  	return NULL;
   68.94  }
   68.95  
   68.96 -/* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
   68.97 -static void *xs_talkv_dev(struct xs_handle *h, enum xsd_sockmsg_type type,
   68.98 -			  const struct iovec *iovec, unsigned int num_vecs,
   68.99 -			  unsigned int *len)
  68.100 -{
  68.101 -	struct xenbus_dev_talkv dt;
  68.102 -	char *buf;
  68.103 -	int err, buflen = 1024;
  68.104 -
  68.105 - again:
  68.106 -	buf = malloc(buflen);
  68.107 -	if (buf == NULL) {
  68.108 -		errno = ENOMEM;
  68.109 -		return NULL;
  68.110 -	}
  68.111 -	dt.type = type;
  68.112 -	dt.iovec = (struct kvec *)iovec;
  68.113 -	dt.num_vecs = num_vecs;
  68.114 -	dt.buf = buf;
  68.115 -	dt.len = buflen;
  68.116 -	err = ioctl(h->fd, IOCTL_XENBUS_DEV_TALKV, &dt);
  68.117 -	if (err < 0) {
  68.118 -		free(buf);
  68.119 -		errno = err;
  68.120 -		return NULL;
  68.121 -	}
  68.122 -	if (err > buflen) {
  68.123 -		free(buf);
  68.124 -		buflen = err;
  68.125 -		goto again;
  68.126 -	}
  68.127 -	if (len)
  68.128 -		*len = err;
  68.129 -	return buf;
  68.130 -}
  68.131 -
  68.132 -/* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
  68.133 -static void *xs_talkv(struct xs_handle *h, enum xsd_sockmsg_type type,
  68.134 -		      const struct iovec *iovec, unsigned int num_vecs,
  68.135 -		      unsigned int *len)
  68.136 -{
  68.137 -	if (h->type == SOCK)
  68.138 -		return xs_talkv_sock(h, type, iovec, num_vecs, len);
  68.139 -	if (h->type == DEV)
  68.140 -		return xs_talkv_dev(h, type, iovec, num_vecs, len);
  68.141 -	return NULL;
  68.142 -}
  68.143 -
  68.144  /* free(), but don't change errno. */
  68.145  static void free_no_errno(void *p)
  68.146  {
    69.1 --- a/tools/xenstore/xs_lib.c	Fri Sep 09 10:31:36 2005 -0600
    69.2 +++ b/tools/xenstore/xs_lib.c	Tue Sep 13 10:14:16 2005 -0600
    69.3 @@ -38,37 +38,55 @@ static const char *xs_daemon_rundir(void
    69.4  	return (s ? s : "/var/run/xenstored");
    69.5  }
    69.6  
    69.7 +static const char *xs_daemon_path(void)
    69.8 +{
    69.9 +	static char buf[PATH_MAX];
   69.10 +	char *s = getenv("XENSTORED_PATH");
   69.11 +	if (s)
   69.12 +		return s;
   69.13 +	if (snprintf(buf, PATH_MAX, "%s/socket",
   69.14 +		     xs_daemon_rundir()) >= PATH_MAX)
   69.15 +		return NULL;
   69.16 +	return buf;
   69.17 +}
   69.18 +
   69.19  const char *xs_daemon_socket(void)
   69.20  {
   69.21 -	static char buf[PATH_MAX];
   69.22 -	sprintf(buf, "%s/socket", xs_daemon_rundir());
   69.23 -	return buf;
   69.24 +	return xs_daemon_path();
   69.25  }
   69.26  
   69.27  const char *xs_daemon_socket_ro(void)
   69.28  {
   69.29  	static char buf[PATH_MAX];
   69.30 -	sprintf(buf, "%s/socket_ro", xs_daemon_rundir());
   69.31 +	const char *s = xs_daemon_path();
   69.32 +	if (s == NULL)
   69.33 +		return NULL;
   69.34 +	if (snprintf(buf, PATH_MAX, "%s_ro", s) >= PATH_MAX)
   69.35 +		return NULL;
   69.36  	return buf;
   69.37  }
   69.38  
   69.39  const char *xs_daemon_store(void)
   69.40  {
   69.41  	static char buf[PATH_MAX];
   69.42 -	sprintf(buf, "%s/store", xs_daemon_rootdir());
   69.43 +	if (snprintf(buf, PATH_MAX, "%s/store",
   69.44 +		     xs_daemon_rootdir()) >= PATH_MAX)
   69.45 +		return NULL;
   69.46  	return buf;
   69.47  }
   69.48  
   69.49  const char *xs_daemon_transactions(void)
   69.50  {
   69.51  	static char buf[PATH_MAX];
   69.52 -	sprintf(buf, "%s/transactions", xs_daemon_rootdir());
   69.53 +	if (snprintf(buf, PATH_MAX, "%s/transactions",
   69.54 +		     xs_daemon_rootdir()) >= PATH_MAX)
   69.55 +		return NULL;
   69.56  	return buf;
   69.57  }
   69.58  
   69.59  const char *xs_domain_dev(void)
   69.60  {
   69.61 -	char *s = getenv("XENSTORED_DOMAIN_DEV");
   69.62 +	char *s = getenv("XENSTORED_PATH");
   69.63  	return (s ? s : "/proc/xen/xenbus");
   69.64  }
   69.65  
    70.1 --- a/tools/xenstore/xs_test.c	Fri Sep 09 10:31:36 2005 -0600
    70.2 +++ b/tools/xenstore/xs_test.c	Tue Sep 13 10:14:16 2005 -0600
    70.3 @@ -43,7 +43,7 @@
    70.4  
    70.5  static struct xs_handle *handles[10] = { NULL };
    70.6  
    70.7 -static unsigned int timeout_ms = 200;
    70.8 +static unsigned int timeout_ms = 500;
    70.9  static bool timeout_suppressed = true;
   70.10  static bool readonly = false;
   70.11  static bool print_input = false;
    71.1 --- a/xen/Makefile	Fri Sep 09 10:31:36 2005 -0600
    71.2 +++ b/xen/Makefile	Tue Sep 13 10:14:16 2005 -0600
    71.3 @@ -31,11 +31,11 @@ build: $(TARGET).gz
    71.4  
    71.5  install: $(TARGET).gz
    71.6  	[ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
    71.7 -	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz
    71.8 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
    71.9 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
   71.10 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
   71.11 -	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
   71.12 +	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
   71.13 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
   71.14 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
   71.15 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
   71.16 +	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
   71.17  	[ -d $(DESTDIR)/usr/include/xen/io ] || \
   71.18  		$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
   71.19  	$(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
    72.1 --- a/xen/arch/ia64/xen/xensetup.c	Fri Sep 09 10:31:36 2005 -0600
    72.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Sep 13 10:14:16 2005 -0600
    72.3 @@ -386,16 +386,17 @@ printk("About to call startup_cpu_idle_l
    72.4      startup_cpu_idle_loop();
    72.5  }
    72.6  
    72.7 -void arch_get_xen_caps(xen_capabilities_info_t *info)
    72.8 +void arch_get_xen_caps(xen_capabilities_info_t info)
    72.9  {
   72.10 -    char *p=info->caps;
   72.11 +    char *p=info;
   72.12  
   72.13      *p=0;
   72.14  
   72.15      p+=sprintf(p,"xen_%d.%d_ia64 ",XEN_VERSION,XEN_SUBVERSION);
   72.16  
   72.17 -    BUG_ON((p-info->caps)>sizeof(*info));
   72.18 +    *(p-1) = 0;
   72.19  
   72.20 -    if(p>info->caps) *(p-1) = 0;
   72.21 +    BUG_ON((p-info)>sizeof(xen_capabilities_info_t));
   72.22 +
   72.23  }
   72.24  
    73.1 --- a/xen/arch/x86/dom0_ops.c	Fri Sep 09 10:31:36 2005 -0600
    73.2 +++ b/xen/arch/x86/dom0_ops.c	Tue Sep 13 10:14:16 2005 -0600
    73.3 @@ -35,13 +35,13 @@ static unsigned long msr_hi;
    73.4  
    73.5  static void write_msr_for(void *unused)
    73.6  {
    73.7 -    if (((1 << current->processor) & msr_cpu_mask))
    73.8 +    if ( ((1 << current->processor) & msr_cpu_mask) )
    73.9          (void)wrmsr_user(msr_addr, msr_lo, msr_hi);
   73.10  }
   73.11  
   73.12  static void read_msr_for(void *unused)
   73.13  {
   73.14 -    if (((1 << current->processor) & msr_cpu_mask))
   73.15 +    if ( ((1 << current->processor) & msr_cpu_mask) )
   73.16          (void)rdmsr_user(msr_addr, msr_lo, msr_hi);
   73.17  }
   73.18  
   73.19 @@ -189,11 +189,11 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
   73.20          pi->total_pages      = max_page;
   73.21          pi->free_pages       = avail_domheap_pages();
   73.22          pi->cpu_khz          = cpu_khz;
   73.23 -        memset( pi->hw_cap, 0, sizeof(pi->hw_cap) );
   73.24 -        memcpy( pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4 );
   73.25 +        memset(pi->hw_cap, 0, sizeof(pi->hw_cap));
   73.26 +        memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
   73.27          ret = 0;
   73.28 -        if( copy_to_user(u_dom0_op, op, sizeof(*op)) )
   73.29 -	    ret = -EINVAL;
   73.30 +        if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
   73.31 +	    ret = -EFAULT;
   73.32      }
   73.33      break;
   73.34      
    74.1 --- a/xen/arch/x86/domain.c	Fri Sep 09 10:31:36 2005 -0600
    74.2 +++ b/xen/arch/x86/domain.c	Tue Sep 13 10:14:16 2005 -0600
    74.3 @@ -461,14 +461,11 @@ int arch_set_info_guest(
    74.4          if ( !get_page(&frame_table[phys_basetab>>PAGE_SHIFT], d) )
    74.5              return -EINVAL;
    74.6      }
    74.7 -    else
    74.8 +    else if ( !(c->flags & VGCF_VMX_GUEST) )
    74.9      {
   74.10 -#ifdef __x86_64__
   74.11 -        if ( !(c->flags & VGCF_VMX_GUEST) )
   74.12 -#endif
   74.13 -            if ( !get_page_and_type(&frame_table[phys_basetab>>PAGE_SHIFT], d, 
   74.14 -                                    PGT_base_page_table) )
   74.15 -                return -EINVAL;
   74.16 +        if ( !get_page_and_type(&frame_table[phys_basetab>>PAGE_SHIFT], d, 
   74.17 +                                PGT_base_page_table) )
   74.18 +            return -EINVAL;
   74.19      }
   74.20  
   74.21      if ( (rc = (int)set_gdt(v, c->gdt_frames, c->gdt_ents)) != 0 )
   74.22 @@ -677,10 +674,10 @@ static void save_segments(struct vcpu *v
   74.23      if ( VMX_DOMAIN(v) )
   74.24          rdmsrl(MSR_SHADOW_GS_BASE, v->arch.arch_vmx.msr_content.shadow_gs);
   74.25  
   74.26 -    __asm__ __volatile__ ( "movl %%ds,%0" : "=m" (regs->ds) );
   74.27 -    __asm__ __volatile__ ( "movl %%es,%0" : "=m" (regs->es) );
   74.28 -    __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (regs->fs) );
   74.29 -    __asm__ __volatile__ ( "movl %%gs,%0" : "=m" (regs->gs) );
   74.30 +    __asm__ __volatile__ ( "mov %%ds,%0" : "=m" (regs->ds) );
   74.31 +    __asm__ __volatile__ ( "mov %%es,%0" : "=m" (regs->es) );
   74.32 +    __asm__ __volatile__ ( "mov %%fs,%0" : "=m" (regs->fs) );
   74.33 +    __asm__ __volatile__ ( "mov %%gs,%0" : "=m" (regs->gs) );
   74.34  
   74.35      if ( regs->ds )
   74.36          dirty_segment_mask |= DIRTY_DS;
    75.1 --- a/xen/arch/x86/setup.c	Fri Sep 09 10:31:36 2005 -0600
    75.2 +++ b/xen/arch/x86/setup.c	Tue Sep 13 10:14:16 2005 -0600
    75.3 @@ -93,8 +93,6 @@ unsigned long mmu_cr4_features = X86_CR4
    75.4  #endif
    75.5  EXPORT_SYMBOL(mmu_cr4_features);
    75.6  
    75.7 -int hvm_enabled = 0; /* can we run unmodified guests */
    75.8 -
    75.9  struct vcpu *idle_task[NR_CPUS] = { &idle0_vcpu };
   75.10  
   75.11  int acpi_disabled;
   75.12 @@ -533,43 +531,44 @@ void __init __start_xen(multiboot_info_t
   75.13      startup_cpu_idle_loop();
   75.14  }
   75.15  
   75.16 -void arch_get_xen_caps(xen_capabilities_info_t *info)
   75.17 +void arch_get_xen_caps(xen_capabilities_info_t info)
   75.18  {
   75.19 -    char *p=info->caps;
   75.20 -
   75.21 -    *p=0;
   75.22 -
   75.23 -#ifdef CONFIG_X86_32
   75.24 +    char *p = info;
   75.25  
   75.26 -#ifndef CONFIG_X86_PAE       
   75.27 -    p+=sprintf(p,"xen_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
   75.28 -    if(hvm_enabled)
   75.29 +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
   75.30 +
   75.31 +    p += sprintf(p, "xen_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   75.32 +    if ( hvm_enabled )
   75.33 +        p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   75.34 +
   75.35 +#elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
   75.36 +
   75.37 +    p += sprintf(p, "xen_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   75.38 +    if ( hvm_enabled )
   75.39      {
   75.40 -        p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
   75.41 -    }
   75.42 -#else
   75.43 -    p+=sprintf(p,"xen_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);
   75.44 -    if(hvm_enabled)
   75.45 -    {
   75.46 -        //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
   75.47 -        //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);    
   75.48 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   75.49 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   75.50      }
   75.51  
   75.52 -#endif        
   75.53 +#elif defined(CONFIG_X86_64)
   75.54  
   75.55 -#else /* !CONFIG_X86_32 */
   75.56 -    p+=sprintf(p,"xen_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION);
   75.57 -    if(hvm_enabled)
   75.58 +    p += sprintf(p, "xen_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
   75.59 +    if ( hvm_enabled )
   75.60      {
   75.61 -        //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
   75.62 -        //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);    
   75.63 -        p+=sprintf(p,"hvm_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION);    
   75.64 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   75.65 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   75.66 +        p += sprintf(p, "hvm_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
   75.67      }
   75.68 +
   75.69 +#else
   75.70 +
   75.71 +    p++;
   75.72 +
   75.73  #endif
   75.74      
   75.75 -    BUG_ON((p-info->caps)>sizeof(*info));
   75.76 +    *(p-1) = 0;
   75.77  
   75.78 -    if(p>info->caps) *(p-1) = 0;
   75.79 +    BUG_ON((p - info) > sizeof(xen_capabilities_info_t));
   75.80  }
   75.81  
   75.82  /*
    76.1 --- a/xen/arch/x86/shadow.c	Fri Sep 09 10:31:36 2005 -0600
    76.2 +++ b/xen/arch/x86/shadow.c	Tue Sep 13 10:14:16 2005 -0600
    76.3 @@ -54,7 +54,7 @@ static unsigned long shadow_l4_table(
    76.4  static void shadow_map_into_current(struct vcpu *v,
    76.5      unsigned long va, unsigned int from, unsigned int to);
    76.6  static inline void validate_bl2e_change( struct domain *d,
    76.7 -	guest_root_pgentry_t *new_gle_p, pgentry_64_t *shadow_l3, int index);
    76.8 +    guest_root_pgentry_t *new_gle_p, pgentry_64_t *shadow_l3, int index);
    76.9  
   76.10  #endif
   76.11  
    77.1 --- a/xen/arch/x86/shadow32.c	Fri Sep 09 10:31:36 2005 -0600
    77.2 +++ b/xen/arch/x86/shadow32.c	Tue Sep 13 10:14:16 2005 -0600
    77.3 @@ -2214,7 +2214,7 @@ static u32 remove_all_access_in_page(
    77.4      struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
    77.5  {
    77.6      l1_pgentry_t *pl1e = map_domain_page(l1mfn);
    77.7 -    l1_pgentry_t match;
    77.8 +    l1_pgentry_t match, ol2e;
    77.9      unsigned long flags  = _PAGE_PRESENT;
   77.10      int i;
   77.11      u32 count = 0;
   77.12 @@ -2226,17 +2226,17 @@ static u32 remove_all_access_in_page(
   77.13      
   77.14      for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
   77.15      {
   77.16 -        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
   77.17 -        {
   77.18 -            l1_pgentry_t ol2e = pl1e[i];
   77.19 -            pl1e[i] = l1e_empty();
   77.20 -            count++;
   77.21 -
   77.22 -            if ( is_l1_shadow )
   77.23 -                shadow_put_page_from_l1e(ol2e, d);
   77.24 -            else /* must be an hl2 page */
   77.25 -                put_page(&frame_table[forbidden_gmfn]);
   77.26 -        }
   77.27 +        if ( l1e_has_changed(pl1e[i], match, flags) )
   77.28 +            continue;
   77.29 +
   77.30 +        ol2e = pl1e[i];
   77.31 +        pl1e[i] = l1e_empty();
   77.32 +        count++;
   77.33 +
   77.34 +        if ( is_l1_shadow )
   77.35 +            shadow_put_page_from_l1e(ol2e, d);
   77.36 +        else /* must be an hl2 page */
   77.37 +            put_page(&frame_table[forbidden_gmfn]);
   77.38      }
   77.39  
   77.40      unmap_domain_page(pl1e);
    78.1 --- a/xen/arch/x86/shadow_public.c	Fri Sep 09 10:31:36 2005 -0600
    78.2 +++ b/xen/arch/x86/shadow_public.c	Tue Sep 13 10:14:16 2005 -0600
    78.3 @@ -54,24 +54,24 @@ int shadow_set_guest_paging_levels(struc
    78.4      switch(levels) {
    78.5  #if CONFIG_PAGING_LEVELS >= 4
    78.6      case 4:
    78.7 -	if ( d->arch.ops != &MODE_F_HANDLER )
    78.8 -	    d->arch.ops = &MODE_F_HANDLER;
    78.9 -	shadow_unlock(d);
   78.10 +        if ( d->arch.ops != &MODE_F_HANDLER )
   78.11 +            d->arch.ops = &MODE_F_HANDLER;
   78.12 +        shadow_unlock(d);
   78.13          return 1;
   78.14  #endif
   78.15      case 3:
   78.16      case 2:
   78.17  #if CONFIG_PAGING_LEVELS == 2
   78.18 -	if ( d->arch.ops != &MODE_A_HANDLER )
   78.19 -	    d->arch.ops = &MODE_A_HANDLER;
   78.20 +        if ( d->arch.ops != &MODE_A_HANDLER )
   78.21 +            d->arch.ops = &MODE_A_HANDLER;
   78.22  #elif CONFIG_PAGING_LEVELS == 4
   78.23 -	if ( d->arch.ops != &MODE_D_HANDLER )
   78.24 -	    d->arch.ops = &MODE_D_HANDLER;
   78.25 +        if ( d->arch.ops != &MODE_D_HANDLER )
   78.26 +            d->arch.ops = &MODE_D_HANDLER;
   78.27  #endif
   78.28 -	shadow_unlock(d);
   78.29 +        shadow_unlock(d);
   78.30          return 1;
   78.31 -   default:
   78.32 -	shadow_unlock(d);
   78.33 +    default:
   78.34 +        shadow_unlock(d);
   78.35          return 0;
   78.36      }
   78.37  }
   78.38 @@ -115,10 +115,10 @@ int shadow_do_update_va_mapping(unsigned
   78.39  
   78.40  struct out_of_sync_entry *
   78.41  shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn,
   78.42 -                             unsigned long mfn)
   78.43 +                            unsigned long mfn)
   78.44  {
   78.45 -   struct domain *d = v->domain;
   78.46 -   return d->arch.ops->mark_mfn_out_of_sync(v, gpfn, mfn);
   78.47 +    struct domain *d = v->domain;
   78.48 +    return d->arch.ops->mark_mfn_out_of_sync(v, gpfn, mfn);
   78.49  }
   78.50  
   78.51  /*
   78.52 @@ -181,7 +181,7 @@ static void alloc_monitor_pagetable(stru
   78.53      l4_pgentry_t *mpl4e;
   78.54      struct pfn_info *mmfn_info;
   78.55      struct domain *d = v->domain;
   78.56 -     pagetable_t phys_table;
   78.57 +    pagetable_t phys_table;
   78.58  
   78.59      ASSERT(!pagetable_get_paddr(v->arch.monitor_table)); /* we should only get called once */
   78.60  
   78.61 @@ -192,13 +192,13 @@ static void alloc_monitor_pagetable(stru
   78.62      mpl4e = (l4_pgentry_t *) map_domain_page(mmfn);
   78.63      memcpy(mpl4e, &idle_pg_table[0], PAGE_SIZE);
   78.64      mpl4e[l4_table_offset(PERDOMAIN_VIRT_START)] =
   78.65 -      l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
   78.66 +        l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
   78.67      /* map the phys_to_machine map into the per domain Read-Only MPT space */
   78.68      phys_table = page_table_convert(d);
   78.69  
   78.70      mpl4e[l4_table_offset(RO_MPT_VIRT_START)] =
   78.71 -       l4e_from_paddr(pagetable_get_paddr(phys_table),
   78.72 -         __PAGE_HYPERVISOR);
   78.73 +        l4e_from_paddr(pagetable_get_paddr(phys_table),
   78.74 +                       __PAGE_HYPERVISOR);
   78.75      v->arch.monitor_table = mk_pagetable(mmfn << PAGE_SHIFT);
   78.76      v->arch.monitor_vtable = (l2_pgentry_t *) mpl4e;
   78.77  }
   78.78 @@ -245,7 +245,7 @@ free_shadow_tables(struct domain *d, uns
   78.79          for ( i = 0; i < PAGETABLE_ENTRIES; i++ )
   78.80              if ( external || is_guest_l4_slot(i) )
   78.81                  if ( entry_get_flags(ple[i]) & _PAGE_PRESENT )
   78.82 -                        put_shadow_ref(entry_get_pfn(ple[i]));
   78.83 +                    put_shadow_ref(entry_get_pfn(ple[i]));
   78.84  
   78.85          unmap_domain_page(ple);
   78.86      }
   78.87 @@ -306,12 +306,12 @@ static void alloc_monitor_pagetable(stru
   78.88  
   78.89      mpl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
   78.90          l2e_from_paddr(__pa(d->arch.mm_perdomain_pt),
   78.91 -                        __PAGE_HYPERVISOR);
   78.92 +                       __PAGE_HYPERVISOR);
   78.93  
   78.94      // map the phys_to_machine map into the Read-Only MPT space for this domain
   78.95      mpl2e[l2_table_offset(RO_MPT_VIRT_START)] =
   78.96          l2e_from_paddr(pagetable_get_paddr(d->arch.phys_table),
   78.97 -                        __PAGE_HYPERVISOR);
   78.98 +                       __PAGE_HYPERVISOR);
   78.99  
  78.100      // Don't (yet) have mappings for these...
  78.101      // Don't want to accidentally see the idle_pg_table's linear mapping.
  78.102 @@ -365,7 +365,7 @@ void free_monitor_pagetable(struct vcpu 
  78.103      v->arch.monitor_table = mk_pagetable(0);
  78.104      v->arch.monitor_vtable = 0;
  78.105  }
  78.106 -#endif	
  78.107 +#endif 
  78.108  
  78.109  static void
  78.110  shadow_free_snapshot(struct domain *d, struct out_of_sync_entry *entry)
  78.111 @@ -850,16 +850,16 @@ void free_shadow_pages(struct domain *d)
  78.112          perfc_decr(free_l1_pages);
  78.113  
  78.114          struct pfn_info *page = list_entry(list_ent, struct pfn_info, list);
  78.115 -	if (d->arch.ops->guest_paging_levels == PAGING_L2)
  78.116 -	{
  78.117 +        if (d->arch.ops->guest_paging_levels == PAGING_L2)
  78.118 +        {
  78.119  #if CONFIG_PAGING_LEVELS >=4
  78.120 -        free_domheap_pages(page, SL1_ORDER);
  78.121 +            free_domheap_pages(page, SL1_ORDER);
  78.122  #else
  78.123 -	free_domheap_page(page);
  78.124 +            free_domheap_page(page);
  78.125  #endif
  78.126 -	}
  78.127 -	else
  78.128 -	free_domheap_page(page);
  78.129 +        }
  78.130 +        else
  78.131 +            free_domheap_page(page);
  78.132      }
  78.133  
  78.134      shadow_audit(d, 0);
  78.135 @@ -930,9 +930,9 @@ int __shadow_mode_enable(struct domain *
  78.136  
  78.137  #if defined(CONFIG_PAGING_LEVELS)
  78.138      if(!shadow_set_guest_paging_levels(d, 
  78.139 -	   CONFIG_PAGING_LEVELS)) {
  78.140 -	printk("Unsupported guest paging levels\n");
  78.141 -	domain_crash_synchronous(); /* need to take a clean path */
  78.142 +                                       CONFIG_PAGING_LEVELS)) {
  78.143 +        printk("Unsupported guest paging levels\n");
  78.144 +        domain_crash_synchronous(); /* need to take a clean path */
  78.145      }
  78.146  #endif
  78.147  
  78.148 @@ -1004,7 +1004,7 @@ int __shadow_mode_enable(struct domain *
  78.149              goto nomem;
  78.150  
  78.151          memset(d->arch.shadow_ht, 0,
  78.152 -           shadow_ht_buckets * sizeof(struct shadow_status));
  78.153 +               shadow_ht_buckets * sizeof(struct shadow_status));
  78.154      }
  78.155  
  78.156      if ( new_modes & SHM_log_dirty )
  78.157 @@ -1013,7 +1013,7 @@ int __shadow_mode_enable(struct domain *
  78.158          d->arch.shadow_dirty_bitmap_size = (d->max_pages + 63) & ~63;
  78.159          d->arch.shadow_dirty_bitmap = 
  78.160              xmalloc_array(unsigned long, d->arch.shadow_dirty_bitmap_size /
  78.161 -                                         (8 * sizeof(unsigned long)));
  78.162 +                          (8 * sizeof(unsigned long)));
  78.163          if ( d->arch.shadow_dirty_bitmap == NULL )
  78.164          {
  78.165              d->arch.shadow_dirty_bitmap_size = 0;
  78.166 @@ -1039,7 +1039,7 @@ int __shadow_mode_enable(struct domain *
  78.167              // external guests provide their own memory for their P2M maps.
  78.168              //
  78.169              ASSERT( d == page_get_owner(
  78.170 -                        &frame_table[pagetable_get_pfn(d->arch.phys_table)]) );
  78.171 +                &frame_table[pagetable_get_pfn(d->arch.phys_table)]) );
  78.172          }
  78.173      }
  78.174  
  78.175 @@ -1188,9 +1188,9 @@ static int shadow_mode_table_op(
  78.176                            chunk : (d->max_pages - i)) + 7) / 8;
  78.177  
  78.178              if (copy_to_user(
  78.179 -                    sc->dirty_bitmap + (i/(8*sizeof(unsigned long))),
  78.180 -                    d->arch.shadow_dirty_bitmap +(i/(8*sizeof(unsigned long))),
  78.181 -                    bytes))
  78.182 +                sc->dirty_bitmap + (i/(8*sizeof(unsigned long))),
  78.183 +                d->arch.shadow_dirty_bitmap +(i/(8*sizeof(unsigned long))),
  78.184 +                bytes))
  78.185              {
  78.186                  // copy_to_user can fail when copying to guest app memory.
  78.187                  // app should zero buffer after mallocing, and pin it
  78.188 @@ -1474,8 +1474,8 @@ void shadow_l3_normal_pt_update(
  78.189  
  78.190          spl3e = (pgentry_64_t *) map_domain_page_with_cache(sl3mfn, cache);
  78.191          validate_entry_change(d, (pgentry_64_t *) &gpde,
  78.192 -			      &spl3e[(pa & ~PAGE_MASK) / sizeof(l3_pgentry_t)], 
  78.193 -			      shadow_type_to_level(PGT_l3_shadow));
  78.194 +                              &spl3e[(pa & ~PAGE_MASK) / sizeof(l3_pgentry_t)], 
  78.195 +                              shadow_type_to_level(PGT_l3_shadow));
  78.196          unmap_domain_page_with_cache(spl3e, cache);
  78.197      }
  78.198  
  78.199 @@ -1502,8 +1502,8 @@ void shadow_l4_normal_pt_update(
  78.200  
  78.201          spl4e = (pgentry_64_t *)map_domain_page_with_cache(sl4mfn, cache);
  78.202          validate_entry_change(d, (pgentry_64_t *)&gpde,
  78.203 -			      &spl4e[(pa & ~PAGE_MASK) / sizeof(l4_pgentry_t)], 
  78.204 -			      shadow_type_to_level(PGT_l4_shadow));
  78.205 +                              &spl4e[(pa & ~PAGE_MASK) / sizeof(l4_pgentry_t)], 
  78.206 +                              shadow_type_to_level(PGT_l4_shadow));
  78.207          unmap_domain_page_with_cache(spl4e, cache);
  78.208      }
  78.209  
  78.210 @@ -1619,32 +1619,32 @@ gpfn_to_mfn_foreign(struct domain *d, un
  78.211  }
  78.212  
  78.213  static u32 remove_all_access_in_page(
  78.214 -  struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
  78.215 +    struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
  78.216  {
  78.217      l1_pgentry_t *pl1e = map_domain_page(l1mfn);
  78.218 -    l1_pgentry_t match;
  78.219 +    l1_pgentry_t match, ol2e;
  78.220      unsigned long flags  = _PAGE_PRESENT;
  78.221      int i;
  78.222      u32 count = 0;
  78.223      int is_l1_shadow =
  78.224 -      ((frame_table[l1mfn].u.inuse.type_info & PGT_type_mask) ==
  78.225 -       PGT_l1_shadow);
  78.226 +        ((frame_table[l1mfn].u.inuse.type_info & PGT_type_mask) ==
  78.227 +         PGT_l1_shadow);
  78.228  
  78.229      match = l1e_from_pfn(forbidden_gmfn, flags);
  78.230  
  78.231      for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
  78.232      {
  78.233 -        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
  78.234 -        {
  78.235 -            l1_pgentry_t ol2e = pl1e[i];
  78.236 -            pl1e[i] = l1e_empty();
  78.237 -            count++;
  78.238 +        if ( l1e_has_changed(pl1e[i], match, flags) )
  78.239 +            continue;
  78.240  
  78.241 -            if ( is_l1_shadow )
  78.242 -                shadow_put_page_from_l1e(ol2e, d);
  78.243 -            else /* must be an hl2 page */
  78.244 -                put_page(&frame_table[forbidden_gmfn]);
  78.245 -        }
  78.246 +        ol2e = pl1e[i];
  78.247 +        pl1e[i] = l1e_empty();
  78.248 +        count++;
  78.249 +
  78.250 +        if ( is_l1_shadow )
  78.251 +            shadow_put_page_from_l1e(ol2e, d);
  78.252 +        else /* must be an hl2 page */
  78.253 +            put_page(&frame_table[forbidden_gmfn]);
  78.254      }
  78.255  
  78.256      unmap_domain_page(pl1e);
  78.257 @@ -1671,19 +1671,19 @@ static u32 __shadow_remove_all_access(st
  78.258          {
  78.259              switch (a->gpfn_and_flags & PGT_type_mask)
  78.260              {
  78.261 -                case PGT_l1_shadow:
  78.262 -                case PGT_l2_shadow:
  78.263 -                case PGT_l3_shadow:
  78.264 -                case PGT_l4_shadow:
  78.265 -                case PGT_hl2_shadow:
  78.266 -                    count += remove_all_access_in_page(d, a->smfn, forbidden_gmfn);
  78.267 -                    break;
  78.268 -                case PGT_snapshot:
  78.269 -                case PGT_writable_pred:
  78.270 -                    // these can't hold refs to the forbidden page
  78.271 -                    break;
  78.272 -                default:
  78.273 -                    BUG();
  78.274 +            case PGT_l1_shadow:
  78.275 +            case PGT_l2_shadow:
  78.276 +            case PGT_l3_shadow:
  78.277 +            case PGT_l4_shadow:
  78.278 +            case PGT_hl2_shadow:
  78.279 +                count += remove_all_access_in_page(d, a->smfn, forbidden_gmfn);
  78.280 +                break;
  78.281 +            case PGT_snapshot:
  78.282 +            case PGT_writable_pred:
  78.283 +                // these can't hold refs to the forbidden page
  78.284 +                break;
  78.285 +            default:
  78.286 +                BUG();
  78.287              }
  78.288  
  78.289              a = a->next;
  78.290 @@ -1694,29 +1694,29 @@ static u32 __shadow_remove_all_access(st
  78.291  }
  78.292  
  78.293  void shadow_drop_references(
  78.294 -  struct domain *d, struct pfn_info *page)
  78.295 +    struct domain *d, struct pfn_info *page)
  78.296  {
  78.297      if ( likely(!shadow_mode_refcounts(d)) ||
  78.298 -      ((page->u.inuse.type_info & PGT_count_mask) == 0) )
  78.299 +         ((page->u.inuse.type_info & PGT_count_mask) == 0) )
  78.300          return;
  78.301  
  78.302      /* XXX This needs more thought... */
  78.303      printk("%s: needing to call __shadow_remove_all_access for mfn=%lx\n",
  78.304 -      __func__, page_to_pfn(page));
  78.305 +           __func__, page_to_pfn(page));
  78.306      printk("Before: mfn=%lx c=%08x t=%" PRtype_info "\n", page_to_pfn(page),
  78.307 -      page->count_info, page->u.inuse.type_info);
  78.308 +           page->count_info, page->u.inuse.type_info);
  78.309  
  78.310      shadow_lock(d);
  78.311      __shadow_remove_all_access(d, page_to_pfn(page));
  78.312      shadow_unlock(d);
  78.313  
  78.314      printk("After:  mfn=%lx c=%08x t=%" PRtype_info "\n", page_to_pfn(page),
  78.315 -      page->count_info, page->u.inuse.type_info);
  78.316 +           page->count_info, page->u.inuse.type_info);
  78.317  }
  78.318  
  78.319  /* XXX Needs more thought. Neither pretty nor fast: a place holder. */
  78.320  void shadow_sync_and_drop_references(
  78.321 -  struct domain *d, struct pfn_info *page)
  78.322 +    struct domain *d, struct pfn_info *page)
  78.323  {
  78.324      if ( likely(!shadow_mode_refcounts(d)) )
  78.325          return;
  78.326 @@ -1730,3 +1730,13 @@ void shadow_sync_and_drop_references(
  78.327  
  78.328      shadow_unlock(d);
  78.329  }
  78.330 +
  78.331 +/*
  78.332 + * Local variables:
  78.333 + * mode: C
  78.334 + * c-set-style: "BSD"
  78.335 + * c-basic-offset: 4
  78.336 + * tab-width: 4
  78.337 + * indent-tabs-mode: nil
  78.338 + * End:
  78.339 + */
    79.1 --- a/xen/arch/x86/traps.c	Fri Sep 09 10:31:36 2005 -0600
    79.2 +++ b/xen/arch/x86/traps.c	Tue Sep 13 10:14:16 2005 -0600
    79.3 @@ -106,7 +106,7 @@ integer_param("debug_stack_lines", debug
    79.4  #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
    79.5  #else
    79.6  #define stack_words_per_line 4
    79.7 -#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->esp)
    79.8 +#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
    79.9  #endif
   79.10  
   79.11  int is_kernel_text(unsigned long addr)
   79.12 @@ -238,7 +238,7 @@ void show_stack(struct cpu_user_regs *re
   79.13      unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
   79.14      int i;
   79.15  
   79.16 -    if ( GUEST_MODE(regs) )
   79.17 +    if ( GUEST_CONTEXT(current, regs) )
   79.18          return show_guest_stack(regs);
   79.19  
   79.20      printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
    80.1 --- a/xen/arch/x86/vmx.c	Fri Sep 09 10:31:36 2005 -0600
    80.2 +++ b/xen/arch/x86/vmx.c	Tue Sep 13 10:14:16 2005 -0600
    80.3 @@ -44,14 +44,14 @@
    80.4  
    80.5  #include <public/io/ioreq.h>
    80.6  
    80.7 +int hvm_enabled;
    80.8 +
    80.9  #ifdef CONFIG_VMX
   80.10  
   80.11  int vmcs_size;
   80.12  unsigned int opt_vmx_debug_level = 0;
   80.13  integer_param("vmx_debug", opt_vmx_debug_level);
   80.14  
   80.15 -extern int hvm_enabled;
   80.16 -
   80.17  #ifdef TRACE_BUFFER
   80.18  static unsigned long trace_values[NR_CPUS][4];
   80.19  #define TRACE_VMEXIT(index,value) trace_values[current->processor][index]=value
   80.20 @@ -122,37 +122,37 @@ static inline int long_mode_do_msr_read(
   80.21      struct vcpu *vc = current;
   80.22      struct msr_state * msr = &vc->arch.arch_vmx.msr_content;
   80.23      switch(regs->ecx){
   80.24 -        case MSR_EFER:
   80.25 -            msr_content = msr->msr_items[VMX_INDEX_MSR_EFER];
   80.26 -            VMX_DBG_LOG(DBG_LEVEL_2, "EFER msr_content %llx\n", (unsigned long long)msr_content);
   80.27 -            if (test_bit(VMX_CPU_STATE_LME_ENABLED,
   80.28 -                          &vc->arch.arch_vmx.cpu_state))
   80.29 -                msr_content |= 1 << _EFER_LME;
   80.30 +    case MSR_EFER:
   80.31 +        msr_content = msr->msr_items[VMX_INDEX_MSR_EFER];
   80.32 +        VMX_DBG_LOG(DBG_LEVEL_2, "EFER msr_content %llx\n", (unsigned long long)msr_content);
   80.33 +        if (test_bit(VMX_CPU_STATE_LME_ENABLED,
   80.34 +                     &vc->arch.arch_vmx.cpu_state))
   80.35 +            msr_content |= 1 << _EFER_LME;
   80.36  
   80.37 -            if (VMX_LONG_GUEST(vc))
   80.38 -                msr_content |= 1 << _EFER_LMA;
   80.39 -            break;
   80.40 -        case MSR_FS_BASE:
   80.41 -            if (!(VMX_LONG_GUEST(vc)))
   80.42 -                /* XXX should it be GP fault */
   80.43 -                domain_crash();
   80.44 -            __vmread(GUEST_FS_BASE, &msr_content);
   80.45 -            break;
   80.46 -        case MSR_GS_BASE:
   80.47 -            if (!(VMX_LONG_GUEST(vc)))
   80.48 -                domain_crash();
   80.49 -            __vmread(GUEST_GS_BASE, &msr_content);
   80.50 -            break;
   80.51 -        case MSR_SHADOW_GS_BASE:
   80.52 -            msr_content = msr->shadow_gs;
   80.53 -            break;
   80.54 +        if (VMX_LONG_GUEST(vc))
   80.55 +            msr_content |= 1 << _EFER_LMA;
   80.56 +        break;
   80.57 +    case MSR_FS_BASE:
   80.58 +        if (!(VMX_LONG_GUEST(vc)))
   80.59 +            /* XXX should it be GP fault */
   80.60 +            domain_crash();
   80.61 +        __vmread(GUEST_FS_BASE, &msr_content);
   80.62 +        break;
   80.63 +    case MSR_GS_BASE:
   80.64 +        if (!(VMX_LONG_GUEST(vc)))
   80.65 +            domain_crash();
   80.66 +        __vmread(GUEST_GS_BASE, &msr_content);
   80.67 +        break;
   80.68 +    case MSR_SHADOW_GS_BASE:
   80.69 +        msr_content = msr->shadow_gs;
   80.70 +        break;
   80.71  
   80.72          CASE_READ_MSR(STAR);
   80.73          CASE_READ_MSR(LSTAR);
   80.74          CASE_READ_MSR(CSTAR);
   80.75          CASE_READ_MSR(SYSCALL_MASK);
   80.76 -        default:
   80.77 -            return 0;
   80.78 +    default:
   80.79 +        return 0;
   80.80      }
   80.81      VMX_DBG_LOG(DBG_LEVEL_2, "mode_do_msr_read: msr_content: %lx\n", msr_content);
   80.82      regs->eax = msr_content & 0xffffffff;
   80.83 @@ -166,68 +166,68 @@ static inline int long_mode_do_msr_write
   80.84      struct vcpu *vc = current;
   80.85      struct msr_state * msr = &vc->arch.arch_vmx.msr_content;
   80.86      struct msr_state * host_state = 
   80.87 -		&percpu_msr[smp_processor_id()];
   80.88 +        &percpu_msr[smp_processor_id()];
   80.89  
   80.90      VMX_DBG_LOG(DBG_LEVEL_1, " mode_do_msr_write msr %lx msr_content %lx\n", 
   80.91                  regs->ecx, msr_content);
   80.92  
   80.93      switch (regs->ecx){
   80.94 -        case MSR_EFER:
   80.95 -            if ((msr_content & EFER_LME) ^
   80.96 -                  test_bit(VMX_CPU_STATE_LME_ENABLED,
   80.97 -                           &vc->arch.arch_vmx.cpu_state)){
   80.98 -                if (test_bit(VMX_CPU_STATE_PG_ENABLED,
   80.99 -                             &vc->arch.arch_vmx.cpu_state) ||
  80.100 -                    !test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.101 -                        &vc->arch.arch_vmx.cpu_state)){
  80.102 -                     vmx_inject_exception(vc, TRAP_gp_fault, 0);
  80.103 -                }
  80.104 -            }
  80.105 -            if (msr_content & EFER_LME)
  80.106 -                set_bit(VMX_CPU_STATE_LME_ENABLED,
  80.107 -                        &vc->arch.arch_vmx.cpu_state);
  80.108 -            /* No update for LME/LMA since it have no effect */
  80.109 -            msr->msr_items[VMX_INDEX_MSR_EFER] =
  80.110 -                  msr_content;
  80.111 -            if (msr_content & ~(EFER_LME | EFER_LMA)){
  80.112 -                msr->msr_items[VMX_INDEX_MSR_EFER] = msr_content;
  80.113 -                if (!test_bit(VMX_INDEX_MSR_EFER, &msr->flags)){ 
  80.114 -                    rdmsrl(MSR_EFER,
  80.115 -                            host_state->msr_items[VMX_INDEX_MSR_EFER]);
  80.116 -                      set_bit(VMX_INDEX_MSR_EFER, &host_state->flags);
  80.117 -                      set_bit(VMX_INDEX_MSR_EFER, &msr->flags);  
  80.118 -                      wrmsrl(MSR_EFER, msr_content);
  80.119 -                }
  80.120 +    case MSR_EFER:
  80.121 +        if ((msr_content & EFER_LME) ^
  80.122 +            test_bit(VMX_CPU_STATE_LME_ENABLED,
  80.123 +                     &vc->arch.arch_vmx.cpu_state)){
  80.124 +            if (test_bit(VMX_CPU_STATE_PG_ENABLED,
  80.125 +                         &vc->arch.arch_vmx.cpu_state) ||
  80.126 +                !test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.127 +                          &vc->arch.arch_vmx.cpu_state)){
  80.128 +                vmx_inject_exception(vc, TRAP_gp_fault, 0);
  80.129              }
  80.130 -            break;
  80.131 +        }
  80.132 +        if (msr_content & EFER_LME)
  80.133 +            set_bit(VMX_CPU_STATE_LME_ENABLED,
  80.134 +                    &vc->arch.arch_vmx.cpu_state);
  80.135 +        /* No update for LME/LMA since it have no effect */
  80.136 +        msr->msr_items[VMX_INDEX_MSR_EFER] =
  80.137 +            msr_content;
  80.138 +        if (msr_content & ~(EFER_LME | EFER_LMA)){
  80.139 +            msr->msr_items[VMX_INDEX_MSR_EFER] = msr_content;
  80.140 +            if (!test_bit(VMX_INDEX_MSR_EFER, &msr->flags)){ 
  80.141 +                rdmsrl(MSR_EFER,
  80.142 +                       host_state->msr_items[VMX_INDEX_MSR_EFER]);
  80.143 +                set_bit(VMX_INDEX_MSR_EFER, &host_state->flags);
  80.144 +                set_bit(VMX_INDEX_MSR_EFER, &msr->flags);  
  80.145 +                wrmsrl(MSR_EFER, msr_content);
  80.146 +            }
  80.147 +        }
  80.148 +        break;
  80.149  
  80.150 -        case MSR_FS_BASE:
  80.151 -        case MSR_GS_BASE:
  80.152 -           if (!(VMX_LONG_GUEST(vc)))
  80.153 -                domain_crash();
  80.154 -           if (!IS_CANO_ADDRESS(msr_content)){
  80.155 -               VMX_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write\n");
  80.156 -               vmx_inject_exception(vc, TRAP_gp_fault, 0);
  80.157 -           }
  80.158 -           if (regs->ecx == MSR_FS_BASE)
  80.159 -               __vmwrite(GUEST_FS_BASE, msr_content);
  80.160 -           else 
  80.161 -               __vmwrite(GUEST_GS_BASE, msr_content);
  80.162 -           break;
  80.163 +    case MSR_FS_BASE:
  80.164 +    case MSR_GS_BASE:
  80.165 +        if (!(VMX_LONG_GUEST(vc)))
  80.166 +            domain_crash();
  80.167 +        if (!IS_CANO_ADDRESS(msr_content)){
  80.168 +            VMX_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write\n");
  80.169 +            vmx_inject_exception(vc, TRAP_gp_fault, 0);
  80.170 +        }
  80.171 +        if (regs->ecx == MSR_FS_BASE)
  80.172 +            __vmwrite(GUEST_FS_BASE, msr_content);
  80.173 +        else 
  80.174 +            __vmwrite(GUEST_GS_BASE, msr_content);
  80.175 +        break;
  80.176  
  80.177 -        case MSR_SHADOW_GS_BASE:
  80.178 -           if (!(VMX_LONG_GUEST(vc)))
  80.179 -               domain_crash();
  80.180 -           vc->arch.arch_vmx.msr_content.shadow_gs = msr_content;
  80.181 -           wrmsrl(MSR_SHADOW_GS_BASE, msr_content);
  80.182 -           break;
  80.183 +    case MSR_SHADOW_GS_BASE:
  80.184 +        if (!(VMX_LONG_GUEST(vc)))
  80.185 +            domain_crash();
  80.186 +        vc->arch.arch_vmx.msr_content.shadow_gs = msr_content;
  80.187 +        wrmsrl(MSR_SHADOW_GS_BASE, msr_content);
  80.188 +        break;
  80.189  
  80.190 -           CASE_WRITE_MSR(STAR);
  80.191 -           CASE_WRITE_MSR(LSTAR);
  80.192 -           CASE_WRITE_MSR(CSTAR);
  80.193 -           CASE_WRITE_MSR(SYSCALL_MASK);
  80.194 -        default:
  80.195 -            return 0;
  80.196 +        CASE_WRITE_MSR(STAR);
  80.197 +        CASE_WRITE_MSR(LSTAR);
  80.198 +        CASE_WRITE_MSR(CSTAR);
  80.199 +        CASE_WRITE_MSR(SYSCALL_MASK);
  80.200 +    default:
  80.201 +        return 0;
  80.202      }
  80.203      return 1;
  80.204  }
  80.205 @@ -252,8 +252,8 @@ vmx_restore_msrs(struct vcpu *d)
  80.206          i = find_first_set_bit(guest_flags);
  80.207  
  80.208          VMX_DBG_LOG(DBG_LEVEL_2,
  80.209 -          "restore guest's index %d msr %lx with %lx\n",
  80.210 -          i, (unsigned long) msr_data_index[i], (unsigned long) guest_state->msr_items[i]);
  80.211 +                    "restore guest's index %d msr %lx with %lx\n",
  80.212 +                    i, (unsigned long) msr_data_index[i], (unsigned long) guest_state->msr_items[i]);
  80.213          set_bit(i, &host_state->flags);
  80.214          wrmsrl(msr_data_index[i], guest_state->msr_items[i]);
  80.215          clear_bit(i, &guest_flags);
  80.216 @@ -309,8 +309,8 @@ int start_vmx(void)
  80.217  
  80.218      if (eax & IA32_FEATURE_CONTROL_MSR_LOCK) {
  80.219          if ((eax & IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON) == 0x0) {
  80.220 -                printk("VMX disabled by Feature Control MSR.\n");
  80.221 -                return 0;
  80.222 +            printk("VMX disabled by Feature Control MSR.\n");
  80.223 +            return 0;
  80.224          }
  80.225      }
  80.226      else {
  80.227 @@ -320,16 +320,16 @@ int start_vmx(void)
  80.228      }
  80.229  
  80.230      if (!check_vmx_controls(MONITOR_PIN_BASED_EXEC_CONTROLS, 
  80.231 -            MSR_IA32_VMX_PINBASED_CTLS_MSR))
  80.232 +                            MSR_IA32_VMX_PINBASED_CTLS_MSR))
  80.233          return 0;
  80.234      if (!check_vmx_controls(MONITOR_CPU_BASED_EXEC_CONTROLS, 
  80.235 -            MSR_IA32_VMX_PROCBASED_CTLS_MSR))
  80.236 +                            MSR_IA32_VMX_PROCBASED_CTLS_MSR))
  80.237          return 0;
  80.238      if (!check_vmx_controls(MONITOR_VM_EXIT_CONTROLS, 
  80.239 -            MSR_IA32_VMX_EXIT_CTLS_MSR))
  80.240 +                            MSR_IA32_VMX_EXIT_CTLS_MSR))
  80.241          return 0;
  80.242      if (!check_vmx_controls(MONITOR_VM_ENTRY_CONTROLS, 
  80.243 -            MSR_IA32_VMX_ENTRY_CTLS_MSR))
  80.244 +                            MSR_IA32_VMX_ENTRY_CTLS_MSR))
  80.245          return 0;
  80.246  
  80.247      set_in_cr4(X86_CR4_VMXE);   /* Enable VMXE */
  80.248 @@ -385,8 +385,8 @@ static int vmx_do_page_fault(unsigned lo
  80.249      {
  80.250          __vmread(GUEST_RIP, &eip);
  80.251          VMX_DBG_LOG(DBG_LEVEL_VMMU, 
  80.252 -                "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
  80.253 -                va, eip, (unsigned long)regs->error_code);
  80.254 +                    "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
  80.255 +                    va, eip, (unsigned long)regs->error_code);
  80.256      }
  80.257  #endif
  80.258  
  80.259 @@ -478,8 +478,8 @@ static void vmx_vmexit_do_cpuid(unsigned
  80.260      regs->edx = (unsigned long) edx;
  80.261  
  80.262      VMX_DBG_LOG(DBG_LEVEL_1, 
  80.263 -            "vmx_vmexit_do_cpuid: eip: %lx, input: %lx, out:eax=%x, ebx=%x, ecx=%x, edx=%x",
  80.264 -            eip, input, eax, ebx, ecx, edx);
  80.265 +                "vmx_vmexit_do_cpuid: eip: %lx, input: %lx, out:eax=%x, ebx=%x, ecx=%x, edx=%x",
  80.266 +                eip, input, eax, ebx, ecx, edx);
  80.267  
  80.268  }
  80.269  
  80.270 @@ -607,7 +607,7 @@ static int check_for_null_selector(unsig
  80.271  }
  80.272  
  80.273  void send_pio_req(struct cpu_user_regs *regs, unsigned long port,
  80.274 -       unsigned long count, int size, long value, int dir, int pvalid)
  80.275 +                  unsigned long count, int size, long value, int dir, int pvalid)
  80.276  {
  80.277      struct vcpu *v = current;
  80.278      vcpu_iodata_t *vio;
  80.279 @@ -620,8 +620,8 @@ void send_pio_req(struct cpu_user_regs *
  80.280      }
  80.281  
  80.282      if (test_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags)) {
  80.283 -       printf("VMX I/O has not yet completed\n");
  80.284 -       domain_crash_synchronous();
  80.285 +        printf("VMX I/O has not yet completed\n");
  80.286 +        domain_crash_synchronous();
  80.287      }
  80.288      set_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags);
  80.289  
  80.290 @@ -656,7 +656,7 @@ void send_pio_req(struct cpu_user_regs *
  80.291  }
  80.292  
  80.293  static void vmx_io_instruction(struct cpu_user_regs *regs, 
  80.294 -                   unsigned long exit_qualification, unsigned long inst_len) 
  80.295 +                               unsigned long exit_qualification, unsigned long inst_len) 
  80.296  {
  80.297      struct mi_per_cpu_info *mpcip;
  80.298      unsigned long eip, cs, eflags;
  80.299 @@ -686,10 +686,10 @@ static void vmx_io_instruction(struct cp
  80.300      dir = test_bit(3, &exit_qualification); /* direction */
  80.301  
  80.302      if (test_bit(4, &exit_qualification)) { /* string instruction */
  80.303 -	unsigned long addr, count = 1;
  80.304 -	int sign = regs->eflags & EF_DF ? -1 : 1;
  80.305 +        unsigned long addr, count = 1;
  80.306 +        int sign = regs->eflags & EF_DF ? -1 : 1;
  80.307  
  80.308 -	__vmread(GUEST_LINEAR_ADDRESS, &addr);
  80.309 +        __vmread(GUEST_LINEAR_ADDRESS, &addr);
  80.310  
  80.311          /*
  80.312           * In protected mode, guest linear address is invalid if the
  80.313 @@ -699,35 +699,35 @@ static void vmx_io_instruction(struct cp
  80.314              addr = dir == IOREQ_WRITE ? regs->esi : regs->edi;
  80.315  
  80.316          if (test_bit(5, &exit_qualification)) { /* "rep" prefix */
  80.317 -	    mpcip->flags |= REPZ;
  80.318 -	    count = vm86 ? regs->ecx & 0xFFFF : regs->ecx;
  80.319 -	}
  80.320 +            mpcip->flags |= REPZ;
  80.321 +            count = vm86 ? regs->ecx & 0xFFFF : regs->ecx;
  80.322 +        }
  80.323  
  80.324 -	/*
  80.325 -	 * Handle string pio instructions that cross pages or that
  80.326 -	 * are unaligned. See the comments in vmx_platform.c/handle_mmio()
  80.327 -	 */
  80.328 -	if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) {
  80.329 -	    unsigned long value = 0;
  80.330 +        /*
  80.331 +         * Handle string pio instructions that cross pages or that
  80.332 +         * are unaligned. See the comments in vmx_platform.c/handle_mmio()
  80.333 +         */
  80.334 +        if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) {
  80.335 +            unsigned long value = 0;
  80.336  
  80.337 -	    mpcip->flags |= OVERLAP;
  80.338 -	    if (dir == IOREQ_WRITE)
  80.339 -		vmx_copy(&value, addr, size, VMX_COPY_IN);
  80.340 -	    send_pio_req(regs, port, 1, size, value, dir, 0);
  80.341 -	} else {
  80.342 -	    if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) {
  80.343 +            mpcip->flags |= OVERLAP;
  80.344 +            if (dir == IOREQ_WRITE)
  80.345 +                vmx_copy(&value, addr, size, VMX_COPY_IN);
  80.346 +            send_pio_req(regs, port, 1, size, value, dir, 0);
  80.347 +        } else {
  80.348 +            if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) {
  80.349                  if (sign > 0)
  80.350                      count = (PAGE_SIZE - (addr & ~PAGE_MASK)) / size;
  80.351                  else
  80.352                      count = (addr & ~PAGE_MASK) / size;
  80.353 -	    } else
  80.354 -		__update_guest_eip(inst_len);
  80.355 +            } else
  80.356 +                __update_guest_eip(inst_len);
  80.357  
  80.358 -	    send_pio_req(regs, port, count, size, addr, dir, 1);
  80.359 -	}
  80.360 +            send_pio_req(regs, port, count, size, addr, dir, 1);
  80.361 +        }
  80.362      } else {
  80.363          __update_guest_eip(inst_len);
  80.364 -	send_pio_req(regs, port, 1, size, regs->eax, dir, 0);
  80.365 +        send_pio_req(regs, port, 1, size, regs->eax, dir, 0);
  80.366      }
  80.367  }
  80.368  
  80.369 @@ -739,30 +739,30 @@ vmx_copy(void *buf, unsigned long laddr,
  80.370      int count;
  80.371  
  80.372      while (size > 0) {
  80.373 -	count = PAGE_SIZE - (laddr & ~PAGE_MASK);
  80.374 -	if (count > size)
  80.375 -	    count = size;
  80.376 -
  80.377 -	if (vmx_paging_enabled(current)) {
  80.378 -		gpa = gva_to_gpa(laddr);
  80.379 -		mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
  80.380 -	} else
  80.381 -		mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
  80.382 -	if (mfn == INVALID_MFN)
  80.383 -		return 0;
  80.384 +        count = PAGE_SIZE - (laddr & ~PAGE_MASK);
  80.385 +        if (count > size)
  80.386 +            count = size;
  80.387  
  80.388 -	addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
  80.389 +        if (vmx_paging_enabled(current)) {
  80.390 +            gpa = gva_to_gpa(laddr);
  80.391 +            mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
  80.392 +        } else
  80.393 +            mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
  80.394 +        if (mfn == INVALID_MFN)
  80.395 +            return 0;
  80.396  
  80.397 -	if (dir == VMX_COPY_IN)
  80.398 -	    memcpy(buf, addr, count);
  80.399 -	else
  80.400 -	    memcpy(addr, buf, count);
  80.401 +        addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
  80.402  
  80.403 -	unmap_domain_page(addr);
  80.404 +        if (dir == VMX_COPY_IN)
  80.405 +            memcpy(buf, addr, count);
  80.406 +        else
  80.407 +            memcpy(addr, buf, count);
  80.408  
  80.409 -	laddr += count;
  80.410 -	buf += count;
  80.411 -	size -= count;
  80.412 +        unmap_domain_page(addr);
  80.413 +
  80.414 +        laddr += count;
  80.415 +        buf += count;
  80.416 +        size -= count;
  80.417      }
  80.418  
  80.419      return 1;
  80.420 @@ -846,47 +846,47 @@ vmx_world_restore(struct vcpu *d, struct
  80.421      error |= __vmwrite(CR0_READ_SHADOW, c->cr0);
  80.422  
  80.423      if (!vmx_paging_enabled(d)) {
  80.424 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "switching to vmxassist. use phys table");
  80.425 -	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->domain->arch.phys_table));
  80.426 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "switching to vmxassist. use phys table");
  80.427 +        __vmwrite(GUEST_CR3, pagetable_get_paddr(d->domain->arch.phys_table));
  80.428          goto skip_cr3;
  80.429      }
  80.430  
  80.431      if (c->cr3 == d->arch.arch_vmx.cpu_cr3) {
  80.432 -	/* 
  80.433 -	 * This is simple TLB flush, implying the guest has 
  80.434 -	 * removed some translation or changed page attributes.
  80.435 -	 * We simply invalidate the shadow.
  80.436 -	 */
  80.437 -	mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
  80.438 -	if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
  80.439 -	    printk("Invalid CR3 value=%x", c->cr3);
  80.440 -	    domain_crash_synchronous();
  80.441 -	    return 0;
  80.442 -	}
  80.443 -	shadow_sync_all(d->domain);
  80.444 +        /* 
  80.445 +         * This is simple TLB flush, implying the guest has 
  80.446 +         * removed some translation or changed page attributes.
  80.447 +         * We simply invalidate the shadow.
  80.448 +         */
  80.449 +        mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
  80.450 +        if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
  80.451 +            printk("Invalid CR3 value=%x", c->cr3);
  80.452 +            domain_crash_synchronous();
  80.453 +            return 0;
  80.454 +        }
  80.455 +        shadow_sync_all(d->domain);
  80.456      } else {
  80.457 -	/*
  80.458 -	 * If different, make a shadow. Check if the PDBR is valid
  80.459 -	 * first.
  80.460 -	 */
  80.461 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
  80.462 -	if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
  80.463 -	    printk("Invalid CR3 value=%x", c->cr3);
  80.464 -	    domain_crash_synchronous(); 
  80.465 -	    return 0;
  80.466 -	}
  80.467 -	mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
  80.468 -	d->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
  80.469 -	update_pagetables(d);
  80.470 -	/* 
  80.471 -	 * arch.shadow_table should now hold the next CR3 for shadow
  80.472 -	 */
  80.473 -	d->arch.arch_vmx.cpu_cr3 = c->cr3;
  80.474 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
  80.475 -	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
  80.476 +        /*
  80.477 +         * If different, make a shadow. Check if the PDBR is valid
  80.478 +         * first.
  80.479 +         */
  80.480 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
  80.481 +        if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
  80.482 +            printk("Invalid CR3 value=%x", c->cr3);
  80.483 +            domain_crash_synchronous(); 
  80.484 +            return 0;
  80.485 +        }
  80.486 +        mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
  80.487 +        d->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
  80.488 +        update_pagetables(d);
  80.489 +        /* 
  80.490 +         * arch.shadow_table should now hold the next CR3 for shadow
  80.491 +         */
  80.492 +        d->arch.arch_vmx.cpu_cr3 = c->cr3;
  80.493 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
  80.494 +        __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
  80.495      }
  80.496  
  80.497 -skip_cr3:
  80.498 + skip_cr3:
  80.499  
  80.500      error |= __vmread(CR4_READ_SHADOW, &old_cr4);
  80.501      error |= __vmwrite(GUEST_CR4, (c->cr4 | VMX_CR4_HOST_MASK));
  80.502 @@ -952,59 +952,59 @@ vmx_assist(struct vcpu *d, int mode)
  80.503  
  80.504      /* make sure vmxassist exists (this is not an error) */
  80.505      if (!vmx_copy(&magic, VMXASSIST_MAGIC_OFFSET, sizeof(magic), VMX_COPY_IN))
  80.506 -    	return 0;
  80.507 +        return 0;
  80.508      if (magic != VMXASSIST_MAGIC)
  80.509 -    	return 0;
  80.510 +        return 0;
  80.511  
  80.512      switch (mode) {
  80.513 -    /*
  80.514 -     * Transfer control to vmxassist.
  80.515 -     * Store the current context in VMXASSIST_OLD_CONTEXT and load
  80.516 -     * the new VMXASSIST_NEW_CONTEXT context. This context was created
  80.517 -     * by vmxassist and will transfer control to it.
  80.518 -     */
  80.519 +        /*
  80.520 +         * Transfer control to vmxassist.
  80.521 +         * Store the current context in VMXASSIST_OLD_CONTEXT and load
  80.522 +         * the new VMXASSIST_NEW_CONTEXT context. This context was created
  80.523 +         * by vmxassist and will transfer control to it.
  80.524 +         */
  80.525      case VMX_ASSIST_INVOKE:
  80.526 -	/* save the old context */
  80.527 -	if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.528 -    	    goto error;
  80.529 -	if (cp != 0) {
  80.530 -    	    if (!vmx_world_save(d, &c))
  80.531 -		goto error;
  80.532 -	    if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_OUT))
  80.533 -		goto error;
  80.534 -	}
  80.535 +        /* save the old context */
  80.536 +        if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.537 +            goto error;
  80.538 +        if (cp != 0) {
  80.539 +            if (!vmx_world_save(d, &c))
  80.540 +                goto error;
  80.541 +            if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_OUT))
  80.542 +                goto error;
  80.543 +        }
  80.544  
  80.545 -	/* restore the new context, this should activate vmxassist */
  80.546 -	if (!vmx_copy(&cp, VMXASSIST_NEW_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.547 -	    goto error;
  80.548 -	if (cp != 0) {
  80.549 +        /* restore the new context, this should activate vmxassist */
  80.550 +        if (!vmx_copy(&cp, VMXASSIST_NEW_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.551 +            goto error;
  80.552 +        if (cp != 0) {
  80.553              if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_IN))
  80.554 -		goto error;
  80.555 -    	    if (!vmx_world_restore(d, &c))
  80.556 -		goto error;
  80.557 -    	    return 1;
  80.558 -	}
  80.559 -	break;
  80.560 +                goto error;
  80.561 +            if (!vmx_world_restore(d, &c))
  80.562 +                goto error;
  80.563 +            return 1;
  80.564 +        }
  80.565 +        break;
  80.566  
  80.567 -    /*
  80.568 -     * Restore the VMXASSIST_OLD_CONTEXT that was saved by VMX_ASSIST_INVOKE
  80.569 -     * above.
  80.570 -     */
  80.571 +        /*
  80.572 +         * Restore the VMXASSIST_OLD_CONTEXT that was saved by VMX_ASSIST_INVOKE
  80.573 +         * above.
  80.574 +         */
  80.575      case VMX_ASSIST_RESTORE:
  80.576 -	/* save the old context */
  80.577 -	if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.578 -    	    goto error;
  80.579 -	if (cp != 0) {
  80.580 +        /* save the old context */
  80.581 +        if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
  80.582 +            goto error;
  80.583 +        if (cp != 0) {
  80.584              if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_IN))
  80.585 -		goto error;
  80.586 -    	    if (!vmx_world_restore(d, &c))
  80.587 -		goto error;
  80.588 -	    return 1;
  80.589 -	}
  80.590 -	break;
  80.591 +                goto error;
  80.592 +            if (!vmx_world_restore(d, &c))
  80.593 +                goto error;
  80.594 +            return 1;
  80.595 +        }
  80.596 +        break;
  80.597      }
  80.598  
  80.599 -error:
  80.600 + error:
  80.601      printf("Failed to transfer to vmxassist\n");
  80.602      domain_crash_synchronous(); 
  80.603      return 0;
  80.604 @@ -1031,7 +1031,7 @@ static int vmx_set_cr0(unsigned long val
  80.605           * The guest CR3 must be pointing to the guest physical.
  80.606           */
  80.607          if ( !VALID_MFN(mfn = get_mfn_from_pfn(
  80.608 -                            d->arch.arch_vmx.cpu_cr3 >> PAGE_SHIFT)) ||
  80.609 +            d->arch.arch_vmx.cpu_cr3 >> PAGE_SHIFT)) ||
  80.610               !get_page(pfn_to_page(mfn), d->domain) )
  80.611          {
  80.612              printk("Invalid CR3 value = %lx", d->arch.arch_vmx.cpu_cr3);
  80.613 @@ -1040,18 +1040,18 @@ static int vmx_set_cr0(unsigned long val
  80.614  
  80.615  #if defined(__x86_64__)
  80.616          if (test_bit(VMX_CPU_STATE_LME_ENABLED,
  80.617 -              &d->arch.arch_vmx.cpu_state) &&
  80.618 -          !test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.619 -              &d->arch.arch_vmx.cpu_state)){
  80.620 +                     &d->arch.arch_vmx.cpu_state) &&
  80.621 +            !test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.622 +                      &d->arch.arch_vmx.cpu_state)){
  80.623              VMX_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE enable\n");
  80.624              vmx_inject_exception(d, TRAP_gp_fault, 0);
  80.625          }
  80.626          if (test_bit(VMX_CPU_STATE_LME_ENABLED,
  80.627 -              &d->arch.arch_vmx.cpu_state)){
  80.628 +                     &d->arch.arch_vmx.cpu_state)){
  80.629              /* Here the PAE is should to be opened */
  80.630              VMX_DBG_LOG(DBG_LEVEL_1, "Enable the Long mode\n");
  80.631              set_bit(VMX_CPU_STATE_LMA_ENABLED,
  80.632 -              &d->arch.arch_vmx.cpu_state);
  80.633 +                    &d->arch.arch_vmx.cpu_state);
  80.634              __vmread(VM_ENTRY_CONTROLS, &vm_entry_value);
  80.635              vm_entry_value |= VM_ENTRY_CONTROLS_IA32E_MODE;
  80.636              __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
  80.637 @@ -1073,20 +1073,15 @@ static int vmx_set_cr0(unsigned long val
  80.638  #endif
  80.639          }
  80.640  
  80.641 -	unsigned long crn;
  80.642 +        unsigned long crn;
  80.643          /* update CR4's PAE if needed */
  80.644          __vmread(GUEST_CR4, &crn);
  80.645          if ( (!(crn & X86_CR4_PAE)) &&
  80.646 -          test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.647 -              &d->arch.arch_vmx.cpu_state)){
  80.648 +             test_bit(VMX_CPU_STATE_PAE_ENABLED,
  80.649 +                      &d->arch.arch_vmx.cpu_state)){
  80.650              VMX_DBG_LOG(DBG_LEVEL_1, "enable PAE on cr4\n");
  80.651              __vmwrite(GUEST_CR4, crn | X86_CR4_PAE);
  80.652          }
  80.653 -#elif defined( __i386__)
  80.654 -       	unsigned long old_base_mfn;
  80.655 -        old_base_mfn = pagetable_get_pfn(d->arch.guest_table);
  80.656 -        if (old_base_mfn)
  80.657 -            put_page(pfn_to_page(old_base_mfn));
  80.658  #endif
  80.659          /*
  80.660           * Now arch.guest_table points to machine physical.
  80.661 @@ -1095,14 +1090,14 @@ static int vmx_set_cr0(unsigned long val
  80.662          update_pagetables(d);
  80.663  
  80.664          VMX_DBG_LOG(DBG_LEVEL_VMMU, "New arch.guest_table = %lx", 
  80.665 -                (unsigned long) (mfn << PAGE_SHIFT));
  80.666 +                    (unsigned long) (mfn << PAGE_SHIFT));
  80.667  
  80.668          __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
  80.669          /* 
  80.670           * arch->shadow_table should hold the next CR3 for shadow
  80.671           */
  80.672          VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx, mfn = %lx", 
  80.673 -                d->arch.arch_vmx.cpu_cr3, mfn);
  80.674 +                    d->arch.arch_vmx.cpu_cr3, mfn);
  80.675      }
  80.676  
  80.677      /*
  80.678 @@ -1129,29 +1124,29 @@ static int vmx_set_cr0(unsigned long val
  80.679                  __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
  80.680              }
  80.681          }
  80.682 -	__vmread(GUEST_RIP, &eip);
  80.683 -	VMX_DBG_LOG(DBG_LEVEL_1,
  80.684 -	    "Disabling CR0.PE at %%eip 0x%lx\n", eip);
  80.685 -	if (vmx_assist(d, VMX_ASSIST_INVOKE)) {
  80.686 -	    set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &d->arch.arch_vmx.cpu_state);
  80.687 -	    __vmread(GUEST_RIP, &eip);
  80.688 -	    VMX_DBG_LOG(DBG_LEVEL_1,
  80.689 -		"Transfering control to vmxassist %%eip 0x%lx\n", eip);
  80.690 -	    return 0; /* do not update eip! */
  80.691 -	}
  80.692 +        __vmread(GUEST_RIP, &eip);
  80.693 +        VMX_DBG_LOG(DBG_LEVEL_1,
  80.694 +                    "Disabling CR0.PE at %%eip 0x%lx\n", eip);
  80.695 +        if (vmx_assist(d, VMX_ASSIST_INVOKE)) {
  80.696 +            set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &d->arch.arch_vmx.cpu_state);
  80.697 +            __vmread(GUEST_RIP, &eip);
  80.698 +            VMX_DBG_LOG(DBG_LEVEL_1,
  80.699 +                        "Transfering control to vmxassist %%eip 0x%lx\n", eip);
  80.700 +            return 0; /* do not update eip! */
  80.701 +        }
  80.702      } else if (test_bit(VMX_CPU_STATE_ASSIST_ENABLED,
  80.703 -					&d->arch.arch_vmx.cpu_state)) {
  80.704 -	__vmread(GUEST_RIP, &eip);
  80.705 -	VMX_DBG_LOG(DBG_LEVEL_1,
  80.706 -	    "Enabling CR0.PE at %%eip 0x%lx\n", eip);
  80.707 -	if (vmx_assist(d, VMX_ASSIST_RESTORE)) {
  80.708 -	    clear_bit(VMX_CPU_STATE_ASSIST_ENABLED,
  80.709 -					&d->arch.arch_vmx.cpu_state);
  80.710 -	    __vmread(GUEST_RIP, &eip);
  80.711 -	    VMX_DBG_LOG(DBG_LEVEL_1,
  80.712 -		"Restoring to %%eip 0x%lx\n", eip);
  80.713 -	    return 0; /* do not update eip! */
  80.714 -	}
  80.715 +                        &d->arch.arch_vmx.cpu_state)) {
  80.716 +        __vmread(GUEST_RIP, &eip);
  80.717 +        VMX_DBG_LOG(DBG_LEVEL_1,
  80.718 +                    "Enabling CR0.PE at %%eip 0x%lx\n", eip);
  80.719 +        if (vmx_assist(d, VMX_ASSIST_RESTORE)) {
  80.720 +            clear_bit(VMX_CPU_STATE_ASSIST_ENABLED,
  80.721 +                      &d->arch.arch_vmx.cpu_state);
  80.722 +            __vmread(GUEST_RIP, &eip);
  80.723 +            VMX_DBG_LOG(DBG_LEVEL_1,
  80.724 +                        "Restoring to %%eip 0x%lx\n", eip);
  80.725 +            return 0; /* do not update eip! */
  80.726 +        }
  80.727      }
  80.728  
  80.729      return 1;
  80.730 @@ -1198,8 +1193,8 @@ static int mov_to_cr(int gp, int cr, str
  80.731          CASE_GET_REG(ESI, esi);
  80.732          CASE_GET_REG(EDI, edi);
  80.733          CASE_EXTEND_GET_REG
  80.734 -    case REG_ESP:
  80.735 -        __vmread(GUEST_RSP, &value);
  80.736 +            case REG_ESP:
  80.737 +                __vmread(GUEST_RSP, &value);
  80.738          break;
  80.739      default:
  80.740          printk("invalid gp: %d\n", gp);
  80.741 @@ -1212,7 +1207,7 @@ static int mov_to_cr(int gp, int cr, str
  80.742      switch(cr) {
  80.743      case 0: 
  80.744      {
  80.745 -	return vmx_set_cr0(value);
  80.746 +        return vmx_set_cr0(value);
  80.747      }
  80.748      case 3: 
  80.749      {
  80.750 @@ -1262,7 +1257,7 @@ static int mov_to_cr(int gp, int cr, str
  80.751               */
  80.752              d->arch.arch_vmx.cpu_cr3 = value;
  80.753              VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx",
  80.754 -                    value);
  80.755 +                        value);
  80.756              __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
  80.757          }
  80.758          break;
  80.759 @@ -1332,8 +1327,8 @@ static void mov_from_cr(int cr, int gp, 
  80.760          CASE_SET_REG(ESI, esi);
  80.761          CASE_SET_REG(EDI, edi);
  80.762          CASE_EXTEND_SET_REG
  80.763 -    case REG_ESP:
  80.764 -        __vmwrite(GUEST_RSP, value);
  80.765 +            case REG_ESP:
  80.766 +                __vmwrite(GUEST_RSP, value);
  80.767          regs->esp = value;
  80.768          break;
  80.769      default:
  80.770 @@ -1381,9 +1376,9 @@ static int vmx_cr_access(unsigned long e
  80.771      case TYPE_LMSW:
  80.772          TRACE_VMEXIT(1,TYPE_LMSW);
  80.773          __vmread(CR0_READ_SHADOW, &value);
  80.774 -	value = (value & ~0xF) |
  80.775 -		(((exit_qualification & LMSW_SOURCE_DATA) >> 16) & 0xF);
  80.776 -	return vmx_set_cr0(value);
  80.777 +        value = (value & ~0xF) |
  80.778 +            (((exit_qualification & LMSW_SOURCE_DATA) >> 16) & 0xF);
  80.779 +        return vmx_set_cr0(value);
  80.780          break;
  80.781      default:
  80.782          __vmx_bug(regs);
  80.783 @@ -1394,29 +1389,31 @@ static int vmx_cr_access(unsigned long e
  80.784  
  80.785  static inline void vmx_do_msr_read(struct cpu_user_regs *regs)
  80.786  {
  80.787 +    u64 msr_content = 0;
  80.788 +
  80.789      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read: ecx=%lx, eax=%lx, edx=%lx",
  80.790                  (unsigned long)regs->ecx, (unsigned long)regs->eax, 
  80.791                  (unsigned long)regs->edx);
  80.792      switch (regs->ecx) {
  80.793 -        case MSR_IA32_SYSENTER_CS:
  80.794 -            __vmread(GUEST_SYSENTER_CS, &regs->eax);
  80.795 -            regs->edx = 0;
  80.796 -            break;
  80.797 -        case MSR_IA32_SYSENTER_ESP:	
  80.798 -             __vmread(GUEST_SYSENTER_ESP, &regs->eax);
  80.799 -             regs->edx = 0;
  80.800 -            break;
  80.801 -        case MSR_IA32_SYSENTER_EIP:		
  80.802 -            __vmread(GUEST_SYSENTER_EIP, &regs->eax);
  80.803 -            regs->edx = 0;
  80.804 -            break;
  80.805 -        default:
  80.806 -            if(long_mode_do_msr_read(regs))
  80.807 -                return;
  80.808 -            rdmsr_user(regs->ecx, regs->eax, regs->edx);
  80.809 -            break;
  80.810 +    case MSR_IA32_SYSENTER_CS:
  80.811 +        __vmread(GUEST_SYSENTER_CS, (u32 *)&msr_content);
  80.812 +        break;
  80.813 +    case MSR_IA32_SYSENTER_ESP:
  80.814 +        __vmread(GUEST_SYSENTER_ESP, &msr_content);
  80.815 +        break;
  80.816 +    case MSR_IA32_SYSENTER_EIP:
  80.817 +        __vmread(GUEST_SYSENTER_EIP, &msr_content);
  80.818 +        break;
  80.819 +    default:
  80.820 +        if(long_mode_do_msr_read(regs))
  80.821 +            return;
  80.822 +        rdmsr_user(regs->ecx, regs->eax, regs->edx);
  80.823 +        break;
  80.824      }
  80.825  
  80.826 +    regs->eax = msr_content & 0xFFFFFFFF;
  80.827 +    regs->edx = msr_content >> 32;
  80.828 +
  80.829      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read returns: "
  80.830                  "ecx=%lx, eax=%lx, edx=%lx",
  80.831                  (unsigned long)regs->ecx, (unsigned long)regs->eax,
  80.832 @@ -1425,22 +1422,27 @@ static inline void vmx_do_msr_read(struc
  80.833  
  80.834  static inline void vmx_do_msr_write(struct cpu_user_regs *regs)
  80.835  {
  80.836 +    u64 msr_content;
  80.837 +
  80.838      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write: ecx=%lx, eax=%lx, edx=%lx",
  80.839                  (unsigned long)regs->ecx, (unsigned long)regs->eax, 
  80.840                  (unsigned long)regs->edx);
  80.841 +
  80.842 +    msr_content = (regs->eax & 0xFFFFFFFF) | ((u64)regs->edx << 32);
  80.843 +
  80.844      switch (regs->ecx) {
  80.845 -        case MSR_IA32_SYSENTER_CS:
  80.846 -            __vmwrite(GUEST_SYSENTER_CS, regs->eax);
  80.847 -            break;
  80.848 -        case MSR_IA32_SYSENTER_ESP:	
  80.849 -             __vmwrite(GUEST_SYSENTER_ESP, regs->eax);
  80.850 -            break;
  80.851 -        case MSR_IA32_SYSENTER_EIP:		
  80.852 -            __vmwrite(GUEST_SYSENTER_EIP, regs->eax);
  80.853 -            break;
  80.854 -        default:
  80.855 -            long_mode_do_msr_write(regs);
  80.856 -            break;
  80.857 +    case MSR_IA32_SYSENTER_CS:
  80.858 +        __vmwrite(GUEST_SYSENTER_CS, msr_content);
  80.859 +        break;
  80.860 +    case MSR_IA32_SYSENTER_ESP:
  80.861 +        __vmwrite(GUEST_SYSENTER_ESP, msr_content);
  80.862 +        break;
  80.863 +    case MSR_IA32_SYSENTER_EIP:
  80.864 +        __vmwrite(GUEST_SYSENTER_EIP, msr_content);
  80.865 +        break;
  80.866 +    default:
  80.867 +        long_mode_do_msr_write(regs);
  80.868 +        break;
  80.869      }
  80.870  
  80.871      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write returns: "
  80.872 @@ -1484,28 +1486,28 @@ static inline void vmx_vmexit_do_extint(
  80.873      local_irq_disable();
  80.874  
  80.875      switch(vector) {
  80.876 -        case LOCAL_TIMER_VECTOR:
  80.877 -            smp_apic_timer_interrupt(regs);
  80.878 -            break;
  80.879 -        case EVENT_CHECK_VECTOR:
  80.880 -            smp_event_check_interrupt();
  80.881 -            break;
  80.882 -        case INVALIDATE_TLB_VECTOR:
  80.883 -            smp_invalidate_interrupt();
  80.884 -            break;
  80.885 -        case CALL_FUNCTION_VECTOR:
  80.886 -            smp_call_function_interrupt();
  80.887 -            break;
  80.888 -        case SPURIOUS_APIC_VECTOR:
  80.889 -            smp_spurious_interrupt(regs);
  80.890 -            break;
  80.891 -        case ERROR_APIC_VECTOR:
  80.892 -            smp_error_interrupt(regs);
  80.893 -            break;
  80.894 -        default:
  80.895 -            regs->entry_vector = vector;
  80.896 -            do_IRQ(regs);
  80.897 -            break;
  80.898 +    case LOCAL_TIMER_VECTOR:
  80.899 +        smp_apic_timer_interrupt(regs);
  80.900 +        break;
  80.901 +    case EVENT_CHECK_VECTOR:
  80.902 +        smp_event_check_interrupt();
  80.903 +        break;
  80.904 +    case INVALIDATE_TLB_VECTOR:
  80.905 +        smp_invalidate_interrupt();
  80.906 +        break;
  80.907 +    case CALL_FUNCTION_VECTOR:
  80.908 +        smp_call_function_interrupt();
  80.909 +        break;
  80.910 +    case SPURIOUS_APIC_VECTOR:
  80.911 +        smp_spurious_interrupt(regs);
  80.912 +        break;
  80.913 +    case ERROR_APIC_VECTOR:
  80.914 +        smp_error_interrupt(regs);
  80.915 +        break;
  80.916 +    default:
  80.917 +        regs->entry_vector = vector;
  80.918 +        do_IRQ(regs);
  80.919 +        break;
  80.920      }
  80.921  }
  80.922  
  80.923 @@ -1597,17 +1599,17 @@ asmlinkage void vmx_vmexit_handler(struc
  80.924  
  80.925      __vmread(IDT_VECTORING_INFO_FIELD, &idtv_info_field);
  80.926      if (idtv_info_field & INTR_INFO_VALID_MASK) {
  80.927 -	__vmwrite(VM_ENTRY_INTR_INFO_FIELD, idtv_info_field);
  80.928 +        __vmwrite(VM_ENTRY_INTR_INFO_FIELD, idtv_info_field);
  80.929  
  80.930 -	__vmread(VM_EXIT_INSTRUCTION_LEN, &inst_len);
  80.931 -	if (inst_len >= 1 && inst_len <= 15) 
  80.932 -	    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, inst_len);
  80.933 +        __vmread(VM_EXIT_INSTRUCTION_LEN, &inst_len);
  80.934 +        if (inst_len >= 1 && inst_len <= 15) 
  80.935 +            __vmwrite(VM_ENTRY_INSTRUCTION_LEN, inst_len);
  80.936  
  80.937 -	if (idtv_info_field & 0x800) { /* valid error code */
  80.938 -	    unsigned long error_code;
  80.939 -	    __vmread(IDT_VECTORING_ERROR_CODE, &error_code);
  80.940 -	    __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
  80.941 -	} 
  80.942 +        if (idtv_info_field & 0x800) { /* valid error code */
  80.943 +            unsigned long error_code;
  80.944 +            __vmread(IDT_VECTORING_ERROR_CODE, &error_code);
  80.945 +            __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
  80.946 +        } 
  80.947  
  80.948          VMX_DBG_LOG(DBG_LEVEL_1, "idtv_info_field=%x", idtv_info_field);
  80.949      }
  80.950 @@ -1645,7 +1647,7 @@ asmlinkage void vmx_vmexit_handler(struc
  80.951              __vmx_bug(&regs);
  80.952          vector &= 0xff;
  80.953  
  80.954 -	 TRACE_VMEXIT(1,vector);
  80.955 +        TRACE_VMEXIT(1,vector);
  80.956          perfc_incra(cause_vector, vector);
  80.957  
  80.958          TRACE_3D(TRC_VMX_VECTOR, v->domain->domain_id, eip, vector);
  80.959 @@ -1691,8 +1693,8 @@ asmlinkage void vmx_vmexit_handler(struc
  80.960              __vmread(EXIT_QUALIFICATION, &va);
  80.961              __vmread(VM_EXIT_INTR_ERROR_CODE, &regs.error_code);
  80.962              
  80.963 -	    TRACE_VMEXIT(3,regs.error_code);
  80.964 -	    TRACE_VMEXIT(4,va);
  80.965 +            TRACE_VMEXIT(3,regs.error_code);
  80.966 +            TRACE_VMEXIT(4,va);
  80.967  
  80.968              VMX_DBG_LOG(DBG_LEVEL_VMMU, 
  80.969                          "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
  80.970 @@ -1725,7 +1727,7 @@ asmlinkage void vmx_vmexit_handler(struc
  80.971          break;
  80.972      case EXIT_REASON_PENDING_INTERRUPT:
  80.973          __vmwrite(CPU_BASED_VM_EXEC_CONTROL, 
  80.974 -              MONITOR_CPU_BASED_EXEC_CONTROLS);
  80.975 +                  MONITOR_CPU_BASED_EXEC_CONTROLS);
  80.976          break;
  80.977      case EXIT_REASON_TASK_SWITCH:
  80.978          __vmx_bug(&regs);
  80.979 @@ -1765,10 +1767,10 @@ asmlinkage void vmx_vmexit_handler(struc
  80.980          __vmread(EXIT_QUALIFICATION, &exit_qualification);
  80.981  
  80.982          VMX_DBG_LOG(DBG_LEVEL_1, "eip = %lx, inst_len =%lx, exit_qualification = %lx", 
  80.983 -                eip, inst_len, exit_qualification);
  80.984 +                    eip, inst_len, exit_qualification);
  80.985          if (vmx_cr_access(exit_qualification, &regs))
  80.986 -	    __update_guest_eip(inst_len);
  80.987 -	 TRACE_VMEXIT(3,regs.error_code);
  80.988 +            __update_guest_eip(inst_len);
  80.989 +        TRACE_VMEXIT(3,regs.error_code);
  80.990          TRACE_VMEXIT(4,exit_qualification);
  80.991          break;
  80.992      }
  80.993 @@ -1821,8 +1823,8 @@ asmlinkage void load_cr2(void)
  80.994  asmlinkage void trace_vmentry (void)
  80.995  {
  80.996      TRACE_5D(TRC_VMENTRY,trace_values[current->processor][0],
  80.997 -          trace_values[current->processor][1],trace_values[current->processor][2],
  80.998 -          trace_values[current->processor][3],trace_values[current->processor][4]);
  80.999 +             trace_values[current->processor][1],trace_values[current->processor][2],
 80.1000 +             trace_values[current->processor][3],trace_values[current->processor][4]);
 80.1001      TRACE_VMEXIT(0,9);
 80.1002      TRACE_VMEXIT(1,9);
 80.1003      TRACE_VMEXIT(2,9);
    81.1 --- a/xen/arch/x86/vmx_intercept.c	Fri Sep 09 10:31:36 2005 -0600
    81.2 +++ b/xen/arch/x86/vmx_intercept.c	Tue Sep 13 10:14:16 2005 -0600
    81.3 @@ -45,8 +45,8 @@ int vmx_io_intercept(ioreq_t *p, int typ
    81.4          addr   = handler->hdl_list[i].addr;
    81.5          offset = handler->hdl_list[i].offset;
    81.6          if (p->addr >= addr &&
    81.7 -	    p->addr <  addr + offset)
    81.8 -	    return handler->hdl_list[i].action(p);
    81.9 +            p->addr <  addr + offset)
   81.10 +            return handler->hdl_list[i].action(p);
   81.11      }
   81.12      return 0;
   81.13  }
   81.14 @@ -172,22 +172,22 @@ int intercept_pit_io(ioreq_t *p)
   81.15  
   81.16      if (p->size != 1 ||
   81.17          p->pdata_valid ||
   81.18 -	p->type != IOREQ_TYPE_PIO)
   81.19 +        p->type != IOREQ_TYPE_PIO)
   81.20          return 0;
   81.21      
   81.22      if (p->addr == PIT_MODE &&
   81.23 -	p->dir == 0 &&				/* write */
   81.24 -        ((p->u.data >> 4) & 0x3) == 0 &&	/* latch command */
   81.25 +        p->dir == 0 &&    /* write */
   81.26 +        ((p->u.data >> 4) & 0x3) == 0 && /* latch command */
   81.27          ((p->u.data >> 6) & 0x3) == (vpit->channel)) {/* right channel */
   81.28          pit_latch_io(vpit);
   81.29 -	return 1;
   81.30 +        return 1;
   81.31      }
   81.32  
   81.33      if (p->addr == (PIT_CH0 + vpit->channel) &&
   81.34 -	p->dir == 1) {	/* read */
   81.35 +        p->dir == 1) { /* read */
   81.36          p->u.data = pit_read_io(vpit);
   81.37          resume_pit_io(p);
   81.38 -	return 1;
   81.39 +        return 1;
   81.40      }
   81.41  
   81.42      return 0;
   81.43 @@ -253,8 +253,8 @@ void vmx_hooks_assist(struct vcpu *d)
   81.44          vpit->channel = ((p->u.data >> 24) & 0x3);
   81.45          vpit->first_injected = 0;
   81.46  
   81.47 -	vpit->count_LSB_latched = 0;
   81.48 -	vpit->count_MSB_latched = 0;
   81.49 +        vpit->count_LSB_latched = 0;
   81.50 +        vpit->count_MSB_latched = 0;
   81.51  
   81.52          rw_mode = ((p->u.data >> 26) & 0x3);
   81.53          switch(rw_mode) {
   81.54 @@ -280,9 +280,19 @@ void vmx_hooks_assist(struct vcpu *d)
   81.55          /*restore the state*/
   81.56          p->state = STATE_IORESP_READY;
   81.57  
   81.58 -	/* register handler to intercept the PIT io when vm_exit */
   81.59 +        /* register handler to intercept the PIT io when vm_exit */
   81.60          if (!reinit)
   81.61 -	    register_portio_handler(0x40, 4, intercept_pit_io); 
   81.62 +            register_portio_handler(0x40, 4, intercept_pit_io); 
   81.63      }
   81.64  }
   81.65  #endif /* CONFIG_VMX */
   81.66 +
   81.67 +/*
   81.68 + * Local variables:
   81.69 + * mode: C
   81.70 + * c-set-style: "BSD"
   81.71 + * c-basic-offset: 4
   81.72 + * tab-width: 4
   81.73 + * indent-tabs-mode: nil
   81.74 + * End:
   81.75 + */
    82.1 --- a/xen/arch/x86/vmx_io.c	Fri Sep 09 10:31:36 2005 -0600
    82.2 +++ b/xen/arch/x86/vmx_io.c	Tue Sep 13 10:14:16 2005 -0600
    82.3 @@ -16,6 +16,7 @@
    82.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
    82.5   *
    82.6   */
    82.7 +
    82.8  #include <xen/config.h>
    82.9  #include <xen/init.h>
   82.10  #include <xen/mm.h>
   82.11 @@ -99,7 +100,6 @@ static void set_reg_value (int size, int
   82.12              printk("Error: size:%x, index:%x are invalid!\n", size, index);
   82.13              domain_crash_synchronous();
   82.14              break;
   82.15 -
   82.16          }
   82.17          break;
   82.18      case WORD:
   82.19 @@ -199,24 +199,24 @@ void load_cpu_user_regs(struct cpu_user_
   82.20  static inline void __set_reg_value(unsigned long *reg, int size, long value)
   82.21  {
   82.22      switch (size) {
   82.23 -        case BYTE_64:
   82.24 -            *reg &= ~0xFF;
   82.25 -            *reg |= (value & 0xFF);
   82.26 -            break;
   82.27 -        case WORD:
   82.28 -            *reg &= ~0xFFFF;
   82.29 -            *reg |= (value & 0xFFFF);
   82.30 -            break;
   82.31 -        case LONG:
   82.32 -            *reg &= ~0xFFFFFFFF;
   82.33 -            *reg |= (value & 0xFFFFFFFF);
   82.34 -            break;
   82.35 -        case QUAD:
   82.36 -            *reg = value;
   82.37 -            break;
   82.38 -        default:
   82.39 -            printk("Error: <__set_reg_value> : Unknown size for register\n");
   82.40 -            domain_crash_synchronous();
   82.41 +    case BYTE_64:
   82.42 +        *reg &= ~0xFF;
   82.43 +        *reg |= (value & 0xFF);
   82.44 +        break;
   82.45 +    case WORD:
   82.46 +        *reg &= ~0xFFFF;
   82.47 +        *reg |= (value & 0xFFFF);
   82.48 +        break;
   82.49 +    case LONG:
   82.50 +        *reg &= ~0xFFFFFFFF;
   82.51 +        *reg |= (value & 0xFFFFFFFF);
   82.52 +        break;
   82.53 +    case QUAD:
   82.54 +        *reg = value;
   82.55 +        break;
   82.56 +    default:
   82.57 +        printk("Error: <__set_reg_value>: size:%x is invalid\n", size);
   82.58 +        domain_crash_synchronous();
   82.59      }
   82.60  }
   82.61  
   82.62 @@ -224,98 +224,98 @@ static void set_reg_value (int size, int
   82.63  {
   82.64      if (size == BYTE) {
   82.65          switch (index) {
   82.66 -            case 0:
   82.67 -                regs->rax &= ~0xFF;
   82.68 -                regs->rax |= (value & 0xFF);
   82.69 -                break;
   82.70 -            case 1:
   82.71 -                regs->rcx &= ~0xFF;
   82.72 -                regs->rcx |= (value & 0xFF);
   82.73 -                break;
   82.74 -            case 2:
   82.75 -                regs->rdx &= ~0xFF;
   82.76 -                regs->rdx |= (value & 0xFF);
   82.77 -                break;
   82.78 -            case 3:
   82.79 -                regs->rbx &= ~0xFF;
   82.80 -                regs->rbx |= (value & 0xFF);
   82.81 -                break;
   82.82 -            case 4:
   82.83 -                regs->rax &= 0xFFFFFFFFFFFF00FF;
   82.84 -                regs->rax |= ((value & 0xFF) << 8);
   82.85 -                break;
   82.86 -            case 5:
   82.87 -                regs->rcx &= 0xFFFFFFFFFFFF00FF;
   82.88 -                regs->rcx |= ((value & 0xFF) << 8);
   82.89 -                break;
   82.90 -            case 6:
   82.91 -                regs->rdx &= 0xFFFFFFFFFFFF00FF;
   82.92 -                regs->rdx |= ((value & 0xFF) << 8);
   82.93 -                break;
   82.94 -            case 7:
   82.95 -                regs->rbx &= 0xFFFFFFFFFFFF00FF;
   82.96 -                regs->rbx |= ((value & 0xFF) << 8);
   82.97 -                break;
   82.98 -            default:
   82.99 -                printk("Error: size:%x, index:%x are invalid!\n", size, index);
  82.100 -                domain_crash_synchronous();
  82.101 -                break;
  82.102 +        case 0:
  82.103 +            regs->rax &= ~0xFF;
  82.104 +            regs->rax |= (value & 0xFF);
  82.105 +            break;
  82.106 +        case 1:
  82.107 +            regs->rcx &= ~0xFF;
  82.108 +            regs->rcx |= (value & 0xFF);
  82.109 +            break;
  82.110 +        case 2:
  82.111 +            regs->rdx &= ~0xFF;
  82.112 +            regs->rdx |= (value & 0xFF);
  82.113 +            break;
  82.114 +        case 3:
  82.115 +            regs->rbx &= ~0xFF;
  82.116 +            regs->rbx |= (value & 0xFF);
  82.117 +            break;
  82.118 +        case 4:
  82.119 +            regs->rax &= 0xFFFFFFFFFFFF00FF;
  82.120 +            regs->rax |= ((value & 0xFF) << 8);
  82.121 +            break;
  82.122 +        case 5:
  82.123 +            regs->rcx &= 0xFFFFFFFFFFFF00FF;
  82.124 +            regs->rcx |= ((value & 0xFF) << 8);
  82.125 +            break;
  82.126 +        case 6:
  82.127 +            regs->rdx &= 0xFFFFFFFFFFFF00FF;
  82.128 +            regs->rdx |= ((value & 0xFF) << 8);
  82.129 +            break;
  82.130 +        case 7:
  82.131 +            regs->rbx &= 0xFFFFFFFFFFFF00FF;
  82.132 +            regs->rbx |= ((value & 0xFF) << 8);
  82.133 +            break;
  82.134 +        default:
  82.135 +            printk("Error: size:%x, index:%x are invalid!\n", size, index);
  82.136 +            domain_crash_synchronous();
  82.137 +            break;
  82.138          }
  82.139 -
  82.140 +        return;
  82.141      }
  82.142  
  82.143      switch (index) {
  82.144 -        case 0: 
  82.145 -            __set_reg_value(&regs->rax, size, value);
  82.146 -            break;
  82.147 -        case 1: 
  82.148 -            __set_reg_value(&regs->rcx, size, value);
  82.149 -            break;
  82.150 -        case 2: 
  82.151 -            __set_reg_value(&regs->rdx, size, value);
  82.152 -            break;
  82.153 -        case 3: 
  82.154 -            __set_reg_value(&regs->rbx, size, value);
  82.155 -            break;
  82.156 -        case 4: 
  82.157 -            __set_reg_value(&regs->rsp, size, value);
  82.158 -            break;
  82.159 -        case 5: 
  82.160 -            __set_reg_value(&regs->rbp, size, value);
  82.161 -            break;
  82.162 -        case 6: 
  82.163 -            __set_reg_value(&regs->rsi, size, value);
  82.164 -            break;
  82.165 -        case 7: 
  82.166 -            __set_reg_value(&regs->rdi, size, value);
  82.167 -            break;
  82.168 -        case 8: 
  82.169 -            __set_reg_value(&regs->r8, size, value);
  82.170 -            break;
  82.171 -        case 9: 
  82.172 -            __set_reg_value(&regs->r9, size, value);
  82.173 -            break;
  82.174 -        case 10: 
  82.175 -            __set_reg_value(&regs->r10, size, value);
  82.176 -            break;
  82.177 -        case 11: 
  82.178 -            __set_reg_value(&regs->r11, size, value);
  82.179 -            break;
  82.180 -        case 12: 
  82.181 -            __set_reg_value(&regs->r12, size, value);
  82.182 -            break;
  82.183 -        case 13: 
  82.184 -            __set_reg_value(&regs->r13, size, value);
  82.185 -            break;
  82.186 -        case 14: 
  82.187 -            __set_reg_value(&regs->r14, size, value);
  82.188 -            break;
  82.189 -        case 15: 
  82.190 -            __set_reg_value(&regs->r15, size, value);
  82.191 -            break;
  82.192 -        default:
  82.193 -            printk("Error: <set_reg_value> Invalid index\n");
  82.194 -            domain_crash_synchronous();
  82.195 +    case 0: 
  82.196 +        __set_reg_value(&regs->rax, size, value);
  82.197 +        break;
  82.198 +    case 1: 
  82.199 +        __set_reg_value(&regs->rcx, size, value);
  82.200 +        break;
  82.201 +    case 2: 
  82.202 +        __set_reg_value(&regs->rdx, size, value);
  82.203 +        break;
  82.204 +    case 3: 
  82.205 +        __set_reg_value(&regs->rbx, size, value);
  82.206 +        break;
  82.207 +    case 4: 
  82.208 +        __set_reg_value(&regs->rsp, size, value);
  82.209 +        break;
  82.210 +    case 5: 
  82.211 +        __set_reg_value(&regs->rbp, size, value);
  82.212 +        break;
  82.213 +    case 6: 
  82.214 +        __set_reg_value(&regs->rsi, size, value);
  82.215 +        break;
  82.216 +    case 7: 
  82.217 +        __set_reg_value(&regs->rdi, size, value);
  82.218 +        break;
  82.219 +    case 8: 
  82.220 +        __set_reg_value(&regs->r8, size, value);
  82.221 +        break;
  82.222 +    case 9: 
  82.223 +        __set_reg_value(&regs->r9, size, value);
  82.224 +        break;
  82.225 +    case 10: 
  82.226 +        __set_reg_value(&regs->r10, size, value);
  82.227 +        break;
  82.228 +    case 11: 
  82.229 +        __set_reg_value(&regs->r11, size, value);
  82.230 +        break;
  82.231 +    case 12: 
  82.232 +        __set_reg_value(&regs->r12, size, value);
  82.233 +        break;
  82.234 +    case 13: 
  82.235 +        __set_reg_value(&regs->r13, size, value);
  82.236 +        break;
  82.237 +    case 14: 
  82.238 +        __set_reg_value(&regs->r14, size, value);
  82.239 +        break;
  82.240 +    case 15: 
  82.241 +        __set_reg_value(&regs->r15, size, value);
  82.242 +        break;
  82.243 +    default:
  82.244 +        printk("Error: <set_reg_value> Invalid index\n");
  82.245 +        domain_crash_synchronous();
  82.246      }
  82.247      return;
  82.248  }
  82.249 @@ -324,44 +324,44 @@ static void set_reg_value (int size, int
  82.250  extern long get_reg_value(int size, int index, int seg, struct cpu_user_regs *regs);
  82.251  
  82.252  static inline void set_eflags_CF(int size, unsigned long v1,
  82.253 -	unsigned long v2, struct cpu_user_regs *regs)
  82.254 +                                 unsigned long v2, struct cpu_user_regs *regs)
  82.255  {
  82.256      unsigned long mask = (1 << (8 * size)) - 1;
  82.257  
  82.258      if ((v1 & mask) > (v2 & mask))
  82.259 -	regs->eflags |= X86_EFLAGS_CF;
  82.260 +        regs->eflags |= X86_EFLAGS_CF;
  82.261      else
  82.262 -	regs->eflags &= ~X86_EFLAGS_CF;
  82.263 +        regs->eflags &= ~X86_EFLAGS_CF;
  82.264  }
  82.265  
  82.266  static inline void set_eflags_OF(int size, unsigned long v1,
  82.267 -	unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
  82.268 +                                 unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
  82.269  {
  82.270      if ((v3 ^ v2) & (v3 ^ v1) & (1 << ((8 * size) - 1)))
  82.271 -	regs->eflags |= X86_EFLAGS_OF;
  82.272 +        regs->eflags |= X86_EFLAGS_OF;
  82.273  }
  82.274  
  82.275  static inline void set_eflags_AF(int size, unsigned long v1,
  82.276 -	unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
  82.277 +                                 unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
  82.278  {
  82.279      if ((v1 ^ v2 ^ v3) & 0x10)
  82.280 -	regs->eflags |= X86_EFLAGS_AF;
  82.281 +        regs->eflags |= X86_EFLAGS_AF;
  82.282  }
  82.283  
  82.284  static inline void set_eflags_ZF(int size, unsigned long v1,
  82.285 -	struct cpu_user_regs *regs)
  82.286 +                                 struct cpu_user_regs *regs)
  82.287  {
  82.288      unsigned long mask = (1 << (8 * size)) - 1;
  82.289  
  82.290      if ((v1 & mask) == 0)
  82.291 -	regs->eflags |= X86_EFLAGS_ZF;
  82.292 +        regs->eflags |= X86_EFLAGS_ZF;
  82.293  }
  82.294  
  82.295  static inline void set_eflags_SF(int size, unsigned long v1,
  82.296 -	struct cpu_user_regs *regs)
  82.297 +                                 struct cpu_user_regs *regs)
  82.298  {
  82.299      if (v1 & (1 << ((8 * size) - 1)))
  82.300 -	regs->eflags |= X86_EFLAGS_SF;
  82.301 +        regs->eflags |= X86_EFLAGS_SF;
  82.302  }
  82.303  
  82.304  static char parity_table[256] = {
  82.305 @@ -384,14 +384,14 @@ static char parity_table[256] = {
  82.306  };
  82.307  
  82.308  static inline void set_eflags_PF(int size, unsigned long v1,
  82.309 -	struct cpu_user_regs *regs)
  82.310 +                                 struct cpu_user_regs *regs)
  82.311  {
  82.312      if (parity_table[v1 & 0xFF])
  82.313 -	regs->eflags |= X86_EFLAGS_PF;
  82.314 +        regs->eflags |= X86_EFLAGS_PF;
  82.315  }
  82.316  
  82.317  static void vmx_pio_assist(struct cpu_user_regs *regs, ioreq_t *p,
  82.318 -					struct mi_per_cpu_info *mpcip)
  82.319 +                           struct mi_per_cpu_info *mpcip)
  82.320  {
  82.321      unsigned long old_eax;
  82.322      int sign = p->df ? -1 : 1;
  82.323 @@ -399,28 +399,28 @@ static void vmx_pio_assist(struct cpu_us
  82.324      if (p->dir == IOREQ_WRITE) {
  82.325          if (p->pdata_valid) {
  82.326              regs->esi += sign * p->count * p->size;
  82.327 -	    if (mpcip->flags & REPZ)
  82.328 -		regs->ecx -= p->count;
  82.329 +            if (mpcip->flags & REPZ)
  82.330 +                regs->ecx -= p->count;
  82.331          }
  82.332      } else {
  82.333 -	if (mpcip->flags & OVERLAP) {
  82.334 -	    unsigned long addr;
  82.335 +        if (mpcip->flags & OVERLAP) {
  82.336 +            unsigned long addr;
  82.337  
  82.338              regs->edi += sign * p->count * p->size;
  82.339 -	    if (mpcip->flags & REPZ)
  82.340 -		regs->ecx -= p->count;
  82.341 +            if (mpcip->flags & REPZ)
  82.342 +                regs->ecx -= p->count;
  82.343  
  82.344 -	    addr = regs->edi;
  82.345 -	    if (sign > 0)
  82.346 -		addr -= p->size;
  82.347 -	    vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
  82.348 -	} else if (p->pdata_valid) {
  82.349 +            addr = regs->edi;
  82.350 +            if (sign > 0)
  82.351 +                addr -= p->size;
  82.352 +            vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
  82.353 +        } else if (p->pdata_valid) {
  82.354              regs->edi += sign * p->count * p->size;
  82.355 -	    if (mpcip->flags & REPZ)
  82.356 -		regs->ecx -= p->count;
  82.357 +            if (mpcip->flags & REPZ)
  82.358 +                regs->ecx -= p->count;
  82.359          } else {
  82.360 -	    old_eax = regs->eax;
  82.361 -	    switch (p->size) {
  82.362 +            old_eax = regs->eax;
  82.363 +            switch (p->size) {
  82.364              case 1:
  82.365                  regs->eax = (old_eax & 0xffffff00) | (p->u.data & 0xff);
  82.366                  break;
  82.367 @@ -431,15 +431,15 @@ static void vmx_pio_assist(struct cpu_us
  82.368                  regs->eax = (p->u.data & 0xffffffff);
  82.369                  break;
  82.370              default:
  82.371 -		printk("Error: %s unknown port size\n", __FUNCTION__);
  82.372 -		domain_crash_synchronous();
  82.373 -	    }
  82.374 -    	}
  82.375 +                printk("Error: %s unknown port size\n", __FUNCTION__);
  82.376 +                domain_crash_synchronous();
  82.377 +            }
  82.378 +        }
  82.379      }
  82.380  }
  82.381  
  82.382  static void vmx_mmio_assist(struct cpu_user_regs *regs, ioreq_t *p,
  82.383 -					struct mi_per_cpu_info *mpcip)
  82.384 +                            struct mi_per_cpu_info *mpcip)
  82.385  {
  82.386      int sign = p->df ? -1 : 1;
  82.387      int size = -1, index = -1;
  82.388 @@ -452,178 +452,178 @@ static void vmx_mmio_assist(struct cpu_u
  82.389  
  82.390      switch (mpcip->instr) {
  82.391      case INSTR_MOV:
  82.392 -	if (dst & REGISTER) {
  82.393 -	    index = operand_index(dst);
  82.394 -	    set_reg_value(size, index, 0, regs, p->u.data);
  82.395 -	}
  82.396 -	break;
  82.397 +        if (dst & REGISTER) {
  82.398 +            index = operand_index(dst);
  82.399 +            set_reg_value(size, index, 0, regs, p->u.data);
  82.400 +        }
  82.401 +        break;
  82.402  
  82.403      case INSTR_MOVZ:
  82.404 -	if (dst & REGISTER) {
  82.405 -	    index = operand_index(dst);
  82.406 -	    switch (size) {
  82.407 -	    case BYTE: p->u.data = p->u.data & 0xFFULL; break;
  82.408 -	    case WORD: p->u.data = p->u.data & 0xFFFFULL; break;
  82.409 -	    case LONG: p->u.data = p->u.data & 0xFFFFFFFFULL; break;
  82.410 -	    }
  82.411 -	    set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
  82.412 -	}
  82.413 -	break;
  82.414 +        if (dst & REGISTER) {
  82.415 +            index = operand_index(dst);
  82.416 +            switch (size) {
  82.417 +            case BYTE: p->u.data = p->u.data & 0xFFULL; break;
  82.418 +            case WORD: p->u.data = p->u.data & 0xFFFFULL; break;
  82.419 +            case LONG: p->u.data = p->u.data & 0xFFFFFFFFULL; break;
  82.420 +            }
  82.421 +            set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
  82.422 +        }
  82.423 +        break;
  82.424  
  82.425      case INSTR_MOVS:
  82.426 -	sign = p->df ? -1 : 1;
  82.427 -	regs->esi += sign * p->count * p->size;
  82.428 -	regs->edi += sign * p->count * p->size;
  82.429 -
  82.430 -	if ((mpcip->flags & OVERLAP) && p->dir == IOREQ_READ) {
  82.431 -	    unsigned long addr = regs->edi;
  82.432 +        sign = p->df ? -1 : 1;
  82.433 +        regs->esi += sign * p->count * p->size;
  82.434 +        regs->edi += sign * p->count * p->size;
  82.435  
  82.436 -	    if (sign > 0)
  82.437 -		addr -= p->size;
  82.438 -	    vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
  82.439 -	}
  82.440 +        if ((mpcip->flags & OVERLAP) && p->dir == IOREQ_READ) {
  82.441 +            unsigned long addr = regs->edi;
  82.442  
  82.443 -	if (mpcip->flags & REPZ)
  82.444 -	    regs->ecx -= p->count;
  82.445 -	break;
  82.446 +            if (sign > 0)
  82.447 +                addr -= p->size;
  82.448 +            vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
  82.449 +        }
  82.450 +
  82.451 +        if (mpcip->flags & REPZ)
  82.452 +            regs->ecx -= p->count;
  82.453 +        break;
  82.454  
  82.455      case INSTR_STOS:
  82.456 -	sign = p->df ? -1 : 1;
  82.457 -	regs->edi += sign * p->count * p->size;
  82.458 -	if (mpcip->flags & REPZ)
  82.459 -	    regs->ecx -= p->count;
  82.460 -	break;
  82.461 +        sign = p->df ? -1 : 1;
  82.462 +        regs->edi += sign * p->count * p->size;
  82.463 +        if (mpcip->flags & REPZ)
  82.464 +            regs->ecx -= p->count;
  82.465 +        break;
  82.466  
  82.467      case INSTR_AND:
  82.468 -	if (src & REGISTER) {
  82.469 -	    index = operand_index(src);
  82.470 -	    value = get_reg_value(size, index, 0, regs);
  82.471 -	    diff = (unsigned long) p->u.data & value;
  82.472 -	} else if (src & IMMEDIATE) {
  82.473 -	    value = mpcip->immediate;
  82.474 -	    diff = (unsigned long) p->u.data & value;
  82.475 -	} else if (src & MEMORY) {
  82.476 -	    index = operand_index(dst);
  82.477 -	    value = get_reg_value(size, index, 0, regs);
  82.478 -	    diff = (unsigned long) p->u.data & value;
  82.479 -	    set_reg_value(size, index, 0, regs, diff);
  82.480 -	}
  82.481 +        if (src & REGISTER) {
  82.482 +            index = operand_index(src);
  82.483 +            value = get_reg_value(size, index, 0, regs);
  82.484 +            diff = (unsigned long) p->u.data & value;
  82.485 +        } else if (src & IMMEDIATE) {
  82.486 +            value = mpcip->immediate;
  82.487 +            diff = (unsigned long) p->u.data & value;
  82.488 +        } else if (src & MEMORY) {
  82.489 +            index = operand_index(dst);
  82.490 +            value = get_reg_value(size, index, 0, regs);
  82.491 +            diff = (unsigned long) p->u.data & value;
  82.492 +            set_reg_value(size, index, 0, regs, diff);
  82.493 +        }
  82.494  
  82.495 -	/*
  82.496 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
  82.497 -	 * flags are set according to the result. The state of
  82.498 -	 * the AF flag is undefined.
  82.499 -	 */
  82.500 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.501 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.502 -	set_eflags_ZF(size, diff, regs);
  82.503 -	set_eflags_SF(size, diff, regs);
  82.504 -	set_eflags_PF(size, diff, regs);
  82.505 -	break;
  82.506 +        /*
  82.507 +         * The OF and CF flags are cleared; the SF, ZF, and PF
  82.508 +         * flags are set according to the result. The state of
  82.509 +         * the AF flag is undefined.
  82.510 +         */
  82.511 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.512 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.513 +        set_eflags_ZF(size, diff, regs);
  82.514 +        set_eflags_SF(size, diff, regs);
  82.515 +        set_eflags_PF(size, diff, regs);
  82.516 +        break;
  82.517  
  82.518      case INSTR_OR:
  82.519 -	if (src & REGISTER) {
  82.520 -	    index = operand_index(src);
  82.521 -	    value = get_reg_value(size, index, 0, regs);
  82.522 -	    diff = (unsigned long) p->u.data | value;
  82.523 -	} else if (src & IMMEDIATE) {
  82.524 -	    value = mpcip->immediate;
  82.525 -	    diff = (unsigned long) p->u.data | value;
  82.526 -	} else if (src & MEMORY) {
  82.527 -	    index = operand_index(dst);
  82.528 -	    value = get_reg_value(size, index, 0, regs);
  82.529 -	    diff = (unsigned long) p->u.data | value;
  82.530 -	    set_reg_value(size, index, 0, regs, diff);
  82.531 -	}
  82.532 +        if (src & REGISTER) {
  82.533 +            index = operand_index(src);
  82.534 +            value = get_reg_value(size, index, 0, regs);
  82.535 +            diff = (unsigned long) p->u.data | value;
  82.536 +        } else if (src & IMMEDIATE) {
  82.537 +            value = mpcip->immediate;
  82.538 +            diff = (unsigned long) p->u.data | value;
  82.539 +        } else if (src & MEMORY) {
  82.540 +            index = operand_index(dst);
  82.541 +            value = get_reg_value(size, index, 0, regs);
  82.542 +            diff = (unsigned long) p->u.data | value;
  82.543 +            set_reg_value(size, index, 0, regs, diff);
  82.544 +        }
  82.545  
  82.546 -	/*
  82.547 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
  82.548 -	 * flags are set according to the result. The state of
  82.549 -	 * the AF flag is undefined.
  82.550 -	 */
  82.551 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.552 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.553 -	set_eflags_ZF(size, diff, regs);
  82.554 -	set_eflags_SF(size, diff, regs);
  82.555 -	set_eflags_PF(size, diff, regs);
  82.556 -	break;
  82.557 +        /*
  82.558 +         * The OF and CF flags are cleared; the SF, ZF, and PF
  82.559 +         * flags are set according to the result. The state of
  82.560 +         * the AF flag is undefined.
  82.561 +         */
  82.562 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.563 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.564 +        set_eflags_ZF(size, diff, regs);
  82.565 +        set_eflags_SF(size, diff, regs);
  82.566 +        set_eflags_PF(size, diff, regs);
  82.567 +        break;
  82.568  
  82.569      case INSTR_XOR:
  82.570 -	if (src & REGISTER) {
  82.571 -	    index = operand_index(src);
  82.572 -	    value = get_reg_value(size, index, 0, regs);
  82.573 -	    diff = (unsigned long) p->u.data ^ value;
  82.574 -	} else if (src & IMMEDIATE) {
  82.575 -	    value = mpcip->immediate;
  82.576 -	    diff = (unsigned long) p->u.data ^ value;
  82.577 -	} else if (src & MEMORY) {
  82.578 -	    index = operand_index(dst);
  82.579 -	    value = get_reg_value(size, index, 0, regs);
  82.580 -	    diff = (unsigned long) p->u.data ^ value;
  82.581 -	    set_reg_value(size, index, 0, regs, diff);
  82.582 -	}
  82.583 +        if (src & REGISTER) {
  82.584 +            index = operand_index(src);
  82.585 +            value = get_reg_value(size, index, 0, regs);
  82.586 +            diff = (unsigned long) p->u.data ^ value;
  82.587 +        } else if (src & IMMEDIATE) {
  82.588 +            value = mpcip->immediate;
  82.589 +            diff = (unsigned long) p->u.data ^ value;
  82.590 +        } else if (src & MEMORY) {
  82.591 +            index = operand_index(dst);
  82.592 +            value = get_reg_value(size, index, 0, regs);
  82.593 +            diff = (unsigned long) p->u.data ^ value;
  82.594 +            set_reg_value(size, index, 0, regs, diff);
  82.595 +        }
  82.596  
  82.597 -	/*
  82.598 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
  82.599 -	 * flags are set according to the result. The state of
  82.600 -	 * the AF flag is undefined.
  82.601 -	 */
  82.602 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.603 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.604 -	set_eflags_ZF(size, diff, regs);
  82.605 -	set_eflags_SF(size, diff, regs);
  82.606 -	set_eflags_PF(size, diff, regs);
  82.607 -	break;
  82.608 +        /*
  82.609 +         * The OF and CF flags are cleared; the SF, ZF, and PF
  82.610 +         * flags are set according to the result. The state of
  82.611 +         * the AF flag is undefined.
  82.612 +         */
  82.613 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.614 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.615 +        set_eflags_ZF(size, diff, regs);
  82.616 +        set_eflags_SF(size, diff, regs);
  82.617 +        set_eflags_PF(size, diff, regs);
  82.618 +        break;
  82.619  
  82.620      case INSTR_CMP:
  82.621 -	if (src & REGISTER) {
  82.622 -	    index = operand_index(src);
  82.623 -	    value = get_reg_value(size, index, 0, regs);
  82.624 -	    diff = (unsigned long) p->u.data - value;
  82.625 -	} else if (src & IMMEDIATE) {
  82.626 -	    value = mpcip->immediate;
  82.627 -	    diff = (unsigned long) p->u.data - value;
  82.628 -	} else if (src & MEMORY) {
  82.629 -	    index = operand_index(dst);
  82.630 -	    value = get_reg_value(size, index, 0, regs);
  82.631 -	    diff = value - (unsigned long) p->u.data;
  82.632 -	}
  82.633 +        if (src & REGISTER) {
  82.634 +            index = operand_index(src);
  82.635 +            value = get_reg_value(size, index, 0, regs);
  82.636 +            diff = (unsigned long) p->u.data - value;
  82.637 +        } else if (src & IMMEDIATE) {
  82.638 +            value = mpcip->immediate;
  82.639 +            diff = (unsigned long) p->u.data - value;
  82.640 +        } else if (src & MEMORY) {
  82.641 +            index = operand_index(dst);
  82.642 +            value = get_reg_value(size, index, 0, regs);
  82.643 +            diff = value - (unsigned long) p->u.data;
  82.644 +        }
  82.645  
  82.646 -	/*
  82.647 -	 * The CF, OF, SF, ZF, AF, and PF flags are set according
  82.648 -	 * to the result
  82.649 -	 */
  82.650 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
  82.651 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.652 -	set_eflags_CF(size, value, (unsigned long) p->u.data, regs);
  82.653 -	set_eflags_OF(size, diff, value, (unsigned long) p->u.data, regs);
  82.654 -	set_eflags_AF(size, diff, value, (unsigned long) p->u.data, regs);
  82.655 -	set_eflags_ZF(size, diff, regs);
  82.656 -	set_eflags_SF(size, diff, regs);
  82.657 -	set_eflags_PF(size, diff, regs);
  82.658 -	break;
  82.659 +        /*
  82.660 +         * The CF, OF, SF, ZF, AF, and PF flags are set according
  82.661 +         * to the result
  82.662 +         */
  82.663 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
  82.664 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.665 +        set_eflags_CF(size, value, (unsigned long) p->u.data, regs);
  82.666 +        set_eflags_OF(size, diff, value, (unsigned long) p->u.data, regs);
  82.667 +        set_eflags_AF(size, diff, value, (unsigned long) p->u.data, regs);
  82.668 +        set_eflags_ZF(size, diff, regs);
  82.669 +        set_eflags_SF(size, diff, regs);
  82.670 +        set_eflags_PF(size, diff, regs);
  82.671 +        break;
  82.672  
  82.673      case INSTR_TEST:
  82.674 -	if (src & REGISTER) {
  82.675 -	    index = operand_index(src);
  82.676 -	    value = get_reg_value(size, index, 0, regs);
  82.677 -	} else if (src & IMMEDIATE) {
  82.678 -	    value = mpcip->immediate;
  82.679 -	} else if (src & MEMORY) {
  82.680 -	    index = operand_index(dst);
  82.681 -	    value = get_reg_value(size, index, 0, regs);
  82.682 -	}
  82.683 -	diff = (unsigned long) p->u.data & value;
  82.684 +        if (src & REGISTER) {
  82.685 +            index = operand_index(src);
  82.686 +            value = get_reg_value(size, index, 0, regs);
  82.687 +        } else if (src & IMMEDIATE) {
  82.688 +            value = mpcip->immediate;
  82.689 +        } else if (src & MEMORY) {
  82.690 +            index = operand_index(dst);
  82.691 +            value = get_reg_value(size, index, 0, regs);
  82.692 +        }
  82.693 +        diff = (unsigned long) p->u.data & value;
  82.694  
  82.695 -	/*
  82.696 -	 * Sets the SF, ZF, and PF status flags. CF and OF are set to 0
  82.697 -	 */
  82.698 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.699 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.700 -	set_eflags_ZF(size, diff, regs);
  82.701 -	set_eflags_SF(size, diff, regs);
  82.702 -	set_eflags_PF(size, diff, regs);
  82.703 -	break;
  82.704 +        /*
  82.705 +         * Sets the SF, ZF, and PF status flags. CF and OF are set to 0
  82.706 +         */
  82.707 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
  82.708 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
  82.709 +        set_eflags_ZF(size, diff, regs);
  82.710 +        set_eflags_SF(size, diff, regs);
  82.711 +        set_eflags_PF(size, diff, regs);
  82.712 +        break;
  82.713      }
  82.714  
  82.715      load_cpu_user_regs(regs);
  82.716 @@ -645,7 +645,7 @@ void vmx_io_assist(struct vcpu *v)
  82.717      if (vio == 0) {
  82.718          VMX_DBG_LOG(DBG_LEVEL_1, 
  82.719                      "bad shared page: %lx", (unsigned long) vio);
  82.720 -	printf("bad shared page: %lx\n", (unsigned long) vio);
  82.721 +        printf("bad shared page: %lx\n", (unsigned long) vio);
  82.722          domain_crash_synchronous();
  82.723      }
  82.724  
  82.725 @@ -656,15 +656,15 @@ void vmx_io_assist(struct vcpu *v)
  82.726      /* clear IO wait VMX flag */
  82.727      if (test_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags)) {
  82.728          if (p->state == STATE_IORESP_READY) {
  82.729 -	    p->state = STATE_INVALID;
  82.730 +            p->state = STATE_INVALID;
  82.731              clear_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags);
  82.732  
  82.733 -	    if (p->type == IOREQ_TYPE_PIO)
  82.734 -		vmx_pio_assist(regs, p, mpci_p);
  82.735 -	    else
  82.736 -		vmx_mmio_assist(regs, p, mpci_p);
  82.737 -	}
  82.738 -	/* else an interrupt send event raced us */
  82.739 +            if (p->type == IOREQ_TYPE_PIO)
  82.740 +                vmx_pio_assist(regs, p, mpci_p);
  82.741 +            else
  82.742 +                vmx_mmio_assist(regs, p, mpci_p);
  82.743 +        }
  82.744 +        /* else an interrupt send event raced us */
  82.745      }
  82.746  }
  82.747  
  82.748 @@ -731,7 +731,7 @@ static inline int __fls(u32 word)
  82.749      return word ? bit : -1;
  82.750  }
  82.751  #else
  82.752 -#define __fls(x) 	generic_fls(x)
  82.753 +#define __fls(x)  generic_fls(x)
  82.754  static __inline__ int generic_fls(u32 x)
  82.755  {
  82.756      int r = 31;
  82.757 @@ -840,23 +840,23 @@ interrupt_post_injection(struct vcpu * v
  82.758      struct vmx_virpit_t *vpit = &(v->domain->arch.vmx_platform.vmx_pit);
  82.759      switch(type)
  82.760      {
  82.761 -        case VLAPIC_DELIV_MODE_EXT:
  82.762 -            if (vpit->pending_intr_nr && vector == vpit->vector)
  82.763 -                vpit->pending_intr_nr--;
  82.764 -            else
  82.765 -                clear_highest_bit(v, vector);
  82.766 +    case VLAPIC_DELIV_MODE_EXT:
  82.767 +        if (vpit->pending_intr_nr && vector == vpit->vector)
  82.768 +            vpit->pending_intr_nr--;
  82.769 +        else
  82.770 +            clear_highest_bit(v, vector);
  82.771  
  82.772 -            if (vector == vpit->vector && !vpit->first_injected){
  82.773 -                vpit->first_injected = 1;
  82.774 -                vpit->pending_intr_nr = 0;
  82.775 -            }
  82.776 -            if (vector == vpit->vector)
  82.777 -                vpit->inject_point = NOW();
  82.778 -            break;
  82.779 +        if (vector == vpit->vector && !vpit->first_injected){
  82.780 +            vpit->first_injected = 1;
  82.781 +            vpit->pending_intr_nr = 0;
  82.782 +        }
  82.783 +        if (vector == vpit->vector)
  82.784 +            vpit->inject_point = NOW();
  82.785 +        break;
  82.786  
  82.787 -        default:
  82.788 -            printk("Not support interrupt type\n");
  82.789 -            break;
  82.790 +    default:
  82.791 +        printk("Not support interrupt type\n");
  82.792 +        break;
  82.793      }
  82.794  }
  82.795  
  82.796 @@ -898,51 +898,51 @@ asmlinkage void vmx_intr_assist(void)
  82.797          return;
  82.798      }
  82.799  
  82.800 -     __vmread(VM_ENTRY_INTR_INFO_FIELD, &intr_fields);
  82.801 -
  82.802 -     if (intr_fields & INTR_INFO_VALID_MASK) {
  82.803 -         VMX_DBG_LOG(DBG_LEVEL_1, "vmx_intr_assist: intr_fields: %lx",
  82.804 -           intr_fields);
  82.805 -         return;
  82.806 -     }
  82.807 -
  82.808 -     __vmread(GUEST_INTERRUPTIBILITY_INFO, &interruptibility);
  82.809 -
  82.810 -     if (interruptibility) {
  82.811 -         enable_irq_window(cpu_exec_control);
  82.812 -         VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, interruptibility: %lx",
  82.813 -                     highest_vector, interruptibility);
  82.814 -         return;
  82.815 -     }
  82.816 -
  82.817 -     __vmread(GUEST_RFLAGS, &eflags);
  82.818 +    __vmread(VM_ENTRY_INTR_INFO_FIELD, &intr_fields);
  82.819  
  82.820 -     switch (intr_type) {
  82.821 -         case VLAPIC_DELIV_MODE_EXT:
  82.822 -             if (irq_masked(eflags)) {
  82.823 -                 enable_irq_window(cpu_exec_control);
  82.824 -                 VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, eflags: %lx",
  82.825 -                             highest_vector, eflags);
  82.826 -                 return;
  82.827 -             }
  82.828 +    if (intr_fields & INTR_INFO_VALID_MASK) {
  82.829 +        VMX_DBG_LOG(DBG_LEVEL_1, "vmx_intr_assist: intr_fields: %lx",
  82.830 +                    intr_fields);
  82.831 +        return;
  82.832 +    }
  82.833  
  82.834 -             vmx_inject_extint(v, highest_vector, VMX_INVALID_ERROR_CODE);
  82.835 -             TRACE_3D(TRC_VMX_INT, v->domain->domain_id, highest_vector, 0);
  82.836 -             break;
  82.837 -         case VLAPIC_DELIV_MODE_FIXED:
  82.838 -         case VLAPIC_DELIV_MODE_LPRI:
  82.839 -         case VLAPIC_DELIV_MODE_SMI:
  82.840 -         case VLAPIC_DELIV_MODE_NMI:
  82.841 -         case VLAPIC_DELIV_MODE_INIT:
  82.842 -         case VLAPIC_DELIV_MODE_STARTUP:
  82.843 -         default:
  82.844 -             printk("Unsupported interrupt type\n");
  82.845 -             BUG();
  82.846 -             break;
  82.847 -     }
  82.848 +    __vmread(GUEST_INTERRUPTIBILITY_INFO, &interruptibility);
  82.849  
  82.850 -     interrupt_post_injection(v, highest_vector, intr_type);
  82.851 -     return;
  82.852 +    if (interruptibility) {
  82.853 +        enable_irq_window(cpu_exec_control);
  82.854 +        VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, interruptibility: %lx",
  82.855 +                    highest_vector, interruptibility);
  82.856 +        return;
  82.857 +    }
  82.858 +
  82.859 +    __vmread(GUEST_RFLAGS, &eflags);
  82.860 +
  82.861 +    switch (intr_type) {
  82.862 +    case VLAPIC_DELIV_MODE_EXT:
  82.863 +        if (irq_masked(eflags)) {
  82.864 +            enable_irq_window(cpu_exec_control);
  82.865 +            VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, eflags: %lx",
  82.866 +                        highest_vector, eflags);
  82.867 +            return;
  82.868 +        }
  82.869 +
  82.870 +        vmx_inject_extint(v, highest_vector, VMX_INVALID_ERROR_CODE);
  82.871 +        TRACE_3D(TRC_VMX_INT, v->domain->domain_id, highest_vector, 0);
  82.872 +        break;
  82.873 +    case VLAPIC_DELIV_MODE_FIXED:
  82.874 +    case VLAPIC_DELIV_MODE_LPRI:
  82.875 +    case VLAPIC_DELIV_MODE_SMI:
  82.876 +    case VLAPIC_DELIV_MODE_NMI:
  82.877 +    case VLAPIC_DELIV_MODE_INIT:
  82.878 +    case VLAPIC_DELIV_MODE_STARTUP:
  82.879 +    default:
  82.880 +        printk("Unsupported interrupt type\n");
  82.881 +        BUG();
  82.882 +        break;
  82.883 +    }
  82.884 +
  82.885 +    interrupt_post_injection(v, highest_vector, intr_type);
  82.886 +    return;
  82.887  }
  82.888  
  82.889  void vmx_do_resume(struct vcpu *d) 
    83.1 --- a/xen/arch/x86/vmx_platform.c	Fri Sep 09 10:31:36 2005 -0600
    83.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Sep 13 10:14:16 2005 -0600
    83.3 @@ -55,17 +55,17 @@ void store_cpu_user_regs(struct cpu_user
    83.4  static inline long __get_reg_value(unsigned long reg, int size)
    83.5  {
    83.6      switch(size) {
    83.7 -        case BYTE_64:
    83.8 -            return (char)(reg & 0xFF);
    83.9 -        case WORD:
   83.10 -            return (short)(reg & 0xFFFF);
   83.11 -        case LONG:
   83.12 -            return (int)(reg & 0xFFFFFFFF);
   83.13 -        case QUAD:
   83.14 -            return (long)(reg);
   83.15 -        default:
   83.16 -	printf("Error: (__get_reg_value) Invalid reg size\n");
   83.17 -            domain_crash_synchronous();
   83.18 +    case BYTE_64:
   83.19 +        return (char)(reg & 0xFF);
   83.20 +    case WORD:
   83.21 +        return (short)(reg & 0xFFFF);
   83.22 +    case LONG:
   83.23 +        return (int)(reg & 0xFFFFFFFF);
   83.24 +    case QUAD:
   83.25 +        return (long)(reg);
   83.26 +    default:
   83.27 +        printf("Error: (__get_reg_value) Invalid reg size\n");
   83.28 +        domain_crash_synchronous();
   83.29      }
   83.30  }
   83.31  
   83.32 @@ -73,48 +73,49 @@ long get_reg_value(int size, int index, 
   83.33  {
   83.34      if (size == BYTE) {
   83.35          switch (index) { 
   83.36 -	case 0: /* %al */
   83.37 -                return (char)(regs->rax & 0xFF);
   83.38 -	case 1: /* %cl */
   83.39 -                return (char)(regs->rcx & 0xFF);
   83.40 -	case 2: /* %dl */
   83.41 -                return (char)(regs->rdx & 0xFF); 
   83.42 -	case 3: /* %bl */
   83.43 -                return (char)(regs->rbx & 0xFF);
   83.44 -	case 4: /* %ah */
   83.45 -                return (char)((regs->rax & 0xFF00) >> 8);
   83.46 -	case 5: /* %ch */
   83.47 -                return (char)((regs->rcx & 0xFF00) >> 8);
   83.48 -	case 6: /* %dh */
   83.49 -                return (char)((regs->rdx & 0xFF00) >> 8);
   83.50 -	case 7: /* %bh */
   83.51 -                return (char)((regs->rbx & 0xFF00) >> 8);
   83.52 -            default:
   83.53 -	    printf("Error: (get_reg_value) Invalid index value\n"); 
   83.54 -                domain_crash_synchronous();
   83.55 +        case 0: /* %al */
   83.56 +            return (char)(regs->rax & 0xFF);
   83.57 +        case 1: /* %cl */
   83.58 +            return (char)(regs->rcx & 0xFF);
   83.59 +        case 2: /* %dl */
   83.60 +            return (char)(regs->rdx & 0xFF); 
   83.61 +        case 3: /* %bl */
   83.62 +            return (char)(regs->rbx & 0xFF);
   83.63 +        case 4: /* %ah */
   83.64 +            return (char)((regs->rax & 0xFF00) >> 8);
   83.65 +        case 5: /* %ch */
   83.66 +            return (char)((regs->rcx & 0xFF00) >> 8);
   83.67 +        case 6: /* %dh */
   83.68 +            return (char)((regs->rdx & 0xFF00) >> 8);
   83.69 +        case 7: /* %bh */
   83.70 +            return (char)((regs->rbx & 0xFF00) >> 8);
   83.71 +        default:
   83.72 +            printf("Error: (get_reg_value) Invalid index value\n"); 
   83.73 +            domain_crash_synchronous();
   83.74          }
   83.75 +        /* NOTREACHED */
   83.76      }
   83.77  
   83.78      switch (index) {
   83.79 -        case 0: return __get_reg_value(regs->rax, size);
   83.80 -        case 1: return __get_reg_value(regs->rcx, size);
   83.81 -        case 2: return __get_reg_value(regs->rdx, size);
   83.82 -        case 3: return __get_reg_value(regs->rbx, size);
   83.83 -        case 4: return __get_reg_value(regs->rsp, size);
   83.84 -        case 5: return __get_reg_value(regs->rbp, size);
   83.85 -        case 6: return __get_reg_value(regs->rsi, size);
   83.86 -        case 7: return __get_reg_value(regs->rdi, size);
   83.87 -        case 8: return __get_reg_value(regs->r8, size);
   83.88 -        case 9: return __get_reg_value(regs->r9, size);
   83.89 -        case 10: return __get_reg_value(regs->r10, size);
   83.90 -        case 11: return __get_reg_value(regs->r11, size);
   83.91 -        case 12: return __get_reg_value(regs->r12, size);
   83.92 -        case 13: return __get_reg_value(regs->r13, size);
   83.93 -        case 14: return __get_reg_value(regs->r14, size);
   83.94 -        case 15: return __get_reg_value(regs->r15, size);
   83.95 -        default:
   83.96 -	printf("Error: (get_reg_value) Invalid index value\n"); 
   83.97 -            domain_crash_synchronous();
   83.98 +    case 0: return __get_reg_value(regs->rax, size);
   83.99 +    case 1: return __get_reg_value(regs->rcx, size);
  83.100 +    case 2: return __get_reg_value(regs->rdx, size);
  83.101 +    case 3: return __get_reg_value(regs->rbx, size);
  83.102 +    case 4: return __get_reg_value(regs->rsp, size);
  83.103 +    case 5: return __get_reg_value(regs->rbp, size);
  83.104 +    case 6: return __get_reg_value(regs->rsi, size);
  83.105 +    case 7: return __get_reg_value(regs->rdi, size);
  83.106 +    case 8: return __get_reg_value(regs->r8, size);
  83.107 +    case 9: return __get_reg_value(regs->r9, size);
  83.108 +    case 10: return __get_reg_value(regs->r10, size);
  83.109 +    case 11: return __get_reg_value(regs->r11, size);
  83.110 +    case 12: return __get_reg_value(regs->r12, size);
  83.111 +    case 13: return __get_reg_value(regs->r13, size);
  83.112 +    case 14: return __get_reg_value(regs->r14, size);
  83.113 +    case 15: return __get_reg_value(regs->r15, size);
  83.114 +    default:
  83.115 +        printf("Error: (get_reg_value) Invalid index value\n"); 
  83.116 +        domain_crash_synchronous();
  83.117      }
  83.118  }
  83.119  #elif defined (__i386__)
  83.120 @@ -133,12 +134,12 @@ static inline long __get_reg_value(unsig
  83.121  {                    
  83.122      switch(size) {
  83.123      case WORD:
  83.124 -	return (short)(reg & 0xFFFF);
  83.125 +        return (short)(reg & 0xFFFF);
  83.126      case LONG:
  83.127 -	return (int)(reg & 0xFFFFFFFF);
  83.128 +        return (int)(reg & 0xFFFFFFFF);
  83.129      default:
  83.130 -	printf("Error: (__get_reg_value) Invalid reg size\n");
  83.131 -	domain_crash_synchronous();
  83.132 +        printf("Error: (__get_reg_value) Invalid reg size\n");
  83.133 +        domain_crash_synchronous();
  83.134      }
  83.135  }
  83.136  
  83.137 @@ -146,29 +147,29 @@ long get_reg_value(int size, int index, 
  83.138  {                    
  83.139      if (size == BYTE) {
  83.140          switch (index) { 
  83.141 -	case 0: /* %al */
  83.142 +        case 0: /* %al */
  83.143              return (char)(regs->eax & 0xFF);
  83.144 -	case 1: /* %cl */
  83.145 +        case 1: /* %cl */
  83.146              return (char)(regs->ecx & 0xFF);
  83.147 -	case 2: /* %dl */
  83.148 +        case 2: /* %dl */
  83.149              return (char)(regs->edx & 0xFF); 
  83.150 -	case 3: /* %bl */
  83.151 +        case 3: /* %bl */
  83.152              return (char)(regs->ebx & 0xFF);
  83.153 -	case 4: /* %ah */
  83.154 +        case 4: /* %ah */
  83.155              return (char)((regs->eax & 0xFF00) >> 8);
  83.156 -	case 5: /* %ch */
  83.157 +        case 5: /* %ch */
  83.158              return (char)((regs->ecx & 0xFF00) >> 8);
  83.159 -	case 6: /* %dh */
  83.160 +        case 6: /* %dh */
  83.161              return (char)((regs->edx & 0xFF00) >> 8);
  83.162 -	case 7: /* %bh */
  83.163 +        case 7: /* %bh */
  83.164              return (char)((regs->ebx & 0xFF00) >> 8);
  83.165          default:
  83.166 -	    printf("Error: (get_reg_value) Invalid index value\n"); 
  83.167 +            printf("Error: (get_reg_value) Invalid index value\n"); 
  83.168              domain_crash_synchronous();
  83.169          }
  83.170 -        }
  83.171 +    }
  83.172  
  83.173 -        switch (index) {
  83.174 +    switch (index) {
  83.175      case 0: return __get_reg_value(regs->eax, size);
  83.176      case 1: return __get_reg_value(regs->ecx, size);
  83.177      case 2: return __get_reg_value(regs->edx, size);
  83.178 @@ -178,46 +179,46 @@ long get_reg_value(int size, int index, 
  83.179      case 6: return __get_reg_value(regs->esi, size);
  83.180      case 7: return __get_reg_value(regs->edi, size);
  83.181      default:
  83.182 -	printf("Error: (get_reg_value) Invalid index value\n"); 
  83.183 +        printf("Error: (get_reg_value) Invalid index value\n"); 
  83.184          domain_crash_synchronous();
  83.185      }
  83.186  }
  83.187  #endif
  83.188  
  83.189  static inline unsigned char *check_prefix(unsigned char *inst,
  83.190 -		struct instruction *thread_inst, unsigned char *rex_p)
  83.191 +                                          struct instruction *thread_inst, unsigned char *rex_p)
  83.192  {
  83.193      while (1) {
  83.194          switch (*inst) {
  83.195 -        /* rex prefix for em64t instructions */
  83.196 -            case 0x40 ... 0x4e:
  83.197 -                *rex_p = *inst;
  83.198 -                break;
  83.199 +            /* rex prefix for em64t instructions */
  83.200 +        case 0x40 ... 0x4e:
  83.201 +            *rex_p = *inst;
  83.202 +            break;
  83.203          case 0xf3: /* REPZ */
  83.204 -    	    	thread_inst->flags = REPZ;
  83.205 -        	break;
  83.206 +            thread_inst->flags = REPZ;
  83.207 +            break;
  83.208          case 0xf2: /* REPNZ */
  83.209 -    	    	thread_inst->flags = REPNZ;
  83.210 -        	break;
  83.211 +            thread_inst->flags = REPNZ;
  83.212 +            break;
  83.213          case 0xf0: /* LOCK */
  83.214 -    	    	break;
  83.215 +            break;
  83.216          case 0x2e: /* CS */
  83.217          case 0x36: /* SS */
  83.218          case 0x3e: /* DS */
  83.219          case 0x26: /* ES */
  83.220          case 0x64: /* FS */
  83.221          case 0x65: /* GS */
  83.222 -	        thread_inst->seg_sel = *inst;
  83.223 -                break;
  83.224 +            thread_inst->seg_sel = *inst;
  83.225 +            break;
  83.226          case 0x66: /* 32bit->16bit */
  83.227 -                thread_inst->op_size = WORD;
  83.228 -                break;
  83.229 -            case 0x67:
  83.230 -        	printf("Error: Not handling 0x67 (yet)\n");
  83.231 -                domain_crash_synchronous();
  83.232 -                break;
  83.233 -            default:
  83.234 -                return inst;
  83.235 +            thread_inst->op_size = WORD;
  83.236 +            break;
  83.237 +        case 0x67:
  83.238 +            printf("Error: Not handling 0x67 (yet)\n");
  83.239 +            domain_crash_synchronous();
  83.240 +            break;
  83.241 +        default:
  83.242 +            return inst;
  83.243          }
  83.244          inst++;
  83.245      }
  83.246 @@ -239,23 +240,23 @@ static inline unsigned long get_immediat
  83.247      }
  83.248  
  83.249      switch(mod) {
  83.250 -        case 0:
  83.251 -            if (rm == 5 || rm == 4) {
  83.252 -                if (op16)
  83.253 -                    inst = inst + 2; //disp16, skip 2 bytes
  83.254 -                else
  83.255 -                    inst = inst + 4; //disp32, skip 4 bytes
  83.256 -            }
  83.257 -            break;
  83.258 -        case 1:
  83.259 -            inst++; //disp8, skip 1 byte
  83.260 -            break;
  83.261 -        case 2:
  83.262 +    case 0:
  83.263 +        if (rm == 5 || rm == 4) {
  83.264              if (op16)
  83.265                  inst = inst + 2; //disp16, skip 2 bytes
  83.266              else
  83.267                  inst = inst + 4; //disp32, skip 4 bytes
  83.268 -            break;
  83.269 +        }
  83.270 +        break;
  83.271 +    case 1:
  83.272 +        inst++; //disp8, skip 1 byte
  83.273 +        break;
  83.274 +    case 2:
  83.275 +        if (op16)
  83.276 +            inst = inst + 2; //disp16, skip 2 bytes
  83.277 +        else
  83.278 +            inst = inst + 4; //disp32, skip 4 bytes
  83.279 +        break;
  83.280      }
  83.281  
  83.282      if (op_size == QUAD)
  83.283 @@ -303,19 +304,19 @@ static void init_instruction(struct inst
  83.284  }
  83.285  
  83.286  #define GET_OP_SIZE_FOR_BYTE(op_size)   \
  83.287 -    do {				\
  83.288 -    	if (rex)			\
  83.289 -	    op_size = BYTE_64;		\
  83.290 -	else				\
  83.291 -	    op_size = BYTE;		\
  83.292 +    do {    \
  83.293 +     if (rex)   \
  83.294 +     op_size = BYTE_64;  \
  83.295 + else    \
  83.296 +     op_size = BYTE;  \
  83.297      } while(0)
  83.298  
  83.299  #define GET_OP_SIZE_FOR_NONEBYTE(op_size)   \
  83.300 -    do {				\
  83.301 -    	if (rex & 0x8)			\
  83.302 -	    op_size = QUAD;		\
  83.303 -	else if (op_size != WORD)	\
  83.304 -	    op_size = LONG;		\
  83.305 +    do {    \
  83.306 +     if (rex & 0x8)   \
  83.307 +     op_size = QUAD;  \
  83.308 + else if (op_size != WORD) \
  83.309 +     op_size = LONG;  \
  83.310      } while(0)
  83.311  
  83.312  
  83.313 @@ -343,7 +344,7 @@ static int acc_mem(unsigned char size, s
  83.314   * Decode mem,reg operands (as in <opcode> r32/16, m32/16)
  83.315   */
  83.316  static int mem_reg(unsigned char size, unsigned char *opcode,
  83.317 -			struct instruction *instr, unsigned char rex)
  83.318 +                   struct instruction *instr, unsigned char rex)
  83.319  {
  83.320      int index = get_index(opcode + 1, rex);
  83.321  
  83.322 @@ -356,7 +357,7 @@ static int mem_reg(unsigned char size, u
  83.323   * Decode reg,mem operands (as in <opcode> m32/16, r32/16)
  83.324   */
  83.325  static int reg_mem(unsigned char size, unsigned char *opcode,
  83.326 -			struct instruction *instr, unsigned char rex)
  83.327 +                   struct instruction *instr, unsigned char rex)
  83.328  {
  83.329      int index = get_index(opcode + 1, rex);
  83.330  
  83.331 @@ -381,205 +382,210 @@ static int vmx_decode(unsigned char *opc
  83.332          vm86 = 1;
  83.333  
  83.334      if (vm86) { /* meaning is reversed */
  83.335 -       if (instr->op_size == WORD)
  83.336 -           instr->op_size = LONG;
  83.337 -       else if (instr->op_size == LONG)
  83.338 -           instr->op_size = WORD;
  83.339 -       else if (instr->op_size == 0)
  83.340 -           instr->op_size = WORD;
  83.341 +        if (instr->op_size == WORD)
  83.342 +            instr->op_size = LONG;
  83.343 +        else if (instr->op_size == LONG)
  83.344 +            instr->op_size = WORD;
  83.345 +        else if (instr->op_size == 0)
  83.346 +            instr->op_size = WORD;
  83.347      }
  83.348  
  83.349      switch (*opcode) {
  83.350      case 0x0B: /* or m32/16, r32/16 */
  83.351 -	instr->instr = INSTR_OR;
  83.352 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.353 -	return mem_reg(instr->op_size, opcode, instr, rex);
  83.354 +        instr->instr = INSTR_OR;
  83.355 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.356 +        return mem_reg(instr->op_size, opcode, instr, rex);
  83.357  
  83.358      case 0x20: /* and r8, m8 */
  83.359 -	instr->instr = INSTR_AND;
  83.360 -	GET_OP_SIZE_FOR_BYTE(instr->op_size);
  83.361 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.362 +        instr->instr = INSTR_AND;
  83.363 +        GET_OP_SIZE_FOR_BYTE(instr->op_size);
  83.364 +        return reg_mem(instr->op_size, opcode, instr, rex);
  83.365  
  83.366      case 0x21: /* and r32/16, m32/16 */
  83.367 -	instr->instr = INSTR_AND;
  83.368 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.369 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.370 +        instr->instr = INSTR_AND;
  83.371 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.372 +        return reg_mem(instr->op_size, opcode, instr, rex);
  83.373  
  83.374      case 0x23: /* and m32/16, r32/16 */
  83.375 -	instr->instr = INSTR_AND;
  83.376 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.377 -	return mem_reg(instr->op_size, opcode, instr, rex);
  83.378 +        instr->instr = INSTR_AND;
  83.379 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.380 +        return mem_reg(instr->op_size, opcode, instr, rex);
  83.381  
  83.382      case 0x30: /* xor r8, m8 */
  83.383 -	instr->instr = INSTR_XOR;
  83.384 -	GET_OP_SIZE_FOR_BYTE(instr->op_size);
  83.385 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.386 +        instr->instr = INSTR_XOR;
  83.387 +        GET_OP_SIZE_FOR_BYTE(instr->op_size);
  83.388 +        return reg_mem(instr->op_size, opcode, instr, rex);
  83.389  
  83.390      case 0x31: /* xor r32/16, m32/16 */
  83.391 -	instr->instr = INSTR_XOR;
  83.392 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.393 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.394 +        instr->instr = INSTR_XOR;
  83.395 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.396 +        return reg_mem(instr->op_size, opcode, instr, rex);
  83.397  
  83.398      case 0x39: /* cmp r32/16, m32/16 */
  83.399 -	instr->instr = INSTR_CMP;
  83.400 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.401 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.402 +        instr->instr = INSTR_CMP;
  83.403 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.404 +        return reg_mem(instr->op_size, opcode, instr, rex);
  83.405  
  83.406 +    case 0x80:
  83.407      case 0x81:
  83.408 -	if (((opcode[1] >> 3) & 7) == 7) { /* cmp $imm, m32/16 */
  83.409 -	    instr->instr = INSTR_CMP;
  83.410 -	    GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.411 +        if (((opcode[1] >> 3) & 7) == 7) { /* cmp $imm, m32/16 */
  83.412 +            instr->instr = INSTR_CMP;
  83.413  
  83.414 -	    instr->operand[0] = mk_operand(instr->op_size, 0, 0, IMMEDIATE);
  83.415 -	    instr->immediate = get_immediate(vm86, opcode+1, BYTE);
  83.416 -	    instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
  83.417 +            if (opcode[0] == 0x80)
  83.418 +                GET_OP_SIZE_FOR_BYTE(instr->op_size);
  83.419 +            else
  83.420 +                GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.421 +
  83.422 +            instr->operand[0] = mk_operand(instr->op_size, 0, 0, IMMEDIATE);
  83.423 +            instr->immediate = get_immediate(vm86, opcode+1, BYTE);
  83.424 +            instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
  83.425  
  83.426              return DECODE_success;
  83.427 -	} else
  83.428 -	    return DECODE_failure;
  83.429 +        } else
  83.430 +            return DECODE_failure;
  83.431  
  83.432      case 0x84:  /* test m8, r8 */
  83.433 -	instr->instr = INSTR_TEST;
  83.434 -	instr->op_size = BYTE;
  83.435 -	GET_OP_SIZE_FOR_BYTE(tmp_size);
  83.436 -	return mem_reg(tmp_size, opcode, instr, rex);
  83.437 +        instr->instr = INSTR_TEST;
  83.438 +        instr->op_size = BYTE;
  83.439 +        GET_OP_SIZE_FOR_BYTE(tmp_size);
  83.440 +        return mem_reg(tmp_size, opcode, instr, rex);
  83.441  
  83.442      case 0x88: /* mov r8, m8 */
  83.443 -	instr->instr = INSTR_MOV;
  83.444 -	instr->op_size = BYTE;
  83.445 +        instr->instr = INSTR_MOV;
  83.446 +        instr->op_size = BYTE;
  83.447          GET_OP_SIZE_FOR_BYTE(tmp_size);
  83.448 -	return reg_mem(tmp_size, opcode, instr, rex);
  83.449 +        return reg_mem(tmp_size, opcode, instr, rex);
  83.450  
  83.451      case 0x89: /* mov r32/16, m32/16 */
  83.452 -	instr->instr = INSTR_MOV;
  83.453 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
  83.454 -	return reg_mem(instr->op_size, opcode, instr, rex);
  83.455