ia64/xen-unstable

changeset 6437:8799d14bef77

Merge with -unstable
author djm@kirby.fc.hp.com
date Thu Aug 25 15:53:20 2005 -0700 (2005-08-25)
parents 5f1ed597f107 9fb0bad776dd
children 9312a3e8a6f8
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/src/user.tex extras/mini-os/include/hypervisor.h extras/mini-os/include/mm.h extras/mini-os/include/time.h extras/mini-os/kernel.c extras/mini-os/mm.c extras/mini-os/time.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/ctrl_if.c 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/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/blktap_controlmsg.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap_datapath.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap_userdev.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/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/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_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_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/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/ctrl_if.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/linux-public/suspend.h linux-2.6-xen-sparse/include/asm-xen/queues.h linux-2.6-xen-sparse/include/asm-xen/synch_bitops.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/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/blktaplib.c tools/blktap/blktaplib.h tools/blktap/parallax/Makefile tools/blktap/parallax/block-async.h tools/blktap/parallax/blockstore.h 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/backend.hotplug tools/examples/network-bridge tools/examples/vif-bridge tools/examples/xend-config.sxp tools/examples/xmexample.vmx tools/firmware/acpi/acpi2_0.h tools/firmware/rombios/rombios.c tools/ioemu/hw/i8254.c tools/ioemu/hw/i8259.c tools/ioemu/hw/ide.c tools/ioemu/hw/ioapic.h 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_xeno.h tools/misc/xc_shadow.c tools/misc/xend tools/misc/xenperf.c tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xs/xs.c tools/python/xen/lowlevel/xu/xu.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/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/messages.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/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/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/install.txt 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/xcs/Makefile tools/xcs/dump.h tools/xcs/xcs.h tools/xcs/xcsdump.c 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/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/utils.c tools/xenstore/utils.h 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/xenctx.c tools/xentrace/xentrace.c xen/Makefile xen/Rules.mk xen/acm/acm_core.c xen/acm/acm_policy.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/dom_fw.c xen/arch/ia64/domain.c xen/arch/ia64/grant_table.c xen/arch/ia64/hypercall.c xen/arch/ia64/hyperprivop.S xen/arch/ia64/ivt.S xen/arch/ia64/mmio.c xen/arch/ia64/pal_emul.c xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c xen/arch/ia64/patch/linux-2.6.11/kregs.h xen/arch/ia64/pcdp.c xen/arch/ia64/process.c xen/arch/ia64/regionreg.c xen/arch/ia64/tools/mkbuildtree xen/arch/ia64/vcpu.c xen/arch/ia64/vlsapic.c xen/arch/ia64/vmmu.c xen/arch/ia64/vmx_hypercall.c xen/arch/ia64/vmx_init.c xen/arch/ia64/vmx_ivt.S xen/arch/ia64/vmx_phy_mode.c xen/arch/ia64/vmx_support.c xen/arch/ia64/vmx_vcpu.c xen/arch/ia64/vmx_virt.c xen/arch/ia64/vtlb.c xen/arch/ia64/xenasm.S xen/arch/ia64/xenmem.c xen/arch/ia64/xenmisc.c xen/arch/ia64/xensetup.c xen/arch/ia64/xentime.c xen/arch/x86/Makefile xen/arch/x86/acpi/boot.c xen/arch/x86/apic.c xen/arch/x86/audit.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_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/entry.S xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c xen/common/ac_timer.c xen/common/dom0_ops.c xen/common/dom_mem_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/grant_table.c xen/common/lib.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/console.c xen/drivers/char/ns16550.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/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/serial.h xen/include/asm-ia64/tlb.h xen/include/asm-ia64/vcpu.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/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.h xen/include/asm-x86/shadow.h xen/include/asm-x86/shadow_64.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_virpit.h xen/include/asm-x86/vmx_vmcs.h xen/include/asm-x86/x86_32/page-3level.h xen/include/asm-x86/x86_32/uaccess.h xen/include/asm-x86/x86_64/page.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/netif.h xen/include/public/physdev.h xen/include/public/trace.h xen/include/public/xen.h xen/include/xen/ac_timer.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_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	Tue Aug 23 18:43:18 2005 -0800
     1.2 +++ b/.hgignore	Thu Aug 25 15:53:20 2005 -0700
     1.3 @@ -69,25 +69,25 @@
     1.4  ^tools/blktap/blkdump$
     1.5  ^tools/blktap/blkgnbd$
     1.6  ^tools/blktap/blkimg$
     1.7 -^tools/blktap/blockstore\.dat$
     1.8 -^tools/blktap/blockstored$
     1.9  ^tools/blktap/bstest$
    1.10 -^tools/blktap/parallax$
    1.11  ^tools/blktap/vdi\.dot$
    1.12  ^tools/blktap/vdi\.ps$
    1.13 -^tools/blktap/vdi_create$
    1.14 -^tools/blktap/vdi_fill$
    1.15 -^tools/blktap/vdi_list$
    1.16 -^tools/blktap/vdi_snap$
    1.17 -^tools/blktap/vdi_snap_list$
    1.18 -^tools/blktap/vdi_tree$
    1.19 -^tools/blktap/vdi_validate$
    1.20 +^tools/blktap/parallax/vdi_create$
    1.21 +^tools/blktap/parallax/vdi_fill$
    1.22 +^tools/blktap/parallax/vdi_list$
    1.23 +^tools/blktap/parallax/vdi_snap$
    1.24 +^tools/blktap/parallax/vdi_snap_list$
    1.25 +^tools/blktap/parallax/vdi_snap_delete$
    1.26 +^tools/blktap/parallax/vdi_tree$
    1.27 +^tools/blktap/parallax/vdi_validate$
    1.28 +^tools/blktap/parallax/parallax$
    1.29 +^tools/blktap/parallax/blockstored$
    1.30  ^tools/blktap/xen/.*$
    1.31  ^tools/check/\..*$
    1.32  ^tools/cmdline/.*$
    1.33  ^tools/cmdline/xen/.*$
    1.34 -^tools/consoled/consoled$
    1.35 -^tools/consoled/xc_console$
    1.36 +^tools/console/xenconsoled$
    1.37 +^tools/console/xenconsole$
    1.38  ^tools/debugger/pdb/pdb$
    1.39  ^tools/debugger/pdb/linux-[0-9.]*-module/.*\.ko$
    1.40  ^tools/debugger/pdb/linux-[0-9.]*-module/.*\.mod.c$
    1.41 @@ -116,7 +116,6 @@
    1.42  ^tools/ioemu/target-.*/Makefile$
    1.43  ^tools/ioemu/target-.*/config\..*$
    1.44  ^tools/ioemu/target-.*/qemu-dm$
    1.45 -^tools/ioemu/target-.*/qemu-vgaram-bin$
    1.46  ^tools/libxc/xen/.*$
    1.47  ^tools/misc/cpuperf/cpuperf-perfcntr$
    1.48  ^tools/misc/cpuperf/cpuperf-xen$
    1.49 @@ -148,6 +147,7 @@
    1.50  ^tools/xcs/xcsdump$
    1.51  ^tools/xcutils/xc_restore$
    1.52  ^tools/xcutils/xc_save$
    1.53 +^tools/xenstat/xentop/xentop$
    1.54  ^tools/xenstore/testsuite/tmp/.*$
    1.55  ^tools/xenstore/xen$
    1.56  ^tools/xenstore/xenstored$
     2.1 --- a/Config.mk	Tue Aug 23 18:43:18 2005 -0800
     2.2 +++ b/Config.mk	Thu Aug 25 15:53:20 2005 -0700
     2.3 @@ -7,13 +7,14 @@ XEN_TARGET_X86_PAE  ?= n
     2.4  
     2.5  # Tools to run on system hosting the build
     2.6  HOSTCC     = gcc
     2.7 -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
     2.8 +HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
     2.9  
    2.10  AS         = $(CROSS_COMPILE)as
    2.11  LD         = $(CROSS_COMPILE)ld
    2.12  CC         = $(CROSS_COMPILE)gcc
    2.13  CPP        = $(CROSS_COMPILE)gcc -E
    2.14  AR         = $(CROSS_COMPILE)ar
    2.15 +RANLIB     = $(CROSS_COMPILE)ranlib
    2.16  NM         = $(CROSS_COMPILE)nm
    2.17  STRIP      = $(CROSS_COMPILE)strip
    2.18  OBJCOPY    = $(CROSS_COMPILE)objcopy
    2.19 @@ -35,3 +36,15 @@ CFLAGS += $(foreach i, $(EXTRA_INCLUDES)
    2.20  
    2.21  # Choose the best mirror to download linux kernel
    2.22  KERNEL_REPO = http://www.kernel.org
    2.23 +
    2.24 +# ACM_USE_SECURITY_POLICY is set to security policy of Xen
    2.25 +# Supported models are:
    2.26 +#	ACM_NULL_POLICY (ACM will not be built with this policy)
    2.27 +#	ACM_CHINESE_WALL_POLICY
    2.28 +#	ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY
    2.29 +#	ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY
    2.30 +ACM_USE_SECURITY_POLICY ?= ACM_NULL_POLICY
    2.31 +
    2.32 +# Optional components
    2.33 +XENSTAT_XENTOP ?= y
    2.34 +
     3.1 --- a/Makefile	Tue Aug 23 18:43:18 2005 -0800
     3.2 +++ b/Makefile	Thu Aug 25 15:53:20 2005 -0700
     3.3 @@ -101,11 +101,6 @@ mrproper: clean
     3.4  	for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
     3.5  	for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
     3.6  
     3.7 -install-twisted:
     3.8 -	wget http://www.twistedmatrix.com/products/get-current.epy
     3.9 -	tar -zxf Twisted-*.tar.gz
    3.10 -	cd Twisted-* && python setup.py install
    3.11 -
    3.12  install-logging: LOGGING=logging-0.4.9.2
    3.13  install-logging:
    3.14  	[ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
    3.15 @@ -149,7 +144,6 @@ help:
    3.16  	@echo '  kclean           - clean guest kernel build trees'
    3.17  	@echo ''
    3.18  	@echo 'Dependency installation targets:'
    3.19 -	@echo '  install-twisted  - install the Twisted Matrix Framework'
    3.20  	@echo '  install-logging  - install the Python Logging package'
    3.21  	@echo '  install-iptables - install iptables tools'
    3.22  	@echo ''
    3.23 @@ -178,6 +172,12 @@ uninstall:
    3.24  	rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
    3.25  	rm -rf $(D)/boot/*xen*
    3.26  	rm -rf $(D)/lib/modules/*xen*
    3.27 +	rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
    3.28 +	rm -rf $(D)/usr/bin/xc_shadow
    3.29 +	rm -rf $(D)/usr/share/xen $(D)/usr/libexec/xen
    3.30 +	rm -rf $(D)/usr/share/man/man1/xen*
    3.31 +	rm -rf $(D)/usr/share/man/man8/xen*
    3.32 +	rm -rf $(D)/usr/lib/xen
    3.33  
    3.34  # Legacy targets for compatibility
    3.35  linux24:
     4.1 --- a/buildconfigs/Rules.mk	Tue Aug 23 18:43:18 2005 -0800
     4.2 +++ b/buildconfigs/Rules.mk	Thu Aug 25 15:53:20 2005 -0700
     4.3 @@ -66,6 +66,7 @@ pristine-%/.valid-pristine: %.tar.bz2
     4.4  
     4.5  PATCHDIRS := $(wildcard patches/*-*)
     4.6  
     4.7 +ifneq ($(PATCHDIRS),)
     4.8  -include $(patsubst %,%/.makedep,$(PATCHDIRS))
     4.9  
    4.10  $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
    4.11 @@ -80,6 +81,7 @@ ref-%/.valid-ref: pristine-%/.valid-pris
    4.12  	([ -d patches/$* ] && \
    4.13  	  for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
    4.14  	touch $@ # update timestamp to avoid rebuild
    4.15 +endif
    4.16  
    4.17  %-build:
    4.18  	$(MAKE) -f buildconfigs/mk.$* build
    4.19 @@ -115,7 +117,7 @@ config-update-pae:
    4.20  ifeq ($(XEN_TARGET_X86_PAE),y)
    4.21  	sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
    4.22  else
    4.23 -	@: # do nothing yet
    4.24 +	grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
    4.25  endif
    4.26  
    4.27  # never delete any intermediate files.
     8.1 --- a/docs/misc/shype4xen_readme.txt	Tue Aug 23 18:43:18 2005 -0800
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,588 +0,0 @@
     8.4 -Copyright: IBM Corporation (C)
     8.5 -20 June 2005
     8.6 -Author: Reiner Sailer
     8.7 -
     8.8 -This document is a very short introduction into the sHype access control 
     8.9 -security architecture implementation and how it is perceived by users. It 
    8.10 -is a very preliminary draft  for the courageous ones to get "their feet wet" 
    8.11 -and to be able to give feedback (via the xen-devel/xense-devel mailing lists).
    8.12 -
    8.13 -Install:
    8.14 -
    8.15 -cd into xeno-unstable.bk 
    8.16 -(use --dry-run option if you want to test the patch only)
    8.17 -patch -p1 -g0 < *tools.diff
    8.18 -patch -p1 -g0 < *xen.diff
    8.19 -
    8.20 -(no rejects, probably some line offsets)
    8.21 -
    8.22 -make uninstall; make mrproper; make; ./install.sh should install the default 
    8.23 -sHype into Xen (rebuild your initrd images if necessary). Reboot.
    8.24 -
    8.25 -Debug output: there are two triggers for debug output:
    8.26 -a) General sHype debug:
    8.27 -    xeno-unstable.bk/xen/include/public/acm.h
    8.28 -    undefine ACM_DEBUG to switch this debug off
    8.29 -
    8.30 -b) sHype enforcement hook trace: This prints a small trace for each enforcement 
    8.31 -hook that is executed. The trigger is in
    8.32 -    xeno-unstable.bk/xen/include/acm/acm_hooks.h
    8.33 -    undefine ACM_TRACE_MODE to switch this debug off
    8.34 -
    8.35 -1. The default NULL policy
    8.36 -***************************
    8.37 -When you apply the patches and startup xen, you should at first not notice any 
    8.38 -difference because the default policy is the "NULL" policy, which as the name 
    8.39 -implies does not enforce anything.
    8.40 -
    8.41 -To display the currently enforced policy, use the policy tool under xeno-
    8.42 -unstable.bk/tools/policy: policy_tool getpolicy. You should see output like the 
    8.43 -one below.
    8.44 -
    8.45 -[root@laptop policy]#./policy_tool getpolicy
    8.46 -
    8.47 -Policy dump:
    8.48 -============
    8.49 -Magic     = 1debc.
    8.50 -PolVer    = aaaa0000.
    8.51 -Len       = 14.
    8.52 -Primary   = NULL policy (c=0, off=14).
    8.53 -Secondary = NULL policy (c=0, off=14).
    8.54 -No primary policy (NULL).
    8.55 -No secondary policy (NULL).
    8.56 -
    8.57 -Policy dump End.
    8.58 -
    8.59 -Since this is a dump of a binary policy, it's not pretty. The important parts 
    8.60 -are the "Primary" and "Secondary" policy fields set to "NULL policy". sHype 
    8.61 -currently allows to set two independent policies; thus the two SSID-REF parts 
    8.62 -shown in 'xm list'. Right here: primary policy only means this policy is 
    8.63 -checked first, the secondary policy is checked if the primary results in 
    8.64 -"permitted access". The result of the combined policy is "permitted" if both 
    8.65 -policies return permitted (NULL policy always returns permitted). The result is 
    8.66 -"denied" if at least one of the policies returns "denied". Look into xeno-
    8.67 -unstable.bk/xen/include/acm/acm_hooks.h for the general hook structure 
    8.68 -integrating the policy decisions (if you like, you won't need it for the rest 
    8.69 -of the Readme file).
    8.70 -
    8.71 -2. Setting Chinese Wall and Simple Type Enforcement policies:
    8.72 -*************************************************************
    8.73 -
    8.74 -We'll get fast to the point. However, in order to understand what we are doing, 
    8.75 -we must at least understand the purpose of the policies that we are going to 
    8.76 -enforce. The two policies presented here are just examples and the 
    8.77 -implementation encourages adding new policies easily.
    8.78 -
    8.79 -2.1. Chinese Wall policy: "decides whether a domain can be started based on 
    8.80 -this domain's ssidref and the ssidrefs of the currently running domains". 
    8.81 -Generally, the Chinese wall policy allows specifying certain types (or classes 
    8.82 -or categories, whatever the preferred word) that conflict; we usually assign a 
    8.83 -type to a workload and the set of types of those workloads running in a domain 
    8.84 -make up the type set for this domain.  Each domain is assigned a set of types 
    8.85 -through its SSID-REF (we register Chinese Wall as primary policy, so the 
    8.86 -ssidref used for determining the Chinese Wall types is the one annotated with 
    8.87 -"p:" in xm list) since each SSID-REF points at a set of types. We'll see how 
    8.88 -SSIDREFs are represented in Xen later when we will look at the policy. (A good 
    8.89 -read for Chinese Wall is: Brewer/Nash The Chinese Wall Security Policy 1989.)
    8.90 -
    8.91 -So let's assume the Chinese Wall policy we are running distinguishes 10 types: 
    8.92 -t0 ... t9. Let us assume further that each SSID-REF points to a set that 
    8.93 -includes exactly one type (attached to domains that run workloads of a single 
    8.94 -type). SSID-REF 0 points to {t0}, ssidref 1 points to {t1} ... 9 points to 
    8.95 -{t9}. [This is actually the example policy we are going to push into xen later]
    8.96 -
    8.97 -Now the Chinese Wall policy allows you to define "Conflict type sets" and it 
    8.98 -guarantees that of any conflict set at most one type is "running" at any time. 
    8.99 -As an example, we have defined 2 conflict set: {t2, t3} and {t0, t5, t6}. 
   8.100 -Specifying these conflict sets, sHype ensures that at most one type of each set 
   8.101 -is running (either t2 or t3 but not both; either t0 or t5 or t6 but not 
   8.102 -multiple of them).
   8.103 -
   8.104 -The effect is that administrators can define which workload types cannot run 
   8.105 -simultaneously on a single Xen system. This is useful to limit the covert 
   8.106 -timing channels between such payloads or to ensure that payloads don't 
   8.107 -interfere with each other through existing resource dependencies.
   8.108 -
   8.109 -2.2. Simple Type Enforcement (ste) policy: "decides whether two domains can 
   8.110 -share data, e.g., setup event channels or grant tables to each other, based on 
   8.111 -the two domains' ssidref. This, as the name says, is a simple policy. Think of 
   8.112 -each type as of a single color. Each domain has one or more colors, i.e., the 
   8.113 -domains ssid for the ste policy points to a set that has set one or multiple 
   8.114 -types. Let us assume in our example policy we differentiate 5 colors (types) 
   8.115 -and define 5 different ssids referenced by ssidref=0..4. Each ssid shall have 
   8.116 -exactly one type set, i.e., describes a uni-color. Only ssid(0) has all types 
   8.117 -set, i.e., has all defined colors.
   8.118 -
   8.119 -Sharing is enforced by the ste policy by requiring that two domains that want 
   8.120 -to establish an event channel or grant pages to each other must have a common 
   8.121 -color. Currently all domains communicate through DOM0 by default; i.e., Domain0 
   8.122 -will necessarily have all colors to be able to create domains (thus, we will 
   8.123 -assign ssidref(0) to Domain0 in our example below.
   8.124 -
   8.125 -More complex mandatory access control policies governing sharing will follow; 
   8.126 -such policies are more sophisticated than the "color" scheme above by allowing 
   8.127 -more flexible (and complex :_) access control decisions than "share a color" or 
   8.128 -"don't share a color" and will be able to express finer-grained policies.
   8.129 -
   8.130 -
   8.131 -2.3 Binary Policy:
   8.132 -In the future, we will have a policy tool that takes as input a more humane 
   8.133 -policy description, using types such as development, home-banking, donated-
   8.134 -Grid, CorpA-Payload ... and translates the respective policy into what we see 
   8.135 -today as the binary policy using 1s and 0s and sets of them. For now, we must 
   8.136 -live with the binary policy when working with sHype.
   8.137 -
   8.138 -    
   8.139 -2.4 Exemplary use of a real sHype policy on Xen. To activate a real policy, 
   8.140 -edit the file (yes, this will soon be a compile option):
   8.141 -  xeno-unstable.bk/xen/include/public/acm.h
   8.142 -  Change: #define ACM_USE_SECURITY_POLICY ACM_NULL_POLICY
   8.143 -   To : #define ACM_USE_SECURITY_POLICY ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY
   8.144 -   cd xeno-unstable.bk
   8.145 -   make mrproper
   8.146 -   make uninstall (manually remove /etc/xen.old if necessary)
   8.147 -   make
   8.148 -   ./install.sh      (recreate your kernel initrd's if necessary)
   8.149 -   Reboot into new xen.gz
   8.150 -     
   8.151 -After booting, check out 'xm dmesg'; should show somewhere in the middle:
   8.152 -
   8.153 -(XEN) acm_init: Enforcing Primary CHINESE WALL policy, Secondary SIMPLE TYPE 
   8.154 -ENFORCEMENT policy.
   8.155 -
   8.156 -Even though you can activate those policies in any combination and also 
   8.157 -independently, the policy tool currently only supports setting the policy for 
   8.158 -the above combination.
   8.159 -
   8.160 -Now look at the minimal startup policy with:
   8.161 -                xeno-unstable.bk/tools/policytool getpolicy
   8.162 -
   8.163 -You should see something like:
   8.164 -
   8.165 -[root@laptop policy]# ./policy_tool getpolicy
   8.166 -
   8.167 -Policy dump:
   8.168 -============
   8.169 -Magic     = 1debc.
   8.170 -PolVer    = aaaa0000.
   8.171 -Len       = 36.
   8.172 -Primary   = CHINESE WALL policy (c=1, off=14).
   8.173 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=2c).
   8.174 -
   8.175 -
   8.176 -Chinese Wall policy:
   8.177 -====================
   8.178 -Max Types     = 1.
   8.179 -Max Ssidrefs  = 1.
   8.180 -Max ConfSets  = 1.
   8.181 -Ssidrefs Off  = 10.
   8.182 -Conflicts Off = 12.
   8.183 -Runing T. Off = 14.
   8.184 -C. Agg. Off   = 16.
   8.185 -
   8.186 -SSID To CHWALL-Type matrix:
   8.187 -
   8.188 -   ssidref 0:  00 
   8.189 -
   8.190 -Confict Sets:
   8.191 -
   8.192 -   c-set 0:    00 
   8.193 -
   8.194 -Running
   8.195 -Types:         00 
   8.196 -
   8.197 -Conflict
   8.198 -Aggregate Set: 00 
   8.199 -
   8.200 -
   8.201 -Simple Type Enforcement policy:
   8.202 -===============================
   8.203 -Max Types     = 1.
   8.204 -Max Ssidrefs  = 1.
   8.205 -Ssidrefs Off  = 8.
   8.206 -
   8.207 -SSID To STE-Type matrix:
   8.208 -
   8.209 -   ssidref 0: 01 
   8.210 -
   8.211 -
   8.212 -Policy dump End.
   8.213 -
   8.214 -This is a minimal policy (of little use), except it will disable starting any 
   8.215 -domain that does not have ssidref set to 0x0. The Chinese Wall policy has 
   8.216 -nothing to enforce and the ste policy only knows one type, which is set for the 
   8.217 -only defined ssidref.
   8.218 -
   8.219 -The item that defines the ssidref in a domain configuration is:
   8.220 -
   8.221 -ssidref = 0x12345678
   8.222 -
   8.223 -Where ssidref is interpreted as a 32bit number, where the lower 16bits become 
   8.224 -the ssidref for the primary policy and the higher 16bits become the ssidref for 
   8.225 -the secondary policy. sHype currently supports two policies but this is an 
   8.226 -implementation decision and can be extended if necessary.
   8.227 -
   8.228 -This reference defines the security information of a domain. The meaning of the 
   8.229 -SSID-REF depends on the policy, so we explain it when we explain the real 
   8.230 -policies.
   8.231 -
   8.232 -
   8.233 -Setting a new Security Policy:
   8.234 -******************************
   8.235 -The policy tool with all its current limitations has one usable example policy 
   8.236 -compiled-in. Please try at this time to use the setpolicy command:
   8.237 -       xeno-unstable.bk/tools/policy/policy_tool setpolicy
   8.238 -
   8.239 -You should see a dump of the policy you are setting. It should say at the very 
   8.240 -end: 
   8.241 -
   8.242 -Policy successfully set.
   8.243 -
   8.244 -Now try to dump the currently enforced policy, which is the policy we have just 
   8.245 -set and the dynamic security state information of this policy 
   8.246 -(<<< ... some additional explanations)
   8.247 -
   8.248 -[root@laptop policy]# ./policy_tool getpolicy
   8.249 -
   8.250 -Policy dump:
   8.251 -============
   8.252 -Magic     = 1debc.
   8.253 -PolVer    = aaaa0000.
   8.254 -Len       = 112.
   8.255 -Primary   = CHINESE WALL policy (c=1, off=14).
   8.256 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   8.257 -
   8.258 -
   8.259 -Chinese Wall policy:
   8.260 -====================
   8.261 -Max Types     = a.
   8.262 -Max Ssidrefs  = 5.
   8.263 -Max ConfSets  = 2.
   8.264 -Ssidrefs Off  = 10.
   8.265 -Conflicts Off = 74.
   8.266 -Runing T. Off = 9c.
   8.267 -C. Agg. Off   = b0.
   8.268 -
   8.269 -SSID To CHWALL-Type matrix:
   8.270 -
   8.271 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00  <<< type0 is set for ssidref0
   8.272 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00 
   8.273 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00 
   8.274 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00 
   8.275 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00  <<< type4 is set for ssidref4
   8.276 -                                              <<< types 5-9 are unused
   8.277 -Confict Sets:
   8.278 -
   8.279 -   c-set 0:    00 00 01 01 00 00 00 00 00 00  <<< type2 and type3 never run together
   8.280 -   c-set 1:    01 00 00 00 00 01 01 00 00 00  <<< only one of types 0, 5 or 6 
   8.281 -                                              <<<   can run simultaneously
   8.282 -Running
   8.283 -Types:         01 00 00 00 00 00 00 00 00 00  <<< ref-count for types of running domains
   8.284 -
   8.285 -Conflict
   8.286 -Aggregate Set: 00 00 00 00 00 01 01 00 00 00  <<< aggregated set of types that                  
   8.287 -                                              <<< cannot run because they 
   8.288 -                                              <<< are in conflict set 1 and
   8.289 -                                              <<< (domain 0 is running w t0)
   8.290 -                                             
   8.291 -
   8.292 -Simple Type Enforcement policy:
   8.293 -===============================
   8.294 -Max Types     = 5.
   8.295 -Max Ssidrefs  = 5.
   8.296 -Ssidrefs Off  = 8.
   8.297 -
   8.298 -SSID To STE-Type matrix:
   8.299 -
   8.300 -   ssidref 0: 01 01 01 01 01                  <<< ssidref0 points to a set that                  
   8.301 -                                              <<< has all types set (colors)
   8.302 -   ssidref 1: 00 01 00 00 00                  <<< ssidref1 has color1 set
   8.303 -   ssidref 2: 00 00 01 00 00                  <<< ...
   8.304 -   ssidref 3: 00 00 00 01 00 
   8.305 -   ssidref 4: 00 00 00 00 01 
   8.306 -
   8.307 -
   8.308 -Policy dump End.
   8.309 -
   8.310 -
   8.311 -This is a small example policy with which we will demonstrate the enforcement.
   8.312 -
   8.313 -Starting Domains with policy enforcement
   8.314 -========================================
   8.315 -Now let us play with this policy. 
   8.316 -
   8.317 -Define 3 or 4 domain configurations. I use the following config using a ramdisk 
   8.318 -only and about 8MBytes of memory for each DomU (test purposes):
   8.319 -
   8.320 -#-------configuration xmsec1-------------------------
   8.321 -kernel = "/boot/vmlinuz-2.6.11-xenU"
   8.322 -ramdisk="/boot/U1_ramdisk.img"
   8.323 -#security reference identifier
   8.324 -ssidref= 0x00010001
   8.325 -memory = 10
   8.326 -name = "xmsec1"
   8.327 -cpu = -1   # leave to Xen to pick
   8.328 -# Number of network interfaces. Default is 1.
   8.329 -nics=1
   8.330 -dhcp="dhcp"
   8.331 -#-----------------------------------------------------
   8.332 -
   8.333 -xmsec2 and xmsec3 look the same except for the name and the ssidref line. Use 
   8.334 -your domain config file and add "ssidref = 0x00010001" to the first (xmsec1),  
   8.335 -"ssidref= 0x00020002" to the second (call it xmsec2), and "ssidref=0x00030003"  
   8.336 -to the third (we will call this one xmsec3).
   8.337 -
   8.338 -First start xmsec1: xm create -c xmsec1 (succeeds)
   8.339 -
   8.340 -Then
   8.341 -[root@laptop policy]# xm list 
   8.342 -Name              Id  Mem(MB)  CPU  State  Time(s)  Console  
   8.343 -Domain-0           0      620   0  r----     42.3            s:00/p:00
   8.344 -xmnosec            1        9   0  -b---      0.3    9601    s:00/p:05
   8.345 -xmsec1             2        9   0  -b---      0.2    9602    s:01/p:01
   8.346 -
   8.347 -Shows a new domain xmsec1 running with primary (here: chinese wall) ssidref 1 
   8.348 -and secondary (here: simple type enforcement) ssidref 1. The ssidrefs are  
   8.349 -independent and can differ for a domain.
   8.350 -
   8.351 -[root@laptop policy]# ./policy_tool getpolicy
   8.352 -
   8.353 -Policy dump:
   8.354 -============
   8.355 -Magic     = 1debc.
   8.356 -PolVer    = aaaa0000.
   8.357 -Len       = 112.
   8.358 -Primary   = CHINESE WALL policy (c=1, off=14).
   8.359 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   8.360 -
   8.361 -
   8.362 -Chinese Wall policy:
   8.363 -====================
   8.364 -Max Types     = a.
   8.365 -Max Ssidrefs  = 5.
   8.366 -Max ConfSets  = 2.
   8.367 -Ssidrefs Off  = 10.
   8.368 -Conflicts Off = 74.
   8.369 -Runing T. Off = 9c.
   8.370 -C. Agg. Off   = b0.
   8.371 -
   8.372 -SSID To CHWALL-Type matrix:
   8.373 -
   8.374 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00
   8.375 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00
   8.376 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00
   8.377 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00
   8.378 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00
   8.379 -
   8.380 -Confict Sets:
   8.381 -
   8.382 -   c-set 0:    00 00 01 01 00 00 00 00 00 00
   8.383 -   c-set 1:    01 00 00 00 00 01 01 00 00 00   <<< t1 is not part of any c-set
   8.384 -
   8.385 -Running
   8.386 -Types:         01 01 00 00 00 00 00 00 00 00   <<< xmsec1 has ssidref 1->type1
   8.387 -                  ^^                           <<< ref-count at position 1 incr
   8.388 -Conflict
   8.389 -Aggregate Set: 00 00 00 00 00 01 01 00 00 00   <<< domain 1 was allowed to       
   8.390 -                                               <<< start since type 1 was not
   8.391 -                                               <<< in conflict with running 
   8.392 -                                               <<< types
   8.393 -                                            
   8.394 -Simple Type Enforcement policy:
   8.395 -===============================
   8.396 -Max Types     = 5.
   8.397 -Max Ssidrefs  = 5.
   8.398 -Ssidrefs Off  = 8.
   8.399 -
   8.400 -SSID To STE-Type matrix:
   8.401 -
   8.402 -   ssidref 0: 01 01 01 01 01           <<< the ste policy does not maintain; we
   8.403 -   ssidref 1: 00 01 00 00 00   <--     <<< see that domain xmsec1 has ste 
   8.404 -   ssidref 2: 00 00 01 00 00           <<< ssidref1->type1 and has this type in
   8.405 -   ssidref 3: 00 00 00 01 00           <<< common with dom0
   8.406 -   ssidref 4: 00 00 00 00 01
   8.407 -
   8.408 -
   8.409 -Policy dump End.
   8.410 -
   8.411 -Look at sHype output in xen dmesg:
   8.412 -
   8.413 -[root@laptop xen]# xm dmesg
   8.414 -.
   8.415 -.
   8.416 -[somewhere near the very end]
   8.417 -(XEN) chwall_init_domain_ssid: determined chwall_ssidref to 1.
   8.418 -(XEN) ste_init_domain_ssid.
   8.419 -(XEN) ste_init_domain_ssid: determined ste_ssidref to 1.
   8.420 -(XEN) acm_init_domain_ssid: Instantiated individual ssid for domain 0x01.
   8.421 -(XEN) chwall_post_domain_create.
   8.422 -(XEN) ste_pre_eventchannel_interdomain.
   8.423 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   8.424 -(XEN) shype_authorize_domops.
   8.425 -(XEN) ste_pre_eventchannel_interdomain.
   8.426 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   8.427 -(XEN) ste_pre_eventchannel_interdomain.
   8.428 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   8.429 -
   8.430 -
   8.431 -You can see that the chinese wall policy does not complain and that the ste 
   8.432 -policy makes three access control decisions for three event-channels setup 
   8.433 -between domain 0 and the new domain 1. Each time, the two domains share the 
   8.434 -type1 and setting up the eventchannel is permitted.
   8.435 -
   8.436 -
   8.437 -Starting up a second domain xmsec2:
   8.438 -
   8.439 -[root@laptop xen]# xm create -c xmsec2
   8.440 -Using config file "xmsec2".
   8.441 -Started domain xmsec2, console on port 9602
   8.442 -************ REMOTE CONSOLE: CTRL-] TO QUIT ********
   8.443 -Linux version 2.6.11-xenU (root@laptop.home.org) (gcc version 3.4.2 20041017 
   8.444 -(Red Hat 3.4.2-6.fc3)) #1 Wed Mar 30 13:14:31 EST 2005
   8.445 -.
   8.446 -.
   8.447 -.
   8.448 -[root@laptop policy]# xm list
   8.449 -Name              Id  Mem(MB)  CPU  State  Time(s)  Console  
   8.450 -Domain-0           0      620   0  r----     71.7            s:00/p:00
   8.451 -xmsec1             1        9   0  -b---      0.3    9601    s:01/p:01
   8.452 -xmsec2             2        7   0  -b---      0.3    9602    s:02/p:02   << our domain runs both policies with ssidref 2
   8.453 -
   8.454 -
   8.455 -[root@laptop policy]# ./policy_tool getpolicy
   8.456 -
   8.457 -Policy dump:
   8.458 -============
   8.459 -Magic     = 1debc.
   8.460 -PolVer    = aaaa0000.
   8.461 -Len       = 112.
   8.462 -Primary   = CHINESE WALL policy (c=1, off=14).
   8.463 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   8.464 -
   8.465 -
   8.466 -Chinese Wall policy:
   8.467 -====================
   8.468 -Max Types     = a.
   8.469 -Max Ssidrefs  = 5.
   8.470 -Max ConfSets  = 2.
   8.471 -Ssidrefs Off  = 10.
   8.472 -Conflicts Off = 74.
   8.473 -Runing T. Off = 9c.
   8.474 -C. Agg. Off   = b0.
   8.475 -
   8.476 -SSID To CHWALL-Type matrix:
   8.477 -
   8.478 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00
   8.479 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00
   8.480 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00   <<< our domain has type 2 set
   8.481 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00
   8.482 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00
   8.483 -
   8.484 -Confict Sets:
   8.485 -
   8.486 -   c-set 0:    00 00 01 01 00 00 00 00 00 00   <<< t2 is in c-set0 with type 3
   8.487 -   c-set 1:    01 00 00 00 00 01 01 00 00 00
   8.488 -
   8.489 -Running
   8.490 -Types:         01 01 01 00 00 00 00 00 00 00   <<< t2 is running since the 
   8.491 -                     ^^                        <<< current aggregate conflict
   8.492 -                                               <<< set (see above) does not 
   8.493 -                                               <<< include type 2
   8.494 -Conflict
   8.495 -Aggregate Set: 00 00 00 01 00 01 01 00 00 00   <<< type 3 is added to the 
   8.496 -                                               <<< conflict aggregate
   8.497 -
   8.498 -
   8.499 -Simple Type Enforcement policy:
   8.500 -===============================
   8.501 -Max Types     = 5.
   8.502 -Max Ssidrefs  = 5.
   8.503 -Ssidrefs Off  = 8.
   8.504 -
   8.505 -SSID To STE-Type matrix:
   8.506 -
   8.507 -   ssidref 0: 01 01 01 01 01
   8.508 -   ssidref 1: 00 01 00 00 00
   8.509 -   ssidref 2: 00 00 01 00 00
   8.510 -   ssidref 3: 00 00 00 01 00
   8.511 -   ssidref 4: 00 00 00 00 01
   8.512 -
   8.513 -
   8.514 -Policy dump End.
   8.515 -
   8.516 -
   8.517 -The sHype xen dmesg output looks similar to the one above when starting the 
   8.518 -first domain.
   8.519 -
   8.520 -Now we start xmsec3 and it has ssidref3. Thus, it tries to run as type3 which 
   8.521 -conflicts with running type2 (from xmsec2). As expected, creating this domain 
   8.522 -fails for security policy enforcement reasons.
   8.523 -
   8.524 -[root@laptop xen]# xm create -c xmsec3
   8.525 -Using config file "xmsec3".
   8.526 -Error: Error creating domain: (22, 'Invalid argument')
   8.527 -[root@laptop xen]#
   8.528 -
   8.529 -[root@laptop xen]# xm dmesg
   8.530 -.
   8.531 -.
   8.532 -[somewhere near the very end]
   8.533 -(XEN) chwall_pre_domain_create.
   8.534 -(XEN) chwall_pre_domain_create: CHINESE WALL CONFLICT in type 03.
   8.535 -
   8.536 -xmsec3 ssidref3 points to type3, which is in the current conflict aggregate 
   8.537 -set. This domain cannot start until domain xmsec2 is destroyed, at which time 
   8.538 -the aggregate conflict set is reduced and type3 is excluded from it. Then, 
   8.539 -xmsec3 can start. Of course, afterwards, xmsec2 cannot be restarted. Try it.
   8.540 -
   8.541 -3. Policy tool
   8.542 -**************
   8.543 -toos/policy/policy_tool.c
   8.544 -
   8.545 -a) ./policy_tool getpolicy
   8.546 -      prints the currently enforced policy
   8.547 -      (see for example section 1.)
   8.548 -
   8.549 -b) ./policy_tool setpolicy
   8.550 -      sets a predefined and hardcoded security
   8.551 -      policy (the one described in section 2.)
   8.552 -
   8.553 -c) ./policy_tool dumpstats
   8.554 -      prints some status information about the caching
   8.555 -      of access control decisions (number of cache hits
   8.556 -      and number of policy evaluations for grant_table
   8.557 -      and event channels).
   8.558 -
   8.559 -d) ./policy_tool loadpolicy <binary_policy_file>
   8.560 -      sets the policy defined in the <binary_policy_file>
   8.561 -      please use the policy_processor that is posted to this
   8.562 -      mailing list to create such a binary policy from an XML
   8.563 -      policy description
   8.564 -
   8.565 -4. Policy interface:
   8.566 -********************
   8.567 -The Policy interface is working in "network-byte-order" (big endian). The reason for this
   8.568 -is that policy files/management should be portable and independent of the platforms.
   8.569 -
   8.570 -Our policy interface enables managers to create a single binary policy file in a trusted
   8.571 -environment and distributed it to multiple systems for enforcement.
   8.572 -
   8.573 -5. Booting with a binary policy:
   8.574 -********************************
   8.575 -The grub configuration file can be adapted to boot the hypervisor with an
   8.576 -already active policy. To do this, a binary policy file - this can be
   8.577 -the same file as used by the policy_tool - should be placed into the boot
   8.578 -partition. The following entry from the grub configuration file shows how
   8.579 -a binary policy can be added to the system during boot time. Note that the 
   8.580 -binary policy must be of the same type that the hypervisor was compiled 
   8.581 -for. The policy module line should also only be added as the last module
   8.582 -line if XEN was compiled with the access control module (ACM).
   8.583 -
   8.584 -title XEN0 3.0 Devel
   8.585 -	kernel /xen.gz dom0_mem=400000
   8.586 -	module /vmlinuz-2.6.12-xen0 root=/dev/hda2 ro console=tty0
   8.587 -	module /initrd-2.6.12-xen0.img
   8.588 -	module /xen_sample_policy.bin
   8.589 -
   8.590 -
   8.591 -====================end-of file=======================================
     9.1 --- a/docs/src/user.tex	Tue Aug 23 18:43:18 2005 -0800
     9.2 +++ b/docs/src/user.tex	Thu Aug 25 15:53:20 2005 -0700
     9.3 @@ -1709,8 +1709,11 @@ editing \path{grub.conf}.
     9.4   For example: `com1=9600, 8n1, 0x408, 5' maps COM1 to a
     9.5   9600-baud port, 8 data bits, no parity, 1 stop bit,
     9.6   I/O port base 0x408, IRQ 5.
     9.7 - If the I/O base and IRQ are standard (com1:0x3f8,4;
     9.8 - com2:0x2f8,3) then they need not be specified. 
     9.9 + If some configuration options are standard (e.g., I/O base and IRQ),
    9.10 + then only a prefix of the full configuration string need be
    9.11 + specified. If the baud rate is pre-configured (e.g., by the
    9.12 + bootloader) then you can specify `auto' in place of a numeric baud
    9.13 + rate. 
    9.14  
    9.15  \item [console=$<$specifier list$>$ ] 
    9.16   Specify the destination for Xen console I/O.
    9.17 @@ -1760,7 +1763,7 @@ editing \path{grub.conf}.
    9.18   physical address in the memory map will be ignored. This parameter
    9.19   may be specified with a B, K, M or G suffix, representing bytes,
    9.20   kilobytes, megabytes and gigabytes respectively. The
    9.21 - default unit, if no suffix is specified, is bytes.
    9.22 + default unit, if no suffix is specified, is kilobytes.
    9.23  
    9.24  \item [dom0\_mem=xxx ] 
    9.25   Set the amount of memory to be allocated to domain0. In Xen 3.x the parameter
    10.1 --- a/extras/mini-os/include/hypervisor.h	Tue Aug 23 18:43:18 2005 -0800
    10.2 +++ b/extras/mini-os/include/hypervisor.h	Thu Aug 25 15:53:20 2005 -0700
    10.3 @@ -80,17 +80,43 @@ static __inline__ int HYPERVISOR_set_tra
    10.4  
    10.5  static __inline__ int HYPERVISOR_mmu_update(mmu_update_t *req, 
    10.6                                              int count, 
    10.7 -                                            int *success_count)
    10.8 +                                            int *success_count, 
    10.9 +                                            domid_t domid)
   10.10  {
   10.11      int ret;
   10.12 +    unsigned long ign1, ign2, ign3, ign4;
   10.13 +
   10.14      __asm__ __volatile__ (
   10.15          TRAP_INSTR
   10.16 -        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
   10.17 -        _a1 (req), _a2 (count), _a3 (success_count)  : "memory" );
   10.18 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   10.19 +        : "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
   10.20 +          "3" (success_count), "4" (domid)
   10.21 +        : "memory" );
   10.22  
   10.23      return ret;
   10.24  }
   10.25  
   10.26 +
   10.27 +static __inline__ int HYPERVISOR_mmuext_op(struct mmuext_op *op, 
   10.28 +                                           int count, 
   10.29 +                                           int *success_count, 
   10.30 +                                           domid_t domid)
   10.31 +{
   10.32 +    int ret;
   10.33 +    unsigned long ign1, ign2, ign3, ign4;
   10.34 +
   10.35 +    __asm__ __volatile__ (
   10.36 +        TRAP_INSTR
   10.37 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   10.38 +        : "0" (__HYPERVISOR_mmuext_op), "1" (op), "2" (count),
   10.39 +          "3" (success_count), "4" (domid)
   10.40 +        : "memory" );
   10.41 +
   10.42 +    return ret;
   10.43 +}
   10.44 +
   10.45 +
   10.46 +
   10.47  static __inline__ int HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
   10.48  {
   10.49      int ret;
    11.1 --- a/extras/mini-os/include/mm.h	Tue Aug 23 18:43:18 2005 -0800
    11.2 +++ b/extras/mini-os/include/mm.h	Thu Aug 25 15:53:20 2005 -0700
    11.3 @@ -43,13 +43,27 @@
    11.4  #define PADDR_MASK              ((1UL << PADDR_BITS)-1)
    11.5  #define VADDR_MASK              ((1UL << VADDR_BITS)-1)
    11.6  
    11.7 -#define pte_to_mfn(_pte) (((_pte) & (PADDR_MASK&PAGE_MASK)) >> PAGE_SHIFT)
    11.8 +#define pte_to_mfn(_pte) (((_pte) & (PADDR_MASK&PAGE_MASK)) >> L1_PAGETABLE_SHIFT)
    11.9 +
   11.10 +#endif
   11.11 +
   11.12 +
   11.13 +
   11.14 +#ifdef __i386__
   11.15 +
   11.16 +#define L1_PAGETABLE_SHIFT      12
   11.17 +#define L2_PAGETABLE_SHIFT      22
   11.18 +
   11.19 +#define L1_PAGETABLE_ENTRIES    1024
   11.20 +#define L2_PAGETABLE_ENTRIES    1024
   11.21 +#endif
   11.22  
   11.23  /* Given a virtual address, get an entry offset into a page table. */
   11.24  #define l1_table_offset(_a) \
   11.25    (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))
   11.26  #define l2_table_offset(_a) \
   11.27    (((_a) >> L2_PAGETABLE_SHIFT) & (L2_PAGETABLE_ENTRIES - 1))
   11.28 +#ifdef __x86_64__
   11.29  #define l3_table_offset(_a) \
   11.30    (((_a) >> L3_PAGETABLE_SHIFT) & (L3_PAGETABLE_ENTRIES - 1))
   11.31  #define l4_table_offset(_a) \
   11.32 @@ -67,13 +81,16 @@
   11.33  #define _PAGE_PSE      0x080UL
   11.34  #define _PAGE_GLOBAL   0x100UL
   11.35  
   11.36 -#define PAGE_SHIFT      12
   11.37 -#define PAGE_SIZE       (1UL << PAGE_SHIFT)
   11.38 +#define L1_PROT (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED)
   11.39 +#define L2_PROT (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_USER)
   11.40 +
   11.41 +#define PAGE_SIZE       (1UL << L1_PAGETABLE_SHIFT)
   11.42 +#define PAGE_SHIFT      L1_PAGETABLE_SHIFT
   11.43  #define PAGE_MASK       (~(PAGE_SIZE-1))
   11.44  
   11.45 -#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
   11.46 -#define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
   11.47 -#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
   11.48 +#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> L1_PAGETABLE_SHIFT)
   11.49 +#define PFN_DOWN(x)	((x) >> L1_PAGETABLE_SHIFT)
   11.50 +#define PFN_PHYS(x)	((x) << L1_PAGETABLE_SHIFT)
   11.51  
   11.52  /* to align the pointer to the (next) page boundary */
   11.53  #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
   11.54 @@ -83,14 +100,14 @@ extern unsigned long *phys_to_machine_ma
   11.55  #define mfn_to_pfn(_mfn) (machine_to_phys_mapping[(_mfn)])
   11.56  static __inline__ unsigned long phys_to_machine(unsigned long phys)
   11.57  {
   11.58 -    unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
   11.59 -    machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
   11.60 +    unsigned long machine = pfn_to_mfn(phys >> L1_PAGETABLE_SHIFT);
   11.61 +    machine = (machine << L1_PAGETABLE_SHIFT) | (phys & ~PAGE_MASK);
   11.62      return machine;
   11.63  }
   11.64  static __inline__ unsigned long machine_to_phys(unsigned long machine)
   11.65  {
   11.66 -    unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
   11.67 -    phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
   11.68 +    unsigned long phys = mfn_to_pfn(machine >> L1_PAGETABLE_SHIFT);
   11.69 +    phys = (phys << L1_PAGETABLE_SHIFT) | (machine & ~PAGE_MASK);
   11.70      return phys;
   11.71  }
   11.72  
   11.73 @@ -105,7 +122,10 @@ static __inline__ unsigned long machine_
   11.74  #define __va to_virt
   11.75  #define __pa to_phys
   11.76  
   11.77 +#define virt_to_pfn(_virt)         (PFN_DOWN(to_phys(_virt)))
   11.78 +
   11.79  void init_mm(void);
   11.80  unsigned long alloc_pages(int order);
   11.81 +int is_mfn_mapped(unsigned long mfn);
   11.82  
   11.83  #endif /* _MM_H_ */
    12.1 --- a/extras/mini-os/include/time.h	Tue Aug 23 18:43:18 2005 -0800
    12.2 +++ b/extras/mini-os/include/time.h	Thu Aug 25 15:53:20 2005 -0700
    12.3 @@ -28,7 +28,7 @@
    12.4   * of real time into system time 
    12.5   */
    12.6  typedef s64 s_time_t;
    12.7 -#define NOW()                   ((s_time_t)get_s_time())
    12.8 +#define NOW()                   ((s_time_t)monotonic_clock())
    12.9  #define SECONDS(_s)             (((s_time_t)(_s))  * 1000000000UL )
   12.10  #define TENTHS(_ts)             (((s_time_t)(_ts)) * 100000000UL )
   12.11  #define HUNDREDTHS(_hs)         (((s_time_t)(_hs)) * 10000000UL )
   12.12 @@ -36,7 +36,8 @@ typedef s64 s_time_t;
   12.13  #define MICROSECS(_us)          (((s_time_t)(_us)) * 1000UL )
   12.14  #define Time_Max                ((s_time_t) 0x7fffffffffffffffLL)
   12.15  #define FOREVER                 Time_Max
   12.16 -
   12.17 +#define NSEC_TO_USEC(_nsec)     (_nsec / 1000UL)
   12.18 +#define NSEC_TO_SEC(_nsec)      (_nsec / 1000000000ULL)
   12.19  
   12.20  /* wall clock time  */
   12.21  typedef long time_t;
   12.22 @@ -46,6 +47,11 @@ struct timeval {
   12.23  	suseconds_t	tv_usec;	/* microseconds */
   12.24  };
   12.25  
   12.26 +struct timespec {
   12.27 +    time_t      ts_sec;
   12.28 +    long        ts_nsec;
   12.29 +};
   12.30 +
   12.31  
   12.32  /* prototypes */
   12.33  void     init_time(void);
    13.1 --- a/extras/mini-os/kernel.c	Tue Aug 23 18:43:18 2005 -0800
    13.2 +++ b/extras/mini-os/kernel.c	Thu Aug 25 15:53:20 2005 -0700
    13.3 @@ -132,22 +132,8 @@ void start_kernel(start_info_t *si)
    13.4      i = 0;
    13.5      for ( ; ; ) 
    13.6      {      
    13.7 -        if(i >= 1000)         
    13.8 -        {
    13.9 -            {
   13.10 -                unsigned long saved;
   13.11 -                __asm__ ("movl %%esp, %0"
   13.12 -                         :"=r"(saved)  /* y is output operand */
   13.13 -                            /* x is input operand */);
   13.14 -//                        :"a"); /* %eax is clobbered register */
   13.15 -                printk("ESP=0x%lx\n", saved);
   13.16 -            }
   13.17 -            
   13.18 -            printk("1000 bloks\n");
   13.19 -            i=0;            
   13.20 -        }
   13.21  //        HYPERVISOR_yield();
   13.22 -        block(1);
   13.23 +        block(100);
   13.24          i++;
   13.25      }
   13.26  }
    14.1 --- a/extras/mini-os/mm.c	Tue Aug 23 18:43:18 2005 -0800
    14.2 +++ b/extras/mini-os/mm.c	Thu Aug 25 15:53:20 2005 -0700
    14.3 @@ -5,9 +5,9 @@
    14.4   *
    14.5   *        File: mm.c
    14.6   *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
    14.7 - *     Changes: 
    14.8 + *     Changes: Grzegorz Milos
    14.9   *              
   14.10 - *        Date: Aug 2003
   14.11 + *        Date: Aug 2003, chages Aug 2005
   14.12   * 
   14.13   * Environment: Xen Minimal OS
   14.14   * Description: memory management related functions
   14.15 @@ -41,86 +41,18 @@
   14.16  #include <types.h>
   14.17  #include <lib.h>
   14.18  
   14.19 +
   14.20 +#ifdef MM_DEBUG
   14.21 +#define DEBUG(_f, _a...) \
   14.22 +    printk("MINI_OS(file=mm.c, line=%d) " _f "\n", __LINE__, ## _a)
   14.23 +#else
   14.24 +#define DEBUG(_f, _a...)    ((void)0)
   14.25 +#endif
   14.26 +
   14.27  unsigned long *phys_to_machine_mapping;
   14.28  extern char *stack;
   14.29  extern char _text, _etext, _edata, _end;
   14.30  
   14.31 -static void init_page_allocator(unsigned long min, unsigned long max);
   14.32 -
   14.33 -void init_mm(void)
   14.34 -{
   14.35 -
   14.36 -    unsigned long start_pfn, max_pfn, max_free_pfn;
   14.37 -
   14.38 -    unsigned long *pgd = (unsigned long *)start_info.pt_base;
   14.39 -
   14.40 -    printk("MM: Init\n");
   14.41 -
   14.42 -    printk("  _text:        %p\n", &_text);
   14.43 -    printk("  _etext:       %p\n", &_etext);
   14.44 -    printk("  _edata:       %p\n", &_edata);
   14.45 -    printk("  stack start:  %p\n", &stack);
   14.46 -    printk("  _end:         %p\n", &_end);
   14.47 -
   14.48 -    /* set up minimal memory infos */
   14.49 -    start_pfn = PFN_UP(to_phys(&_end));
   14.50 -    max_pfn = start_info.nr_pages;
   14.51 -
   14.52 -    printk("  start_pfn:    %lx\n", start_pfn);
   14.53 -    printk("  max_pfn:      %lx\n", max_pfn);
   14.54 -
   14.55 -    /*
   14.56 -     * we know where free tables start (start_pfn) and how many we 
   14.57 -     * have (max_pfn). 
   14.58 -     * 
   14.59 -     * Currently the hypervisor stores page tables it providesin the
   14.60 -     * high region of the this memory range.
   14.61 -     * 
   14.62 -     * next we work out how far down this goes (max_free_pfn)
   14.63 -     * 
   14.64 -     * XXX this assumes the hypervisor provided page tables to be in
   14.65 -     * the upper region of our initial memory. I don't know if this 
   14.66 -     * is always true.
   14.67 -     */
   14.68 -
   14.69 -    max_free_pfn = PFN_DOWN(to_phys(pgd));
   14.70 -#ifdef __i386__
   14.71 -    {
   14.72 -        unsigned long *pgd = (unsigned long *)start_info.pt_base;
   14.73 -        unsigned long  pte;
   14.74 -        int i;
   14.75 -        printk("  pgd(pa(pgd)): %lx(%lx)", (u_long)pgd, to_phys(pgd));
   14.76 -
   14.77 -        for ( i = 0; i < (HYPERVISOR_VIRT_START>>22); i++ )
   14.78 -        {
   14.79 -            unsigned long pgde = *pgd++;
   14.80 -            if ( !(pgde & 1) ) continue;
   14.81 -            pte = machine_to_phys(pgde & PAGE_MASK);
   14.82 -            printk("  PT(%x): %lx(%lx)", i, (u_long)to_virt(pte), pte);
   14.83 -            if (PFN_DOWN(pte) <= max_free_pfn) 
   14.84 -                max_free_pfn = PFN_DOWN(pte);
   14.85 -        }
   14.86 -    }
   14.87 -    max_free_pfn--;
   14.88 -    printk("  max_free_pfn: %lx\n", max_free_pfn);
   14.89 -
   14.90 -    /*
   14.91 -     * now we can initialise the page allocator
   14.92 -     */
   14.93 -    printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
   14.94 -           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
   14.95 -           (u_long)to_virt(PFN_PHYS(max_free_pfn)), PFN_PHYS(max_free_pfn));
   14.96 -    init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_free_pfn));   
   14.97 -#endif
   14.98 -
   14.99 -
  14.100 -    /* Now initialise the physical->machine mapping table. */
  14.101 -
  14.102 -
  14.103 -    printk("MM: done\n");
  14.104 -
  14.105 -    
  14.106 -}
  14.107  
  14.108  /*********************
  14.109   * ALLOCATION BITMAP
  14.110 @@ -214,6 +146,59 @@ static chunk_head_t  free_tail[FREELIST_
  14.111  #define round_pgdown(_p)  ((_p)&PAGE_MASK)
  14.112  #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
  14.113  
  14.114 +#ifdef MM_DEBUG
  14.115 +/*
  14.116 + * Prints allocation[0/1] for @nr_pages, starting at @start
  14.117 + * address (virtual).
  14.118 + */
  14.119 +static void print_allocation(void *start, int nr_pages)
  14.120 +{
  14.121 +    unsigned long pfn_start = virt_to_pfn(start);
  14.122 +    int count;
  14.123 +    for(count = 0; count < nr_pages; count++)
  14.124 +        if(allocated_in_map(pfn_start + count)) printk("1");
  14.125 +        else printk("0");
  14.126 +        
  14.127 +    printk("\n");        
  14.128 +}
  14.129 +
  14.130 +/*
  14.131 + * Prints chunks (making them with letters) for @nr_pages starting
  14.132 + * at @start (virtual).
  14.133 + */
  14.134 +static void print_chunks(void *start, int nr_pages)
  14.135 +{
  14.136 +    char chunks[1001], current='A';
  14.137 +    int order, count;
  14.138 +    chunk_head_t *head;
  14.139 +    unsigned long pfn_start = virt_to_pfn(start);
  14.140 +   
  14.141 +    memset(chunks, (int)'_', 1000);
  14.142 +    if(nr_pages > 1000) 
  14.143 +    {
  14.144 +        DEBUG("Can only pring 1000 pages. Increase buffer size.");
  14.145 +    }
  14.146 +    
  14.147 +    for(order=0; order < FREELIST_SIZE; order++)
  14.148 +    {
  14.149 +        head = free_head[order];
  14.150 +        while(!FREELIST_EMPTY(head))
  14.151 +        {
  14.152 +            for(count = 0; count < 1<< head->level; count++)
  14.153 +            {
  14.154 +                if(count + virt_to_pfn(head) - pfn_start < 1000)
  14.155 +                    chunks[count + virt_to_pfn(head) - pfn_start] = current;
  14.156 +            }
  14.157 +            head = head->next;
  14.158 +            current++;
  14.159 +        }
  14.160 +    }
  14.161 +    chunks[nr_pages] = '\0';
  14.162 +    printk("%s\n", chunks);
  14.163 +}
  14.164 +#endif
  14.165 +
  14.166 +
  14.167  
  14.168  /*
  14.169   * Initialise allocator, placing addresses [@min,@max] in free pool.
  14.170 @@ -328,3 +313,198 @@ unsigned long alloc_pages(int order)
  14.171      return 0;
  14.172  }
  14.173  
  14.174 +void free_pages(void *pointer, int order)
  14.175 +{
  14.176 +    chunk_head_t *freed_ch, *to_merge_ch;
  14.177 +    chunk_tail_t *freed_ct;
  14.178 +    unsigned long mask;
  14.179 +    
  14.180 +    /* First free the chunk */
  14.181 +    map_free(virt_to_pfn(pointer), 1 << order);
  14.182 +    
  14.183 +    /* Create free chunk */
  14.184 +    freed_ch = (chunk_head_t *)pointer;
  14.185 +    freed_ct = (chunk_tail_t *)((char *)pointer + (1<<(order + PAGE_SHIFT)))-1;
  14.186 +    
  14.187 +    /* Now, possibly we can conseal chunks together */
  14.188 +    while(order < FREELIST_SIZE)
  14.189 +    {
  14.190 +        mask = 1 << (order + PAGE_SHIFT);
  14.191 +        if((unsigned long)freed_ch & mask) 
  14.192 +        {
  14.193 +            to_merge_ch = (chunk_head_t *)((char *)freed_ch - mask);
  14.194 +            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
  14.195 +                    to_merge_ch->level != order)
  14.196 +                break;
  14.197 +            
  14.198 +            /* Merge with predecessor */
  14.199 +            freed_ch = to_merge_ch;   
  14.200 +        }
  14.201 +        else 
  14.202 +        {
  14.203 +            to_merge_ch = (chunk_head_t *)((char *)freed_ch + mask);
  14.204 +            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
  14.205 +                    to_merge_ch->level != order)
  14.206 +                break;
  14.207 +            
  14.208 +            /* Merge with successor */
  14.209 +            freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask);
  14.210 +        }
  14.211 +        
  14.212 +        /* We are commited to merging, unlink the chunk */
  14.213 +        *(to_merge_ch->pprev) = to_merge_ch->next;
  14.214 +        to_merge_ch->next->pprev = to_merge_ch->pprev;
  14.215 +        
  14.216 +        order++;
  14.217 +    }
  14.218 +
  14.219 +    /* Link the new chunk */
  14.220 +    freed_ch->level = order;
  14.221 +    freed_ch->next  = free_head[order];
  14.222 +    freed_ch->pprev = &free_head[order];
  14.223 +    freed_ct->level = order;
  14.224 +    
  14.225 +    freed_ch->next->pprev = &freed_ch->next;
  14.226 +    free_head[order] = freed_ch;   
  14.227 +   
  14.228 +}
  14.229 +void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
  14.230 +{
  14.231 +    unsigned long pfn_to_map, pt_frame;
  14.232 +    unsigned long mach_ptd, max_mach_ptd;
  14.233 +    int count;
  14.234 +    unsigned long mach_pte, virt_pte;
  14.235 +    unsigned long *ptd = (unsigned long *)start_info.pt_base;
  14.236 +    mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
  14.237 +    struct mmuext_op pin_request;
  14.238 +    
  14.239 +    /* Firstly work out what is the first pfn that is not yet in page tables
  14.240 +       NB. Assuming that builder fills whole pt_frames (which it does at the
  14.241 +       moment)
  14.242 +     */  
  14.243 +    pfn_to_map = (start_info.nr_pt_frames - 1) * L1_PAGETABLE_ENTRIES;
  14.244 +    DEBUG("start_pfn=%ld, first pfn_to_map %ld, max_pfn=%ld", 
  14.245 +            *start_pfn, pfn_to_map, *max_pfn);
  14.246 +
  14.247 +    /* Machine address of page table directory */
  14.248 +    mach_ptd = phys_to_machine(to_phys(start_info.pt_base));
  14.249 +    mach_ptd += sizeof(void *) * 
  14.250 +        l2_table_offset((unsigned long)to_virt(PFN_PHYS(pfn_to_map)));
  14.251 +  
  14.252 +    max_mach_ptd = sizeof(void *) * 
  14.253 +        l2_table_offset((unsigned long)to_virt(PFN_PHYS(*max_pfn)));
  14.254 +    
  14.255 +    /* Check that we are not trying to access Xen region */
  14.256 +    if(max_mach_ptd > sizeof(void *) * l2_table_offset(HYPERVISOR_VIRT_START))
  14.257 +    {
  14.258 +        printk("WARNING: mini-os will not use all the memory supplied\n");
  14.259 +        max_mach_ptd = sizeof(void *) * l2_table_offset(HYPERVISOR_VIRT_START);
  14.260 +        *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
  14.261 +    }
  14.262 +    max_mach_ptd += phys_to_machine(to_phys(start_info.pt_base));
  14.263 +    DEBUG("Max_mach_ptd 0x%lx", max_mach_ptd); 
  14.264 +   
  14.265 +    pt_frame = *start_pfn;
  14.266 +    /* Should not happen - no empty, mapped pages */
  14.267 +    if(pt_frame >= pfn_to_map)
  14.268 +    {
  14.269 +        printk("ERROR: Not even a single empty, mapped page\n");
  14.270 +        *(int*)0=0;
  14.271 +    }
  14.272 +    
  14.273 +    while(mach_ptd < max_mach_ptd)
  14.274 +    {
  14.275 +        /* Correct protection needs to be set for the new page table frame */
  14.276 +        virt_pte = (unsigned long)to_virt(PFN_PHYS(pt_frame));
  14.277 +        mach_pte = ptd[l2_table_offset(virt_pte)] & ~(PAGE_SIZE-1);
  14.278 +        mach_pte += sizeof(void *) * l1_table_offset(virt_pte);
  14.279 +        DEBUG("New page table page: pfn=0x%lx, mfn=0x%lx, virt_pte=0x%lx, "
  14.280 +                "mach_pte=0x%lx", pt_frame, pfn_to_mfn(pt_frame), 
  14.281 +                virt_pte, mach_pte);
  14.282 +        
  14.283 +        /* Update the entry */
  14.284 +        mmu_updates[0].ptr = mach_pte;
  14.285 +        mmu_updates[0].val = pfn_to_mfn(pt_frame) << PAGE_SHIFT | 
  14.286 +                                                    (L1_PROT & ~_PAGE_RW);
  14.287 +        if(HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF) < 0)
  14.288 +        {
  14.289 +            printk("PTE for new page table page could not be updated\n");
  14.290 +            *(int*)0=0;
  14.291 +        }
  14.292 +        
  14.293 +        /* Pin the page to provide correct protection */
  14.294 +        pin_request.cmd = MMUEXT_PIN_L1_TABLE;
  14.295 +        pin_request.mfn = pfn_to_mfn(pt_frame);
  14.296 +        if(HYPERVISOR_mmuext_op(&pin_request, 1, NULL, DOMID_SELF) < 0)
  14.297 +        {
  14.298 +            printk("ERROR: pinning failed\n");
  14.299 +            *(int*)0=0;
  14.300 +        }
  14.301 +        
  14.302 +        /* Now fill the new page table page with entries.
  14.303 +           Update the page directory as well. */
  14.304 +        count = 0;
  14.305 +        mmu_updates[count].ptr = mach_ptd;
  14.306 +        mmu_updates[count].val = pfn_to_mfn(pt_frame) << PAGE_SHIFT |
  14.307 +                                                         L2_PROT;
  14.308 +        count++;
  14.309 +        mach_ptd += sizeof(void *);
  14.310 +        mach_pte = phys_to_machine(PFN_PHYS(pt_frame++));
  14.311 +        
  14.312 +        for(;count <= L1_PAGETABLE_ENTRIES && pfn_to_map <= *max_pfn; count++)
  14.313 +        {
  14.314 +            mmu_updates[count].ptr = mach_pte;
  14.315 +            mmu_updates[count].val = 
  14.316 +                pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
  14.317 +            if(count == 1) DEBUG("mach_pte 0x%lx", mach_pte);
  14.318 +            mach_pte += sizeof(void *);
  14.319 +        }
  14.320 +        if(HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF) < 0) 
  14.321 +        {            
  14.322 +            printk("ERROR: mmu_update failed\n");
  14.323 +            *(int*)0=0;
  14.324 +        }
  14.325 +        (*start_pfn)++;
  14.326 +    }
  14.327 +
  14.328 +    *start_pfn = pt_frame;
  14.329 +}
  14.330 +
  14.331 +void init_mm(void)
  14.332 +{
  14.333 +
  14.334 +    unsigned long start_pfn, max_pfn;
  14.335 +
  14.336 +    printk("MM: Init\n");
  14.337 +
  14.338 +    printk("  _text:        %p\n", &_text);
  14.339 +    printk("  _etext:       %p\n", &_etext);
  14.340 +    printk("  _edata:       %p\n", &_edata);
  14.341 +    printk("  stack start:  %p\n", &stack);
  14.342 +    printk("  _end:         %p\n", &_end);
  14.343 +
  14.344 +    /* set up minimal memory infos */
  14.345 +    phys_to_machine_mapping = (unsigned long *)start_info.mfn_list;
  14.346 +   
  14.347 +    /* First page follows page table pages and 3 more pages (store page etc) */
  14.348 +    start_pfn = PFN_UP(__pa(start_info.pt_base)) + start_info.nr_pt_frames + 3;
  14.349 +    max_pfn = start_info.nr_pages;
  14.350 +
  14.351 +    printk("  start_pfn:    %lx\n", start_pfn);
  14.352 +    printk("  max_pfn:      %lx\n", max_pfn);
  14.353 +
  14.354 +
  14.355 +    build_pagetable(&start_pfn, &max_pfn);
  14.356 +    
  14.357 +#ifdef __i386__
  14.358 +    /*
  14.359 +     * now we can initialise the page allocator
  14.360 +     */
  14.361 +    printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
  14.362 +           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
  14.363 +           (u_long)to_virt(PFN_PHYS(max_pfn)), PFN_PHYS(max_pfn));
  14.364 +    init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn));   
  14.365 +#endif
  14.366 +
  14.367 +    printk("MM: done\n");
  14.368 +}
    15.1 --- a/extras/mini-os/time.c	Tue Aug 23 18:43:18 2005 -0800
    15.2 +++ b/extras/mini-os/time.c	Thu Aug 25 15:53:20 2005 -0700
    15.3 @@ -43,19 +43,20 @@
    15.4   * Time functions
    15.5   *************************************************************************/
    15.6  
    15.7 -/* Cached *multiplier* to convert TSC counts to microseconds.
    15.8 - * (see the equation below).
    15.9 - * Equal to 2^32 * (1 / (clocks per usec) ).
   15.10 - * Initialized in time_init.
   15.11 - */
   15.12 -static unsigned long fast_gettimeoffset_quotient;
   15.13 +/* These are peridically updated in shared_info, and then copied here. */
   15.14 +struct shadow_time_info {
   15.15 +	u64 tsc_timestamp;     /* TSC at last update of time vals.  */
   15.16 +	u64 system_timestamp;  /* Time, in nanosecs, since boot.    */
   15.17 +	u32 tsc_to_nsec_mul;
   15.18 +	u32 tsc_to_usec_mul;
   15.19 +	int tsc_shift;
   15.20 +	u32 version;
   15.21 +};
   15.22 +static struct timespec shadow_ts;
   15.23 +static u32 shadow_ts_version;
   15.24  
   15.25 +static struct shadow_time_info shadow;
   15.26  
   15.27 -/* These are peridically updated in shared_info, and then copied here. */
   15.28 -static u32 shadow_tsc_stamp;
   15.29 -static s64 shadow_system_time;
   15.30 -static u32 shadow_time_version;
   15.31 -static struct timeval shadow_tv;
   15.32  
   15.33  #ifndef rmb
   15.34  #define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
   15.35 @@ -63,116 +64,150 @@ static struct timeval shadow_tv;
   15.36  
   15.37  #define HANDLE_USEC_OVERFLOW(_tv)          \
   15.38      do {                                   \
   15.39 -        while ( (_tv).tv_usec >= 1000000 ) \
   15.40 +        while ( (_tv)->tv_usec >= 1000000 ) \
   15.41          {                                  \
   15.42 -            (_tv).tv_usec -= 1000000;      \
   15.43 -            (_tv).tv_sec++;                \
   15.44 +            (_tv)->tv_usec -= 1000000;      \
   15.45 +            (_tv)->tv_sec++;                \
   15.46          }                                  \
   15.47      } while ( 0 )
   15.48  
   15.49 -static void get_time_values_from_xen(void)
   15.50 +static inline int time_values_up_to_date(void)
   15.51 +{
   15.52 +	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_time[0]; 
   15.53 +
   15.54 +	return (shadow.version == src->version);
   15.55 +}
   15.56 +
   15.57 +
   15.58 +/*
   15.59 + * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
   15.60 + * yielding a 64-bit result.
   15.61 + */
   15.62 +static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
   15.63  {
   15.64 -    do {
   15.65 -        shadow_time_version = HYPERVISOR_shared_info->time_version2;
   15.66 -        rmb();
   15.67 -        shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
   15.68 -        shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
   15.69 -        shadow_tsc_stamp    = (u32)HYPERVISOR_shared_info->tsc_timestamp;
   15.70 -        shadow_system_time  = HYPERVISOR_shared_info->system_time;
   15.71 -        rmb();
   15.72 -    }
   15.73 -    while ( shadow_time_version != HYPERVISOR_shared_info->time_version1 );
   15.74 +	u64 product;
   15.75 +#ifdef __i386__
   15.76 +	u32 tmp1, tmp2;
   15.77 +#endif
   15.78 +
   15.79 +	if ( shift < 0 )
   15.80 +		delta >>= -shift;
   15.81 +	else
   15.82 +		delta <<= shift;
   15.83 +
   15.84 +#ifdef __i386__
   15.85 +	__asm__ (
   15.86 +		"mul  %5       ; "
   15.87 +		"mov  %4,%%eax ; "
   15.88 +		"mov  %%edx,%4 ; "
   15.89 +		"mul  %5       ; "
   15.90 +		"add  %4,%%eax ; "
   15.91 +		"xor  %5,%5    ; "
   15.92 +		"adc  %5,%%edx ; "
   15.93 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
   15.94 +		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
   15.95 +#else
   15.96 +	__asm__ (
   15.97 +		"mul %%rdx ; shrd $32,%%rdx,%%rax"
   15.98 +		: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
   15.99 +#endif
  15.100 +
  15.101 +	return product;
  15.102 +}
  15.103 +
  15.104 +
  15.105 +static unsigned long get_nsec_offset(void)
  15.106 +{
  15.107 +	u64 now, delta;
  15.108 +	rdtscll(now);
  15.109 +	delta = now - shadow.tsc_timestamp;
  15.110 +	return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
  15.111  }
  15.112  
  15.113  
  15.114 -#define TIME_VALUES_UP_TO_DATE \
  15.115 -    (shadow_time_version == HYPERVISOR_shared_info->time_version2)
  15.116 -
  15.117 -static u32  get_time_delta_usecs(void)
  15.118 +static void get_time_values_from_xen(void)
  15.119  {
  15.120 -	register unsigned long eax, edx;
  15.121 -
  15.122 -	/* Read the Time Stamp Counter */
  15.123 -
  15.124 -	rdtsc(eax,edx);
  15.125 -
  15.126 -	/* .. relative to previous jiffy (32 bits is enough) */
  15.127 -	eax -= shadow_tsc_stamp;
  15.128 +	struct vcpu_time_info    *src = &HYPERVISOR_shared_info->vcpu_time[0];
  15.129  
  15.130 -	/*
  15.131 -	 * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient
  15.132 -	 *             = (tsc_low delta) * (usecs_per_clock)
  15.133 -	 *             = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy)
  15.134 -	 *
  15.135 -	 * Using a mull instead of a divl saves up to 31 clock cycles
  15.136 -	 * in the critical path.
  15.137 -	 */
  15.138 + 	do {
  15.139 +		shadow.version = src->version;
  15.140 +		rmb();
  15.141 +		shadow.tsc_timestamp     = src->tsc_timestamp;
  15.142 +		shadow.system_timestamp  = src->system_time;
  15.143 +		shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
  15.144 +		shadow.tsc_shift         = src->tsc_shift;
  15.145 +		rmb();
  15.146 +	}
  15.147 +	while ((src->version & 1) | (shadow.version ^ src->version));
  15.148  
  15.149 -	__asm__("mull %2"
  15.150 -		:"=a" (eax), "=d" (edx)
  15.151 -		:"rm" (fast_gettimeoffset_quotient),
  15.152 -		 "0" (eax));
  15.153 -
  15.154 -	/* our adjusted time offset in microseconds */
  15.155 -	return edx;
  15.156 +	shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
  15.157  }
  15.158  
  15.159 -s64 get_s_time (void)
  15.160 -{
  15.161 -    u64 u_delta;
  15.162 -    s64 ret;
  15.163 +
  15.164 +
  15.165  
  15.166 - again:
  15.167 -
  15.168 -    u_delta = get_time_delta_usecs();
  15.169 -    ret = shadow_system_time + (1000 * u_delta);
  15.170 +/* monotonic_clock(): returns # of nanoseconds passed since time_init()
  15.171 + *		Note: This function is required to return accurate
  15.172 + *		time even in the absence of multiple timer ticks.
  15.173 + */
  15.174 +u64 monotonic_clock(void)
  15.175 +{
  15.176 +	u64 time;
  15.177 +	u32 local_time_version;
  15.178  
  15.179 -    if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
  15.180 -    {
  15.181 -        /*
  15.182 -         * We may have blocked for a long time, rendering our calculations
  15.183 -         * invalid (e.g. the time delta may have overflowed). Detect that
  15.184 -         * and recalculate with fresh values.
  15.185 -         */
  15.186 -        get_time_values_from_xen();
  15.187 -        goto again;
  15.188 -    }
  15.189 +	do {
  15.190 +		local_time_version = shadow.version;
  15.191 +		rmb();
  15.192 +		time = shadow.system_timestamp + get_nsec_offset();
  15.193 +        if (!time_values_up_to_date())
  15.194 +			get_time_values_from_xen();
  15.195 +		rmb();
  15.196 +	} while (local_time_version != shadow.version);
  15.197 +
  15.198 +	return time;
  15.199 +}
  15.200  
  15.201 -    return ret;
  15.202 +static void update_wallclock(void)
  15.203 +{
  15.204 +	shared_info_t *s = HYPERVISOR_shared_info;
  15.205 +
  15.206 +	do {
  15.207 +		shadow_ts_version = s->wc_version;
  15.208 +		rmb();
  15.209 +		shadow_ts.ts_sec  = s->wc_sec;
  15.210 +		shadow_ts.ts_nsec = s->wc_nsec;
  15.211 +		rmb();
  15.212 +	}
  15.213 +	while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version));
  15.214  }
  15.215  
  15.216 +
  15.217  void gettimeofday(struct timeval *tv)
  15.218  {
  15.219 -    struct timeval _tv;
  15.220 +    u64 nsec = monotonic_clock();
  15.221 +    nsec += shadow_ts.ts_nsec;
  15.222 +    
  15.223 +    
  15.224 +    tv->tv_sec = shadow_ts.ts_sec;
  15.225 +    tv->tv_sec += NSEC_TO_SEC(nsec);
  15.226 +    tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
  15.227 +}
  15.228  
  15.229 -    do {
  15.230 -        get_time_values_from_xen();
  15.231 -        _tv.tv_usec = get_time_delta_usecs();
  15.232 -        _tv.tv_sec   = shadow_tv.tv_sec;
  15.233 -        _tv.tv_usec += shadow_tv.tv_usec;
  15.234 -    }
  15.235 -    while ( unlikely(!TIME_VALUES_UP_TO_DATE) );
  15.236 -
  15.237 -    HANDLE_USEC_OVERFLOW(_tv);
  15.238 -    *tv = _tv;
  15.239 -}
  15.240  
  15.241  static void print_current_time(void)
  15.242  {
  15.243 -    struct timeval tv;
  15.244 -
  15.245 -    get_time_values_from_xen();
  15.246 +    struct timeval tv;    
  15.247  
  15.248      gettimeofday(&tv);
  15.249      printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
  15.250  }
  15.251  
  15.252 +
  15.253  void block(u32 millisecs)
  15.254  {
  15.255      struct timeval tv;
  15.256      gettimeofday(&tv);
  15.257 -    //printk("tv.tv_sec=%ld, tv.tv_usec=%ld, shadow_system_time=%lld\n", tv.tv_sec, tv.tv_usec, shadow_system_time );
  15.258 -    HYPERVISOR_set_timer_op(get_s_time() + 1000000LL * (s64) millisecs);
  15.259 +    HYPERVISOR_set_timer_op(monotonic_clock() + 1000000LL * (s64) millisecs);
  15.260      HYPERVISOR_block();
  15.261  }
  15.262  
  15.263 @@ -185,7 +220,7 @@ static void timer_handler(int ev, struct
  15.264      static int i;
  15.265  
  15.266      get_time_values_from_xen();
  15.267 -
  15.268 +    update_wallclock();
  15.269      i++;
  15.270      if (i >= 1000) {
  15.271          print_current_time();
  15.272 @@ -197,24 +232,5 @@ static void timer_handler(int ev, struct
  15.273  
  15.274  void init_time(void)
  15.275  {
  15.276 -    u64         __cpu_khz;
  15.277 -    unsigned long cpu_khz;
  15.278 -
  15.279 -    __cpu_khz = HYPERVISOR_shared_info->cpu_freq;
  15.280 -
  15.281 -    cpu_khz = (u32) (__cpu_khz/1000);
  15.282 -
  15.283 -    printk("Xen reported: %lu.%03lu MHz processor.\n", 
  15.284 -           cpu_khz / 1000, cpu_khz % 1000);
  15.285 -	/* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz =
  15.286 -	   (2^32 * 1 / (clocks/us)) */
  15.287 -	{	
  15.288 -		unsigned long eax=0, edx=1000;
  15.289 -		__asm__("divl %2"
  15.290 -		    :"=a" (fast_gettimeoffset_quotient), "=d" (edx)
  15.291 -		    :"r" (cpu_khz),
  15.292 -		    "0" (eax), "1" (edx));
  15.293 -	}
  15.294 -
  15.295      bind_virq(VIRQ_TIMER, &timer_handler);
  15.296  }
    17.1 --- a/linux-2.4-xen-sparse/arch/xen/Makefile	Tue Aug 23 18:43:18 2005 -0800
    17.2 +++ b/linux-2.4-xen-sparse/arch/xen/Makefile	Thu Aug 25 15:53:20 2005 -0700
    17.3 @@ -61,7 +61,6 @@ SUBDIRS += arch/xen/drivers/console
    17.4  SUBDIRS += arch/xen/drivers/evtchn
    17.5  SUBDIRS += arch/xen/drivers/blkif
    17.6  SUBDIRS += arch/xen/drivers/netif
    17.7 -#SUBDIRS += arch/xen/drivers/usbif
    17.8  SUBDIRS += arch/xen/drivers/balloon
    17.9  ifdef CONFIG_XEN_PRIVILEGED_GUEST
   17.10  SUBDIRS += arch/xen/drivers/dom0 
   17.11 @@ -72,7 +71,6 @@ CORE_FILES += arch/xen/drivers/evtchn/dr
   17.12  CORE_FILES += arch/xen/drivers/console/drv.o
   17.13  DRIVERS += arch/xen/drivers/blkif/drv.o
   17.14  DRIVERS += arch/xen/drivers/netif/drv.o
   17.15 -DRIVERS += arch/xen/drivers/usbif/drv.o
   17.16  ifdef CONFIG_XEN_PRIVILEGED_GUEST
   17.17  CORE_FILES += arch/xen/drivers/dom0/drv.o
   17.18  endif
    19.1 --- a/linux-2.4-xen-sparse/arch/xen/config.in	Tue Aug 23 18:43:18 2005 -0800
    19.2 +++ b/linux-2.4-xen-sparse/arch/xen/config.in	Thu Aug 25 15:53:20 2005 -0700
    19.3 @@ -16,14 +16,10 @@ mainmenu_option next_comment
    19.4  comment 'Xen'
    19.5  bool 'Support for privileged operations (domain 0)' CONFIG_XEN_PRIVILEGED_GUEST
    19.6  bool 'Device-driver domain (physical device access)' CONFIG_XEN_PHYSDEV_ACCESS
    19.7 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
    19.8 -    bool 'USB-device backend driver' CONFIG_XEN_USB_BACKEND
    19.9 -fi
   19.10  bool 'Scrub memory before freeing it to Xen' CONFIG_XEN_SCRUB_PAGES
   19.11  bool 'Network-device frontend driver' CONFIG_XEN_NETDEV_FRONTEND
   19.12  bool 'Block-device frontend driver' CONFIG_XEN_BLKDEV_FRONTEND
   19.13  bool 'Block-device uses grant tables' CONFIG_XEN_BLKDEV_GRANT
   19.14 -bool 'USB-device frontend driver' CONFIG_XEN_USB_FRONTEND
   19.15  endmenu
   19.16  # The IBM S/390 patch needs this.
   19.17  define_bool CONFIG_NO_IDLE_HZ y
   19.18 @@ -267,7 +263,7 @@ fi
   19.19  
   19.20  source drivers/char/Config.in
   19.21  
   19.22 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   19.23 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   19.24     source drivers/media/Config.in
   19.25  fi
   19.26  
   19.27 @@ -302,14 +298,8 @@ if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" 
   19.28     endmenu
   19.29  fi
   19.30  
   19.31 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   19.32 -   if [ "$CONFIG_XEN_USB_FRONTEND" = "y" -o "$CONFIG_XEN_USB_BACKEND" = "y" ]; then
   19.33 -       define_bool CONFIG_USB y
   19.34 -   fi
   19.35 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   19.36     source drivers/usb/Config.in
   19.37 -fi
   19.38 -
   19.39 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   19.40     source net/bluetooth/Config.in
   19.41  fi
   19.42  
    89.1 --- a/linux-2.4-xen-sparse/mkbuildtree	Tue Aug 23 18:43:18 2005 -0800
    89.2 +++ b/linux-2.4-xen-sparse/mkbuildtree	Thu Aug 25 15:53:20 2005 -0700
    89.3 @@ -103,10 +103,9 @@ relative_lndir ${RS}
    89.4  rm -f mkbuildtree
    89.5  
    89.6  set ${RS}/../linux-2.6-xen-sparse
    89.7 -[ "$1" == "${RS}/../linux-2.6-xen-parse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6-xen-sparse"; exit 1; }
    89.8 +[ "$1" == "${RS}/../linux-2.6-xen-sparse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6-xen-sparse"; exit 1; }
    89.9  LINUX_26="$1"
   89.10  
   89.11 -
   89.12  # Create links to the shared definitions of the Xen interfaces.
   89.13  rm -rf ${AD}/include/asm-xen/xen-public
   89.14  mkdir  ${AD}/include/asm-xen/xen-public
    96.1 --- a/linux-2.6-xen-sparse/arch/xen/Kconfig	Tue Aug 23 18:43:18 2005 -0800
    96.2 +++ b/linux-2.6-xen-sparse/arch/xen/Kconfig	Thu Aug 25 15:53:20 2005 -0700
    96.3 @@ -61,15 +61,6 @@ config XEN_BLKDEV_TAP_BE
    96.4            with the blktap.  This option will be removed as the block drivers are
    96.5            modified to use grant tables.
    96.6  
    96.7 -config XEN_BLKDEV_GRANT
    96.8 -        bool "Grant table substrate for block drivers"
    96.9 -        depends on !XEN_BLKDEV_TAP_BE
   96.10 -        default y
   96.11 -        help
   96.12 -          This introduces the use of grant tables as a data exhange mechanism
   96.13 -          between the frontend and backend block drivers. This currently
   96.14 -          conflicts with the block tap.
   96.15 -
   96.16  config XEN_NETDEV_BACKEND
   96.17  	bool "Network-device backend driver"
   96.18  	depends on XEN_PHYSDEV_ACCESS
   100.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
   100.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
   100.3 @@ -1,7 +1,7 @@
   100.4  #
   100.5  # Automatically generated make config: don't edit
   100.6  # Linux kernel version: 2.6.12-xen0
   100.7 -# Mon Jul 25 09:48:34 2005
   100.8 +# Wed Aug  3 09:54:56 2005
   100.9  #
  100.10  CONFIG_XEN=y
  100.11  CONFIG_ARCH_XEN=y
  100.12 @@ -14,12 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
  100.13  CONFIG_XEN_PHYSDEV_ACCESS=y
  100.14  CONFIG_XEN_BLKDEV_BACKEND=y
  100.15  # CONFIG_XEN_BLKDEV_TAP_BE is not set
  100.16 -CONFIG_XEN_BLKDEV_GRANT=y
  100.17  CONFIG_XEN_NETDEV_BACKEND=y
  100.18  CONFIG_XEN_BLKDEV_FRONTEND=y
  100.19  CONFIG_XEN_NETDEV_FRONTEND=y
  100.20 -#CONFIG_XEN_NETDEV_GRANT_TX=y
  100.21 -#CONFIG_XEN_NETDEV_GRANT_RX=y
  100.22 +CONFIG_XEN_NETDEV_GRANT_TX=y
  100.23 +CONFIG_XEN_NETDEV_GRANT_RX=y
  100.24  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  100.25  # CONFIG_XEN_BLKDEV_TAP is not set
  100.26  # CONFIG_XEN_SHADOW_MODE is not set
  100.27 @@ -93,11 +92,11 @@ CONFIG_GENERIC_IOMAP=y
  100.28  # CONFIG_M586 is not set
  100.29  # CONFIG_M586TSC is not set
  100.30  # CONFIG_M586MMX is not set
  100.31 -# CONFIG_M686 is not set
  100.32 +CONFIG_M686=y
  100.33  # CONFIG_MPENTIUMII is not set
  100.34  # CONFIG_MPENTIUMIII is not set
  100.35  # CONFIG_MPENTIUMM is not set
  100.36 -CONFIG_MPENTIUM4=y
  100.37 +# CONFIG_MPENTIUM4 is not set
  100.38  # CONFIG_MK6 is not set
  100.39  # CONFIG_MK7 is not set
  100.40  # CONFIG_MK8 is not set
  100.41 @@ -112,15 +111,15 @@ CONFIG_MPENTIUM4=y
  100.42  # CONFIG_X86_GENERIC is not set
  100.43  CONFIG_X86_CMPXCHG=y
  100.44  CONFIG_X86_XADD=y
  100.45 -CONFIG_X86_L1_CACHE_SHIFT=7
  100.46 +CONFIG_X86_L1_CACHE_SHIFT=5
  100.47  CONFIG_RWSEM_XCHGADD_ALGORITHM=y
  100.48  CONFIG_GENERIC_CALIBRATE_DELAY=y
  100.49 +CONFIG_X86_PPRO_FENCE=y
  100.50  CONFIG_X86_WP_WORKS_OK=y
  100.51  CONFIG_X86_INVLPG=y
  100.52  CONFIG_X86_BSWAP=y
  100.53  CONFIG_X86_POPAD_OK=y
  100.54  CONFIG_X86_GOOD_APIC=y
  100.55 -CONFIG_X86_INTEL_USERCOPY=y
  100.56  CONFIG_X86_USE_PPRO_CHECKSUM=y
  100.57  # CONFIG_HPET_TIMER is not set
  100.58  # CONFIG_HPET_EMULATE_RTC is not set
  100.59 @@ -130,6 +129,7 @@ CONFIG_PREEMPT_BKL=y
  100.60  # CONFIG_X86_REBOOTFIXUPS is not set
  100.61  CONFIG_MICROCODE=y
  100.62  CONFIG_X86_CPUID=y
  100.63 +CONFIG_SWIOTLB=y
  100.64  
  100.65  #
  100.66  # Firmware Drivers
  100.67 @@ -540,7 +540,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
  100.68  # CONFIG_IP_NF_MATCH_STATE is not set
  100.69  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
  100.70  # CONFIG_IP_NF_MATCH_OWNER is not set
  100.71 -# CONFIG_IP_NF_MATCH_PHYSDEV is not set
  100.72 +CONFIG_IP_NF_MATCH_PHYSDEV=y
  100.73  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
  100.74  # CONFIG_IP_NF_MATCH_REALM is not set
  100.75  # CONFIG_IP_NF_MATCH_SCTP is not set
  100.76 @@ -688,7 +688,7 @@ CONFIG_E1000=y
  100.77  # CONFIG_HAMACHI is not set
  100.78  # CONFIG_YELLOWFIN is not set
  100.79  # CONFIG_R8169 is not set
  100.80 -# CONFIG_SK98LIN is not set
  100.81 +CONFIG_SK98LIN=y
  100.82  # CONFIG_VIA_VELOCITY is not set
  100.83  CONFIG_TIGON3=y
  100.84  # CONFIG_BNX2 is not set
   101.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
   101.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
   101.3 @@ -1,7 +1,7 @@
   101.4  #
   101.5  # Automatically generated make config: don't edit
   101.6 -# Linux kernel version: 2.6.12-xen0
   101.7 -# Wed Jun 29 10:01:20 2005
   101.8 +# Linux kernel version: 2.6.12.4-xen0
   101.9 +# Mon Aug 15 18:57:19 2005
  101.10  #
  101.11  CONFIG_XEN=y
  101.12  CONFIG_ARCH_XEN=y
  101.13 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
  101.14  CONFIG_XEN_PHYSDEV_ACCESS=y
  101.15  CONFIG_XEN_BLKDEV_BACKEND=y
  101.16  # CONFIG_XEN_BLKDEV_TAP_BE is not set
  101.17 -CONFIG_XEN_BLKDEV_GRANT=y
  101.18  CONFIG_XEN_NETDEV_BACKEND=y
  101.19  CONFIG_XEN_BLKDEV_FRONTEND=y
  101.20  CONFIG_XEN_NETDEV_FRONTEND=y
  101.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
  101.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
  101.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  101.24  # CONFIG_XEN_BLKDEV_TAP is not set
  101.25  # CONFIG_XEN_SHADOW_MODE is not set
  101.26 @@ -50,6 +51,7 @@ CONFIG_KOBJECT_UEVENT=y
  101.27  # CONFIG_IKCONFIG is not set
  101.28  # CONFIG_EMBEDDED is not set
  101.29  CONFIG_KALLSYMS=y
  101.30 +# CONFIG_KALLSYMS_ALL is not set
  101.31  # CONFIG_KALLSYMS_EXTRA_PASS is not set
  101.32  CONFIG_PRINTK=y
  101.33  CONFIG_BUG=y
  101.34 @@ -116,9 +118,11 @@ CONFIG_EARLY_PRINTK=y
  101.35  CONFIG_GENERIC_CPU=y
  101.36  CONFIG_X86_L1_CACHE_BYTES=128
  101.37  # CONFIG_X86_TSC is not set
  101.38 +CONFIG_X86_XEN_GENAPIC=y
  101.39  # CONFIG_X86_MSR is not set
  101.40  # CONFIG_GART_IOMMU is not set
  101.41  CONFIG_DUMMY_IOMMU=y
  101.42 +CONFIG_SWIOTLB=y
  101.43  # CONFIG_X86_MCE is not set
  101.44  
  101.45  #
  101.46 @@ -160,6 +164,7 @@ CONFIG_BINFMT_MISC=y
  101.47  CONFIG_STANDALONE=y
  101.48  # CONFIG_PREVENT_FIRMWARE_BUILD is not set
  101.49  # CONFIG_FW_LOADER is not set
  101.50 +# CONFIG_DEBUG_DRIVER is not set
  101.51  
  101.52  #
  101.53  # Memory Technology Devices (MTD)
  101.54 @@ -369,7 +374,23 @@ CONFIG_SCSI_QLA2XXX=y
  101.55  #
  101.56  # Multi-device support (RAID and LVM)
  101.57  #
  101.58 -# CONFIG_MD is not set
  101.59 +CONFIG_MD=y
  101.60 +CONFIG_BLK_DEV_MD=y
  101.61 +CONFIG_MD_LINEAR=y
  101.62 +CONFIG_MD_RAID0=y
  101.63 +CONFIG_MD_RAID1=y
  101.64 +# CONFIG_MD_RAID10 is not set
  101.65 +# CONFIG_MD_RAID5 is not set
  101.66 +# CONFIG_MD_RAID6 is not set
  101.67 +CONFIG_MD_MULTIPATH=y
  101.68 +# CONFIG_MD_FAULTY is not set
  101.69 +CONFIG_BLK_DEV_DM=y
  101.70 +CONFIG_DM_CRYPT=y
  101.71 +CONFIG_DM_SNAPSHOT=y
  101.72 +CONFIG_DM_MIRROR=y
  101.73 +# CONFIG_DM_ZERO is not set
  101.74 +CONFIG_DM_MULTIPATH=y
  101.75 +CONFIG_DM_MULTIPATH_EMC=y
  101.76  
  101.77  #
  101.78  # Fusion MPT device support
  101.79 @@ -458,7 +479,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
  101.80  # CONFIG_IP_NF_MATCH_STATE is not set
  101.81  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
  101.82  # CONFIG_IP_NF_MATCH_OWNER is not set
  101.83 -# CONFIG_IP_NF_MATCH_PHYSDEV is not set
  101.84 +CONFIG_IP_NF_MATCH_PHYSDEV=y
  101.85  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
  101.86  # CONFIG_IP_NF_MATCH_REALM is not set
  101.87  # CONFIG_IP_NF_MATCH_SCTP is not set
  101.88 @@ -589,7 +610,7 @@ CONFIG_E1000=y
  101.89  # CONFIG_HAMACHI is not set
  101.90  # CONFIG_YELLOWFIN is not set
  101.91  # CONFIG_R8169 is not set
  101.92 -# CONFIG_SK98LIN is not set
  101.93 +CONFIG_SK98LIN=y
  101.94  # CONFIG_VIA_VELOCITY is not set
  101.95  CONFIG_TIGON3=y
  101.96  # CONFIG_BNX2 is not set
  101.97 @@ -786,7 +807,107 @@ CONFIG_DUMMY_CONSOLE=y
  101.98  #
  101.99  CONFIG_USB_ARCH_HAS_HCD=y
 101.100  CONFIG_USB_ARCH_HAS_OHCI=y
 101.101 -# CONFIG_USB is not set
 101.102 +CONFIG_USB=y
 101.103 +# CONFIG_USB_DEBUG is not set
 101.104 +
 101.105 +#
 101.106 +# Miscellaneous USB options
 101.107 +#
 101.108 +# CONFIG_USB_DEVICEFS is not set
 101.109 +# CONFIG_USB_BANDWIDTH is not set
 101.110 +# CONFIG_USB_DYNAMIC_MINORS is not set
 101.111 +# CONFIG_USB_OTG is not set
 101.112 +
 101.113 +#
 101.114 +# USB Host Controller Drivers
 101.115 +#
 101.116 +# CONFIG_USB_EHCI_HCD is not set
 101.117 +CONFIG_USB_OHCI_HCD=y
 101.118 +# CONFIG_USB_OHCI_BIG_ENDIAN is not set
 101.119 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 101.120 +CONFIG_USB_UHCI_HCD=y
 101.121 +# CONFIG_USB_SL811_HCD is not set
 101.122 +
 101.123 +#
 101.124 +# USB Device Class drivers
 101.125 +#
 101.126 +# CONFIG_USB_BLUETOOTH_TTY is not set
 101.127 +# CONFIG_USB_ACM is not set
 101.128 +# CONFIG_USB_PRINTER is not set
 101.129 +
 101.130 +#
 101.131 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
 101.132 +#
 101.133 +# CONFIG_USB_STORAGE is not set
 101.134 +
 101.135 +#
 101.136 +# USB Input Devices
 101.137 +#
 101.138 +CONFIG_USB_HID=y
 101.139 +CONFIG_USB_HIDINPUT=y
 101.140 +# CONFIG_HID_FF is not set
 101.141 +# CONFIG_USB_HIDDEV is not set
 101.142 +# CONFIG_USB_AIPTEK is not set
 101.143 +# CONFIG_USB_WACOM is not set
 101.144 +# CONFIG_USB_KBTAB is not set
 101.145 +# CONFIG_USB_POWERMATE is not set
 101.146 +# CONFIG_USB_MTOUCH is not set
 101.147 +# CONFIG_USB_EGALAX is not set
 101.148 +# CONFIG_USB_XPAD is not set
 101.149 +# CONFIG_USB_ATI_REMOTE is not set
 101.150 +
 101.151 +#
 101.152 +# USB Imaging devices
 101.153 +#
 101.154 +# CONFIG_USB_MDC800 is not set
 101.155 +# CONFIG_USB_MICROTEK is not set
 101.156 +
 101.157 +#
 101.158 +# USB Multimedia devices
 101.159 +#
 101.160 +# CONFIG_USB_DABUSB is not set
 101.161 +
 101.162 +#
 101.163 +# Video4Linux support is needed for USB Multimedia device support
 101.164 +#
 101.165 +
 101.166 +#
 101.167 +# USB Network Adapters
 101.168 +#
 101.169 +# CONFIG_USB_CATC is not set
 101.170 +# CONFIG_USB_KAWETH is not set
 101.171 +# CONFIG_USB_PEGASUS is not set
 101.172 +# CONFIG_USB_RTL8150 is not set
 101.173 +# CONFIG_USB_USBNET is not set
 101.174 +CONFIG_USB_MON=y
 101.175 +
 101.176 +#
 101.177 +# USB port drivers
 101.178 +#
 101.179 +
 101.180 +#
 101.181 +# USB Serial Converter support
 101.182 +#
 101.183 +# CONFIG_USB_SERIAL is not set
 101.184 +
 101.185 +#
 101.186 +# USB Miscellaneous drivers
 101.187 +#
 101.188 +# CONFIG_USB_EMI62 is not set
 101.189 +# CONFIG_USB_EMI26 is not set
 101.190 +# CONFIG_USB_AUERSWALD is not set
 101.191 +# CONFIG_USB_RIO500 is not set
 101.192 +# CONFIG_USB_LEGOTOWER is not set
 101.193 +# CONFIG_USB_LCD is not set
 101.194 +# CONFIG_USB_LED is not set
 101.195 +# CONFIG_USB_CYTHERM is not set
 101.196 +# CONFIG_USB_PHIDGETKIT is not set
 101.197 +# CONFIG_USB_PHIDGETSERVO is not set
 101.198 +# CONFIG_USB_IDMOUSE is not set
 101.199 +
 101.200 +#
 101.201 +# USB ATM/DSL drivers
 101.202 +#
 101.203  
 101.204  #
 101.205  # USB Gadget Support
 101.206 @@ -801,7 +922,12 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 101.207  #
 101.208  # InfiniBand support
 101.209  #
 101.210 -# CONFIG_INFINIBAND is not set
 101.211 +CONFIG_INFINIBAND=y
 101.212 +CONFIG_INFINIBAND_MTHCA=y
 101.213 +CONFIG_INFINIBAND_MTHCA_DEBUG=y
 101.214 +CONFIG_INFINIBAND_IPOIB=y
 101.215 +CONFIG_INFINIBAND_IPOIB_DEBUG=y
 101.216 +CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
 101.217  
 101.218  #
 101.219  # Power management options
 101.220 @@ -1036,7 +1162,22 @@ CONFIG_ZLIB_INFLATE=y
 101.221  # Kernel hacking
 101.222  #
 101.223  # CONFIG_PRINTK_TIME is not set
 101.224 -# CONFIG_DEBUG_KERNEL is not set
 101.225 -CONFIG_LOG_BUF_SHIFT=14
 101.226 +CONFIG_DEBUG_KERNEL=y
 101.227 +CONFIG_MAGIC_SYSRQ=y
 101.228 +CONFIG_LOG_BUF_SHIFT=15
 101.229 +# CONFIG_SCHEDSTATS is not set
 101.230 +# CONFIG_DEBUG_SLAB is not set
 101.231 +# CONFIG_DEBUG_SPINLOCK is not set
 101.232 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 101.233 +# CONFIG_DEBUG_KOBJECT is not set
 101.234 +# CONFIG_DEBUG_INFO is not set
 101.235 +# CONFIG_DEBUG_FS is not set
 101.236 +# CONFIG_DEBUG_STACKOVERFLOW is not set
 101.237 +# CONFIG_KPROBES is not set
 101.238 +# CONFIG_DEBUG_STACK_USAGE is not set
 101.239 +# CONFIG_DEBUG_PAGEALLOC is not set
 101.240 +# CONFIG_4KSTACKS is not set
 101.241  CONFIG_X86_FIND_SMP_CONFIG=y
 101.242  CONFIG_X86_MPPARSE=y
 101.243 +# CONFIG_CHECKING is not set
 101.244 +# CONFIG_INIT_DEBUG is not set
   102.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
   102.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
   102.3 @@ -1,7 +1,7 @@
   102.4  #
   102.5  # Automatically generated make config: don't edit
   102.6  # Linux kernel version: 2.6.12-xenU
   102.7 -# Mon Jul 25 10:06:06 2005
   102.8 +# Wed Aug  3 09:57:44 2005
   102.9  #
  102.10  CONFIG_XEN=y
  102.11  CONFIG_ARCH_XEN=y
  102.12 @@ -12,11 +12,10 @@ CONFIG_NO_IDLE_HZ=y
  102.13  #
  102.14  # CONFIG_XEN_PRIVILEGED_GUEST is not set
  102.15  # CONFIG_XEN_PHYSDEV_ACCESS is not set
  102.16 -CONFIG_XEN_BLKDEV_GRANT=y
  102.17  CONFIG_XEN_BLKDEV_FRONTEND=y
  102.18  CONFIG_XEN_NETDEV_FRONTEND=y
  102.19 -#CONFIG_XEN_NETDEV_GRANT_TX=y
  102.20 -#CONFIG_XEN_NETDEV_GRANT_RX=y
  102.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
  102.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
  102.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  102.24  # CONFIG_XEN_BLKDEV_TAP is not set
  102.25  # CONFIG_XEN_SHADOW_MODE is not set
  102.26 @@ -90,11 +89,11 @@ CONFIG_GENERIC_IOMAP=y
  102.27  # CONFIG_M586 is not set
  102.28  # CONFIG_M586TSC is not set
  102.29  # CONFIG_M586MMX is not set
  102.30 -# CONFIG_M686 is not set
  102.31 +CONFIG_M686=y
  102.32  # CONFIG_MPENTIUMII is not set
  102.33  # CONFIG_MPENTIUMIII is not set
  102.34  # CONFIG_MPENTIUMM is not set
  102.35 -CONFIG_MPENTIUM4=y
  102.36 +# CONFIG_MPENTIUM4 is not set
  102.37  # CONFIG_MK6 is not set
  102.38  # CONFIG_MK7 is not set
  102.39  # CONFIG_MK8 is not set
  102.40 @@ -109,15 +108,15 @@ CONFIG_MPENTIUM4=y
  102.41  # CONFIG_X86_GENERIC is not set
  102.42  CONFIG_X86_CMPXCHG=y
  102.43  CONFIG_X86_XADD=y
  102.44 -CONFIG_X86_L1_CACHE_SHIFT=7
  102.45 +CONFIG_X86_L1_CACHE_SHIFT=5
  102.46  CONFIG_RWSEM_XCHGADD_ALGORITHM=y
  102.47  CONFIG_GENERIC_CALIBRATE_DELAY=y
  102.48 +CONFIG_X86_PPRO_FENCE=y
  102.49  CONFIG_X86_WP_WORKS_OK=y
  102.50  CONFIG_X86_INVLPG=y
  102.51  CONFIG_X86_BSWAP=y
  102.52  CONFIG_X86_POPAD_OK=y
  102.53  CONFIG_X86_GOOD_APIC=y
  102.54 -CONFIG_X86_INTEL_USERCOPY=y
  102.55  CONFIG_X86_USE_PPRO_CHECKSUM=y
  102.56  # CONFIG_HPET_TIMER is not set
  102.57  # CONFIG_HPET_EMULATE_RTC is not set
  102.58 @@ -415,7 +414,7 @@ CONFIG_RAMFS=y
  102.59  # CONFIG_BEFS_FS is not set
  102.60  # CONFIG_BFS_FS is not set
  102.61  # CONFIG_EFS_FS is not set
  102.62 -# CONFIG_CRAMFS is not set
  102.63 +CONFIG_CRAMFS=y
  102.64  # CONFIG_VXFS_FS is not set
  102.65  # CONFIG_HPFS_FS is not set
  102.66  # CONFIG_QNX4FS_FS is not set
   103.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
   103.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
   103.3 @@ -1,7 +1,7 @@
   103.4  #
   103.5  # Automatically generated make config: don't edit
   103.6  # Linux kernel version: 2.6.12-xenU
   103.7 -# Thu Jul  7 11:43:14 2005
   103.8 +# Thu Aug 18 11:15:14 2005
   103.9  #
  103.10  CONFIG_XEN=y
  103.11  CONFIG_ARCH_XEN=y
  103.12 @@ -12,9 +12,10 @@ CONFIG_NO_IDLE_HZ=y
  103.13  #
  103.14  # CONFIG_XEN_PRIVILEGED_GUEST is not set
  103.15  # CONFIG_XEN_PHYSDEV_ACCESS is not set
  103.16 -CONFIG_XEN_BLKDEV_GRANT=y
  103.17  CONFIG_XEN_BLKDEV_FRONTEND=y
  103.18  CONFIG_XEN_NETDEV_FRONTEND=y
  103.19 +CONFIG_XEN_NETDEV_GRANT_TX=y
  103.20 +CONFIG_XEN_NETDEV_GRANT_RX=y
  103.21  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  103.22  # CONFIG_XEN_BLKDEV_TAP is not set
  103.23  # CONFIG_XEN_SHADOW_MODE is not set
  103.24 @@ -28,7 +29,7 @@ CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
  103.25  #
  103.26  CONFIG_EXPERIMENTAL=y
  103.27  CONFIG_CLEAN_COMPILE=y
  103.28 -CONFIG_BROKEN_ON_SMP=y
  103.29 +CONFIG_LOCK_KERNEL=y
  103.30  CONFIG_INIT_ENV_ARG_LIMIT=32
  103.31  
  103.32  #
  103.33 @@ -46,8 +47,10 @@ CONFIG_AUDITSYSCALL=y
  103.34  CONFIG_HOTPLUG=y
  103.35  CONFIG_KOBJECT_UEVENT=y
  103.36  # CONFIG_IKCONFIG is not set
  103.37 +# CONFIG_CPUSETS is not set
  103.38  # CONFIG_EMBEDDED is not set
  103.39  CONFIG_KALLSYMS=y
  103.40 +# CONFIG_KALLSYMS_ALL is not set
  103.41  CONFIG_KALLSYMS_EXTRA_PASS=y
  103.42  CONFIG_PRINTK=y
  103.43  CONFIG_BUG=y
  103.44 @@ -72,6 +75,7 @@ CONFIG_OBSOLETE_MODPARM=y
  103.45  CONFIG_MODVERSIONS=y
  103.46  # CONFIG_MODULE_SRCVERSION_ALL is not set
  103.47  CONFIG_KMOD=y
  103.48 +CONFIG_STOP_MACHINE=y
  103.49  CONFIG_XENARCH="x86_64"
  103.50  CONFIG_X86=y
  103.51  CONFIG_MMU=y
  103.52 @@ -84,12 +88,15 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
  103.53  CONFIG_GENERIC_CALIBRATE_DELAY=y
  103.54  CONFIG_X86_GOOD_APIC=y
  103.55  # CONFIG_HPET_TIMER is not set
  103.56 -# CONFIG_SMP is not set
  103.57 +CONFIG_SMP=y
  103.58 +CONFIG_NR_CPUS=8
  103.59 +# CONFIG_SCHED_SMT is not set
  103.60  # CONFIG_PREEMPT is not set
  103.61  # CONFIG_MICROCODE is not set
  103.62  CONFIG_X86_CPUID=y
  103.63  # CONFIG_NUMA is not set
  103.64  # CONFIG_MTRR is not set
  103.65 +CONFIG_HAVE_DEC_LOCK=y
  103.66  # CONFIG_X86_LOCAL_APIC is not set
  103.67  # CONFIG_X86_IO_APIC is not set
  103.68  # CONFIG_PCI is not set
  103.69 @@ -112,7 +119,11 @@ CONFIG_MPSC=y
  103.70  # CONFIG_GENERIC_CPU is not set
  103.71  CONFIG_X86_L1_CACHE_BYTES=128
  103.72  # CONFIG_X86_TSC is not set
  103.73 +CONFIG_X86_XEN_GENAPIC=y
  103.74  # CONFIG_X86_MSR is not set
  103.75 +CONFIG_X86_HT=y
  103.76 +# CONFIG_K8_NUMA is not set
  103.77 +# CONFIG_NUMA_EMU is not set
  103.78  CONFIG_DUMMY_IOMMU=y
  103.79  # CONFIG_X86_MCE is not set
  103.80  
  103.81 @@ -155,6 +166,7 @@ CONFIG_BINFMT_MISC=y
  103.82  CONFIG_STANDALONE=y
  103.83  CONFIG_PREVENT_FIRMWARE_BUILD=y
  103.84  CONFIG_FW_LOADER=y
  103.85 +# CONFIG_DEBUG_DRIVER is not set
  103.86  
  103.87  #
  103.88  # Block devices
  103.89 @@ -257,7 +269,10 @@ CONFIG_IP_ROUTE_FWMARK=y
  103.90  CONFIG_IP_ROUTE_MULTIPATH=y
  103.91  # CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
  103.92  CONFIG_IP_ROUTE_VERBOSE=y
  103.93 -# CONFIG_IP_PNP is not set
  103.94 +CONFIG_IP_PNP=y
  103.95 +CONFIG_IP_PNP_DHCP=y
  103.96 +CONFIG_IP_PNP_BOOTP=y
  103.97 +CONFIG_IP_PNP_RARP=y
  103.98  CONFIG_NET_IPIP=m
  103.99  CONFIG_NET_IPGRE=m
 103.100  CONFIG_NET_IPGRE_BROADCAST=y
 103.101 @@ -557,7 +572,6 @@ CONFIG_ACT200L_DONGLE=m
 103.102  #
 103.103  # Old SIR device drivers
 103.104  #
 103.105 -# CONFIG_IRPORT_SIR is not set
 103.106  
 103.107  #
 103.108  # Old Serial dongle support
 103.109 @@ -660,14 +674,14 @@ CONFIG_EXT2_FS=y
 103.110  CONFIG_EXT2_FS_XATTR=y
 103.111  CONFIG_EXT2_FS_POSIX_ACL=y
 103.112  CONFIG_EXT2_FS_SECURITY=y
 103.113 -CONFIG_EXT3_FS=m
 103.114 +CONFIG_EXT3_FS=y
 103.115  CONFIG_EXT3_FS_XATTR=y
 103.116 -CONFIG_EXT3_FS_POSIX_ACL=y
 103.117 -CONFIG_EXT3_FS_SECURITY=y
 103.118 +# CONFIG_EXT3_FS_POSIX_ACL is not set
 103.119 +# CONFIG_EXT3_FS_SECURITY is not set
 103.120  CONFIG_JBD=m
 103.121  # CONFIG_JBD_DEBUG is not set
 103.122  CONFIG_FS_MBCACHE=y
 103.123 -CONFIG_REISERFS_FS=m
 103.124 +CONFIG_REISERFS_FS=y
 103.125  # CONFIG_REISERFS_CHECK is not set
 103.126  CONFIG_REISERFS_PROC_INFO=y
 103.127  CONFIG_REISERFS_FS_XATTR=y
 103.128 @@ -746,7 +760,7 @@ CONFIG_BEFS_FS=m
 103.129  # CONFIG_BEFS_DEBUG is not set
 103.130  CONFIG_BFS_FS=m
 103.131  CONFIG_EFS_FS=m
 103.132 -CONFIG_CRAMFS=m
 103.133 +CONFIG_CRAMFS=y
 103.134  CONFIG_VXFS_FS=m
 103.135  # CONFIG_HPFS_FS is not set
 103.136  CONFIG_QNX4FS_FS=m
 103.137 @@ -859,17 +873,7 @@ CONFIG_NLS_UTF8=m
 103.138  # Security options
 103.139  #
 103.140  # CONFIG_KEYS is not set
 103.141 -CONFIG_SECURITY=y
 103.142 -CONFIG_SECURITY_NETWORK=y
 103.143 -CONFIG_SECURITY_CAPABILITIES=y
 103.144 -# CONFIG_SECURITY_SECLVL is not set
 103.145 -CONFIG_SECURITY_SELINUX=y
 103.146 -CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 103.147 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
 103.148 -CONFIG_SECURITY_SELINUX_DISABLE=y
 103.149 -CONFIG_SECURITY_SELINUX_DEVELOP=y
 103.150 -CONFIG_SECURITY_SELINUX_AVC_STATS=y
 103.151 -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
 103.152 +# CONFIG_SECURITY is not set
 103.153  
 103.154  #
 103.155  # Cryptographic options
 103.156 @@ -917,5 +921,19 @@ CONFIG_ZLIB_DEFLATE=m
 103.157  # Kernel hacking
 103.158  #
 103.159  # CONFIG_PRINTK_TIME is not set
 103.160 -# CONFIG_DEBUG_KERNEL is not set
 103.161 -CONFIG_LOG_BUF_SHIFT=14
 103.162 +CONFIG_DEBUG_KERNEL=y
 103.163 +CONFIG_MAGIC_SYSRQ=y
 103.164 +CONFIG_LOG_BUF_SHIFT=15
 103.165 +# CONFIG_SCHEDSTATS is not set
 103.166 +# CONFIG_DEBUG_SLAB is not set
 103.167 +# CONFIG_DEBUG_SPINLOCK is not set
 103.168 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 103.169 +# CONFIG_DEBUG_KOBJECT is not set
 103.170 +# CONFIG_DEBUG_INFO is not set
 103.171 +# CONFIG_DEBUG_FS is not set
 103.172 +# CONFIG_DEBUG_STACKOVERFLOW is not set
 103.173 +# CONFIG_KPROBES is not set
 103.174 +# CONFIG_DEBUG_STACK_USAGE is not set
 103.175 +# CONFIG_DEBUG_PAGEALLOC is not set
 103.176 +# CONFIG_4KSTACKS is not set
 103.177 +# CONFIG_INIT_DEBUG is not set
   104.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
   104.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
   104.3 @@ -1,7 +1,7 @@
   104.4  #
   104.5  # Automatically generated make config: don't edit
   104.6  # Linux kernel version: 2.6.12-xen
   104.7 -# Thu Jul 14 21:55:53 2005
   104.8 +# Wed Aug  3 10:04:25 2005
   104.9  #
  104.10  CONFIG_XEN=y
  104.11  CONFIG_ARCH_XEN=y
  104.12 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
  104.13  CONFIG_XEN_PHYSDEV_ACCESS=y
  104.14  CONFIG_XEN_BLKDEV_BACKEND=y
  104.15  # CONFIG_XEN_BLKDEV_TAP_BE is not set
  104.16 -CONFIG_XEN_BLKDEV_GRANT=y
  104.17  CONFIG_XEN_NETDEV_BACKEND=y
  104.18  CONFIG_XEN_BLKDEV_FRONTEND=y
  104.19  CONFIG_XEN_NETDEV_FRONTEND=y
  104.20 +CONFIG_XEN_NETDEV_GRANT_TX=y
  104.21 +CONFIG_XEN_NETDEV_GRANT_RX=y
  104.22  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  104.23  # CONFIG_XEN_BLKDEV_TAP is not set
  104.24  # CONFIG_XEN_SHADOW_MODE is not set
  104.25 @@ -135,6 +136,7 @@ CONFIG_PREEMPT_BKL=y
  104.26  # CONFIG_X86_REBOOTFIXUPS is not set
  104.27  CONFIG_MICROCODE=m
  104.28  CONFIG_X86_CPUID=m
  104.29 +CONFIG_SWIOTLB=y
  104.30  
  104.31  #
  104.32  # Firmware Drivers
   105.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
   105.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
   105.3 @@ -1,7 +1,7 @@
   105.4  #
   105.5  # Automatically generated make config: don't edit
   105.6 -# Linux kernel version: 2.6.12-xen
   105.7 -# Fri Jul 15 00:34:21 2005
   105.8 +# Linux kernel version: 2.6.12.4-xen
   105.9 +# Mon Aug 15 19:54:11 2005
  105.10  #
  105.11  CONFIG_XEN=y
  105.12  CONFIG_ARCH_XEN=y
  105.13 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
  105.14  CONFIG_XEN_PHYSDEV_ACCESS=y
  105.15  CONFIG_XEN_BLKDEV_BACKEND=y
  105.16  # CONFIG_XEN_BLKDEV_TAP_BE is not set
  105.17 -CONFIG_XEN_BLKDEV_GRANT=y
  105.18  CONFIG_XEN_NETDEV_BACKEND=y
  105.19  CONFIG_XEN_BLKDEV_FRONTEND=y
  105.20  CONFIG_XEN_NETDEV_FRONTEND=y
  105.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
  105.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
  105.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
  105.24  # CONFIG_XEN_BLKDEV_TAP is not set
  105.25  # CONFIG_XEN_SHADOW_MODE is not set
  105.26 @@ -33,6 +34,7 @@ CONFIG_EXPERIMENTAL=y
  105.27  # CONFIG_CLEAN_COMPILE is not set
  105.28  CONFIG_BROKEN=y
  105.29  CONFIG_BROKEN_ON_SMP=y
  105.30 +CONFIG_LOCK_KERNEL=y
  105.31  CONFIG_INIT_ENV_ARG_LIMIT=32
  105.32  
  105.33  #
  105.34 @@ -48,10 +50,11 @@ CONFIG_SYSCTL=y
  105.35  CONFIG_HOTPLUG=y
  105.36  CONFIG_KOBJECT_UEVENT=y
  105.37  # CONFIG_IKCONFIG is not set
  105.38 +# CONFIG_CPUSETS is not set
  105.39  # CONFIG_EMBEDDED is not set
  105.40  CONFIG_KALLSYMS=y
  105.41  # CONFIG_KALLSYMS_ALL is not set
  105.42 -# CONFIG_KALLSYMS_EXTRA_PASS is not set
  105.43 +CONFIG_KALLSYMS_EXTRA_PASS=y
  105.44  CONFIG_PRINTK=y
  105.45  CONFIG_BUG=y
  105.46  CONFIG_BASE_FULL=y
  105.47 @@ -73,8 +76,9 @@ CONFIG_MODULE_UNLOAD=y
  105.48  # CONFIG_MODULE_FORCE_UNLOAD is not set
  105.49  CONFIG_OBSOLETE_MODPARM=y
  105.50  # CONFIG_MODVERSIONS is not set
  105.51 -# CONFIG_MODULE_SRCVERSION_ALL is not set
  105.52 +CONFIG_MODULE_SRCVERSION_ALL=y
  105.53  CONFIG_KMOD=y
  105.54 +CONFIG_STOP_MACHINE=y
  105.55  CONFIG_XENARCH="x86_64"
  105.56  CONFIG_X86=y
  105.57  CONFIG_MMU=y
  105.58 @@ -87,12 +91,15 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
  105.59  CONFIG_GENERIC_CALIBRATE_DELAY=y
  105.60  CONFIG_X86_GOOD_APIC=y
  105.61  # CONFIG_HPET_TIMER is not set
  105.62 -# CONFIG_SMP is not set
  105.63 +CONFIG_SMP=y
  105.64 +CONFIG_NR_CPUS=8
  105.65 +# CONFIG_SCHED_SMT is not set
  105.66  # CONFIG_PREEMPT is not set
  105.67  CONFIG_MICROCODE=y
  105.68  # CONFIG_X86_CPUID is not set
  105.69  # CONFIG_NUMA is not set
  105.70  # CONFIG_MTRR is not set
  105.71 +CONFIG_HAVE_DEC_LOCK=y
  105.72  CONFIG_X86_LOCAL_APIC=y
  105.73  CONFIG_X86_IO_APIC=y
  105.74  CONFIG_PCI=y
  105.75 @@ -108,7 +115,7 @@ CONFIG_SECCOMP=y
  105.76  #
  105.77  CONFIG_X86_64=y
  105.78  CONFIG_64BIT=y
  105.79 -# CONFIG_EARLY_PRINTK is not set
  105.80 +CONFIG_EARLY_PRINTK=y
  105.81  
  105.82  #
  105.83  # Processor type and features
  105.84 @@ -117,9 +124,14 @@ CONFIG_64BIT=y
  105.85  CONFIG_GENERIC_CPU=y
  105.86  CONFIG_X86_L1_CACHE_BYTES=128
  105.87  # CONFIG_X86_TSC is not set
  105.88 +CONFIG_X86_XEN_GENAPIC=y
  105.89  # CONFIG_X86_MSR is not set
  105.90 +CONFIG_X86_HT=y
  105.91 +# CONFIG_K8_NUMA is not set
  105.92 +# CONFIG_NUMA_EMU is not set
  105.93  # CONFIG_GART_IOMMU is not set
  105.94  CONFIG_DUMMY_IOMMU=y
  105.95 +CONFIG_SWIOTLB=y
  105.96  # CONFIG_X86_MCE is not set
  105.97  
  105.98  #
  105.99 @@ -149,7 +161,7 @@ CONFIG_SYSVIPC_COMPAT=y
 105.100  # Executable file formats
 105.101  #
 105.102  CONFIG_BINFMT_ELF=y
 105.103 -CONFIG_BINFMT_MISC=m
 105.104 +CONFIG_BINFMT_MISC=y
 105.105  
 105.106  #
 105.107  # Device Drivers
 105.108 @@ -160,7 +172,7 @@ CONFIG_BINFMT_MISC=m
 105.109  #
 105.110  CONFIG_STANDALONE=y
 105.111  CONFIG_PREVENT_FIRMWARE_BUILD=y
 105.112 -CONFIG_FW_LOADER=m
 105.113 +CONFIG_FW_LOADER=y
 105.114  # CONFIG_DEBUG_DRIVER is not set
 105.115  
 105.116  #
 105.117 @@ -174,7 +186,7 @@ CONFIG_MTD_REDBOOT_PARTS=m
 105.118  CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
 105.119  # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
 105.120  # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
 105.121 -# CONFIG_MTD_CMDLINE_PARTS is not set
 105.122 +CONFIG_MTD_CMDLINE_PARTS=y
 105.123  
 105.124  #
 105.125  # User Modules And Translation Layers
 105.126 @@ -206,24 +218,20 @@ CONFIG_MTD_CFI_I2=y
 105.127  # CONFIG_MTD_CFI_I8 is not set
 105.128  CONFIG_MTD_CFI_INTELEXT=m
 105.129  CONFIG_MTD_CFI_AMDSTD=m
 105.130 -CONFIG_MTD_CFI_AMDSTD_RETRY=0
 105.131 +CONFIG_MTD_CFI_AMDSTD_RETRY=3
 105.132  CONFIG_MTD_CFI_STAA=m
 105.133  CONFIG_MTD_CFI_UTIL=m
 105.134  CONFIG_MTD_RAM=m
 105.135  CONFIG_MTD_ROM=m
 105.136  CONFIG_MTD_ABSENT=m
 105.137  # CONFIG_MTD_OBSOLETE_CHIPS is not set
 105.138 -# CONFIG_MTD_XIP is not set
 105.139  
 105.140  #
 105.141  # Mapping drivers for chip access
 105.142  #
 105.143  CONFIG_MTD_COMPLEX_MAPPINGS=y
 105.144 -CONFIG_MTD_PHYSMAP=m
 105.145 -CONFIG_MTD_PHYSMAP_START=0x8000000
 105.146 -CONFIG_MTD_PHYSMAP_LEN=0x4000000
 105.147 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 105.148 -CONFIG_MTD_PNC2000=m
 105.149 +# CONFIG_MTD_PHYSMAP is not set
 105.150 +# CONFIG_MTD_PNC2000 is not set
 105.151  CONFIG_MTD_SC520CDP=m
 105.152  CONFIG_MTD_NETSC520=m
 105.153  CONFIG_MTD_TS5500=m
 105.154 @@ -231,10 +239,9 @@ CONFIG_MTD_SBC_GXX=m
 105.155  CONFIG_MTD_ELAN_104NC=m
 105.156  # CONFIG_MTD_AMD76XROM is not set
 105.157  # CONFIG_MTD_ICHXROM is not set
 105.158 -# CONFIG_MTD_SCB2_FLASH is not set
 105.159 -CONFIG_MTD_NETtel=m
 105.160 -CONFIG_MTD_DILNETPC=m
 105.161 -CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000
 105.162 +CONFIG_MTD_SCB2_FLASH=m
 105.163 +# CONFIG_MTD_NETtel is not set
 105.164 +# CONFIG_MTD_DILNETPC is not set
 105.165  # CONFIG_MTD_L440GX is not set
 105.166  CONFIG_MTD_PCI=m
 105.167  
 105.168 @@ -244,19 +251,19 @@ CONFIG_MTD_PCI=m
 105.169  CONFIG_MTD_PMC551=m
 105.170  # CONFIG_MTD_PMC551_BUGFIX is not set
 105.171  # CONFIG_MTD_PMC551_DEBUG is not set
 105.172 -CONFIG_MTD_SLRAM=m
 105.173 -CONFIG_MTD_PHRAM=m
 105.174 +# CONFIG_MTD_SLRAM is not set
 105.175 +# CONFIG_MTD_PHRAM is not set
 105.176  CONFIG_MTD_MTDRAM=m
 105.177  CONFIG_MTDRAM_TOTAL_SIZE=4096
 105.178  CONFIG_MTDRAM_ERASE_SIZE=128
 105.179 -CONFIG_MTD_BLKMTD=m
 105.180 -# CONFIG_MTD_BLOCK2MTD is not set
 105.181 +# CONFIG_MTD_BLKMTD is not set
 105.182 +CONFIG_MTD_BLOCK2MTD=m
 105.183  
 105.184  #
 105.185  # Disk-On-Chip Device Drivers
 105.186  #
 105.187  CONFIG_MTD_DOC2000=m
 105.188 -CONFIG_MTD_DOC2001=m
 105.189 +# CONFIG_MTD_DOC2001 is not set
 105.190  CONFIG_MTD_DOC2001PLUS=m
 105.191  CONFIG_MTD_DOCPROBE=m
 105.192  CONFIG_MTD_DOCECC=m
 105.193 @@ -269,10 +276,7 @@ CONFIG_MTD_DOCPROBE_ADDRESS=0
 105.194  CONFIG_MTD_NAND=m
 105.195  # CONFIG_MTD_NAND_VERIFY_WRITE is not set
 105.196  CONFIG_MTD_NAND_IDS=m
 105.197 -CONFIG_MTD_NAND_DISKONCHIP=m
 105.198 -# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
 105.199 -CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
 105.200 -# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
 105.201 +# CONFIG_MTD_NAND_DISKONCHIP is not set
 105.202  # CONFIG_MTD_NAND_NANDSIM is not set
 105.203  
 105.204  #
 105.205 @@ -280,8 +284,7 @@ CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS
 105.206  #
 105.207  CONFIG_PARPORT=m
 105.208  CONFIG_PARPORT_PC=m
 105.209 -CONFIG_PARPORT_SERIAL=m
 105.210 -CONFIG_PARPORT_PC_FIFO=y
 105.211 +# CONFIG_PARPORT_PC_FIFO is not set
 105.212  # CONFIG_PARPORT_PC_SUPERIO is not set
 105.213  CONFIG_PARPORT_NOT_PC=y
 105.214  # CONFIG_PARPORT_GSC is not set
 105.215 @@ -290,13 +293,7 @@ CONFIG_PARPORT_1284=y
 105.216  #
 105.217  # Plug and Play support
 105.218  #
 105.219 -CONFIG_PNP=y
 105.220 -# CONFIG_PNP_DEBUG is not set
 105.221 -
 105.222 -#
 105.223 -# Protocols
 105.224 -#
 105.225 -CONFIG_PNPACPI=y
 105.226 +# CONFIG_PNP is not set
 105.227  
 105.228  #
 105.229  # Block devices
 105.230 @@ -324,7 +321,7 @@ CONFIG_PARIDE_DSTR=m
 105.231  CONFIG_PARIDE_FIT2=m
 105.232  CONFIG_PARIDE_FIT3=m
 105.233  CONFIG_PARIDE_EPAT=m
 105.234 -# CONFIG_PARIDE_EPATC8 is not set
 105.235 +CONFIG_PARIDE_EPATC8=y
 105.236  CONFIG_PARIDE_EPIA=m
 105.237  CONFIG_PARIDE_FRIQ=m
 105.238  CONFIG_PARIDE_FRPW=m
 105.239 @@ -345,7 +342,7 @@ CONFIG_BLK_DEV_SX8=m
 105.240  # CONFIG_BLK_DEV_UB is not set
 105.241  CONFIG_BLK_DEV_RAM=y
 105.242  CONFIG_BLK_DEV_RAM_COUNT=16
 105.243 -CONFIG_BLK_DEV_RAM_SIZE=8192
 105.244 +CONFIG_BLK_DEV_RAM_SIZE=16384
 105.245  CONFIG_BLK_DEV_INITRD=y
 105.246  CONFIG_INITRAMFS_SOURCE=""
 105.247  CONFIG_LBD=y
 105.248 @@ -360,70 +357,69 @@ CONFIG_IOSCHED_NOOP=y
 105.249  CONFIG_IOSCHED_AS=y
 105.250  CONFIG_IOSCHED_DEADLINE=y
 105.251  CONFIG_IOSCHED_CFQ=y
 105.252 -# CONFIG_ATA_OVER_ETH is not set
 105.253 +CONFIG_ATA_OVER_ETH=m
 105.254  
 105.255  #
 105.256  # ATA/ATAPI/MFM/RLL support
 105.257  #
 105.258 -CONFIG_IDE=m
 105.259 -CONFIG_BLK_DEV_IDE=m
 105.260 +CONFIG_IDE=y
 105.261 +CONFIG_BLK_DEV_IDE=y
 105.262  
 105.263  #
 105.264  # Please see Documentation/ide.txt for help/info on IDE drives
 105.265  #
 105.266  # CONFIG_BLK_DEV_IDE_SATA is not set
 105.267  # CONFIG_BLK_DEV_HD_IDE is not set
 105.268 -CONFIG_BLK_DEV_IDEDISK=m
 105.269 -# CONFIG_IDEDISK_MULTI_MODE is not set
 105.270 -CONFIG_BLK_DEV_IDECD=m
 105.271 -CONFIG_BLK_DEV_IDETAPE=m
 105.272 -CONFIG_BLK_DEV_IDEFLOPPY=m
 105.273 +CONFIG_BLK_DEV_IDEDISK=y
 105.274 +CONFIG_IDEDISK_MULTI_MODE=y
 105.275 +CONFIG_BLK_DEV_IDECD=y
 105.276 +# CONFIG_BLK_DEV_IDETAPE is not set
 105.277 +CONFIG_BLK_DEV_IDEFLOPPY=y
 105.278  CONFIG_BLK_DEV_IDESCSI=m
 105.279  # CONFIG_IDE_TASK_IOCTL is not set
 105.280  
 105.281  #
 105.282  # IDE chipset support/bugfixes
 105.283  #
 105.284 -CONFIG_IDE_GENERIC=m
 105.285 +CONFIG_IDE_GENERIC=y
 105.286  CONFIG_BLK_DEV_CMD640=y
 105.287 -# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
 105.288 -# CONFIG_BLK_DEV_IDEPNP is not set
 105.289 +CONFIG_BLK_DEV_CMD640_ENHANCED=y
 105.290  CONFIG_BLK_DEV_IDEPCI=y
 105.291  CONFIG_IDEPCI_SHARE_IRQ=y
 105.292  # CONFIG_BLK_DEV_OFFBOARD is not set
 105.293 -CONFIG_BLK_DEV_GENERIC=m
 105.294 -CONFIG_BLK_DEV_OPTI621=m
 105.295 -CONFIG_BLK_DEV_RZ1000=m
 105.296 +CONFIG_BLK_DEV_GENERIC=y
 105.297 +# CONFIG_BLK_DEV_OPTI621 is not set
 105.298 +CONFIG_BLK_DEV_RZ1000=y
 105.299  CONFIG_BLK_DEV_IDEDMA_PCI=y
 105.300  # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 105.301  CONFIG_IDEDMA_PCI_AUTO=y
 105.302  # CONFIG_IDEDMA_ONLYDISK is not set
 105.303 -CONFIG_BLK_DEV_AEC62XX=m
 105.304 -CONFIG_BLK_DEV_ALI15X3=m
 105.305 +CONFIG_BLK_DEV_AEC62XX=y
 105.306 +CONFIG_BLK_DEV_ALI15X3=y
 105.307  # CONFIG_WDC_ALI15X3 is not set
 105.308 -CONFIG_BLK_DEV_AMD74XX=m
 105.309 -CONFIG_BLK_DEV_ATIIXP=m
 105.310 -CONFIG_BLK_DEV_CMD64X=m
 105.311 -CONFIG_BLK_DEV_TRIFLEX=m
 105.312 -CONFIG_BLK_DEV_CY82C693=m
 105.313 -CONFIG_BLK_DEV_CS5520=m
 105.314 -CONFIG_BLK_DEV_CS5530=m
 105.315 -CONFIG_BLK_DEV_HPT34X=m
 105.316 +CONFIG_BLK_DEV_AMD74XX=y
 105.317 +CONFIG_BLK_DEV_ATIIXP=y
 105.318 +CONFIG_BLK_DEV_CMD64X=y
 105.319 +CONFIG_BLK_DEV_TRIFLEX=y
 105.320 +CONFIG_BLK_DEV_CY82C693=y
 105.321 +CONFIG_BLK_DEV_CS5520=y
 105.322 +CONFIG_BLK_DEV_CS5530=y
 105.323 +CONFIG_BLK_DEV_HPT34X=y
 105.324  # CONFIG_HPT34X_AUTODMA is not set
 105.325 -CONFIG_BLK_DEV_HPT366=m
 105.326 -CONFIG_BLK_DEV_SC1200=m
 105.327 -CONFIG_BLK_DEV_PIIX=m
 105.328 -CONFIG_BLK_DEV_NS87415=m
 105.329 -CONFIG_BLK_DEV_PDC202XX_OLD=m
 105.330 -CONFIG_PDC202XX_BURST=y
 105.331 -CONFIG_BLK_DEV_PDC202XX_NEW=m
 105.332 +CONFIG_BLK_DEV_HPT366=y
 105.333 +# CONFIG_BLK_DEV_SC1200 is not set
 105.334 +CONFIG_BLK_DEV_PIIX=y
 105.335 +# CONFIG_BLK_DEV_NS87415 is not set
 105.336 +CONFIG_BLK_DEV_PDC202XX_OLD=y
 105.337 +# CONFIG_PDC202XX_BURST is not set
 105.338 +CONFIG_BLK_DEV_PDC202XX_NEW=y
 105.339  CONFIG_PDC202XX_FORCE=y
 105.340 -CONFIG_BLK_DEV_SVWKS=m
 105.341 -CONFIG_BLK_DEV_SIIMAGE=m
 105.342 -CONFIG_BLK_DEV_SIS5513=m
 105.343 -CONFIG_BLK_DEV_SLC90E66=m
 105.344 -CONFIG_BLK_DEV_TRM290=m
 105.345 -CONFIG_BLK_DEV_VIA82CXXX=m
 105.346 +CONFIG_BLK_DEV_SVWKS=y
 105.347 +CONFIG_BLK_DEV_SIIMAGE=y
 105.348 +CONFIG_BLK_DEV_SIS5513=y
 105.349 +CONFIG_BLK_DEV_SLC90E66=y
 105.350 +# CONFIG_BLK_DEV_TRM290 is not set
 105.351 +CONFIG_BLK_DEV_VIA82CXXX=y
 105.352  # CONFIG_IDE_ARM is not set
 105.353  CONFIG_BLK_DEV_IDEDMA=y
 105.354  # CONFIG_IDEDMA_IVB is not set
 105.355 @@ -433,17 +429,17 @@ CONFIG_IDEDMA_AUTO=y
 105.356  #
 105.357  # SCSI device support
 105.358  #
 105.359 -CONFIG_SCSI=m
 105.360 +CONFIG_SCSI=y
 105.361  CONFIG_SCSI_PROC_FS=y
 105.362  
 105.363  #
 105.364  # SCSI support type (disk, tape, CD-ROM)
 105.365  #
 105.366 -CONFIG_BLK_DEV_SD=m
 105.367 +CONFIG_BLK_DEV_SD=y
 105.368  CONFIG_CHR_DEV_ST=m
 105.369  CONFIG_CHR_DEV_OSST=m
 105.370  CONFIG_BLK_DEV_SR=m
 105.371 -# CONFIG_BLK_DEV_SR_VENDOR is not set
 105.372 +CONFIG_BLK_DEV_SR_VENDOR=y
 105.373  CONFIG_CHR_DEV_SG=m
 105.374  
 105.375  #
 105.376 @@ -458,7 +454,7 @@ CONFIG_SCSI_LOGGING=y
 105.377  #
 105.378  CONFIG_SCSI_SPI_ATTRS=m
 105.379  CONFIG_SCSI_FC_ATTRS=m
 105.380 -# CONFIG_SCSI_ISCSI_ATTRS is not set
 105.381 +CONFIG_SCSI_ISCSI_ATTRS=m
 105.382  
 105.383  #
 105.384  # SCSI low-level drivers
 105.385 @@ -468,29 +464,30 @@ CONFIG_SCSI_3W_9XXX=m
 105.386  CONFIG_SCSI_ACARD=m
 105.387  CONFIG_SCSI_AACRAID=m
 105.388  CONFIG_SCSI_AIC7XXX=m
 105.389 -CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
 105.390 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
 105.391  CONFIG_AIC7XXX_RESET_DELAY_MS=15000
 105.392 -CONFIG_AIC7XXX_DEBUG_ENABLE=y
 105.393 +# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
 105.394  CONFIG_AIC7XXX_DEBUG_MASK=0
 105.395 -CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 105.396 +# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
 105.397  CONFIG_SCSI_AIC7XXX_OLD=m
 105.398  CONFIG_SCSI_AIC79XX=m
 105.399 -CONFIG_AIC79XX_CMDS_PER_DEVICE=32
 105.400 +CONFIG_AIC79XX_CMDS_PER_DEVICE=4
 105.401  CONFIG_AIC79XX_RESET_DELAY_MS=15000
 105.402 -CONFIG_AIC79XX_ENABLE_RD_STRM=y
 105.403 -CONFIG_AIC79XX_DEBUG_ENABLE=y
 105.404 +# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
 105.405 +# CONFIG_AIC79XX_DEBUG_ENABLE is not set
 105.406  CONFIG_AIC79XX_DEBUG_MASK=0
 105.407 -CONFIG_AIC79XX_REG_PRETTY_PRINT=y
 105.408 -CONFIG_SCSI_ADVANSYS=m
 105.409 -# CONFIG_MEGARAID_NEWGEN is not set
 105.410 -CONFIG_MEGARAID_LEGACY=m
 105.411 +# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
 105.412 +# CONFIG_SCSI_ADVANSYS is not set
 105.413 +CONFIG_MEGARAID_NEWGEN=y
 105.414 +CONFIG_MEGARAID_MM=m
 105.415 +CONFIG_MEGARAID_MAILBOX=m
 105.416  CONFIG_SCSI_SATA=y
 105.417  CONFIG_SCSI_SATA_AHCI=m
 105.418  CONFIG_SCSI_SATA_SVW=m
 105.419 -CONFIG_SCSI_ATA_PIIX=m
 105.420 +CONFIG_SCSI_ATA_PIIX=y
 105.421  CONFIG_SCSI_SATA_NV=m
 105.422  CONFIG_SCSI_SATA_PROMISE=m
 105.423 -# CONFIG_SCSI_SATA_QSTOR is not set
 105.424 +CONFIG_SCSI_SATA_QSTOR=m
 105.425  CONFIG_SCSI_SATA_SX4=m
 105.426  CONFIG_SCSI_SATA_SIL=m
 105.427  CONFIG_SCSI_SATA_SIS=m
 105.428 @@ -500,17 +497,14 @@ CONFIG_SCSI_SATA_VITESSE=m
 105.429  CONFIG_SCSI_BUSLOGIC=m
 105.430  # CONFIG_SCSI_OMIT_FLASHPOINT is not set
 105.431  # CONFIG_SCSI_CPQFCTS is not set
 105.432 -CONFIG_SCSI_DMX3191D=m
 105.433 -CONFIG_SCSI_EATA=m
 105.434 -CONFIG_SCSI_EATA_TAGGED_QUEUE=y
 105.435 -CONFIG_SCSI_EATA_LINKED_COMMANDS=y
 105.436 -CONFIG_SCSI_EATA_MAX_TAGS=16
 105.437 -CONFIG_SCSI_EATA_PIO=m
 105.438 -CONFIG_SCSI_FUTURE_DOMAIN=m
 105.439 +# CONFIG_SCSI_DMX3191D is not set
 105.440 +# CONFIG_SCSI_EATA is not set
 105.441 +# CONFIG_SCSI_EATA_PIO is not set
 105.442 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
 105.443  CONFIG_SCSI_GDTH=m
 105.444  CONFIG_SCSI_IPS=m
 105.445 -# CONFIG_SCSI_INITIO is not set
 105.446 -# CONFIG_SCSI_INIA100 is not set
 105.447 +CONFIG_SCSI_INITIO=m
 105.448 +CONFIG_SCSI_INIA100=m
 105.449  CONFIG_SCSI_PPA=m
 105.450  CONFIG_SCSI_IMM=m
 105.451  # CONFIG_SCSI_IZIP_EPP16 is not set
 105.452 @@ -520,32 +514,29 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MOD
 105.453  CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 105.454  CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 105.455  # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
 105.456 -CONFIG_SCSI_IPR=m
 105.457 -# CONFIG_SCSI_IPR_TRACE is not set
 105.458 -# CONFIG_SCSI_IPR_DUMP is not set
 105.459 +# CONFIG_SCSI_IPR is not set
 105.460  # CONFIG_SCSI_PCI2000 is not set
 105.461  # CONFIG_SCSI_PCI2220I is not set
 105.462 -CONFIG_SCSI_QLOGIC_ISP=m
 105.463 -CONFIG_SCSI_QLOGIC_FC=m
 105.464 -CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
 105.465 +# CONFIG_SCSI_QLOGIC_ISP is not set
 105.466 +# CONFIG_SCSI_QLOGIC_FC is not set
 105.467  CONFIG_SCSI_QLOGIC_1280=m
 105.468  CONFIG_SCSI_QLOGIC_1280_1040=y
 105.469 -CONFIG_SCSI_QLA2XXX=m
 105.470 -# CONFIG_SCSI_QLA21XX is not set
 105.471 -# CONFIG_SCSI_QLA22XX is not set
 105.472 -# CONFIG_SCSI_QLA2300 is not set
 105.473 -# CONFIG_SCSI_QLA2322 is not set
 105.474 -# CONFIG_SCSI_QLA6312 is not set
 105.475 +CONFIG_SCSI_QLA2XXX=y
 105.476 +CONFIG_SCSI_QLA21XX=m
 105.477 +CONFIG_SCSI_QLA22XX=m
 105.478 +CONFIG_SCSI_QLA2300=m
 105.479 +CONFIG_SCSI_QLA2322=m
 105.480 +CONFIG_SCSI_QLA6312=m
 105.481  CONFIG_SCSI_LPFC=m
 105.482  CONFIG_SCSI_DC395x=m
 105.483  CONFIG_SCSI_DC390T=m
 105.484 -CONFIG_SCSI_DEBUG=m
 105.485 +# CONFIG_SCSI_DEBUG is not set
 105.486  
 105.487  #
 105.488  # Multi-device support (RAID and LVM)
 105.489  #
 105.490  CONFIG_MD=y
 105.491 -CONFIG_BLK_DEV_MD=m
 105.492 +CONFIG_BLK_DEV_MD=y
 105.493  CONFIG_MD_LINEAR=m
 105.494  CONFIG_MD_RAID0=m
 105.495  CONFIG_MD_RAID1=m
 105.496 @@ -579,7 +570,7 @@ CONFIG_IEEE1394=m
 105.497  # Subsystem Options
 105.498  #
 105.499  # CONFIG_IEEE1394_VERBOSEDEBUG is not set
 105.500 -# CONFIG_IEEE1394_OUI_DB is not set
 105.501 +CONFIG_IEEE1394_OUI_DB=y
 105.502  CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
 105.503  CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
 105.504  
 105.505 @@ -618,9 +609,9 @@ CONFIG_NET=y
 105.506  #
 105.507  # Networking options
 105.508  #
 105.509 -CONFIG_PACKET=m
 105.510 +CONFIG_PACKET=y
 105.511  CONFIG_PACKET_MMAP=y
 105.512 -CONFIG_UNIX=m
 105.513 +CONFIG_UNIX=y
 105.514  CONFIG_NET_KEY=m
 105.515  CONFIG_INET=y
 105.516  CONFIG_IP_MULTICAST=y
 105.517 @@ -784,11 +775,6 @@ CONFIG_IP6_NF_TARGET_MARK=m
 105.518  CONFIG_IP6_NF_RAW=m
 105.519  
 105.520  #
 105.521 -# DECnet: Netfilter Configuration
 105.522 -#
 105.523 -CONFIG_DECNET_NF_GRABULATOR=m
 105.524 -
 105.525 -#
 105.526  # Bridge: Netfilter Configuration
 105.527  #
 105.528  CONFIG_BRIDGE_NF_EBTABLES=m
 105.529 @@ -810,9 +796,9 @@ CONFIG_BRIDGE_EBT_MARK_T=m
 105.530  CONFIG_BRIDGE_EBT_REDIRECT=m
 105.531  CONFIG_BRIDGE_EBT_SNAT=m
 105.532  CONFIG_BRIDGE_EBT_LOG=m
 105.533 -# CONFIG_BRIDGE_EBT_ULOG is not set
 105.534 +CONFIG_BRIDGE_EBT_ULOG=m
 105.535  CONFIG_XFRM=y
 105.536 -CONFIG_XFRM_USER=m
 105.537 +CONFIG_XFRM_USER=y
 105.538  
 105.539  #
 105.540  # SCTP Configuration (EXPERIMENTAL)
 105.541 @@ -823,19 +809,18 @@ CONFIG_IP_SCTP=m
 105.542  # CONFIG_SCTP_HMAC_NONE is not set
 105.543  # CONFIG_SCTP_HMAC_SHA1 is not set
 105.544  CONFIG_SCTP_HMAC_MD5=y
 105.545 -CONFIG_ATM=y
 105.546 -CONFIG_ATM_CLIP=y
 105.547 +CONFIG_ATM=m
 105.548 +CONFIG_ATM_CLIP=m
 105.549  # CONFIG_ATM_CLIP_NO_ICMP is not set
 105.550  CONFIG_ATM_LANE=m
 105.551 -CONFIG_ATM_MPOA=m
 105.552 +# CONFIG_ATM_MPOA is not set
 105.553  CONFIG_ATM_BR2684=m
 105.554  # CONFIG_ATM_BR2684_IPFILTER is not set
 105.555  CONFIG_BRIDGE=m
 105.556  CONFIG_VLAN_8021Q=m
 105.557 -CONFIG_DECNET=m
 105.558 -# CONFIG_DECNET_ROUTER is not set
 105.559 +# CONFIG_DECNET is not set
 105.560  CONFIG_LLC=y
 105.561 -CONFIG_LLC2=m
 105.562 +# CONFIG_LLC2 is not set
 105.563  CONFIG_IPX=m
 105.564  # CONFIG_IPX_INTERN is not set
 105.565  CONFIG_ATALK=m
 105.566 @@ -843,12 +828,10 @@ CONFIG_DEV_APPLETALK=y
 105.567  CONFIG_IPDDP=m
 105.568  CONFIG_IPDDP_ENCAP=y
 105.569  CONFIG_IPDDP_DECAP=y
 105.570 -CONFIG_X25=m
 105.571 -CONFIG_LAPB=m
 105.572 -# CONFIG_NET_DIVERT is not set
 105.573 -CONFIG_ECONET=m
 105.574 -CONFIG_ECONET_AUNUDP=y
 105.575 -CONFIG_ECONET_NATIVE=y
 105.576 +# CONFIG_X25 is not set
 105.577 +# CONFIG_LAPB is not set
 105.578 +CONFIG_NET_DIVERT=y
 105.579 +# CONFIG_ECONET is not set
 105.580  CONFIG_WAN_ROUTER=m
 105.581  
 105.582  #
 105.583 @@ -880,9 +863,9 @@ CONFIG_NET_CLS_ROUTE4=m
 105.584  CONFIG_NET_CLS_ROUTE=y
 105.585  CONFIG_NET_CLS_FW=m
 105.586  CONFIG_NET_CLS_U32=m
 105.587 -# CONFIG_CLS_U32_PERF is not set
 105.588 -# CONFIG_NET_CLS_IND is not set
 105.589 -# CONFIG_CLS_U32_MARK is not set
 105.590 +CONFIG_CLS_U32_PERF=y
 105.591 +CONFIG_NET_CLS_IND=y
 105.592 +CONFIG_CLS_U32_MARK=y
 105.593  CONFIG_NET_CLS_RSVP=m
 105.594  CONFIG_NET_CLS_RSVP6=m
 105.595  CONFIG_NET_EMATCH=y
 105.596 @@ -897,31 +880,12 @@ CONFIG_NET_CLS_POLICE=y
 105.597  #
 105.598  # Network testing
 105.599  #
 105.600 -CONFIG_NET_PKTGEN=m
 105.601 +# CONFIG_NET_PKTGEN is not set
 105.602  CONFIG_NETPOLL=y
 105.603  # CONFIG_NETPOLL_RX is not set
 105.604 -# CONFIG_NETPOLL_TRAP is not set
 105.605 +CONFIG_NETPOLL_TRAP=y
 105.606  CONFIG_NET_POLL_CONTROLLER=y
 105.607 -CONFIG_HAMRADIO=y
 105.608 -
 105.609 -#
 105.610 -# Packet Radio protocols
 105.611 -#
 105.612 -CONFIG_AX25=m
 105.613 -# CONFIG_AX25_DAMA_SLAVE is not set
 105.614 -CONFIG_NETROM=m
 105.615 -CONFIG_ROSE=m
 105.616 -
 105.617 -#
 105.618 -# AX.25 network device drivers
 105.619 -#
 105.620 -CONFIG_MKISS=m
 105.621 -CONFIG_6PACK=m
 105.622 -CONFIG_BPQETHER=m
 105.623 -CONFIG_BAYCOM_SER_FDX=m
 105.624 -CONFIG_BAYCOM_SER_HDX=m
 105.625 -CONFIG_BAYCOM_PAR=m
 105.626 -CONFIG_YAM=m
 105.627 +# CONFIG_HAMRADIO is not set
 105.628  CONFIG_IRDA=m
 105.629  
 105.630  #
 105.631 @@ -937,7 +901,7 @@ CONFIG_IRCOMM=m
 105.632  #
 105.633  CONFIG_IRDA_CACHE_LAST_LSAP=y
 105.634  CONFIG_IRDA_FAST_RR=y
 105.635 -CONFIG_IRDA_DEBUG=y
 105.636 +# CONFIG_IRDA_DEBUG is not set
 105.637  
 105.638  #
 105.639  # Infrared-port device drivers
 105.640 @@ -1002,9 +966,9 @@ CONFIG_BT_HCIUSB_SCO=y
 105.641  CONFIG_BT_HCIUART=m
 105.642  CONFIG_BT_HCIUART_H4=y
 105.643  CONFIG_BT_HCIUART_BCSP=y
 105.644 -# CONFIG_BT_HCIUART_BCSP_TXCRC is not set
 105.645 +CONFIG_BT_HCIUART_BCSP_TXCRC=y
 105.646  CONFIG_BT_HCIBCM203X=m
 105.647 -# CONFIG_BT_HCIBPA10X is not set
 105.648 +CONFIG_BT_HCIBPA10X=m
 105.649  CONFIG_BT_HCIBFUSB=m
 105.650  CONFIG_BT_HCIVHCI=m
 105.651  CONFIG_NETDEVICES=y
 105.652 @@ -1012,21 +976,11 @@ CONFIG_DUMMY=m
 105.653  CONFIG_BONDING=m
 105.654  CONFIG_EQUALIZER=m
 105.655  CONFIG_TUN=m
 105.656 -CONFIG_NET_SB1000=m
 105.657  
 105.658  #
 105.659  # ARCnet devices
 105.660  #
 105.661 -CONFIG_ARCNET=m
 105.662 -CONFIG_ARCNET_1201=m
 105.663 -CONFIG_ARCNET_1051=m
 105.664 -CONFIG_ARCNET_RAW=m
 105.665 -# CONFIG_ARCNET_CAP is not set
 105.666 -CONFIG_ARCNET_COM90xx=m
 105.667 -CONFIG_ARCNET_COM90xxIO=m
 105.668 -CONFIG_ARCNET_RIM_I=m
 105.669 -CONFIG_ARCNET_COM20020=m
 105.670 -CONFIG_ARCNET_COM20020_PCI=m
 105.671 +# CONFIG_ARCNET is not set
 105.672  
 105.673  #
 105.674  # Ethernet (10 or 100Mbit)
 105.675 @@ -1046,21 +1000,21 @@ CONFIG_NET_TULIP=y
 105.676  CONFIG_DE2104X=m
 105.677  CONFIG_TULIP=m
 105.678  # CONFIG_TULIP_MWI is not set
 105.679 -# CONFIG_TULIP_MMIO is not set
 105.680 +CONFIG_TULIP_MMIO=y
 105.681  # CONFIG_TULIP_NAPI is not set
 105.682  CONFIG_DE4X5=m
 105.683  CONFIG_WINBOND_840=m
 105.684  CONFIG_DM9102=m
 105.685 -CONFIG_HP100=m
 105.686 +# CONFIG_HP100 is not set
 105.687  CONFIG_NET_PCI=y
 105.688  CONFIG_PCNET32=m
 105.689  CONFIG_AMD8111_ETH=m
 105.690 -# CONFIG_AMD8111E_NAPI is not set
 105.691 +CONFIG_AMD8111E_NAPI=y
 105.692  CONFIG_ADAPTEC_STARFIRE=m
 105.693 -# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
 105.694 +CONFIG_ADAPTEC_STARFIRE_NAPI=y
 105.695  CONFIG_B44=m
 105.696  CONFIG_FORCEDETH=m
 105.697 -# CONFIG_DGRS is not set
 105.698 +CONFIG_DGRS=m
 105.699  CONFIG_EEPRO100=m
 105.700  CONFIG_E100=m
 105.701  CONFIG_FEALNX=m
 105.702 @@ -1069,7 +1023,7 @@ CONFIG_NE2K_PCI=m
 105.703  CONFIG_8139CP=m
 105.704  CONFIG_8139TOO=m
 105.705  CONFIG_8139TOO_PIO=y
 105.706 -CONFIG_8139TOO_TUNE_TWISTER=y
 105.707 +# CONFIG_8139TOO_TUNE_TWISTER is not set
 105.708  CONFIG_8139TOO_8129=y
 105.709  # CONFIG_8139_OLD_RX_RESET is not set
 105.710  CONFIG_SIS900=m
 105.711 @@ -1077,21 +1031,22 @@ CONFIG_EPIC100=m
 105.712  CONFIG_SUNDANCE=m
 105.713  # CONFIG_SUNDANCE_MMIO is not set
 105.714  CONFIG_VIA_RHINE=m
 105.715 -# CONFIG_VIA_RHINE_MMIO is not set
 105.716 +CONFIG_VIA_RHINE_MMIO=y
 105.717  
 105.718  #
 105.719  # Ethernet (1000 Mbit)
 105.720  #
 105.721 -# CONFIG_ACENIC is not set
 105.722 +CONFIG_ACENIC=m
 105.723 +# CONFIG_ACENIC_OMIT_TIGON_I is not set
 105.724  CONFIG_DL2K=m
 105.725  CONFIG_E1000=m
 105.726 -# CONFIG_E1000_NAPI is not set
 105.727 +CONFIG_E1000_NAPI=y
 105.728  CONFIG_NS83820=m
 105.729  CONFIG_HAMACHI=m
 105.730  CONFIG_YELLOWFIN=m
 105.731  CONFIG_R8169=m
 105.732 -# CONFIG_R8169_NAPI is not set
 105.733 -# CONFIG_R8169_VLAN is not set
 105.734 +CONFIG_R8169_NAPI=y
 105.735 +CONFIG_R8169_VLAN=y
 105.736  CONFIG_SK98LIN=m
 105.737  CONFIG_VIA_VELOCITY=m
 105.738  CONFIG_TIGON3=m
 105.739 @@ -1101,9 +1056,9 @@ CONFIG_BNX2=m
 105.740  # Ethernet (10000 Mbit)
 105.741  #
 105.742  CONFIG_IXGB=m
 105.743 -# CONFIG_IXGB_NAPI is not set
 105.744 +CONFIG_IXGB_NAPI=y
 105.745  CONFIG_S2IO=m
 105.746 -# CONFIG_S2IO_NAPI is not set
 105.747 +CONFIG_S2IO_NAPI=y
 105.748  # CONFIG_2BUFF_MODE is not set
 105.749  
 105.750  #
 105.751 @@ -1124,7 +1079,7 @@ CONFIG_NET_RADIO=y
 105.752  #
 105.753  # Obsolete Wireless cards support (pre-802.11)
 105.754  #
 105.755 -CONFIG_STRIP=m
 105.756 +# CONFIG_STRIP is not set
 105.757  
 105.758  #
 105.759  # Wireless 802.11b ISA/PCI cards support
 105.760 @@ -1145,35 +1100,7 @@ CONFIG_NET_WIRELESS=y
 105.761  #
 105.762  # Wan interfaces
 105.763  #
 105.764 -CONFIG_WAN=y
 105.765 -CONFIG_DSCC4=m
 105.766 -CONFIG_DSCC4_PCISYNC=y
 105.767 -CONFIG_DSCC4_PCI_RST=y
 105.768 -CONFIG_LANMEDIA=m
 105.769 -CONFIG_SYNCLINK_SYNCPPP=m
 105.770 -CONFIG_HDLC=m
 105.771 -CONFIG_HDLC_RAW=y
 105.772 -CONFIG_HDLC_RAW_ETH=y
 105.773 -CONFIG_HDLC_CISCO=y
 105.774 -CONFIG_HDLC_FR=y
 105.775 -CONFIG_HDLC_PPP=y
 105.776 -CONFIG_HDLC_X25=y
 105.777 -CONFIG_PCI200SYN=m
 105.778 -CONFIG_WANXL=m
 105.779 -CONFIG_PC300=m
 105.780 -CONFIG_PC300_MLPPP=y
 105.781 -CONFIG_FARSYNC=m
 105.782 -CONFIG_DLCI=m
 105.783 -CONFIG_DLCI_COUNT=24
 105.784 -CONFIG_DLCI_MAX=8
 105.785 -CONFIG_WAN_ROUTER_DRIVERS=y
 105.786 -# CONFIG_VENDOR_SANGOMA is not set
 105.787 -CONFIG_CYCLADES_SYNC=m
 105.788 -CONFIG_CYCLOMX_X25=y
 105.789 -CONFIG_LAPBETHER=m
 105.790 -CONFIG_X25_ASY=m
 105.791 -CONFIG_SBNI=m
 105.792 -# CONFIG_SBNI_MULTILINE is not set
 105.793 +# CONFIG_WAN is not set
 105.794  
 105.795  #
 105.796  # ATM drivers
 105.797 @@ -1184,8 +1111,7 @@ CONFIG_ATM_ENI=m
 105.798  # CONFIG_ATM_ENI_DEBUG is not set
 105.799  # CONFIG_ATM_ENI_TUNE_BURST is not set
 105.800  CONFIG_ATM_FIRESTREAM=m
 105.801 -CONFIG_ATM_ZATM=m
 105.802 -# CONFIG_ATM_ZATM_DEBUG is not set
 105.803 +# CONFIG_ATM_ZATM is not set
 105.804  CONFIG_ATM_IDT77252=m
 105.805  # CONFIG_ATM_IDT77252_DEBUG is not set
 105.806  # CONFIG_ATM_IDT77252_RCV_ALL is not set
 105.807 @@ -1195,20 +1121,13 @@ CONFIG_ATM_AMBASSADOR=m
 105.808  CONFIG_ATM_HORIZON=m
 105.809  # CONFIG_ATM_HORIZON_DEBUG is not set
 105.810  CONFIG_ATM_FORE200E_MAYBE=m
 105.811 -CONFIG_ATM_FORE200E_PCA=y
 105.812 -CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
 105.813 -# CONFIG_ATM_FORE200E_USE_TASKLET is not set
 105.814 -CONFIG_ATM_FORE200E_TX_RETRY=16
 105.815 -CONFIG_ATM_FORE200E_DEBUG=0
 105.816 -CONFIG_ATM_FORE200E=m
 105.817 +# CONFIG_ATM_FORE200E_PCA is not set
 105.818  CONFIG_ATM_HE=m
 105.819 -CONFIG_ATM_HE_USE_SUNI=y
 105.820 +# CONFIG_ATM_HE_USE_SUNI is not set
 105.821  CONFIG_FDDI=y
 105.822 -CONFIG_DEFXX=m
 105.823 +# CONFIG_DEFXX is not set
 105.824  CONFIG_SKFP=m
 105.825 -CONFIG_HIPPI=y
 105.826 -CONFIG_ROADRUNNER=m
 105.827 -# CONFIG_ROADRUNNER_LARGE_RINGS is not set
 105.828 +# CONFIG_HIPPI is not set
 105.829  CONFIG_PLIP=m
 105.830  CONFIG_PPP=m
 105.831  CONFIG_PPP_MULTILINK=y
 105.832 @@ -1216,15 +1135,15 @@ CONFIG_PPP_FILTER=y
 105.833  CONFIG_PPP_ASYNC=m
 105.834  CONFIG_PPP_SYNC_TTY=m
 105.835  CONFIG_PPP_DEFLATE=m
 105.836 -CONFIG_PPP_BSDCOMP=m
 105.837 +# CONFIG_PPP_BSDCOMP is not set
 105.838  CONFIG_PPPOE=m
 105.839  CONFIG_PPPOATM=m
 105.840  CONFIG_SLIP=m
 105.841  CONFIG_SLIP_COMPRESSED=y
 105.842  CONFIG_SLIP_SMART=y
 105.843 -CONFIG_SLIP_MODE_SLIP6=y
 105.844 +# CONFIG_SLIP_MODE_SLIP6 is not set
 105.845  CONFIG_NET_FC=y
 105.846 -CONFIG_SHAPER=m
 105.847 +# CONFIG_SHAPER is not set
 105.848  CONFIG_NETCONSOLE=m
 105.849  
 105.850  #
 105.851 @@ -1240,16 +1159,15 @@ CONFIG_ISDN_PPP=y
 105.852  CONFIG_ISDN_PPP_VJ=y
 105.853  CONFIG_ISDN_MPP=y
 105.854  CONFIG_IPPP_FILTER=y
 105.855 -CONFIG_ISDN_PPP_BSDCOMP=m
 105.856 +# CONFIG_ISDN_PPP_BSDCOMP is not set
 105.857  CONFIG_ISDN_AUDIO=y
 105.858  CONFIG_ISDN_TTY_FAX=y
 105.859 -CONFIG_ISDN_X25=y
 105.860  
 105.861  #
 105.862  # ISDN feature submodules
 105.863  #
 105.864  CONFIG_ISDN_DRV_LOOP=m
 105.865 -# CONFIG_ISDN_DIVERSION is not set
 105.866 +CONFIG_ISDN_DIVERSION=m
 105.867  
 105.868  #
 105.869  # ISDN4Linux hardware drivers
 105.870 @@ -1265,9 +1183,9 @@ CONFIG_ISDN_DRV_HISAX=m
 105.871  #
 105.872  CONFIG_HISAX_EURO=y
 105.873  CONFIG_DE_AOC=y
 105.874 -# CONFIG_HISAX_NO_SENDCOMPLETE is not set
 105.875 -# CONFIG_HISAX_NO_LLC is not set
 105.876 -# CONFIG_HISAX_NO_KEYPAD is not set
 105.877 +CONFIG_HISAX_NO_SENDCOMPLETE=y
 105.878 +CONFIG_HISAX_NO_LLC=y
 105.879 +CONFIG_HISAX_NO_KEYPAD=y
 105.880  CONFIG_HISAX_1TR6=y
 105.881  CONFIG_HISAX_NI1=y
 105.882  CONFIG_HISAX_MAX_CARDS=8
 105.883 @@ -1342,19 +1260,12 @@ CONFIG_ISDN_DRV_AVMB1_C4=m
 105.884  #
 105.885  # Active Eicon DIVA Server cards
 105.886  #
 105.887 -CONFIG_CAPI_EICON=y
 105.888 -CONFIG_ISDN_DIVAS=m
 105.889 -CONFIG_ISDN_DIVAS_BRIPCI=y
 105.890 -CONFIG_ISDN_DIVAS_PRIPCI=y
 105.891 -CONFIG_ISDN_DIVAS_DIVACAPI=m
 105.892 -CONFIG_ISDN_DIVAS_USERIDI=m
 105.893 -CONFIG_ISDN_DIVAS_MAINT=m
 105.894 +# CONFIG_CAPI_EICON is not set
 105.895  
 105.896  #
 105.897  # Telephony Support
 105.898  #
 105.899 -CONFIG_PHONE=m
 105.900 -CONFIG_PHONE_IXJ=m
 105.901 +# CONFIG_PHONE is not set
 105.902  
 105.903  #
 105.904  # Input device support
 105.905 @@ -1365,27 +1276,25 @@ CONFIG_INPUT=y
 105.906  # Userland interfaces
 105.907  #
 105.908  CONFIG_INPUT_MOUSEDEV=y
 105.909 -CONFIG_INPUT_MOUSEDEV_PSAUX=y
 105.910 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 105.911  CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 105.912  CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 105.913  CONFIG_INPUT_JOYDEV=m
 105.914 -CONFIG_INPUT_TSDEV=m
 105.915 -CONFIG_INPUT_TSDEV_SCREEN_X=240
 105.916 -CONFIG_INPUT_TSDEV_SCREEN_Y=320
 105.917 -CONFIG_INPUT_EVDEV=m
 105.918 -CONFIG_INPUT_EVBUG=m
 105.919 +# CONFIG_INPUT_TSDEV is not set
 105.920 +CONFIG_INPUT_EVDEV=y
 105.921 +# CONFIG_INPUT_EVBUG is not set
 105.922  
 105.923  #
 105.924  # Input Device Drivers
 105.925  #
 105.926  CONFIG_INPUT_KEYBOARD=y
 105.927  CONFIG_KEYBOARD_ATKBD=y
 105.928 -CONFIG_KEYBOARD_SUNKBD=m
 105.929 -CONFIG_KEYBOARD_LKKBD=m
 105.930 -CONFIG_KEYBOARD_XTKBD=m
 105.931 -CONFIG_KEYBOARD_NEWTON=m
 105.932 +# CONFIG_KEYBOARD_SUNKBD is not set
 105.933 +# CONFIG_KEYBOARD_LKKBD is not set
 105.934 +# CONFIG_KEYBOARD_XTKBD is not set
 105.935 +# CONFIG_KEYBOARD_NEWTON is not set
 105.936  CONFIG_INPUT_MOUSE=y
 105.937 -CONFIG_MOUSE_PS2=m
 105.938 +CONFIG_MOUSE_PS2=y
 105.939  CONFIG_MOUSE_SERIAL=m
 105.940  CONFIG_MOUSE_VSXXXAA=m
 105.941  CONFIG_INPUT_JOYSTICK=y
 105.942 @@ -1427,19 +1336,19 @@ CONFIG_INPUT_UINPUT=m
 105.943  #
 105.944  CONFIG_SERIO=y
 105.945  CONFIG_SERIO_I8042=y
 105.946 -CONFIG_SERIO_SERPORT=m
 105.947 -CONFIG_SERIO_CT82C710=m
 105.948 -CONFIG_SERIO_PARKBD=m
 105.949 -CONFIG_SERIO_PCIPS2=m
 105.950 +CONFIG_SERIO_SERPORT=y
 105.951 +# CONFIG_SERIO_CT82C710 is not set
 105.952 +# CONFIG_SERIO_PARKBD is not set
 105.953 +# CONFIG_SERIO_PCIPS2 is not set
 105.954  CONFIG_SERIO_LIBPS2=y
 105.955 -CONFIG_SERIO_RAW=m
 105.956 +# CONFIG_SERIO_RAW is not set
 105.957  CONFIG_GAMEPORT=m
 105.958  CONFIG_GAMEPORT_NS558=m
 105.959  CONFIG_GAMEPORT_L4=m
 105.960  CONFIG_GAMEPORT_EMU10K1=m
 105.961  CONFIG_GAMEPORT_VORTEX=m
 105.962  CONFIG_GAMEPORT_FM801=m
 105.963 -# CONFIG_GAMEPORT_CS461X is not set
 105.964 +CONFIG_GAMEPORT_CS461X=m
 105.965  
 105.966  #
 105.967  # Character devices
 105.968 @@ -1452,21 +1361,16 @@ CONFIG_HW_CONSOLE=y
 105.969  #
 105.970  # Serial drivers
 105.971  #
 105.972 -CONFIG_SERIAL_8250=m
 105.973 -# CONFIG_SERIAL_8250_ACPI is not set
 105.974 -CONFIG_SERIAL_8250_NR_UARTS=4
 105.975 -# CONFIG_SERIAL_8250_EXTENDED is not set
 105.976 +# CONFIG_SERIAL_8250 is not set
 105.977  
 105.978  #
 105.979  # Non-8250 serial port support
 105.980  #
 105.981 -CONFIG_SERIAL_CORE=m
 105.982 -CONFIG_SERIAL_JSM=m
 105.983 +# CONFIG_SERIAL_JSM is not set
 105.984  CONFIG_UNIX98_PTYS=y
 105.985 -CONFIG_LEGACY_PTYS=y
 105.986 -CONFIG_LEGACY_PTY_COUNT=256
 105.987 +# CONFIG_LEGACY_PTYS is not set
 105.988  CONFIG_PRINTER=m
 105.989 -# CONFIG_LP_CONSOLE is not set
 105.990 +CONFIG_LP_CONSOLE=y
 105.991  CONFIG_PPDEV=m
 105.992  CONFIG_TIPAR=m
 105.993  
 105.994 @@ -1500,7 +1404,7 @@ CONFIG_IB700_WDT=m
 105.995  CONFIG_WAFER_WDT=m
 105.996  CONFIG_I8XX_TCO=m
 105.997  CONFIG_SC1200_WDT=m
 105.998 -CONFIG_60XX_WDT=m
 105.999 +# CONFIG_60XX_WDT is not set
105.1000  CONFIG_CPU5_WDT=m
105.1001  CONFIG_W83627HF_WDT=m
105.1002  CONFIG_W83877F_WDT=m
105.1003 @@ -1518,67 +1422,31 @@ CONFIG_WDT_501_PCI=y
105.1004  #
105.1005  CONFIG_USBPCWATCHDOG=m
105.1006  CONFIG_HW_RANDOM=m
105.1007 -CONFIG_NVRAM=m
105.1008 -CONFIG_RTC=m
105.1009 -CONFIG_GEN_RTC=m
105.1010 -CONFIG_GEN_RTC_X=y
105.1011 +# CONFIG_NVRAM is not set
105.1012 +CONFIG_RTC=y
105.1013  CONFIG_DTLK=m
105.1014  CONFIG_R3964=m
105.1015 -CONFIG_APPLICOM=m
105.1016 +# CONFIG_APPLICOM is not set
105.1017  
105.1018  #
105.1019  # Ftape, the floppy tape device driver
105.1020  #
105.1021 -CONFIG_FTAPE=m
105.1022 -CONFIG_ZFTAPE=m
105.1023 -CONFIG_ZFT_DFLT_BLK_SZ=10240
105.1024 -
105.1025 -#
105.1026 -# The compressor will be built as a module only!
105.1027 -#
105.1028 -CONFIG_ZFT_COMPRESSOR=m
105.1029 -CONFIG_FT_NR_BUFFERS=3
105.1030 -CONFIG_FT_PROC_FS=y
105.1031 -CONFIG_FT_NORMAL_DEBUG=y
105.1032 -# CONFIG_FT_FULL_DEBUG is not set
105.1033 -# CONFIG_FT_NO_TRACE is not set
105.1034 -# CONFIG_FT_NO_TRACE_AT_ALL is not set
105.1035 -
105.1036 -#
105.1037 -# Hardware configuration
105.1038 -#
105.1039 -CONFIG_FT_STD_FDC=y
105.1040 -# CONFIG_FT_MACH2 is not set
105.1041 -# CONFIG_FT_PROBE_FC10 is not set
105.1042 -# CONFIG_FT_ALT_FDC is not set
105.1043 -CONFIG_FT_FDC_THR=8
105.1044 -CONFIG_FT_FDC_MAX_RATE=2000
105.1045 -CONFIG_FT_ALPHA_CLOCK=0
105.1046 -CONFIG_AGP=m
105.1047 -CONFIG_AGP_AMD64=m
105.1048 -CONFIG_AGP_INTEL=m
105.1049 +# CONFIG_FTAPE is not set
105.1050 +# CONFIG_AGP is not set
105.1051  CONFIG_DRM=m
105.1052  CONFIG_DRM_TDFX=m
105.1053  # CONFIG_DRM_GAMMA is not set
105.1054  CONFIG_DRM_R128=m
105.1055  CONFIG_DRM_RADEON=m
105.1056 -CONFIG_DRM_I810=m
105.1057 -CONFIG_DRM_I830=m
105.1058 -CONFIG_DRM_I915=m
105.1059 -CONFIG_DRM_MGA=m
105.1060 -CONFIG_DRM_SIS=m
105.1061 -CONFIG_MWAVE=m
105.1062 -CONFIG_RAW_DRIVER=m
105.1063 +# CONFIG_MWAVE is not set
105.1064 +# CONFIG_RAW_DRIVER is not set
105.1065  # CONFIG_HPET is not set
105.1066 -CONFIG_MAX_RAW_DEVS=256
105.1067  CONFIG_HANGCHECK_TIMER=m
105.1068  
105.1069  #
105.1070  # TPM devices
105.1071  #
105.1072 -CONFIG_TCG_TPM=m
105.1073 -CONFIG_TCG_NSC=m
105.1074 -CONFIG_TCG_ATMEL=m
105.1075 +# CONFIG_TCG_TPM is not set
105.1076  
105.1077  #
105.1078  # I2C support
105.1079 @@ -1596,24 +1464,24 @@ CONFIG_I2C_ALGOPCA=m
105.1080  #
105.1081  # I2C Hardware Bus support
105.1082  #
105.1083 -CONFIG_I2C_ALI1535=m
105.1084 -CONFIG_I2C_ALI1563=m
105.1085 -CONFIG_I2C_ALI15X3=m
105.1086 +# CONFIG_I2C_ALI1535 is not set
105.1087 +# CONFIG_I2C_ALI1563 is not set
105.1088 +# CONFIG_I2C_ALI15X3 is not set
105.1089  CONFIG_I2C_AMD756=m
105.1090  CONFIG_I2C_AMD756_S4882=m
105.1091  CONFIG_I2C_AMD8111=m
105.1092 -CONFIG_I2C_I801=m
105.1093 -CONFIG_I2C_I810=m
105.1094 -CONFIG_I2C_PIIX4=m
105.1095 +# CONFIG_I2C_I801 is not set
105.1096 +# CONFIG_I2C_I810 is not set
105.1097 +# CONFIG_I2C_PIIX4 is not set
105.1098  CONFIG_I2C_ISA=m
105.1099  CONFIG_I2C_NFORCE2=m
105.1100 -CONFIG_I2C_PARPORT=m
105.1101 -CONFIG_I2C_PARPORT_LIGHT=m
105.1102 +# CONFIG_I2C_PARPORT is not set
105.1103 +# CONFIG_I2C_PARPORT_LIGHT is not set
105.1104  CONFIG_I2C_PROSAVAGE=m
105.1105  CONFIG_I2C_SAVAGE4=m
105.1106 -CONFIG_SCx200_ACB=m
105.1107 -CONFIG_I2C_SIS5595=m
105.1108 -CONFIG_I2C_SIS630=m
105.1109 +# CONFIG_SCx200_ACB is not set
105.1110 +# CONFIG_I2C_SIS5595 is not set
105.1111 +# CONFIG_I2C_SIS630 is not set
105.1112  CONFIG_I2C_SIS96X=m
105.1113  CONFIG_I2C_STUB=m
105.1114  CONFIG_I2C_VIA=m
105.1115 @@ -1648,7 +1516,7 @@ CONFIG_SENSORS_LM90=m
105.1116  CONFIG_SENSORS_LM92=m
105.1117  CONFIG_SENSORS_MAX1619=m
105.1118  CONFIG_SENSORS_PC87360=m
105.1119 -# CONFIG_SENSORS_SMSC47B397 is not set
105.1120 +CONFIG_SENSORS_SMSC47B397=m
105.1121  CONFIG_SENSORS_SIS5595=m
105.1122  CONFIG_SENSORS_SMSC47M1=m
105.1123  CONFIG_SENSORS_VIA686A=m
105.1124 @@ -1682,7 +1550,7 @@ CONFIG_W1_SMEM=m
105.1125  #
105.1126  # Misc devices
105.1127  #
105.1128 -CONFIG_IBM_ASM=m
105.1129 +# CONFIG_IBM_ASM is not set
105.1130  
105.1131  #
105.1132  # Multimedia devices
105.1133 @@ -1714,13 +1582,14 @@ CONFIG_VIDEO_ZORAN_DC30=m
105.1134  CONFIG_VIDEO_ZORAN_LML33=m
105.1135  CONFIG_VIDEO_ZORAN_LML33R10=m
105.1136  # CONFIG_VIDEO_ZR36120 is not set
105.1137 -# CONFIG_VIDEO_SAA7134 is not set
105.1138 +CONFIG_VIDEO_SAA7134=m
105.1139 +CONFIG_VIDEO_SAA7134_DVB=m
105.1140  CONFIG_VIDEO_MXB=m
105.1141  CONFIG_VIDEO_DPC=m
105.1142  CONFIG_VIDEO_HEXIUM_ORION=m
105.1143  CONFIG_VIDEO_HEXIUM_GEMINI=m
105.1144  CONFIG_VIDEO_CX88=m
105.1145 -# CONFIG_VIDEO_CX88_DVB is not set
105.1146 +CONFIG_VIDEO_CX88_DVB=m
105.1147  CONFIG_VIDEO_OVCAMCHIP=m
105.1148  
105.1149  #
105.1150 @@ -1740,7 +1609,7 @@ CONFIG_DVB_CORE=m
105.1151  # Supported SAA7146 based PCI Adapters
105.1152  #
105.1153  CONFIG_DVB_AV7110=m
105.1154 -# CONFIG_DVB_AV7110_OSD is not set
105.1155 +CONFIG_DVB_AV7110_OSD=y
105.1156  CONFIG_DVB_BUDGET=m
105.1157  CONFIG_DVB_BUDGET_CI=m
105.1158  CONFIG_DVB_BUDGET_AV=m
105.1159 @@ -1755,7 +1624,12 @@ CONFIG_DVB_DIBUSB=m
105.1160  CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES=y
105.1161  # CONFIG_DVB_DIBCOM_DEBUG is not set
105.1162  CONFIG_DVB_CINERGYT2=m
105.1163 -# CONFIG_DVB_CINERGYT2_TUNING is not set
105.1164 +CONFIG_DVB_CINERGYT2_TUNING=y
105.1165 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32
105.1166 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512
105.1167 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250
105.1168 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y
105.1169 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100
105.1170  
105.1171  #
105.1172  # Supported FlexCopII (B2C2) Adapters
105.1173 @@ -1822,6 +1696,7 @@ CONFIG_VIDEO_SAA7146_VV=m
105.1174  CONFIG_VIDEO_VIDEOBUF=m
105.1175  CONFIG_VIDEO_TUNER=m
105.1176  CONFIG_VIDEO_BUF=m
105.1177 +CONFIG_VIDEO_BUF_DVB=m
105.1178  CONFIG_VIDEO_BTCX=m
105.1179  CONFIG_VIDEO_IR=m
105.1180  CONFIG_VIDEO_TVEEPROM=m
105.1181 @@ -1830,36 +1705,34 @@ CONFIG_VIDEO_TVEEPROM=m
105.1182  # Graphics support
105.1183  #
105.1184  CONFIG_FB=y
105.1185 -CONFIG_FB_CFB_FILLRECT=m
105.1186 -CONFIG_FB_CFB_COPYAREA=m
105.1187 -CONFIG_FB_CFB_IMAGEBLIT=m
105.1188 -CONFIG_FB_SOFT_CURSOR=m
105.1189 +CONFIG_FB_CFB_FILLRECT=y
105.1190 +CONFIG_FB_CFB_COPYAREA=y
105.1191 +CONFIG_FB_CFB_IMAGEBLIT=y
105.1192 +CONFIG_FB_SOFT_CURSOR=y
105.1193  # CONFIG_FB_MACMODES is not set
105.1194  CONFIG_FB_MODE_HELPERS=y
105.1195  CONFIG_FB_TILEBLITTING=y
105.1196  CONFIG_FB_CIRRUS=m
105.1197 -CONFIG_FB_PM2=m
105.1198 -CONFIG_FB_PM2_FIFO_DISCONNECT=y
105.1199 -CONFIG_FB_CYBER2000=m
105.1200 +# CONFIG_FB_PM2 is not set
105.1201 +# CONFIG_FB_CYBER2000 is not set
105.1202  # CONFIG_FB_ASILIANT is not set
105.1203  # CONFIG_FB_IMSTT is not set
105.1204  CONFIG_FB_VGA16=m
105.1205 -# CONFIG_FB_VESA is not set
105.1206 +CONFIG_FB_VESA=y
105.1207  CONFIG_VIDEO_SELECT=y
105.1208 -CONFIG_FB_HGA=m
105.1209 -# CONFIG_FB_HGA_ACCEL is not set
105.1210 -CONFIG_FB_NVIDIA=m
105.1211 -CONFIG_FB_NVIDIA_I2C=y
105.1212 +# CONFIG_FB_HGA is not set
105.1213 +# CONFIG_FB_NVIDIA is not set
105.1214  CONFIG_FB_RIVA=m
105.1215 -CONFIG_FB_RIVA_I2C=y
105.1216 -CONFIG_FB_RIVA_DEBUG=y
105.1217 +# CONFIG_FB_RIVA_I2C is not set
105.1218 +# CONFIG_FB_RIVA_DEBUG is not set
105.1219  CONFIG_FB_MATROX=m
105.1220  CONFIG_FB_MATROX_MILLENIUM=y
105.1221  CONFIG_FB_MATROX_MYSTIQUE=y
105.1222 -# CONFIG_FB_MATROX_G is not set
105.1223 +CONFIG_FB_MATROX_G=y
105.1224  CONFIG_FB_MATROX_I2C=m
105.1225 +CONFIG_FB_MATROX_MAVEN=m
105.1226  CONFIG_FB_MATROX_MULTIHEAD=y
105.1227 -CONFIG_FB_RADEON_OLD=m
105.1228 +# CONFIG_FB_RADEON_OLD is not set
105.1229  CONFIG_FB_RADEON=m
105.1230  CONFIG_FB_RADEON_I2C=y
105.1231  # CONFIG_FB_RADEON_DEBUG is not set
105.1232 @@ -1867,33 +1740,30 @@ CONFIG_FB_ATY128=m
105.1233  CONFIG_FB_ATY=m
105.1234  CONFIG_FB_ATY_CT=y
105.1235  CONFIG_FB_ATY_GENERIC_LCD=y
105.1236 -CONFIG_FB_ATY_XL_INIT=y
105.1237 +# CONFIG_FB_ATY_XL_INIT is not set
105.1238  CONFIG_FB_ATY_GX=y
105.1239  CONFIG_FB_SAVAGE=m
105.1240  CONFIG_FB_SAVAGE_I2C=y
105.1241  CONFIG_FB_SAVAGE_ACCEL=y
105.1242 -CONFIG_FB_SIS=m
105.1243 -CONFIG_FB_SIS_300=y
105.1244 -CONFIG_FB_SIS_315=y
105.1245 +# CONFIG_FB_SIS is not set
105.1246  CONFIG_FB_NEOMAGIC=m
105.1247  CONFIG_FB_KYRO=m
105.1248  CONFIG_FB_3DFX=m
105.1249 -# CONFIG_FB_3DFX_ACCEL is not set
105.1250 +CONFIG_FB_3DFX_ACCEL=y
105.1251  CONFIG_FB_VOODOO1=m
105.1252  CONFIG_FB_TRIDENT=m
105.1253 -# CONFIG_FB_TRIDENT_ACCEL is not set
105.1254 +CONFIG_FB_TRIDENT_ACCEL=y
105.1255  # CONFIG_FB_PM3 is not set
105.1256 -CONFIG_FB_GEODE=y
105.1257 -CONFIG_FB_GEODE_GX1=m
105.1258 -CONFIG_FB_S1D13XXX=m
105.1259 -CONFIG_FB_VIRTUAL=m
105.1260 +# CONFIG_FB_GEODE is not set
105.1261 +# CONFIG_FB_S1D13XXX is not set
105.1262 +# CONFIG_FB_VIRTUAL is not set
105.1263  
105.1264  #
105.1265  # Console display driver support
105.1266  #
105.1267  CONFIG_VGA_CONSOLE=y
105.1268  CONFIG_DUMMY_CONSOLE=y
105.1269 -CONFIG_FRAMEBUFFER_CONSOLE=m
105.1270 +CONFIG_FRAMEBUFFER_CONSOLE=y
105.1271  # CONFIG_FONTS is not set
105.1272  CONFIG_FONT_8x8=y
105.1273  CONFIG_FONT_8x16=y
105.1274 @@ -1901,8 +1771,15 @@ CONFIG_FONT_8x16=y
105.1275  #
105.1276  # Logo configuration
105.1277  #
105.1278 -# CONFIG_LOGO is not set
105.1279 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
105.1280 +CONFIG_LOGO=y
105.1281 +# CONFIG_LOGO_LINUX_MONO is not set
105.1282 +# CONFIG_LOGO_LINUX_VGA16 is not set
105.1283 +CONFIG_LOGO_LINUX_CLUT224=y
105.1284 +CONFIG_BACKLIGHT_LCD_SUPPORT=y
105.1285 +CONFIG_BACKLIGHT_CLASS_DEVICE=m
105.1286 +CONFIG_BACKLIGHT_DEVICE=y
105.1287 +CONFIG_LCD_CLASS_DEVICE=m
105.1288 +CONFIG_LCD_DEVICE=y
105.1289  
105.1290  #
105.1291  # Sound
105.1292 @@ -1936,7 +1813,7 @@ CONFIG_SND_VX_LIB=m
105.1293  CONFIG_SND_DUMMY=m
105.1294  CONFIG_SND_VIRMIDI=m
105.1295  CONFIG_SND_MTPAV=m
105.1296 -CONFIG_SND_SERIAL_U16550=m
105.1297 +# CONFIG_SND_SERIAL_U16550 is not set
105.1298  CONFIG_SND_MPU401=m
105.1299  
105.1300  #
105.1301 @@ -1956,8 +1833,8 @@ CONFIG_SND_CS46XX=m
105.1302  CONFIG_SND_CS46XX_NEW_DSP=y
105.1303  CONFIG_SND_CS4281=m
105.1304  CONFIG_SND_EMU10K1=m
105.1305 -# CONFIG_SND_EMU10K1X is not set
105.1306 -# CONFIG_SND_CA0106 is not set
105.1307 +CONFIG_SND_EMU10K1X=m
105.1308 +CONFIG_SND_CA0106=m
105.1309  CONFIG_SND_KORG1212=m
105.1310  CONFIG_SND_MIXART=m
105.1311  CONFIG_SND_NM256=m
105.1312 @@ -1982,7 +1859,7 @@ CONFIG_SND_INTEL8X0=m
105.1313  CONFIG_SND_INTEL8X0M=m
105.1314  CONFIG_SND_SONICVIBES=m
105.1315  CONFIG_SND_VIA82XX=m
105.1316 -# CONFIG_SND_VIA82XX_MODEM is not set
105.1317 +CONFIG_SND_VIA82XX_MODEM=m
105.1318  CONFIG_SND_VX222=m
105.1319  CONFIG_SND_HDA_INTEL=m
105.1320  
105.1321 @@ -1995,75 +1872,7 @@ CONFIG_SND_USB_USX2Y=m
105.1322  #
105.1323  # Open Sound System
105.1324  #
105.1325 -CONFIG_SOUND_PRIME=m
105.1326 -CONFIG_SOUND_BT878=m
105.1327 -CONFIG_SOUND_CMPCI=m
105.1328 -# CONFIG_SOUND_CMPCI_FM is not set
105.1329 -# CONFIG_SOUND_CMPCI_MIDI is not set
105.1330 -CONFIG_SOUND_CMPCI_JOYSTICK=y
105.1331 -CONFIG_SOUND_EMU10K1=m
105.1332 -CONFIG_MIDI_EMU10K1=y
105.1333 -CONFIG_SOUND_FUSION=m
105.1334 -CONFIG_SOUND_CS4281=m
105.1335 -CONFIG_SOUND_ES1370=m
105.1336 -CONFIG_SOUND_ES1371=m
105.1337 -CONFIG_SOUND_ESSSOLO1=m
105.1338 -CONFIG_SOUND_MAESTRO=m
105.1339 -CONFIG_SOUND_MAESTRO3=m
105.1340 -CONFIG_SOUND_ICH=m
105.1341 -CONFIG_SOUND_SONICVIBES=m
105.1342 -CONFIG_SOUND_TRIDENT=m
105.1343 -# CONFIG_SOUND_MSNDCLAS is not set
105.1344 -# CONFIG_SOUND_MSNDPIN is not set
105.1345 -CONFIG_SOUND_VIA82CXXX=m
105.1346 -CONFIG_MIDI_VIA82CXXX=y
105.1347 -CONFIG_SOUND_OSS=m
105.1348 -# CONFIG_SOUND_TRACEINIT is not set
105.1349 -# CONFIG_SOUND_DMAP is not set
105.1350 -# CONFIG_SOUND_AD1816 is not set
105.1351 -CONFIG_SOUND_AD1889=m
105.1352 -CONFIG_SOUND_SGALAXY=m
105.1353 -CONFIG_SOUND_ADLIB=m
105.1354 -CONFIG_SOUND_ACI_MIXER=m
105.1355 -CONFIG_SOUND_CS4232=m
105.1356 -CONFIG_SOUND_SSCAPE=m
105.1357 -CONFIG_SOUND_GUS=m
105.1358 -CONFIG_SOUND_GUS16=y
105.1359 -CONFIG_SOUND_GUSMAX=y
105.1360 -CONFIG_SOUND_VMIDI=m
105.1361 -CONFIG_SOUND_TRIX=m
105.1362 -CONFIG_SOUND_MSS=m
105.1363 -CONFIG_SOUND_MPU401=m
105.1364 -CONFIG_SOUND_NM256=m
105.1365 -CONFIG_SOUND_MAD16=m
105.1366 -CONFIG_MAD16_OLDCARD=y
105.1367 -CONFIG_SOUND_PAS=m
105.1368 -CONFIG_SOUND_PSS=m
105.1369 -CONFIG_PSS_MIXER=y
105.1370 -CONFIG_SOUND_SB=m
105.1371 -# CONFIG_SOUND_AWE32_SYNTH is not set
105.1372 -CONFIG_SOUND_WAVEFRONT=m
105.1373 -CONFIG_SOUND_MAUI=m
105.1374 -CONFIG_SOUND_YM3812=m
105.1375 -CONFIG_SOUND_OPL3SA1=m
105.1376 -CONFIG_SOUND_OPL3SA2=m
105.1377 -CONFIG_SOUND_YMFPCI=m
105.1378 -# CONFIG_SOUND_YMFPCI_LEGACY is not set
105.1379 -CONFIG_SOUND_UART6850=m
105.1380 -CONFIG_SOUND_AEDSP16=m
105.1381 -CONFIG_SC6600=y
105.1382 -CONFIG_SC6600_JOY=y
105.1383 -CONFIG_SC6600_CDROM=4
105.1384 -CONFIG_SC6600_CDROMBASE=0x0
105.1385 -# CONFIG_AEDSP16_MSS is not set
105.1386 -# CONFIG_AEDSP16_SBPRO is not set
105.1387 -# CONFIG_AEDSP16_MPU401 is not set
105.1388 -CONFIG_SOUND_TVMIXER=m
105.1389 -CONFIG_SOUND_KAHLUA=m
105.1390 -CONFIG_SOUND_ALI5455=m
105.1391 -CONFIG_SOUND_FORTE=m
105.1392 -CONFIG_SOUND_RME96XX=m
105.1393 -CONFIG_SOUND_AD1980=m
105.1394 +# CONFIG_SOUND_PRIME is not set
105.1395  
105.1396  #
105.1397  # USB support
105.1398 @@ -2077,14 +1886,14 @@ CONFIG_USB=y
105.1399  # Miscellaneous USB options
105.1400  #
105.1401  CONFIG_USB_DEVICEFS=y
105.1402 -CONFIG_USB_BANDWIDTH=y
105.1403 +# CONFIG_USB_BANDWIDTH is not set
105.1404  # CONFIG_USB_DYNAMIC_MINORS is not set
105.1405  # CONFIG_USB_OTG is not set
105.1406  
105.1407  #
105.1408  # USB Host Controller Drivers
105.1409  #
105.1410 -CONFIG_USB_EHCI_HCD=y
105.1411 +CONFIG_USB_EHCI_HCD=m
105.1412  CONFIG_USB_EHCI_SPLIT_ISO=y
105.1413  CONFIG_USB_EHCI_ROOT_HUB_TT=y
105.1414  CONFIG_USB_OHCI_HCD=m
105.1415 @@ -2096,7 +1905,7 @@ CONFIG_USB_SL811_HCD=m
105.1416  #
105.1417  # USB Device Class drivers
105.1418  #
105.1419 -CONFIG_USB_AUDIO=m
105.1420 +# CONFIG_USB_AUDIO is not set
105.1421  
105.1422  #
105.1423  # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
105.1424 @@ -2122,16 +1931,13 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
105.1425  #
105.1426  # USB Input Devices
105.1427  #
105.1428 -CONFIG_USB_HID=m
105.1429 +CONFIG_USB_HID=y
105.1430  CONFIG_USB_HIDINPUT=y
105.1431 -# CONFIG_HID_FF is not set
105.1432 +CONFIG_HID_FF=y
105.1433 +CONFIG_HID_PID=y
105.1434 +CONFIG_LOGITECH_FF=y
105.1435 +CONFIG_THRUSTMASTER_FF=y
105.1436  CONFIG_USB_HIDDEV=y
105.1437 -
105.1438 -#
105.1439 -# USB HID Boot Protocol drivers
105.1440 -#
105.1441 -CONFIG_USB_KBD=y
105.1442 -CONFIG_USB_MOUSE=y
105.1443  CONFIG_USB_AIPTEK=m
105.1444  CONFIG_USB_WACOM=m
105.1445  CONFIG_USB_KBTAB=m
105.1446 @@ -2150,7 +1956,7 @@ CONFIG_USB_MICROTEK=m
105.1447  #
105.1448  # USB Multimedia devices
105.1449  #
105.1450 -# CONFIG_USB_DABUSB is not set
105.1451 +CONFIG_USB_DABUSB=m
105.1452  CONFIG_USB_VICAM=m
105.1453  CONFIG_USB_DSBR=m
105.1454  CONFIG_USB_IBMCAM=m
105.1455 @@ -2220,30 +2026,30 @@ CONFIG_USB_SERIAL_IPAQ=m
105.1456  CONFIG_USB_SERIAL_IR=m
105.1457  CONFIG_USB_SERIAL_EDGEPORT=m
105.1458  CONFIG_USB_SERIAL_EDGEPORT_TI=m
105.1459 -# CONFIG_USB_SERIAL_GARMIN is not set
105.1460 +CONFIG_USB_SERIAL_GARMIN=m
105.1461  CONFIG_USB_SERIAL_IPW=m
105.1462  CONFIG_USB_SERIAL_KEYSPAN_PDA=m
105.1463  CONFIG_USB_SERIAL_KEYSPAN=m
105.1464 -# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
105.1465 -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
105.1466 -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
105.1467 -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
105.1468 -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
105.1469 -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
105.1470 -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
105.1471 -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
105.1472 -# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set
105.1473 -# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set
105.1474 -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
105.1475 -# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
105.1476 +CONFIG_USB_SERIAL_KEYSPAN_MPR=y
105.1477 +CONFIG_USB_SERIAL_KEYSPAN_USA28=y
105.1478 +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
105.1479 +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
105.1480 +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
105.1481 +CONFIG_USB_SERIAL_KEYSPAN_USA19=y
105.1482 +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
105.1483 +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
105.1484 +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
105.1485 +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
105.1486 +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
105.1487 +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
105.1488  CONFIG_USB_SERIAL_KLSI=m
105.1489  CONFIG_USB_SERIAL_KOBIL_SCT=m
105.1490  CONFIG_USB_SERIAL_MCT_U232=m
105.1491  CONFIG_USB_SERIAL_PL2303=m
105.1492  CONFIG_USB_SERIAL_HP4X=m
105.1493  CONFIG_USB_SERIAL_SAFE=m
105.1494 -# CONFIG_USB_SERIAL_SAFE_PADDED is not set
105.1495 -# CONFIG_USB_SERIAL_TI is not set
105.1496 +CONFIG_USB_SERIAL_SAFE_PADDED=y
105.1497 +CONFIG_USB_SERIAL_TI=m
105.1498  CONFIG_USB_SERIAL_CYBERJACK=m
105.1499  CONFIG_USB_SERIAL_XIRCOM=m
105.1500  CONFIG_USB_SERIAL_OMNINET=m
105.1501 @@ -2252,17 +2058,17 @@ CONFIG_USB_EZUSB=y
105.1502  #
105.1503  # USB Miscellaneous drivers
105.1504  #
105.1505 -# CONFIG_USB_EMI62 is not set
105.1506 +CONFIG_USB_EMI62=m
105.1507  # CONFIG_USB_EMI26 is not set
105.1508  CONFIG_USB_AUERSWALD=m
105.1509  CONFIG_USB_RIO500=m
105.1510  CONFIG_USB_LEGOTOWER=m
105.1511  CONFIG_USB_LCD=m
105.1512  CONFIG_USB_LED=m
105.1513 -CONFIG_USB_CYTHERM=m
105.1514 +# CONFIG_USB_CYTHERM is not set
105.1515  CONFIG_USB_PHIDGETKIT=m
105.1516  CONFIG_USB_PHIDGETSERVO=m
105.1517 -# CONFIG_USB_IDMOUSE is not set
105.1518 +CONFIG_USB_IDMOUSE=m
105.1519  CONFIG_USB_SISUSBVGA=m
105.1520  CONFIG_USB_TEST=m
105.1521  
105.1522 @@ -2275,33 +2081,24 @@ CONFIG_USB_SPEEDTOUCH=m
105.1523  #
105.1524  # USB Gadget Support
105.1525  #
105.1526 -CONFIG_USB_GADGET=m
105.1527 -# CONFIG_USB_GADGET_DEBUG_FILES is not set
105.1528 -CONFIG_USB_GADGET_NET2280=y
105.1529 -CONFIG_USB_NET2280=m
105.1530 -# CONFIG_USB_GADGET_PXA2XX is not set
105.1531 -# CONFIG_USB_GADGET_GOKU is not set
105.1532 -# CONFIG_USB_GADGET_LH7A40X is not set
105.1533 -# CONFIG_USB_GADGET_OMAP is not set
105.1534 -# CONFIG_USB_GADGET_DUMMY_HCD is not set
105.1535 -CONFIG_USB_GADGET_DUALSPEED=y
105.1536 -CONFIG_USB_ZERO=m
105.1537 -CONFIG_USB_ETH=m
105.1538 -CONFIG_USB_ETH_RNDIS=y
105.1539 -CONFIG_USB_GADGETFS=m
105.1540 -CONFIG_USB_FILE_STORAGE=m
105.1541 -# CONFIG_USB_FILE_STORAGE_TEST is not set
105.1542 -CONFIG_USB_G_SERIAL=m
105.1543 +# CONFIG_USB_GADGET is not set
105.1544  
105.1545  #
105.1546  # MMC/SD Card support
105.1547  #
105.1548 -# CONFIG_MMC is not set
105.1549 +CONFIG_MMC=m
105.1550 +# CONFIG_MMC_DEBUG is not set
105.1551 +CONFIG_MMC_BLOCK=m
105.1552 +CONFIG_MMC_WBSD=m
105.1553  
105.1554  #
105.1555  # InfiniBand support
105.1556  #
105.1557 -# CONFIG_INFINIBAND is not set
105.1558 +CONFIG_INFINIBAND=m
105.1559 +CONFIG_INFINIBAND_MTHCA=m
105.1560 +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
105.1561 +CONFIG_INFINIBAND_IPOIB=m
105.1562 +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
105.1563  
105.1564  #
105.1565  # Power management options
105.1566 @@ -2335,7 +2132,7 @@ CONFIG_ACPI_SYSTEM=y
105.1567  #
105.1568  # File systems
105.1569  #
105.1570 -CONFIG_EXT2_FS=m
105.1571 +CONFIG_EXT2_FS=y
105.1572  CONFIG_EXT2_FS_XATTR=y
105.1573  CONFIG_EXT2_FS_POSIX_ACL=y
105.1574  CONFIG_EXT2_FS_SECURITY=y
105.1575 @@ -2345,16 +2142,18 @@ CONFIG_EXT3_FS_POSIX_ACL=y
105.1576  CONFIG_EXT3_FS_SECURITY=y
105.1577  CONFIG_JBD=m
105.1578  # CONFIG_JBD_DEBUG is not set
105.1579 -CONFIG_FS_MBCACHE=m
105.1580 +CONFIG_FS_MBCACHE=y
105.1581  CONFIG_REISERFS_FS=m
105.1582  # CONFIG_REISERFS_CHECK is not set
105.1583 -# CONFIG_REISERFS_PROC_INFO is not set
105.1584 -# CONFIG_REISERFS_FS_XATTR is not set
105.1585 +CONFIG_REISERFS_PROC_INFO=y
105.1586 +CONFIG_REISERFS_FS_XATTR=y
105.1587 +CONFIG_REISERFS_FS_POSIX_ACL=y
105.1588 +CONFIG_REISERFS_FS_SECURITY=y
105.1589  CONFIG_JFS_FS=m
105.1590  CONFIG_JFS_POSIX_ACL=y
105.1591 -# CONFIG_JFS_SECURITY is not set
105.1592 +CONFIG_JFS_SECURITY=y
105.1593  # CONFIG_JFS_DEBUG is not set
105.1594 -CONFIG_JFS_STATISTICS=y
105.1595 +# CONFIG_JFS_STATISTICS is not set
105.1596  CONFIG_FS_POSIX_ACL=y
105.1597  
105.1598  #
105.1599 @@ -2362,15 +2161,15 @@ CONFIG_FS_POSIX_ACL=y
105.1600  #
105.1601  CONFIG_XFS_FS=m
105.1602  CONFIG_XFS_EXPORT=y
105.1603 -CONFIG_XFS_RT=y
105.1604 +# CONFIG_XFS_RT is not set
105.1605  CONFIG_XFS_QUOTA=y
105.1606  CONFIG_XFS_SECURITY=y
105.1607  CONFIG_XFS_POSIX_ACL=y
105.1608  CONFIG_MINIX_FS=m
105.1609  CONFIG_ROMFS_FS=m
105.1610  CONFIG_QUOTA=y
105.1611 -CONFIG_QFMT_V1=m
105.1612 -CONFIG_QFMT_V2=m
105.1613 +# CONFIG_QFMT_V1 is not set
105.1614 +CONFIG_QFMT_V2=y
105.1615  CONFIG_QUOTACTL=y
105.1616  CONFIG_DNOTIFY=y
105.1617  CONFIG_AUTOFS_FS=m
105.1618 @@ -2379,10 +2178,10 @@ CONFIG_AUTOFS4_FS=m
105.1619  #
105.1620  # CD-ROM/DVD Filesystems
105.1621  #
105.1622 -CONFIG_ISO9660_FS=m
105.1623 +CONFIG_ISO9660_FS=y
105.1624  CONFIG_JOLIET=y
105.1625  CONFIG_ZISOFS=y
105.1626 -CONFIG_ZISOFS_FS=m
105.1627 +CONFIG_ZISOFS_FS=y
105.1628  CONFIG_UDF_FS=m
105.1629  CONFIG_UDF_NLS=y
105.1630  
105.1631 @@ -2393,10 +2192,8 @@ CONFIG_FAT_FS=m
105.1632  CONFIG_MSDOS_FS=m
105.1633  CONFIG_VFAT_FS=m
105.1634  CONFIG_FAT_DEFAULT_CODEPAGE=437
105.1635 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
105.1636 -CONFIG_NTFS_FS=m
105.1637 -# CONFIG_NTFS_DEBUG is not set
105.1638 -# CONFIG_NTFS_RW is not set
105.1639 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
105.1640 +# CONFIG_NTFS_FS is not set
105.1641  
105.1642  #
105.1643  # Pseudo filesystems
105.1644 @@ -2404,9 +2201,7 @@ CONFIG_NTFS_FS=m
105.1645  CONFIG_PROC_FS=y
105.1646  CONFIG_PROC_KCORE=y
105.1647  CONFIG_SYSFS=y
105.1648 -CONFIG_DEVFS_FS=y
105.1649 -# CONFIG_DEVFS_MOUNT is not set
105.1650 -# CONFIG_DEVFS_DEBUG is not set
105.1651 +# CONFIG_DEVFS_FS is not set
105.1652  CONFIG_DEVPTS_FS_XATTR=y
105.1653  CONFIG_DEVPTS_FS_SECURITY=y
105.1654  CONFIG_TMPFS=y
105.1655 @@ -2419,8 +2214,7 @@ CONFIG_RAMFS=y
105.1656  #
105.1657  # Miscellaneous filesystems
105.1658  #
105.1659 -CONFIG_ADFS_FS=m
105.1660 -# CONFIG_ADFS_FS_RW is not set
105.1661 +# CONFIG_ADFS_FS is not set
105.1662  CONFIG_AFFS_FS=m
105.1663  CONFIG_HFS_FS=m
105.1664  CONFIG_HFSPLUS_FS=m
105.1665 @@ -2428,20 +2222,18 @@ CONFIG_BEFS_FS=m
105.1666  # CONFIG_BEFS_DEBUG is not set
105.1667  CONFIG_BFS_FS=m
105.1668  CONFIG_EFS_FS=m
105.1669 -CONFIG_JFFS_FS=m
105.1670 -CONFIG_JFFS_FS_VERBOSE=0
105.1671 -CONFIG_JFFS_PROC_FS=y
105.1672 +# CONFIG_JFFS_FS is not set
105.1673  CONFIG_JFFS2_FS=m
105.1674  CONFIG_JFFS2_FS_DEBUG=0
105.1675 -# CONFIG_JFFS2_FS_NAND is not set
105.1676 +CONFIG_JFFS2_FS_NAND=y
105.1677  # CONFIG_JFFS2_FS_NOR_ECC is not set
105.1678  # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
105.1679  CONFIG_JFFS2_ZLIB=y
105.1680  CONFIG_JFFS2_RTIME=y
105.1681  # CONFIG_JFFS2_RUBIN is not set
105.1682 -CONFIG_CRAMFS=y
105.1683 +CONFIG_CRAMFS=m
105.1684  CONFIG_VXFS_FS=m
105.1685 -CONFIG_HPFS_FS=m
105.1686 +# CONFIG_HPFS_FS is not set
105.1687  CONFIG_QNX4FS_FS=m
105.1688  # CONFIG_QNX4FS_RW is not set
105.1689  CONFIG_SYSV_FS=m
105.1690 @@ -2470,7 +2262,8 @@ CONFIG_SMB_FS=m
105.1691  # CONFIG_SMB_NLS_DEFAULT is not set
105.1692  CONFIG_CIFS=m
105.1693  # CONFIG_CIFS_STATS is not set
105.1694 -# CONFIG_CIFS_XATTR is not set
105.1695 +CONFIG_CIFS_XATTR=y
105.1696 +CONFIG_CIFS_POSIX=y
105.1697  # CONFIG_CIFS_EXPERIMENTAL is not set
105.1698  CONFIG_NCP_FS=m
105.1699  CONFIG_NCPFS_PACKET_SIGNING=y
105.1700 @@ -2478,38 +2271,29 @@ CONFIG_NCPFS_IOCTL_LOCKING=y
105.1701  CONFIG_NCPFS_STRONG=y
105.1702  CONFIG_NCPFS_NFS_NS=y
105.1703  CONFIG_NCPFS_OS2_NS=y
105.1704 -# CONFIG_NCPFS_SMALLDOS is not set
105.1705 +CONFIG_NCPFS_SMALLDOS=y
105.1706  CONFIG_NCPFS_NLS=y
105.1707  CONFIG_NCPFS_EXTRAS=y
105.1708 -CONFIG_CODA_FS=m
105.1709 -# CONFIG_CODA_FS_OLD_API is not set
105.1710 -CONFIG_AFS_FS=m
105.1711 -CONFIG_RXRPC=m
105.1712 +# CONFIG_CODA_FS is not set
105.1713 +# CONFIG_AFS_FS is not set
105.1714  
105.1715  #
105.1716  # Partition Types
105.1717  #
105.1718  CONFIG_PARTITION_ADVANCED=y
105.1719 -CONFIG_ACORN_PARTITION=y
105.1720 -CONFIG_ACORN_PARTITION_CUMANA=y
105.1721 -# CONFIG_ACORN_PARTITION_EESOX is not set
105.1722 -CONFIG_ACORN_PARTITION_ICS=y
105.1723 -# CONFIG_ACORN_PARTITION_ADFS is not set
105.1724 -# CONFIG_ACORN_PARTITION_POWERTEC is not set
105.1725 -CONFIG_ACORN_PARTITION_RISCIX=y
105.1726 +# CONFIG_ACORN_PARTITION is not set
105.1727  CONFIG_OSF_PARTITION=y
105.1728  CONFIG_AMIGA_PARTITION=y
105.1729 -CONFIG_ATARI_PARTITION=y
105.1730 +# CONFIG_ATARI_PARTITION is not set
105.1731  CONFIG_MAC_PARTITION=y
105.1732  CONFIG_MSDOS_PARTITION=y
105.1733  CONFIG_BSD_DISKLABEL=y
105.1734  CONFIG_MINIX_SUBPARTITION=y
105.1735  CONFIG_SOLARIS_X86_PARTITION=y
105.1736  CONFIG_UNIXWARE_DISKLABEL=y
105.1737 -CONFIG_LDM_PARTITION=y
105.1738 -# CONFIG_LDM_DEBUG is not set
105.1739 +# CONFIG_LDM_PARTITION is not set
105.1740  CONFIG_SGI_PARTITION=y
105.1741 -CONFIG_ULTRIX_PARTITION=y
105.1742 +# CONFIG_ULTRIX_PARTITION is not set
105.1743  CONFIG_SUN_PARTITION=y
105.1744  CONFIG_EFI_PARTITION=y
105.1745  
105.1746 @@ -2517,8 +2301,8 @@ CONFIG_EFI_PARTITION=y
105.1747  # Native Language Support
105.1748  #
105.1749  CONFIG_NLS=y
105.1750 -CONFIG_NLS_DEFAULT="cp437"
105.1751 -CONFIG_NLS_CODEPAGE_437=m
105.1752 +CONFIG_NLS_DEFAULT="utf8"
105.1753 +CONFIG_NLS_CODEPAGE_437=y
105.1754  CONFIG_NLS_CODEPAGE_737=m
105.1755  CONFIG_NLS_CODEPAGE_775=m
105.1756  CONFIG_NLS_CODEPAGE_850=m
105.1757 @@ -2541,7 +2325,7 @@ CONFIG_NLS_CODEPAGE_874=m
105.1758  CONFIG_NLS_ISO8859_8=m
105.1759  CONFIG_NLS_CODEPAGE_1250=m
105.1760  CONFIG_NLS_CODEPAGE_1251=m
105.1761 -CONFIG_NLS_ASCII=m
105.1762 +CONFIG_NLS_ASCII=y
105.1763  CONFIG_NLS_ISO8859_1=m
105.1764  CONFIG_NLS_ISO8859_2=m
105.1765  CONFIG_NLS_ISO8859_3=m
105.1766 @@ -2561,15 +2345,15 @@ CONFIG_NLS_UTF8=m
105.1767  # Security options
105.1768  #
105.1769  CONFIG_KEYS=y
105.1770 -# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
105.1771 +CONFIG_KEYS_DEBUG_PROC_KEYS=y
105.1772  CONFIG_SECURITY=y
105.1773 -# CONFIG_SECURITY_NETWORK is not set
105.1774 -CONFIG_SECURITY_CAPABILITIES=m
105.1775 -CONFIG_SECURITY_ROOTPLUG=m
105.1776 -CONFIG_SECURITY_SECLVL=m
105.1777 +CONFIG_SECURITY_NETWORK=y
105.1778 +CONFIG_SECURITY_CAPABILITIES=y
105.1779 +# CONFIG_SECURITY_ROOTPLUG is not set
105.1780 +# CONFIG_SECURITY_SECLVL is not set
105.1781  CONFIG_SECURITY_SELINUX=y
105.1782  CONFIG_SECURITY_SELINUX_BOOTPARAM=y
105.1783 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
105.1784 +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
105.1785  CONFIG_SECURITY_SELINUX_DISABLE=y
105.1786  CONFIG_SECURITY_SELINUX_DEVELOP=y
105.1787  CONFIG_SECURITY_SELINUX_AVC_STATS=y
105.1788 @@ -2582,8 +2366,8 @@ CONFIG_CRYPTO=y
105.1789  CONFIG_CRYPTO_HMAC=y
105.1790  CONFIG_CRYPTO_NULL=m
105.1791  CONFIG_CRYPTO_MD4=m
105.1792 -CONFIG_CRYPTO_MD5=y
105.1793 -CONFIG_CRYPTO_SHA1=m
105.1794 +CONFIG_CRYPTO_MD5=m
105.1795 +CONFIG_CRYPTO_SHA1=y
105.1796  CONFIG_CRYPTO_SHA256=m
105.1797  CONFIG_CRYPTO_SHA512=m
105.1798  CONFIG_CRYPTO_WP512=m
105.1799 @@ -2602,7 +2386,7 @@ CONFIG_CRYPTO_ANUBIS=m
105.1800  CONFIG_CRYPTO_DEFLATE=m
105.1801  CONFIG_CRYPTO_MICHAEL_MIC=m
105.1802  CONFIG_CRYPTO_CRC32C=m
105.1803 -CONFIG_CRYPTO_TEST=m
105.1804 +# CONFIG_CRYPTO_TEST is not set
105.1805  
105.1806  #
105.1807  # Hardware crypto devices
105.1808 @@ -2616,8 +2400,6 @@ CONFIG_CRC32=y
105.1809  CONFIG_LIBCRC32C=m
105.1810  CONFIG_ZLIB_INFLATE=y
105.1811  CONFIG_ZLIB_DEFLATE=m
105.1812 -CONFIG_REED_SOLOMON=m
105.1813 -CONFIG_REED_SOLOMON_DEC16=y
105.1814  
105.1815  #
105.1816  # Kernel hacking
105.1817 @@ -2625,7 +2407,7 @@ CONFIG_REED_SOLOMON_DEC16=y
105.1818  # CONFIG_PRINTK_TIME is not set
105.1819  CONFIG_DEBUG_KERNEL=y
105.1820  CONFIG_MAGIC_SYSRQ=y
105.1821 -CONFIG_LOG_BUF_SHIFT=14
105.1822 +CONFIG_LOG_BUF_SHIFT=15
105.1823  # CONFIG_SCHEDSTATS is not set
105.1824  # CONFIG_DEBUG_SLAB is not set
105.1825  # CONFIG_DEBUG_SPINLOCK is not set
105.1826 @@ -2640,5 +2422,4 @@ CONFIG_LOG_BUF_SHIFT=14
105.1827  # CONFIG_4KSTACKS is not set
105.1828  CONFIG_X86_FIND_SMP_CONFIG=y
105.1829  CONFIG_X86_MPPARSE=y
105.1830 -# CONFIG_CHECKING is not set
105.1831  # CONFIG_INIT_DEBUG is not set
   106.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Tue Aug 23 18:43:18 2005 -0800
   106.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Thu Aug 25 15:53:20 2005 -0700
   106.3 @@ -533,6 +533,11 @@ config X86_CPUID
   106.4  	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
   106.5  	  /dev/cpu/31/cpuid.
   106.6  
   106.7 +config SWIOTLB
   106.8 +       bool
   106.9 +       depends on PCI
  106.10 +       default y
  106.11 +
  106.12  source "drivers/firmware/Kconfig"
  106.13  
  106.14  choice
   108.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile	Tue Aug 23 18:43:18 2005 -0800
   108.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile	Thu Aug 25 15:53:20 2005 -0700
   108.3 @@ -14,8 +14,7 @@ obj-y	:= process.o signal.o entry.o trap
   108.4  
   108.5  c-obj-y	:= semaphore.o vm86.o \
   108.6  		ptrace.o sys_i386.o \
   108.7 -		i387.o dmi_scan.o bootflag.o \
   108.8 -		doublefault.o
   108.9 +		i387.o dmi_scan.o bootflag.o
  108.10  s-obj-y	:=
  108.11  
  108.12  obj-y				+= cpu/
  108.13 @@ -44,6 +43,7 @@ c-obj-$(CONFIG_HPET_TIMER) 	+= time_hpet
  108.14  c-obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
  108.15  c-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
  108.16  c-obj-$(CONFIG_SMP_ALTERNATIVES)+= smpalts.o
  108.17 +obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
  108.18  
  108.19  EXTRA_AFLAGS   := -traditional
  108.20  
  108.21 @@ -84,7 +84,7 @@ SYSCFLAGS_vsyscall-syms.o = -r
  108.22  			$(obj)/vsyscall-sysenter.o FORCE
  108.23  	$(call if_changed,syscall)
  108.24  
  108.25 -c-link	:= init_task.o
  108.26 +c-link	:=
  108.27  s-link	:= vsyscall-int80.o vsyscall-sysenter.o vsyscall-sigreturn.o vsyscall.lds.o syscall_table.o
  108.28  
  108.29  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-obj-m) $(c-link)) $(patsubst %.o,$(obj)/%.S,$(s-obj-y) $(s-link)):
  108.30 @@ -92,6 +92,7 @@ s-link	:= vsyscall-int80.o vsyscall-syse
  108.31  
  108.32  $(obj)/vsyscall-int80.S: $(obj)/vsyscall-sigreturn.S
  108.33  
  108.34 +EXTRA_AFLAGS	+= -I$(obj)
  108.35  $(obj)/entry.o: $(src)/entry.S $(src)/syscall_table.S
  108.36  
  108.37  obj-y	+= $(c-obj-y) $(s-obj-y)
   113.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Tue Aug 23 18:43:18 2005 -0800
   113.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Thu Aug 25 15:53:20 2005 -0700
   113.3 @@ -19,11 +19,13 @@
   113.4  
   113.5  #include "cpu.h"
   113.6  
   113.7 +#ifndef CONFIG_XEN
   113.8  DEFINE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
   113.9  EXPORT_PER_CPU_SYMBOL(cpu_gdt_table);
  113.10  
  113.11  DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
  113.12  EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
  113.13 +#endif
  113.14  
  113.15  static int cachesize_override __initdata = -1;
  113.16  static int disable_x86_fxsr __initdata = 0;
  113.17 @@ -569,7 +571,7 @@ void __init cpu_gdt_init(struct Xgt_desc
  113.18  	for (va = gdt_descr->address, f = 0;
  113.19  	     va < gdt_descr->address + gdt_descr->size;
  113.20  	     va += PAGE_SIZE, f++) {
  113.21 -		frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
  113.22 +		frames[f] = virt_to_mfn(va);
  113.23  		make_page_readonly((void *)va);
  113.24  	}
  113.25  	if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
   117.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Tue Aug 23 18:43:18 2005 -0800
   117.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Thu Aug 25 15:53:20 2005 -0700
   117.3 @@ -136,9 +136,6 @@ cpu_gdt_descr:
   117.4  ENTRY(empty_zero_page)
   117.5  
   117.6  .org 0x2000
   117.7 -ENTRY(swapper_pg_dir)
   117.8 -
   117.9 -.org 0x3000
  117.10  ENTRY(cpu_gdt_table)
  117.11  	.quad 0x0000000000000000	/* NULL descriptor */
  117.12  	.quad 0x0000000000000000	/* 0x0b reserved */
  117.13 @@ -190,10 +187,10 @@ ENTRY(cpu_gdt_table)
  117.14  	.quad 0x0000000000000000	/* 0xf8 - GDT entry 31: double-fault TSS */
  117.15  	.fill GDT_ENTRIES-32,8,0
  117.16  
  117.17 -.org 0x4000
  117.18 +.org 0x3000
  117.19  ENTRY(default_ldt)
  117.20  
  117.21 -.org 0x5000
  117.22 +.org 0x4000
  117.23  /*
  117.24   * Real beginning of normal "text" segment
  117.25   */
   118.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c	Tue Aug 23 18:43:18 2005 -0800
   118.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c	Thu Aug 25 15:53:20 2005 -0700
   118.3 @@ -115,9 +115,6 @@ EXPORT_SYMBOL(__copy_from_user_ll);
   118.4  EXPORT_SYMBOL(__copy_to_user_ll);
   118.5  EXPORT_SYMBOL(strnlen_user);
   118.6  
   118.7 -EXPORT_SYMBOL(dma_alloc_coherent);
   118.8 -EXPORT_SYMBOL(dma_free_coherent);
   118.9 -
  118.10  #ifdef CONFIG_PCI
  118.11  EXPORT_SYMBOL(pci_mem_start);
  118.12  #endif
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/init_task.c	Thu Aug 25 15:53:20 2005 -0700
   119.3 @@ -0,0 +1,49 @@
   119.4 +#include <linux/mm.h>
   119.5 +#include <linux/module.h>
   119.6 +#include <linux/sched.h>
   119.7 +#include <linux/init.h>
   119.8 +#include <linux/init_task.h>
   119.9 +#include <linux/fs.h>
  119.10 +#include <linux/mqueue.h>
  119.11 +
  119.12 +#include <asm/uaccess.h>
  119.13 +#include <asm/pgtable.h>
  119.14 +#include <asm/desc.h>
  119.15 +
  119.16 +static struct fs_struct init_fs = INIT_FS;
  119.17 +static struct files_struct init_files = INIT_FILES;
  119.18 +static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
  119.19 +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
  119.20 +
  119.21 +#define swapper_pg_dir ((pgd_t *)NULL)
  119.22 +struct mm_struct init_mm = INIT_MM(init_mm);
  119.23 +#undef swapper_pg_dir
  119.24 +
  119.25 +EXPORT_SYMBOL(init_mm);
  119.26 +
  119.27 +/*
  119.28 + * Initial thread structure.
  119.29 + *
  119.30 + * We need to make sure that this is THREAD_SIZE aligned due to the
  119.31 + * way process stacks are handled. This is done by having a special
  119.32 + * "init_task" linker map entry..
  119.33 + */
  119.34 +union thread_union init_thread_union 
  119.35 +	__attribute__((__section__(".data.init_task"))) =
  119.36 +		{ INIT_THREAD_INFO(init_task) };
  119.37 +
  119.38 +/*
  119.39 + * Initial task structure.
  119.40 + *
  119.41 + * All other task structs will be allocated on slabs in fork.c
  119.42 + */
  119.43 +struct task_struct init_task = INIT_TASK(init_task);
  119.44 +
  119.45 +EXPORT_SYMBOL(init_task);
  119.46 +
  119.47 +/*
  119.48 + * per-CPU TSS segments. Threads are completely 'soft' on Linux,
  119.49 + * no more per-task TSS's.
  119.50 + */ 
  119.51 +DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp = INIT_TSS;
  119.52 +
   121.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Tue Aug 23 18:43:18 2005 -0800
   121.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Thu Aug 25 15:53:20 2005 -0700
   121.3 @@ -80,7 +80,7 @@ asmlinkage long sys_ioperm(unsigned long
   121.4  		t->io_bitmap_ptr = bitmap;
   121.5  
   121.6  		op.cmd = PHYSDEVOP_SET_IOBITMAP;
   121.7 -		op.u.set_iobitmap.bitmap   = (unsigned long)bitmap;
   121.8 +		op.u.set_iobitmap.bitmap   = (char *)bitmap;
   121.9  		op.u.set_iobitmap.nr_ports = IO_BITMAP_BITS;
  121.10  		HYPERVISOR_physdev_op(&op);
  121.11  	}
  121.12 @@ -113,16 +113,12 @@ asmlinkage long sys_iopl(unsigned int ne
  121.13  	if ((new_io_pl > old_io_pl) && !capable(CAP_SYS_RAWIO))
  121.14  		return -EPERM;
  121.15  
  121.16 -	/* Maintain OS privileges even if user attempts to relinquish them. */
  121.17 -	if (new_io_pl == 0)
  121.18 -		new_io_pl = 1;
  121.19 -
  121.20  	/* Change our version of the privilege levels. */
  121.21  	current->thread.io_pl = new_io_pl;
  121.22  
  121.23  	/* Force the change at ring 0. */
  121.24  	op.cmd             = PHYSDEVOP_SET_IOPL;
  121.25 -	op.u.set_iopl.iopl = new_io_pl;
  121.26 +	op.u.set_iopl.iopl = (new_io_pl == 0) ? 1 : new_io_pl;
  121.27  	HYPERVISOR_physdev_op(&op);
  121.28  
  121.29  	return 0;
   123.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c	Tue Aug 23 18:43:18 2005 -0800
   123.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c	Thu Aug 25 15:53:20 2005 -0700
   123.3 @@ -198,7 +198,7 @@ static int write_ldt(void __user * ptr, 
   123.4  {
   123.5  	struct mm_struct * mm = current->mm;
   123.6  	__u32 entry_1, entry_2, *lp;
   123.7 -	unsigned long mach_lp;
   123.8 +	maddr_t mach_lp;
   123.9  	int error;
  123.10  	struct user_desc ldt_info;
  123.11  
  123.12 @@ -245,7 +245,8 @@ static int write_ldt(void __user * ptr, 
  123.13  
  123.14  	/* Install the new entry ...  */
  123.15  install:
  123.16 -	error = HYPERVISOR_update_descriptor(mach_lp, entry_1, entry_2);
  123.17 +	error = HYPERVISOR_update_descriptor(
  123.18 +		mach_lp, (u64)entry_1 | ((u64)entry_2<<32));
  123.19  
  123.20  out_unlock:
  123.21  	up(&mm->context.sem);
   125.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c	Tue Aug 23 18:43:18 2005 -0800
   125.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c	Thu Aug 25 15:53:20 2005 -0700
   125.3 @@ -784,7 +784,9 @@ static int __init smp_scan_config (unsig
   125.4  
   125.5  void __init find_smp_config (void)
   125.6  {
   125.7 +#ifndef CONFIG_XEN
   125.8  	unsigned int address;
   125.9 +#endif
  125.10  
  125.11  	/*
  125.12  	 * FIXME: Linux assumes you have 640K of base ram..
   126.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Tue Aug 23 18:43:18 2005 -0800
   126.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Aug 25 15:53:20 2005 -0700
   126.3 @@ -24,6 +24,104 @@ struct dma_coherent_mem {
   126.4  	unsigned long	*bitmap;
   126.5  };
   126.6  
   126.7 +#define IOMMU_BUG_ON(test)				\
   126.8 +do {							\
   126.9 +	if (unlikely(test)) {				\
  126.10 +		printk(KERN_ALERT "Fatal DMA error! "	\
  126.11 +		       "Please use 'swiotlb=force'\n");	\
  126.12 +		BUG();					\
  126.13 +	}						\
  126.14 +} while (0)
  126.15 +
  126.16 +int
  126.17 +dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
  126.18 +	   enum dma_data_direction direction)
  126.19 +{
  126.20 +	int i, rc;
  126.21 +
  126.22 +	BUG_ON(direction == DMA_NONE);
  126.23 +
  126.24 +	if (swiotlb) {
  126.25 +		rc = swiotlb_map_sg(hwdev, sg, nents, direction);
  126.26 +	} else {
  126.27 +		for (i = 0; i < nents; i++ ) {
  126.28 +			sg[i].dma_address =
  126.29 +				page_to_phys(sg[i].page) + sg[i].offset;
  126.30 +			sg[i].dma_length  = sg[i].length;
  126.31 +			BUG_ON(!sg[i].page);
  126.32 +			IOMMU_BUG_ON(address_needs_mapping(
  126.33 +				hwdev, sg[i].dma_address));
  126.34 +		}
  126.35 +		rc = nents;
  126.36 +	}
  126.37 +
  126.38 +	flush_write_buffers();
  126.39 +	return rc;
  126.40 +}
  126.41 +EXPORT_SYMBOL(dma_map_sg);
  126.42 +
  126.43 +void
  126.44 +dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
  126.45 +	     enum dma_data_direction direction)
  126.46 +{
  126.47 +	BUG_ON(direction == DMA_NONE);
  126.48 +	if (swiotlb)
  126.49 +		swiotlb_unmap_sg(hwdev, sg, nents, direction);
  126.50 +}
  126.51 +EXPORT_SYMBOL(dma_unmap_sg);
  126.52 +
  126.53 +dma_addr_t
  126.54 +dma_map_page(struct device *dev, struct page *page, unsigned long offset,
  126.55 +	     size_t size, enum dma_data_direction direction)
  126.56 +{
  126.57 +	dma_addr_t dma_addr;
  126.58 +
  126.59 +	BUG_ON(direction == DMA_NONE);
  126.60 +
  126.61 +	if (swiotlb) {
  126.62 +		dma_addr = swiotlb_map_page(
  126.63 +			dev, page, offset, size, direction);
  126.64 +	} else {
  126.65 +		dma_addr = page_to_phys(page) + offset;
  126.66 +		IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr));
  126.67 +	}
  126.68 +
  126.69 +	return dma_addr;
  126.70 +}
  126.71 +EXPORT_SYMBOL(dma_map_page);
  126.72 +
  126.73 +void
  126.74 +dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
  126.75 +	       enum dma_data_direction direction)
  126.76 +{
  126.77 +	BUG_ON(direction == DMA_NONE);
  126.78 +	if (swiotlb)
  126.79 +		swiotlb_unmap_page(dev, dma_address, size, direction);
  126.80 +}
  126.81 +EXPORT_SYMBOL(dma_unmap_page);
  126.82 +
  126.83 +int
  126.84 +dma_mapping_error(dma_addr_t dma_addr)
  126.85 +{
  126.86 +	if (swiotlb)
  126.87 +		return swiotlb_dma_mapping_error(dma_addr);
  126.88 +	return 0;
  126.89 +}
  126.90 +EXPORT_SYMBOL(dma_mapping_error);
  126.91 +
  126.92 +int
  126.93 +dma_supported(struct device *dev, u64 mask)
  126.94 +{
  126.95 +	if (swiotlb)
  126.96 +		return swiotlb_dma_supported(dev, mask);
  126.97 +	/*
  126.98 +         * By default we'll BUG when an infeasible DMA is requested, and
  126.99 +         * request swiotlb=force (see IOMMU_BUG_ON).
 126.100 +         */
 126.101 +	return 1;
 126.102 +}
 126.103 +EXPORT_SYMBOL(dma_supported);
 126.104 +
 126.105  void *dma_alloc_coherent(struct device *dev, size_t size,
 126.106  			   dma_addr_t *dma_handle, unsigned int __nocast gfp)
 126.107  {
 126.108 @@ -54,13 +152,14 @@ void *dma_alloc_coherent(struct device *
 126.109  	ret = (void *)vstart;
 126.110  
 126.111  	if (ret != NULL) {
 126.112 -		xen_contig_memory(vstart, order);
 126.113 +		xen_create_contiguous_region(vstart, order);
 126.114  
 126.115  		memset(ret, 0, size);
 126.116  		*dma_handle = virt_to_bus(ret);
 126.117  	}
 126.118  	return ret;
 126.119  }
 126.120 +EXPORT_SYMBOL(dma_alloc_coherent);
 126.121  
 126.122  void dma_free_coherent(struct device *dev, size_t size,
 126.123  			 void *vaddr, dma_addr_t dma_handle)
 126.124 @@ -72,9 +171,12 @@ void dma_free_coherent(struct device *de
 126.125  		int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
 126.126  
 126.127  		bitmap_release_region(mem->bitmap, page, order);
 126.128 -	} else
 126.129 +	} else {
 126.130 +		xen_destroy_contiguous_region((unsigned long)vaddr, order);
 126.131  		free_pages((unsigned long)vaddr, order);
 126.132 +	}
 126.133  }
 126.134 +EXPORT_SYMBOL(dma_free_coherent);
 126.135  
 126.136  int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
 126.137  				dma_addr_t device_addr, size_t size, int flags)
 126.138 @@ -153,46 +255,20 @@ void *dma_mark_declared_memory_occupied(
 126.139  }
 126.140  EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
 126.141  
 126.142 -static LIST_HEAD(dma_map_head);
 126.143 -static DEFINE_SPINLOCK(dma_map_lock);
 126.144 -struct dma_map_entry {
 126.145 -	struct list_head list;
 126.146 -	dma_addr_t dma;
 126.147 -	char *bounce, *host;
 126.148 -	size_t size;
 126.149 -};
 126.150 -#define DMA_MAP_MATCHES(e,d) (((e)->dma<=(d)) && (((e)->dma+(e)->size)>(d)))
 126.151 -
 126.152  dma_addr_t
 126.153  dma_map_single(struct device *dev, void *ptr, size_t size,
 126.154  	       enum dma_data_direction direction)
 126.155  {
 126.156 -	struct dma_map_entry *ent;
 126.157 -	void *bnc;
 126.158  	dma_addr_t dma;
 126.159 -	unsigned long flags;
 126.160  
 126.161  	BUG_ON(direction == DMA_NONE);
 126.162  
 126.163 -	/*
 126.164 -	 * Even if size is sub-page, the buffer may still straddle a page
 126.165 -	 * boundary. Take into account buffer start offset. All other calls are
 126.166 -	 * conservative and always search the dma_map list if it's non-empty.
 126.167 -	 */
 126.168 -	if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) {
 126.169 -		dma = virt_to_bus(ptr);
 126.170 +	if (swiotlb) {
 126.171 +		dma = swiotlb_map_single(dev, ptr, size, direction);
 126.172  	} else {
 126.173 -		BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL);
 126.174 -		BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL);
 126.175 -		if (direction != DMA_FROM_DEVICE)
 126.176 -			memcpy(bnc, ptr, size);
 126.177 -		ent->dma    = dma;
 126.178 -		ent->bounce = bnc;
 126.179 -		ent->host   = ptr;
 126.180 -		ent->size   = size;
 126.181 -		spin_lock_irqsave(&dma_map_lock, flags);
 126.182 -		list_add(&ent->list, &dma_map_head);
 126.183 -		spin_unlock_irqrestore(&dma_map_lock, flags);
 126.184 +		dma = virt_to_bus(ptr);
 126.185 +		IOMMU_BUG_ON(range_straddles_page_boundary(ptr, size));
 126.186 +		IOMMU_BUG_ON(address_needs_mapping(dev, dma));
 126.187  	}
 126.188  
 126.189  	flush_write_buffers();
 126.190 @@ -204,30 +280,9 @@ void
 126.191  dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 126.192  		 enum dma_data_direction direction)
 126.193  {
 126.194 -	struct dma_map_entry *ent;
 126.195 -	unsigned long flags;
 126.196 -
 126.197  	BUG_ON(direction == DMA_NONE);
 126.198 -
 126.199 -	/* Fast-path check: are there any multi-page DMA mappings? */
 126.200 -	if (!list_empty(&dma_map_head)) {
 126.201 -		spin_lock_irqsave(&dma_map_lock, flags);
 126.202 -		list_for_each_entry ( ent, &dma_map_head, list ) {
 126.203 -			if (DMA_MAP_MATCHES(ent, dma_addr)) {
 126.204 -				list_del(&ent->list);
 126.205 -				break;
 126.206 -			}
 126.207 -		}
 126.208 -		spin_unlock_irqrestore(&dma_map_lock, flags);
 126.209 -		if (&ent->list != &dma_map_head) {
 126.210 -			BUG_ON(dma_addr != ent->dma);
 126.211 -			BUG_ON(size != ent->size);
 126.212 -			if (direction != DMA_TO_DEVICE)
 126.213 -				memcpy(ent->host, ent->bounce, size);
 126.214 -			dma_free_coherent(dev, size, ent->bounce, ent->dma);
 126.215 -			kfree(ent);
 126.216 -		}
 126.217 -	}
 126.218 +	if (swiotlb)
 126.219 +		swiotlb_unmap_single(dev, dma_addr, size, direction);
 126.220  }
 126.221  EXPORT_SYMBOL(dma_unmap_single);
 126.222  
 126.223 @@ -235,23 +290,8 @@ void
 126.224  dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
 126.225  			enum dma_data_direction direction)
 126.226  {
 126.227 -	struct dma_map_entry *ent;
 126.228 -	unsigned long flags, off;
 126.229 -
 126.230 -	/* Fast-path check: are there any multi-page DMA mappings? */
 126.231 -	if (!list_empty(&dma_map_head)) {
 126.232 -		spin_lock_irqsave(&dma_map_lock, flags);
 126.233 -		list_for_each_entry ( ent, &dma_map_head, list )
 126.234 -			if (DMA_MAP_MATCHES(ent, dma_handle))
 126.235 -				break;
 126.236 -		spin_unlock_irqrestore(&dma_map_lock, flags);
 126.237 -		if (&ent->list != &dma_map_head) {
 126.238 -			off = dma_handle - ent->dma;
 126.239 -			BUG_ON((off + size) > ent->size);
 126.240 -			/*if (direction != DMA_TO_DEVICE)*/
 126.241 -				memcpy(ent->host+off, ent->bounce+off, size);
 126.242 -		}
 126.243 -	}
 126.244 +	if (swiotlb)
 126.245 +		swiotlb_sync_single_for_cpu(dev, dma_handle, size, direction);
 126.246  }
 126.247  EXPORT_SYMBOL(dma_sync_single_for_cpu);
 126.248  
 126.249 @@ -259,24 +299,17 @@ void
 126.250  dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
 126.251                             enum dma_data_direction direction)
 126.252  {
 126.253 -	struct dma_map_entry *ent;
 126.254 -	unsigned long flags, off;
 126.255 -
 126.256 -	/* Fast-path check: are there any multi-page DMA mappings? */
 126.257 -	if (!list_empty(&dma_map_head)) {
 126.258 -		spin_lock_irqsave(&dma_map_lock, flags);
 126.259 -		list_for_each_entry ( ent, &dma_map_head, list )
 126.260 -			if (DMA_MAP_MATCHES(ent, dma_handle))
 126.261 -				break;
 126.262 -		spin_unlock_irqrestore(&dma_map_lock, flags);
 126.263 -		if (&ent->list != &dma_map_head) {
 126.264 -			off = dma_handle - ent->dma;
 126.265 -			BUG_ON((off + size) > ent->size);
 126.266 -			/*if (direction != DMA_FROM_DEVICE)*/
 126.267 -				memcpy(ent->bounce+off, ent->host+off, size);
 126.268 -		}
 126.269 -	}
 126.270 -
 126.271 -	flush_write_buffers();
 126.272 +	if (swiotlb)
 126.273 +		swiotlb_sync_single_for_device(dev, dma_handle, size, direction);
 126.274  }
 126.275  EXPORT_SYMBOL(dma_sync_single_for_device);
 126.276 +
 126.277 +/*
 126.278 + * Local variables:
 126.279 + *  c-file-style: "linux"
 126.280 + *  indent-tabs-mode: t
 126.281 + *  c-indent-level: 8
 126.282 + *  c-basic-offset: 8
 126.283 + *  tab-width: 8
 126.284 + * End:
 126.285 + */
   127.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Tue Aug 23 18:43:18 2005 -0800
   127.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Thu Aug 25 15:53:20 2005 -0700
   127.3 @@ -115,20 +115,12 @@ void xen_idle(void)
   127.4  /* We don't actually take CPU down, just spin without interrupts. */
   127.5  static inline void play_dead(void)
   127.6  {
   127.7 -	/* Ack it */
   127.8 -	__get_cpu_var(cpu_state) = CPU_DEAD;
   127.9 -
  127.10 -	/* We shouldn't have to disable interrupts while dead, but
  127.11 -	 * some interrupts just don't seem to go away, and this makes
  127.12 -	 * it "work" for testing purposes. */
  127.13  	/* Death loop */
  127.14  	while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
  127.15  		HYPERVISOR_yield();
  127.16  
  127.17 -	local_irq_disable();
  127.18  	__flush_tlb_all();
  127.19  	cpu_set(smp_processor_id(), cpu_online_map);
  127.20 -	local_irq_enable();
  127.21  }
  127.22  #else
  127.23  static inline void play_dead(void)
  127.24 @@ -156,12 +148,19 @@ void cpu_idle (void)
  127.25  			rmb();
  127.26  
  127.27  			if (cpu_is_offline(cpu)) {
  127.28 +				local_irq_disable();
  127.29  #if defined(CONFIG_XEN) && defined(CONFIG_HOTPLUG_CPU)
  127.30 +				/* Ack it.  From this point on until
  127.31 +				   we get woken up, we're not allowed
  127.32 +				   to take any locks.  In particular,
  127.33 +				   don't printk. */
  127.34 +				__get_cpu_var(cpu_state) = CPU_DEAD;
  127.35  				/* Tell hypervisor to take vcpu down. */
  127.36  				HYPERVISOR_vcpu_down(cpu);
  127.37  #endif
  127.38  				play_dead();
  127.39 -         }
  127.40 +				local_irq_enable();
  127.41 +			}
  127.42  
  127.43  			__get_cpu_var(irq_stat).idle_timestamp = jiffies;
  127.44  			xen_idle();
  127.45 @@ -523,23 +522,22 @@ struct task_struct fastcall * __switch_t
  127.46  	 * Load the per-thread Thread-Local Storage descriptor.
  127.47  	 * This is load_TLS(next, cpu) with multicalls.
  127.48  	 */
  127.49 -#define C(i) do {                                                       \
  127.50 -	if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||    \
  127.51 -		     next->tls_array[i].b != prev->tls_array[i].b)) {   \
  127.52 -		mcl->op      = __HYPERVISOR_update_descriptor;          \
  127.53 -		mcl->args[0] = virt_to_machine(&get_cpu_gdt_table(cpu)  \
  127.54 -					 [GDT_ENTRY_TLS_MIN + i]);      \
  127.55 -		mcl->args[1] = ((u32 *)&next->tls_array[i])[0];         \
  127.56 -		mcl->args[2] = ((u32 *)&next->tls_array[i])[1];         \
  127.57 -		mcl++;                                                  \
  127.58 -	}                                                               \
  127.59 +#define C(i) do {							\
  127.60 +	if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||	\
  127.61 +		     next->tls_array[i].b != prev->tls_array[i].b)) {	\
  127.62 +		mcl->op = __HYPERVISOR_update_descriptor;		\
  127.63 +		*(u64 *)&mcl->args[0] =	virt_to_machine(		\
  127.64 +			&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]);\
  127.65 +		*(u64 *)&mcl->args[2] = *(u64 *)&next->tls_array[i];	\
  127.66 +		mcl++;							\
  127.67 +	}								\
  127.68  } while (0)
  127.69  	C(0); C(1); C(2);
  127.70  #undef C
  127.71  
  127.72  	if (unlikely(prev->io_pl != next->io_pl)) {
  127.73  		iopl_op.cmd             = PHYSDEVOP_SET_IOPL;
  127.74 -		iopl_op.u.set_iopl.iopl = next->io_pl;
  127.75 +		iopl_op.u.set_iopl.iopl = (next->io_pl == 0) ? 1 : next->io_pl;
  127.76  		mcl->op      = __HYPERVISOR_physdev_op;
  127.77  		mcl->args[0] = (unsigned long)&iopl_op;
  127.78  		mcl++;
  127.79 @@ -549,7 +547,7 @@ struct task_struct fastcall * __switch_t
  127.80  		iobmp_op.cmd                     =
  127.81  			PHYSDEVOP_SET_IOBITMAP;
  127.82  		iobmp_op.u.set_iobitmap.bitmap   =
  127.83 -			(unsigned long)next->io_bitmap_ptr;
  127.84 +			(char *)next->io_bitmap_ptr;
  127.85  		iobmp_op.u.set_iobitmap.nr_ports =
  127.86  			next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
  127.87  		mcl->op      = __HYPERVISOR_physdev_op;
  127.88 @@ -791,3 +789,10 @@ unsigned long arch_align_stack(unsigned 
  127.89  		sp -= get_random_int() % 8192;
  127.90  	return sp & ~0xf;
  127.91  }
  127.92 +
  127.93 +
  127.94 +#ifndef CONFIG_X86_SMP
  127.95 +void _restore_vcpu(void)
  127.96 +{
  127.97 +}
  127.98 +#endif
   128.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Aug 23 18:43:18 2005 -0800
   128.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Thu Aug 25 15:53:20 2005 -0700
   128.3 @@ -1575,19 +1575,20 @@ void __init setup_arch(char **cmdline_p)
   128.4  	/* Make sure we have a correctly sized P->M table. */
   128.5  	if (max_pfn != xen_start_info.nr_pages) {
   128.6  		phys_to_machine_mapping = alloc_bootmem_low_pages(
   128.7 -			max_pfn * sizeof(unsigned long));
   128.8 +			max_pfn * sizeof(unsigned int));
   128.9  
  128.10  		if (max_pfn > xen_start_info.nr_pages) {
  128.11  			/* set to INVALID_P2M_ENTRY */
  128.12  			memset(phys_to_machine_mapping, ~0,
  128.13 -				max_pfn * sizeof(unsigned long));
  128.14 +				max_pfn * sizeof(unsigned int));
  128.15  			memcpy(phys_to_machine_mapping,
  128.16 -				(unsigned long *)xen_start_info.mfn_list,
  128.17 -				xen_start_info.nr_pages * sizeof(unsigned long));
  128.18 +				(unsigned int *)xen_start_info.mfn_list,
  128.19 +				xen_start_info.nr_pages * sizeof(unsigned int));
  128.20  		} else {
  128.21  			memcpy(phys_to_machine_mapping,
  128.22 -				(unsigned long *)xen_start_info.mfn_list,
  128.23 -				max_pfn * sizeof(unsigned long));
  128.24 +				(unsigned int *)xen_start_info.mfn_list,
  128.25 +				max_pfn * sizeof(unsigned int));
  128.26 +			/* N.B. below relies on sizeof(int) == sizeof(long). */
  128.27  			if (HYPERVISOR_dom_mem_op(
  128.28  				MEMOP_decrease_reservation,
  128.29  				(unsigned long *)xen_start_info.mfn_list + max_pfn,
  128.30 @@ -1597,18 +1598,17 @@ void __init setup_arch(char **cmdline_p)
  128.31  		free_bootmem(
  128.32  			__pa(xen_start_info.mfn_list), 
  128.33  			PFN_PHYS(PFN_UP(xen_start_info.nr_pages *
  128.34 -			sizeof(unsigned long))));
  128.35 +			sizeof(unsigned int))));
  128.36  	}
  128.37  
  128.38  	pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
  128.39 -	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
  128.40 +	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned int)), j++ )
  128.41  	{	
  128.42  	     pfn_to_mfn_frame_list[j] = 
  128.43 -		  virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
  128.44 +		  virt_to_mfn(&phys_to_machine_mapping[i]);
  128.45  	}
  128.46  	HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
  128.47 -	     virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
  128.48 -
  128.49 +	     virt_to_mfn(pfn_to_mfn_frame_list);
  128.50  
  128.51  	/*
  128.52  	 * NOTE: at this point the bootmem allocator is fully available.
  128.53 @@ -1636,7 +1636,7 @@ void __init setup_arch(char **cmdline_p)
  128.54  		efi_map_memmap();
  128.55  
  128.56  	op.cmd             = PHYSDEVOP_SET_IOPL;
  128.57 -	op.u.set_iopl.iopl = current->thread.io_pl = 1;
  128.58 +	op.u.set_iopl.iopl = 1;
  128.59  	HYPERVISOR_physdev_op(&op);
  128.60  
  128.61  #ifdef CONFIG_ACPI_BOOT
   131.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Aug 23 18:43:18 2005 -0800
   131.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Thu Aug 25 15:53:20 2005 -0700
   131.3 @@ -62,6 +62,8 @@
   131.4  #include <mach_wakecpu.h>
   131.5  #include <smpboot_hooks.h>
   131.6  
   131.7 +#include <asm-xen/evtchn.h>
   131.8 +
   131.9  /* Set if we find a B stepping CPU */
  131.10  static int __initdata smp_b_stepping;
  131.11  
  131.12 @@ -129,15 +131,7 @@ static void map_cpu_to_logical_apicid(vo
  131.13   */
  131.14  void __init smp_alloc_memory(void)
  131.15  {
  131.16 -#if 1
  131.17 -	int cpu;
  131.18 -
  131.19 -	for (cpu = 1; cpu < NR_CPUS; cpu++) {
  131.20 -		cpu_gdt_descr[cpu].address = (unsigned long)
  131.21 -			alloc_bootmem_low_pages(PAGE_SIZE);
  131.22 -		/* XXX free unused pages later */
  131.23 -	}
  131.24 -#else
  131.25 +#if 0
  131.26  	trampoline_base = (void *) alloc_bootmem_low_pages(PAGE_SIZE);
  131.27  	/*
  131.28  	 * Has to be in very low memory so we can execute
  131.29 @@ -859,8 +853,8 @@ static int __init do_boot_cpu(int apicid
  131.30  	atomic_set(&init_deasserted, 0);
  131.31  
  131.32  #if 1
  131.33 -	if (cpu_gdt_descr[0].size > PAGE_SIZE)
  131.34 -		BUG();
  131.35 +	cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL);
  131.36 +	BUG_ON(cpu_gdt_descr[0].size > PAGE_SIZE);
  131.37  	cpu_gdt_descr[cpu].size = cpu_gdt_descr[0].size;
  131.38  	printk("GDT: copying %d bytes from %lx to %lx\n",
  131.39  		cpu_gdt_descr[0].size, cpu_gdt_descr[0].address,
  131.40 @@ -878,7 +872,8 @@ static int __init do_boot_cpu(int apicid
  131.41  	ctxt.user_regs.cs = __KERNEL_CS;
  131.42  	ctxt.user_regs.eip = start_eip;
  131.43  	ctxt.user_regs.esp = idle->thread.esp;
  131.44 -	ctxt.user_regs.eflags = (1<<9) | (1<<2) | (idle->thread.io_pl<<12);
  131.45 +#define X86_EFLAGS_IOPL_RING1 0x1000
  131.46 +	ctxt.user_regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_IOPL_RING1;
  131.47  
  131.48  	/* FPU is set up to default initial state. */
  131.49  	memset(&ctxt.fpu_ctxt, 0, sizeof(ctxt.fpu_ctxt));
  131.50 @@ -901,7 +896,7 @@ static int __init do_boot_cpu(int apicid
  131.51  		for (va = cpu_gdt_descr[cpu].address, f = 0;
  131.52  		     va < cpu_gdt_descr[cpu].address + cpu_gdt_descr[cpu].size;
  131.53  		     va += PAGE_SIZE, f++) {
  131.54 -			ctxt.gdt_frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
  131.55 +			ctxt.gdt_frames[f] = virt_to_mfn(va);
  131.56  			make_page_readonly((void *)va);
  131.57  		}
  131.58  		ctxt.gdt_ents = cpu_gdt_descr[cpu].size / 8;
  131.59 @@ -917,10 +912,11 @@ static int __init do_boot_cpu(int apicid
  131.60  	ctxt.failsafe_callback_cs  = __KERNEL_CS;
  131.61  	ctxt.failsafe_callback_eip = (unsigned long)failsafe_callback;
  131.62  
  131.63 -	ctxt.ctrlreg[3] = (unsigned long)virt_to_machine(swapper_pg_dir);
  131.64 +	ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
  131.65  
  131.66  	boot_error = HYPERVISOR_boot_vcpu(cpu, &ctxt);
  131.67 -	printk("boot error: %ld\n", boot_error);
  131.68 +	if (boot_error)
  131.69 +		printk("boot error: %ld\n", boot_error);
  131.70  
  131.71  	if (!boot_error) {
  131.72  		/*
  131.73 @@ -1321,15 +1317,128 @@ void __devinit smp_prepare_boot_cpu(void
  131.74  }
  131.75  
  131.76  #ifdef CONFIG_HOTPLUG_CPU
  131.77 -#include <asm-xen/ctrl_if.h>
  131.78 -
  131.79 +#include <asm-xen/xenbus.h>
  131.80  /* hotplug down/up funtion pointer and target vcpu */
  131.81  struct vcpu_hotplug_handler_t {
  131.82 -	void (*fn)(int vcpu);
  131.83 +	void (*fn) (int vcpu);
  131.84  	u32 vcpu;
  131.85  };
  131.86  static struct vcpu_hotplug_handler_t vcpu_hotplug_handler;
  131.87  
  131.88 +static int vcpu_hotplug_cpu_process(void *unused)
  131.89 +{
  131.90 +	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
  131.91 +
  131.92 +	if (handler->fn) {
  131.93 +		(*(handler->fn)) (handler->vcpu);
  131.94 +		handler->fn = NULL;
  131.95 +	}
  131.96 +	return 0;
  131.97 +}
  131.98 +
  131.99 +static void __vcpu_hotplug_handler(void *unused)
 131.100 +{
 131.101 +	int err;
 131.102 +
 131.103 +	err = kernel_thread(vcpu_hotplug_cpu_process,
 131.104 +			    NULL, CLONE_FS | CLONE_FILES);
 131.105 +	if (err < 0)
 131.106 +		printk(KERN_ALERT "Error creating hotplug_cpu process!\n");
 131.107 +}
 131.108 +
 131.109 +static void handle_vcpu_hotplug_event(struct xenbus_watch *, const char *);
 131.110 +static struct notifier_block xsn_cpu;
 131.111 +
 131.112 +/* xenbus watch struct */
 131.113 +static struct xenbus_watch cpu_watch = {
 131.114 +	.node = "cpu",
 131.115 +	.callback = handle_vcpu_hotplug_event
 131.116 +};
 131.117 +
 131.118 +/* NB: Assumes xenbus_lock is held! */
 131.119 +static int setup_cpu_watcher(struct notifier_block *notifier,
 131.120 +			      unsigned long event, void *data)
 131.121 +{
 131.122 +	int err = 0;
 131.123 +
 131.124 +	BUG_ON(down_trylock(&xenbus_lock) == 0);
 131.125 +	err = register_xenbus_watch(&cpu_watch);
 131.126 +
 131.127 +	if (err) {
 131.128 +		printk("Failed to register watch on /cpu\n");
 131.129 +	}
 131.130 +
 131.131 +	return NOTIFY_DONE;
 131.132 +}
 131.133 +
 131.134 +static void handle_vcpu_hotplug_event(struct xenbus_watch *watch, const char *node)
 131.135 +{
 131.136 +	static DECLARE_WORK(vcpu_hotplug_work, __vcpu_hotplug_handler, NULL);
 131.137 +	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
 131.138 +	ssize_t ret;
 131.139 +	int err, cpu;
 131.140 +	char state[8];
 131.141 +	char dir[32];
 131.142 +	char *cpustr;
 131.143 +
 131.144 +	/* get a pointer to start of cpu string */
 131.145 +	if ((cpustr = strstr(node, "cpu/")) != NULL) {
 131.146 +
 131.147 +		/* find which cpu state changed, note vcpu for handler */
 131.148 +		sscanf(cpustr, "cpu/%d", &cpu);
 131.149 +		handler->vcpu = cpu;
 131.150 +
 131.151 +		/* calc the dir for xenbus read */
 131.152 +		sprintf(dir, "cpu/%d", cpu);
 131.153 +
 131.154 +		/* make sure watch that was triggered is changes to the correct key */
 131.155 +		if ((strcmp(node + strlen(dir), "/availability")) != 0)
 131.156 +			return;
 131.157 +
 131.158 +		/* get the state value */
 131.159 +		xenbus_transaction_start("cpu");
 131.160 +		err = xenbus_scanf(dir, "availability", "%s", state);
 131.161 +		xenbus_transaction_end(0);
 131.162 +
 131.163 +		if (err != 1) {
 131.164 +			printk(KERN_ERR
 131.165 +			       "XENBUS: Unable to read cpu state\n");
 131.166 +			return;
 131.167 +		}
 131.168 +
 131.169 +		/* if we detect a state change, take action */
 131.170 +		if (strcmp(state, "online") == 0) {
 131.171 +			/* offline -> online */
 131.172 +			if (!cpu_isset(cpu, cpu_online_map)) {
 131.173 +				handler->fn = (void *)&cpu_up;
 131.174 +				ret = schedule_work(&vcpu_hotplug_work);
 131.175 +			} 
 131.176 +		} else if (strcmp(state, "offline") == 0) {
 131.177 +			/* online -> offline */
 131.178 +			if (cpu_isset(cpu, cpu_online_map)) {
 131.179 +				handler->fn = (void *)&cpu_down;
 131.180 +				ret = schedule_work(&vcpu_hotplug_work);
 131.181 +			} 
 131.182 +		} else {
 131.183 +			printk(KERN_ERR
 131.184 +			       "XENBUS: unknown state(%s) on node(%s)\n", state,
 131.185 +			       node);
 131.186 +		}
 131.187 +	}
 131.188 +	return;
 131.189 +}
 131.190 +
 131.191 +static int __init setup_vcpu_hotplug_event(void)
 131.192 +{
 131.193 +	xsn_cpu.notifier_call = setup_cpu_watcher;
 131.194 +
 131.195 +	register_xenstore_notifier(&xsn_cpu);
 131.196 +
 131.197 +	return 0;
 131.198 +}
 131.199 +
 131.200 +subsys_initcall(setup_vcpu_hotplug_event);
 131.201 +
 131.202  /* must be called with the cpucontrol mutex held */
 131.203  static int __devinit cpu_enable(unsigned int cpu)
 131.204  {
 131.205 @@ -1398,77 +1507,6 @@ void __cpu_die(unsigned int cpu)
 131.206   	printk(KERN_ERR "CPU %u didn't die...\n", cpu);
 131.207  }
 131.208  
 131.209 -static int vcpu_hotplug_cpu_process(void *unused)
 131.210 -{
 131.211 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
 131.212 -
 131.213 -	if (handler->fn) {
 131.214 -		(*(handler->fn))(handler->vcpu);
 131.215 -		handler->fn = NULL;
 131.216 -	}
 131.217 -	return 0;
 131.218 -}
 131.219 -
 131.220 -static void __vcpu_hotplug_handler(void *unused)
 131.221 -{
 131.222 -	int err;
 131.223 -
 131.224 -	err = kernel_thread(vcpu_hotplug_cpu_process, 
 131.225 -			    NULL, CLONE_FS | CLONE_FILES);
 131.226 -	if (err < 0)
 131.227 -		printk(KERN_ALERT "Error creating hotplug_cpu process!\n");
 131.228 -
 131.229 -}
 131.230 -
 131.231 -static void vcpu_hotplug_event_handler(ctrl_msg_t *msg, unsigned long id)
 131.232 -{
 131.233 -	static DECLARE_WORK(vcpu_hotplug_work, __vcpu_hotplug_handler, NULL);
 131.234 -	vcpu_hotplug_t *req = (vcpu_hotplug_t *)&msg->msg[0];
 131.235 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
 131.236 -	ssize_t ret;
 131.237 -
 131.238 -	if (msg->length != sizeof(vcpu_hotplug_t))
 131.239 -		goto parse_error;
 131.240 -
 131.241 -	/* grab target vcpu from msg */
 131.242 -	handler->vcpu = req->vcpu;
 131.243 -
 131.244 -	/* determine which function to call based on msg subtype */
 131.245 -	switch (msg->subtype) {
 131.246 -        case CMSG_VCPU_HOTPLUG_OFF:
 131.247 -		handler->fn = (void *)&cpu_down;
 131.248 -		ret = schedule_work(&vcpu_hotplug_work);
 131.249 -		req->status = (u32) ret;
 131.250 -		break;
 131.251 -        case CMSG_VCPU_HOTPLUG_ON:
 131.252 -		handler->fn = (void *)&cpu_up;
 131.253 -		ret = schedule_work(&vcpu_hotplug_work);
 131.254 -		req->status = (u32) ret;
 131.255 -		break;
 131.256 -        default:
 131.257 -		goto parse_error;
 131.258 -	}
 131.259 -
 131.260 -	ctrl_if_send_response(msg);
 131.261 -	return;
 131.262 - parse_error:
 131.263 -	msg->length = 0;
 131.264 -	ctrl_if_send_response(msg);
 131.265 -}
 131.266 -
 131.267 -static int __init setup_vcpu_hotplug_event(void)
 131.268 -{
 131.269 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
 131.270 -
 131.271 -	handler->fn = NULL;
 131.272 -	ctrl_if_register_receiver(CMSG_VCPU_HOTPLUG,
 131.273 -				  vcpu_hotplug_event_handler, 0);
 131.274 -
 131.275 -	return 0;
 131.276 -}
 131.277 -
 131.278 -__initcall(setup_vcpu_hotplug_event);
 131.279 -
 131.280  #else /* ... !CONFIG_HOTPLUG_CPU */
 131.281  int __cpu_disable(void)
 131.282  {
 131.283 @@ -1529,20 +1567,66 @@ void __init smp_cpus_done(unsigned int m
 131.284  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
 131.285  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
 131.286  
 131.287 -void __init smp_intr_init(void)
 131.288 +void smp_intr_init(void)
 131.289  {
 131.290  	int cpu = smp_processor_id();
 131.291  
 131.292  	per_cpu(resched_irq, cpu) =
 131.293 -		bind_ipi_on_cpu_to_irq(RESCHEDULE_VECTOR);
 131.294 +		bind_ipi_to_irq(RESCHEDULE_VECTOR);
 131.295  	sprintf(resched_name[cpu], "resched%d", cpu);
 131.296  	BUG_ON(request_irq(per_cpu(resched_irq, cpu), smp_reschedule_interrupt,
 131.297  	                   SA_INTERRUPT, resched_name[cpu], NULL));
 131.298  
 131.299  	per_cpu(callfunc_irq, cpu) =
 131.300 -		bind_ipi_on_cpu_to_irq(CALL_FUNCTION_VECTOR);
 131.301 +		bind_ipi_to_irq(CALL_FUNCTION_VECTOR);
 131.302  	sprintf(callfunc_name[cpu], "callfunc%d", cpu);
 131.303  	BUG_ON(request_irq(per_cpu(callfunc_irq, cpu),
 131.304  	                   smp_call_function_interrupt,
 131.305  	                   SA_INTERRUPT, callfunc_name[cpu], NULL));
 131.306  }
 131.307 +
 131.308 +static void smp_intr_exit(void)
 131.309 +{
 131.310 +	int cpu = smp_processor_id();
 131.311 +
 131.312 +	free_irq(per_cpu(resched_irq, cpu), NULL);
 131.313 +	unbind_ipi_from_irq(RESCHEDULE_VECTOR);
 131.314 +
 131.315 +	free_irq(per_cpu(callfunc_irq, cpu), NULL);
 131.316 +	unbind_ipi_from_irq(CALL_FUNCTION_VECTOR);
 131.317 +}
 131.318 +
 131.319 +extern void local_setup_timer_irq(void);
 131.320 +extern void local_teardown_timer_irq(void);
 131.321 +
 131.322 +void smp_suspend(void)
 131.323 +{
 131.324 +	/* XXX todo: take down time and ipi's on all cpus */
 131.325 +	local_teardown_timer_irq();
 131.326 +	smp_intr_exit();
 131.327 +}
 131.328 +
 131.329 +void smp_resume(void)
 131.330 +{
 131.331 +	/* XXX todo: restore time and ipi's on all cpus */
 131.332 +	smp_intr_init();
 131.333 +	local_setup_timer_irq();
 131.334 +}
 131.335 +
 131.336 +DECLARE_PER_CPU(int, timer_irq);
 131.337 +
 131.338 +void _restore_vcpu(void)
 131.339 +{
 131.340 +	int cpu = smp_processor_id();
 131.341 +	extern atomic_t vcpus_rebooting;
 131.342 +
 131.343 +	/* We are the first thing the vcpu runs when it comes back,
 131.344 +	   and we are supposed to restore the IPIs and timer
 131.345 +	   interrupts etc.  When we return, the vcpu's idle loop will
 131.346 +	   start up again. */
 131.347 +	_bind_virq_to_irq(VIRQ_TIMER, cpu, per_cpu(timer_irq, cpu));
 131.348 +	_bind_virq_to_irq(VIRQ_DEBUG, cpu, per_cpu(ldebug_irq, cpu));
 131.349 +	_bind_ipi_to_irq(RESCHEDULE_VECTOR, cpu, per_cpu(resched_irq, cpu) );
 131.350 +	_bind_ipi_to_irq(CALL_FUNCTION_VECTOR, cpu, per_cpu(callfunc_irq, cpu) );
 131.351 +	atomic_dec(&vcpus_rebooting);
 131.352 +}
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Thu Aug 25 15:53:20 2005 -0700
   132.3 @@ -0,0 +1,660 @@
   132.4 +/*
   132.5 + * Dynamic DMA mapping support.
   132.6 + *
   132.7 + * This implementation is a fallback for platforms that do not support
   132.8 + * I/O TLBs (aka DMA address translation hardware).
   132.9 + * Copyright (C) 2000 Asit Mallick <Asit.K.Mallick@intel.com>
  132.10 + * Copyright (C) 2000 Goutham Rao <goutham.rao@intel.com>
  132.11 + * Copyright (C) 2000, 2003 Hewlett-Packard Co
  132.12 + *	David Mosberger-Tang <davidm@hpl.hp.com>
  132.13 + * Copyright (C) 2005 Keir Fraser <keir@xensource.com>
  132.14 + */
  132.15 +
  132.16 +#include <linux/cache.h>
  132.17 +#include <linux/mm.h>
  132.18 +#include <linux/module.h>
  132.19 +#include <linux/pci.h>
  132.20 +#include <linux/spinlock.h>
  132.21 +#include <linux/string.h>
  132.22 +#include <linux/types.h>
  132.23 +#include <linux/ctype.h>
  132.24 +#include <linux/init.h>
  132.25 +#include <linux/bootmem.h>
  132.26 +#include <linux/highmem.h>
  132.27 +#include <asm/io.h>
  132.28 +#include <asm/pci.h>
  132.29 +#include <asm/dma.h>
  132.30 +
  132.31 +#define OFFSET(val,align) ((unsigned long)((val) & ( (align) - 1)))
  132.32 +
  132.33 +#define SG_ENT_PHYS_ADDRESS(sg)	(page_to_phys((sg)->page) + (sg)->offset)
  132.34 +
  132.35 +/*
  132.36 + * Maximum allowable number of contiguous slabs to map,
  132.37 + * must be a power of 2.  What is the appropriate value ?
  132.38 + * The complexity of {map,unmap}_single is linearly dependent on this value.
  132.39 + */
  132.40 +#define IO_TLB_SEGSIZE	128
  132.41 +
  132.42 +/*
  132.43 + * log of the size of each IO TLB slab.  The number of slabs is command line
  132.44 + * controllable.
  132.45 + */
  132.46 +#define IO_TLB_SHIFT 11
  132.47 +
  132.48 +int swiotlb_force;
  132.49 +static char *iotlb_virt_start;
  132.50 +static unsigned long iotlb_nslabs;
  132.51 +
  132.52 +/*
  132.53 + * Used to do a quick range check in swiotlb_unmap_single and
  132.54 + * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
  132.55 + * API.
  132.56 + */
  132.57 +static dma_addr_t iotlb_bus_start, iotlb_bus_mask;
  132.58 +
  132.59 +/* Does the given dma address reside within the swiotlb aperture? */
  132.60 +#define in_swiotlb_aperture(a) (!(((a) ^ iotlb_bus_start) & iotlb_bus_mask))
  132.61 +
  132.62 +/*
  132.63 + * When the IOMMU overflows we return a fallback buffer. This sets the size.
  132.64 + */
  132.65 +static unsigned long io_tlb_overflow = 32*1024;
  132.66 +
  132.67 +void *io_tlb_overflow_buffer;
  132.68 +
  132.69 +/*
  132.70 + * This is a free list describing the number of free entries available from
  132.71 + * each index
  132.72 + */
  132.73 +static unsigned int *io_tlb_list;
  132.74 +static unsigned int io_tlb_index;
  132.75 +
  132.76 +/*
  132.77 + * We need to save away the original address corresponding to a mapped entry
  132.78 + * for the sync operations.
  132.79 + */
  132.80 +static struct phys_addr {
  132.81 +	struct page *page;
  132.82 +	unsigned int offset;
  132.83 +} *io_tlb_orig_addr;
  132.84 +
  132.85 +/*
  132.86 + * Protect the above data structures in the map and unmap calls
  132.87 + */
  132.88 +static DEFINE_SPINLOCK(io_tlb_lock);
  132.89 +
  132.90 +static int __init
  132.91 +setup_io_tlb_npages(char *str)
  132.92 +{
  132.93 +	/* Unlike ia64, the size is aperture in megabytes, not 'slabs'! */
  132.94 +	if (isdigit(*str)) {
  132.95 +		iotlb_nslabs = simple_strtoul(str, &str, 0) <<
  132.96 +			(20 - IO_TLB_SHIFT);
  132.97 +		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
  132.98 +		/* Round up to power of two (xen_create_contiguous_region). */
  132.99 +		while (iotlb_nslabs & (iotlb_nslabs-1))
 132.100 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
 132.101 +	}
 132.102 +	if (*str == ',')
 132.103 +		++str;
 132.104 +	/*
 132.105 +         * NB. 'force' enables the swiotlb, but doesn't force its use for
 132.106 +         * every DMA like it does on native Linux.
 132.107 +         */
 132.108 +	if (!strcmp(str, "force"))
 132.109 +		swiotlb_force = 1;
 132.110 +	return 1;
 132.111 +}
 132.112 +__setup("swiotlb=", setup_io_tlb_npages);
 132.113 +/* make io_tlb_overflow tunable too? */
 132.114 +
 132.115 +/*
 132.116 + * Statically reserve bounce buffer space and initialize bounce buffer data
 132.117 + * structures for the software IO TLB used to implement the PCI DMA API.
 132.118 + */
 132.119 +void
 132.120 +swiotlb_init_with_default_size (size_t default_size)
 132.121 +{
 132.122 +	unsigned long i, bytes;
 132.123 +
 132.124 +	if (!iotlb_nslabs) {
 132.125 +		iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
 132.126 +		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
 132.127 +		/* Round up to power of two (xen_create_contiguous_region). */
 132.128 +		while (iotlb_nslabs & (iotlb_nslabs-1))
 132.129 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
 132.130 +	}
 132.131 +
 132.132 +	bytes = iotlb_nslabs * (1UL << IO_TLB_SHIFT);
 132.133 +
 132.134 +	/*
 132.135 +	 * Get IO TLB memory from the low pages
 132.136 +	 */
 132.137 +	iotlb_virt_start = alloc_bootmem_low_pages(bytes);
 132.138 +	if (!iotlb_virt_start)
 132.139 +		panic("Cannot allocate SWIOTLB buffer!\n"
 132.140 +		      "Use dom0_mem Xen boot parameter to reserve\n"
 132.141 +		      "some DMA memory (e.g., dom0_mem=-128M).\n");
 132.142 +
 132.143 +	xen_create_contiguous_region(
 132.144 +		(unsigned long)iotlb_virt_start, get_order(bytes));
 132.145 +
 132.146 +	/*
 132.147 +	 * Allocate and initialize the free list array.  This array is used
 132.148 +	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE.
 132.149 +	 */
 132.150 +	io_tlb_list = alloc_bootmem(iotlb_nslabs * sizeof(int));
 132.151 +	for (i = 0; i < iotlb_nslabs; i++)
 132.152 + 		io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
 132.153 +	io_tlb_index = 0;
 132.154 +	io_tlb_orig_addr = alloc_bootmem(
 132.155 +		iotlb_nslabs * sizeof(*io_tlb_orig_addr));
 132.156 +
 132.157 +	/*
 132.158 +	 * Get the overflow emergency buffer
 132.159 +	 */
 132.160 +	io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
 132.161 +
 132.162 +	iotlb_bus_start = virt_to_bus(iotlb_virt_start);
 132.163 +	iotlb_bus_mask  = ~(dma_addr_t)(bytes - 1);
 132.164 +
 132.165 +	printk(KERN_INFO "Software IO TLB enabled: \n"
 132.166 +	       " Aperture:     %lu megabytes\n"
 132.167 +	       " Bus range:    0x%016lx - 0x%016lx\n"
 132.168 +	       " Kernel range: 0x%016lx - 0x%016lx\n",
 132.169 +	       bytes >> 20,
 132.170 +	       (unsigned long)iotlb_bus_start,
 132.171 +	       (unsigned long)iotlb_bus_start + bytes,
 132.172 +	       (unsigned long)iotlb_virt_start,
 132.173 +	       (unsigned long)iotlb_virt_start + bytes);
 132.174 +}
 132.175 +
 132.176 +void
 132.177 +swiotlb_init(void)
 132.178 +{
 132.179 +	/* The user can forcibly enable swiotlb. */
 132.180 +	if (swiotlb_force)
 132.181 +		swiotlb = 1;
 132.182 +
 132.183 +	/*
 132.184 +         * Otherwise, enable for domain 0 if the machine has 'lots of memory',
 132.185 +         * which we take to mean more than 2GB.
 132.186 +         */
 132.187 +	if (xen_start_info.flags & SIF_INITDOMAIN) {
 132.188 +		dom0_op_t op;
 132.189 +		op.cmd = DOM0_PHYSINFO;
 132.190 +		if ((HYPERVISOR_dom0_op(&op) == 0) &&
 132.191 +		    (op.u.physinfo.total_pages > 0x7ffff))
 132.192 +			swiotlb = 1;
 132.193 +	}
 132.194 +
 132.195 +	if (swiotlb)
 132.196 +		swiotlb_init_with_default_size(64 * (1<<20));
 132.197 +}
 132.198 +
 132.199 +static void
 132.200 +__sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir)
 132.201 +{
 132.202 +	if (PageHighMem(buffer.page)) {
 132.203 +		size_t len, bytes;
 132.204 +		char *dev, *host, *kmp;
 132.205 +		len = size;
 132.206 +		while (len != 0) {
 132.207 +			if (((bytes = len) + buffer.offset) > PAGE_SIZE)
 132.208 +				bytes = PAGE_SIZE - buffer.offset;
 132.209 +			kmp  = kmap_atomic(buffer.page, KM_SWIOTLB);
 132.210 +			dev  = dma_addr + size - len;
 132.211 +			host = kmp + buffer.offset;
 132.212 +			memcpy((dir == DMA_FROM_DEVICE) ? host : dev,
 132.213 +			       (dir == DMA_FROM_DEVICE) ? dev : host,
 132.214 +			       bytes);
 132.215 +			kunmap_atomic(kmp, KM_SWIOTLB);
 132.216 +			len -= bytes;
 132.217 +			buffer.page++;
 132.218 +			buffer.offset = 0;
 132.219 +		}
 132.220 +	} else {
 132.221 +		char *host = (char *)phys_to_virt(
 132.222 +			page_to_pseudophys(buffer.page)) + buffer.offset;
 132.223 +		if (dir == DMA_FROM_DEVICE)
 132.224 +			memcpy(host, dma_addr, size);
 132.225 +		else if (dir == DMA_TO_DEVICE)
 132.226 +			memcpy(dma_addr, host, size);
 132.227 +	}
 132.228 +}
 132.229 +
 132.230 +/*
 132.231 + * Allocates bounce buffer and returns its kernel virtual address.
 132.232 + */
 132.233 +static void *
 132.234 +map_single(struct device *hwdev, struct phys_addr buffer, size_t size, int dir)
 132.235 +{
 132.236 +	unsigned long flags;
 132.237 +	char *dma_addr;
 132.238 +	unsigned int nslots, stride, index, wrap;
 132.239 +	int i;
 132.240 +
 132.241 +	/*
 132.242 +	 * For mappings greater than a page, we limit the stride (and
 132.243 +	 * hence alignment) to a page size.
 132.244 +	 */
 132.245 +	nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
 132.246 +	if (size > PAGE_SIZE)
 132.247 +		stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
 132.248 +	else
 132.249 +		stride = 1;
 132.250 +
 132.251 +	BUG_ON(!nslots);
 132.252 +
 132.253 +	/*
 132.254 +	 * Find suitable number of IO TLB entries size that will fit this
 132.255 +	 * request and allocate a buffer from that IO TLB pool.
 132.256 +	 */
 132.257 +	spin_lock_irqsave(&io_tlb_lock, flags);
 132.258 +	{
 132.259 +		wrap = index = ALIGN(io_tlb_index, stride);
 132.260 +
 132.261 +		if (index >= iotlb_nslabs)
 132.262 +			wrap = index = 0;
 132.263 +
 132.264 +		do {
 132.265 +			/*
 132.266 +			 * If we find a slot that indicates we have 'nslots'
 132.267 +			 * number of contiguous buffers, we allocate the
 132.268 +			 * buffers from that slot and mark the entries as '0'
 132.269 +			 * indicating unavailable.
 132.270 +			 */
 132.271 +			if (io_tlb_list[index] >= nslots) {
 132.272 +				int count = 0;
 132.273 +
 132.274 +				for (i = index; i < (int)(index + nslots); i++)
 132.275 +					io_tlb_list[i] = 0;
 132.276 +				for (i = index - 1;
 132.277 +				     (OFFSET(i, IO_TLB_SEGSIZE) !=
 132.278 +				      IO_TLB_SEGSIZE -1) && io_tlb_list[i];
 132.279 +				     i--)
 132.280 +					io_tlb_list[i] = ++count;
 132.281 +				dma_addr = iotlb_virt_start +
 132.282 +					(index << IO_TLB_SHIFT);
 132.283 +
 132.284 +				/*
 132.285 +				 * Update the indices to avoid searching in
 132.286 +				 * the next round.
 132.287 +				 */
 132.288 +				io_tlb_index = 
 132.289 +					((index + nslots) < iotlb_nslabs
 132.290 +					 ? (index + nslots) : 0);
 132.291 +
 132.292 +				goto found;
 132.293 +			}
 132.294 +			index += stride;
 132.295 +			if (index >= iotlb_nslabs)
 132.296 +				index = 0;
 132.297 +		} while (index != wrap);
 132.298 +
 132.299 +		spin_unlock_irqrestore(&io_tlb_lock, flags);
 132.300 +		return NULL;
 132.301 +	}
 132.302 +  found:
 132.303 +	spin_unlock_irqrestore(&io_tlb_lock, flags);
 132.304 +
 132.305 +	/*
 132.306 +	 * Save away the mapping from the original address to the DMA address.
 132.307 +	 * This is needed when we sync the memory.  Then we sync the buffer if
 132.308 +	 * needed.
 132.309 +	 */
 132.310 +	io_tlb_orig_addr[index] = buffer;
 132.311 +	if ((dir == DMA_TO_DEVICE) || (dir == DMA_BIDIRECTIONAL))
 132.312 +		__sync_single(buffer, dma_addr, size, DMA_TO_DEVICE);
 132.313 +
 132.314 +	return dma_addr;
 132.315 +}
 132.316 +
 132.317 +/*
 132.318 + * dma_addr is the kernel virtual address of the bounce buffer to unmap.
 132.319 + */
 132.320 +static void
 132.321 +unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
 132.322 +{
 132.323 +	unsigned long flags;
 132.324 +	int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
 132.325 +	int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
 132.326 +	struct phys_addr buffer = io_tlb_orig_addr[index];
 132.327 +
 132.328 +	/*
 132.329 +	 * First, sync the memory before unmapping the entry
 132.330 +	 */
 132.331 +	if ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))
 132.332 +		__sync_single(buffer, dma_addr, size, DMA_FROM_DEVICE);
 132.333 +
 132.334 +	/*
 132.335 +	 * Return the buffer to the free list by setting the corresponding
 132.336 +	 * entries to indicate the number of contigous entries available.
 132.337 +	 * While returning the entries to the free list, we merge the entries
 132.338 +	 * with slots below and above the pool being returned.
 132.339 +	 */
 132.340 +	spin_lock_irqsave(&io_tlb_lock, flags);
 132.341 +	{
 132.342 +		count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ?
 132.343 +			 io_tlb_list[index + nslots] : 0);
 132.344 +		/*
 132.345 +		 * Step 1: return the slots to the free list, merging the
 132.346 +		 * slots with superceeding slots
 132.347 +		 */
 132.348 +		for (i = index + nslots - 1; i >= index; i--)
 132.349 +			io_tlb_list[i] = ++count;
 132.350 +		/*
 132.351 +		 * Step 2: merge the returned slots with the preceding slots,
 132.352 +		 * if available (non zero)
 132.353 +		 */
 132.354 +		for (i = index - 1;
 132.355 +		     (OFFSET(i, IO_TLB_SEGSIZE) !=
 132.356 +		      IO_TLB_SEGSIZE -1) && io_tlb_list[i];
 132.357 +		     i--)
 132.358 +			io_tlb_list[i] = ++count;
 132.359 +	}
 132.360 +	spin_unlock_irqrestore(&io_tlb_lock, flags);
 132.361 +}
 132.362 +
 132.363 +static void
 132.364 +sync_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
 132.365 +{
 132.366 +	int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
 132.367 +	struct phys_addr buffer = io_tlb_orig_addr[index];
 132.368 +	BUG_ON((dir != DMA_FROM_DEVICE) && (dir != DMA_TO_DEVICE));
 132.369 +	__sync_single(buffer, dma_addr, size, dir);
 132.370 +}
 132.371 +
 132.372 +static void
 132.373 +swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
 132.374 +{
 132.375 +	/*
 132.376 +	 * Ran out of IOMMU space for this operation. This is very bad.
 132.377 +	 * Unfortunately the drivers cannot handle this operation properly.
 132.378 +	 * unless they check for pci_dma_mapping_error (most don't)
 132.379 +	 * When the mapping is small enough return a static buffer to limit
 132.380 +	 * the damage, or panic when the transfer is too big.
 132.381 +	 */
 132.382 +	printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
 132.383 +	       "device %s\n", (unsigned long)size, dev ? dev->bus_id : "?");
 132.384 +
 132.385 +	if (size > io_tlb_overflow && do_panic) {
 132.386 +		if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
 132.387 +			panic("PCI-DMA: Memory would be corrupted\n");
 132.388 +		if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL)
 132.389 +			panic("PCI-DMA: Random memory would be DMAed\n");
 132.390 +	}
 132.391 +}
 132.392 +
 132.393 +/*
 132.394 + * Map a single buffer of the indicated size for DMA in streaming mode.  The
 132.395 + * PCI address to use is returned.
 132.396 + *
 132.397 + * Once the device is given the dma address, the device owns this memory until
 132.398 + * either swiotlb_unmap_single or swiotlb_dma_sync_single is performed.
 132.399 + */
 132.400 +dma_addr_t
 132.401 +swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
 132.402 +{
 132.403 +	dma_addr_t dev_addr = virt_to_bus(ptr);
 132.404 +	void *map;
 132.405 +	struct phys_addr buffer;
 132.406 +
 132.407 +	BUG_ON(dir == DMA_NONE);
 132.408 +
 132.409 +	/*
 132.410 +	 * If the pointer passed in happens to be in the device's DMA window,
 132.411 +	 * we can safely return the device addr and not worry about bounce
 132.412 +	 * buffering it.
 132.413 +	 */
 132.414 +	if (!range_straddles_page_boundary(ptr, size) &&
 132.415 +	    !address_needs_mapping(hwdev, dev_addr))
 132.416 +		return dev_addr;
 132.417 +
 132.418 +	/*
 132.419 +	 * Oh well, have to allocate and map a bounce buffer.
 132.420 +	 */
 132.421 +	buffer.page   = virt_to_page(ptr);
 132.422 +	buffer.offset = (unsigned long)ptr & ~PAGE_MASK;
 132.423 +	map = map_single(hwdev, buffer, size, dir);
 132.424 +	if (!map) {
 132.425 +		swiotlb_full(hwdev, size, dir, 1);
 132.426 +		map = io_tlb_overflow_buffer;
 132.427 +	}
 132.428 +
 132.429 +	dev_addr = virt_to_bus(map);
 132.430 +
 132.431 +	/*
 132.432 +	 * Ensure that the address returned is DMA'ble
 132.433 +	 */
 132.434 +	if (address_needs_mapping(hwdev, dev_addr))
 132.435 +		panic("map_single: bounce buffer is not DMA'ble");
 132.436 +
 132.437 +	return dev_addr;
 132.438 +}
 132.439 +
 132.440 +/*
 132.441 + * Unmap a single streaming mode DMA translation.  The dma_addr and size must
 132.442 + * match what was provided for in a previous swiotlb_map_single call.  All
 132.443 + * other usages are undefined.
 132.444 + *
 132.445 + * After this call, reads by the cpu to the buffer are guaranteed to see
 132.446 + * whatever the device wrote there.
 132.447 + */
 132.448 +void
 132.449 +swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size,
 132.450 +		     int dir)
 132.451 +{
 132.452 +	BUG_ON(dir == DMA_NONE);
 132.453 +	if (in_swiotlb_aperture(dev_addr))
 132.454 +		unmap_single(hwdev, bus_to_virt(dev_addr), size, dir);
 132.455 +}
 132.456 +
 132.457 +/*
 132.458 + * Make physical memory consistent for a single streaming mode DMA translation
 132.459 + * after a transfer.
 132.460 + *
 132.461 + * If you perform a swiotlb_map_single() but wish to interrogate the buffer
 132.462 + * using the cpu, yet do not wish to teardown the PCI dma mapping, you must
 132.463 + * call this function before doing so.  At the next point you give the PCI dma
 132.464 + * address back to the card, you must first perform a
 132.465 + * swiotlb_dma_sync_for_device, and then the device again owns the buffer
 132.466 + */
 132.467 +void
 132.468 +swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
 132.469 +			    size_t size, int dir)
 132.470 +{
 132.471 +	BUG_ON(dir == DMA_NONE);
 132.472 +	if (in_swiotlb_aperture(dev_addr))
 132.473 +		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
 132.474 +}
 132.475 +
 132.476 +void
 132.477 +swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
 132.478 +			       size_t size, int dir)
 132.479 +{
 132.480 +	BUG_ON(dir == DMA_NONE);
 132.481 +	if (in_swiotlb_aperture(dev_addr))
 132.482 +		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
 132.483 +}
 132.484 +
 132.485 +/*
 132.486 + * Map a set of buffers described by scatterlist in streaming mode for DMA.
 132.487 + * This is the scatter-gather version of the above swiotlb_map_single
 132.488 + * interface.  Here the scatter gather list elements are each tagged with the
 132.489 + * appropriate dma address and length.  They are obtained via
 132.490 + * sg_dma_{address,length}(SG).
 132.491 + *
 132.492 + * NOTE: An implementation may be able to use a smaller number of
 132.493 + *       DMA address/length pairs than there are SG table elements.
 132.494 + *       (for example via virtual mapping capabilities)
 132.495 + *       The routine returns the number of addr/length pairs actually
 132.496 + *       used, at most nents.
 132.497 + *
 132.498 + * Device ownership issues as mentioned above for swiotlb_map_single are the
 132.499 + * same here.
 132.500 + */
 132.501 +int
 132.502 +swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
 132.503 +	       int dir)
 132.504 +{
 132.505 +	struct phys_addr buffer;
 132.506 +	dma_addr_t dev_addr;
 132.507 +	char *map;
 132.508 +	int i;
 132.509 +
 132.510 +	BUG_ON(dir == DMA_NONE);
 132.511 +
 132.512 +	for (i = 0; i < nelems; i++, sg++) {
 132.513 +		dev_addr = SG_ENT_PHYS_ADDRESS(sg);
 132.514 +		if (address_needs_mapping(hwdev, dev_addr)) {
 132.515 +			buffer.page   = sg->page;
 132.516 +			buffer.offset = sg->offset;
 132.517 +			map = map_single(hwdev, buffer, sg->length, dir);
 132.518 +			if (!map) {
 132.519 +				/* Don't panic here, we expect map_sg users
 132.520 +				   to do proper error handling. */
 132.521 +				swiotlb_full(hwdev, sg->length, dir, 0);
 132.522 +				swiotlb_unmap_sg(hwdev, sg - i, i, dir);
 132.523 +				sg[0].dma_length = 0;
 132.524 +				return 0;
 132.525 +			}
 132.526 +			sg->dma_address = (dma_addr_t)virt_to_bus(map);
 132.527 +		} else
 132.528 +			sg->dma_address = dev_addr;
 132.529 +		sg->dma_length = sg->length;
 132.530 +	}
 132.531 +	return nelems;
 132.532 +}
 132.533 +
 132.534 +/*
 132.535 + * Unmap a set of streaming mode DMA translations.  Again, cpu read rules
 132.536 + * concerning calls here are the same as for swiotlb_unmap_single() above.
 132.537 + */
 132.538 +void
 132.539 +swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
 132.540 +		 int dir)
 132.541 +{
 132.542 +	int i;
 132.543 +
 132.544 +	BUG_ON(dir == DMA_NONE);
 132.545 +
 132.546 +	for (i = 0; i < nelems; i++, sg++)
 132.547 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
 132.548 +			unmap_single(hwdev, 
 132.549 +				     (void *)bus_to_virt(sg->dma_address),
 132.550 +				     sg->dma_length, dir);
 132.551 +}
 132.552 +
 132.553 +/*
 132.554 + * Make physical memory consistent for a set of streaming mode DMA translations
 132.555 + * after a transfer.
 132.556 + *
 132.557 + * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules
 132.558 + * and usage.
 132.559 + */
 132.560 +void
 132.561 +swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
 132.562 +			int nelems, int dir)
 132.563 +{
 132.564 +	int i;
 132.565 +
 132.566 +	BUG_ON(dir == DMA_NONE);
 132.567 +
 132.568 +	for (i = 0; i < nelems; i++, sg++)
 132.569 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
 132.570 +			sync_single(hwdev,
 132.571 +				    (void *)bus_to_virt(sg->dma_address),
 132.572 +				    sg->dma_length, dir);
 132.573 +}
 132.574 +
 132.575 +void
 132.576 +swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
 132.577 +			   int nelems, int dir)
 132.578 +{
 132.579 +	int i;
 132.580 +
 132.581 +	BUG_ON(dir == DMA_NONE);
 132.582 +
 132.583 +	for (i = 0; i < nelems; i++, sg++)
 132.584 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
 132.585 +			sync_single(hwdev,
 132.586 +				    (void *)bus_to_virt(sg->dma_address),
 132.587 +				    sg->dma_length, dir);
 132.588 +}
 132.589 +
 132.590 +dma_addr_t
 132.591 +swiotlb_map_page(struct device *hwdev, struct page *page,
 132.592 +		 unsigned long offset, size_t size,
 132.593 +		 enum dma_data_direction direction)
 132.594 +{
 132.595 +	struct phys_addr buffer;
 132.596 +	dma_addr_t dev_addr;
 132.597 +	char *map;
 132.598 +
 132.599 +	dev_addr = page_to_phys(page) + offset;
 132.600 +	if (address_needs_mapping(hwdev, dev_addr)) {
 132.601 +		buffer.page   = page;
 132.602 +		buffer.offset = offset;
 132.603 +		map = map_single(hwdev, buffer, size, direction);
 132.604 +		if (!map) {
 132.605 +			swiotlb_full(hwdev, size, direction, 1);
 132.606 +			map = io_tlb_overflow_buffer;
 132.607 +		}
 132.608 +		dev_addr = (dma_addr_t)virt_to_bus(map);
 132.609 +	}
 132.610 +
 132.611 +	return dev_addr;
 132.612 +}
 132.613 +
 132.614 +void
 132.615 +swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address,
 132.616 +		   size_t size, enum dma_data_direction direction)
 132.617 +{
 132.618 +	BUG_ON(direction == DMA_NONE);
 132.619 +	if (in_swiotlb_aperture(dma_address))
 132.620 +		unmap_single(hwdev, bus_to_virt(dma_address), size, direction);
 132.621 +}
 132.622 +
 132.623 +int
 132.624 +swiotlb_dma_mapping_error(dma_addr_t dma_addr)
 132.625 +{
 132.626 +	return (dma_addr == virt_to_bus(io_tlb_overflow_buffer));
 132.627 +}
 132.628 +
 132.629 +/*
 132.630 + * Return whether the given PCI device DMA address mask can be supported
 132.631 + * properly.  For example, if your device can only drive the low 24-bits
 132.632 + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to
 132.633 + * this function.
 132.634 + */
 132.635 +int
 132.636 +swiotlb_dma_supported (struct device *hwdev, u64 mask)
 132.637 +{
 132.638 +	return (mask >= 0xffffffffUL);
 132.639 +}
 132.640 +
 132.641 +EXPORT_SYMBOL(swiotlb_init);
 132.642 +EXPORT_SYMBOL(swiotlb_map_single);
 132.643 +EXPORT_SYMBOL(swiotlb_unmap_single);
 132.644 +EXPORT_SYMBOL(swiotlb_map_sg);
 132.645 +EXPORT_SYMBOL(swiotlb_unmap_sg);
 132.646 +EXPORT_SYMBOL(swiotlb_sync_single_for_cpu);
 132.647 +EXPORT_SYMBOL(swiotlb_sync_single_for_device);
 132.648 +EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu);
 132.649 +EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
 132.650 +EXPORT_SYMBOL(swiotlb_map_page);
 132.651 +EXPORT_SYMBOL(swiotlb_unmap_page);
 132.652 +EXPORT_SYMBOL(swiotlb_dma_mapping_error);
 132.653 +EXPORT_SYMBOL(swiotlb_dma_supported);
 132.654 +
 132.655 +/*
 132.656 + * Local variables:
 132.657 + *  c-file-style: "linux"
 132.658 + *  indent-tabs-mode: t
 132.659 + *  c-indent-level: 8
 132.660 + *  c-basic-offset: 8
 132.661 + *  tab-width: 8
 132.662 + * End:
 132.663 + */
   133.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Tue Aug 23 18:43:18 2005 -0800
   133.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Thu Aug 25 15:53:20 2005 -0700
   133.3 @@ -70,6 +70,8 @@
   133.4  
   133.5  #include "io_ports.h"
   133.6  
   133.7 +#include <asm-xen/evtchn.h>
   133.8 +
   133.9  extern spinlock_t i8259A_lock;
  133.10  int pit_latch_buggy;              /* extern */
  133.11  
  133.12 @@ -113,26 +115,15 @@ struct shadow_time_info {
  133.13  	u32 version;
  133.14  };
  133.15  static DEFINE_PER_CPU(struct shadow_time_info, shadow_time);
  133.16 -static struct timeval shadow_tv;
  133.17 +static struct timespec shadow_tv;
  133.18 +static u32 shadow_tv_version;
  133.19  
  133.20  /* Keep track of last time we did processing/updating of jiffies and xtime. */
  133.21  static u64 processed_system_time;   /* System time (ns) at last processing. */
  133.22  static DEFINE_PER_CPU(u64, processed_system_time);
  133.23  
  133.24 -#define NS_PER_TICK (1000000000ULL/HZ)
  133.25 +#define NS_PER_TICK (1000000000L/HZ)
  133.26  
  133.27 -#define HANDLE_USEC_UNDERFLOW(_tv) do {		\
  133.28 -	while ((_tv).tv_usec < 0) {		\
  133.29 -		(_tv).tv_usec += USEC_PER_SEC;	\
  133.30 -		(_tv).tv_sec--;			\
  133.31 -	}					\
  133.32 -} while (0)
  133.33 -#define HANDLE_USEC_OVERFLOW(_tv) do {		\
  133.34 -	while ((_tv).tv_usec >= USEC_PER_SEC) {	\
  133.35 -		(_tv).tv_usec -= USEC_PER_SEC;	\
  133.36 -		(_tv).tv_sec++;			\
  133.37 -	}					\
  133.38 -} while (0)
  133.39  static inline void __normalize_time(time_t *sec, s64 *nsec)
  133.40  {
  133.41  	while (*nsec >= NSEC_PER_SEC) {
  133.42 @@ -153,8 +144,6 @@ static int __init __independent_wallcloc
  133.43  	return 1;
  133.44  }
  133.45  __setup("independent_wallclock", __independent_wallclock);
  133.46 -#define INDEPENDENT_WALLCLOCK() \
  133.47 -    (independent_wallclock || (xen_start_info.flags & SIF_INITDOMAIN))
  133.48  
  133.49  int tsc_disable __initdata = 0;
  133.50  
  133.51 @@ -175,25 +164,40 @@ struct timer_opts timer_tsc = {
  133.52  	.delay = delay_tsc,
  133.53  };
  133.54  
  133.55 -static inline u32 down_shift(u64 time, int shift)
  133.56 +/*
  133.57 + * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
  133.58 + * yielding a 64-bit result.
  133.59 + */
  133.60 +static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
  133.61  {
  133.62 +	u64 product;
  133.63 +#ifdef __i386__
  133.64 +	u32 tmp1, tmp2;
  133.65 +#endif
  133.66 +
  133.67  	if ( shift < 0 )
  133.68 -		return (u32)(time >> -shift);
  133.69 -	return (u32)((u32)time << shift);
  133.70 -}
  133.71 +		delta >>= -shift;
  133.72 +	else
  133.73 +		delta <<= shift;
  133.74  
  133.75 -/*
  133.76 - * 32-bit multiplication of integer multiplicand and fractional multiplier
  133.77 - * yielding 32-bit integer product.
  133.78 - */
  133.79 -static inline u32 mul_frac(u32 multiplicand, u32 multiplier)
  133.80 -{
  133.81 -	u32 product_int, product_frac;
  133.82 +#ifdef __i386__
  133.83  	__asm__ (
  133.84 -		"mul %3"
  133.85 -		: "=a" (product_frac), "=d" (product_int)
  133.86 -		: "0" (multiplicand), "r" (multiplier) );
  133.87 -	return product_int;
  133.88 +		"mul  %5       ; "
  133.89 +		"mov  %4,%%eax ; "
  133.90 +		"mov  %%edx,%4 ; "
  133.91 +		"mul  %5       ; "
  133.92 +		"add  %4,%%eax ; "
  133.93 +		"xor  %5,%5    ; "
  133.94 +		"adc  %5,%%edx ; "
  133.95 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
  133.96 +		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
  133.97 +#else
  133.98 +	__asm__ (
  133.99 +		"mul %%rdx ; shrd $32,%%rdx,%%rax"
 133.100 +		: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
 133.101 +#endif
 133.102 +
 133.103 +	return product;
 133.104  }
 133.105  
 133.106  void init_cpu_khz(void)
 133.107 @@ -201,55 +205,43 @@ void init_cpu_khz(void)
 133.108  	u64 __cpu_khz = 1000000ULL << 32;
 133.109  	struct vcpu_time_info *info = &HYPERVISOR_shared_info->vcpu_time[0];
 133.110  	do_div(__cpu_khz, info->tsc_to_system_mul);
 133.111 -	cpu_khz = down_shift(__cpu_khz, -info->tsc_shift);
 133.112 -	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n",
 133.113 -	       cpu_khz / 1000, cpu_khz % 1000);
 133.114 +	if ( info->tsc_shift < 0 )
 133.115 +		cpu_khz = __cpu_khz << -info->tsc_shift;
 133.116 +	else
 133.117 +		cpu_khz = __cpu_khz >> info->tsc_shift;
 133.118  }
 133.119  
 133.120  static u64 get_nsec_offset(struct shadow_time_info *shadow)
 133.121  {
 133.122 -	u64 now;
 133.123 -	u32 delta;
 133.124 +	u64 now, delta;
 133.125  	rdtscll(now);
 133.126 -	delta = down_shift(now - shadow->tsc_timestamp, shadow->tsc_shift);
 133.127 -	return mul_frac(delta, shadow->tsc_to_nsec_mul);
 133.128 +	delta = now - shadow->tsc_timestamp;
 133.129 +	return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
 133.130  }
 133.131  
 133.132  static unsigned long get_usec_offset(struct shadow_time_info *shadow)
 133.133  {
 133.134 -	u64 now;
 133.135 -	u32 delta;
 133.136 +	u64 now, delta;
 133.137  	rdtscll(now);
 133.138 -	delta = down_shift(now - shadow->tsc_timestamp, shadow->tsc_shift);
 133.139 -	return mul_frac(delta, shadow->tsc_to_usec_mul);
 133.140 +	delta = now - shadow->tsc_timestamp;
 133.141 +	return scale_delta(delta, shadow->tsc_to_usec_mul, shadow->tsc_shift);
 133.142  }
 133.143  
 133.144 -static void update_wallclock(void)
 133.145 +static void __update_wallclock(time_t sec, long nsec)
 133.146  {
 133.147 -	shared_info_t *s = HYPERVISOR_shared_info;
 133.148  	long wtm_nsec, xtime_nsec;
 133.149  	time_t wtm_sec, xtime_sec;
 133.150 -	u64 tmp, usec;
 133.151 -
 133.152 -	shadow_tv.tv_sec  = s->wc_sec;
 133.153 -	shadow_tv.tv_usec = s->wc_usec;
 133.154 -
 133.155 -	if (INDEPENDENT_WALLCLOCK())
 133.156 -		return;
 133.157 -
 133.158 -	if ((time_status & STA_UNSYNC) != 0)
 133.159 -		return;
 133.160 +	u64 tmp, wc_nsec;
 133.161  
 133.162  	/* Adjust wall-clock time base based on wall_jiffies ticks. */
 133.163 -	usec = processed_system_time;
 133.164 -	do_div(usec, 1000);
 133.165 -	usec += (u64)shadow_tv.tv_sec * 1000000ULL;
 133.166 -	usec += (u64)shadow_tv.tv_usec;
 133.167 -	usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
 133.168 +	wc_nsec = processed_system_time;
 133.169 +	wc_nsec += (u64)sec * 1000000000ULL;
 133.170 +	wc_nsec += (u64)nsec;
 133.171 +	wc_nsec -= (jiffies - wall_jiffies) * (u64)(NSEC_PER_SEC / HZ);
 133.172  
 133.173  	/* Split wallclock base into seconds and nanoseconds. */
 133.174 -	tmp = usec;
 133.175 -	xtime_nsec = do_div(tmp, 1000000) * 1000ULL;
 133.176 +	tmp = wc_nsec;
 133.177 +	xtime_nsec = do_div(tmp, 1000000000);
 133.178  	xtime_sec  = (time_t)tmp;
 133.179  
 133.180  	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - xtime_sec);
 133.181 @@ -257,13 +249,35 @@ static void update_wallclock(void)
 133.182  
 133.183  	set_normalized_timespec(&xtime, xtime_sec, xtime_nsec);
 133.184  	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
 133.185 +
 133.186 +	time_adjust = 0;		/* stop active adjtime() */
 133.187 +	time_status |= STA_UNSYNC;
 133.188 +	time_maxerror = NTP_PHASE_LIMIT;
 133.189 +	time_esterror = NTP_PHASE_LIMIT;
 133.190 +}
 133.191 +
 133.192 +static void update_wallclock(void)
 133.193 +{
 133.194 +	shared_info_t *s = HYPERVISOR_shared_info;
 133.195 +
 133.196 +	do {
 133.197 +		shadow_tv_version = s->wc_version;
 133.198 +		rmb();
 133.199 +		shadow_tv.tv_sec  = s->wc_sec;
 133.200 +		shadow_tv.tv_nsec = s->wc_nsec;
 133.201 +		rmb();
 133.202 +	}
 133.203 +	while ((s->wc_version & 1) | (shadow_tv_version ^ s->wc_version));
 133.204 +
 133.205 +	if (!independent_wallclock)
 133.206 +		__update_wallclock(shadow_tv.tv_sec, shadow_tv.tv_nsec);
 133.207  }
 133.208  
 133.209  /*
 133.210   * Reads a consistent set of time-base values from Xen, into a shadow data
 133.211 - * area. Must be called with the xtime_lock held for writing.
 133.212 + * area.
 133.213   */
 133.214 -static void __get_time_values_from_xen(void)
 133.215 +static void get_time_values_from_xen(void)
 133.216  {
 133.217  	shared_info_t           *s = HYPERVISOR_shared_info;
 133.218  	struct vcpu_time_info   *src;
 133.219 @@ -273,7 +287,7 @@ static void __get_time_values_from_xen(v
 133.220  	dst = &per_cpu(shadow_time, smp_processor_id());
 133.221  
 133.222  	do {
 133.223 -		dst->version = src->time_version2;
 133.224 +		dst->version = src->version;
 133.225  		rmb();
 133.226  		dst->tsc_timestamp     = src->tsc_timestamp;
 133.227  		dst->system_timestamp  = src->system_time;
 133.228 @@ -281,13 +295,9 @@ static void __get_time_values_from_xen(v
 133.229  		dst->tsc_shift         = src->tsc_shift;
 133.230  		rmb();
 133.231  	}
 133.232 -	while (dst->version != src->time_version1);
 133.233 +	while ((src->version & 1) | (dst->version ^ src->version));
 133.234  
 133.235  	dst->tsc_to_usec_mul = dst->tsc_to_nsec_mul / 1000;
 133.236 -
 133.237 -	if ((shadow_tv.tv_sec != s->wc_sec) ||
 133.238 -	    (shadow_tv.tv_usec != s->wc_usec))
 133.239 -		update_wallclock();
 133.240  }
 133.241  
 133.242  static inline int time_values_up_to_date(int cpu)
 133.243 @@ -298,7 +308,7 @@ static inline int time_values_up_to_date
 133.244  	src = &HYPERVISOR_shared_info->vcpu_time[cpu]; 
 133.245  	dst = &per_cpu(shadow_time, cpu); 
 133.246  
 133.247 -	return (dst->version == src->time_version2);
 133.248 +	return (dst->version == src->version);
 133.249  }
 133.250  
 133.251  /*
 133.252 @@ -339,10 +349,10 @@ void do_gettimeofday(struct timeval *tv)
 133.253  	unsigned long seq;
 133.254  	unsigned long usec, sec;
 133.255  	unsigned long max_ntp_tick;
 133.256 -	unsigned long flags;
 133.257  	s64 nsec;
 133.258  	unsigned int cpu;
 133.259  	struct shadow_time_info *shadow;
 133.260 +	u32 local_time_version;
 133.261  
 133.262  	cpu = get_cpu();
 133.263  	shadow = &per_cpu(shadow_time, cpu);
 133.264 @@ -350,6 +360,7 @@ void do_gettimeofday(struct timeval *tv)
 133.265  	do {
 133.266  		unsigned long lost;
 133.267  
 133.268 +		local_time_version = shadow->version;
 133.269  		seq = read_seqbegin(&xtime_lock);
 133.270  
 133.271  		usec = get_usec_offset(shadow);
 133.272 @@ -385,12 +396,11 @@ void do_gettimeofday(struct timeval *tv)
 133.273  			 * overflowed). Detect that and recalculate
 133.274  			 * with fresh values.
 133.275  			 */
 133.276 -			write_seqlock_irqsave(&xtime_lock, flags);
 133.277 -			__get_time_values_from_xen();
 133.278 -			write_sequnlock_irqrestore(&xtime_lock, flags);
 133.279 +			get_time_values_from_xen();
 133.280  			continue;
 133.281  		}
 133.282 -	} while (read_seqretry(&xtime_lock, seq));
 133.283 +	} while (read_seqretry(&xtime_lock, seq) ||
 133.284 +		 (local_time_version != shadow->version));
 133.285  
 133.286  	put_cpu();
 133.287  
 133.288 @@ -407,19 +417,15 @@ EXPORT_SYMBOL(do_gettimeofday);
 133.289  
 133.290  int do_settimeofday(struct timespec *tv)
 133.291  {
 133.292 -	time_t wtm_sec, sec = tv->tv_sec;
 133.293 -	long wtm_nsec;
 133.294 +	time_t sec;
 133.295  	s64 nsec;
 133.296 -	struct timespec xentime;
 133.297  	unsigned int cpu;
 133.298  	struct shadow_time_info *shadow;
 133.299 +	dom0_op_t op;
 133.300  
 133.301  	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
 133.302  		return -EINVAL;
 133.303  
 133.304 -	if (!INDEPENDENT_WALLCLOCK())
 133.305 -		return 0; /* Silent failure? */
 133.306 -
 133.307  	cpu = get_cpu();
 133.308  	shadow = &per_cpu(shadow_time, cpu);
 133.309  
 133.310 @@ -430,50 +436,30 @@ int do_settimeofday(struct timespec *tv)
 133.311  	 * overflows. If that were to happen then our shadow time values would
 133.312  	 * be stale, so we can retry with fresh ones.
 133.313  	 */
 133.314 - again:
 133.315 -	nsec = (s64)tv->tv_nsec - (s64)get_nsec_offset(shadow);
 133.316 -	if (unlikely(!time_values_up_to_date(cpu))) {
 133.317 -		__get_time_values_from_xen();
 133.318 -		goto again;
 133.319 +	for ( ; ; ) {
 133.320 +		nsec = (s64)tv->tv_nsec - (s64)get_nsec_offset(shadow);
 133.321 +		if (time_values_up_to_date(cpu))
 133.322 +			break;
 133.323 +		get_time_values_from_xen();
 133.324 +	}
 133.325 +	sec = tv->tv_sec;
 133.326 +	__normalize_time(&sec, &nsec);
 133.327 +
 133.328 +	if ((xen_start_info.flags & SIF_INITDOMAIN) &&
 133.329 +	    !independent_wallclock) {
 133.330 +		op.cmd = DOM0_SETTIME;
 133.331 +		op.u.settime.secs        = sec;
 133.332 +		op.u.settime.nsecs       = nsec;
 133.333 +		op.u.settime.system_time = shadow->system_timestamp;
 133.334 +		HYPERVISOR_dom0_op(&op);
 133.335 +		update_wallclock();
 133.336 +	} else if (independent_wallclock) {
 133.337 +		nsec -= shadow->system_timestamp;
 133.338 +		__normalize_time(&sec, &nsec);
 133.339 +		__update_wallclock(sec, nsec);
 133.340  	}
 133.341  
 133.342 -	__normalize_time(&sec, &nsec);
 133.343 -	set_normalized_timespec(&xentime, sec, nsec);
 133.344 -
 133.345 -	/*
 133.346 -	 * This is revolting. We need to set "xtime" correctly. However, the
 133.347 -	 * value in this location is the value at the most recent update of
 133.348 -	 * wall time.  Discover what correction gettimeofday() would have
 133.349 -	 * made, and then undo it!
 133.350 -	 */
 133.351 -	nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
 133.352 -
 133.353 -	nsec -= (shadow->system_timestamp - processed_system_time);
 133.354 -
 133.355 -	__normalize_time(&sec, &nsec);
 133.356 -	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
 133.357 -	wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
 133.358 -
 133.359 -	set_normalized_timespec(&xtime, sec, nsec);
 133.360 -	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
 133.361 -
 133.362 -	time_adjust = 0;		/* stop active adjtime() */
 133.363 -	time_status |= STA_UNSYNC;
 133.364 -	time_maxerror = NTP_PHASE_LIMIT;
 133.365 -	time_esterror = NTP_PHASE_LIMIT;
 133.366 -
 133.367 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 133.368 -	if (xen_start_info.flags & SIF_INITDOMAIN) {
 133.369 -		dom0_op_t op;
 133.370 -		op.cmd = DOM0_SETTIME;
 133.371 -		op.u.settime.secs        = xentime.tv_sec;
 133.372 -		op.u.settime.usecs       = xentime.tv_nsec / NSEC_PER_USEC;
 133.373 -		op.u.settime.system_time = shadow->system_timestamp;
 133.374 -		write_sequnlock_irq(&xtime_lock);
 133.375 -		HYPERVISOR_dom0_op(&op);
 133.376 -	} else
 133.377 -#endif
 133.378 -		write_sequnlock_irq(&xtime_lock);
 133.379 +	write_sequnlock_irq(&xtime_lock);
 133.380  
 133.381  	put_cpu();
 133.382  
 133.383 @@ -490,6 +476,9 @@ static int set_rtc_mmss(unsigned long no
 133.384  
 133.385  	WARN_ON(irqs_disabled());
 133.386  
 133.387 +	if (!(xen_start_info.flags & SIF_INITDOMAIN))
 133.388 +		return 0;
 133.389 +
 133.390  	/* gets recalled with irq locally disabled */
 133.391  	spin_lock_irq(&rtc_lock);
 133.392  	if (efi_enabled)
 133.393 @@ -515,21 +504,21 @@ unsigned long long monotonic_clock(void)
 133.394  {
 133.395  	int cpu = get_cpu();
 133.396  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
 133.397 -	s64 off;
 133.398 -	unsigned long flags;
 133.399 -	
 133.400 -	for ( ; ; ) {
 133.401 -		off = get_nsec_offset(shadow);
 133.402 -		if (time_values_up_to_date(cpu))
 133.403 -			break;
 133.404 -		write_seqlock_irqsave(&xtime_lock, flags);
 133.405 -		__get_time_values_from_xen();
 133.406 -		write_sequnlock_irqrestore(&xtime_lock, flags);
 133.407 -	}
 133.408 +	u64 time;
 133.409 +	u32 local_time_version;
 133.410 +
 133.411 +	do {
 133.412 +		local_time_version = shadow->version;
 133.413 +		smp_rmb();
 133.414 +		time = shadow->system_timestamp + get_nsec_offset(shadow);
 133.415 +		if (!time_values_up_to_date(cpu))
 133.416 +			get_time_values_from_xen();
 133.417 +		smp_rmb();
 133.418 +	} while (local_time_version != shadow->version);
 133.419  
 133.420  	put_cpu();
 133.421  
 133.422 -	return shadow->system_timestamp + off;
 133.423 +	return time;
 133.424  }
 133.425  EXPORT_SYMBOL(monotonic_clock);
 133.426  
 133.427 @@ -551,19 +540,16 @@ unsigned long profile_pc(struct pt_regs 
 133.428  EXPORT_SYMBOL(profile_pc);
 133.429  #endif
 133.430  
 133.431 -/*
 133.432 - * timer_interrupt() needs to keep up the real-time clock,
 133.433 - * as well as call the "do_timer()" routine every clocktick
 133.434 - */
 133.435 -static inline void do_timer_interrupt(int irq, void *dev_id,
 133.436 -					struct pt_regs *regs)
 133.437 +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 133.438  {
 133.439  	s64 delta, delta_cpu;
 133.440  	int cpu = smp_processor_id();
 133.441  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
 133.442  
 133.443 +	write_seqlock(&xtime_lock);
 133.444 +
 133.445  	do {
 133.446 -		__get_time_values_from_xen();
 133.447 +		get_time_values_from_xen();
 133.448  
 133.449  		delta = delta_cpu = 
 133.450  			shadow->system_timestamp + get_nsec_offset(shadow);
 133.451 @@ -572,7 +558,7 @@ static inline void do_timer_interrupt(in
 133.452  	}
 133.453  	while (!time_values_up_to_date(cpu));
 133.454  
 133.455 -	if (unlikely(delta < 0) || unlikely(delta_cpu < 0)) {
 133.456 +	if (unlikely(delta < (s64)-1000000) || unlikely(delta_cpu < 0)) {
 133.457  		printk("Timer ISR/%d: Time went backwards: "
 133.458  		       "delta=%lld cpu_delta=%lld shadow=%lld "
 133.459  		       "off=%lld processed=%lld cpu_processed=%lld\n",
 133.460 @@ -583,7 +569,6 @@ static inline void do_timer_interrupt(in
 133.461  		for (cpu = 0; cpu < num_online_cpus(); cpu++)
 133.462  			printk(" %d: %lld\n", cpu,
 133.463  			       per_cpu(processed_system_time, cpu));
 133.464 -		return;
 133.465  	}
 133.466  
 133.467  	/* System-wide jiffy work. */
 133.468 @@ -593,32 +578,25 @@ static inline void do_timer_interrupt(in
 133.469  		do_timer(regs);
 133.470  	}
 133.471  
 133.472 -	/* Local CPU jiffy work. */
 133.473 +	if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) {
 133.474 +		update_wallclock();
 133.475 +		clock_was_set();
 133.476 +	}
 133.477 +
 133.478 +	write_sequnlock(&xtime_lock);
 133.479 +
 133.480 +	/*
 133.481 +         * Local CPU jiffy work. No need to hold xtime_lock, and I'm not sure
 133.482 +         * if there is risk of deadlock if we do (since update_process_times
 133.483 +         * may do scheduler rebalancing work and thus acquire runqueue locks).
 133.484 +         */
 133.485  	while (delta_cpu >= NS_PER_TICK) {
 133.486  		delta_cpu -= NS_PER_TICK;
 133.487  		per_cpu(processed_system_time, cpu) += NS_PER_TICK;
 133.488  		update_process_times(user_mode(regs));
 133.489  		profile_tick(CPU_PROFILING, regs);
 133.490  	}
 133.491 -}
 133.492  
 133.493 -/*
 133.494 - * This is the same as the above, except we _also_ save the current
 133.495 - * Time Stamp Counter value at the time of the timer interrupt, so that
 133.496 - * we later on can estimate the time of day more exactly.
 133.497 - */
 133.498 -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 133.499 -{
 133.500 -	/*
 133.501 -	 * Here we are in the timer irq handler. We just have irqs locally
 133.502 -	 * disabled but we don't know if the timer_bh is running on the other
 133.503 -	 * CPU. We need to avoid to SMP race with it. NOTE: we don' t need
 133.504 -	 * the irq version of write_lock because as just said we have irq
 133.505 -	 * locally disabled. -arca
 133.506 -	 */
 133.507 -	write_seqlock(&xtime_lock);
 133.508 -	do_timer_interrupt(irq, NULL, regs);
 133.509 -	write_sequnlock(&xtime_lock);
 133.510  	return IRQ_HANDLED;
 133.511  }
 133.512  
 133.513 @@ -767,7 +745,7 @@ static void __init hpet_time_init(void)
 133.514  #endif
 133.515  
 133.516  /* Dynamically-mapped IRQ. */
 133.517 -static DEFINE_PER_CPU(int, timer_irq);
 133.518 +DEFINE_PER_CPU(int, timer_irq);
 133.519  
 133.520  static struct irqaction irq_timer = {
 133.521  	timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer0",
 133.522 @@ -786,15 +764,16 @@ void __init time_init(void)
 133.523  		return;
 133.524  	}
 133.525  #endif
 133.526 -	__get_time_values_from_xen();
 133.527 -	xtime.tv_sec = shadow_tv.tv_sec;
 133.528 -	xtime.tv_nsec = shadow_tv.tv_usec * NSEC_PER_USEC;
 133.529 -	set_normalized_timespec(&wall_to_monotonic,
 133.530 -		-xtime.tv_sec, -xtime.tv_nsec);
 133.531 +	get_time_values_from_xen();
 133.532 +
 133.533  	processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
 133.534  	per_cpu(processed_system_time, 0) = processed_system_time;
 133.535  
 133.536 +	update_wallclock();
 133.537 +
 133.538  	init_cpu_khz();
 133.539 +	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n",
 133.540 +	       cpu_khz / 1000, cpu_khz % 1000);
 133.541  
 133.542  #if defined(__x86_64__)
 133.543  	vxtime.mode = VXTIME_TSC;
 133.544 @@ -860,6 +839,8 @@ void start_hz_timer(void)
 133.545  void time_suspend(void)
 133.546  {
 133.547  	/* nothing */
 133.548 +	teardown_irq(per_cpu(timer_irq, 0), &irq_timer);
 133.549 +	unbind_virq_from_irq(VIRQ_TIMER);
 133.550  }
 133.551  
 133.552  /* No locking required. We are only CPU running, and interrupts are off. */
 133.553 @@ -867,17 +848,31 @@ void time_resume(void)
 133.554  {
 133.555  	init_cpu_khz();
 133.556  
 133.557 -	/* Get timebases for new environment. */ 
 133.558 -	__get_time_values_from_xen();
 133.559 +	get_time_values_from_xen();
 133.560 +
 133.561 +	processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
 133.562 +	per_cpu(processed_system_time, 0) = processed_system_time;
 133.563  
 133.564 -	/* Reset our own concept of passage of system time. */
 133.565 -	processed_system_time =
 133.566 -		per_cpu(shadow_time, smp_processor_id()).system_timestamp;
 133.567 -	per_cpu(processed_system_time, 0) = processed_system_time;
 133.568 +	update_wallclock();
 133.569 +
 133.570 +	per_cpu(timer_irq, 0) = bind_virq_to_irq(VIRQ_TIMER);
 133.571 +	(void)setup_irq(per_cpu(timer_irq, 0), &irq_timer);
 133.572  }
 133.573  
 133.574  #ifdef CONFIG_SMP
 133.575  static char timer_name[NR_CPUS][15];
 133.576 +void local_setup_timer_irq(void)
 133.577 +{
 133.578 +	int cpu = smp_processor_id();
 133.579 +
 133.580 +	if (cpu == 0)
 133.581 +		return;
 133.582 +	per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
 133.583 +	sprintf(timer_name[cpu], "timer%d", cpu);
 133.584 +	BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
 133.585 +	                   SA_INTERRUPT, timer_name[cpu], NULL));
 133.586 +}
 133.587 +
 133.588  void local_setup_timer(void)
 133.589  {
 133.590  	int seq, cpu = smp_processor_id();
 133.591 @@ -888,10 +883,17 @@ void local_setup_timer(void)
 133.592  			per_cpu(shadow_time, cpu).system_timestamp;
 133.593  	} while (read_seqretry(&xtime_lock, seq));
 133.594  
 133.595 -	per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
 133.596 -	sprintf(timer_name[cpu], "timer%d", cpu);
 133.597 -	BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
 133.598 -	                   SA_INTERRUPT, timer_name[cpu], NULL));
 133.599 +	local_setup_timer_irq();
 133.600 +}
 133.601 +
 133.602 +void local_teardown_timer_irq(void)
 133.603 +{
 133.604 +	int cpu = smp_processor_id();
 133.605 +
 133.606 +	if (cpu == 0)
 133.607 +		return;
 133.608 +	free_irq(per_cpu(timer_irq, cpu), NULL);
 133.609 +	unbind_virq_from_irq(VIRQ_TIMER);
 133.610  }
 133.611  #endif
 133.612  
   134.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/timers/Makefile	Tue Aug 23 18:43:18 2005 -0800
   134.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.3 @@ -1,17 +0,0 @@
   134.4 -#
   134.5 -# Makefile for x86 timers
   134.6 -#
   134.7 -
   134.8 -XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
   134.9 -
  134.10 -obj-y :=	timer_tsc.o
  134.11 -c-obj-y :=
  134.12 -
  134.13 -c-link	:=
  134.14 -
  134.15 -$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
  134.16 -	@ln -fsn $(srctree)/arch/i386/kernel/timers/$(notdir $@) $@
  134.17 -
  134.18 -obj-y	+= $(c-obj-y)
  134.19 -
  134.20 -clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
   135.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Tue Aug 23 18:43:18 2005 -0800
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,379 +0,0 @@
   135.4 -/*
   135.5 - * This code largely moved from arch/i386/kernel/time.c.
   135.6 - * See comments there for proper credits.
   135.7 - */
   135.8 -
   135.9 -#include <linux/spinlock.h>
  135.10 -#include <linux/init.h>
  135.11 -#include <linux/timex.h>
  135.12 -#include <linux/errno.h>
  135.13 -#include <linux/cpufreq.h>
  135.14 -#include <linux/string.h>
  135.15 -#include <linux/jiffies.h>
  135.16 -
  135.17 -#include <asm/timer.h>
  135.18 -#include <asm/io.h>
  135.19 -/* processor.h for distable_tsc flag */
  135.20 -#include <asm/processor.h>
  135.21 -
  135.22 -#include "io_ports.h"
  135.23 -#include "mach_timer.h"
  135.24 -
  135.25 -#include <asm/hpet.h>
  135.26 -
  135.27 -#ifdef CONFIG_HPET_TIMER
  135.28 -static unsigned long hpet_usec_quotient;
  135.29 -static unsigned long hpet_last;
  135.30 -static struct timer_opts timer_tsc;
  135.31 -#endif
  135.32 -
  135.33 -static inline void cpufreq_delayed_get(void);
  135.34 -
  135.35 -int tsc_disable __initdata = 0;
  135.36 -
  135.37 -extern spinlock_t i8253_lock;
  135.38 -
  135.39 -static int use_tsc;
  135.40 -
  135.41 -static unsigned long long monotonic_base;
  135.42 -static u32 monotonic_offset;
  135.43 -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
  135.44 -
  135.45 -/* convert from cycles(64bits) => nanoseconds (64bits)
  135.46 - *  basic equation:
  135.47 - *		ns = cycles / (freq / ns_per_sec)
  135.48 - *		ns = cycles * (ns_per_sec / freq)
  135.49 - *		ns = cycles * (10^9 / (cpu_mhz * 10^6))
  135.50 - *		ns = cycles * (10^3 / cpu_mhz)
  135.51 - *
  135.52 - *	Then we use scaling math (suggested by george@mvista.com) to get:
  135.53 - *		ns = cycles * (10^3 * SC / cpu_mhz) / SC
  135.54 - *		ns = cycles * cyc2ns_scale / SC
  135.55 - *
  135.56 - *	And since SC is a constant power of two, we can convert the div
  135.57 - *  into a shift.   
  135.58 - *			-johnstul@us.ibm.com "math is hard, lets go shopping!"
  135.59 - */
  135.60 -static unsigned long cyc2ns_scale; 
  135.61 -#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
  135.62 -
  135.63 -static inline void set_cyc2ns_scale(unsigned long cpu_mhz)
  135.64 -{
  135.65 -	cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
  135.66 -}
  135.67 -
  135.68 -static inline unsigned long long cycles_2_ns(unsigned long long cyc)
  135.69 -{
  135.70 -	return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
  135.71 -}
  135.72 -
  135.73 -/* Cached *multiplier* to convert TSC counts to microseconds.
  135.74 - * (see the equation below).
  135.75 - * Equal to 2^32 * (1 / (clocks per usec) ).
  135.76 - * Initialized in time_init.
  135.77 - */
  135.78 -static unsigned long fast_gettimeoffset_quotient;
  135.79 -
  135.80 -extern u32 shadow_tsc_stamp;
  135.81 -extern u64 shadow_system_time;
  135.82 -
  135.83 -static unsigned long get_offset_tsc(void)
  135.84 -{
  135.85 -	register unsigned long eax, edx;
  135.86 -
  135.87 -	/* Read the Time Stamp Counter */
  135.88 -
  135.89 -	rdtsc(eax,edx);
  135.90 -
  135.91 -	/* .. relative to previous jiffy (32 bits is enough) */
  135.92 -	eax -= shadow_tsc_stamp;
  135.93 -
  135.94 -	/*
  135.95 -         * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient
  135.96 -         *             = (tsc_low delta) * (usecs_per_clock)
  135.97 -         *             = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy)
  135.98 -	 *
  135.99 -	 * Using a mull instead of a divl saves up to 31 clock cycles
 135.100 -	 * in the critical path.
 135.101 -         */
 135.102 -
 135.103 -	__asm__("mull %2"
 135.104 -		:"=a" (eax), "=d" (edx)
 135.105 -		:"rm" (fast_gettimeoffset_quotient),
 135.106 -		 "0" (eax));
 135.107 -
 135.108 -	/* our adjusted time offset in microseconds */
 135.109 -	return edx;
 135.110 -}
 135.111 -
 135.112 -static unsigned long long monotonic_clock_tsc(void)
 135.113 -{
 135.114 -	unsigned long long last_offset, this_offset, base;
 135.115 -	unsigned seq;
 135.116 -	
 135.117 -	/* atomically read monotonic base & last_offset */
 135.118 -	do {
 135.119 -		seq = read_seqbegin(&monotonic_lock);
 135.120 -		last_offset = monotonic_offset;
 135.121 -		base = monotonic_base;
 135.122 -	} while (read_seqretry(&monotonic_lock, seq));
 135.123 -
 135.124 -	/* Read the Time Stamp Counter */
 135.125 -	rdtscll(this_offset);
 135.126 -
 135.127 -	/* return the value in ns */
 135.128 -	return base + cycles_2_ns(this_offset - last_offset);
 135.129 -}
 135.130 -
 135.131 -/*
 135.132 - * Scheduler clock - returns current time in nanosec units.
 135.133 - */
 135.134 -unsigned long long sched_clock(void)
 135.135 -{
 135.136 -	unsigned long long this_offset;
 135.137 -
 135.138 -	/*
 135.139 -	 * In the NUMA case we dont use the TSC as they are not
 135.140 -	 * synchronized across all CPUs.
 135.141 -	 */
 135.142 -#ifndef CONFIG_NUMA
 135.143 -	if (!use_tsc)
 135.144 -#endif
 135.145 -		/* no locking but a rare wrong value is not a big deal */
 135.146 -		return jiffies_64 * (1000000000 / HZ);
 135.147 -
 135.148 -	/* Read the Time Stamp Counter */
 135.149 -	rdtscll(this_offset);
 135.150 -
 135.151 -	/* return the value in ns */
 135.152 -	return cycles_2_ns(this_offset);
 135.153 -}
 135.154 -
 135.155 -
 135.156 -static void mark_offset_tsc(void)
 135.157 -{
 135.158 -
 135.159 -	/* update the monotonic base value */
 135.160 -	write_seqlock(&monotonic_lock);
 135.161 -	monotonic_base = shadow_system_time;
 135.162 -	monotonic_offset = shadow_tsc_stamp;
 135.163 -	write_sequnlock(&monotonic_lock);
 135.164 -}
 135.165 -
 135.166 -static void delay_tsc(unsigned long loops)
 135.167 -{
 135.168 -	unsigned long bclock, now;
 135.169 -	
 135.170 -	rdtscl(bclock);
 135.171 -	do
 135.172 -	{
 135.173 -		rep_nop();
 135.174 -		rdtscl(now);
 135.175 -	} while ((now-bclock) < loops);
 135.176 -}
 135.177 -
 135.178 -#ifdef CONFIG_HPET_TIMER
 135.179 -static void mark_offset_tsc_hpet(void)
 135.180 -{
 135.181 -	unsigned long long this_offset, last_offset;
 135.182 - 	unsigned long offset, temp, hpet_current;
 135.183 -
 135.184 -	write_seqlock(&monotonic_lock);
 135.185 -	last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
 135.186 -	/*
 135.187 -	 * It is important that these two operations happen almost at
 135.188 -	 * the same time. We do the RDTSC stuff first, since it's
 135.189 -	 * faster. To avoid any inconsistencies, we need interrupts
 135.190 -	 * disabled locally.
 135.191 -	 */
 135.192 -	/*
 135.193 -	 * Interrupts are just disabled locally since the timer irq
 135.194 -	 * has the SA_INTERRUPT flag set. -arca
 135.195 -	 */
 135.196 -	/* read Pentium cycle counter */
 135.197 -
 135.198 -	hpet_current = hpet_readl(HPET_COUNTER);
 135.199 -	rdtsc(last_tsc_low, last_tsc_high);
 135.200 -
 135.201 -	/* lost tick compensation */
 135.202 -	offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
 135.203 -	if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
 135.204 -		int lost_ticks = (offset - hpet_last) / hpet_tick;
 135.205 -		jiffies_64 += lost_ticks;
 135.206 -	}
 135.207 -	hpet_last = hpet_current;
 135.208 -
 135.209 -	/* update the monotonic base value */
 135.210 -	this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
 135.211 -	monotonic_base += cycles_2_ns(this_offset - last_offset);
 135.212 -	write_sequnlock(&monotonic_lock);
 135.213 -
 135.214 -	/* calculate delay_at_last_interrupt */
 135.215 -	/*
 135.216 -	 * Time offset = (hpet delta) * ( usecs per HPET clock )
 135.217 -	 *             = (hpet delta) * ( usecs per tick / HPET clocks per tick)
 135.218 -	 *             = (hpet delta) * ( hpet_usec_quotient ) / (2^32)
 135.219 -	 * Where,
 135.220 -	 * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick
 135.221 -	 */
 135.222 -	delay_at_last_interrupt = hpet_current - offset;
 135.223 -	ASM_MUL64_REG(temp, delay_at_last_interrupt,
 135.224 -			hpet_usec_quotient, delay_at_last_interrupt);
 135.225 -}
 135.226 -#endif
 135.227 -
 135.228 -
 135.229 -#ifdef CONFIG_CPU_FREQ
 135.230 -#include <linux/workqueue.h>
 135.231 -
 135.232 -static unsigned int cpufreq_delayed_issched = 0;
 135.233 -static unsigned int cpufreq_init = 0;
 135.234 -static struct work_struct cpufreq_delayed_get_work;
 135.235 -
 135.236 -static void handle_cpufreq_delayed_get(void *v)
 135.237 -{
 135.238 -	unsigned int cpu;
 135.239 -	for_each_online_cpu(cpu) {
 135.240 -		cpufreq_get(cpu);
 135.241 -	}
 135.242 -	cpufreq_delayed_issched = 0;
 135.243 -}
 135.244 -
 135.245 -/* if we notice lost ticks, schedule a call to cpufreq_get() as it tries
 135.246 - * to verify the CPU frequency the timing core thinks the CPU is running
 135.247 - * at is still correct.
 135.248 - */
 135.249 -static inline void cpufreq_delayed_get(void) 
 135.250 -{
 135.251 -	if (cpufreq_init && !cpufreq_delayed_issched) {
 135.252 -		cpufreq_delayed_issched = 1;
 135.253 -		printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n");
 135.254 -		schedule_work(&cpufreq_delayed_get_work);
 135.255 -	}
 135.256 -}
 135.257 -
 135.258 -/* If the CPU frequency is scaled, TSC-based delays will need a different
 135.259 - * loops_per_jiffy value to function properly.
 135.260 - */
 135.261 -
 135.262 -static unsigned int  ref_freq = 0;
 135.263 -static unsigned long loops_per_jiffy_ref = 0;
 135.264 -
 135.265 -#ifndef CONFIG_SMP
 135.266 -static unsigned long fast_gettimeoffset_ref = 0;
 135.267 -static unsigned long cpu_khz_ref = 0;
 135.268 -#endif
 135.269 -
 135.270 -static int
 135.271 -time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 135.272 -		       void *data)
 135.273 -{
 135.274 -	struct cpufreq_freqs *freq = data;
 135.275 -
 135.276 -	if (val != CPUFREQ_RESUMECHANGE)
 135.277 -		write_seqlock_irq(&xtime_lock);
 135.278 -	if (!ref_freq) {
 135.279 -		ref_freq = freq->old;
 135.280 -		loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
 135.281 -#ifndef CONFIG_SMP
 135.282 -		fast_gettimeoffset_ref = fast_gettimeoffset_quotient;
 135.283 -		cpu_khz_ref = cpu_khz;
 135.284 -#endif
 135.285 -	}
 135.286 -
 135.287 -	if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
 135.288 -	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
 135.289 -	    (val == CPUFREQ_RESUMECHANGE)) {
 135.290 -		if (!(freq->flags & CPUFREQ_CONST_LOOPS))
 135.291 -			cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
 135.292 -#ifndef CONFIG_SMP
 135.293 -		if (cpu_khz)
 135.294 -			cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
 135.295 -		if (use_tsc) {
 135.296 -			if (!(freq->flags & CPUFREQ_CONST_LOOPS)) {
 135.297 -				fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
 135.298 -				set_cyc2ns_scale(cpu_khz/1000);
 135.299 -			}
 135.300 -		}
 135.301 -#endif
 135.302 -	}
 135.303 -
 135.304 -	if (val != CPUFREQ_RESUMECHANGE)
 135.305 -		write_sequnlock_irq(&xtime_lock);
 135.306 -
 135.307 -	return 0;
 135.308 -}
 135.309 -
 135.310 -static struct notifier_block time_cpufreq_notifier_block = {
 135.311 -	.notifier_call	= time_cpufreq_notifier
 135.312 -};
 135.313 -
 135.314 -
 135.315 -static int __init cpufreq_tsc(void)
 135.316 -{
 135.317 -	int ret;
 135.318 -	INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get, NULL);
 135.319 -	ret = cpufreq_register_notifier(&time_cpufreq_notifier_block,
 135.320 -					CPUFREQ_TRANSITION_NOTIFIER);
 135.321 -	if (!ret)
 135.322 -		cpufreq_init = 1;
 135.323 -	return ret;
 135.324 -}
 135.325 -core_initcall(cpufreq_tsc);
 135.326 -
 135.327 -#else /* CONFIG_CPU_FREQ */
 135.328 -static inline void cpufreq_delayed_get(void) { return; }
 135.329 -#endif 
 135.330 -
 135.331 -
 135.332 -static int init_tsc(char* override)
 135.333 -{
 135.334 -	u64 __cpu_khz;
 135.335 -
 135.336 -	__cpu_khz = HYPERVISOR_shared_info->cpu_freq;
 135.337 -	do_div(__cpu_khz, 1000);
 135.338 -	cpu_khz = (u32)__cpu_khz;
 135.339 -	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n", 
 135.340 -	       cpu_khz / 1000, cpu_khz % 1000);
 135.341 -
 135.342 -	/* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz =
 135.343 -	   (2^32 * 1 / (clocks/us)) */
 135.344 -	{
 135.345 -		unsigned long eax=0, edx=1000;
 135.346 -		__asm__("divl %2"
 135.347 -		    :"=a" (fast_gettimeoffset_quotient), "=d" (edx)
 135.348 -		    :"r" (cpu_khz),
 135.349 -		    "0" (eax), "1" (edx));
 135.350 -	}
 135.351 -
 135.352 -	set_cyc2ns_scale(cpu_khz/1000);
 135.353 -
 135.354 -	use_tsc = 1;
 135.355 -
 135.356 -	return 0;
 135.357 -}
 135.358 -
 135.359 -static int __init tsc_setup(char *str)
 135.360 -{
 135.361 -	printk(KERN_WARNING "notsc: cannot disable TSC in Xen/Linux.\n");
 135.362 -	return 1;
 135.363 -}
 135.364 -__setup("notsc", tsc_setup);
 135.365 -
 135.366 -
 135.367 -
 135.368 -/************************************************************/
 135.369 -
 135.370 -/* tsc timer_opts struct */
 135.371 -struct timer_opts timer_tsc = {
 135.372 -	.name = "tsc",
 135.373 -	.mark_offset = mark_offset_tsc, 
 135.374 -	.get_offset = get_offset_tsc,
 135.375 -	.monotonic_clock = monotonic_clock_tsc,
 135.376 -	.delay = delay_tsc,
 135.377 -};
 135.378 -
 135.379 -struct init_timer_opts timer_tsc_init = {
 135.380 -	.init = init_tsc,
 135.381 -	.opts = &timer_tsc,
 135.382 -};
   136.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Tue Aug 23 18:43:18 2005 -0800
   136.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Thu Aug 25 15:53:20 2005 -0700
   136.3 @@ -871,6 +871,7 @@ fastcall void do_simd_coprocessor_error(
   136.4  	}
   136.5  }
   136.6  
   136.7 +#ifndef CONFIG_XEN
   136.8  fastcall void setup_x86_bogus_stack(unsigned char * stk)
   136.9  {
  136.10  	unsigned long *switch16_ptr, *switch32_ptr;
  136.11 @@ -915,6 +916,7 @@ fastcall unsigned char * fixup_x86_bogus
  136.12  	memcpy(stack32, stack16, len);
  136.13  	return stack32;
  136.14  }
  136.15 +#endif
  136.16  
  136.17  /*
  136.18   *  'math_state_restore()' saves the current math information in the
   140.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Tue Aug 23 18:43:18 2005 -0800
   140.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Thu Aug 25 15:53:20 2005 -0700
   140.3 @@ -281,7 +281,7 @@ fastcall void do_page_fault(struct pt_re
   140.4  	siginfo_t info;
   140.5  
   140.6  	/* Set the "privileged fault" bit to something sane. */
   140.7 -	error_code &= 3;
   140.8 +	error_code &= ~4;
   140.9  	error_code |= (regs->xcs & 2) << 1;
  140.10  	if (regs->eflags & X86_EFLAGS_VM)
  140.11  		error_code |= 4;
   141.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Tue Aug 23 18:43:18 2005 -0800
   141.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Thu Aug 25 15:53:20 2005 -0700
   141.3 @@ -41,8 +41,7 @@ static void *__kmap_atomic(struct page *
   141.4  	if (!pte_none(*(kmap_pte-idx)))
   141.5  		BUG();
   141.6  #endif
   141.7 -	set_pte(kmap_pte-idx, mk_pte(page, prot));
   141.8 -	__flush_tlb_one(vaddr);
   141.9 +	set_pte_at_sync(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
  141.10  
  141.11  	return (void*) vaddr;
  141.12  }
   142.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Aug 23 18:43:18 2005 -0800
   142.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Aug 25 15:53:20 2005 -0700
   142.3 @@ -35,6 +35,7 @@
   142.4  #include <asm/pgtable.h>
   142.5  #include <asm-xen/hypervisor.h>
   142.6  #include <asm-xen/balloon.h>
   142.7 +#include <linux/module.h>
   142.8  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   142.9  #include <linux/percpu.h>
  142.10  #include <asm/tlbflush.h>
  142.11 @@ -58,124 +59,124 @@
  142.12  #ifndef CONFIG_XEN_SHADOW_MODE
  142.13  void xen_l1_entry_update(pte_t *ptr, pte_t val)
  142.14  {
  142.15 -    mmu_update_t u;
  142.16 -    u.ptr = virt_to_machine(ptr);
  142.17 -    u.val = pte_val_ma(val);
  142.18 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.19 +	mmu_update_t u;
  142.20 +	u.ptr = virt_to_machine(ptr);
  142.21 +	u.val = pte_val_ma(val);
  142.22 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.23  }
  142.24  
  142.25  void xen_l2_entry_update(pmd_t *ptr, pmd_t val)
  142.26  {
  142.27 -    mmu_update_t u;
  142.28 -    u.ptr = virt_to_machine(ptr);
  142.29 -    u.val = pmd_val_ma(val);
  142.30 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.31 +	mmu_update_t u;
  142.32 +	u.ptr = virt_to_machine(ptr);
  142.33 +	u.val = pmd_val_ma(val);
  142.34 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.35  }
  142.36  
  142.37  #ifdef CONFIG_X86_PAE
  142.38  void xen_l3_entry_update(pud_t *ptr, pud_t val)
  142.39  {
  142.40 -    mmu_update_t u;
  142.41 -    u.ptr = virt_to_machine(ptr);
  142.42 -    u.val = pud_val_ma(val);
  142.43 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.44 +	mmu_update_t u;
  142.45 +	u.ptr = virt_to_machine(ptr);
  142.46 +	u.val = pud_val_ma(val);
  142.47 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.48  }
  142.49  #endif
  142.50  
  142.51  #ifdef CONFIG_X86_64
  142.52  void xen_l3_entry_update(pud_t *ptr, pud_t val)
  142.53  {
  142.54 -    mmu_update_t u;
  142.55 -    u.ptr = virt_to_machine(ptr);
  142.56 -    u.val = val.pud;
  142.57 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.58 +	mmu_update_t u;
  142.59 +	u.ptr = virt_to_machine(ptr);
  142.60 +	u.val = val.pud;
  142.61 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.62  }
  142.63  
  142.64  void xen_l4_entry_update(pgd_t *ptr, pgd_t val)
  142.65  {
  142.66 -    mmu_update_t u;
  142.67 -    u.ptr = virt_to_machine(ptr);
  142.68 -    u.val = val.pgd;
  142.69 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.70 +	mmu_update_t u;
  142.71 +	u.ptr = virt_to_machine(ptr);
  142.72 +	u.val = val.pgd;
  142.73 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.74  }
  142.75  #endif /* CONFIG_X86_64 */
  142.76  #endif /* CONFIG_XEN_SHADOW_MODE */
  142.77  
  142.78  void xen_machphys_update(unsigned long mfn, unsigned long pfn)
  142.79  {
  142.80 -    mmu_update_t u;
  142.81 -    u.ptr = (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
  142.82 -    u.val = pfn;
  142.83 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.84 +	mmu_update_t u;
  142.85 +	u.ptr = (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
  142.86 +	u.val = pfn;
  142.87 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
  142.88  }
  142.89  
  142.90  void xen_pt_switch(unsigned long ptr)
  142.91  {
  142.92 -    struct mmuext_op op;
  142.93 -    op.cmd = MMUEXT_NEW_BASEPTR;
  142.94 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  142.95 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  142.96 +	struct mmuext_op op;
  142.97 +	op.cmd = MMUEXT_NEW_BASEPTR;
  142.98 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  142.99 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.100  }
 142.101  
 142.102  void xen_new_user_pt(unsigned long ptr)
 142.103  {
 142.104 -    struct mmuext_op op;
 142.105 -    op.cmd = MMUEXT_NEW_USER_BASEPTR;
 142.106 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.107 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.108 +	struct mmuext_op op;
 142.109 +	op.cmd = MMUEXT_NEW_USER_BASEPTR;
 142.110 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.111 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.112  }
 142.113  
 142.114  void xen_tlb_flush(void)
 142.115  {
 142.116 -    struct mmuext_op op;
 142.117 -    op.cmd = MMUEXT_TLB_FLUSH_LOCAL;
 142.118 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.119 +	struct mmuext_op op;
 142.120 +	op.cmd = MMUEXT_TLB_FLUSH_LOCAL;
 142.121 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.122  }
 142.123  
 142.124  void xen_invlpg(unsigned long ptr)
 142.125  {
 142.126 -    struct mmuext_op op;
 142.127 -    op.cmd = MMUEXT_INVLPG_LOCAL;
 142.128 -    op.linear_addr = ptr & PAGE_MASK;
 142.129 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.130 +	struct mmuext_op op;
 142.131 +	op.cmd = MMUEXT_INVLPG_LOCAL;
 142.132 +	op.linear_addr = ptr & PAGE_MASK;
 142.133 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.134  }
 142.135  
 142.136  #ifdef CONFIG_SMP
 142.137  
 142.138  void xen_tlb_flush_all(void)
 142.139  {
 142.140 -    struct mmuext_op op;
 142.141 -    op.cmd = MMUEXT_TLB_FLUSH_ALL;
 142.142 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.143 +	struct mmuext_op op;
 142.144 +	op.cmd = MMUEXT_TLB_FLUSH_ALL;
 142.145 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.146  }
 142.147  
 142.148  void xen_tlb_flush_mask(cpumask_t *mask)
 142.149  {
 142.150 -    struct mmuext_op op;
 142.151 -    if ( cpus_empty(*mask) )
 142.152 -        return;
 142.153 -    op.cmd = MMUEXT_TLB_FLUSH_MULTI;
 142.154 -    op.vcpumask = mask->bits;
 142.155 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.156 +	struct mmuext_op op;
 142.157 +	if ( cpus_empty(*mask) )
 142.158 +		return;
 142.159 +	op.cmd = MMUEXT_TLB_FLUSH_MULTI;
 142.160 +	op.vcpumask = mask->bits;
 142.161 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.162  }
 142.163  
 142.164  void xen_invlpg_all(unsigned long ptr)
 142.165  {
 142.166 -    struct mmuext_op op;
 142.167 -    op.cmd = MMUEXT_INVLPG_ALL;
 142.168 -    op.linear_addr = ptr & PAGE_MASK;
 142.169 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.170 +	struct mmuext_op op;
 142.171 +	op.cmd = MMUEXT_INVLPG_ALL;
 142.172 +	op.linear_addr = ptr & PAGE_MASK;
 142.173 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.174  }
 142.175  
 142.176  void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr)
 142.177  {
 142.178 -    struct mmuext_op op;
 142.179 -    if ( cpus_empty(*mask) )
 142.180 -        return;
 142.181 -    op.cmd = MMUEXT_INVLPG_MULTI;
 142.182 -    op.vcpumask = mask->bits;
 142.183 -    op.linear_addr = ptr & PAGE_MASK;
 142.184 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.185 +	struct mmuext_op op;
 142.186 +	if ( cpus_empty(*mask) )
 142.187 +		return;
 142.188 +	op.cmd = MMUEXT_INVLPG_MULTI;
 142.189 +	op.vcpumask = mask->bits;
 142.190 +	op.linear_addr = ptr & PAGE_MASK;
 142.191 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.192  }
 142.193  
 142.194  #endif /* CONFIG_SMP */
 142.195 @@ -183,181 +184,233 @@ void xen_invlpg_mask(cpumask_t *mask, un
 142.196  #ifndef CONFIG_XEN_SHADOW_MODE
 142.197  void xen_pgd_pin(unsigned long ptr)
 142.198  {
 142.199 -    struct mmuext_op op;
 142.200 +	struct mmuext_op op;
 142.201  #ifdef CONFIG_X86_64
 142.202 -    op.cmd = MMUEXT_PIN_L4_TABLE;
 142.203 +	op.cmd = MMUEXT_PIN_L4_TABLE;
 142.204  #elif defined(CONFIG_X86_PAE)
 142.205 -    op.cmd = MMUEXT_PIN_L3_TABLE;
 142.206 +	op.cmd = MMUEXT_PIN_L3_TABLE;
 142.207  #else
 142.208 -    op.cmd = MMUEXT_PIN_L2_TABLE;
 142.209 +	op.cmd = MMUEXT_PIN_L2_TABLE;
 142.210  #endif
 142.211 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.212 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.213 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.214 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.215  }
 142.216  
 142.217  void xen_pgd_unpin(unsigned long ptr)
 142.218  {
 142.219 -    struct mmuext_op op;
 142.220 -    op.cmd = MMUEXT_UNPIN_TABLE;
 142.221 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.222 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.223 +	struct mmuext_op op;
 142.224 +	op.cmd = MMUEXT_UNPIN_TABLE;
 142.225 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.226 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.227  }
 142.228  
 142.229  void xen_pte_pin(unsigned long ptr)
 142.230  {
 142.231 -    struct mmuext_op op;
 142.232 -    op.cmd = MMUEXT_PIN_L1_TABLE;
 142.233 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.234 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.235 +	struct mmuext_op op;
 142.236 +	op.cmd = MMUEXT_PIN_L1_TABLE;
 142.237 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.238 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.239  }
 142.240  
 142.241  void xen_pte_unpin(unsigned long ptr)
 142.242  {
 142.243 -    struct mmuext_op op;
 142.244 -    op.cmd = MMUEXT_UNPIN_TABLE;
 142.245 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.246 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.247 +	struct mmuext_op op;
 142.248 +	op.cmd = MMUEXT_UNPIN_TABLE;
 142.249 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.250 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.251  }
 142.252  
 142.253  #ifdef CONFIG_X86_64
 142.254  void xen_pud_pin(unsigned long ptr)
 142.255  {
 142.256 -    struct mmuext_op op;
 142.257 -    op.cmd = MMUEXT_PIN_L3_TABLE;
 142.258 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.259 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.260 +	struct mmuext_op op;
 142.261 +	op.cmd = MMUEXT_PIN_L3_TABLE;
 142.262 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.263 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.264  }
 142.265  
 142.266  void xen_pud_unpin(unsigned long ptr)
 142.267  {
 142.268 -    struct mmuext_op op;
 142.269 -    op.cmd = MMUEXT_UNPIN_TABLE;
 142.270 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.271 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.272 +	struct mmuext_op op;
 142.273 +	op.cmd = MMUEXT_UNPIN_TABLE;
 142.274 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.275 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.276  }
 142.277  
 142.278  void xen_pmd_pin(unsigned long ptr)
 142.279  {
 142.280 -    struct mmuext_op op;
 142.281 -    op.cmd = MMUEXT_PIN_L2_TABLE;
 142.282 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.283 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.284 +	struct mmuext_op op;
 142.285 +	op.cmd = MMUEXT_PIN_L2_TABLE;
 142.286 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.287 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.288  }
 142.289  
 142.290  void xen_pmd_unpin(unsigned long ptr)
 142.291  {
 142.292 -    struct mmuext_op op;
 142.293 -    op.cmd = MMUEXT_UNPIN_TABLE;
 142.294 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.295 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.296 +	struct mmuext_op op;
 142.297 +	op.cmd = MMUEXT_UNPIN_TABLE;
 142.298 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
 142.299 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.300  }
 142.301  #endif /* CONFIG_X86_64 */
 142.302  #endif /* CONFIG_XEN_SHADOW_MODE */
 142.303  
 142.304  void xen_set_ldt(unsigned long ptr, unsigned long len)
 142.305  {
 142.306 -    struct mmuext_op op;
 142.307 -    op.cmd = MMUEXT_SET_LDT;
 142.308 -    op.linear_addr = ptr;
 142.309 -    op.nr_ents = len;
 142.310 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.311 +	struct mmuext_op op;
 142.312 +	op.cmd = MMUEXT_SET_LDT;
 142.313 +	op.linear_addr = ptr;
 142.314 +	op.nr_ents = len;
 142.315 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 142.316 +}
 142.317 +
 142.318 +/*
 142.319 + * Bitmap is indexed by page number. If bit is set, the page is part of a
 142.320 + * xen_create_contiguous_region() area of memory.
 142.321 + */
 142.322 +unsigned long *contiguous_bitmap;
 142.323 +
 142.324 +static void contiguous_bitmap_set(
 142.325 +	unsigned long first_page, unsigned long nr_pages)
 142.326 +{
 142.327 +	unsigned long start_off, end_off, curr_idx, end_idx;
 142.328 +
 142.329 +	curr_idx  = first_page / BITS_PER_LONG;
 142.330 +	start_off = first_page & (BITS_PER_LONG-1);
 142.331 +	end_idx   = (first_page + nr_pages) / BITS_PER_LONG;
 142.332 +	end_off   = (first_page + nr_pages) & (BITS_PER_LONG-1);
 142.333 +
 142.334 +	if (curr_idx == end_idx) {
 142.335 +		contiguous_bitmap[curr_idx] |=
 142.336 +			((1UL<<end_off)-1) & -(1UL<<start_off);
 142.337 +	} else {
 142.338 +		contiguous_bitmap[curr_idx] |= -(1UL<<start_off);
 142.339 +		while ( ++curr_idx < end_idx )
 142.340 +			contiguous_bitmap[curr_idx] = ~0UL;
 142.341 +		contiguous_bitmap[curr_idx] |= (1UL<<end_off)-1;
 142.342 +	}
 142.343 +}
 142.344 +
 142.345 +static void contiguous_bitmap_clear(
 142.346 +	unsigned long first_page, unsigned long nr_pages)
 142.347 +{
 142.348 +	unsigned long start_off, end_off, curr_idx, end_idx;
 142.349 +
 142.350 +	curr_idx  = first_page / BITS_PER_LONG;
 142.351 +	start_off = first_page & (BITS_PER_LONG-1);
 142.352 +	end_idx   = (first_page + nr_pages) / BITS_PER_LONG;
 142.353 +	end_off   = (first_page + nr_pages) & (BITS_PER_LONG-1);
 142.354 +
 142.355 +	if (curr_idx == end_idx) {
 142.356 +		contiguous_bitmap[curr_idx] &=
 142.357 +			-(1UL<<end_off) | ((1UL<<start_off)-1);
 142.358 +	} else {
 142.359 +		contiguous_bitmap[curr_idx] &= (1UL<<start_off)-1;
 142.360 +		while ( ++curr_idx != end_idx )
 142.361 +			contiguous_bitmap[curr_idx] = 0;
 142.362 +		contiguous_bitmap[curr_idx] &= -(1UL<<end_off);
 142.363 +	}
 142.364  }
 142.365  
 142.366 -void xen_contig_memory(unsigned long vstart, unsigned int order)
 142.367 +/* Ensure multi-page extents are contiguous in machine memory. */
 142.368 +void xen_create_contiguous_region(unsigned long vstart, unsigned int order)
 142.369  {
 142.370 -    /*
 142.371 -     * Ensure multi-page extents are contiguous in machine memory. This code 
 142.372 -     * could be cleaned up some, and the number of hypercalls reduced.
 142.373 -     */
 142.374 -    pgd_t         *pgd; 
 142.375 -    pud_t         *pud; 
 142.376 -    pmd_t         *pmd;
 142.377 -    pte_t         *pte;
 142.378 -    unsigned long  mfn, i, flags;
 142.379 +	pgd_t         *pgd; 
 142.380 +	pud_t         *pud; 
 142.381 +	pmd_t         *pmd;
 142.382 +	pte_t         *pte;
 142.383 +	unsigned long  mfn, i, flags;
 142.384  
 142.385 -    scrub_pages(vstart, 1 << order);
 142.386 +	scrub_pages(vstart, 1 << order);
 142.387  
 142.388 -    balloon_lock(flags);
 142.389 +	balloon_lock(flags);
 142.390  
 142.391 -    /* 1. Zap current PTEs, giving away the underlying pages. */
 142.392 -    for (i = 0; i < (1<<order); i++) {
 142.393 -        pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
 142.394 -        pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
 142.395 -        pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
 142.396 -        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
 142.397 -        mfn = pte_mfn(*pte);
 142.398 -        HYPERVISOR_update_va_mapping(
 142.399 -            vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
 142.400 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
 142.401 -            INVALID_P2M_ENTRY;
 142.402 -        BUG_ON(HYPERVISOR_dom_mem_op(
 142.403 -            MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
 142.404 -    }
 142.405 +	/* 1. Zap current PTEs, giving away the underlying pages. */
 142.406 +	for (i = 0; i < (1<<order); i++) {
 142.407 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
 142.408 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
 142.409 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
 142.410 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
 142.411 +		mfn = pte_mfn(*pte);
 142.412 +		BUG_ON(HYPERVISOR_update_va_mapping(
 142.413 +			vstart + (i*PAGE_SIZE), __pte_ma(0), 0));
 142.414 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
 142.415 +			INVALID_P2M_ENTRY;
 142.416 +		BUG_ON(HYPERVISOR_dom_mem_op(
 142.417 +			MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
 142.418 +	}
 142.419  
 142.420 -    /* 2. Get a new contiguous memory extent. */
 142.421 -    BUG_ON(HYPERVISOR_dom_mem_op(
 142.422 -	       MEMOP_increase_reservation, &mfn, 1, order | (32<<8)) != 1);
 142.423 +	/* 2. Get a new contiguous memory extent. */
 142.424 +	BUG_ON(HYPERVISOR_dom_mem_op(
 142.425 +		MEMOP_increase_reservation, &mfn, 1, order | (32<<8)) != 1);
 142.426  
 142.427 -    /* 3. Map the new extent in place of old pages. */
 142.428 -    for (i = 0; i < (1<<order); i++) {
 142.429 -        HYPERVISOR_update_va_mapping(
 142.430 -            vstart + (i*PAGE_SIZE),
 142.431 -            __pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0);
 142.432 -        xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
 142.433 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
 142.434 -    }
 142.435 +	/* 3. Map the new extent in place of old pages. */
 142.436 +	for (i = 0; i < (1<<order); i++) {
 142.437 +		BUG_ON(HYPERVISOR_update_va_mapping(
 142.438 +			vstart + (i*PAGE_SIZE),
 142.439 +			pfn_pte_ma(mfn+i, PAGE_KERNEL), 0));
 142.440 +		xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
 142.441 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
 142.442 +	}
 142.443  
 142.444 -    flush_tlb_all();
 142.445 +	flush_tlb_all();
 142.446  
 142.447 -    balloon_unlock(flags);
 142.448 +	contiguous_bitmap_set(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
 142.449 +
 142.450 +	balloon_unlock(flags);
 142.451  }
 142.452  
 142.453 -#ifdef CONFIG_XEN_PHYSDEV_ACCESS
 142.454 -
 142.455 -unsigned long allocate_empty_lowmem_region(unsigned long pages)
 142.456 +void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
 142.457  {
 142.458 -    pgd_t         *pgd;
 142.459 -    pud_t         *pud; 
 142.460 -    pmd_t         *pmd;
 142.461 -    pte_t         *pte;
 142.462 -    unsigned long *pfn_array;
 142.463 -    unsigned long  vstart;
 142.464 -    unsigned long  i;
 142.465 -    unsigned int   order = get_order(pages*PAGE_SIZE);
 142.466 +	pgd_t         *pgd; 
 142.467 +	pud_t         *pud; 
 142.468 +	pmd_t         *pmd;
 142.469 +	pte_t         *pte;
 142.470 +	unsigned long  mfn, i, flags;
 142.471  
 142.472 -    vstart = __get_free_pages(GFP_KERNEL, order);
 142.473 -    if ( vstart == 0 )
 142.474 -        return 0UL;
 142.475 +	scrub_pages(vstart, 1 << order);
 142.476  
 142.477 -    scrub_pages(vstart, 1 << order);
 142.478 +	balloon_lock(flags);
 142.479  
 142.480 -    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
 142.481 -    if ( pfn_array == NULL )
 142.482 -        BUG();
 142.483 +	contiguous_bitmap_clear(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
 142.484  
 142.485 -    for ( i = 0; i < (1<<order); i++ )
 142.486 -    {
 142.487 -        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
 142.488 -        pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
 142.489 -        pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
 142.490 -        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); 
 142.491 -        pfn_array[i] = pte_mfn(*pte);
 142.492 -#ifdef CONFIG_X86_64
 142.493 -        xen_l1_entry_update(pte, __pte(0));
 142.494 -#else
 142.495 -        HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
 142.496 -#endif
 142.497 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
 142.498 -            INVALID_P2M_ENTRY;
 142.499 -    }
 142.500 +	/* 1. Zap current PTEs, giving away the underlying pages. */
 142.501 +	for (i = 0; i < (1<<order); i++) {
 142.502 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
 142.503 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
 142.504 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
 142.505 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
 142.506 +		mfn = pte_mfn(*pte);
 142.507 +		BUG_ON(HYPERVISOR_update_va_mapping(
 142.508 +			vstart + (i*PAGE_SIZE), __pte_ma(0), 0));
 142.509 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
 142.510 +			INVALID_P2M_ENTRY;
 142.511 +		BUG_ON(HYPERVISOR_dom_mem_op(
 142.512 +			MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
 142.513 +	}
 142.514  
 142.515 -    flush_tlb_all();
 142.516 -
 142.517 -    balloon_put_pages(pfn_array, 1 << order);
 142.518 +	/* 2. Map new pages in place of old pages. */
 142.519 +	for (i = 0; i < (1<<order); i++) {
 142.520 +		BUG_ON(HYPERVISOR_dom_mem_op(
 142.521 +			MEMOP_increase_reservation, &mfn, 1, 0) != 1);
 142.522 +		BUG_ON(HYPERVISOR_update_va_mapping(
 142.523 +			vstart + (i*PAGE_SIZE),
 142.524 +			pfn_pte_ma(mfn, PAGE_KERNEL), 0));
 142.525 +		xen_machphys_update(mfn, (__pa(vstart)>>PAGE_SHIFT)+i);
 142.526 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn;
 142.527 +	}
 142.528  
 142.529 -    vfree(pfn_array);
 142.530 +	flush_tlb_all();
 142.531  
 142.532 -    return vstart;
 142.533 +	balloon_unlock(flags);
 142.534  }
 142.535  
 142.536 -#endif /* CONFIG_XEN_PHYSDEV_ACCESS */
 142.537 +/*
 142.538 + * Local variables:
 142.539 + *  c-file-style: "linux"
 142.540 + *  indent-tabs-mode: t
 142.541 + *  c-indent-level: 8
 142.542 + *  c-basic-offset: 8
 142.543 + *  tab-width: 8
 142.544 + * End:
 142.545 + */
   143.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Tue Aug 23 18:43:18 2005 -0800
   143.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Thu Aug 25 15:53:20 2005 -0700
   143.3 @@ -41,6 +41,14 @@
   143.4  #include <asm/sections.h>
   143.5  #include <asm-xen/hypervisor.h>
   143.6  
   143.7 +extern unsigned long *contiguous_bitmap;
   143.8 +
   143.9 +#if defined(CONFIG_SWIOTLB)
  143.10 +extern void swiotlb_init(void);
  143.11 +int swiotlb;
  143.12 +EXPORT_SYMBOL(swiotlb);
  143.13 +#endif
  143.14 +
  143.15  unsigned int __VMALLOC_RESERVE = 128 << 20;
  143.16  
  143.17  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
  143.18 @@ -334,18 +342,18 @@ unsigned long long __PAGE_KERNEL_EXEC = 
  143.19  extern void __init remap_numa_kva(void);
  143.20  #endif
  143.21  
  143.22 +pgd_t *swapper_pg_dir;
  143.23 +
  143.24  static void __init pagetable_init (void)
  143.25  {
  143.26  	unsigned long vaddr;
  143.27 -	pgd_t *pgd_base = swapper_pg_dir;
  143.28 -	pgd_t *old_pgd = (pgd_t *)xen_start_info.pt_base;
  143.29 -
  143.30 -#ifdef CONFIG_X86_PAE
  143.31 +	pgd_t *pgd_base = (pgd_t *)xen_start_info.pt_base;
  143.32  	int i;
  143.33 -	/* Init entries of the first-level page table to the zero page */
  143.34 -	for (i = 0; i < PTRS_PER_PGD; i++)
  143.35 -		set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT));
  143.36 -#endif
  143.37 +
  143.38 +	swapper_pg_dir = pgd_base;
  143.39 +	init_mm.pgd    = pgd_base;
  143.40 +	for (i = 0; i < NR_CPUS; i++)
  143.41 +		per_cpu(cur_pgd, i) = pgd_base;
  143.42  
  143.43  	/* Enable PSE if available */
  143.44  	if (cpu_has_pse) {
  143.45 @@ -359,44 +367,6 @@ static void __init pagetable_init (void)
  143.46  		__PAGE_KERNEL_EXEC |= _PAGE_GLOBAL;
  143.47  	}
  143.48  
  143.49 -	/*
  143.50 -	 * Switch to proper mm_init page directory. Initialise from the current
  143.51 -	 * page directory, write-protect the new page directory, then switch to
  143.52 -	 * it. We clean up by write-enabling and then freeing the old page dir.
  143.53 -	 */
  143.54 -#ifndef CONFIG_X86_PAE
  143.55 -	memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
  143.56 -	make_page_readonly(pgd_base);
  143.57 -	xen_pgd_pin(__pa(pgd_base));
  143.58 -	load_cr3(pgd_base);
  143.59 -	xen_pgd_unpin(__pa(old_pgd));
  143.60 -	make_page_writable(old_pgd);
  143.61 -	__flush_tlb_all();
  143.62 -	free_bootmem(__pa(old_pgd), PAGE_SIZE);
  143.63 -#else
  143.64 -	{
  143.65 -		pud_t *old_pud = pud_offset(old_pgd+3, PAGE_OFFSET);
  143.66 -		pmd_t *old_pmd = pmd_offset(old_pud, PAGE_OFFSET);
  143.67 -		pmd_t *new_pmd = alloc_bootmem_low_pages(PAGE_SIZE);
  143.68 -
  143.69 -		memcpy(new_pmd,  old_pmd, PAGE_SIZE);
  143.70 -		memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
  143.71 -		set_pgd(&pgd_base[3], __pgd(__pa(new_pmd) | _PAGE_PRESENT));
  143.72 -
  143.73 -		make_page_readonly(new_pmd);
  143.74 -		make_page_readonly(pgd_base);
  143.75 -		xen_pgd_pin(__pa(pgd_base));
  143.76 -		load_cr3(pgd_base);
  143.77 -		xen_pgd_unpin(__pa(old_pgd));
  143.78 -		make_page_writable(old_pgd);
  143.79 -		make_page_writable(old_pmd);
  143.80 -		__flush_tlb_all();
  143.81 -
  143.82 -		free_bootmem(__pa(old_pgd), PAGE_SIZE);
  143.83 -		free_bootmem(__pa(old_pmd), PAGE_SIZE);
  143.84 -	}
  143.85 -#endif
  143.86 -
  143.87  	init_mm.context.pinned = 1;
  143.88  	kernel_physical_mapping_init(pgd_base);
  143.89  	remap_numa_kva();
  143.90 @@ -409,17 +379,6 @@ static void __init pagetable_init (void)
  143.91  	page_table_range_init(vaddr, 0, pgd_base);
  143.92  
  143.93  	permanent_kmaps_init(pgd_base);
  143.94 -
  143.95 -#if 0 /* def CONFIG_X86_PAE */
  143.96 -	/*
  143.97 -	 * Add low memory identity-mappings - SMP needs it when
  143.98 -	 * starting up on an AP from real-mode. In the non-PAE
  143.99 -	 * case we already have these mappings through head.S.
 143.100 -	 * All user-space mappings are explicitly cleared after
 143.101 -	 * SMP startup.
 143.102 -	 */
 143.103 -	set_pgd(&pgd_base[0], pgd_base[USER_PTRS_PER_PGD]);
 143.104 -#endif
 143.105  }
 143.106  
 143.107  #if defined(CONFIG_PM_DISK) || defined(CONFIG_SOFTWARE_SUSPEND)
 143.108 @@ -631,6 +590,15 @@ void __init mem_init(void)
 143.109  	int bad_ppro;
 143.110  	unsigned long pfn;
 143.111  
 143.112 +	contiguous_bitmap = alloc_bootmem_low_pages(
 143.113 +		(max_low_pfn + 2*BITS_PER_LONG) >> 3);
 143.114 +	BUG_ON(!contiguous_bitmap);
 143.115 +	memset(contiguous_bitmap, 0, (max_low_pfn + 2*BITS_PER_LONG) >> 3);
 143.116 +
 143.117 +#if defined(CONFIG_SWIOTLB)
 143.118 +	swiotlb_init();	
 143.119 +#endif
 143.120 +
 143.121  #ifndef CONFIG_DISCONTIGMEM
 143.122  	if (!mem_map)
 143.123  		BUG();
   144.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c	Tue Aug 23 18:43:18 2005 -0800
   144.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c	Thu Aug 25 15:53:20 2005 -0700
   144.3 @@ -36,6 +36,8 @@ void iounmap(volatile void __iomem *addr
   144.4  {
   144.5  }
   144.6  
   144.7 +#ifdef __i386__
   144.8 +
   144.9  void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
  144.10  {
  144.11  	return NULL;
  144.12 @@ -45,6 +47,8 @@ void __init bt_iounmap(void *addr, unsig
  144.13  {
  144.14  }
  144.15  
  144.16 +#endif /* __i386__ */
  144.17 +
  144.18  #else
  144.19  
  144.20  /*
  144.21 @@ -58,7 +62,7 @@ static inline int is_local_lowmem(unsign
  144.22  	extern unsigned long max_low_pfn;
  144.23  	unsigned long mfn = address >> PAGE_SHIFT;
  144.24  	unsigned long pfn = mfn_to_pfn(mfn);
  144.25 -	return ((pfn < max_low_pfn) && (pfn_to_mfn(pfn) == mfn));
  144.26 +	return ((pfn < max_low_pfn) && (phys_to_machine_mapping[pfn] == mfn));
  144.27  }
  144.28  
  144.29  /*
  144.30 @@ -126,10 +130,12 @@ void __iomem * __ioremap(unsigned long p
  144.31  		return NULL;
  144.32  	area->phys_addr = phys_addr;
  144.33  	addr = (void __iomem *) area->addr;
  144.34 +	flags |= _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED;
  144.35 +#ifdef __x86_64__
  144.36 +	flags |= _PAGE_USER;
  144.37 +#endif
  144.38  	if (direct_remap_area_pages(&init_mm, (unsigned long) addr, phys_addr,
  144.39 -				    size, __pgprot(_PAGE_PRESENT | _PAGE_RW |
  144.40 -						   _PAGE_DIRTY | _PAGE_ACCESSED
  144.41 -						   | flags), domid)) {
  144.42 +				    size, __pgprot(flags), domid)) {
  144.43  		vunmap((void __force *) addr);
  144.44  		return NULL;
  144.45  	}
  144.46 @@ -218,6 +224,8 @@ void iounmap(volatile void __iomem *addr
  144.47  	kfree(p); 
  144.48  }
  144.49  
  144.50 +#ifdef __i386__
  144.51 +
  144.52  void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
  144.53  {
  144.54  	unsigned long offset, last_addr;
  144.55 @@ -289,6 +297,8 @@ void __init bt_iounmap(void *addr, unsig
  144.56  	}
  144.57  }
  144.58  
  144.59 +#endif /* __i386__ */
  144.60 +
  144.61  #endif /* CONFIG_XEN_PHYSDEV_ACCESS */
  144.62  
  144.63  /* These hacky macros avoid phys->machine translations. */
  144.64 @@ -298,90 +308,20 @@ void __init bt_iounmap(void *addr, unsig
  144.65  #define direct_mk_pte_phys(physpage, pgprot) \
  144.66    __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot)
  144.67  
  144.68 -static inline void direct_remap_area_pte(pte_t *pte, 
  144.69 -					 unsigned long address, 
  144.70 -					 unsigned long size,
  144.71 -					 mmu_update_t **v)
  144.72 -{
  144.73 -	unsigned long end;
  144.74 -
  144.75 -	address &= ~PMD_MASK;
  144.76 -	end = address + size;
  144.77 -	if (end > PMD_SIZE)
  144.78 -		end = PMD_SIZE;
  144.79 -	if (address >= end)
  144.80 -		BUG();
  144.81 -
  144.82 -	do {
  144.83 -		(*v)->ptr = virt_to_machine(pte);
  144.84 -		(*v)++;
  144.85 -		address += PAGE_SIZE;
  144.86 -		pte++;
  144.87 -	} while (address && (address < end));
  144.88 -}
  144.89  
  144.90 -static inline int direct_remap_area_pmd(struct mm_struct *mm,
  144.91 -					pmd_t *pmd, 
  144.92 -					unsigned long address, 
  144.93 -					unsigned long size,
  144.94 -					mmu_update_t **v)
  144.95 +static int direct_remap_area_pte_fn(pte_t *pte, 
  144.96 +				    struct page *pte_page,
  144.97 +				    unsigned long address, 
  144.98 +				    void *data)
  144.99  {
 144.100 -	unsigned long end;
 144.101 +	mmu_update_t **v = (mmu_update_t **)data;
 144.102  
 144.103 -	address &= ~PGDIR_MASK;
 144.104 -	end = address + size;
 144.105 -	if (end > PGDIR_SIZE)
 144.106 -		end = PGDIR_SIZE;
 144.107 -	if (address >= end)
 144.108 -		BUG();
 144.109 -	do {
 144.110 -		pte_t *pte = (mm == &init_mm) ? 
 144.111 -			pte_alloc_kernel(mm, pmd, address) :
 144.112 -			pte_alloc_map(mm, pmd, address);
 144.113 -		if (!pte)
 144.114 -			return -ENOMEM;
 144.115 -		direct_remap_area_pte(pte, address, end - address, v);
 144.116 -		pte_unmap(pte);
 144.117 -		address = (address + PMD_SIZE) & PMD_MASK;
 144.118 -		pmd++;
 144.119 -	} while (address && (address < end));
 144.120 +	(*v)->ptr = ((maddr_t)pfn_to_mfn(page_to_pfn(pte_page)) <<
 144.121 +		     PAGE_SHIFT) | ((unsigned long)pte & ~PAGE_MASK);
 144.122 +	(*v)++;
 144.123 +
 144.124  	return 0;
 144.125  }
 144.126 - 
 144.127 -int __direct_remap_area_pages(struct mm_struct *mm,
 144.128 -			      unsigned long address, 
 144.129 -			      unsigned long size, 
 144.130 -			      mmu_update_t *v)
 144.131 -{
 144.132 -	pgd_t * dir;
 144.133 -	unsigned long end = address + size;
 144.134 -	int error;
 144.135 -
 144.136 -	dir = pgd_offset(mm, address);
 144.137 -	if (address >= end)
 144.138 -		BUG();
 144.139 -	spin_lock(&mm->page_table_lock);
 144.140 -	do {
 144.141 -		pud_t *pud;
 144.142 -		pmd_t *pmd;
 144.143 -
 144.144 -		error = -ENOMEM;
 144.145 -		pud = pud_alloc(mm, dir, address);
 144.146 -		if (!pud)
 144.147 -			break;
 144.148 -		pmd = pmd_alloc(mm, pud, address);
 144.149 -		if (!pmd)
 144.150 -			break;
 144.151 -		error = 0;
 144.152 -		direct_remap_area_pmd(mm, pmd, address, end - address, &v);
 144.153 -		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 144.154 -		dir++;
 144.155 -
 144.156 -	} while (address && (address < end));
 144.157 -	spin_unlock(&mm->page_table_lock);
 144.158 -	return error;
 144.159 -}
 144.160 -
 144.161  
 144.162  int direct_remap_area_pages(struct mm_struct *mm,
 144.163  			    unsigned long address, 
 144.164 @@ -393,7 +333,7 @@ int direct_remap_area_pages(struct mm_st
 144.165  	int i;
 144.166  	unsigned long start_address;
 144.167  #define MAX_DIRECTMAP_MMU_QUEUE 130
 144.168 -	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v = u;
 144.169 +	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v = u, *w = u;
 144.170  
 144.171  	start_address = address;
 144.172  
 144.173 @@ -402,11 +342,10 @@ int direct_remap_area_pages(struct mm_st
 144.174  	for (i = 0; i < size; i += PAGE_SIZE) {
 144.175  		if ((v - u) == MAX_DIRECTMAP_MMU_QUEUE) {
 144.176  			/* Fill in the PTE pointers. */
 144.177 -			__direct_remap_area_pages(mm,
 144.178 -						  start_address, 
 144.179 -						  address-start_address, 
 144.180 -						  u);
 144.181 - 
 144.182 +			generic_page_range(mm, start_address, 
 144.183 +					   address - start_address,
 144.184 +					   direct_remap_area_pte_fn, &w);
 144.185 +			w = u;
 144.186  			if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
 144.187  				return -EFAULT;
 144.188  			v = u;
 144.189 @@ -417,7 +356,7 @@ int direct_remap_area_pages(struct mm_st
 144.190  		 * Fill in the machine address: PTE ptr is done later by
 144.191  		 * __direct_remap_area_pages(). 
 144.192  		 */
 144.193 -		v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot);
 144.194 +		v->val = pte_val_ma(pfn_pte_ma(machine_addr >> PAGE_SHIFT, prot));
 144.195  
 144.196  		machine_addr += PAGE_SIZE;
 144.197  		address += PAGE_SIZE; 
 144.198 @@ -426,10 +365,8 @@ int direct_remap_area_pages(struct mm_st
 144.199  
 144.200  	if (v != u) {
 144.201  		/* get the ptep's filled in */
 144.202 -		__direct_remap_area_pages(mm,
 144.203 -					  start_address, 
 144.204 -					  address-start_address, 
 144.205 -					  u);
 144.206 +		generic_page_range(mm, start_address, address - start_address,
 144.207 +				   direct_remap_area_pte_fn, &w);
 144.208  		if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0))
 144.209  			return -EFAULT;
 144.210  	}
 144.211 @@ -440,3 +377,48 @@ int direct_remap_area_pages(struct mm_st
 144.212  }
 144.213  
 144.214  EXPORT_SYMBOL(direct_remap_area_pages);
 144.215 +
 144.216 +static int lookup_pte_fn(
 144.217 +	pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
 144.218 +{
 144.219 +	unsigned long *ptep = (unsigned long *)data;
 144.220 +	if (ptep)
 144.221 +		*ptep = (pfn_to_mfn(page_to_pfn(pte_page)) <<
 144.222 +			 PAGE_SHIFT) |
 144.223 +			((unsigned long)pte & ~PAGE_MASK);
 144.224 +	return 0;
 144.225 +}
 144.226 +
 144.227 +int create_lookup_pte_addr(struct mm_struct *mm, 
 144.228 +			   unsigned long address,
 144.229 +			   unsigned long *ptep)
 144.230 +{
 144.231 +	return generic_page_range(mm, address, PAGE_SIZE, lookup_pte_fn, ptep);
 144.232 +}
 144.233 +
 144.234 +EXPORT_SYMBOL(create_lookup_pte_addr);
 144.235 +
 144.236 +static int noop_fn(
 144.237 +	pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
 144.238 +{
 144.239 +	return 0;
 144.240 +}
 144.241 +
 144.242 +int touch_pte_range(struct mm_struct *mm,
 144.243 +		    unsigned long address,
 144.244 +		    unsigned long size)
 144.245 +{
 144.246 +	return generic_page_range(mm, address, size, noop_fn, NULL);
 144.247 +} 
 144.248 +
 144.249 +EXPORT_SYMBOL(touch_pte_range);
 144.250 +
 144.251 +/*
 144.252 + * Local variables:
 144.253 + *  c-file-style: "linux"
 144.254 + *  indent-tabs-mode: t
 144.255 + *  c-indent-level: 8
 144.256 + *  c-basic-offset: 8
 144.257 + *  tab-width: 8
 144.258 + * End:
 144.259 + */
   145.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Tue Aug 23 18:43:18 2005 -0800
   145.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Aug 25 15:53:20 2005 -0700
   145.3 @@ -25,6 +25,7 @@
   145.4  #include <asm/mmu_context.h>
   145.5  
   145.6  #include <asm-xen/foreign_page.h>
   145.7 +#include <asm-xen/hypervisor.h>
   145.8  
   145.9  void show_mem(void)
  145.10  {
  145.11 @@ -169,7 +170,7 @@ void set_pmd_pfn(unsigned long vaddr, un
  145.12  	__flush_tlb_one(vaddr);
  145.13  }
  145.14  
  145.15 -void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
  145.16 +void __set_fixmap (enum fixed_addresses idx, maddr_t phys, pgprot_t flags)
  145.17  {
  145.18  	unsigned long address = __fix_to_virt(idx);
  145.19  
  145.20 @@ -221,8 +222,8 @@ void pte_free(struct page *pte)
  145.21  	unsigned long va = (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT);
  145.22  
  145.23  	if (!pte_write(*virt_to_ptep(va)))
  145.24 -		HYPERVISOR_update_va_mapping(
  145.25 -			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0);
  145.26 +		BUG_ON(HYPERVISOR_update_va_mapping(
  145.27 +			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0));
  145.28  
  145.29  	ClearPageForeign(pte);
  145.30  	set_page_count(pte, 1);
  145.31 @@ -274,6 +275,11 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
  145.32  {
  145.33  	unsigned long flags;
  145.34  
  145.35 +#ifdef CONFIG_X86_PAE
  145.36 +	/* this gives us a page below 4GB */
  145.37 +	xen_create_contiguous_region((unsigned long)pgd, 0);
  145.38 +#endif
  145.39 +
  145.40  	if (!HAVE_SHARED_KERNEL_PMD)
  145.41  		spin_lock_irqsave(&pgd_lock, flags);
  145.42  
  145.43 @@ -349,16 +355,17 @@ void pgd_free(pgd_t *pgd)
  145.44  
  145.45  	if (!pte_write(*ptep)) {
  145.46  		xen_pgd_unpin(__pa(pgd));
  145.47 -		HYPERVISOR_update_va_mapping(
  145.48 +		BUG_ON(HYPERVISOR_update_va_mapping(
  145.49  			(unsigned long)pgd,
  145.50  			pfn_pte(virt_to_phys(pgd)>>PAGE_SHIFT, PAGE_KERNEL),
  145.51 -			0);
  145.52 +			0));
  145.53  	}
  145.54  
  145.55  	/* in the PAE case user pgd entries are overwritten before usage */
  145.56  	if (PTRS_PER_PMD > 1) {
  145.57  		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
  145.58  			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
  145.59 +			make_page_writable(pmd);
  145.60  			kmem_cache_free(pmd_cache, pmd);
  145.61  		}
  145.62  		if (!HAVE_SHARED_KERNEL_PMD) {
  145.63 @@ -444,9 +451,9 @@ static inline void mm_walk_set_prot(void
  145.64  
  145.65  	if (PageHighMem(page))
  145.66  		return;
  145.67 -	HYPERVISOR_update_va_mapping(
  145.68 +	BUG_ON(HYPERVISOR_update_va_mapping(
  145.69  		(unsigned long)__va(pfn << PAGE_SHIFT),
  145.70 -		pfn_pte(pfn, flags), 0);
  145.71 +		pfn_pte(pfn, flags), 0));
  145.72  }
  145.73  
  145.74  static void mm_walk(struct mm_struct *mm, pgprot_t flags)
  145.75 @@ -485,10 +492,10 @@ void mm_pin(struct mm_struct *mm)
  145.76      spin_lock(&mm->page_table_lock);
  145.77  
  145.78      mm_walk(mm, PAGE_KERNEL_RO);
  145.79 -    HYPERVISOR_update_va_mapping(
  145.80 +    BUG_ON(HYPERVISOR_update_va_mapping(
  145.81          (unsigned long)mm->pgd,
  145.82          pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL_RO),
  145.83 -        UVMF_TLB_FLUSH);
  145.84 +        UVMF_TLB_FLUSH));
  145.85      xen_pgd_pin(__pa(mm->pgd));
  145.86      mm->context.pinned = 1;
  145.87      spin_lock(&mm_unpinned_lock);
  145.88 @@ -503,9 +510,9 @@ void mm_unpin(struct mm_struct *mm)
  145.89      spin_lock(&mm->page_table_lock);
  145.90  
  145.91      xen_pgd_unpin(__pa(mm->pgd));
  145.92 -    HYPERVISOR_update_va_mapping(
  145.93 +    BUG_ON(HYPERVISOR_update_va_mapping(
  145.94          (unsigned long)mm->pgd,
  145.95 -        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0);
  145.96 +        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0));
  145.97      mm_walk(mm, PAGE_KERNEL);
  145.98      xen_tlb_flush();
  145.99      mm->context.pinned = 0;
   146.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile	Tue Aug 23 18:43:18 2005 -0800
   146.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile	Thu Aug 25 15:53:20 2005 -0700
   146.3 @@ -17,7 +17,7 @@ l-pci-y				+= irq.o
   146.4  c-pci-$(CONFIG_X86_VISWS)	:= visws.o fixup.o
   146.5  pci-$(CONFIG_X86_VISWS)		:=
   146.6  c-pci-$(CONFIG_X86_NUMAQ)	:= numa.o
   146.7 -pci-$(CONFIG_X86_NUMAQ)		:= irq.o
   146.8 +l-pci-$(CONFIG_X86_NUMAQ)	:= irq.o
   146.9  
  146.10  obj-y				+= $(pci-y)
  146.11  c-obj-y				+= $(c-pci-y) common.o
  146.12 @@ -27,6 +27,7 @@ c-link	:=
  146.13  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
  146.14  	@ln -fsn $(srctree)/arch/i386/pci/$(notdir $@) $@
  146.15  
  146.16 -obj-y	+= $(c-obj-y) $(l-pci-y)
  146.17 +# Make sure irq.o gets linked in before common.o
  146.18 +obj-y	+= $(patsubst common.o,$(l-pci-y) common.o,$(c-obj-y))
  146.19  
  146.20  clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
   151.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Tue Aug 23 18:43:18 2005 -0800
   151.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Thu Aug 25 15:53:20 2005 -0700
   151.3 @@ -116,9 +116,9 @@ extern asmlinkage unsigned int do_IRQ(st
   151.4  #elif defined (__x86_64__)
   151.5  #define IRQ_REG orig_rax
   151.6  #endif
   151.7 -#define do_IRQ(irq, regs) do {		\
   151.8 -    (regs)->IRQ_REG = (irq);		\
   151.9 -    do_IRQ((regs));			\
  151.10 +#define do_IRQ(irq, regs) do {                  \
  151.11 +    (regs)->IRQ_REG = (irq);                    \
  151.12 +    do_IRQ((regs));                             \
  151.13  } while (0)
  151.14  #endif
  151.15  
  151.16 @@ -137,14 +137,14 @@ void force_evtchn_callback(void)
  151.17  /* NB. Interrupts are disabled on entry. */
  151.18  asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
  151.19  {
  151.20 -    u32 	   l1, l2;
  151.21 +    u32     l1, l2;
  151.22      unsigned int   l1i, l2i, port;
  151.23      int            irq, cpu = smp_processor_id();
  151.24      shared_info_t *s = HYPERVISOR_shared_info;
  151.25      vcpu_info_t   *vcpu_info = &s->vcpu_data[cpu];
  151.26  
  151.27      vcpu_info->evtchn_upcall_pending = 0;
  151.28 -    
  151.29 +
  151.30      /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
  151.31      l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
  151.32      while ( l1 != 0 )
  151.33 @@ -158,9 +158,9 @@ asmlinkage void evtchn_do_upcall(struct 
  151.34              l2 &= ~(1 << l2i);
  151.35              
  151.36              port = (l1i << 5) + l2i;
  151.37 -            if ( (irq = evtchn_to_irq[port]) != -1 )
  151.38 +            if ( (irq = evtchn_to_irq[port]) != -1 ) {
  151.39                  do_IRQ(irq, regs);
  151.40 -            else
  151.41 +	    } else
  151.42                  evtchn_device_upcall(port);
  151.43          }
  151.44      }
  151.45 @@ -229,13 +229,14 @@ void unbind_virq_from_irq(int virq)
  151.46          if ( HYPERVISOR_event_channel_op(&op) != 0 )
  151.47              panic("Failed to unbind virtual IRQ %d\n", virq);
  151.48  
  151.49 -	/* This is a slight hack.  Interdomain ports can be allocated
  151.50 -	   directly by userspace, and at that point they get bound by
  151.51 -	   Xen to vcpu 0.  We therefore need to make sure that if we
  151.52 -	   get an event on an event channel we don't know about vcpu 0
  151.53 -	   handles it.  Binding channels to vcpu 0 when closing them
  151.54 -	   achieves this. */
  151.55 -	bind_evtchn_to_cpu(evtchn, 0);
  151.56 +        /*
  151.57 +         * This is a slight hack. Interdomain ports can be allocated directly 
  151.58 +         * by userspace, and at that point they get bound by Xen to vcpu 0. We 
  151.59 +         * therefore need to make sure that if we get an event on an event 
  151.60 +         * channel we don't know about vcpu 0 handles it. Binding channels to 
  151.61 +         * vcpu 0 when closing them achieves this.
  151.62 +         */
  151.63 +        bind_evtchn_to_cpu(evtchn, 0);
  151.64          evtchn_to_irq[evtchn] = -1;
  151.65          irq_to_evtchn[irq]    = -1;
  151.66          per_cpu(virq_to_irq, cpu)[virq]     = -1;
  151.67 @@ -244,7 +245,75 @@ void unbind_virq_from_irq(int virq)
  151.68      spin_unlock(&irq_mapping_update_lock);
  151.69  }
  151.70  
  151.71 -int bind_ipi_on_cpu_to_irq(int ipi)
  151.72 +/* This is only used when a vcpu from an xm save.  The ipi is expected
  151.73 +   to have been bound before we suspended, and so all of the xenolinux
  151.74 +   state is set up; we only need to restore the Xen side of things.
  151.75 +   The irq number has to be the same, but the evtchn number can
  151.76 +   change. */
  151.77 +void _bind_ipi_to_irq(int ipi, int vcpu, int irq)
  151.78 +{
  151.79 +    evtchn_op_t op;
  151.80 +    int evtchn;
  151.81 +
  151.82 +    spin_lock(&irq_mapping_update_lock);
  151.83 +
  151.84 +    op.cmd = EVTCHNOP_bind_ipi;
  151.85 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  151.86 +	panic("Failed to bind virtual IPI %d on cpu %d\n", ipi, vcpu);
  151.87 +    evtchn = op.u.bind_ipi.port;
  151.88 +
  151.89 +    printk("<0>IPI %d, old evtchn %d, evtchn %d.\n",
  151.90 +	   ipi, per_cpu(ipi_to_evtchn, vcpu)[ipi],
  151.91 +	   evtchn);
  151.92 +
  151.93 +    evtchn_to_irq[irq_to_evtchn[irq]] = -1;
  151.94 +    irq_to_evtchn[irq] = -1;
  151.95 +
  151.96 +    evtchn_to_irq[evtchn] = irq;
  151.97 +    irq_to_evtchn[irq]    = evtchn;
  151.98 +
  151.99 +    printk("<0>evtchn_to_irq[%d] = %d.\n", evtchn,
 151.100 +	   evtchn_to_irq[evtchn]);
 151.101 +    per_cpu(ipi_to_evtchn, vcpu)[ipi] = evtchn;
 151.102 +
 151.103 +    bind_evtchn_to_cpu(evtchn, vcpu);
 151.104 +
 151.105 +    spin_unlock(&irq_mapping_update_lock);
 151.106 +
 151.107 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_mask);
 151.108 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_pending);
 151.109 +}
 151.110 +
 151.111 +void _bind_virq_to_irq(int virq, int cpu, int irq)
 151.112 +{
 151.113 +    evtchn_op_t op;
 151.114 +    int evtchn;
 151.115 +
 151.116 +    spin_lock(&irq_mapping_update_lock);
 151.117 +
 151.118 +    op.cmd              = EVTCHNOP_bind_virq;
 151.119 +    op.u.bind_virq.virq = virq;
 151.120 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
 151.121 +            panic("Failed to bind virtual IRQ %d\n", virq);
 151.122 +    evtchn = op.u.bind_virq.port;
 151.123 +
 151.124 +    evtchn_to_irq[irq_to_evtchn[irq]] = -1;
 151.125 +    irq_to_evtchn[irq] = -1;
 151.126 +
 151.127 +    evtchn_to_irq[evtchn] = irq;
 151.128 +    irq_to_evtchn[irq]    = evtchn;
 151.129 +
 151.130 +    per_cpu(virq_to_irq, cpu)[virq] = irq;
 151.131 +
 151.132 +    bind_evtchn_to_cpu(evtchn, cpu);
 151.133 +
 151.134 +    spin_unlock(&irq_mapping_update_lock);
 151.135 +
 151.136 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_mask);
 151.137 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_pending);
 151.138 +}
 151.139 +
 151.140 +int bind_ipi_to_irq(int ipi)
 151.141  {
 151.142      evtchn_op_t op;
 151.143      int evtchn, irq;
 151.144 @@ -269,7 +338,7 @@ int bind_ipi_on_cpu_to_irq(int ipi)
 151.145      } 
 151.146      else
 151.147      {
 151.148 -	irq = evtchn_to_irq[evtchn];
 151.149 +        irq = evtchn_to_irq[evtchn];
 151.150      }
 151.151  
 151.152      irq_bindcount[irq]++;
 151.153 @@ -284,29 +353,29 @@ void unbind_ipi_from_irq(int ipi)
 151.154      evtchn_op_t op;
 151.155      int cpu    = smp_processor_id();
 151.156      int evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi];
 151.157 -    int irq    = irq_to_evtchn[evtchn];
 151.158 +    int irq    = evtchn_to_irq[evtchn];
 151.159  
 151.160      spin_lock(&irq_mapping_update_lock);
 151.161  
 151.162      if ( --irq_bindcount[irq] == 0 )
 151.163      {
 151.164 -	op.cmd          = EVTCHNOP_close;
 151.165 -	op.u.close.dom  = DOMID_SELF;
 151.166 -	op.u.close.port = evtchn;
 151.167 -	if ( HYPERVISOR_event_channel_op(&op) != 0 )
 151.168 -	    panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
 151.169 +        op.cmd          = EVTCHNOP_close;
 151.170 +        op.u.close.dom  = DOMID_SELF;
 151.171 +        op.u.close.port = evtchn;
 151.172 +        if ( HYPERVISOR_event_channel_op(&op) != 0 )
 151.173 +            panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
 151.174  
 151.175 -	/* See comments in unbind_virq_from_irq */
 151.176 -	bind_evtchn_to_cpu(evtchn, 0);
 151.177 +        /* See comments in unbind_virq_from_irq */
 151.178 +        bind_evtchn_to_cpu(evtchn, 0);
 151.179          evtchn_to_irq[evtchn] = -1;
 151.180          irq_to_evtchn[irq]    = -1;
 151.181 -	per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
 151.182 +        per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
 151.183      }
 151.184  
 151.185      spin_unlock(&irq_mapping_update_lock);
 151.186  }
 151.187  
 151.188 -int bind_evtchn_to_irq(int evtchn)
 151.189 +int bind_evtchn_to_irq(unsigned int evtchn)
 151.190  {
 151.191      int irq;
 151.192  
 151.193 @@ -326,7 +395,7 @@ int bind_evtchn_to_irq(int evtchn)
 151.194      return irq;
 151.195  }
 151.196  
 151.197 -void unbind_evtchn_from_irq(int evtchn)
 151.198 +void unbind_evtchn_from_irq(unsigned int evtchn)
 151.199  {
 151.200      int irq = evtchn_to_irq[evtchn];
 151.201  
 151.202 @@ -341,9 +410,36 @@ void unbind_evtchn_from_irq(int evtchn)
 151.203      spin_unlock(&irq_mapping_update_lock);
 151.204  }
 151.205  
 151.206 +int bind_evtchn_to_irqhandler(
 151.207 +    unsigned int evtchn,
 151.208 +    irqreturn_t (*handler)(int, void *, struct pt_regs *),
 151.209 +    unsigned long irqflags,
 151.210 +    const char *devname,
 151.211 +    void *dev_id)
 151.212 +{
 151.213 +    unsigned int irq;
 151.214 +    int retval;
 151.215 +
 151.216 +    irq = bind_evtchn_to_irq(evtchn);
 151.217 +    retval = request_irq(irq, handler, irqflags, devname, dev_id);
 151.218 +    if ( retval != 0 )
 151.219 +        unbind_evtchn_from_irq(evtchn);
 151.220 +
 151.221 +    return retval;
 151.222 +}
 151.223 +
 151.224 +void unbind_evtchn_from_irqhandler(unsigned int evtchn, void *dev_id)
 151.225 +{
 151.226 +    unsigned int irq = evtchn_to_irq[evtchn];
 151.227 +    free_irq(irq, dev_id);
 151.228 +    unbind_evtchn_from_irq(evtchn);
 151.229 +}
 151.230 +
 151.231 +#ifdef CONFIG_SMP
 151.232  static void do_nothing_function(void *ign)
 151.233  {
 151.234  }
 151.235 +#endif
 151.236  
 151.237  /* Rebind an evtchn so that it gets delivered to a specific cpu */
 151.238  static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
 151.239 @@ -354,38 +450,37 @@ static void rebind_irq_to_cpu(unsigned i
 151.240      spin_lock(&irq_mapping_update_lock);
 151.241      evtchn = irq_to_evtchn[irq];
 151.242      if (!VALID_EVTCHN(evtchn)) {
 151.243 -	spin_unlock(&irq_mapping_update_lock);
 151.244 -	return;
 151.245 +        spin_unlock(&irq_mapping_update_lock);
 151.246 +        return;
 151.247      }
 151.248  
 151.249 -    /* Tell Xen to send future instances of this interrupt to the
 151.250 -       other vcpu */
 151.251 +    /* Tell Xen to send future instances of this interrupt to other vcpu. */
 151.252      op.cmd = EVTCHNOP_bind_vcpu;
 151.253      op.u.bind_vcpu.port = evtchn;
 151.254      op.u.bind_vcpu.vcpu = tcpu;
 151.255  
 151.256 -    /* If this fails, it usually just indicates that we're dealing
 151.257 -       with a virq or IPI channel, which don't actually need to be
 151.258 -       rebound.  Ignore it, but don't do the xenlinux-level rebind
 151.259 -       in that case. */
 151.260 +    /*
 151.261 +     * If this fails, it usually just indicates that we're dealing with a virq 
 151.262 +     * or IPI channel, which don't actually need to be rebound. Ignore it, 
 151.263 +     * but don't do the xenlinux-level rebind in that case.
 151.264 +     */
 151.265      if (HYPERVISOR_event_channel_op(&op) >= 0)
 151.266 -	bind_evtchn_to_cpu(evtchn, tcpu);
 151.267 +        bind_evtchn_to_cpu(evtchn, tcpu);
 151.268  
 151.269      spin_unlock(&irq_mapping_update_lock);
 151.270  
 151.271 -    /* Now send the new target processor a NOP IPI.  When this
 151.272 -       returns, it will check for any pending interrupts, and so
 151.273 -       service any that got delivered to the wrong processor by
 151.274 -       mistake. */
 151.275 -    /* XXX: The only time this is called with interrupts disabled is
 151.276 -       from the hotplug/hotunplug path.  In that case, all cpus are
 151.277 -       stopped with interrupts disabled, and the missed interrupts
 151.278 -       will be picked up when they start again.  This is kind of a
 151.279 -       hack.
 151.280 -    */
 151.281 -    if (!irqs_disabled()) {
 151.282 -	smp_call_function(do_nothing_function, NULL, 0, 0);
 151.283 -    }
 151.284 +    /*
 151.285 +     * Now send the new target processor a NOP IPI. When this returns, it 
 151.286 +     * will check for any pending interrupts, and so service any that got 
 151.287 +     * delivered to the wrong processor by mistake.
 151.288 +     * 
 151.289 +     * XXX: The only time this is called with interrupts disabled is from the 
 151.290 +     * hotplug/hotunplug path. In that case, all cpus are stopped with 
 151.291 +     * interrupts disabled, and the missed interrupts will be picked up when 
 151.292 +     * they start again. This is kind of a hack.
 151.293 +     */
 151.294 +    if (!irqs_disabled())
 151.295 +        smp_call_function(do_nothing_function, NULL, 0, 0);
 151.296  }
 151.297  
 151.298  
 151.299 @@ -585,6 +680,16 @@ static struct hw_interrupt_type pirq_typ
 151.300      set_affinity_irq
 151.301  };
 151.302  
 151.303 +void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
 151.304 +{
 151.305 +    int evtchn = irq_to_evtchn[i];
 151.306 +    shared_info_t *s = HYPERVISOR_shared_info;
 151.307 +    if ( !VALID_EVTCHN(evtchn) )
 151.308 +        return;
 151.309 +    BUG_ON(!synch_test_bit(evtchn, &s->evtchn_mask[0]));
 151.310 +    synch_set_bit(evtchn, &s->evtchn_pending[0]);
 151.311 +}
 151.312 +
 151.313  void irq_suspend(void)
 151.314  {
 151.315      int pirq, virq, irq, evtchn;
 151.316 @@ -631,7 +736,7 @@ void irq_resume(void)
 151.317          evtchn = op.u.bind_virq.port;
 151.318          
 151.319          /* Record the new mapping. */
 151.320 -	bind_evtchn_to_cpu(evtchn, 0);
 151.321 +        bind_evtchn_to_cpu(evtchn, 0);
 151.322          evtchn_to_irq[evtchn] = irq;
 151.323          irq_to_evtchn[irq]    = evtchn;
 151.324  
 151.325 @@ -655,9 +760,9 @@ void __init init_IRQ(void)
 151.326  #endif
 151.327  
 151.328      for ( cpu = 0; cpu < NR_CPUS; cpu++ ) {
 151.329 -	/* No VIRQ -> IRQ mappings. */
 151.330 -	for ( i = 0; i < NR_VIRQS; i++ )
 151.331 -	    per_cpu(virq_to_irq, cpu)[i] = -1;
 151.332 +        /* No VIRQ -> IRQ mappings. */
 151.333 +        for ( i = 0; i < NR_VIRQS; i++ )
 151.334 +            per_cpu(virq_to_irq, cpu)[i] = -1;
 151.335      }
 151.336  
 151.337      /* No event-channel -> IRQ mappings. */
   153.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Tue Aug 23 18:43:18 2005 -0800
   153.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Aug 25 15:53:20 2005 -0700
   153.3 @@ -34,44 +34,90 @@
   153.4  
   153.5  
   153.6  EXPORT_SYMBOL(gnttab_grant_foreign_access);
   153.7 +EXPORT_SYMBOL(gnttab_end_foreign_access_ref);
   153.8  EXPORT_SYMBOL(gnttab_end_foreign_access);
   153.9  EXPORT_SYMBOL(gnttab_query_foreign_access);
  153.10  EXPORT_SYMBOL(gnttab_grant_foreign_transfer);
  153.11 +EXPORT_SYMBOL(gnttab_end_foreign_transfer_ref);
  153.12  EXPORT_SYMBOL(gnttab_end_foreign_transfer);
  153.13  EXPORT_SYMBOL(gnttab_alloc_grant_references);
  153.14  EXPORT_SYMBOL(gnttab_free_grant_references);
  153.15 +EXPORT_SYMBOL(gnttab_free_grant_reference);
  153.16  EXPORT_SYMBOL(gnttab_claim_grant_reference);
  153.17  EXPORT_SYMBOL(gnttab_release_grant_reference);
  153.18  EXPORT_SYMBOL(gnttab_grant_foreign_access_ref);
  153.19  EXPORT_SYMBOL(gnttab_grant_foreign_transfer_ref);
  153.20  
  153.21 -static grant_ref_t gnttab_free_list[NR_GRANT_ENTRIES];
  153.22 +#define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
  153.23 +#define GNTTAB_LIST_END (NR_GRANT_ENTRIES + 1)
  153.24 +
  153.25 +static grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
  153.26 +static int gnttab_free_count = NR_GRANT_ENTRIES;
  153.27  static grant_ref_t gnttab_free_head;
  153.28 +static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
  153.29  
  153.30  static grant_entry_t *shared;
  153.31  
  153.32 -/*
  153.33 - * Lock-free grant-entry allocator
  153.34 - */
  153.35 +static struct gnttab_free_callback *gnttab_free_callback_list = NULL;
  153.36  
  153.37 -static inline int
  153.38 -get_free_entry(
  153.39 -    void)
  153.40 +static int
  153.41 +get_free_entries(int count)
  153.42  {
  153.43 -    grant_ref_t fh, nfh = gnttab_free_head;
  153.44 -    do { if ( unlikely((fh = nfh) == NR_GRANT_ENTRIES) ) return -1; }
  153.45 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh,
  153.46 -                                    gnttab_free_list[fh])) != fh) );
  153.47 -    return fh;
  153.48 +    unsigned long flags;
  153.49 +    int ref;
  153.50 +    grant_ref_t head;
  153.51 +    spin_lock_irqsave(&gnttab_list_lock, flags);
  153.52 +    if (gnttab_free_count < count) {
  153.53 +	spin_unlock_irqrestore(&gnttab_list_lock, flags);
  153.54 +	return -1;
  153.55 +    }
  153.56 +    ref = head = gnttab_free_head;
  153.57 +    gnttab_free_count -= count;
  153.58 +    while (count-- > 1)
  153.59 +	head = gnttab_list[head];
  153.60 +    gnttab_free_head = gnttab_list[head];
  153.61 +    gnttab_list[head] = GNTTAB_LIST_END;
  153.62 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
  153.63 +    return ref;
  153.64 +}
  153.65 +
  153.66 +#define get_free_entry() get_free_entries(1)
  153.67 +
  153.68 +static void
  153.69 +do_free_callbacks(void)
  153.70 +{
  153.71 +    struct gnttab_free_callback *callback = gnttab_free_callback_list, *next;
  153.72 +    gnttab_free_callback_list = NULL;
  153.73 +    while (callback) {
  153.74 +	next = callback->next;
  153.75 +	if (gnttab_free_count >= callback->count) {
  153.76 +	    callback->next = NULL;
  153.77 +	    callback->fn(callback->arg);
  153.78 +	} else {
  153.79 +	    callback->next = gnttab_free_callback_list;
  153.80 +	    gnttab_free_callback_list = callback;
  153.81 +	}
  153.82 +	callback = next;
  153.83 +    }
  153.84  }
  153.85  
  153.86  static inline void
  153.87 -put_free_entry(
  153.88 -    grant_ref_t ref)
  153.89 +check_free_callbacks(void)
  153.90  {
  153.91 -    grant_ref_t fh, nfh = gnttab_free_head;
  153.92 -    do { gnttab_free_list[ref] = fh = nfh; wmb(); }
  153.93 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh, ref)) != fh) );
  153.94 +    if (unlikely(gnttab_free_callback_list))
  153.95 +	do_free_callbacks();
  153.96 +}
  153.97 +
  153.98 +static void
  153.99 +put_free_entry(grant_ref_t ref)
 153.100 +{
 153.101 +    unsigned long flags;
 153.102 +    spin_lock_irqsave(&gnttab_list_lock, flags);
 153.103 +    gnttab_list[ref] = gnttab_free_head;
 153.104 +    gnttab_free_head = ref;
 153.105 +    gnttab_free_count++;
 153.106 +    check_free_callbacks();
 153.107 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
 153.108  }
 153.109  
 153.110  /*
 153.111 @@ -79,8 +125,7 @@ put_free_entry(
 153.112   */
 153.113  
 153.114  int
 153.115 -gnttab_grant_foreign_access(
 153.116 -    domid_t domid, unsigned long frame, int readonly)
 153.117 +gnttab_grant_foreign_access(domid_t domid, unsigned long frame, int readonly)
 153.118  {
 153.119      int ref;
 153.120      
 153.121 @@ -96,8 +141,8 @@ gnttab_grant_foreign_access(
 153.122  }
 153.123  
 153.124  void
 153.125 -gnttab_grant_foreign_access_ref(
 153.126 -    grant_ref_t ref, domid_t domid, unsigned long frame, int readonly)
 153.127 +gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
 153.128 +				unsigned long frame, int readonly)
 153.129  {
 153.130      shared[ref].frame = frame;
 153.131      shared[ref].domid = domid;
 153.132 @@ -107,7 +152,7 @@ gnttab_grant_foreign_access_ref(
 153.133  
 153.134  
 153.135  int
 153.136 -gnttab_query_foreign_access( grant_ref_t ref )
 153.137 +gnttab_query_foreign_access(grant_ref_t ref)
 153.138  {
 153.139      u16 nflags;
 153.140  
 153.141 @@ -117,7 +162,7 @@ gnttab_query_foreign_access( grant_ref_t
 153.142  }
 153.143  
 153.144  void
 153.145 -gnttab_end_foreign_access( grant_ref_t ref, int readonly )
 153.146 +gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly)
 153.147  {
 153.148      u16 flags, nflags;
 153.149  
 153.150 @@ -127,13 +172,17 @@ gnttab_end_foreign_access( grant_ref_t r
 153.151              printk(KERN_ALERT "WARNING: g.e. still in use!\n");
 153.152      }
 153.153      while ( (nflags = synch_cmpxchg(&shared[ref].flags, flags, 0)) != flags );
 153.154 +}
 153.155  
 153.156 +void
 153.157 +gnttab_end_foreign_access(grant_ref_t ref, int readonly)
 153.158 +{
 153.159 +    gnttab_end_foreign_access_ref(ref, readonly);
 153.160      put_free_entry(ref);
 153.161  }
 153.162  
 153.163  int
 153.164 -gnttab_grant_foreign_transfer(
 153.165 -    domid_t domid, unsigned long pfn )
 153.166 +gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn)
 153.167  {
 153.168      int ref;
 153.169  
 153.170 @@ -149,8 +198,8 @@ gnttab_grant_foreign_transfer(
 153.171  }
 153.172  
 153.173  void
 153.174 -gnttab_grant_foreign_transfer_ref(
 153.175 -    grant_ref_t ref, domid_t domid, unsigned long pfn )
 153.176 +gnttab_grant_foreign_transfer_ref(grant_ref_t ref, domid_t domid,
 153.177 +				  unsigned long pfn)
 153.178  {
 153.179      shared[ref].frame = pfn;
 153.180      shared[ref].domid = domid;
 153.181 @@ -159,21 +208,13 @@ gnttab_grant_foreign_transfer_ref(
 153.182  }
 153.183  
 153.184  unsigned long
 153.185 -gnttab_end_foreign_transfer(
 153.186 -    grant_ref_t ref)
 153.187 +gnttab_end_foreign_transfer_ref(grant_ref_t ref)
 153.188  {
 153.189      unsigned long frame = 0;
 153.190      u16           flags;
 153.191  
 153.192      flags = shared[ref].flags;
 153.193 -#ifdef CONFIG_XEN_NETDEV_GRANT_RX
 153.194 -    /*
 153.195 -     * But can't flags == (GTF_accept_transfer | GTF_transfer_completed)
 153.196 -     * if gnttab_donate executes without interruption???
 153.197 -     */
 153.198 -#else
 153.199 -    ASSERT(flags == (GTF_accept_transfer | GTF_transfer_committed));
 153.200 -#endif
 153.201 +
 153.202      /*
 153.203       * If a transfer is committed then wait for the frame address to appear.
 153.204       * Otherwise invalidate the grant entry against future use.
 153.205 @@ -183,65 +224,91 @@ gnttab_end_foreign_transfer(
 153.206          while ( unlikely((frame = shared[ref].frame) == 0) )
 153.207              cpu_relax();
 153.208  
 153.209 +    return frame;
 153.210 +}
 153.211 +
 153.212 +unsigned long
 153.213 +gnttab_end_foreign_transfer(grant_ref_t ref)
 153.214 +{
 153.215 +    unsigned long frame = gnttab_end_foreign_transfer_ref(ref);
 153.216      put_free_entry(ref);
 153.217 -
 153.218      return frame;
 153.219  }
 153.220  
 153.221  void
 153.222 -gnttab_free_grant_references( u16 count, grant_ref_t head )
 153.223 +gnttab_free_grant_reference(grant_ref_t ref)
 153.224  {
 153.225 -    /* TODO: O(N)...? */
 153.226 -    grant_ref_t to_die = 0, next = head;
 153.227 -    int i;
 153.228 +
 153.229 +    put_free_entry(ref);
 153.230 +}
 153.231  
 153.232 -    for ( i = 0; i < count; i++ )
 153.233 -    {
 153.234 -        to_die = next;
 153.235 -        next = gnttab_free_list[next];
 153.236 -        put_free_entry( to_die );
 153.237 +void
 153.238 +gnttab_free_grant_references(grant_ref_t head)
 153.239 +{
 153.240 +    grant_ref_t ref;
 153.241 +    unsigned long flags;
 153.242 +    int count = 1;
 153.243 +    if (head == GNTTAB_LIST_END)
 153.244 +	return;
 153.245 +    spin_lock_irqsave(&gnttab_list_lock, flags);
 153.246 +    ref = head;
 153.247 +    while (gnttab_list[ref] != GNTTAB_LIST_END) {
 153.248 +	ref = gnttab_list[ref];
 153.249 +	count++;
 153.250      }
 153.251 +    gnttab_list[ref] = gnttab_free_head;
 153.252 +    gnttab_free_head = head;
 153.253 +    gnttab_free_count += count;
 153.254 +    check_free_callbacks();
 153.255 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
 153.256  }
 153.257  
 153.258  int
 153.259 -gnttab_alloc_grant_references( u16 count,
 153.260 -                               grant_ref_t *head,
 153.261 -                               grant_ref_t *terminal )
 153.262 +gnttab_alloc_grant_references(u16 count, grant_ref_t *head)
 153.263  {
 153.264 -    int i;
 153.265 -    grant_ref_t h = gnttab_free_head;
 153.266 +    int h = get_free_entries(count);
 153.267  
 153.268 -    for ( i = 0; i < count; i++ )
 153.269 -        if ( unlikely(get_free_entry() == -1) )
 153.270 -            goto not_enough_refs;
 153.271 +    if (h == -1)
 153.272 +	return -ENOSPC;
 153.273  
 153.274      *head = h;
 153.275 -    *terminal = gnttab_free_head;
 153.276  
 153.277      return 0;
 153.278 -
 153.279 -not_enough_refs:
 153.280 -    gnttab_free_head = h;
 153.281 -    return -ENOSPC;
 153.282  }
 153.283  
 153.284  int
 153.285 -gnttab_claim_grant_reference( grant_ref_t *private_head,
 153.286 -                              grant_ref_t  terminal )
 153.287 +gnttab_claim_grant_reference(grant_ref_t *private_head)
 153.288  {
 153.289 -    grant_ref_t g;
 153.290 -    if ( unlikely((g = *private_head) == terminal) )
 153.291 +    grant_ref_t g = *private_head;
 153.292 +    if (unlikely(g == GNTTAB_LIST_END))
 153.293          return -ENOSPC;
 153.294 -    *private_head = gnttab_free_list[g];
 153.295 +    *private_head = gnttab_list[g];
 153.296      return g;
 153.297  }
 153.298  
 153.299  void
 153.300 -gnttab_release_grant_reference( grant_ref_t *private_head,
 153.301 -                                grant_ref_t  release )
 153.302 +gnttab_release_grant_reference(grant_ref_t *private_head, grant_ref_t  release)
 153.303 +{
 153.304 +    gnttab_list[release] = *private_head;
 153.305 +    *private_head = release;
 153.306 +}
 153.307 +
 153.308 +void
 153.309 +gnttab_request_free_callback(struct gnttab_free_callback *callback,
 153.310 +			     void (*fn)(void *), void *arg, u16 count)
 153.311  {
 153.312 -    gnttab_free_list[release] = *private_head;
 153.313 -    *private_head = release;
 153.314 +    unsigned long flags;
 153.315 +    spin_lock_irqsave(&gnttab_list_lock, flags);
 153.316 +    if (callback->next)
 153.317 +	goto out;
 153.318 +    callback->fn = fn;
 153.319 +    callback->arg = arg;
 153.320 +    callback->count = count;
 153.321 +    callback->next = gnttab_free_callback_list;
 153.322 +    gnttab_free_callback_list = callback;
 153.323 +    check_free_callbacks();
 153.324 + out:
 153.325 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
 153.326  }
 153.327  
 153.328  /*
 153.329 @@ -252,8 +319,9 @@ gnttab_release_grant_reference( grant_re
 153.330  
 153.331  static struct proc_dir_entry *grant_pde;
 153.332  
 153.333 -static int grant_ioctl(struct inode *inode, struct file *file,
 153.334 -                       unsigned int cmd, unsigned long data)
 153.335 +static int
 153.336 +grant_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 153.337 +	    unsigned long data)
 153.338  {
 153.339      int                     ret;
 153.340      privcmd_hypercall_t     hypercall;
 153.341 @@ -291,8 +359,9 @@ static struct file_operations grant_file
 153.342      ioctl:  grant_ioctl,
 153.343  };
 153.344  
 153.345 -static int grant_read(char *page, char **start, off_t off,
 153.346 -                      int count, int *eof, void *data)
 153.347 +static int
 153.348 +grant_read(char *page, char **start, off_t off, int count, int *eof,
 153.349 +	   void *data)
 153.350  {
 153.351      int             len;
 153.352      unsigned int    i;
 153.353 @@ -321,8 +390,9 @@ static int grant_read(char *page, char *
 153.354      return len;
 153.355  }
 153.356  
 153.357 -static int grant_write(struct file *file, const char __user *buffer,
 153.358 -                       unsigned long count, void *data)
 153.359 +static int
 153.360 +grant_write(struct file *file, const char __user *buffer, unsigned long count,
 153.361 +	    void *data)
 153.362  {
 153.363      /* TODO: implement this */
 153.364      return -ENOSYS;
 153.365 @@ -330,7 +400,8 @@ static int grant_write(struct file *file
 153.366  
 153.367  #endif /* CONFIG_PROC_FS */
 153.368  
 153.369 -int gnttab_resume(void)
 153.370 +int
 153.371 +gnttab_resume(void)
 153.372  {
 153.373      gnttab_setup_table_t setup;
 153.374      unsigned long        frames[NR_GRANT_FRAMES];
 153.375 @@ -349,7 +420,8 @@ int gnttab_resume(void)
 153.376      return 0;
 153.377  }
 153.378  
 153.379 -int gnttab_suspend(void)
 153.380 +int
 153.381 +gnttab_suspend(void)
 153.382  {
 153.383      int i;
 153.384  
 153.385 @@ -359,7 +431,8 @@ int gnttab_suspend(void)
 153.386      return 0;
 153.387  }
 153.388  
 153.389 -static int __init gnttab_init(void)
 153.390 +static int __init
 153.391 +gnttab_init(void)
 153.392  {
 153.393      int i;
 153.394  
 153.395 @@ -368,7 +441,7 @@ static int __init gnttab_init(void)
 153.396      shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
 153.397  
 153.398      for ( i = 0; i < NR_GRANT_ENTRIES; i++ )
 153.399 -        gnttab_free_list[i] = i + 1;
 153.400 +        gnttab_list[i] = i + 1;
 153.401      
 153.402  #ifdef CONFIG_PROC_FS
 153.403      /*
   154.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Aug 23 18:43:18 2005 -0800
   154.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Thu Aug 25 15:53:20 2005 -0700
   154.3 @@ -1,7 +1,4 @@
   154.4 -
   154.5  #define __KERNEL_SYSCALLS__
   154.6 -static int errno;
   154.7 -#include <linux/errno.h>
   154.8  #include <linux/version.h>
   154.9  #include <linux/kernel.h>
  154.10  #include <linux/mm.h>
  154.11 @@ -9,13 +6,23 @@ static int errno;
  154.12  #include <linux/module.h>
  154.13  #include <linux/reboot.h>
  154.14  #include <linux/sysrq.h>
  154.15 +#include <linux/stringify.h>
  154.16  #include <asm/irq.h>
  154.17  #include <asm/mmu_context.h>
  154.18 -#include <asm-xen/ctrl_if.h>
  154.19 +#include <asm-xen/evtchn.h>
  154.20  #include <asm-xen/hypervisor.h>
  154.21  #include <asm-xen/xen-public/dom0_ops.h>
  154.22  #include <asm-xen/linux-public/suspend.h>
  154.23  #include <asm-xen/queues.h>
  154.24 +#include <asm-xen/xenbus.h>
  154.25 +#include <asm-xen/ctrl_if.h>
  154.26 +#include <linux/cpu.h>
  154.27 +#include <linux/kthread.h>
  154.28 +
  154.29 +#define SHUTDOWN_INVALID  -1
  154.30 +#define SHUTDOWN_POWEROFF  0
  154.31 +#define SHUTDOWN_REBOOT    1
  154.32 +#define SHUTDOWN_SUSPEND   2
  154.33  
  154.34  void machine_restart(char * __unused)
  154.35  {
  154.36 @@ -51,30 +58,76 @@ EXPORT_SYMBOL(machine_power_off);
  154.37   */
  154.38  
  154.39  /* Ignore multiple shutdown requests. */
  154.40 -static int shutting_down = -1;
  154.41 +static int shutting_down = SHUTDOWN_INVALID;
  154.42 +
  154.43 +#ifndef CONFIG_HOTPLUG_CPU
  154.44 +#define cpu_down(x) (-EOPNOTSUPP)
  154.45 +#define cpu_up(x) (-EOPNOTSUPP)
  154.46 +#endif
  154.47 +
  154.48 +static void save_vcpu_context(int vcpu, vcpu_guest_context_t *ctxt)
  154.49 +{
  154.50 +    int r;
  154.51 +    int gdt_pages;
  154.52 +    r = HYPERVISOR_vcpu_pickle(vcpu, ctxt);
  154.53 +    if (r != 0)
  154.54 +	panic("pickling vcpu %d -> %d!\n", vcpu, r);
  154.55 +
  154.56 +    /* Translate from machine to physical addresses where necessary,
  154.57 +       so that they can be translated to our new machine address space
  154.58 +       after resume.  libxc is responsible for doing this to vcpu0,
  154.59 +       but we do it to the others. */
  154.60 +    gdt_pages = (ctxt->gdt_ents + 511) / 512;
  154.61 +    ctxt->ctrlreg[3] = machine_to_phys(ctxt->ctrlreg[3]);
  154.62 +    for (r = 0; r < gdt_pages; r++)
  154.63 +	ctxt->gdt_frames[r] = mfn_to_pfn(ctxt->gdt_frames[r]);
  154.64 +}
  154.65 +
  154.66 +void _restore_vcpu(int cpu);
  154.67 +
  154.68 +atomic_t vcpus_rebooting;
  154.69  
  154.70 -static void __do_suspend(void)
  154.71 +static int restore_vcpu_context(int vcpu, vcpu_guest_context_t *ctxt)
  154.72 +{
  154.73 +    int r;
  154.74 +    int gdt_pages = (ctxt->gdt_ents + 511) / 512;
  154.75 +
  154.76 +    /* This is kind of a hack, and implicitly relies on the fact that
  154.77 +       the vcpu stops in a place where all of the call clobbered
  154.78 +       registers are already dead. */
  154.79 +    ctxt->user_regs.esp -= 4;
  154.80 +    ((unsigned long *)ctxt->user_regs.esp)[0] = ctxt->user_regs.eip;
  154.81 +    ctxt->user_regs.eip = (unsigned long)_restore_vcpu;
  154.82 +
  154.83 +    /* De-canonicalise.  libxc handles this for vcpu 0, but we need
  154.84 +       to do it for the other vcpus. */
  154.85 +    ctxt->ctrlreg[3] = phys_to_machine(ctxt->ctrlreg[3]);
  154.86 +    for (r = 0; r < gdt_pages; r++)
  154.87 +	ctxt->gdt_frames[r] = pfn_to_mfn(ctxt->gdt_frames[r]);
  154.88 +
  154.89 +    atomic_set(&vcpus_rebooting, 1);
  154.90 +    r = HYPERVISOR_boot_vcpu(vcpu, ctxt);
  154.91 +    if (r != 0) {
  154.92 +	printk(KERN_EMERG "Failed to reboot vcpu %d (%d)\n", vcpu, r);
  154.93 +	return -1;
  154.94 +    }
  154.95 +
  154.96 +    /* Make sure we wait for the new vcpu to come up before trying to do
  154.97 +       anything with it or starting the next one. */
  154.98 +    while (atomic_read(&vcpus_rebooting))
  154.99 +	barrier();
 154.100 +
 154.101 +    return 0;
 154.102 +}
 154.103 +
 154.104 +static int __do_suspend(void *ignore)
 154.105  {
 154.106      int i, j;
 154.107      suspend_record_t *suspend_record;
 154.108 +    static vcpu_guest_context_t suspended_cpu_records[NR_CPUS];
 154.109  
 154.110      /* Hmmm... a cleaner interface to suspend/resume blkdevs would be nice. */
 154.111  	/* XXX SMH: yes it would :-( */	
 154.112 -#ifdef CONFIG_XEN_BLKDEV_FRONTEND
 154.113 -    extern void blkdev_suspend(void);
 154.114 -    extern void blkdev_resume(void);
 154.115 -#else
 154.116 -#define blkdev_suspend() do{}while(0)
 154.117 -#define blkdev_resume()  do{}while(0)
 154.118 -#endif
 154.119 -
 154.120 -#ifdef CONFIG_XEN_NETDEV_FRONTEND
 154.121 -    extern void netif_suspend(void);
 154.122 -    extern void netif_resume(void);  
 154.123 -#else
 154.124 -#define netif_suspend() do{}while(0)
 154.125 -#define netif_resume()  do{}while(0)
 154.126 -#endif
 154.127  
 154.128  #ifdef CONFIG_XEN_USB_FRONTEND
 154.129      extern void usbif_resume();
 154.130 @@ -82,37 +135,88 @@ static void __do_suspend(void)
 154.131  #define usbif_resume() do{}while(0)
 154.132  #endif
 154.133  
 154.134 -#ifdef CONFIG_XEN_BLKDEV_GRANT
 154.135      extern int gnttab_suspend(void);
 154.136      extern int gnttab_resume(void);
 154.137 -#else
 154.138 -#define gnttab_suspend() do{}while(0)
 154.139 -#define gnttab_resume()  do{}while(0)
 154.140 +
 154.141 +#ifdef CONFIG_SMP
 154.142 +    extern void smp_suspend(void);
 154.143 +    extern void smp_resume(void);
 154.144  #endif
 154.145 -
 154.146      extern void time_suspend(void);
 154.147      extern void time_resume(void);
 154.148      extern unsigned long max_pfn;
 154.149      extern unsigned int *pfn_to_mfn_frame_list;
 154.150  
 154.151 +    cpumask_t prev_online_cpus, prev_present_cpus;
 154.152 +    int err = 0;
 154.153 +
 154.154 +    BUG_ON(smp_processor_id() != 0);
 154.155 +    BUG_ON(in_interrupt());
 154.156 +
 154.157 +#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
 154.158 +    if (num_online_cpus() > 1) {
 154.159 +	printk(KERN_WARNING "Can't suspend SMP guests without CONFIG_HOTPLUG_CPU\n");
 154.160 +	return -EOPNOTSUPP;
 154.161 +    }
 154.162 +#endif
 154.163 +
 154.164      suspend_record = (suspend_record_t *)__get_free_page(GFP_KERNEL);
 154.165      if ( suspend_record == NULL )
 154.166          goto out;
 154.167  
 154.168 +    /* Take all of the other cpus offline.  We need to be careful not
 154.169 +       to get preempted between the final test for num_online_cpus()
 154.170 +       == 1 and disabling interrupts, since otherwise userspace could
 154.171 +       bring another cpu online, and then we'd be stuffed.  At the
 154.172 +       same time, cpu_down can reschedule, so we need to enable
 154.173 +       preemption while doing that.  This kind of sucks, but should be
 154.174 +       correct. */
 154.175 +    /* (We don't need to worry about other cpus bringing stuff up,
 154.176 +       since by the time num_online_cpus() == 1, there aren't any
 154.177 +       other cpus) */
 154.178 +    cpus_clear(prev_online_cpus);
 154.179 +    preempt_disable();
 154.180 +    while (num_online_cpus() > 1) {
 154.181 +	preempt_enable();
 154.182 +	for_each_online_cpu(i) {
 154.183 +	    if (i == 0)
 154.184 +		continue;
 154.185 +	    err = cpu_down(i);
 154.186 +	    if (err != 0) {
 154.187 +		printk(KERN_CRIT "Failed to take all CPUs down: %d.\n", err);
 154.188 +		goto out_reenable_cpus;
 154.189 +	    }
 154.190 +	    cpu_set(i, prev_online_cpus);
 154.191 +	}
 154.192 +	preempt_disable();
 154.193 +    }
 154.194 +
 154.195      suspend_record->nr_pfns = max_pfn; /* final number of pfns */
 154.196  
 154.197      __cli();
 154.198  
 154.199 +    preempt_enable();
 154.200 +
 154.201 +    cpus_clear(prev_present_cpus);
 154.202 +    for_each_present_cpu(i) {
 154.203 +	if (i == 0)
 154.204 +	    continue;
 154.205 +	save_vcpu_context(i, &suspended_cpu_records[i]);
 154.206 +	cpu_set(i, prev_present_cpus);
 154.207 +    }
 154.208 +
 154.209  #ifdef __i386__
 154.210      mm_pin_all();
 154.211      kmem_cache_shrink(pgd_cache);
 154.212  #endif
 154.213  
 154.214 -    netif_suspend();
 154.215 +    time_suspend();
 154.216  
 154.217 -    blkdev_suspend();
 154.218 +#ifdef CONFIG_SMP
 154.219 +    smp_suspend();
 154.220 +#endif
 154.221  
 154.222 -    time_suspend();
 154.223 +    xenbus_suspend();
 154.224  
 154.225      ctrl_if_suspend();
 154.226  
 154.227 @@ -126,9 +230,11 @@ static void __do_suspend(void)
 154.228      memcpy(&suspend_record->resume_info, &xen_start_info,
 154.229             sizeof(xen_start_info));
 154.230  
 154.231 -    HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT);
 154.232 +    /* We'll stop somewhere inside this hypercall.  When it returns,
 154.233 +       we'll start resuming after the restore. */
 154.234 +    HYPERVISOR_suspend(virt_to_mfn(suspend_record));
 154.235  
 154.236 -    shutting_down = -1; 
 154.237 +    shutting_down = SHUTDOWN_INVALID; 
 154.238  
 154.239      memcpy(&xen_start_info, &suspend_record->resume_info,
 154.240             sizeof(xen_start_info));
 154.241 @@ -142,10 +248,10 @@ static void __do_suspend(void)
 154.242      for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
 154.243      {
 154.244          pfn_to_mfn_frame_list[j] = 
 154.245 -            virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
 154.246 +            virt_to_mfn(&phys_to_machine_mapping[i]);
 154.247      }
 154.248      HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
 154.249 -        virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
 154.250 +        virt_to_mfn(pfn_to_mfn_frame_list);
 154.251  
 154.252      gnttab_resume();
 154.253  
 154.254 @@ -153,19 +259,36 @@ static void __do_suspend(void)
 154.255  
 154.256      ctrl_if_resume();
 154.257  
 154.258 -    time_resume();
 154.259 +    xenbus_resume();
 154.260  
 154.261 -    blkdev_resume();
 154.262 +#ifdef CONFIG_SMP
 154.263 +    smp_resume();
 154.264 +#endif
 154.265  
 154.266 -    netif_resume();
 154.267 +    time_resume();
 154.268  
 154.269      usbif_resume();
 154.270  
 154.271 +    for_each_cpu_mask(i, prev_present_cpus) {
 154.272 +	restore_vcpu_context(i, &suspended_cpu_records[i]);
 154.273 +    }
 154.274 +
 154.275      __sti();
 154.276  
 154.277 + out_reenable_cpus:
 154.278 +    for_each_cpu_mask(i, prev_online_cpus) {
 154.279 +	j = cpu_up(i);
 154.280 +	if (j != 0) {
 154.281 +	    printk(KERN_CRIT "Failed to bring cpu %d back up (%d).\n",
 154.282 +		   i, j);
 154.283 +	    err = j;
 154.284 +	}
 154.285 +    }
 154.286 +
 154.287   out:
 154.288      if ( suspend_record != NULL )
 154.289          free_page((unsigned long)suspend_record);
 154.290 +    return err;
 154.291  }
 154.292  
 154.293  static int shutdown_process(void *__unused)
 154.294 @@ -186,7 +309,7 @@ static int shutdown_process(void *__unus
 154.295  
 154.296      switch ( shutting_down )
 154.297      {
 154.298 -    case CMSG_SHUTDOWN_POWEROFF:
 154.299 +    case SHUTDOWN_POWEROFF:
 154.300          if ( execve("/sbin/poweroff", poweroff_argv, envp) < 0 )
 154.301          {
 154.302              sys_reboot(LINUX_REBOOT_MAGIC1,
 154.303 @@ -196,7 +319,7 @@ static int shutdown_process(void *__unus
 154.304          }
 154.305          break;
 154.306  
 154.307 -    case CMSG_SHUTDOWN_REBOOT:
 154.308 +    case SHUTDOWN_REBOOT:
 154.309          if ( execve("/sbin/reboot", restart_argv, envp) < 0 )
 154.310          {
 154.311              sys_reboot(LINUX_REBOOT_MAGIC1,
 154.312 @@ -207,16 +330,28 @@ static int shutdown_process(void *__unus
 154.313          break;
 154.314      }
 154.315  
 154.316 -    shutting_down = -1; /* could try again */
 154.317 +    shutting_down = SHUTDOWN_INVALID; /* could try again */
 154.318  
 154.319      return 0;
 154.320  }
 154.321  
 154.322 +static struct task_struct *kthread_create_on_cpu(int (*f)(void *arg),
 154.323 +						 void *arg,
 154.324 +						 const char *name,
 154.325 +						 int cpu)
 154.326 +{
 154.327 +    struct task_struct *p;
 154.328 +    p = kthread_create(f, arg, name);
 154.329 +    kthread_bind(p, cpu);
 154.330 +    wake_up_process(p);
 154.331 +    return p;
 154.332 +}
 154.333 +
 154.334  static void __shutdown_handler(void *unused)
 154.335  {
 154.336      int err;
 154.337  
 154.338 -    if ( shutting_down != CMSG_SHUTDOWN_SUSPEND )
 154.339 +    if ( shutting_down != SHUTDOWN_SUSPEND )
 154.340      {
 154.341          err = kernel_thread(shutdown_process, NULL, CLONE_FS | CLONE_FILES);
 154.342          if ( err < 0 )
 154.343 @@ -224,46 +359,121 @@ static void __shutdown_handler(void *unu
 154.344      }
 154.345      else
 154.346      {
 154.347 -        __do_suspend();
 154.348 +	kthread_create_on_cpu(__do_suspend, NULL, "suspender", 0);
 154.349      }
 154.350  }
 154.351  
 154.352 -static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
 154.353 +static void shutdown_handler(struct xenbus_watch *watch, const char *node)
 154.354  {
 154.355      static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
 154.356  
 154.357 -    if ( msg->subtype == CMSG_SHUTDOWN_SYSRQ )
 154.358 -    {
 154.359 -	int sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
 154.360 -	
 154.361 +    char *str;
 154.362 +
 154.363 +    str = (char *)xenbus_read("control", "shutdown", NULL);
 154.364 +    /* Ignore read errors. */
 154.365 +    if (IS_ERR(str))
 154.366 +        return;
 154.367 +    if (strlen(str) == 0) {
 154.368 +        kfree(str);
 154.369 +        return;
 154.370 +    }
 154.371 +
 154.372 +    xenbus_write("control", "shutdown", "", O_CREAT);
 154.373 +
 154.374 +    if (strcmp(str, "poweroff") == 0)
 154.375 +        shutting_down = SHUTDOWN_POWEROFF;
 154.376 +    else if (strcmp(str, "reboot") == 0)
 154.377 +        shutting_down = SHUTDOWN_REBOOT;
 154.378 +    else if (strcmp(str, "suspend") == 0)
 154.379 +        shutting_down = SHUTDOWN_SUSPEND;
 154.380 +    else {
 154.381 +        printk("Ignoring shutdown request: %s\n", str);
 154.382 +        shutting_down = SHUTDOWN_INVALID;
 154.383 +    }
 154.384 +
 154.385 +    kfree(str);
 154.386 +
 154.387 +    if (shutting_down != SHUTDOWN_INVALID)
 154.388 +        schedule_work(&shutdown_work);
 154.389 +}
 154.390 +
 154.391  #ifdef CONFIG_MAGIC_SYSRQ
 154.392 +static void sysrq_handler(struct xenbus_watch *watch, const char *node)
 154.393 +{
 154.394 +    char sysrq_key = '\0';
 154.395 +    
 154.396 +    if (!xenbus_scanf("control", "sysrq", "%c", &sysrq_key)) {
 154.397 +        printk(KERN_ERR "Unable to read sysrq code in control/sysrq\n");
 154.398 +        return;
 154.399 +    }
 154.400 +
 154.401 +    xenbus_printf("control", "sysrq", "%c", '\0');
 154.402 +
 154.403 +    if (sysrq_key != '\0') {
 154.404 +
 154.405  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 154.406 -	handle_sysrq(sysrq, NULL, NULL);
 154.407 +        handle_sysrq(sysrq_key, NULL, NULL);
 154.408  #else
 154.409 -	handle_sysrq(sysrq, NULL, NULL, NULL);
 154.410 -#endif
 154.411 +        handle_sysrq(sysrq_key, NULL, NULL, NULL);
 154.412  #endif
 154.413      }
 154.414 -    else if ( (shutting_down == -1) &&
 154.415 -         ((msg->subtype == CMSG_SHUTDOWN_POWEROFF) ||
 154.416 -          (msg->subtype == CMSG_SHUTDOWN_REBOOT) ||
 154.417 -          (msg->subtype == CMSG_SHUTDOWN_SUSPEND)) )
 154.418 -    {
 154.419 -        shutting_down = msg->subtype;
 154.420 -        schedule_work(&shutdown_work);
 154.421 +}
 154.422 +#endif
 154.423 +
 154.424 +static struct xenbus_watch shutdown_watch = {
 154.425 +    .node = "control/shutdown",
 154.426 +    .callback = shutdown_handler
 154.427 +};
 154.428 +
 154.429 +#ifdef CONFIG_MAGIC_SYSRQ
 154.430 +static struct xenbus_watch sysrq_watch = {
 154.431 +    .node ="control/sysrq",
 154.432 +    .callback = sysrq_handler
 154.433 +};
 154.434 +#endif
 154.435 +
 154.436 +static struct notifier_block xenstore_notifier;
 154.437 +
 154.438 +/* Setup our watcher
 154.439 +   NB: Assumes xenbus_lock is held!
 154.440 +*/
 154.441 +static int setup_shutdown_watcher(struct notifier_block *notifier,
 154.442 +                                  unsigned long event,
 154.443 +                                  void *data)
 154.444 +{
 154.445 +    int err1 = 0;
 154.446 +#ifdef CONFIG_MAGIC_SYSRQ
 154.447 +    int err2 = 0;
 154.448 +#endif
 154.449 +
 154.450 +    BUG_ON(down_trylock(&xenbus_lock) == 0);
 154.451 +
 154.452 +    err1 = register_xenbus_watch(&shutdown_watch);
 154.453 +#ifdef CONFIG_MAGIC_SYSRQ
 154.454 +    err2 = register_xenbus_watch(&sysrq_watch);
 154.455 +#endif
 154.456 +
 154.457 +    if (err1) {
 154.458 +        printk(KERN_ERR "Failed to set shutdown watcher\n");
 154.459      }
 154.460 -    else
 154.461 -    {
 154.462 -        printk("Ignore spurious shutdown request\n");
 154.463 +    
 154.464 +#ifdef CONFIG_MAGIC_SYSRQ
 154.465 +    if (err2) {
 154.466 +        printk(KERN_ERR "Failed to set sysrq watcher\n");
 154.467      }
 154.468 +#endif
 154.469  
 154.470 -    ctrl_if_send_response(msg);
 154.471 +    return NOTIFY_DONE;
 154.472  }
 154.473  
 154.474  static int __init setup_shutdown_event(void)
 154.475  {
 154.476 -    ctrl_if_register_receiver(CMSG_SHUTDOWN, shutdown_handler, 0);
 154.477 +    
 154.478 +    xenstore_notifier.notifier_call = setup_shutdown_watcher;
 154.479 +
 154.480 +    register_xenstore_notifier(&xenstore_notifier);
 154.481 +    
 154.482      return 0;
 154.483  }
 154.484  
 154.485 -__initcall(setup_shutdown_event);
 154.486 +subsys_initcall(setup_shutdown_event);
   155.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Tue Aug 23 18:43:18 2005 -0800
   155.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Thu Aug 25 15:53:20 2005 -0700
   155.3 @@ -5,8 +5,6 @@
   155.4  #include <linux/kernel.h>
   155.5  #include <linux/sched.h>
   155.6  #include <linux/slab.h>
   155.7 -#include <linux/string.h>
   155.8 -#include <linux/errno.h>
   155.9  #include <linux/netdevice.h>
  155.10  #include <linux/inetdevice.h>
  155.11  #include <linux/etherdevice.h>
  155.12 @@ -14,34 +12,86 @@
  155.13  #include <linux/init.h>
  155.14  #include <asm/io.h>
  155.15  #include <asm/page.h>
  155.16 -
  155.17 -EXPORT_SYMBOL(__dev_alloc_skb);
  155.18 +#include <asm-xen/hypervisor.h>
  155.19  
  155.20  /* Referenced in netback.c. */
  155.21  /*static*/ kmem_cache_t *skbuff_cachep;
  155.22  
  155.23 -/* Size must be cacheline-aligned (alloc_skb uses SKB_DATA_ALIGN). */
  155.24 -#define XEN_SKB_SIZE \
  155.25 -    ((PAGE_SIZE - sizeof(struct skb_shared_info)) & ~(SMP_CACHE_BYTES - 1))
  155.26 +#define MAX_SKBUFF_ORDER 2
  155.27 +static kmem_cache_t *skbuff_order_cachep[MAX_SKBUFF_ORDER + 1];
  155.28  
  155.29  struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
  155.30  {
  155.31 -    struct sk_buff *skb;
  155.32 -    skb = alloc_skb_from_cache(skbuff_cachep, length + 16, gfp_mask);
  155.33 -    if ( likely(skb != NULL) )
  155.34 -        skb_reserve(skb, 16);
  155.35 -    return skb;
  155.36 +	struct sk_buff *skb;
  155.37 +	int order;
  155.38 +
  155.39 +	length = SKB_DATA_ALIGN(length + 16);
  155.40 +	order = get_order(length + sizeof(struct skb_shared_info));
  155.41 +	if (order > MAX_SKBUFF_ORDER) {
  155.42 +		printk(KERN_ALERT "Attempt to allocate order %d skbuff. "
  155.43 +		       "Increase MAX_SKBUFF_ORDER.\n", order);
  155.44 +		return NULL;
  155.45 +	}
  155.46 +
  155.47 +	skb = alloc_skb_from_cache(
  155.48 +		skbuff_order_cachep[order], length, gfp_mask);
  155.49 +	if (skb != NULL)
  155.50 +		skb_reserve(skb, 16);
  155.51 +
  155.52 +	return skb;
  155.53  }
  155.54  
  155.55  static void skbuff_ctor(void *buf, kmem_cache_t *cachep, unsigned long unused)
  155.56  {
  155.57 -    scrub_pages(buf, 1);
  155.58 +	int order = 0;
  155.59 +
  155.60 +	while (skbuff_order_cachep[order] != cachep)
  155.61 +		order++;
  155.62 +
  155.63 +	if (order != 0)
  155.64 +		xen_create_contiguous_region((unsigned long)buf, order);
  155.65 +
  155.66 +	scrub_pages(buf, 1 << order);
  155.67 +}
  155.68 +
  155.69 +static void skbuff_dtor(void *buf, kmem_cache_t *cachep, unsigned long unused)
  155.70 +{
  155.71 +	int order = 0;
  155.72 +
  155.73 +	while (skbuff_order_cachep[order] != cachep)
  155.74 +		order++;
  155.75 +
  155.76 +	if (order != 0)
  155.77 +		xen_destroy_contiguous_region((unsigned long)buf, order);
  155.78  }
  155.79  
  155.80  static int __init skbuff_init(void)
  155.81  {
  155.82 -    skbuff_cachep = kmem_cache_create(
  155.83 -        "xen-skb", PAGE_SIZE, PAGE_SIZE, 0, skbuff_ctor, NULL);
  155.84 -    return 0;
  155.85 +	static char name[MAX_SKBUFF_ORDER + 1][20];
  155.86 +	unsigned long size;
  155.87 +	int order;
  155.88 +
  155.89 +	for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
  155.90 +		size = PAGE_SIZE << order;
  155.91 +		sprintf(name[order], "xen-skb-%lu", size);
  155.92 +		skbuff_order_cachep[order] = kmem_cache_create(
  155.93 +			name[order], size, size, 0, skbuff_ctor, skbuff_dtor);
  155.94 +	}
  155.95 +
  155.96 +	skbuff_cachep = skbuff_order_cachep[0];
  155.97 +
  155.98 +	return 0;
  155.99  }
 155.100  __initcall(skbuff_init);
 155.101 +
 155.102 +EXPORT_SYMBOL(__dev_alloc_skb);
 155.103 +
 155.104 +/*
 155.105 + * Local variables:
 155.106 + *  c-file-style: "linux"
 155.107 + *  indent-tabs-mode: t
 155.108 + *  c-indent-level: 8
 155.109 + *  c-basic-offset: 8
 155.110 + *  tab-width: 8
 155.111 + * End:
 155.112 + */
   158.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig	Tue Aug 23 18:43:18 2005 -0800
   158.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig	Thu Aug 25 15:53:20 2005 -0700
   158.3 @@ -126,6 +126,10 @@ config X86_IO_APIC
   158.4  	bool
   158.5  	default XEN_PRIVILEGED_GUEST
   158.6  
   158.7 +config X86_XEN_GENAPIC
   158.8 +	bool
   158.9 +	default XEN_PRIVILEGED_GUEST || SMP
  158.10 +
  158.11  config X86_LOCAL_APIC
  158.12  	bool
  158.13  	default XEN_PRIVILEGED_GUEST
  158.14 @@ -325,12 +329,12 @@ config GART_IOMMU
  158.15  # need this always enabled with GART_IOMMU for the VIA workaround
  158.16  config SWIOTLB
  158.17         bool
  158.18 -       depends on GART_IOMMU
  158.19 +       depends on PCI
  158.20         default y
  158.21  
  158.22  config DUMMY_IOMMU
  158.23  	bool
  158.24 -	depends on !GART_IOMMU && !SWIOTLB
  158.25 +	depends on !GART_IOMMU
  158.26  	default y
  158.27  	help
  158.28  	  Don't use IOMMU code. This will cause problems when you have more than 4GB
   159.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/Makefile	Tue Aug 23 18:43:18 2005 -0800
   159.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/Makefile	Thu Aug 25 15:53:20 2005 -0700
   159.3 @@ -79,14 +79,15 @@ xenflags-y += -Iinclude/asm-xen/asm-x86_
   159.4  CFLAGS += $(xenflags-y)
   159.5  AFLAGS += $(xenflags-y)
   159.6  
   159.7 -prepare: include/asm-$(XENARCH)/asm_offset.h
   159.8 -CLEAN_FILES += include/asm-$(XENARCH)/asm_offset.h
   159.9 +prepare: include/asm-$(XENARCH)/asm_offsets.h
  159.10 +CLEAN_FILES += include/asm-$(XENARCH)/asm_offsets.h
  159.11  
  159.12  arch/$(XENARCH)/kernel/asm-offsets.s: include/asm include/.asm-ignore \
  159.13  	include/linux/version.h include/config/MARKER
  159.14  
  159.15 -
  159.16 -include/asm-$(XENARCH)/asm_offset.h: arch/xen/x86_64/kernel/asm-offsets.s
  159.17 +include/asm-$(XENARCH)/offset.h: arch/$(XENARCH)/kernel/asm-offsets.s
  159.18  	$(call filechk,gen-asm-offsets)
  159.19 -	ln -fsn asm_offset.h include/asm-$(XENARCH)/offset.h
  159.20  
  159.21 +include/asm-$(XENARCH)/asm_offsets.h: include/asm-$(XENARCH)/offset.h
  159.22 +	ln -fsn offset.h include/asm-$(XENARCH)/asm_offsets.h
  159.23 +	ln -fsn offset.h include/asm-$(XENARCH)/asm_offset.h
   160.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Tue Aug 23 18:43:18 2005 -0800
   160.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Thu Aug 25 15:53:20 2005 -0700
   160.3 @@ -36,8 +36,8 @@ quiet_cmd_syscall = SYSCALL $@
   160.4  	$(call if_changed,syscall)
   160.5  
   160.6  AFLAGS_vsyscall-int80.o = -m32 -I$(obj)
   160.7 -AFLAGS_vsyscall-sysenter.o = -m32
   160.8 -AFLAGS_vsyscall-syscall.o = -m32
   160.9 +AFLAGS_vsyscall-sysenter.o = -m32 -I$(obj)
  160.10 +AFLAGS_vsyscall-syscall.o = -m32 -I$(obj)
  160.11  CFLAGS_ia32_ioctl.o += -Ifs/
  160.12  
  160.13  s-link	:= vsyscall-syscall.o vsyscall-sysenter.o vsyscall-sigreturn.o
  160.14 @@ -48,13 +48,11 @@ s-link	:= vsyscall-syscall.o vsyscall-sy
  160.15  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)) $(patsubst %.o,$(obj)/%.S,$(s-obj-y) $(s-link)):
  160.16  	@ln -fsn $(srctree)/arch/x86_64/ia32/$(notdir $@) $@
  160.17  
  160.18 -$(obj)/vsyscall-int80.S: $(obj)/vsyscall-sigreturn.S ../../i386/kernel/vsyscall-note.S
  160.19 -$(obj)/vsyscall-sysenter.S: $(obj)/vsyscall-sigreturn.S
  160.20 -$(obj)/vsyscall-syscall.S: $(obj)/vsyscall-sigreturn.S
  160.21 +$(obj)/vsyscall-int80.o $(obj)/vsyscall-sysenter.o $(obj)/vsyscall-syscall.o: \
  160.22 +	$(obj)/vsyscall-sigreturn.S $(obj)/../../i386/kernel/vsyscall-note.S
  160.23  
  160.24 -../../i386/kernel/vsyscall-note.S:
  160.25 -	@ln -fsn $(srctree)/arch/i386/kernel/$(notdir $@) $(srctree)/arch/xen/i386/kernel/$(notdir $@)
  160.26 -	make -C arch/xen/i386/kernel vsyscall-note.S
  160.27 +$(obj)/../../i386/kernel/vsyscall-note.S:
  160.28 +	@ln -fsn $(srctree)/arch/i386/kernel/$(notdir $@) $@
  160.29  
  160.30  obj-y	+= $(c-obj-y) $(s-obj-y)
  160.31  
   162.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c	Tue Aug 23 18:43:18 2005 -0800
   162.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c	Thu Aug 25 15:53:20 2005 -0700
   162.3 @@ -128,8 +128,12 @@ static int __init init_syscall32(void)
   162.4  #endif
   162.5  	return 0;
   162.6  } 
   162.7 -	
   162.8 -__initcall(init_syscall32); 
   162.9 +
  162.10 +/*
  162.11 + * This must be done early in case we have an initrd containing 32-bit
  162.12 + * binaries (e.g., hotplug). This could be pushed upstream to arch/x86_64.
  162.13 + */	
  162.14 +core_initcall(init_syscall32); 
  162.15  
  162.16  /* May not be __init: called during resume */
  162.17  void syscall32_cpu_init(void)
   164.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile	Tue Aug 23 18:43:18 2005 -0800
   164.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile	Thu Aug 25 15:53:20 2005 -0700
   164.3 @@ -25,30 +25,32 @@ obj-$(CONFIG_ACPI_BOOT)		+= acpi/
   164.4  c-obj-$(CONFIG_X86_MSR)		+= msr.o
   164.5  obj-$(CONFIG_MICROCODE)		+= microcode.o
   164.6  obj-$(CONFIG_X86_CPUID)		+= cpuid.o
   164.7 -#obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
   164.8 +obj-$(CONFIG_SMP)		+= smp.o smpboot.o
   164.9  obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o
  164.10  c-obj-$(CONFIG_X86_LOCAL_APIC)	+= nmi.o
  164.11  obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o mpparse.o
  164.12 -c-obj-$(CONFIG_X86_IO_APIC)	+= genapic.o genapic_cluster.o genapic_flat.o
  164.13 +obj-$(CONFIG_X86_XEN_GENAPIC)	+= genapic.o genapic_xen.o
  164.14 +c-obj-$(CONFIG_X86_IO_APIC)	+= genapic_cluster.o genapic_flat.o
  164.15  #obj-$(CONFIG_PM)		+= suspend.o
  164.16  #obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
  164.17  #obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
  164.18  #obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
  164.19  #obj-$(CONFIG_GART_IOMMU)	+= pci-gart.o aperture.o
  164.20 -c-obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
  164.21 -#obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
  164.22 +obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o
  164.23 +i386-obj-$(CONFIG_DUMMY_IOMMU)	+= pci-dma.o
  164.24 +i386-obj-$(CONFIG_SWIOTLB)	+= swiotlb.o
  164.25  obj-$(CONFIG_KPROBES)		+= kprobes.o
  164.26  obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer.o
  164.27  
  164.28  c-obj-$(CONFIG_MODULES)		+= module.o
  164.29  
  164.30 -#obj-y				+= topology.o
  164.31 +obj-y				+= topology.o
  164.32  c-obj-y				+= intel_cacheinfo.o
  164.33  
  164.34  bootflag-y			+= ../../../i386/kernel/bootflag.o
  164.35  cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../../i386/kernel/cpuid.o
  164.36  topology-y                     += ../../../i386/mach-default/topology.o
  164.37 -swiotlb-$(CONFIG_SWIOTLB)      += ../../../ia64/lib/swiotlb.o
  164.38 +#swiotlb-$(CONFIG_SWIOTLB)      += ../../../ia64/lib/swiotlb.o
  164.39  microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../../i386/kernel/microcode.o
  164.40  intel_cacheinfo-y		+= ../../../i386/kernel/cpu/intel_cacheinfo.o
  164.41  quirks-y			+= ../../i386/kernel/quirks.o
   166.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c	Tue Aug 23 18:43:18 2005 -0800
   166.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c	Thu Aug 25 15:53:20 2005 -0700
   166.3 @@ -45,10 +45,11 @@ int disable_apic;
   166.4  
   166.5  void smp_local_timer_interrupt(struct pt_regs *regs)
   166.6  {
   166.7 +
   166.8 +	profile_tick(CPU_PROFILING, regs);
   166.9 +#ifndef CONFIG_XEN
  166.10  	int cpu = smp_processor_id();
  166.11  
  166.12 -	profile_tick(CPU_PROFILING, regs);
  166.13 -#if 0
  166.14  	if (--per_cpu(prof_counter, cpu) <= 0) {
  166.15  		/*
  166.16  		 * The multiplier may have changed since the last time we got
   167.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/asm-offsets.c	Tue Aug 23 18:43:18 2005 -0800
   167.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.3 @@ -1,70 +0,0 @@
   167.4 -/*
   167.5 - * Generate definitions needed by assembly language modules.
   167.6 - * This code generates raw asm output which is post-processed to extract
   167.7 - * and format the required data.
   167.8 - */
   167.9 -
  167.10 -#include <linux/sched.h> 
  167.11 -#include <linux/stddef.h>
  167.12 -#include <linux/errno.h> 
  167.13 -#include <linux/hardirq.h>
  167.14 -#include <linux/suspend.h>
  167.15 -#include <asm/pda.h>
  167.16 -#include <asm/processor.h>
  167.17 -#include <asm/segment.h>
  167.18 -#include <asm/thread_info.h>
  167.19 -#include <asm/ia32.h>
  167.20 -
  167.21 -#define DEFINE(sym, val) \
  167.22 -        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
  167.23 -
  167.24 -#define BLANK() asm volatile("\n->" : : )
  167.25 -
  167.26 -int main(void)
  167.27 -{
  167.28 -#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
  167.29 -	ENTRY(state);
  167.30 -	ENTRY(flags); 
  167.31 -	ENTRY(thread); 
  167.32 -	ENTRY(pid);
  167.33 -	BLANK();
  167.34 -#undef ENTRY
  167.35 -#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry))
  167.36 -	ENTRY(flags);
  167.37 -	ENTRY(addr_limit);
  167.38 -	ENTRY(preempt_count);
  167.39 -	BLANK();
  167.40 -#undef ENTRY
  167.41 -#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
  167.42 -	ENTRY(kernelstack); 
  167.43 -	ENTRY(oldrsp); 
  167.44 -	ENTRY(pcurrent); 
  167.45 -	ENTRY(irqrsp);
  167.46 -	ENTRY(irqcount);
  167.47 -	ENTRY(cpunumber);
  167.48 -	ENTRY(irqstackptr);
  167.49 -	ENTRY(kernel_mode);
  167.50 -	BLANK();
  167.51 -#undef ENTRY
  167.52 -#ifdef CONFIG_IA32_EMULATION
  167.53 -#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
  167.54 -	ENTRY(eax);
  167.55 -	ENTRY(ebx);
  167.56 -	ENTRY(ecx);
  167.57 -	ENTRY(edx);
  167.58 -	ENTRY(esi);
  167.59 -	ENTRY(edi);
  167.60 -	ENTRY(ebp);
  167.61 -	ENTRY(esp);
  167.62 -	ENTRY(eip);
  167.63 -	BLANK();
  167.64 -#undef ENTRY
  167.65 -	DEFINE(IA32_RT_SIGFRAME_sigcontext,
  167.66 -	       offsetof (struct rt_sigframe32, uc.uc_mcontext));
  167.67 -	BLANK();
  167.68 -#endif
  167.69 -	DEFINE(pbe_address, offsetof(struct pbe, address));
  167.70 -	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
  167.71 -	DEFINE(pbe_next, offsetof(struct pbe, next));
  167.72 -	return 0;
  167.73 -}
   168.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Tue Aug 23 18:43:18 2005 -0800
   168.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Thu Aug 25 15:53:20 2005 -0700
   168.3 @@ -46,7 +46,7 @@ void __init add_memory_region(unsigned l
   168.4  	e820.nr_map++;
   168.5  }
   168.6  
   168.7 -#if 0
   168.8 +#ifndef CONFIG_XEN
   168.9  extern char _end[];
  168.10  
  168.11  /* 
  168.12 @@ -235,7 +235,6 @@ void __init e820_reserve_resources(void)
  168.13  	}
  168.14  }
  168.15  
  168.16 -
  168.17  void __init e820_print_map(char *who)
  168.18  {
  168.19  	int i;
  168.20 @@ -516,9 +515,31 @@ void __init setup_memory_region(void)
  168.21  	printk(KERN_INFO "BIOS-provided physical RAM map:\n");
  168.22  	e820_print_map(who);
  168.23  }
  168.24 -#endif
  168.25 +
  168.26 +#else  /* CONFIX_XEN */
  168.27 +extern unsigned long xen_override_max_pfn;
  168.28 +extern union xen_start_info_union xen_start_info_union;
  168.29 +/*
  168.30 + * Guest physical starts from 0.
  168.31 + */
  168.32 +unsigned long __init e820_end_of_ram(void)
  168.33 +{
  168.34 +        unsigned long max_end_pfn = xen_start_info.nr_pages;
  168.35  
  168.36 -extern unsigned long xen_override_max_pfn;
  168.37 +	if ( xen_override_max_pfn <  max_end_pfn)
  168.38 +		xen_override_max_pfn = max_end_pfn;
  168.39 +	
  168.40 +        return xen_override_max_pfn;
  168.41 +}
  168.42 +
  168.43 +
  168.44 +
  168.45 +void __init e820_reserve_resources(void) 
  168.46 +{
  168.47 +	return;			/* Xen won't have reserved entries */
  168.48 +}
  168.49 +
  168.50 +#endif
  168.51  
  168.52  void __init parse_memopt(char *p, char **from) 
  168.53  { 
   169.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c	Tue Aug 23 18:43:18 2005 -0800
   169.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c	Thu Aug 25 15:53:20 2005 -0700
   169.3 @@ -6,6 +6,8 @@
   169.4  #include <asm/io.h>
   169.5  #include <asm/processor.h>
   169.6  
   169.7 +#ifndef CONFIG_XEN
   169.8 +
   169.9  /* Simple VGA output */
  169.10  
  169.11  #ifdef __i386__
  169.12 @@ -59,7 +61,6 @@ static struct console early_vga_console 
  169.13  	.index =	-1,
  169.14  };
  169.15  
  169.16 -#ifndef CONFIG_XEN
  169.17  /* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ 
  169.18  
  169.19  static int early_serial_base = 0x3f8;  /* ttyS0 */
  169.20 @@ -148,7 +149,8 @@ static __init void early_serial_init(cha
  169.21  	outb((divisor >> 8) & 0xff, early_serial_base + DLH); 
  169.22  	outb(c & ~DLAB, early_serial_base + LCR);
  169.23  }
  169.24 -#else
  169.25 +
  169.26 +#else /* CONFIG_XEN */
  169.27  
  169.28  static void
  169.29  early_serial_write(struct console *con, const char *s, unsigned count)
  169.30 @@ -167,6 +169,13 @@ early_serial_write(struct console *con, 
  169.31  static __init void early_serial_init(char *s)
  169.32  {
  169.33  }
  169.34 +
  169.35 +/*
  169.36 + * No early VGA console on Xen, as we do not have convenient ISA-space
  169.37 + * mappings. Someone should fix this for domain 0. For now, use fake serial.
  169.38 + */
  169.39 +#define early_vga_console early_serial_console
  169.40 +
  169.41  #endif
  169.42  
  169.43  static struct console early_serial_console = {
   170.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S	Tue Aug 23 18:43:18 2005 -0800
   170.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S	Thu Aug 25 15:53:20 2005 -0700
   170.3 @@ -128,7 +128,6 @@
   170.4           * #define VGCF_IN_SYSCALL (1<<8) 
   170.5           */
   170.6          .macro SWITCH_TO_USER flag
   170.7 -        movl $0,%gs:pda_kernel_mode     # change to user mode
   170.8          subq $8*4,%rsp                   # reuse rip, cs, rflags, rsp, ss in the stack
   170.9          movq %rax,(%rsp)
  170.10          movq %r11,1*8(%rsp)
  170.11 @@ -139,7 +138,6 @@
  170.12          .endm
  170.13  
  170.14          .macro SWITCH_TO_KERNEL ssoff,adjust=0
  170.15 -  	btsq $0,%gs:pda_kernel_mode
  170.16  	jc  1f
  170.17  	orb  $1,\ssoff-\adjust+4(%rsp)
  170.18  1:
   171.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic.c	Thu Aug 25 15:53:20 2005 -0700
   171.3 @@ -0,0 +1,123 @@
   171.4 +/*
   171.5 + * Copyright 2004 James Cleverdon, IBM.
   171.6 + * Subject to the GNU Public License, v.2
   171.7 + *
   171.8 + * Generic APIC sub-arch probe layer.
   171.9 + *
  171.10 + * Hacked for x86-64 by James Cleverdon from i386 architecture code by
  171.11 + * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  171.12 + * James Cleverdon.
  171.13 + */
  171.14 +#include <linux/config.h>
  171.15 +#include <linux/threads.h>
  171.16 +#include <linux/cpumask.h>
  171.17 +#include <linux/string.h>
  171.18 +#include <linux/kernel.h>
  171.19 +#include <linux/ctype.h>
  171.20 +#include <linux/init.h>
  171.21 +#include <linux/module.h>
  171.22 +
  171.23 +#include <asm/smp.h>
  171.24 +#include <asm/ipi.h>
  171.25 +
  171.26 +#if defined(CONFIG_ACPI_BUS)
  171.27 +#include <acpi/acpi_bus.h>
  171.28 +#endif
  171.29 +
  171.30 +/* which logical CPU number maps to which CPU (physical APIC ID) */
  171.31 +u8 x86_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
  171.32 +EXPORT_SYMBOL(x86_cpu_to_apicid);
  171.33 +u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
  171.34 +
  171.35 +extern struct genapic apic_cluster;
  171.36 +extern struct genapic apic_flat;
  171.37 +
  171.38 +#ifndef CONFIG_XEN
  171.39 +struct genapic *genapic = &apic_flat;
  171.40