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.
     5.1 --- a/docs/misc/shype4xen_readme.txt	Tue Aug 23 18:43:18 2005 -0800
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,588 +0,0 @@
     5.4 -Copyright: IBM Corporation (C)
     5.5 -20 June 2005
     5.6 -Author: Reiner Sailer
     5.7 -
     5.8 -This document is a very short introduction into the sHype access control 
     5.9 -security architecture implementation and how it is perceived by users. It 
    5.10 -is a very preliminary draft  for the courageous ones to get "their feet wet" 
    5.11 -and to be able to give feedback (via the xen-devel/xense-devel mailing lists).
    5.12 -
    5.13 -Install:
    5.14 -
    5.15 -cd into xeno-unstable.bk 
    5.16 -(use --dry-run option if you want to test the patch only)
    5.17 -patch -p1 -g0 < *tools.diff
    5.18 -patch -p1 -g0 < *xen.diff
    5.19 -
    5.20 -(no rejects, probably some line offsets)
    5.21 -
    5.22 -make uninstall; make mrproper; make; ./install.sh should install the default 
    5.23 -sHype into Xen (rebuild your initrd images if necessary). Reboot.
    5.24 -
    5.25 -Debug output: there are two triggers for debug output:
    5.26 -a) General sHype debug:
    5.27 -    xeno-unstable.bk/xen/include/public/acm.h
    5.28 -    undefine ACM_DEBUG to switch this debug off
    5.29 -
    5.30 -b) sHype enforcement hook trace: This prints a small trace for each enforcement 
    5.31 -hook that is executed. The trigger is in
    5.32 -    xeno-unstable.bk/xen/include/acm/acm_hooks.h
    5.33 -    undefine ACM_TRACE_MODE to switch this debug off
    5.34 -
    5.35 -1. The default NULL policy
    5.36 -***************************
    5.37 -When you apply the patches and startup xen, you should at first not notice any 
    5.38 -difference because the default policy is the "NULL" policy, which as the name 
    5.39 -implies does not enforce anything.
    5.40 -
    5.41 -To display the currently enforced policy, use the policy tool under xeno-
    5.42 -unstable.bk/tools/policy: policy_tool getpolicy. You should see output like the 
    5.43 -one below.
    5.44 -
    5.45 -[root@laptop policy]#./policy_tool getpolicy
    5.46 -
    5.47 -Policy dump:
    5.48 -============
    5.49 -Magic     = 1debc.
    5.50 -PolVer    = aaaa0000.
    5.51 -Len       = 14.
    5.52 -Primary   = NULL policy (c=0, off=14).
    5.53 -Secondary = NULL policy (c=0, off=14).
    5.54 -No primary policy (NULL).
    5.55 -No secondary policy (NULL).
    5.56 -
    5.57 -Policy dump End.
    5.58 -
    5.59 -Since this is a dump of a binary policy, it's not pretty. The important parts 
    5.60 -are the "Primary" and "Secondary" policy fields set to "NULL policy". sHype 
    5.61 -currently allows to set two independent policies; thus the two SSID-REF parts 
    5.62 -shown in 'xm list'. Right here: primary policy only means this policy is 
    5.63 -checked first, the secondary policy is checked if the primary results in 
    5.64 -"permitted access". The result of the combined policy is "permitted" if both 
    5.65 -policies return permitted (NULL policy always returns permitted). The result is 
    5.66 -"denied" if at least one of the policies returns "denied". Look into xeno-
    5.67 -unstable.bk/xen/include/acm/acm_hooks.h for the general hook structure 
    5.68 -integrating the policy decisions (if you like, you won't need it for the rest 
    5.69 -of the Readme file).
    5.70 -
    5.71 -2. Setting Chinese Wall and Simple Type Enforcement policies:
    5.72 -*************************************************************
    5.73 -
    5.74 -We'll get fast to the point. However, in order to understand what we are doing, 
    5.75 -we must at least understand the purpose of the policies that we are going to 
    5.76 -enforce. The two policies presented here are just examples and the 
    5.77 -implementation encourages adding new policies easily.
    5.78 -
    5.79 -2.1. Chinese Wall policy: "decides whether a domain can be started based on 
    5.80 -this domain's ssidref and the ssidrefs of the currently running domains". 
    5.81 -Generally, the Chinese wall policy allows specifying certain types (or classes 
    5.82 -or categories, whatever the preferred word) that conflict; we usually assign a 
    5.83 -type to a workload and the set of types of those workloads running in a domain 
    5.84 -make up the type set for this domain.  Each domain is assigned a set of types 
    5.85 -through its SSID-REF (we register Chinese Wall as primary policy, so the 
    5.86 -ssidref used for determining the Chinese Wall types is the one annotated with 
    5.87 -"p:" in xm list) since each SSID-REF points at a set of types. We'll see how 
    5.88 -SSIDREFs are represented in Xen later when we will look at the policy. (A good 
    5.89 -read for Chinese Wall is: Brewer/Nash The Chinese Wall Security Policy 1989.)
    5.90 -
    5.91 -So let's assume the Chinese Wall policy we are running distinguishes 10 types: 
    5.92 -t0 ... t9. Let us assume further that each SSID-REF points to a set that 
    5.93 -includes exactly one type (attached to domains that run workloads of a single 
    5.94 -type). SSID-REF 0 points to {t0}, ssidref 1 points to {t1} ... 9 points to 
    5.95 -{t9}. [This is actually the example policy we are going to push into xen later]
    5.96 -
    5.97 -Now the Chinese Wall policy allows you to define "Conflict type sets" and it 
    5.98 -guarantees that of any conflict set at most one type is "running" at any time. 
    5.99 -As an example, we have defined 2 conflict set: {t2, t3} and {t0, t5, t6}. 
   5.100 -Specifying these conflict sets, sHype ensures that at most one type of each set 
   5.101 -is running (either t2 or t3 but not both; either t0 or t5 or t6 but not 
   5.102 -multiple of them).
   5.103 -
   5.104 -The effect is that administrators can define which workload types cannot run 
   5.105 -simultaneously on a single Xen system. This is useful to limit the covert 
   5.106 -timing channels between such payloads or to ensure that payloads don't 
   5.107 -interfere with each other through existing resource dependencies.
   5.108 -
   5.109 -2.2. Simple Type Enforcement (ste) policy: "decides whether two domains can 
   5.110 -share data, e.g., setup event channels or grant tables to each other, based on 
   5.111 -the two domains' ssidref. This, as the name says, is a simple policy. Think of 
   5.112 -each type as of a single color. Each domain has one or more colors, i.e., the 
   5.113 -domains ssid for the ste policy points to a set that has set one or multiple 
   5.114 -types. Let us assume in our example policy we differentiate 5 colors (types) 
   5.115 -and define 5 different ssids referenced by ssidref=0..4. Each ssid shall have 
   5.116 -exactly one type set, i.e., describes a uni-color. Only ssid(0) has all types 
   5.117 -set, i.e., has all defined colors.
   5.118 -
   5.119 -Sharing is enforced by the ste policy by requiring that two domains that want 
   5.120 -to establish an event channel or grant pages to each other must have a common 
   5.121 -color. Currently all domains communicate through DOM0 by default; i.e., Domain0 
   5.122 -will necessarily have all colors to be able to create domains (thus, we will 
   5.123 -assign ssidref(0) to Domain0 in our example below.
   5.124 -
   5.125 -More complex mandatory access control policies governing sharing will follow; 
   5.126 -such policies are more sophisticated than the "color" scheme above by allowing 
   5.127 -more flexible (and complex :_) access control decisions than "share a color" or 
   5.128 -"don't share a color" and will be able to express finer-grained policies.
   5.129 -
   5.130 -
   5.131 -2.3 Binary Policy:
   5.132 -In the future, we will have a policy tool that takes as input a more humane 
   5.133 -policy description, using types such as development, home-banking, donated-
   5.134 -Grid, CorpA-Payload ... and translates the respective policy into what we see 
   5.135 -today as the binary policy using 1s and 0s and sets of them. For now, we must 
   5.136 -live with the binary policy when working with sHype.
   5.137 -
   5.138 -    
   5.139 -2.4 Exemplary use of a real sHype policy on Xen. To activate a real policy, 
   5.140 -edit the file (yes, this will soon be a compile option):
   5.141 -  xeno-unstable.bk/xen/include/public/acm.h
   5.142 -  Change: #define ACM_USE_SECURITY_POLICY ACM_NULL_POLICY
   5.143 -   To : #define ACM_USE_SECURITY_POLICY ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY
   5.144 -   cd xeno-unstable.bk
   5.145 -   make mrproper
   5.146 -   make uninstall (manually remove /etc/xen.old if necessary)
   5.147 -   make
   5.148 -   ./install.sh      (recreate your kernel initrd's if necessary)
   5.149 -   Reboot into new xen.gz
   5.150 -     
   5.151 -After booting, check out 'xm dmesg'; should show somewhere in the middle:
   5.152 -
   5.153 -(XEN) acm_init: Enforcing Primary CHINESE WALL policy, Secondary SIMPLE TYPE 
   5.154 -ENFORCEMENT policy.
   5.155 -
   5.156 -Even though you can activate those policies in any combination and also 
   5.157 -independently, the policy tool currently only supports setting the policy for 
   5.158 -the above combination.
   5.159 -
   5.160 -Now look at the minimal startup policy with:
   5.161 -                xeno-unstable.bk/tools/policytool getpolicy
   5.162 -
   5.163 -You should see something like:
   5.164 -
   5.165 -[root@laptop policy]# ./policy_tool getpolicy
   5.166 -
   5.167 -Policy dump:
   5.168 -============
   5.169 -Magic     = 1debc.
   5.170 -PolVer    = aaaa0000.
   5.171 -Len       = 36.
   5.172 -Primary   = CHINESE WALL policy (c=1, off=14).
   5.173 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=2c).
   5.174 -
   5.175 -
   5.176 -Chinese Wall policy:
   5.177 -====================
   5.178 -Max Types     = 1.
   5.179 -Max Ssidrefs  = 1.
   5.180 -Max ConfSets  = 1.
   5.181 -Ssidrefs Off  = 10.
   5.182 -Conflicts Off = 12.
   5.183 -Runing T. Off = 14.
   5.184 -C. Agg. Off   = 16.
   5.185 -
   5.186 -SSID To CHWALL-Type matrix:
   5.187 -
   5.188 -   ssidref 0:  00 
   5.189 -
   5.190 -Confict Sets:
   5.191 -
   5.192 -   c-set 0:    00 
   5.193 -
   5.194 -Running
   5.195 -Types:         00 
   5.196 -
   5.197 -Conflict
   5.198 -Aggregate Set: 00 
   5.199 -
   5.200 -
   5.201 -Simple Type Enforcement policy:
   5.202 -===============================
   5.203 -Max Types     = 1.
   5.204 -Max Ssidrefs  = 1.
   5.205 -Ssidrefs Off  = 8.
   5.206 -
   5.207 -SSID To STE-Type matrix:
   5.208 -
   5.209 -   ssidref 0: 01 
   5.210 -
   5.211 -
   5.212 -Policy dump End.
   5.213 -
   5.214 -This is a minimal policy (of little use), except it will disable starting any 
   5.215 -domain that does not have ssidref set to 0x0. The Chinese Wall policy has 
   5.216 -nothing to enforce and the ste policy only knows one type, which is set for the 
   5.217 -only defined ssidref.
   5.218 -
   5.219 -The item that defines the ssidref in a domain configuration is:
   5.220 -
   5.221 -ssidref = 0x12345678
   5.222 -
   5.223 -Where ssidref is interpreted as a 32bit number, where the lower 16bits become 
   5.224 -the ssidref for the primary policy and the higher 16bits become the ssidref for 
   5.225 -the secondary policy. sHype currently supports two policies but this is an 
   5.226 -implementation decision and can be extended if necessary.
   5.227 -
   5.228 -This reference defines the security information of a domain. The meaning of the 
   5.229 -SSID-REF depends on the policy, so we explain it when we explain the real 
   5.230 -policies.
   5.231 -
   5.232 -
   5.233 -Setting a new Security Policy:
   5.234 -******************************
   5.235 -The policy tool with all its current limitations has one usable example policy 
   5.236 -compiled-in. Please try at this time to use the setpolicy command:
   5.237 -       xeno-unstable.bk/tools/policy/policy_tool setpolicy
   5.238 -
   5.239 -You should see a dump of the policy you are setting. It should say at the very 
   5.240 -end: 
   5.241 -
   5.242 -Policy successfully set.
   5.243 -
   5.244 -Now try to dump the currently enforced policy, which is the policy we have just 
   5.245 -set and the dynamic security state information of this policy 
   5.246 -(<<< ... some additional explanations)
   5.247 -
   5.248 -[root@laptop policy]# ./policy_tool getpolicy
   5.249 -
   5.250 -Policy dump:
   5.251 -============
   5.252 -Magic     = 1debc.
   5.253 -PolVer    = aaaa0000.
   5.254 -Len       = 112.
   5.255 -Primary   = CHINESE WALL policy (c=1, off=14).
   5.256 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   5.257 -
   5.258 -
   5.259 -Chinese Wall policy:
   5.260 -====================
   5.261 -Max Types     = a.
   5.262 -Max Ssidrefs  = 5.
   5.263 -Max ConfSets  = 2.
   5.264 -Ssidrefs Off  = 10.
   5.265 -Conflicts Off = 74.
   5.266 -Runing T. Off = 9c.
   5.267 -C. Agg. Off   = b0.
   5.268 -
   5.269 -SSID To CHWALL-Type matrix:
   5.270 -
   5.271 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00  <<< type0 is set for ssidref0
   5.272 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00 
   5.273 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00 
   5.274 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00 
   5.275 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00  <<< type4 is set for ssidref4
   5.276 -                                              <<< types 5-9 are unused
   5.277 -Confict Sets:
   5.278 -
   5.279 -   c-set 0:    00 00 01 01 00 00 00 00 00 00  <<< type2 and type3 never run together
   5.280 -   c-set 1:    01 00 00 00 00 01 01 00 00 00  <<< only one of types 0, 5 or 6 
   5.281 -                                              <<<   can run simultaneously
   5.282 -Running
   5.283 -Types:         01 00 00 00 00 00 00 00 00 00  <<< ref-count for types of running domains
   5.284 -
   5.285 -Conflict
   5.286 -Aggregate Set: 00 00 00 00 00 01 01 00 00 00  <<< aggregated set of types that                  
   5.287 -                                              <<< cannot run because they 
   5.288 -                                              <<< are in conflict set 1 and
   5.289 -                                              <<< (domain 0 is running w t0)
   5.290 -                                             
   5.291 -
   5.292 -Simple Type Enforcement policy:
   5.293 -===============================
   5.294 -Max Types     = 5.
   5.295 -Max Ssidrefs  = 5.
   5.296 -Ssidrefs Off  = 8.
   5.297 -
   5.298 -SSID To STE-Type matrix:
   5.299 -
   5.300 -   ssidref 0: 01 01 01 01 01                  <<< ssidref0 points to a set that                  
   5.301 -                                              <<< has all types set (colors)
   5.302 -   ssidref 1: 00 01 00 00 00                  <<< ssidref1 has color1 set
   5.303 -   ssidref 2: 00 00 01 00 00                  <<< ...
   5.304 -   ssidref 3: 00 00 00 01 00 
   5.305 -   ssidref 4: 00 00 00 00 01 
   5.306 -
   5.307 -
   5.308 -Policy dump End.
   5.309 -
   5.310 -
   5.311 -This is a small example policy with which we will demonstrate the enforcement.
   5.312 -
   5.313 -Starting Domains with policy enforcement
   5.314 -========================================
   5.315 -Now let us play with this policy. 
   5.316 -
   5.317 -Define 3 or 4 domain configurations. I use the following config using a ramdisk 
   5.318 -only and about 8MBytes of memory for each DomU (test purposes):
   5.319 -
   5.320 -#-------configuration xmsec1-------------------------
   5.321 -kernel = "/boot/vmlinuz-2.6.11-xenU"
   5.322 -ramdisk="/boot/U1_ramdisk.img"
   5.323 -#security reference identifier
   5.324 -ssidref= 0x00010001
   5.325 -memory = 10
   5.326 -name = "xmsec1"
   5.327 -cpu = -1   # leave to Xen to pick
   5.328 -# Number of network interfaces. Default is 1.
   5.329 -nics=1
   5.330 -dhcp="dhcp"
   5.331 -#-----------------------------------------------------
   5.332 -
   5.333 -xmsec2 and xmsec3 look the same except for the name and the ssidref line. Use 
   5.334 -your domain config file and add "ssidref = 0x00010001" to the first (xmsec1),  
   5.335 -"ssidref= 0x00020002" to the second (call it xmsec2), and "ssidref=0x00030003"  
   5.336 -to the third (we will call this one xmsec3).
   5.337 -
   5.338 -First start xmsec1: xm create -c xmsec1 (succeeds)
   5.339 -
   5.340 -Then
   5.341 -[root@laptop policy]# xm list 
   5.342 -Name              Id  Mem(MB)  CPU  State  Time(s)  Console  
   5.343 -Domain-0           0      620   0  r----     42.3            s:00/p:00
   5.344 -xmnosec            1        9   0  -b---      0.3    9601    s:00/p:05
   5.345 -xmsec1             2        9   0  -b---      0.2    9602    s:01/p:01
   5.346 -
   5.347 -Shows a new domain xmsec1 running with primary (here: chinese wall) ssidref 1 
   5.348 -and secondary (here: simple type enforcement) ssidref 1. The ssidrefs are  
   5.349 -independent and can differ for a domain.
   5.350 -
   5.351 -[root@laptop policy]# ./policy_tool getpolicy
   5.352 -
   5.353 -Policy dump:
   5.354 -============
   5.355 -Magic     = 1debc.
   5.356 -PolVer    = aaaa0000.
   5.357 -Len       = 112.
   5.358 -Primary   = CHINESE WALL policy (c=1, off=14).
   5.359 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   5.360 -
   5.361 -
   5.362 -Chinese Wall policy:
   5.363 -====================
   5.364 -Max Types     = a.
   5.365 -Max Ssidrefs  = 5.
   5.366 -Max ConfSets  = 2.
   5.367 -Ssidrefs Off  = 10.
   5.368 -Conflicts Off = 74.
   5.369 -Runing T. Off = 9c.
   5.370 -C. Agg. Off   = b0.
   5.371 -
   5.372 -SSID To CHWALL-Type matrix:
   5.373 -
   5.374 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00
   5.375 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00
   5.376 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00
   5.377 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00
   5.378 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00
   5.379 -
   5.380 -Confict Sets:
   5.381 -
   5.382 -   c-set 0:    00 00 01 01 00 00 00 00 00 00
   5.383 -   c-set 1:    01 00 00 00 00 01 01 00 00 00   <<< t1 is not part of any c-set
   5.384 -
   5.385 -Running
   5.386 -Types:         01 01 00 00 00 00 00 00 00 00   <<< xmsec1 has ssidref 1->type1
   5.387 -                  ^^                           <<< ref-count at position 1 incr
   5.388 -Conflict
   5.389 -Aggregate Set: 00 00 00 00 00 01 01 00 00 00   <<< domain 1 was allowed to       
   5.390 -                                               <<< start since type 1 was not
   5.391 -                                               <<< in conflict with running 
   5.392 -                                               <<< types
   5.393 -                                            
   5.394 -Simple Type Enforcement policy:
   5.395 -===============================
   5.396 -Max Types     = 5.
   5.397 -Max Ssidrefs  = 5.
   5.398 -Ssidrefs Off  = 8.
   5.399 -
   5.400 -SSID To STE-Type matrix:
   5.401 -
   5.402 -   ssidref 0: 01 01 01 01 01           <<< the ste policy does not maintain; we
   5.403 -   ssidref 1: 00 01 00 00 00   <--     <<< see that domain xmsec1 has ste 
   5.404 -   ssidref 2: 00 00 01 00 00           <<< ssidref1->type1 and has this type in
   5.405 -   ssidref 3: 00 00 00 01 00           <<< common with dom0
   5.406 -   ssidref 4: 00 00 00 00 01
   5.407 -
   5.408 -
   5.409 -Policy dump End.
   5.410 -
   5.411 -Look at sHype output in xen dmesg:
   5.412 -
   5.413 -[root@laptop xen]# xm dmesg
   5.414 -.
   5.415 -.
   5.416 -[somewhere near the very end]
   5.417 -(XEN) chwall_init_domain_ssid: determined chwall_ssidref to 1.
   5.418 -(XEN) ste_init_domain_ssid.
   5.419 -(XEN) ste_init_domain_ssid: determined ste_ssidref to 1.
   5.420 -(XEN) acm_init_domain_ssid: Instantiated individual ssid for domain 0x01.
   5.421 -(XEN) chwall_post_domain_create.
   5.422 -(XEN) ste_pre_eventchannel_interdomain.
   5.423 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   5.424 -(XEN) shype_authorize_domops.
   5.425 -(XEN) ste_pre_eventchannel_interdomain.
   5.426 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   5.427 -(XEN) ste_pre_eventchannel_interdomain.
   5.428 -(XEN) ste_pre_eventchannel_interdomain: (evtchn 0 --> 1) common type #01.
   5.429 -
   5.430 -
   5.431 -You can see that the chinese wall policy does not complain and that the ste 
   5.432 -policy makes three access control decisions for three event-channels setup 
   5.433 -between domain 0 and the new domain 1. Each time, the two domains share the 
   5.434 -type1 and setting up the eventchannel is permitted.
   5.435 -
   5.436 -
   5.437 -Starting up a second domain xmsec2:
   5.438 -
   5.439 -[root@laptop xen]# xm create -c xmsec2
   5.440 -Using config file "xmsec2".
   5.441 -Started domain xmsec2, console on port 9602
   5.442 -************ REMOTE CONSOLE: CTRL-] TO QUIT ********
   5.443 -Linux version 2.6.11-xenU (root@laptop.home.org) (gcc version 3.4.2 20041017 
   5.444 -(Red Hat 3.4.2-6.fc3)) #1 Wed Mar 30 13:14:31 EST 2005
   5.445 -.
   5.446 -.
   5.447 -.
   5.448 -[root@laptop policy]# xm list
   5.449 -Name              Id  Mem(MB)  CPU  State  Time(s)  Console  
   5.450 -Domain-0           0      620   0  r----     71.7            s:00/p:00
   5.451 -xmsec1             1        9   0  -b---      0.3    9601    s:01/p:01
   5.452 -xmsec2             2        7   0  -b---      0.3    9602    s:02/p:02   << our domain runs both policies with ssidref 2
   5.453 -
   5.454 -
   5.455 -[root@laptop policy]# ./policy_tool getpolicy
   5.456 -
   5.457 -Policy dump:
   5.458 -============
   5.459 -Magic     = 1debc.
   5.460 -PolVer    = aaaa0000.
   5.461 -Len       = 112.
   5.462 -Primary   = CHINESE WALL policy (c=1, off=14).
   5.463 -Secondary = SIMPLE TYPE ENFORCEMENT policy (c=2, off=d8).
   5.464 -
   5.465 -
   5.466 -Chinese Wall policy:
   5.467 -====================
   5.468 -Max Types     = a.
   5.469 -Max Ssidrefs  = 5.
   5.470 -Max ConfSets  = 2.
   5.471 -Ssidrefs Off  = 10.
   5.472 -Conflicts Off = 74.
   5.473 -Runing T. Off = 9c.
   5.474 -C. Agg. Off   = b0.
   5.475 -
   5.476 -SSID To CHWALL-Type matrix:
   5.477 -
   5.478 -   ssidref 0:  01 00 00 00 00 00 00 00 00 00
   5.479 -   ssidref 1:  00 01 00 00 00 00 00 00 00 00
   5.480 -   ssidref 2:  00 00 01 00 00 00 00 00 00 00   <<< our domain has type 2 set
   5.481 -   ssidref 3:  00 00 00 01 00 00 00 00 00 00
   5.482 -   ssidref 4:  00 00 00 00 01 00 00 00 00 00
   5.483 -
   5.484 -Confict Sets:
   5.485 -
   5.486 -   c-set 0:    00 00 01 01 00 00 00 00 00 00   <<< t2 is in c-set0 with type 3
   5.487 -   c-set 1:    01 00 00 00 00 01 01 00 00 00
   5.488 -
   5.489 -Running
   5.490 -Types:         01 01 01 00 00 00 00 00 00 00   <<< t2 is running since the 
   5.491 -                     ^^                        <<< current aggregate conflict
   5.492 -                                               <<< set (see above) does not 
   5.493 -                                               <<< include type 2
   5.494 -Conflict
   5.495 -Aggregate Set: 00 00 00 01 00 01 01 00 00 00   <<< type 3 is added to the 
   5.496 -                                               <<< conflict aggregate
   5.497 -
   5.498 -
   5.499 -Simple Type Enforcement policy:
   5.500 -===============================
   5.501 -Max Types     = 5.
   5.502 -Max Ssidrefs  = 5.
   5.503 -Ssidrefs Off  = 8.
   5.504 -
   5.505 -SSID To STE-Type matrix:
   5.506 -
   5.507 -   ssidref 0: 01 01 01 01 01
   5.508 -   ssidref 1: 00 01 00 00 00
   5.509 -   ssidref 2: 00 00 01 00 00
   5.510 -   ssidref 3: 00 00 00 01 00
   5.511 -   ssidref 4: 00 00 00 00 01
   5.512 -
   5.513 -
   5.514 -Policy dump End.
   5.515 -
   5.516 -
   5.517 -The sHype xen dmesg output looks similar to the one above when starting the 
   5.518 -first domain.
   5.519 -
   5.520 -Now we start xmsec3 and it has ssidref3. Thus, it tries to run as type3 which 
   5.521 -conflicts with running type2 (from xmsec2). As expected, creating this domain 
   5.522 -fails for security policy enforcement reasons.
   5.523 -
   5.524 -[root@laptop xen]# xm create -c xmsec3
   5.525 -Using config file "xmsec3".
   5.526 -Error: Error creating domain: (22, 'Invalid argument')
   5.527 -[root@laptop xen]#
   5.528 -
   5.529 -[root@laptop xen]# xm dmesg
   5.530 -.
   5.531 -.
   5.532 -[somewhere near the very end]
   5.533 -(XEN) chwall_pre_domain_create.
   5.534 -(XEN) chwall_pre_domain_create: CHINESE WALL CONFLICT in type 03.
   5.535 -
   5.536 -xmsec3 ssidref3 points to type3, which is in the current conflict aggregate 
   5.537 -set. This domain cannot start until domain xmsec2 is destroyed, at which time 
   5.538 -the aggregate conflict set is reduced and type3 is excluded from it. Then, 
   5.539 -xmsec3 can start. Of course, afterwards, xmsec2 cannot be restarted. Try it.
   5.540 -
   5.541 -3. Policy tool
   5.542 -**************
   5.543 -toos/policy/policy_tool.c
   5.544 -
   5.545 -a) ./policy_tool getpolicy
   5.546 -      prints the currently enforced policy
   5.547 -      (see for example section 1.)
   5.548 -
   5.549 -b) ./policy_tool setpolicy
   5.550 -      sets a predefined and hardcoded security
   5.551 -      policy (the one described in section 2.)
   5.552 -
   5.553 -c) ./policy_tool dumpstats
   5.554 -      prints some status information about the caching
   5.555 -      of access control decisions (number of cache hits
   5.556 -      and number of policy evaluations for grant_table
   5.557 -      and event channels).
   5.558 -
   5.559 -d) ./policy_tool loadpolicy <binary_policy_file>
   5.560 -      sets the policy defined in the <binary_policy_file>
   5.561 -      please use the policy_processor that is posted to this
   5.562 -      mailing list to create such a binary policy from an XML
   5.563 -      policy description
   5.564 -
   5.565 -4. Policy interface:
   5.566 -********************
   5.567 -The Policy interface is working in "network-byte-order" (big endian). The reason for this
   5.568 -is that policy files/management should be portable and independent of the platforms.
   5.569 -
   5.570 -Our policy interface enables managers to create a single binary policy file in a trusted
   5.571 -environment and distributed it to multiple systems for enforcement.
   5.572 -
   5.573 -5. Booting with a binary policy:
   5.574 -********************************
   5.575 -The grub configuration file can be adapted to boot the hypervisor with an
   5.576 -already active policy. To do this, a binary policy file - this can be
   5.577 -the same file as used by the policy_tool - should be placed into the boot
   5.578 -partition. The following entry from the grub configuration file shows how
   5.579 -a binary policy can be added to the system during boot time. Note that the 
   5.580 -binary policy must be of the same type that the hypervisor was compiled 
   5.581 -for. The policy module line should also only be added as the last module
   5.582 -line if XEN was compiled with the access control module (ACM).
   5.583 -
   5.584 -title XEN0 3.0 Devel
   5.585 -	kernel /xen.gz dom0_mem=400000
   5.586 -	module /vmlinuz-2.6.12-xen0 root=/dev/hda2 ro console=tty0
   5.587 -	module /initrd-2.6.12-xen0.img
   5.588 -	module /xen_sample_policy.bin
   5.589 -
   5.590 -
   5.591 -====================end-of file=======================================
     6.1 --- a/docs/src/user.tex	Tue Aug 23 18:43:18 2005 -0800
     6.2 +++ b/docs/src/user.tex	Thu Aug 25 15:53:20 2005 -0700
     6.3 @@ -1709,8 +1709,11 @@ editing \path{grub.conf}.
     6.4   For example: `com1=9600, 8n1, 0x408, 5' maps COM1 to a
     6.5   9600-baud port, 8 data bits, no parity, 1 stop bit,
     6.6   I/O port base 0x408, IRQ 5.
     6.7 - If the I/O base and IRQ are standard (com1:0x3f8,4;
     6.8 - com2:0x2f8,3) then they need not be specified. 
     6.9 + If some configuration options are standard (e.g., I/O base and IRQ),
    6.10 + then only a prefix of the full configuration string need be
    6.11 + specified. If the baud rate is pre-configured (e.g., by the
    6.12 + bootloader) then you can specify `auto' in place of a numeric baud
    6.13 + rate. 
    6.14  
    6.15  \item [console=$<$specifier list$>$ ] 
    6.16   Specify the destination for Xen console I/O.
    6.17 @@ -1760,7 +1763,7 @@ editing \path{grub.conf}.
    6.18   physical address in the memory map will be ignored. This parameter
    6.19   may be specified with a B, K, M or G suffix, representing bytes,
    6.20   kilobytes, megabytes and gigabytes respectively. The
    6.21 - default unit, if no suffix is specified, is bytes.
    6.22 + default unit, if no suffix is specified, is kilobytes.
    6.23  
    6.24  \item [dom0\_mem=xxx ] 
    6.25   Set the amount of memory to be allocated to domain0. In Xen 3.x the parameter
     7.1 --- a/extras/mini-os/include/hypervisor.h	Tue Aug 23 18:43:18 2005 -0800
     7.2 +++ b/extras/mini-os/include/hypervisor.h	Thu Aug 25 15:53:20 2005 -0700
     7.3 @@ -80,17 +80,43 @@ static __inline__ int HYPERVISOR_set_tra
     7.4  
     7.5  static __inline__ int HYPERVISOR_mmu_update(mmu_update_t *req, 
     7.6                                              int count, 
     7.7 -                                            int *success_count)
     7.8 +                                            int *success_count, 
     7.9 +                                            domid_t domid)
    7.10  {
    7.11      int ret;
    7.12 +    unsigned long ign1, ign2, ign3, ign4;
    7.13 +
    7.14      __asm__ __volatile__ (
    7.15          TRAP_INSTR
    7.16 -        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
    7.17 -        _a1 (req), _a2 (count), _a3 (success_count)  : "memory" );
    7.18 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    7.19 +        : "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
    7.20 +          "3" (success_count), "4" (domid)
    7.21 +        : "memory" );
    7.22  
    7.23      return ret;
    7.24  }
    7.25  
    7.26 +
    7.27 +static __inline__ int HYPERVISOR_mmuext_op(struct mmuext_op *op, 
    7.28 +                                           int count, 
    7.29 +                                           int *success_count, 
    7.30 +                                           domid_t domid)
    7.31 +{
    7.32 +    int ret;
    7.33 +    unsigned long ign1, ign2, ign3, ign4;
    7.34 +
    7.35 +    __asm__ __volatile__ (
    7.36 +        TRAP_INSTR
    7.37 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    7.38 +        : "0" (__HYPERVISOR_mmuext_op), "1" (op), "2" (count),
    7.39 +          "3" (success_count), "4" (domid)
    7.40 +        : "memory" );
    7.41 +
    7.42 +    return ret;
    7.43 +}
    7.44 +
    7.45 +
    7.46 +
    7.47  static __inline__ int HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
    7.48  {
    7.49      int ret;
     8.1 --- a/extras/mini-os/include/mm.h	Tue Aug 23 18:43:18 2005 -0800
     8.2 +++ b/extras/mini-os/include/mm.h	Thu Aug 25 15:53:20 2005 -0700
     8.3 @@ -43,13 +43,27 @@
     8.4  #define PADDR_MASK              ((1UL << PADDR_BITS)-1)
     8.5  #define VADDR_MASK              ((1UL << VADDR_BITS)-1)
     8.6  
     8.7 -#define pte_to_mfn(_pte) (((_pte) & (PADDR_MASK&PAGE_MASK)) >> PAGE_SHIFT)
     8.8 +#define pte_to_mfn(_pte) (((_pte) & (PADDR_MASK&PAGE_MASK)) >> L1_PAGETABLE_SHIFT)
     8.9 +
    8.10 +#endif
    8.11 +
    8.12 +
    8.13 +
    8.14 +#ifdef __i386__
    8.15 +
    8.16 +#define L1_PAGETABLE_SHIFT      12
    8.17 +#define L2_PAGETABLE_SHIFT      22
    8.18 +
    8.19 +#define L1_PAGETABLE_ENTRIES    1024
    8.20 +#define L2_PAGETABLE_ENTRIES    1024
    8.21 +#endif
    8.22  
    8.23  /* Given a virtual address, get an entry offset into a page table. */
    8.24  #define l1_table_offset(_a) \
    8.25    (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))
    8.26  #define l2_table_offset(_a) \
    8.27    (((_a) >> L2_PAGETABLE_SHIFT) & (L2_PAGETABLE_ENTRIES - 1))
    8.28 +#ifdef __x86_64__
    8.29  #define l3_table_offset(_a) \
    8.30    (((_a) >> L3_PAGETABLE_SHIFT) & (L3_PAGETABLE_ENTRIES - 1))
    8.31  #define l4_table_offset(_a) \
    8.32 @@ -67,13 +81,16 @@
    8.33  #define _PAGE_PSE      0x080UL
    8.34  #define _PAGE_GLOBAL   0x100UL
    8.35  
    8.36 -#define PAGE_SHIFT      12
    8.37 -#define PAGE_SIZE       (1UL << PAGE_SHIFT)
    8.38 +#define L1_PROT (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED)
    8.39 +#define L2_PROT (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_USER)
    8.40 +
    8.41 +#define PAGE_SIZE       (1UL << L1_PAGETABLE_SHIFT)
    8.42 +#define PAGE_SHIFT      L1_PAGETABLE_SHIFT
    8.43  #define PAGE_MASK       (~(PAGE_SIZE-1))
    8.44  
    8.45 -#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
    8.46 -#define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
    8.47 -#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
    8.48 +#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> L1_PAGETABLE_SHIFT)
    8.49 +#define PFN_DOWN(x)	((x) >> L1_PAGETABLE_SHIFT)
    8.50 +#define PFN_PHYS(x)	((x) << L1_PAGETABLE_SHIFT)
    8.51  
    8.52  /* to align the pointer to the (next) page boundary */
    8.53  #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
    8.54 @@ -83,14 +100,14 @@ extern unsigned long *phys_to_machine_ma
    8.55  #define mfn_to_pfn(_mfn) (machine_to_phys_mapping[(_mfn)])
    8.56  static __inline__ unsigned long phys_to_machine(unsigned long phys)
    8.57  {
    8.58 -    unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    8.59 -    machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
    8.60 +    unsigned long machine = pfn_to_mfn(phys >> L1_PAGETABLE_SHIFT);
    8.61 +    machine = (machine << L1_PAGETABLE_SHIFT) | (phys & ~PAGE_MASK);
    8.62      return machine;
    8.63  }
    8.64  static __inline__ unsigned long machine_to_phys(unsigned long machine)
    8.65  {
    8.66 -    unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
    8.67 -    phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
    8.68 +    unsigned long phys = mfn_to_pfn(machine >> L1_PAGETABLE_SHIFT);
    8.69 +    phys = (phys << L1_PAGETABLE_SHIFT) | (machine & ~PAGE_MASK);
    8.70      return phys;
    8.71  }
    8.72  
    8.73 @@ -105,7 +122,10 @@ static __inline__ unsigned long machine_
    8.74  #define __va to_virt
    8.75  #define __pa to_phys
    8.76  
    8.77 +#define virt_to_pfn(_virt)         (PFN_DOWN(to_phys(_virt)))
    8.78 +
    8.79  void init_mm(void);
    8.80  unsigned long alloc_pages(int order);
    8.81 +int is_mfn_mapped(unsigned long mfn);
    8.82  
    8.83  #endif /* _MM_H_ */
     9.1 --- a/extras/mini-os/include/time.h	Tue Aug 23 18:43:18 2005 -0800
     9.2 +++ b/extras/mini-os/include/time.h	Thu Aug 25 15:53:20 2005 -0700
     9.3 @@ -28,7 +28,7 @@
     9.4   * of real time into system time 
     9.5   */
     9.6  typedef s64 s_time_t;
     9.7 -#define NOW()                   ((s_time_t)get_s_time())
     9.8 +#define NOW()                   ((s_time_t)monotonic_clock())
     9.9  #define SECONDS(_s)             (((s_time_t)(_s))  * 1000000000UL )
    9.10  #define TENTHS(_ts)             (((s_time_t)(_ts)) * 100000000UL )
    9.11  #define HUNDREDTHS(_hs)         (((s_time_t)(_hs)) * 10000000UL )
    9.12 @@ -36,7 +36,8 @@ typedef s64 s_time_t;
    9.13  #define MICROSECS(_us)          (((s_time_t)(_us)) * 1000UL )
    9.14  #define Time_Max                ((s_time_t) 0x7fffffffffffffffLL)
    9.15  #define FOREVER                 Time_Max
    9.16 -
    9.17 +#define NSEC_TO_USEC(_nsec)     (_nsec / 1000UL)
    9.18 +#define NSEC_TO_SEC(_nsec)      (_nsec / 1000000000ULL)
    9.19  
    9.20  /* wall clock time  */
    9.21  typedef long time_t;
    9.22 @@ -46,6 +47,11 @@ struct timeval {
    9.23  	suseconds_t	tv_usec;	/* microseconds */
    9.24  };
    9.25  
    9.26 +struct timespec {
    9.27 +    time_t      ts_sec;
    9.28 +    long        ts_nsec;
    9.29 +};
    9.30 +
    9.31  
    9.32  /* prototypes */
    9.33  void     init_time(void);
    10.1 --- a/extras/mini-os/kernel.c	Tue Aug 23 18:43:18 2005 -0800
    10.2 +++ b/extras/mini-os/kernel.c	Thu Aug 25 15:53:20 2005 -0700
    10.3 @@ -132,22 +132,8 @@ void start_kernel(start_info_t *si)
    10.4      i = 0;
    10.5      for ( ; ; ) 
    10.6      {      
    10.7 -        if(i >= 1000)         
    10.8 -        {
    10.9 -            {
   10.10 -                unsigned long saved;
   10.11 -                __asm__ ("movl %%esp, %0"
   10.12 -                         :"=r"(saved)  /* y is output operand */
   10.13 -                            /* x is input operand */);
   10.14 -//                        :"a"); /* %eax is clobbered register */
   10.15 -                printk("ESP=0x%lx\n", saved);
   10.16 -            }
   10.17 -            
   10.18 -            printk("1000 bloks\n");
   10.19 -            i=0;            
   10.20 -        }
   10.21  //        HYPERVISOR_yield();
   10.22 -        block(1);
   10.23 +        block(100);
   10.24          i++;
   10.25      }
   10.26  }
    11.1 --- a/extras/mini-os/mm.c	Tue Aug 23 18:43:18 2005 -0800
    11.2 +++ b/extras/mini-os/mm.c	Thu Aug 25 15:53:20 2005 -0700
    11.3 @@ -5,9 +5,9 @@
    11.4   *
    11.5   *        File: mm.c
    11.6   *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
    11.7 - *     Changes: 
    11.8 + *     Changes: Grzegorz Milos
    11.9   *              
   11.10 - *        Date: Aug 2003
   11.11 + *        Date: Aug 2003, chages Aug 2005
   11.12   * 
   11.13   * Environment: Xen Minimal OS
   11.14   * Description: memory management related functions
   11.15 @@ -41,86 +41,18 @@
   11.16  #include <types.h>
   11.17  #include <lib.h>
   11.18  
   11.19 +
   11.20 +#ifdef MM_DEBUG
   11.21 +#define DEBUG(_f, _a...) \
   11.22 +    printk("MINI_OS(file=mm.c, line=%d) " _f "\n", __LINE__, ## _a)
   11.23 +#else
   11.24 +#define DEBUG(_f, _a...)    ((void)0)
   11.25 +#endif
   11.26 +
   11.27  unsigned long *phys_to_machine_mapping;
   11.28  extern char *stack;
   11.29  extern char _text, _etext, _edata, _end;
   11.30  
   11.31 -static void init_page_allocator(unsigned long min, unsigned long max);
   11.32 -
   11.33 -void init_mm(void)
   11.34 -{
   11.35 -
   11.36 -    unsigned long start_pfn, max_pfn, max_free_pfn;
   11.37 -
   11.38 -    unsigned long *pgd = (unsigned long *)start_info.pt_base;
   11.39 -
   11.40 -    printk("MM: Init\n");
   11.41 -
   11.42 -    printk("  _text:        %p\n", &_text);
   11.43 -    printk("  _etext:       %p\n", &_etext);
   11.44 -    printk("  _edata:       %p\n", &_edata);
   11.45 -    printk("  stack start:  %p\n", &stack);
   11.46 -    printk("  _end:         %p\n", &_end);
   11.47 -
   11.48 -    /* set up minimal memory infos */
   11.49 -    start_pfn = PFN_UP(to_phys(&_end));
   11.50 -    max_pfn = start_info.nr_pages;
   11.51 -
   11.52 -    printk("  start_pfn:    %lx\n", start_pfn);
   11.53 -    printk("  max_pfn:      %lx\n", max_pfn);
   11.54 -
   11.55 -    /*
   11.56 -     * we know where free tables start (start_pfn) and how many we 
   11.57 -     * have (max_pfn). 
   11.58 -     * 
   11.59 -     * Currently the hypervisor stores page tables it providesin the
   11.60 -     * high region of the this memory range.
   11.61 -     * 
   11.62 -     * next we work out how far down this goes (max_free_pfn)
   11.63 -     * 
   11.64 -     * XXX this assumes the hypervisor provided page tables to be in
   11.65 -     * the upper region of our initial memory. I don't know if this 
   11.66 -     * is always true.
   11.67 -     */
   11.68 -
   11.69 -    max_free_pfn = PFN_DOWN(to_phys(pgd));
   11.70 -#ifdef __i386__
   11.71 -    {
   11.72 -        unsigned long *pgd = (unsigned long *)start_info.pt_base;
   11.73 -        unsigned long  pte;
   11.74 -        int i;
   11.75 -        printk("  pgd(pa(pgd)): %lx(%lx)", (u_long)pgd, to_phys(pgd));
   11.76 -
   11.77 -        for ( i = 0; i < (HYPERVISOR_VIRT_START>>22); i++ )
   11.78 -        {
   11.79 -            unsigned long pgde = *pgd++;
   11.80 -            if ( !(pgde & 1) ) continue;
   11.81 -            pte = machine_to_phys(pgde & PAGE_MASK);
   11.82 -            printk("  PT(%x): %lx(%lx)", i, (u_long)to_virt(pte), pte);
   11.83 -            if (PFN_DOWN(pte) <= max_free_pfn) 
   11.84 -                max_free_pfn = PFN_DOWN(pte);
   11.85 -        }
   11.86 -    }
   11.87 -    max_free_pfn--;
   11.88 -    printk("  max_free_pfn: %lx\n", max_free_pfn);
   11.89 -
   11.90 -    /*
   11.91 -     * now we can initialise the page allocator
   11.92 -     */
   11.93 -    printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
   11.94 -           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
   11.95 -           (u_long)to_virt(PFN_PHYS(max_free_pfn)), PFN_PHYS(max_free_pfn));
   11.96 -    init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_free_pfn));   
   11.97 -#endif
   11.98 -
   11.99 -
  11.100 -    /* Now initialise the physical->machine mapping table. */
  11.101 -
  11.102 -
  11.103 -    printk("MM: done\n");
  11.104 -
  11.105 -    
  11.106 -}
  11.107  
  11.108  /*********************
  11.109   * ALLOCATION BITMAP
  11.110 @@ -214,6 +146,59 @@ static chunk_head_t  free_tail[FREELIST_
  11.111  #define round_pgdown(_p)  ((_p)&PAGE_MASK)
  11.112  #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
  11.113  
  11.114 +#ifdef MM_DEBUG
  11.115 +/*
  11.116 + * Prints allocation[0/1] for @nr_pages, starting at @start
  11.117 + * address (virtual).
  11.118 + */
  11.119 +static void print_allocation(void *start, int nr_pages)
  11.120 +{
  11.121 +    unsigned long pfn_start = virt_to_pfn(start);
  11.122 +    int count;
  11.123 +    for(count = 0; count < nr_pages; count++)
  11.124 +        if(allocated_in_map(pfn_start + count)) printk("1");
  11.125 +        else printk("0");
  11.126 +        
  11.127 +    printk("\n");        
  11.128 +}
  11.129 +
  11.130 +/*
  11.131 + * Prints chunks (making them with letters) for @nr_pages starting
  11.132 + * at @start (virtual).
  11.133 + */
  11.134 +static void print_chunks(void *start, int nr_pages)
  11.135 +{
  11.136 +    char chunks[1001], current='A';
  11.137 +    int order, count;
  11.138 +    chunk_head_t *head;
  11.139 +    unsigned long pfn_start = virt_to_pfn(start);
  11.140 +   
  11.141 +    memset(chunks, (int)'_', 1000);
  11.142 +    if(nr_pages > 1000) 
  11.143 +    {
  11.144 +        DEBUG("Can only pring 1000 pages. Increase buffer size.");
  11.145 +    }
  11.146 +    
  11.147 +    for(order=0; order < FREELIST_SIZE; order++)
  11.148 +    {
  11.149 +        head = free_head[order];
  11.150 +        while(!FREELIST_EMPTY(head))
  11.151 +        {
  11.152 +            for(count = 0; count < 1<< head->level; count++)
  11.153 +            {
  11.154 +                if(count + virt_to_pfn(head) - pfn_start < 1000)
  11.155 +                    chunks[count + virt_to_pfn(head) - pfn_start] = current;
  11.156 +            }
  11.157 +            head = head->next;
  11.158 +            current++;
  11.159 +        }
  11.160 +    }
  11.161 +    chunks[nr_pages] = '\0';
  11.162 +    printk("%s\n", chunks);
  11.163 +}
  11.164 +#endif
  11.165 +
  11.166 +
  11.167  
  11.168  /*
  11.169   * Initialise allocator, placing addresses [@min,@max] in free pool.
  11.170 @@ -328,3 +313,198 @@ unsigned long alloc_pages(int order)
  11.171      return 0;
  11.172  }
  11.173  
  11.174 +void free_pages(void *pointer, int order)
  11.175 +{
  11.176 +    chunk_head_t *freed_ch, *to_merge_ch;
  11.177 +    chunk_tail_t *freed_ct;
  11.178 +    unsigned long mask;
  11.179 +    
  11.180 +    /* First free the chunk */
  11.181 +    map_free(virt_to_pfn(pointer), 1 << order);
  11.182 +    
  11.183 +    /* Create free chunk */
  11.184 +    freed_ch = (chunk_head_t *)pointer;
  11.185 +    freed_ct = (chunk_tail_t *)((char *)pointer + (1<<(order + PAGE_SHIFT)))-1;
  11.186 +    
  11.187 +    /* Now, possibly we can conseal chunks together */
  11.188 +    while(order < FREELIST_SIZE)
  11.189 +    {
  11.190 +        mask = 1 << (order + PAGE_SHIFT);
  11.191 +        if((unsigned long)freed_ch & mask) 
  11.192 +        {
  11.193 +            to_merge_ch = (chunk_head_t *)((char *)freed_ch - mask);
  11.194 +            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
  11.195 +                    to_merge_ch->level != order)
  11.196 +                break;
  11.197 +            
  11.198 +            /* Merge with predecessor */
  11.199 +            freed_ch = to_merge_ch;   
  11.200 +        }
  11.201 +        else 
  11.202 +        {
  11.203 +            to_merge_ch = (chunk_head_t *)((char *)freed_ch + mask);
  11.204 +            if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
  11.205 +                    to_merge_ch->level != order)
  11.206 +                break;
  11.207 +            
  11.208 +            /* Merge with successor */
  11.209 +            freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask);
  11.210 +        }
  11.211 +        
  11.212 +        /* We are commited to merging, unlink the chunk */
  11.213 +        *(to_merge_ch->pprev) = to_merge_ch->next;
  11.214 +        to_merge_ch->next->pprev = to_merge_ch->pprev;
  11.215 +        
  11.216 +        order++;
  11.217 +    }
  11.218 +
  11.219 +    /* Link the new chunk */
  11.220 +    freed_ch->level = order;
  11.221 +    freed_ch->next  = free_head[order];
  11.222 +    freed_ch->pprev = &free_head[order];
  11.223 +    freed_ct->level = order;
  11.224 +    
  11.225 +    freed_ch->next->pprev = &freed_ch->next;
  11.226 +    free_head[order] = freed_ch;   
  11.227 +   
  11.228 +}
  11.229 +void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
  11.230 +{
  11.231 +    unsigned long pfn_to_map, pt_frame;
  11.232 +    unsigned long mach_ptd, max_mach_ptd;
  11.233 +    int count;
  11.234 +    unsigned long mach_pte, virt_pte;
  11.235 +    unsigned long *ptd = (unsigned long *)start_info.pt_base;
  11.236 +    mmu_update_t mmu_updates[L1_PAGETABLE_ENTRIES + 1];
  11.237 +    struct mmuext_op pin_request;
  11.238 +    
  11.239 +    /* Firstly work out what is the first pfn that is not yet in page tables
  11.240 +       NB. Assuming that builder fills whole pt_frames (which it does at the
  11.241 +       moment)
  11.242 +     */  
  11.243 +    pfn_to_map = (start_info.nr_pt_frames - 1) * L1_PAGETABLE_ENTRIES;
  11.244 +    DEBUG("start_pfn=%ld, first pfn_to_map %ld, max_pfn=%ld", 
  11.245 +            *start_pfn, pfn_to_map, *max_pfn);
  11.246 +
  11.247 +    /* Machine address of page table directory */
  11.248 +    mach_ptd = phys_to_machine(to_phys(start_info.pt_base));
  11.249 +    mach_ptd += sizeof(void *) * 
  11.250 +        l2_table_offset((unsigned long)to_virt(PFN_PHYS(pfn_to_map)));
  11.251 +  
  11.252 +    max_mach_ptd = sizeof(void *) * 
  11.253 +        l2_table_offset((unsigned long)to_virt(PFN_PHYS(*max_pfn)));
  11.254 +    
  11.255 +    /* Check that we are not trying to access Xen region */
  11.256 +    if(max_mach_ptd > sizeof(void *) * l2_table_offset(HYPERVISOR_VIRT_START))
  11.257 +    {
  11.258 +        printk("WARNING: mini-os will not use all the memory supplied\n");
  11.259 +        max_mach_ptd = sizeof(void *) * l2_table_offset(HYPERVISOR_VIRT_START);
  11.260 +        *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
  11.261 +    }
  11.262 +    max_mach_ptd += phys_to_machine(to_phys(start_info.pt_base));
  11.263 +    DEBUG("Max_mach_ptd 0x%lx", max_mach_ptd); 
  11.264 +   
  11.265 +    pt_frame = *start_pfn;
  11.266 +    /* Should not happen - no empty, mapped pages */
  11.267 +    if(pt_frame >= pfn_to_map)
  11.268 +    {
  11.269 +        printk("ERROR: Not even a single empty, mapped page\n");
  11.270 +        *(int*)0=0;
  11.271 +    }
  11.272 +    
  11.273 +    while(mach_ptd < max_mach_ptd)
  11.274 +    {
  11.275 +        /* Correct protection needs to be set for the new page table frame */
  11.276 +        virt_pte = (unsigned long)to_virt(PFN_PHYS(pt_frame));
  11.277 +        mach_pte = ptd[l2_table_offset(virt_pte)] & ~(PAGE_SIZE-1);
  11.278 +        mach_pte += sizeof(void *) * l1_table_offset(virt_pte);
  11.279 +        DEBUG("New page table page: pfn=0x%lx, mfn=0x%lx, virt_pte=0x%lx, "
  11.280 +                "mach_pte=0x%lx", pt_frame, pfn_to_mfn(pt_frame), 
  11.281 +                virt_pte, mach_pte);
  11.282 +        
  11.283 +        /* Update the entry */
  11.284 +        mmu_updates[0].ptr = mach_pte;
  11.285 +        mmu_updates[0].val = pfn_to_mfn(pt_frame) << PAGE_SHIFT | 
  11.286 +                                                    (L1_PROT & ~_PAGE_RW);
  11.287 +        if(HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF) < 0)
  11.288 +        {
  11.289 +            printk("PTE for new page table page could not be updated\n");
  11.290 +            *(int*)0=0;
  11.291 +        }
  11.292 +        
  11.293 +        /* Pin the page to provide correct protection */
  11.294 +        pin_request.cmd = MMUEXT_PIN_L1_TABLE;
  11.295 +        pin_request.mfn = pfn_to_mfn(pt_frame);
  11.296 +        if(HYPERVISOR_mmuext_op(&pin_request, 1, NULL, DOMID_SELF) < 0)
  11.297 +        {
  11.298 +            printk("ERROR: pinning failed\n");
  11.299 +            *(int*)0=0;
  11.300 +        }
  11.301 +        
  11.302 +        /* Now fill the new page table page with entries.
  11.303 +           Update the page directory as well. */
  11.304 +        count = 0;
  11.305 +        mmu_updates[count].ptr = mach_ptd;
  11.306 +        mmu_updates[count].val = pfn_to_mfn(pt_frame) << PAGE_SHIFT |
  11.307 +                                                         L2_PROT;
  11.308 +        count++;
  11.309 +        mach_ptd += sizeof(void *);
  11.310 +        mach_pte = phys_to_machine(PFN_PHYS(pt_frame++));
  11.311 +        
  11.312 +        for(;count <= L1_PAGETABLE_ENTRIES && pfn_to_map <= *max_pfn; count++)
  11.313 +        {
  11.314 +            mmu_updates[count].ptr = mach_pte;
  11.315 +            mmu_updates[count].val = 
  11.316 +                pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
  11.317 +            if(count == 1) DEBUG("mach_pte 0x%lx", mach_pte);
  11.318 +            mach_pte += sizeof(void *);
  11.319 +        }
  11.320 +        if(HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF) < 0) 
  11.321 +        {            
  11.322 +            printk("ERROR: mmu_update failed\n");
  11.323 +            *(int*)0=0;
  11.324 +        }
  11.325 +        (*start_pfn)++;
  11.326 +    }
  11.327 +
  11.328 +    *start_pfn = pt_frame;
  11.329 +}
  11.330 +
  11.331 +void init_mm(void)
  11.332 +{
  11.333 +
  11.334 +    unsigned long start_pfn, max_pfn;
  11.335 +
  11.336 +    printk("MM: Init\n");
  11.337 +
  11.338 +    printk("  _text:        %p\n", &_text);
  11.339 +    printk("  _etext:       %p\n", &_etext);
  11.340 +    printk("  _edata:       %p\n", &_edata);
  11.341 +    printk("  stack start:  %p\n", &stack);
  11.342 +    printk("  _end:         %p\n", &_end);
  11.343 +
  11.344 +    /* set up minimal memory infos */
  11.345 +    phys_to_machine_mapping = (unsigned long *)start_info.mfn_list;
  11.346 +   
  11.347 +    /* First page follows page table pages and 3 more pages (store page etc) */
  11.348 +    start_pfn = PFN_UP(__pa(start_info.pt_base)) + start_info.nr_pt_frames + 3;
  11.349 +    max_pfn = start_info.nr_pages;
  11.350 +
  11.351 +    printk("  start_pfn:    %lx\n", start_pfn);
  11.352 +    printk("  max_pfn:      %lx\n", max_pfn);
  11.353 +
  11.354 +
  11.355 +    build_pagetable(&start_pfn, &max_pfn);
  11.356 +    
  11.357 +#ifdef __i386__
  11.358 +    /*
  11.359 +     * now we can initialise the page allocator
  11.360 +     */
  11.361 +    printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
  11.362 +           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
  11.363 +           (u_long)to_virt(PFN_PHYS(max_pfn)), PFN_PHYS(max_pfn));
  11.364 +    init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn));   
  11.365 +#endif
  11.366 +
  11.367 +    printk("MM: done\n");
  11.368 +}
    12.1 --- a/extras/mini-os/time.c	Tue Aug 23 18:43:18 2005 -0800
    12.2 +++ b/extras/mini-os/time.c	Thu Aug 25 15:53:20 2005 -0700
    12.3 @@ -43,19 +43,20 @@
    12.4   * Time functions
    12.5   *************************************************************************/
    12.6  
    12.7 -/* Cached *multiplier* to convert TSC counts to microseconds.
    12.8 - * (see the equation below).
    12.9 - * Equal to 2^32 * (1 / (clocks per usec) ).
   12.10 - * Initialized in time_init.
   12.11 - */
   12.12 -static unsigned long fast_gettimeoffset_quotient;
   12.13 +/* These are peridically updated in shared_info, and then copied here. */
   12.14 +struct shadow_time_info {
   12.15 +	u64 tsc_timestamp;     /* TSC at last update of time vals.  */
   12.16 +	u64 system_timestamp;  /* Time, in nanosecs, since boot.    */
   12.17 +	u32 tsc_to_nsec_mul;
   12.18 +	u32 tsc_to_usec_mul;
   12.19 +	int tsc_shift;
   12.20 +	u32 version;
   12.21 +};
   12.22 +static struct timespec shadow_ts;
   12.23 +static u32 shadow_ts_version;
   12.24  
   12.25 +static struct shadow_time_info shadow;
   12.26  
   12.27 -/* These are peridically updated in shared_info, and then copied here. */
   12.28 -static u32 shadow_tsc_stamp;
   12.29 -static s64 shadow_system_time;
   12.30 -static u32 shadow_time_version;
   12.31 -static struct timeval shadow_tv;
   12.32  
   12.33  #ifndef rmb
   12.34  #define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
   12.35 @@ -63,116 +64,150 @@ static struct timeval shadow_tv;
   12.36  
   12.37  #define HANDLE_USEC_OVERFLOW(_tv)          \
   12.38      do {                                   \
   12.39 -        while ( (_tv).tv_usec >= 1000000 ) \
   12.40 +        while ( (_tv)->tv_usec >= 1000000 ) \
   12.41          {                                  \
   12.42 -            (_tv).tv_usec -= 1000000;      \
   12.43 -            (_tv).tv_sec++;                \
   12.44 +            (_tv)->tv_usec -= 1000000;      \
   12.45 +            (_tv)->tv_sec++;                \
   12.46          }                                  \
   12.47      } while ( 0 )
   12.48  
   12.49 -static void get_time_values_from_xen(void)
   12.50 +static inline int time_values_up_to_date(void)
   12.51  {
   12.52 -    do {
   12.53 -        shadow_time_version = HYPERVISOR_shared_info->time_version2;
   12.54 -        rmb();
   12.55 -        shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
   12.56 -        shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
   12.57 -        shadow_tsc_stamp    = (u32)HYPERVISOR_shared_info->tsc_timestamp;
   12.58 -        shadow_system_time  = HYPERVISOR_shared_info->system_time;
   12.59 -        rmb();
   12.60 -    }
   12.61 -    while ( shadow_time_version != HYPERVISOR_shared_info->time_version1 );
   12.62 +	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_time[0]; 
   12.63 +
   12.64 +	return (shadow.version == src->version);
   12.65  }
   12.66  
   12.67  
   12.68 -#define TIME_VALUES_UP_TO_DATE \
   12.69 -    (shadow_time_version == HYPERVISOR_shared_info->time_version2)
   12.70 -
   12.71 -static u32  get_time_delta_usecs(void)
   12.72 +/*
   12.73 + * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
   12.74 + * yielding a 64-bit result.
   12.75 + */
   12.76 +static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
   12.77  {
   12.78 -	register unsigned long eax, edx;
   12.79 -
   12.80 -	/* Read the Time Stamp Counter */
   12.81 -
   12.82 -	rdtsc(eax,edx);
   12.83 -
   12.84 -	/* .. relative to previous jiffy (32 bits is enough) */
   12.85 -	eax -= shadow_tsc_stamp;
   12.86 +	u64 product;
   12.87 +#ifdef __i386__
   12.88 +	u32 tmp1, tmp2;
   12.89 +#endif
   12.90  
   12.91 -	/*
   12.92 -	 * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient
   12.93 -	 *             = (tsc_low delta) * (usecs_per_clock)
   12.94 -	 *             = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy)
   12.95 -	 *
   12.96 -	 * Using a mull instead of a divl saves up to 31 clock cycles
   12.97 -	 * in the critical path.
   12.98 -	 */
   12.99 +	if ( shift < 0 )
  12.100 +		delta >>= -shift;
  12.101 +	else
  12.102 +		delta <<= shift;
  12.103  
  12.104 -	__asm__("mull %2"
  12.105 -		:"=a" (eax), "=d" (edx)
  12.106 -		:"rm" (fast_gettimeoffset_quotient),
  12.107 -		 "0" (eax));
  12.108 +#ifdef __i386__
  12.109 +	__asm__ (
  12.110 +		"mul  %5       ; "
  12.111 +		"mov  %4,%%eax ; "
  12.112 +		"mov  %%edx,%4 ; "
  12.113 +		"mul  %5       ; "
  12.114 +		"add  %4,%%eax ; "
  12.115 +		"xor  %5,%5    ; "
  12.116 +		"adc  %5,%%edx ; "
  12.117 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
  12.118 +		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
  12.119 +#else
  12.120 +	__asm__ (
  12.121 +		"mul %%rdx ; shrd $32,%%rdx,%%rax"
  12.122 +		: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
  12.123 +#endif
  12.124  
  12.125 -	/* our adjusted time offset in microseconds */
  12.126 -	return edx;
  12.127 +	return product;
  12.128  }
  12.129  
  12.130 -s64 get_s_time (void)
  12.131 -{
  12.132 -    u64 u_delta;
  12.133 -    s64 ret;
  12.134 -
  12.135 - again:
  12.136 -
  12.137 -    u_delta = get_time_delta_usecs();
  12.138 -    ret = shadow_system_time + (1000 * u_delta);
  12.139  
  12.140 -    if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
  12.141 -    {
  12.142 -        /*
  12.143 -         * We may have blocked for a long time, rendering our calculations
  12.144 -         * invalid (e.g. the time delta may have overflowed). Detect that
  12.145 -         * and recalculate with fresh values.
  12.146 -         */
  12.147 -        get_time_values_from_xen();
  12.148 -        goto again;
  12.149 -    }
  12.150 +static unsigned long get_nsec_offset(void)
  12.151 +{
  12.152 +	u64 now, delta;
  12.153 +	rdtscll(now);
  12.154 +	delta = now - shadow.tsc_timestamp;
  12.155 +	return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
  12.156 +}
  12.157  
  12.158 -    return ret;
  12.159 +
  12.160 +static void get_time_values_from_xen(void)
  12.161 +{
  12.162 +	struct vcpu_time_info    *src = &HYPERVISOR_shared_info->vcpu_time[0];
  12.163 +
  12.164 + 	do {
  12.165 +		shadow.version = src->version;
  12.166 +		rmb();
  12.167 +		shadow.tsc_timestamp     = src->tsc_timestamp;
  12.168 +		shadow.system_timestamp  = src->system_time;
  12.169 +		shadow.tsc_to_nsec_mul   = src->tsc_to_system_mul;
  12.170 +		shadow.tsc_shift         = src->tsc_shift;
  12.171 +		rmb();
  12.172 +	}
  12.173 +	while ((src->version & 1) | (shadow.version ^ src->version));
  12.174 +
  12.175 +	shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
  12.176  }
  12.177  
  12.178 +
  12.179 +
  12.180 +
  12.181 +/* monotonic_clock(): returns # of nanoseconds passed since time_init()
  12.182 + *		Note: This function is required to return accurate
  12.183 + *		time even in the absence of multiple timer ticks.
  12.184 + */
  12.185 +u64 monotonic_clock(void)
  12.186 +{
  12.187 +	u64 time;
  12.188 +	u32 local_time_version;
  12.189 +
  12.190 +	do {
  12.191 +		local_time_version = shadow.version;
  12.192 +		rmb();
  12.193 +		time = shadow.system_timestamp + get_nsec_offset();
  12.194 +        if (!time_values_up_to_date())
  12.195 +			get_time_values_from_xen();
  12.196 +		rmb();
  12.197 +	} while (local_time_version != shadow.version);
  12.198 +
  12.199 +	return time;
  12.200 +}
  12.201 +
  12.202 +static void update_wallclock(void)
  12.203 +{
  12.204 +	shared_info_t *s = HYPERVISOR_shared_info;
  12.205 +
  12.206 +	do {
  12.207 +		shadow_ts_version = s->wc_version;
  12.208 +		rmb();
  12.209 +		shadow_ts.ts_sec  = s->wc_sec;
  12.210 +		shadow_ts.ts_nsec = s->wc_nsec;
  12.211 +		rmb();
  12.212 +	}
  12.213 +	while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version));
  12.214 +}
  12.215 +
  12.216 +
  12.217  void gettimeofday(struct timeval *tv)
  12.218  {
  12.219 -    struct timeval _tv;
  12.220 +    u64 nsec = monotonic_clock();
  12.221 +    nsec += shadow_ts.ts_nsec;
  12.222 +    
  12.223 +    
  12.224 +    tv->tv_sec = shadow_ts.ts_sec;
  12.225 +    tv->tv_sec += NSEC_TO_SEC(nsec);
  12.226 +    tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
  12.227 +}
  12.228  
  12.229 -    do {
  12.230 -        get_time_values_from_xen();
  12.231 -        _tv.tv_usec = get_time_delta_usecs();
  12.232 -        _tv.tv_sec   = shadow_tv.tv_sec;
  12.233 -        _tv.tv_usec += shadow_tv.tv_usec;
  12.234 -    }
  12.235 -    while ( unlikely(!TIME_VALUES_UP_TO_DATE) );
  12.236 -
  12.237 -    HANDLE_USEC_OVERFLOW(_tv);
  12.238 -    *tv = _tv;
  12.239 -}
  12.240  
  12.241  static void print_current_time(void)
  12.242  {
  12.243 -    struct timeval tv;
  12.244 -
  12.245 -    get_time_values_from_xen();
  12.246 +    struct timeval tv;    
  12.247  
  12.248      gettimeofday(&tv);
  12.249      printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
  12.250  }
  12.251  
  12.252 +
  12.253  void block(u32 millisecs)
  12.254  {
  12.255      struct timeval tv;
  12.256      gettimeofday(&tv);
  12.257 -    //printk("tv.tv_sec=%ld, tv.tv_usec=%ld, shadow_system_time=%lld\n", tv.tv_sec, tv.tv_usec, shadow_system_time );
  12.258 -    HYPERVISOR_set_timer_op(get_s_time() + 1000000LL * (s64) millisecs);
  12.259 +    HYPERVISOR_set_timer_op(monotonic_clock() + 1000000LL * (s64) millisecs);
  12.260      HYPERVISOR_block();
  12.261  }
  12.262  
  12.263 @@ -185,7 +220,7 @@ static void timer_handler(int ev, struct
  12.264      static int i;
  12.265  
  12.266      get_time_values_from_xen();
  12.267 -
  12.268 +    update_wallclock();
  12.269      i++;
  12.270      if (i >= 1000) {
  12.271          print_current_time();
  12.272 @@ -197,24 +232,5 @@ static void timer_handler(int ev, struct
  12.273  
  12.274  void init_time(void)
  12.275  {
  12.276 -    u64         __cpu_khz;
  12.277 -    unsigned long cpu_khz;
  12.278 -
  12.279 -    __cpu_khz = HYPERVISOR_shared_info->cpu_freq;
  12.280 -
  12.281 -    cpu_khz = (u32) (__cpu_khz/1000);
  12.282 -
  12.283 -    printk("Xen reported: %lu.%03lu MHz processor.\n", 
  12.284 -           cpu_khz / 1000, cpu_khz % 1000);
  12.285 -	/* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz =
  12.286 -	   (2^32 * 1 / (clocks/us)) */
  12.287 -	{	
  12.288 -		unsigned long eax=0, edx=1000;
  12.289 -		__asm__("divl %2"
  12.290 -		    :"=a" (fast_gettimeoffset_quotient), "=d" (edx)
  12.291 -		    :"r" (cpu_khz),
  12.292 -		    "0" (eax), "1" (edx));
  12.293 -	}
  12.294 -
  12.295      bind_virq(VIRQ_TIMER, &timer_handler);
  12.296  }
    13.1 --- a/linux-2.4-xen-sparse/arch/xen/Makefile	Tue Aug 23 18:43:18 2005 -0800
    13.2 +++ b/linux-2.4-xen-sparse/arch/xen/Makefile	Thu Aug 25 15:53:20 2005 -0700
    13.3 @@ -61,7 +61,6 @@ SUBDIRS += arch/xen/drivers/console
    13.4  SUBDIRS += arch/xen/drivers/evtchn
    13.5  SUBDIRS += arch/xen/drivers/blkif
    13.6  SUBDIRS += arch/xen/drivers/netif
    13.7 -#SUBDIRS += arch/xen/drivers/usbif
    13.8  SUBDIRS += arch/xen/drivers/balloon
    13.9  ifdef CONFIG_XEN_PRIVILEGED_GUEST
   13.10  SUBDIRS += arch/xen/drivers/dom0 
   13.11 @@ -72,7 +71,6 @@ CORE_FILES += arch/xen/drivers/evtchn/dr
   13.12  CORE_FILES += arch/xen/drivers/console/drv.o
   13.13  DRIVERS += arch/xen/drivers/blkif/drv.o
   13.14  DRIVERS += arch/xen/drivers/netif/drv.o
   13.15 -DRIVERS += arch/xen/drivers/usbif/drv.o
   13.16  ifdef CONFIG_XEN_PRIVILEGED_GUEST
   13.17  CORE_FILES += arch/xen/drivers/dom0/drv.o
   13.18  endif
    14.1 --- a/linux-2.4-xen-sparse/arch/xen/config.in	Tue Aug 23 18:43:18 2005 -0800
    14.2 +++ b/linux-2.4-xen-sparse/arch/xen/config.in	Thu Aug 25 15:53:20 2005 -0700
    14.3 @@ -16,14 +16,10 @@ mainmenu_option next_comment
    14.4  comment 'Xen'
    14.5  bool 'Support for privileged operations (domain 0)' CONFIG_XEN_PRIVILEGED_GUEST
    14.6  bool 'Device-driver domain (physical device access)' CONFIG_XEN_PHYSDEV_ACCESS
    14.7 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
    14.8 -    bool 'USB-device backend driver' CONFIG_XEN_USB_BACKEND
    14.9 -fi
   14.10  bool 'Scrub memory before freeing it to Xen' CONFIG_XEN_SCRUB_PAGES
   14.11  bool 'Network-device frontend driver' CONFIG_XEN_NETDEV_FRONTEND
   14.12  bool 'Block-device frontend driver' CONFIG_XEN_BLKDEV_FRONTEND
   14.13  bool 'Block-device uses grant tables' CONFIG_XEN_BLKDEV_GRANT
   14.14 -bool 'USB-device frontend driver' CONFIG_XEN_USB_FRONTEND
   14.15  endmenu
   14.16  # The IBM S/390 patch needs this.
   14.17  define_bool CONFIG_NO_IDLE_HZ y
   14.18 @@ -267,7 +263,7 @@ fi
   14.19  
   14.20  source drivers/char/Config.in
   14.21  
   14.22 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   14.23 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   14.24     source drivers/media/Config.in
   14.25  fi
   14.26  
   14.27 @@ -302,14 +298,8 @@ if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" 
   14.28     endmenu
   14.29  fi
   14.30  
   14.31 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   14.32 -   if [ "$CONFIG_XEN_USB_FRONTEND" = "y" -o "$CONFIG_XEN_USB_BACKEND" = "y" ]; then
   14.33 -       define_bool CONFIG_USB y
   14.34 -   fi
   14.35 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   14.36     source drivers/usb/Config.in
   14.37 -fi
   14.38 -
   14.39 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   14.40     source net/bluetooth/Config.in
   14.41  fi
   14.42  
    15.1 --- a/linux-2.4-xen-sparse/mkbuildtree	Tue Aug 23 18:43:18 2005 -0800
    15.2 +++ b/linux-2.4-xen-sparse/mkbuildtree	Thu Aug 25 15:53:20 2005 -0700
    15.3 @@ -103,10 +103,9 @@ relative_lndir ${RS}
    15.4  rm -f mkbuildtree
    15.5  
    15.6  set ${RS}/../linux-2.6-xen-sparse
    15.7 -[ "$1" == "${RS}/../linux-2.6-xen-parse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6-xen-sparse"; exit 1; }
    15.8 +[ "$1" == "${RS}/../linux-2.6-xen-sparse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6-xen-sparse"; exit 1; }
    15.9  LINUX_26="$1"
   15.10  
   15.11 -
   15.12  # Create links to the shared definitions of the Xen interfaces.
   15.13  rm -rf ${AD}/include/asm-xen/xen-public
   15.14  mkdir  ${AD}/include/asm-xen/xen-public
    16.1 --- a/linux-2.6-xen-sparse/arch/xen/Kconfig	Tue Aug 23 18:43:18 2005 -0800
    16.2 +++ b/linux-2.6-xen-sparse/arch/xen/Kconfig	Thu Aug 25 15:53:20 2005 -0700
    16.3 @@ -61,15 +61,6 @@ config XEN_BLKDEV_TAP_BE
    16.4            with the blktap.  This option will be removed as the block drivers are
    16.5            modified to use grant tables.
    16.6  
    16.7 -config XEN_BLKDEV_GRANT
    16.8 -        bool "Grant table substrate for block drivers"
    16.9 -        depends on !XEN_BLKDEV_TAP_BE
   16.10 -        default y
   16.11 -        help
   16.12 -          This introduces the use of grant tables as a data exhange mechanism
   16.13 -          between the frontend and backend block drivers. This currently
   16.14 -          conflicts with the block tap.
   16.15 -
   16.16  config XEN_NETDEV_BACKEND
   16.17  	bool "Network-device backend driver"
   16.18  	depends on XEN_PHYSDEV_ACCESS
    17.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
    17.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
    17.3 @@ -1,7 +1,7 @@
    17.4  #
    17.5  # Automatically generated make config: don't edit
    17.6  # Linux kernel version: 2.6.12-xen0
    17.7 -# Mon Jul 25 09:48:34 2005
    17.8 +# Wed Aug  3 09:54:56 2005
    17.9  #
   17.10  CONFIG_XEN=y
   17.11  CONFIG_ARCH_XEN=y
   17.12 @@ -14,12 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
   17.13  CONFIG_XEN_PHYSDEV_ACCESS=y
   17.14  CONFIG_XEN_BLKDEV_BACKEND=y
   17.15  # CONFIG_XEN_BLKDEV_TAP_BE is not set
   17.16 -CONFIG_XEN_BLKDEV_GRANT=y
   17.17  CONFIG_XEN_NETDEV_BACKEND=y
   17.18  CONFIG_XEN_BLKDEV_FRONTEND=y
   17.19  CONFIG_XEN_NETDEV_FRONTEND=y
   17.20 -#CONFIG_XEN_NETDEV_GRANT_TX=y
   17.21 -#CONFIG_XEN_NETDEV_GRANT_RX=y
   17.22 +CONFIG_XEN_NETDEV_GRANT_TX=y
   17.23 +CONFIG_XEN_NETDEV_GRANT_RX=y
   17.24  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   17.25  # CONFIG_XEN_BLKDEV_TAP is not set
   17.26  # CONFIG_XEN_SHADOW_MODE is not set
   17.27 @@ -93,11 +92,11 @@ CONFIG_GENERIC_IOMAP=y
   17.28  # CONFIG_M586 is not set
   17.29  # CONFIG_M586TSC is not set
   17.30  # CONFIG_M586MMX is not set
   17.31 -# CONFIG_M686 is not set
   17.32 +CONFIG_M686=y
   17.33  # CONFIG_MPENTIUMII is not set
   17.34  # CONFIG_MPENTIUMIII is not set
   17.35  # CONFIG_MPENTIUMM is not set
   17.36 -CONFIG_MPENTIUM4=y
   17.37 +# CONFIG_MPENTIUM4 is not set
   17.38  # CONFIG_MK6 is not set
   17.39  # CONFIG_MK7 is not set
   17.40  # CONFIG_MK8 is not set
   17.41 @@ -112,15 +111,15 @@ CONFIG_MPENTIUM4=y
   17.42  # CONFIG_X86_GENERIC is not set
   17.43  CONFIG_X86_CMPXCHG=y
   17.44  CONFIG_X86_XADD=y
   17.45 -CONFIG_X86_L1_CACHE_SHIFT=7
   17.46 +CONFIG_X86_L1_CACHE_SHIFT=5
   17.47  CONFIG_RWSEM_XCHGADD_ALGORITHM=y
   17.48  CONFIG_GENERIC_CALIBRATE_DELAY=y
   17.49 +CONFIG_X86_PPRO_FENCE=y
   17.50  CONFIG_X86_WP_WORKS_OK=y
   17.51  CONFIG_X86_INVLPG=y
   17.52  CONFIG_X86_BSWAP=y
   17.53  CONFIG_X86_POPAD_OK=y
   17.54  CONFIG_X86_GOOD_APIC=y
   17.55 -CONFIG_X86_INTEL_USERCOPY=y
   17.56  CONFIG_X86_USE_PPRO_CHECKSUM=y
   17.57  # CONFIG_HPET_TIMER is not set
   17.58  # CONFIG_HPET_EMULATE_RTC is not set
   17.59 @@ -130,6 +129,7 @@ CONFIG_PREEMPT_BKL=y
   17.60  # CONFIG_X86_REBOOTFIXUPS is not set
   17.61  CONFIG_MICROCODE=y
   17.62  CONFIG_X86_CPUID=y
   17.63 +CONFIG_SWIOTLB=y
   17.64  
   17.65  #
   17.66  # Firmware Drivers
   17.67 @@ -540,7 +540,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
   17.68  # CONFIG_IP_NF_MATCH_STATE is not set
   17.69  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
   17.70  # CONFIG_IP_NF_MATCH_OWNER is not set
   17.71 -# CONFIG_IP_NF_MATCH_PHYSDEV is not set
   17.72 +CONFIG_IP_NF_MATCH_PHYSDEV=y
   17.73  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
   17.74  # CONFIG_IP_NF_MATCH_REALM is not set
   17.75  # CONFIG_IP_NF_MATCH_SCTP is not set
   17.76 @@ -688,7 +688,7 @@ CONFIG_E1000=y
   17.77  # CONFIG_HAMACHI is not set
   17.78  # CONFIG_YELLOWFIN is not set
   17.79  # CONFIG_R8169 is not set
   17.80 -# CONFIG_SK98LIN is not set
   17.81 +CONFIG_SK98LIN=y
   17.82  # CONFIG_VIA_VELOCITY is not set
   17.83  CONFIG_TIGON3=y
   17.84  # CONFIG_BNX2 is not set
    18.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
    18.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
    18.3 @@ -1,7 +1,7 @@
    18.4  #
    18.5  # Automatically generated make config: don't edit
    18.6 -# Linux kernel version: 2.6.12-xen0
    18.7 -# Wed Jun 29 10:01:20 2005
    18.8 +# Linux kernel version: 2.6.12.4-xen0
    18.9 +# Mon Aug 15 18:57:19 2005
   18.10  #
   18.11  CONFIG_XEN=y
   18.12  CONFIG_ARCH_XEN=y
   18.13 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
   18.14  CONFIG_XEN_PHYSDEV_ACCESS=y
   18.15  CONFIG_XEN_BLKDEV_BACKEND=y
   18.16  # CONFIG_XEN_BLKDEV_TAP_BE is not set
   18.17 -CONFIG_XEN_BLKDEV_GRANT=y
   18.18  CONFIG_XEN_NETDEV_BACKEND=y
   18.19  CONFIG_XEN_BLKDEV_FRONTEND=y
   18.20  CONFIG_XEN_NETDEV_FRONTEND=y
   18.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
   18.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
   18.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   18.24  # CONFIG_XEN_BLKDEV_TAP is not set
   18.25  # CONFIG_XEN_SHADOW_MODE is not set
   18.26 @@ -50,6 +51,7 @@ CONFIG_KOBJECT_UEVENT=y
   18.27  # CONFIG_IKCONFIG is not set
   18.28  # CONFIG_EMBEDDED is not set
   18.29  CONFIG_KALLSYMS=y
   18.30 +# CONFIG_KALLSYMS_ALL is not set
   18.31  # CONFIG_KALLSYMS_EXTRA_PASS is not set
   18.32  CONFIG_PRINTK=y
   18.33  CONFIG_BUG=y
   18.34 @@ -116,9 +118,11 @@ CONFIG_EARLY_PRINTK=y
   18.35  CONFIG_GENERIC_CPU=y
   18.36  CONFIG_X86_L1_CACHE_BYTES=128
   18.37  # CONFIG_X86_TSC is not set
   18.38 +CONFIG_X86_XEN_GENAPIC=y
   18.39  # CONFIG_X86_MSR is not set
   18.40  # CONFIG_GART_IOMMU is not set
   18.41  CONFIG_DUMMY_IOMMU=y
   18.42 +CONFIG_SWIOTLB=y
   18.43  # CONFIG_X86_MCE is not set
   18.44  
   18.45  #
   18.46 @@ -160,6 +164,7 @@ CONFIG_BINFMT_MISC=y
   18.47  CONFIG_STANDALONE=y
   18.48  # CONFIG_PREVENT_FIRMWARE_BUILD is not set
   18.49  # CONFIG_FW_LOADER is not set
   18.50 +# CONFIG_DEBUG_DRIVER is not set
   18.51  
   18.52  #
   18.53  # Memory Technology Devices (MTD)
   18.54 @@ -369,7 +374,23 @@ CONFIG_SCSI_QLA2XXX=y
   18.55  #
   18.56  # Multi-device support (RAID and LVM)
   18.57  #
   18.58 -# CONFIG_MD is not set
   18.59 +CONFIG_MD=y
   18.60 +CONFIG_BLK_DEV_MD=y
   18.61 +CONFIG_MD_LINEAR=y
   18.62 +CONFIG_MD_RAID0=y
   18.63 +CONFIG_MD_RAID1=y
   18.64 +# CONFIG_MD_RAID10 is not set
   18.65 +# CONFIG_MD_RAID5 is not set
   18.66 +# CONFIG_MD_RAID6 is not set
   18.67 +CONFIG_MD_MULTIPATH=y
   18.68 +# CONFIG_MD_FAULTY is not set
   18.69 +CONFIG_BLK_DEV_DM=y
   18.70 +CONFIG_DM_CRYPT=y
   18.71 +CONFIG_DM_SNAPSHOT=y
   18.72 +CONFIG_DM_MIRROR=y
   18.73 +# CONFIG_DM_ZERO is not set
   18.74 +CONFIG_DM_MULTIPATH=y
   18.75 +CONFIG_DM_MULTIPATH_EMC=y
   18.76  
   18.77  #
   18.78  # Fusion MPT device support
   18.79 @@ -458,7 +479,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
   18.80  # CONFIG_IP_NF_MATCH_STATE is not set
   18.81  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
   18.82  # CONFIG_IP_NF_MATCH_OWNER is not set
   18.83 -# CONFIG_IP_NF_MATCH_PHYSDEV is not set
   18.84 +CONFIG_IP_NF_MATCH_PHYSDEV=y
   18.85  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
   18.86  # CONFIG_IP_NF_MATCH_REALM is not set
   18.87  # CONFIG_IP_NF_MATCH_SCTP is not set
   18.88 @@ -589,7 +610,7 @@ CONFIG_E1000=y
   18.89  # CONFIG_HAMACHI is not set
   18.90  # CONFIG_YELLOWFIN is not set
   18.91  # CONFIG_R8169 is not set
   18.92 -# CONFIG_SK98LIN is not set
   18.93 +CONFIG_SK98LIN=y
   18.94  # CONFIG_VIA_VELOCITY is not set
   18.95  CONFIG_TIGON3=y
   18.96  # CONFIG_BNX2 is not set
   18.97 @@ -786,7 +807,107 @@ CONFIG_DUMMY_CONSOLE=y
   18.98  #
   18.99  CONFIG_USB_ARCH_HAS_HCD=y
  18.100  CONFIG_USB_ARCH_HAS_OHCI=y
  18.101 -# CONFIG_USB is not set
  18.102 +CONFIG_USB=y
  18.103 +# CONFIG_USB_DEBUG is not set
  18.104 +
  18.105 +#
  18.106 +# Miscellaneous USB options
  18.107 +#
  18.108 +# CONFIG_USB_DEVICEFS is not set
  18.109 +# CONFIG_USB_BANDWIDTH is not set
  18.110 +# CONFIG_USB_DYNAMIC_MINORS is not set
  18.111 +# CONFIG_USB_OTG is not set
  18.112 +
  18.113 +#
  18.114 +# USB Host Controller Drivers
  18.115 +#
  18.116 +# CONFIG_USB_EHCI_HCD is not set
  18.117 +CONFIG_USB_OHCI_HCD=y
  18.118 +# CONFIG_USB_OHCI_BIG_ENDIAN is not set
  18.119 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
  18.120 +CONFIG_USB_UHCI_HCD=y
  18.121 +# CONFIG_USB_SL811_HCD is not set
  18.122 +
  18.123 +#
  18.124 +# USB Device Class drivers
  18.125 +#
  18.126 +# CONFIG_USB_BLUETOOTH_TTY is not set
  18.127 +# CONFIG_USB_ACM is not set
  18.128 +# CONFIG_USB_PRINTER is not set
  18.129 +
  18.130 +#
  18.131 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
  18.132 +#
  18.133 +# CONFIG_USB_STORAGE is not set
  18.134 +
  18.135 +#
  18.136 +# USB Input Devices
  18.137 +#
  18.138 +CONFIG_USB_HID=y
  18.139 +CONFIG_USB_HIDINPUT=y
  18.140 +# CONFIG_HID_FF is not set
  18.141 +# CONFIG_USB_HIDDEV is not set
  18.142 +# CONFIG_USB_AIPTEK is not set
  18.143 +# CONFIG_USB_WACOM is not set
  18.144 +# CONFIG_USB_KBTAB is not set
  18.145 +# CONFIG_USB_POWERMATE is not set
  18.146 +# CONFIG_USB_MTOUCH is not set
  18.147 +# CONFIG_USB_EGALAX is not set
  18.148 +# CONFIG_USB_XPAD is not set
  18.149 +# CONFIG_USB_ATI_REMOTE is not set
  18.150 +
  18.151 +#
  18.152 +# USB Imaging devices
  18.153 +#
  18.154 +# CONFIG_USB_MDC800 is not set
  18.155 +# CONFIG_USB_MICROTEK is not set
  18.156 +
  18.157 +#
  18.158 +# USB Multimedia devices
  18.159 +#
  18.160 +# CONFIG_USB_DABUSB is not set
  18.161 +
  18.162 +#
  18.163 +# Video4Linux support is needed for USB Multimedia device support
  18.164 +#
  18.165 +
  18.166 +#
  18.167 +# USB Network Adapters
  18.168 +#
  18.169 +# CONFIG_USB_CATC is not set
  18.170 +# CONFIG_USB_KAWETH is not set
  18.171 +# CONFIG_USB_PEGASUS is not set
  18.172 +# CONFIG_USB_RTL8150 is not set
  18.173 +# CONFIG_USB_USBNET is not set
  18.174 +CONFIG_USB_MON=y
  18.175 +
  18.176 +#
  18.177 +# USB port drivers
  18.178 +#
  18.179 +
  18.180 +#
  18.181 +# USB Serial Converter support
  18.182 +#
  18.183 +# CONFIG_USB_SERIAL is not set
  18.184 +
  18.185 +#
  18.186 +# USB Miscellaneous drivers
  18.187 +#
  18.188 +# CONFIG_USB_EMI62 is not set
  18.189 +# CONFIG_USB_EMI26 is not set
  18.190 +# CONFIG_USB_AUERSWALD is not set
  18.191 +# CONFIG_USB_RIO500 is not set
  18.192 +# CONFIG_USB_LEGOTOWER is not set
  18.193 +# CONFIG_USB_LCD is not set
  18.194 +# CONFIG_USB_LED is not set
  18.195 +# CONFIG_USB_CYTHERM is not set
  18.196 +# CONFIG_USB_PHIDGETKIT is not set
  18.197 +# CONFIG_USB_PHIDGETSERVO is not set
  18.198 +# CONFIG_USB_IDMOUSE is not set
  18.199 +
  18.200 +#
  18.201 +# USB ATM/DSL drivers
  18.202 +#
  18.203  
  18.204  #
  18.205  # USB Gadget Support
  18.206 @@ -801,7 +922,12 @@ CONFIG_USB_ARCH_HAS_OHCI=y
  18.207  #
  18.208  # InfiniBand support
  18.209  #
  18.210 -# CONFIG_INFINIBAND is not set
  18.211 +CONFIG_INFINIBAND=y
  18.212 +CONFIG_INFINIBAND_MTHCA=y
  18.213 +CONFIG_INFINIBAND_MTHCA_DEBUG=y
  18.214 +CONFIG_INFINIBAND_IPOIB=y
  18.215 +CONFIG_INFINIBAND_IPOIB_DEBUG=y
  18.216 +CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
  18.217  
  18.218  #
  18.219  # Power management options
  18.220 @@ -1036,7 +1162,22 @@ CONFIG_ZLIB_INFLATE=y
  18.221  # Kernel hacking
  18.222  #
  18.223  # CONFIG_PRINTK_TIME is not set
  18.224 -# CONFIG_DEBUG_KERNEL is not set
  18.225 -CONFIG_LOG_BUF_SHIFT=14
  18.226 +CONFIG_DEBUG_KERNEL=y
  18.227 +CONFIG_MAGIC_SYSRQ=y
  18.228 +CONFIG_LOG_BUF_SHIFT=15
  18.229 +# CONFIG_SCHEDSTATS is not set
  18.230 +# CONFIG_DEBUG_SLAB is not set
  18.231 +# CONFIG_DEBUG_SPINLOCK is not set
  18.232 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
  18.233 +# CONFIG_DEBUG_KOBJECT is not set
  18.234 +# CONFIG_DEBUG_INFO is not set
  18.235 +# CONFIG_DEBUG_FS is not set
  18.236 +# CONFIG_DEBUG_STACKOVERFLOW is not set
  18.237 +# CONFIG_KPROBES is not set
  18.238 +# CONFIG_DEBUG_STACK_USAGE is not set
  18.239 +# CONFIG_DEBUG_PAGEALLOC is not set
  18.240 +# CONFIG_4KSTACKS is not set
  18.241  CONFIG_X86_FIND_SMP_CONFIG=y
  18.242  CONFIG_X86_MPPARSE=y
  18.243 +# CONFIG_CHECKING is not set
  18.244 +# CONFIG_INIT_DEBUG is not set
    19.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
    19.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
    19.3 @@ -1,7 +1,7 @@
    19.4  #
    19.5  # Automatically generated make config: don't edit
    19.6  # Linux kernel version: 2.6.12-xenU
    19.7 -# Mon Jul 25 10:06:06 2005
    19.8 +# Wed Aug  3 09:57:44 2005
    19.9  #
   19.10  CONFIG_XEN=y
   19.11  CONFIG_ARCH_XEN=y
   19.12 @@ -12,11 +12,10 @@ CONFIG_NO_IDLE_HZ=y
   19.13  #
   19.14  # CONFIG_XEN_PRIVILEGED_GUEST is not set
   19.15  # CONFIG_XEN_PHYSDEV_ACCESS is not set
   19.16 -CONFIG_XEN_BLKDEV_GRANT=y
   19.17  CONFIG_XEN_BLKDEV_FRONTEND=y
   19.18  CONFIG_XEN_NETDEV_FRONTEND=y
   19.19 -#CONFIG_XEN_NETDEV_GRANT_TX=y
   19.20 -#CONFIG_XEN_NETDEV_GRANT_RX=y
   19.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
   19.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
   19.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   19.24  # CONFIG_XEN_BLKDEV_TAP is not set
   19.25  # CONFIG_XEN_SHADOW_MODE is not set
   19.26 @@ -90,11 +89,11 @@ CONFIG_GENERIC_IOMAP=y
   19.27  # CONFIG_M586 is not set
   19.28  # CONFIG_M586TSC is not set
   19.29  # CONFIG_M586MMX is not set
   19.30 -# CONFIG_M686 is not set
   19.31 +CONFIG_M686=y
   19.32  # CONFIG_MPENTIUMII is not set
   19.33  # CONFIG_MPENTIUMIII is not set
   19.34  # CONFIG_MPENTIUMM is not set
   19.35 -CONFIG_MPENTIUM4=y
   19.36 +# CONFIG_MPENTIUM4 is not set
   19.37  # CONFIG_MK6 is not set
   19.38  # CONFIG_MK7 is not set
   19.39  # CONFIG_MK8 is not set
   19.40 @@ -109,15 +108,15 @@ CONFIG_MPENTIUM4=y
   19.41  # CONFIG_X86_GENERIC is not set
   19.42  CONFIG_X86_CMPXCHG=y
   19.43  CONFIG_X86_XADD=y
   19.44 -CONFIG_X86_L1_CACHE_SHIFT=7
   19.45 +CONFIG_X86_L1_CACHE_SHIFT=5
   19.46  CONFIG_RWSEM_XCHGADD_ALGORITHM=y
   19.47  CONFIG_GENERIC_CALIBRATE_DELAY=y
   19.48 +CONFIG_X86_PPRO_FENCE=y
   19.49  CONFIG_X86_WP_WORKS_OK=y
   19.50  CONFIG_X86_INVLPG=y
   19.51  CONFIG_X86_BSWAP=y
   19.52  CONFIG_X86_POPAD_OK=y
   19.53  CONFIG_X86_GOOD_APIC=y
   19.54 -CONFIG_X86_INTEL_USERCOPY=y
   19.55  CONFIG_X86_USE_PPRO_CHECKSUM=y
   19.56  # CONFIG_HPET_TIMER is not set
   19.57  # CONFIG_HPET_EMULATE_RTC is not set
   19.58 @@ -415,7 +414,7 @@ CONFIG_RAMFS=y
   19.59  # CONFIG_BEFS_FS is not set
   19.60  # CONFIG_BFS_FS is not set
   19.61  # CONFIG_EFS_FS is not set
   19.62 -# CONFIG_CRAMFS is not set
   19.63 +CONFIG_CRAMFS=y
   19.64  # CONFIG_VXFS_FS is not set
   19.65  # CONFIG_HPFS_FS is not set
   19.66  # CONFIG_QNX4FS_FS is not set
    20.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
    20.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
    20.3 @@ -1,7 +1,7 @@
    20.4  #
    20.5  # Automatically generated make config: don't edit
    20.6  # Linux kernel version: 2.6.12-xenU
    20.7 -# Thu Jul  7 11:43:14 2005
    20.8 +# Thu Aug 18 11:15:14 2005
    20.9  #
   20.10  CONFIG_XEN=y
   20.11  CONFIG_ARCH_XEN=y
   20.12 @@ -12,9 +12,10 @@ CONFIG_NO_IDLE_HZ=y
   20.13  #
   20.14  # CONFIG_XEN_PRIVILEGED_GUEST is not set
   20.15  # CONFIG_XEN_PHYSDEV_ACCESS is not set
   20.16 -CONFIG_XEN_BLKDEV_GRANT=y
   20.17  CONFIG_XEN_BLKDEV_FRONTEND=y
   20.18  CONFIG_XEN_NETDEV_FRONTEND=y
   20.19 +CONFIG_XEN_NETDEV_GRANT_TX=y
   20.20 +CONFIG_XEN_NETDEV_GRANT_RX=y
   20.21  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   20.22  # CONFIG_XEN_BLKDEV_TAP is not set
   20.23  # CONFIG_XEN_SHADOW_MODE is not set
   20.24 @@ -28,7 +29,7 @@ CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
   20.25  #
   20.26  CONFIG_EXPERIMENTAL=y
   20.27  CONFIG_CLEAN_COMPILE=y
   20.28 -CONFIG_BROKEN_ON_SMP=y
   20.29 +CONFIG_LOCK_KERNEL=y
   20.30  CONFIG_INIT_ENV_ARG_LIMIT=32
   20.31  
   20.32  #
   20.33 @@ -46,8 +47,10 @@ CONFIG_AUDITSYSCALL=y
   20.34  CONFIG_HOTPLUG=y
   20.35  CONFIG_KOBJECT_UEVENT=y
   20.36  # CONFIG_IKCONFIG is not set
   20.37 +# CONFIG_CPUSETS is not set
   20.38  # CONFIG_EMBEDDED is not set
   20.39  CONFIG_KALLSYMS=y
   20.40 +# CONFIG_KALLSYMS_ALL is not set
   20.41  CONFIG_KALLSYMS_EXTRA_PASS=y
   20.42  CONFIG_PRINTK=y
   20.43  CONFIG_BUG=y
   20.44 @@ -72,6 +75,7 @@ CONFIG_OBSOLETE_MODPARM=y
   20.45  CONFIG_MODVERSIONS=y
   20.46  # CONFIG_MODULE_SRCVERSION_ALL is not set
   20.47  CONFIG_KMOD=y
   20.48 +CONFIG_STOP_MACHINE=y
   20.49  CONFIG_XENARCH="x86_64"
   20.50  CONFIG_X86=y
   20.51  CONFIG_MMU=y
   20.52 @@ -84,12 +88,15 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
   20.53  CONFIG_GENERIC_CALIBRATE_DELAY=y
   20.54  CONFIG_X86_GOOD_APIC=y
   20.55  # CONFIG_HPET_TIMER is not set
   20.56 -# CONFIG_SMP is not set
   20.57 +CONFIG_SMP=y
   20.58 +CONFIG_NR_CPUS=8
   20.59 +# CONFIG_SCHED_SMT is not set
   20.60  # CONFIG_PREEMPT is not set
   20.61  # CONFIG_MICROCODE is not set
   20.62  CONFIG_X86_CPUID=y
   20.63  # CONFIG_NUMA is not set
   20.64  # CONFIG_MTRR is not set
   20.65 +CONFIG_HAVE_DEC_LOCK=y
   20.66  # CONFIG_X86_LOCAL_APIC is not set
   20.67  # CONFIG_X86_IO_APIC is not set
   20.68  # CONFIG_PCI is not set
   20.69 @@ -112,7 +119,11 @@ CONFIG_MPSC=y
   20.70  # CONFIG_GENERIC_CPU is not set
   20.71  CONFIG_X86_L1_CACHE_BYTES=128
   20.72  # CONFIG_X86_TSC is not set
   20.73 +CONFIG_X86_XEN_GENAPIC=y
   20.74  # CONFIG_X86_MSR is not set
   20.75 +CONFIG_X86_HT=y
   20.76 +# CONFIG_K8_NUMA is not set
   20.77 +# CONFIG_NUMA_EMU is not set
   20.78  CONFIG_DUMMY_IOMMU=y
   20.79  # CONFIG_X86_MCE is not set
   20.80  
   20.81 @@ -155,6 +166,7 @@ CONFIG_BINFMT_MISC=y
   20.82  CONFIG_STANDALONE=y
   20.83  CONFIG_PREVENT_FIRMWARE_BUILD=y
   20.84  CONFIG_FW_LOADER=y
   20.85 +# CONFIG_DEBUG_DRIVER is not set
   20.86  
   20.87  #
   20.88  # Block devices
   20.89 @@ -257,7 +269,10 @@ CONFIG_IP_ROUTE_FWMARK=y
   20.90  CONFIG_IP_ROUTE_MULTIPATH=y
   20.91  # CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
   20.92  CONFIG_IP_ROUTE_VERBOSE=y
   20.93 -# CONFIG_IP_PNP is not set
   20.94 +CONFIG_IP_PNP=y
   20.95 +CONFIG_IP_PNP_DHCP=y
   20.96 +CONFIG_IP_PNP_BOOTP=y
   20.97 +CONFIG_IP_PNP_RARP=y
   20.98  CONFIG_NET_IPIP=m
   20.99  CONFIG_NET_IPGRE=m
  20.100  CONFIG_NET_IPGRE_BROADCAST=y
  20.101 @@ -557,7 +572,6 @@ CONFIG_ACT200L_DONGLE=m
  20.102  #
  20.103  # Old SIR device drivers
  20.104  #
  20.105 -# CONFIG_IRPORT_SIR is not set
  20.106  
  20.107  #
  20.108  # Old Serial dongle support
  20.109 @@ -660,14 +674,14 @@ CONFIG_EXT2_FS=y
  20.110  CONFIG_EXT2_FS_XATTR=y
  20.111  CONFIG_EXT2_FS_POSIX_ACL=y
  20.112  CONFIG_EXT2_FS_SECURITY=y
  20.113 -CONFIG_EXT3_FS=m
  20.114 +CONFIG_EXT3_FS=y
  20.115  CONFIG_EXT3_FS_XATTR=y
  20.116 -CONFIG_EXT3_FS_POSIX_ACL=y
  20.117 -CONFIG_EXT3_FS_SECURITY=y
  20.118 +# CONFIG_EXT3_FS_POSIX_ACL is not set
  20.119 +# CONFIG_EXT3_FS_SECURITY is not set
  20.120  CONFIG_JBD=m
  20.121  # CONFIG_JBD_DEBUG is not set
  20.122  CONFIG_FS_MBCACHE=y
  20.123 -CONFIG_REISERFS_FS=m
  20.124 +CONFIG_REISERFS_FS=y
  20.125  # CONFIG_REISERFS_CHECK is not set
  20.126  CONFIG_REISERFS_PROC_INFO=y
  20.127  CONFIG_REISERFS_FS_XATTR=y
  20.128 @@ -746,7 +760,7 @@ CONFIG_BEFS_FS=m
  20.129  # CONFIG_BEFS_DEBUG is not set
  20.130  CONFIG_BFS_FS=m
  20.131  CONFIG_EFS_FS=m
  20.132 -CONFIG_CRAMFS=m
  20.133 +CONFIG_CRAMFS=y
  20.134  CONFIG_VXFS_FS=m
  20.135  # CONFIG_HPFS_FS is not set
  20.136  CONFIG_QNX4FS_FS=m
  20.137 @@ -859,17 +873,7 @@ CONFIG_NLS_UTF8=m
  20.138  # Security options
  20.139  #
  20.140  # CONFIG_KEYS is not set
  20.141 -CONFIG_SECURITY=y
  20.142 -CONFIG_SECURITY_NETWORK=y
  20.143 -CONFIG_SECURITY_CAPABILITIES=y
  20.144 -# CONFIG_SECURITY_SECLVL is not set
  20.145 -CONFIG_SECURITY_SELINUX=y
  20.146 -CONFIG_SECURITY_SELINUX_BOOTPARAM=y
  20.147 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
  20.148 -CONFIG_SECURITY_SELINUX_DISABLE=y
  20.149 -CONFIG_SECURITY_SELINUX_DEVELOP=y
  20.150 -CONFIG_SECURITY_SELINUX_AVC_STATS=y
  20.151 -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
  20.152 +# CONFIG_SECURITY is not set
  20.153  
  20.154  #
  20.155  # Cryptographic options
  20.156 @@ -917,5 +921,19 @@ CONFIG_ZLIB_DEFLATE=m
  20.157  # Kernel hacking
  20.158  #
  20.159  # CONFIG_PRINTK_TIME is not set
  20.160 -# CONFIG_DEBUG_KERNEL is not set
  20.161 -CONFIG_LOG_BUF_SHIFT=14
  20.162 +CONFIG_DEBUG_KERNEL=y
  20.163 +CONFIG_MAGIC_SYSRQ=y
  20.164 +CONFIG_LOG_BUF_SHIFT=15
  20.165 +# CONFIG_SCHEDSTATS is not set
  20.166 +# CONFIG_DEBUG_SLAB is not set
  20.167 +# CONFIG_DEBUG_SPINLOCK is not set
  20.168 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
  20.169 +# CONFIG_DEBUG_KOBJECT is not set
  20.170 +# CONFIG_DEBUG_INFO is not set
  20.171 +# CONFIG_DEBUG_FS is not set
  20.172 +# CONFIG_DEBUG_STACKOVERFLOW is not set
  20.173 +# CONFIG_KPROBES is not set
  20.174 +# CONFIG_DEBUG_STACK_USAGE is not set
  20.175 +# CONFIG_DEBUG_PAGEALLOC is not set
  20.176 +# CONFIG_4KSTACKS is not set
  20.177 +# CONFIG_INIT_DEBUG is not set
    21.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Tue Aug 23 18:43:18 2005 -0800
    21.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Thu Aug 25 15:53:20 2005 -0700
    21.3 @@ -1,7 +1,7 @@
    21.4  #
    21.5  # Automatically generated make config: don't edit
    21.6  # Linux kernel version: 2.6.12-xen
    21.7 -# Thu Jul 14 21:55:53 2005
    21.8 +# Wed Aug  3 10:04:25 2005
    21.9  #
   21.10  CONFIG_XEN=y
   21.11  CONFIG_ARCH_XEN=y
   21.12 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
   21.13  CONFIG_XEN_PHYSDEV_ACCESS=y
   21.14  CONFIG_XEN_BLKDEV_BACKEND=y
   21.15  # CONFIG_XEN_BLKDEV_TAP_BE is not set
   21.16 -CONFIG_XEN_BLKDEV_GRANT=y
   21.17  CONFIG_XEN_NETDEV_BACKEND=y
   21.18  CONFIG_XEN_BLKDEV_FRONTEND=y
   21.19  CONFIG_XEN_NETDEV_FRONTEND=y
   21.20 +CONFIG_XEN_NETDEV_GRANT_TX=y
   21.21 +CONFIG_XEN_NETDEV_GRANT_RX=y
   21.22  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   21.23  # CONFIG_XEN_BLKDEV_TAP is not set
   21.24  # CONFIG_XEN_SHADOW_MODE is not set
   21.25 @@ -135,6 +136,7 @@ CONFIG_PREEMPT_BKL=y
   21.26  # CONFIG_X86_REBOOTFIXUPS is not set
   21.27  CONFIG_MICROCODE=m
   21.28  CONFIG_X86_CPUID=m
   21.29 +CONFIG_SWIOTLB=y
   21.30  
   21.31  #
   21.32  # Firmware Drivers
    22.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Tue Aug 23 18:43:18 2005 -0800
    22.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Thu Aug 25 15:53:20 2005 -0700
    22.3 @@ -1,7 +1,7 @@
    22.4  #
    22.5  # Automatically generated make config: don't edit
    22.6 -# Linux kernel version: 2.6.12-xen
    22.7 -# Fri Jul 15 00:34:21 2005
    22.8 +# Linux kernel version: 2.6.12.4-xen
    22.9 +# Mon Aug 15 19:54:11 2005
   22.10  #
   22.11  CONFIG_XEN=y
   22.12  CONFIG_ARCH_XEN=y
   22.13 @@ -14,10 +14,11 @@ CONFIG_XEN_PRIVILEGED_GUEST=y
   22.14  CONFIG_XEN_PHYSDEV_ACCESS=y
   22.15  CONFIG_XEN_BLKDEV_BACKEND=y
   22.16  # CONFIG_XEN_BLKDEV_TAP_BE is not set
   22.17 -CONFIG_XEN_BLKDEV_GRANT=y
   22.18  CONFIG_XEN_NETDEV_BACKEND=y
   22.19  CONFIG_XEN_BLKDEV_FRONTEND=y
   22.20  CONFIG_XEN_NETDEV_FRONTEND=y
   22.21 +CONFIG_XEN_NETDEV_GRANT_TX=y
   22.22 +CONFIG_XEN_NETDEV_GRANT_RX=y
   22.23  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
   22.24  # CONFIG_XEN_BLKDEV_TAP is not set
   22.25  # CONFIG_XEN_SHADOW_MODE is not set
   22.26 @@ -33,6 +34,7 @@ CONFIG_EXPERIMENTAL=y
   22.27  # CONFIG_CLEAN_COMPILE is not set
   22.28  CONFIG_BROKEN=y
   22.29  CONFIG_BROKEN_ON_SMP=y
   22.30 +CONFIG_LOCK_KERNEL=y
   22.31  CONFIG_INIT_ENV_ARG_LIMIT=32
   22.32  
   22.33  #
   22.34 @@ -48,10 +50,11 @@ CONFIG_SYSCTL=y
   22.35  CONFIG_HOTPLUG=y
   22.36  CONFIG_KOBJECT_UEVENT=y
   22.37  # CONFIG_IKCONFIG is not set
   22.38 +# CONFIG_CPUSETS is not set
   22.39  # CONFIG_EMBEDDED is not set
   22.40  CONFIG_KALLSYMS=y
   22.41  # CONFIG_KALLSYMS_ALL is not set
   22.42 -# CONFIG_KALLSYMS_EXTRA_PASS is not set
   22.43 +CONFIG_KALLSYMS_EXTRA_PASS=y
   22.44  CONFIG_PRINTK=y
   22.45  CONFIG_BUG=y
   22.46  CONFIG_BASE_FULL=y
   22.47 @@ -73,8 +76,9 @@ CONFIG_MODULE_UNLOAD=y
   22.48  # CONFIG_MODULE_FORCE_UNLOAD is not set
   22.49  CONFIG_OBSOLETE_MODPARM=y
   22.50  # CONFIG_MODVERSIONS is not set
   22.51 -# CONFIG_MODULE_SRCVERSION_ALL is not set
   22.52 +CONFIG_MODULE_SRCVERSION_ALL=y
   22.53  CONFIG_KMOD=y
   22.54 +CONFIG_STOP_MACHINE=y
   22.55  CONFIG_XENARCH="x86_64"
   22.56  CONFIG_X86=y
   22.57  CONFIG_MMU=y
   22.58 @@ -87,12 +91,15 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
   22.59  CONFIG_GENERIC_CALIBRATE_DELAY=y
   22.60  CONFIG_X86_GOOD_APIC=y
   22.61  # CONFIG_HPET_TIMER is not set
   22.62 -# CONFIG_SMP is not set
   22.63 +CONFIG_SMP=y
   22.64 +CONFIG_NR_CPUS=8
   22.65 +# CONFIG_SCHED_SMT is not set
   22.66  # CONFIG_PREEMPT is not set
   22.67  CONFIG_MICROCODE=y
   22.68  # CONFIG_X86_CPUID is not set
   22.69  # CONFIG_NUMA is not set
   22.70  # CONFIG_MTRR is not set
   22.71 +CONFIG_HAVE_DEC_LOCK=y
   22.72  CONFIG_X86_LOCAL_APIC=y
   22.73  CONFIG_X86_IO_APIC=y
   22.74  CONFIG_PCI=y
   22.75 @@ -108,7 +115,7 @@ CONFIG_SECCOMP=y
   22.76  #
   22.77  CONFIG_X86_64=y
   22.78  CONFIG_64BIT=y
   22.79 -# CONFIG_EARLY_PRINTK is not set
   22.80 +CONFIG_EARLY_PRINTK=y
   22.81  
   22.82  #
   22.83  # Processor type and features
   22.84 @@ -117,9 +124,14 @@ CONFIG_64BIT=y
   22.85  CONFIG_GENERIC_CPU=y
   22.86  CONFIG_X86_L1_CACHE_BYTES=128
   22.87  # CONFIG_X86_TSC is not set
   22.88 +CONFIG_X86_XEN_GENAPIC=y
   22.89  # CONFIG_X86_MSR is not set
   22.90 +CONFIG_X86_HT=y
   22.91 +# CONFIG_K8_NUMA is not set
   22.92 +# CONFIG_NUMA_EMU is not set
   22.93  # CONFIG_GART_IOMMU is not set
   22.94  CONFIG_DUMMY_IOMMU=y
   22.95 +CONFIG_SWIOTLB=y
   22.96  # CONFIG_X86_MCE is not set
   22.97  
   22.98  #
   22.99 @@ -149,7 +161,7 @@ CONFIG_SYSVIPC_COMPAT=y
  22.100  # Executable file formats
  22.101  #
  22.102  CONFIG_BINFMT_ELF=y
  22.103 -CONFIG_BINFMT_MISC=m
  22.104 +CONFIG_BINFMT_MISC=y
  22.105  
  22.106  #
  22.107  # Device Drivers
  22.108 @@ -160,7 +172,7 @@ CONFIG_BINFMT_MISC=m
  22.109  #
  22.110  CONFIG_STANDALONE=y
  22.111  CONFIG_PREVENT_FIRMWARE_BUILD=y
  22.112 -CONFIG_FW_LOADER=m
  22.113 +CONFIG_FW_LOADER=y
  22.114  # CONFIG_DEBUG_DRIVER is not set
  22.115  
  22.116  #
  22.117 @@ -174,7 +186,7 @@ CONFIG_MTD_REDBOOT_PARTS=m
  22.118  CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
  22.119  # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
  22.120  # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
  22.121 -# CONFIG_MTD_CMDLINE_PARTS is not set
  22.122 +CONFIG_MTD_CMDLINE_PARTS=y
  22.123  
  22.124  #
  22.125  # User Modules And Translation Layers
  22.126 @@ -206,24 +218,20 @@ CONFIG_MTD_CFI_I2=y
  22.127  # CONFIG_MTD_CFI_I8 is not set
  22.128  CONFIG_MTD_CFI_INTELEXT=m
  22.129  CONFIG_MTD_CFI_AMDSTD=m
  22.130 -CONFIG_MTD_CFI_AMDSTD_RETRY=0
  22.131 +CONFIG_MTD_CFI_AMDSTD_RETRY=3
  22.132  CONFIG_MTD_CFI_STAA=m
  22.133  CONFIG_MTD_CFI_UTIL=m
  22.134  CONFIG_MTD_RAM=m
  22.135  CONFIG_MTD_ROM=m
  22.136  CONFIG_MTD_ABSENT=m
  22.137  # CONFIG_MTD_OBSOLETE_CHIPS is not set
  22.138 -# CONFIG_MTD_XIP is not set
  22.139  
  22.140  #
  22.141  # Mapping drivers for chip access
  22.142  #
  22.143  CONFIG_MTD_COMPLEX_MAPPINGS=y
  22.144 -CONFIG_MTD_PHYSMAP=m
  22.145 -CONFIG_MTD_PHYSMAP_START=0x8000000
  22.146 -CONFIG_MTD_PHYSMAP_LEN=0x4000000
  22.147 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2
  22.148 -CONFIG_MTD_PNC2000=m
  22.149 +# CONFIG_MTD_PHYSMAP is not set
  22.150 +# CONFIG_MTD_PNC2000 is not set
  22.151  CONFIG_MTD_SC520CDP=m
  22.152  CONFIG_MTD_NETSC520=m
  22.153  CONFIG_MTD_TS5500=m
  22.154 @@ -231,10 +239,9 @@ CONFIG_MTD_SBC_GXX=m
  22.155  CONFIG_MTD_ELAN_104NC=m
  22.156  # CONFIG_MTD_AMD76XROM is not set
  22.157  # CONFIG_MTD_ICHXROM is not set
  22.158 -# CONFIG_MTD_SCB2_FLASH is not set
  22.159 -CONFIG_MTD_NETtel=m
  22.160 -CONFIG_MTD_DILNETPC=m
  22.161 -CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000
  22.162 +CONFIG_MTD_SCB2_FLASH=m
  22.163 +# CONFIG_MTD_NETtel is not set
  22.164 +# CONFIG_MTD_DILNETPC is not set
  22.165  # CONFIG_MTD_L440GX is not set
  22.166  CONFIG_MTD_PCI=m
  22.167  
  22.168 @@ -244,19 +251,19 @@ CONFIG_MTD_PCI=m
  22.169  CONFIG_MTD_PMC551=m
  22.170  # CONFIG_MTD_PMC551_BUGFIX is not set
  22.171  # CONFIG_MTD_PMC551_DEBUG is not set
  22.172 -CONFIG_MTD_SLRAM=m
  22.173 -CONFIG_MTD_PHRAM=m
  22.174 +# CONFIG_MTD_SLRAM is not set
  22.175 +# CONFIG_MTD_PHRAM is not set
  22.176  CONFIG_MTD_MTDRAM=m
  22.177  CONFIG_MTDRAM_TOTAL_SIZE=4096
  22.178  CONFIG_MTDRAM_ERASE_SIZE=128
  22.179 -CONFIG_MTD_BLKMTD=m
  22.180 -# CONFIG_MTD_BLOCK2MTD is not set
  22.181 +# CONFIG_MTD_BLKMTD is not set
  22.182 +CONFIG_MTD_BLOCK2MTD=m
  22.183  
  22.184  #
  22.185  # Disk-On-Chip Device Drivers
  22.186  #
  22.187  CONFIG_MTD_DOC2000=m
  22.188 -CONFIG_MTD_DOC2001=m
  22.189 +# CONFIG_MTD_DOC2001 is not set
  22.190  CONFIG_MTD_DOC2001PLUS=m
  22.191  CONFIG_MTD_DOCPROBE=m
  22.192  CONFIG_MTD_DOCECC=m
  22.193 @@ -269,10 +276,7 @@ CONFIG_MTD_DOCPROBE_ADDRESS=0
  22.194  CONFIG_MTD_NAND=m
  22.195  # CONFIG_MTD_NAND_VERIFY_WRITE is not set
  22.196  CONFIG_MTD_NAND_IDS=m
  22.197 -CONFIG_MTD_NAND_DISKONCHIP=m
  22.198 -# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
  22.199 -CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
  22.200 -# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
  22.201 +# CONFIG_MTD_NAND_DISKONCHIP is not set
  22.202  # CONFIG_MTD_NAND_NANDSIM is not set
  22.203  
  22.204  #
  22.205 @@ -280,8 +284,7 @@ CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS
  22.206  #
  22.207  CONFIG_PARPORT=m
  22.208  CONFIG_PARPORT_PC=m
  22.209 -CONFIG_PARPORT_SERIAL=m
  22.210 -CONFIG_PARPORT_PC_FIFO=y
  22.211 +# CONFIG_PARPORT_PC_FIFO is not set
  22.212  # CONFIG_PARPORT_PC_SUPERIO is not set
  22.213  CONFIG_PARPORT_NOT_PC=y
  22.214  # CONFIG_PARPORT_GSC is not set
  22.215 @@ -290,13 +293,7 @@ CONFIG_PARPORT_1284=y
  22.216  #
  22.217  # Plug and Play support
  22.218  #
  22.219 -CONFIG_PNP=y
  22.220 -# CONFIG_PNP_DEBUG is not set
  22.221 -
  22.222 -#
  22.223 -# Protocols
  22.224 -#
  22.225 -CONFIG_PNPACPI=y
  22.226 +# CONFIG_PNP is not set
  22.227  
  22.228  #
  22.229  # Block devices
  22.230 @@ -324,7 +321,7 @@ CONFIG_PARIDE_DSTR=m
  22.231  CONFIG_PARIDE_FIT2=m
  22.232  CONFIG_PARIDE_FIT3=m
  22.233  CONFIG_PARIDE_EPAT=m
  22.234 -# CONFIG_PARIDE_EPATC8 is not set
  22.235 +CONFIG_PARIDE_EPATC8=y
  22.236  CONFIG_PARIDE_EPIA=m
  22.237  CONFIG_PARIDE_FRIQ=m
  22.238  CONFIG_PARIDE_FRPW=m
  22.239 @@ -345,7 +342,7 @@ CONFIG_BLK_DEV_SX8=m
  22.240  # CONFIG_BLK_DEV_UB is not set
  22.241  CONFIG_BLK_DEV_RAM=y
  22.242  CONFIG_BLK_DEV_RAM_COUNT=16
  22.243 -CONFIG_BLK_DEV_RAM_SIZE=8192
  22.244 +CONFIG_BLK_DEV_RAM_SIZE=16384
  22.245  CONFIG_BLK_DEV_INITRD=y
  22.246  CONFIG_INITRAMFS_SOURCE=""
  22.247  CONFIG_LBD=y
  22.248 @@ -360,70 +357,69 @@ CONFIG_IOSCHED_NOOP=y
  22.249  CONFIG_IOSCHED_AS=y
  22.250  CONFIG_IOSCHED_DEADLINE=y
  22.251  CONFIG_IOSCHED_CFQ=y
  22.252 -# CONFIG_ATA_OVER_ETH is not set
  22.253 +CONFIG_ATA_OVER_ETH=m
  22.254  
  22.255  #
  22.256  # ATA/ATAPI/MFM/RLL support
  22.257  #
  22.258 -CONFIG_IDE=m
  22.259 -CONFIG_BLK_DEV_IDE=m
  22.260 +CONFIG_IDE=y
  22.261 +CONFIG_BLK_DEV_IDE=y
  22.262  
  22.263  #
  22.264  # Please see Documentation/ide.txt for help/info on IDE drives
  22.265  #
  22.266  # CONFIG_BLK_DEV_IDE_SATA is not set
  22.267  # CONFIG_BLK_DEV_HD_IDE is not set
  22.268 -CONFIG_BLK_DEV_IDEDISK=m
  22.269 -# CONFIG_IDEDISK_MULTI_MODE is not set
  22.270 -CONFIG_BLK_DEV_IDECD=m
  22.271 -CONFIG_BLK_DEV_IDETAPE=m
  22.272 -CONFIG_BLK_DEV_IDEFLOPPY=m
  22.273 +CONFIG_BLK_DEV_IDEDISK=y
  22.274 +CONFIG_IDEDISK_MULTI_MODE=y
  22.275 +CONFIG_BLK_DEV_IDECD=y
  22.276 +# CONFIG_BLK_DEV_IDETAPE is not set
  22.277 +CONFIG_BLK_DEV_IDEFLOPPY=y
  22.278  CONFIG_BLK_DEV_IDESCSI=m
  22.279  # CONFIG_IDE_TASK_IOCTL is not set
  22.280  
  22.281  #
  22.282  # IDE chipset support/bugfixes
  22.283  #
  22.284 -CONFIG_IDE_GENERIC=m
  22.285 +CONFIG_IDE_GENERIC=y
  22.286  CONFIG_BLK_DEV_CMD640=y
  22.287 -# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  22.288 -# CONFIG_BLK_DEV_IDEPNP is not set
  22.289 +CONFIG_BLK_DEV_CMD640_ENHANCED=y
  22.290  CONFIG_BLK_DEV_IDEPCI=y
  22.291  CONFIG_IDEPCI_SHARE_IRQ=y
  22.292  # CONFIG_BLK_DEV_OFFBOARD is not set
  22.293 -CONFIG_BLK_DEV_GENERIC=m
  22.294 -CONFIG_BLK_DEV_OPTI621=m
  22.295 -CONFIG_BLK_DEV_RZ1000=m
  22.296 +CONFIG_BLK_DEV_GENERIC=y
  22.297 +# CONFIG_BLK_DEV_OPTI621 is not set
  22.298 +CONFIG_BLK_DEV_RZ1000=y
  22.299  CONFIG_BLK_DEV_IDEDMA_PCI=y
  22.300  # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
  22.301  CONFIG_IDEDMA_PCI_AUTO=y
  22.302  # CONFIG_IDEDMA_ONLYDISK is not set
  22.303 -CONFIG_BLK_DEV_AEC62XX=m
  22.304 -CONFIG_BLK_DEV_ALI15X3=m
  22.305 +CONFIG_BLK_DEV_AEC62XX=y
  22.306 +CONFIG_BLK_DEV_ALI15X3=y
  22.307  # CONFIG_WDC_ALI15X3 is not set
  22.308 -CONFIG_BLK_DEV_AMD74XX=m
  22.309 -CONFIG_BLK_DEV_ATIIXP=m
  22.310 -CONFIG_BLK_DEV_CMD64X=m
  22.311 -CONFIG_BLK_DEV_TRIFLEX=m
  22.312 -CONFIG_BLK_DEV_CY82C693=m
  22.313 -CONFIG_BLK_DEV_CS5520=m
  22.314 -CONFIG_BLK_DEV_CS5530=m
  22.315 -CONFIG_BLK_DEV_HPT34X=m
  22.316 +CONFIG_BLK_DEV_AMD74XX=y
  22.317 +CONFIG_BLK_DEV_ATIIXP=y
  22.318 +CONFIG_BLK_DEV_CMD64X=y
  22.319 +CONFIG_BLK_DEV_TRIFLEX=y
  22.320 +CONFIG_BLK_DEV_CY82C693=y
  22.321 +CONFIG_BLK_DEV_CS5520=y
  22.322 +CONFIG_BLK_DEV_CS5530=y
  22.323 +CONFIG_BLK_DEV_HPT34X=y
  22.324  # CONFIG_HPT34X_AUTODMA is not set
  22.325 -CONFIG_BLK_DEV_HPT366=m
  22.326 -CONFIG_BLK_DEV_SC1200=m
  22.327 -CONFIG_BLK_DEV_PIIX=m
  22.328 -CONFIG_BLK_DEV_NS87415=m
  22.329 -CONFIG_BLK_DEV_PDC202XX_OLD=m
  22.330 -CONFIG_PDC202XX_BURST=y
  22.331 -CONFIG_BLK_DEV_PDC202XX_NEW=m
  22.332 +CONFIG_BLK_DEV_HPT366=y
  22.333 +# CONFIG_BLK_DEV_SC1200 is not set
  22.334 +CONFIG_BLK_DEV_PIIX=y
  22.335 +# CONFIG_BLK_DEV_NS87415 is not set
  22.336 +CONFIG_BLK_DEV_PDC202XX_OLD=y
  22.337 +# CONFIG_PDC202XX_BURST is not set
  22.338 +CONFIG_BLK_DEV_PDC202XX_NEW=y
  22.339  CONFIG_PDC202XX_FORCE=y
  22.340 -CONFIG_BLK_DEV_SVWKS=m
  22.341 -CONFIG_BLK_DEV_SIIMAGE=m
  22.342 -CONFIG_BLK_DEV_SIS5513=m
  22.343 -CONFIG_BLK_DEV_SLC90E66=m
  22.344 -CONFIG_BLK_DEV_TRM290=m
  22.345 -CONFIG_BLK_DEV_VIA82CXXX=m
  22.346 +CONFIG_BLK_DEV_SVWKS=y
  22.347 +CONFIG_BLK_DEV_SIIMAGE=y
  22.348 +CONFIG_BLK_DEV_SIS5513=y
  22.349 +CONFIG_BLK_DEV_SLC90E66=y
  22.350 +# CONFIG_BLK_DEV_TRM290 is not set
  22.351 +CONFIG_BLK_DEV_VIA82CXXX=y
  22.352  # CONFIG_IDE_ARM is not set
  22.353  CONFIG_BLK_DEV_IDEDMA=y
  22.354  # CONFIG_IDEDMA_IVB is not set
  22.355 @@ -433,17 +429,17 @@ CONFIG_IDEDMA_AUTO=y
  22.356  #
  22.357  # SCSI device support
  22.358  #
  22.359 -CONFIG_SCSI=m
  22.360 +CONFIG_SCSI=y
  22.361  CONFIG_SCSI_PROC_FS=y
  22.362  
  22.363  #
  22.364  # SCSI support type (disk, tape, CD-ROM)
  22.365  #
  22.366 -CONFIG_BLK_DEV_SD=m
  22.367 +CONFIG_BLK_DEV_SD=y
  22.368  CONFIG_CHR_DEV_ST=m
  22.369  CONFIG_CHR_DEV_OSST=m
  22.370  CONFIG_BLK_DEV_SR=m
  22.371 -# CONFIG_BLK_DEV_SR_VENDOR is not set
  22.372 +CONFIG_BLK_DEV_SR_VENDOR=y
  22.373  CONFIG_CHR_DEV_SG=m
  22.374  
  22.375  #
  22.376 @@ -458,7 +454,7 @@ CONFIG_SCSI_LOGGING=y
  22.377  #
  22.378  CONFIG_SCSI_SPI_ATTRS=m
  22.379  CONFIG_SCSI_FC_ATTRS=m
  22.380 -# CONFIG_SCSI_ISCSI_ATTRS is not set
  22.381 +CONFIG_SCSI_ISCSI_ATTRS=m
  22.382  
  22.383  #
  22.384  # SCSI low-level drivers
  22.385 @@ -468,29 +464,30 @@ CONFIG_SCSI_3W_9XXX=m
  22.386  CONFIG_SCSI_ACARD=m
  22.387  CONFIG_SCSI_AACRAID=m
  22.388  CONFIG_SCSI_AIC7XXX=m
  22.389 -CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
  22.390 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
  22.391  CONFIG_AIC7XXX_RESET_DELAY_MS=15000
  22.392 -CONFIG_AIC7XXX_DEBUG_ENABLE=y
  22.393 +# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
  22.394  CONFIG_AIC7XXX_DEBUG_MASK=0
  22.395 -CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
  22.396 +# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
  22.397  CONFIG_SCSI_AIC7XXX_OLD=m
  22.398  CONFIG_SCSI_AIC79XX=m
  22.399 -CONFIG_AIC79XX_CMDS_PER_DEVICE=32
  22.400 +CONFIG_AIC79XX_CMDS_PER_DEVICE=4
  22.401  CONFIG_AIC79XX_RESET_DELAY_MS=15000
  22.402 -CONFIG_AIC79XX_ENABLE_RD_STRM=y
  22.403 -CONFIG_AIC79XX_DEBUG_ENABLE=y
  22.404 +# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
  22.405 +# CONFIG_AIC79XX_DEBUG_ENABLE is not set
  22.406  CONFIG_AIC79XX_DEBUG_MASK=0
  22.407 -CONFIG_AIC79XX_REG_PRETTY_PRINT=y
  22.408 -CONFIG_SCSI_ADVANSYS=m
  22.409 -# CONFIG_MEGARAID_NEWGEN is not set
  22.410 -CONFIG_MEGARAID_LEGACY=m
  22.411 +# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
  22.412 +# CONFIG_SCSI_ADVANSYS is not set
  22.413 +CONFIG_MEGARAID_NEWGEN=y
  22.414 +CONFIG_MEGARAID_MM=m
  22.415 +CONFIG_MEGARAID_MAILBOX=m
  22.416  CONFIG_SCSI_SATA=y
  22.417  CONFIG_SCSI_SATA_AHCI=m
  22.418  CONFIG_SCSI_SATA_SVW=m
  22.419 -CONFIG_SCSI_ATA_PIIX=m
  22.420 +CONFIG_SCSI_ATA_PIIX=y
  22.421  CONFIG_SCSI_SATA_NV=m
  22.422  CONFIG_SCSI_SATA_PROMISE=m
  22.423 -# CONFIG_SCSI_SATA_QSTOR is not set
  22.424 +CONFIG_SCSI_SATA_QSTOR=m
  22.425  CONFIG_SCSI_SATA_SX4=m
  22.426  CONFIG_SCSI_SATA_SIL=m
  22.427  CONFIG_SCSI_SATA_SIS=m
  22.428 @@ -500,17 +497,14 @@ CONFIG_SCSI_SATA_VITESSE=m
  22.429  CONFIG_SCSI_BUSLOGIC=m
  22.430  # CONFIG_SCSI_OMIT_FLASHPOINT is not set
  22.431  # CONFIG_SCSI_CPQFCTS is not set
  22.432 -CONFIG_SCSI_DMX3191D=m
  22.433 -CONFIG_SCSI_EATA=m
  22.434 -CONFIG_SCSI_EATA_TAGGED_QUEUE=y
  22.435 -CONFIG_SCSI_EATA_LINKED_COMMANDS=y
  22.436 -CONFIG_SCSI_EATA_MAX_TAGS=16
  22.437 -CONFIG_SCSI_EATA_PIO=m
  22.438 -CONFIG_SCSI_FUTURE_DOMAIN=m
  22.439 +# CONFIG_SCSI_DMX3191D is not set
  22.440 +# CONFIG_SCSI_EATA is not set
  22.441 +# CONFIG_SCSI_EATA_PIO is not set
  22.442 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  22.443  CONFIG_SCSI_GDTH=m
  22.444  CONFIG_SCSI_IPS=m
  22.445 -# CONFIG_SCSI_INITIO is not set
  22.446 -# CONFIG_SCSI_INIA100 is not set
  22.447 +CONFIG_SCSI_INITIO=m
  22.448 +CONFIG_SCSI_INIA100=m
  22.449  CONFIG_SCSI_PPA=m
  22.450  CONFIG_SCSI_IMM=m
  22.451  # CONFIG_SCSI_IZIP_EPP16 is not set
  22.452 @@ -520,32 +514,29 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MOD
  22.453  CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
  22.454  CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
  22.455  # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
  22.456 -CONFIG_SCSI_IPR=m
  22.457 -# CONFIG_SCSI_IPR_TRACE is not set
  22.458 -# CONFIG_SCSI_IPR_DUMP is not set
  22.459 +# CONFIG_SCSI_IPR is not set
  22.460  # CONFIG_SCSI_PCI2000 is not set
  22.461  # CONFIG_SCSI_PCI2220I is not set
  22.462 -CONFIG_SCSI_QLOGIC_ISP=m
  22.463 -CONFIG_SCSI_QLOGIC_FC=m
  22.464 -CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
  22.465 +# CONFIG_SCSI_QLOGIC_ISP is not set
  22.466 +# CONFIG_SCSI_QLOGIC_FC is not set
  22.467  CONFIG_SCSI_QLOGIC_1280=m
  22.468  CONFIG_SCSI_QLOGIC_1280_1040=y
  22.469 -CONFIG_SCSI_QLA2XXX=m
  22.470 -# CONFIG_SCSI_QLA21XX is not set
  22.471 -# CONFIG_SCSI_QLA22XX is not set
  22.472 -# CONFIG_SCSI_QLA2300 is not set
  22.473 -# CONFIG_SCSI_QLA2322 is not set
  22.474 -# CONFIG_SCSI_QLA6312 is not set
  22.475 +CONFIG_SCSI_QLA2XXX=y
  22.476 +CONFIG_SCSI_QLA21XX=m
  22.477 +CONFIG_SCSI_QLA22XX=m
  22.478 +CONFIG_SCSI_QLA2300=m
  22.479 +CONFIG_SCSI_QLA2322=m
  22.480 +CONFIG_SCSI_QLA6312=m
  22.481  CONFIG_SCSI_LPFC=m
  22.482  CONFIG_SCSI_DC395x=m
  22.483  CONFIG_SCSI_DC390T=m
  22.484 -CONFIG_SCSI_DEBUG=m
  22.485 +# CONFIG_SCSI_DEBUG is not set
  22.486  
  22.487  #
  22.488  # Multi-device support (RAID and LVM)
  22.489  #
  22.490  CONFIG_MD=y
  22.491 -CONFIG_BLK_DEV_MD=m
  22.492 +CONFIG_BLK_DEV_MD=y
  22.493  CONFIG_MD_LINEAR=m
  22.494  CONFIG_MD_RAID0=m
  22.495  CONFIG_MD_RAID1=m
  22.496 @@ -579,7 +570,7 @@ CONFIG_IEEE1394=m
  22.497  # Subsystem Options
  22.498  #
  22.499  # CONFIG_IEEE1394_VERBOSEDEBUG is not set
  22.500 -# CONFIG_IEEE1394_OUI_DB is not set
  22.501 +CONFIG_IEEE1394_OUI_DB=y
  22.502  CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
  22.503  CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
  22.504  
  22.505 @@ -618,9 +609,9 @@ CONFIG_NET=y
  22.506  #
  22.507  # Networking options
  22.508  #
  22.509 -CONFIG_PACKET=m
  22.510 +CONFIG_PACKET=y
  22.511  CONFIG_PACKET_MMAP=y
  22.512 -CONFIG_UNIX=m
  22.513 +CONFIG_UNIX=y
  22.514  CONFIG_NET_KEY=m
  22.515  CONFIG_INET=y
  22.516  CONFIG_IP_MULTICAST=y
  22.517 @@ -784,11 +775,6 @@ CONFIG_IP6_NF_TARGET_MARK=m
  22.518  CONFIG_IP6_NF_RAW=m
  22.519  
  22.520  #
  22.521 -# DECnet: Netfilter Configuration
  22.522 -#
  22.523 -CONFIG_DECNET_NF_GRABULATOR=m
  22.524 -
  22.525 -#
  22.526  # Bridge: Netfilter Configuration
  22.527  #
  22.528  CONFIG_BRIDGE_NF_EBTABLES=m
  22.529 @@ -810,9 +796,9 @@ CONFIG_BRIDGE_EBT_MARK_T=m
  22.530  CONFIG_BRIDGE_EBT_REDIRECT=m
  22.531  CONFIG_BRIDGE_EBT_SNAT=m
  22.532  CONFIG_BRIDGE_EBT_LOG=m
  22.533 -# CONFIG_BRIDGE_EBT_ULOG is not set
  22.534 +CONFIG_BRIDGE_EBT_ULOG=m
  22.535  CONFIG_XFRM=y
  22.536 -CONFIG_XFRM_USER=m
  22.537 +CONFIG_XFRM_USER=y
  22.538  
  22.539  #
  22.540  # SCTP Configuration (EXPERIMENTAL)
  22.541 @@ -823,19 +809,18 @@ CONFIG_IP_SCTP=m
  22.542  # CONFIG_SCTP_HMAC_NONE is not set
  22.543  # CONFIG_SCTP_HMAC_SHA1 is not set
  22.544  CONFIG_SCTP_HMAC_MD5=y
  22.545 -CONFIG_ATM=y
  22.546 -CONFIG_ATM_CLIP=y
  22.547 +CONFIG_ATM=m
  22.548 +CONFIG_ATM_CLIP=m
  22.549  # CONFIG_ATM_CLIP_NO_ICMP is not set
  22.550  CONFIG_ATM_LANE=m
  22.551 -CONFIG_ATM_MPOA=m
  22.552 +# CONFIG_ATM_MPOA is not set
  22.553  CONFIG_ATM_BR2684=m
  22.554  # CONFIG_ATM_BR2684_IPFILTER is not set
  22.555  CONFIG_BRIDGE=m
  22.556  CONFIG_VLAN_8021Q=m
  22.557 -CONFIG_DECNET=m
  22.558 -# CONFIG_DECNET_ROUTER is not set
  22.559 +# CONFIG_DECNET is not set
  22.560  CONFIG_LLC=y
  22.561 -CONFIG_LLC2=m
  22.562 +# CONFIG_LLC2 is not set
  22.563  CONFIG_IPX=m
  22.564  # CONFIG_IPX_INTERN is not set
  22.565  CONFIG_ATALK=m
  22.566 @@ -843,12 +828,10 @@ CONFIG_DEV_APPLETALK=y
  22.567  CONFIG_IPDDP=m
  22.568  CONFIG_IPDDP_ENCAP=y
  22.569  CONFIG_IPDDP_DECAP=y
  22.570 -CONFIG_X25=m
  22.571 -CONFIG_LAPB=m
  22.572 -# CONFIG_NET_DIVERT is not set
  22.573 -CONFIG_ECONET=m
  22.574 -CONFIG_ECONET_AUNUDP=y
  22.575 -CONFIG_ECONET_NATIVE=y
  22.576 +# CONFIG_X25 is not set
  22.577 +# CONFIG_LAPB is not set
  22.578 +CONFIG_NET_DIVERT=y
  22.579 +# CONFIG_ECONET is not set
  22.580  CONFIG_WAN_ROUTER=m
  22.581  
  22.582  #
  22.583 @@ -880,9 +863,9 @@ CONFIG_NET_CLS_ROUTE4=m
  22.584  CONFIG_NET_CLS_ROUTE=y
  22.585  CONFIG_NET_CLS_FW=m
  22.586  CONFIG_NET_CLS_U32=m
  22.587 -# CONFIG_CLS_U32_PERF is not set
  22.588 -# CONFIG_NET_CLS_IND is not set
  22.589 -# CONFIG_CLS_U32_MARK is not set
  22.590 +CONFIG_CLS_U32_PERF=y
  22.591 +CONFIG_NET_CLS_IND=y
  22.592 +CONFIG_CLS_U32_MARK=y
  22.593  CONFIG_NET_CLS_RSVP=m
  22.594  CONFIG_NET_CLS_RSVP6=m
  22.595  CONFIG_NET_EMATCH=y
  22.596 @@ -897,31 +880,12 @@ CONFIG_NET_CLS_POLICE=y
  22.597  #
  22.598  # Network testing
  22.599  #
  22.600 -CONFIG_NET_PKTGEN=m
  22.601 +# CONFIG_NET_PKTGEN is not set
  22.602  CONFIG_NETPOLL=y
  22.603  # CONFIG_NETPOLL_RX is not set
  22.604 -# CONFIG_NETPOLL_TRAP is not set
  22.605 +CONFIG_NETPOLL_TRAP=y
  22.606  CONFIG_NET_POLL_CONTROLLER=y
  22.607 -CONFIG_HAMRADIO=y
  22.608 -
  22.609 -#
  22.610 -# Packet Radio protocols
  22.611 -#
  22.612 -CONFIG_AX25=m
  22.613 -# CONFIG_AX25_DAMA_SLAVE is not set
  22.614 -CONFIG_NETROM=m
  22.615 -CONFIG_ROSE=m
  22.616 -
  22.617 -#
  22.618 -# AX.25 network device drivers
  22.619 -#
  22.620 -CONFIG_MKISS=m
  22.621 -CONFIG_6PACK=m
  22.622 -CONFIG_BPQETHER=m
  22.623 -CONFIG_BAYCOM_SER_FDX=m
  22.624 -CONFIG_BAYCOM_SER_HDX=m
  22.625 -CONFIG_BAYCOM_PAR=m
  22.626 -CONFIG_YAM=m
  22.627 +# CONFIG_HAMRADIO is not set
  22.628  CONFIG_IRDA=m
  22.629  
  22.630  #
  22.631 @@ -937,7 +901,7 @@ CONFIG_IRCOMM=m
  22.632  #
  22.633  CONFIG_IRDA_CACHE_LAST_LSAP=y
  22.634  CONFIG_IRDA_FAST_RR=y
  22.635 -CONFIG_IRDA_DEBUG=y
  22.636 +# CONFIG_IRDA_DEBUG is not set
  22.637  
  22.638  #
  22.639  # Infrared-port device drivers
  22.640 @@ -1002,9 +966,9 @@ CONFIG_BT_HCIUSB_SCO=y
  22.641  CONFIG_BT_HCIUART=m
  22.642  CONFIG_BT_HCIUART_H4=y
  22.643  CONFIG_BT_HCIUART_BCSP=y
  22.644 -# CONFIG_BT_HCIUART_BCSP_TXCRC is not set
  22.645 +CONFIG_BT_HCIUART_BCSP_TXCRC=y
  22.646  CONFIG_BT_HCIBCM203X=m
  22.647 -# CONFIG_BT_HCIBPA10X is not set
  22.648 +CONFIG_BT_HCIBPA10X=m
  22.649  CONFIG_BT_HCIBFUSB=m
  22.650  CONFIG_BT_HCIVHCI=m
  22.651  CONFIG_NETDEVICES=y
  22.652 @@ -1012,21 +976,11 @@ CONFIG_DUMMY=m
  22.653  CONFIG_BONDING=m
  22.654  CONFIG_EQUALIZER=m
  22.655  CONFIG_TUN=m
  22.656 -CONFIG_NET_SB1000=m
  22.657  
  22.658  #
  22.659  # ARCnet devices
  22.660  #
  22.661 -CONFIG_ARCNET=m
  22.662 -CONFIG_ARCNET_1201=m
  22.663 -CONFIG_ARCNET_1051=m
  22.664 -CONFIG_ARCNET_RAW=m
  22.665 -# CONFIG_ARCNET_CAP is not set
  22.666 -CONFIG_ARCNET_COM90xx=m
  22.667 -CONFIG_ARCNET_COM90xxIO=m
  22.668 -CONFIG_ARCNET_RIM_I=m
  22.669 -CONFIG_ARCNET_COM20020=m
  22.670 -CONFIG_ARCNET_COM20020_PCI=m
  22.671 +# CONFIG_ARCNET is not set
  22.672  
  22.673  #
  22.674  # Ethernet (10 or 100Mbit)
  22.675 @@ -1046,21 +1000,21 @@ CONFIG_NET_TULIP=y
  22.676  CONFIG_DE2104X=m
  22.677  CONFIG_TULIP=m
  22.678  # CONFIG_TULIP_MWI is not set
  22.679 -# CONFIG_TULIP_MMIO is not set
  22.680 +CONFIG_TULIP_MMIO=y
  22.681  # CONFIG_TULIP_NAPI is not set
  22.682  CONFIG_DE4X5=m
  22.683  CONFIG_WINBOND_840=m
  22.684  CONFIG_DM9102=m
  22.685 -CONFIG_HP100=m
  22.686 +# CONFIG_HP100 is not set
  22.687  CONFIG_NET_PCI=y
  22.688  CONFIG_PCNET32=m
  22.689  CONFIG_AMD8111_ETH=m
  22.690 -# CONFIG_AMD8111E_NAPI is not set
  22.691 +CONFIG_AMD8111E_NAPI=y
  22.692  CONFIG_ADAPTEC_STARFIRE=m
  22.693 -# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
  22.694 +CONFIG_ADAPTEC_STARFIRE_NAPI=y
  22.695  CONFIG_B44=m
  22.696  CONFIG_FORCEDETH=m
  22.697 -# CONFIG_DGRS is not set
  22.698 +CONFIG_DGRS=m
  22.699  CONFIG_EEPRO100=m
  22.700  CONFIG_E100=m
  22.701  CONFIG_FEALNX=m
  22.702 @@ -1069,7 +1023,7 @@ CONFIG_NE2K_PCI=m
  22.703  CONFIG_8139CP=m
  22.704  CONFIG_8139TOO=m
  22.705  CONFIG_8139TOO_PIO=y
  22.706 -CONFIG_8139TOO_TUNE_TWISTER=y
  22.707 +# CONFIG_8139TOO_TUNE_TWISTER is not set
  22.708  CONFIG_8139TOO_8129=y
  22.709  # CONFIG_8139_OLD_RX_RESET is not set
  22.710  CONFIG_SIS900=m
  22.711 @@ -1077,21 +1031,22 @@ CONFIG_EPIC100=m
  22.712  CONFIG_SUNDANCE=m
  22.713  # CONFIG_SUNDANCE_MMIO is not set
  22.714  CONFIG_VIA_RHINE=m
  22.715 -# CONFIG_VIA_RHINE_MMIO is not set
  22.716 +CONFIG_VIA_RHINE_MMIO=y
  22.717  
  22.718  #
  22.719  # Ethernet (1000 Mbit)
  22.720  #
  22.721 -# CONFIG_ACENIC is not set
  22.722 +CONFIG_ACENIC=m
  22.723 +# CONFIG_ACENIC_OMIT_TIGON_I is not set
  22.724  CONFIG_DL2K=m
  22.725  CONFIG_E1000=m
  22.726 -# CONFIG_E1000_NAPI is not set
  22.727 +CONFIG_E1000_NAPI=y
  22.728  CONFIG_NS83820=m
  22.729  CONFIG_HAMACHI=m
  22.730  CONFIG_YELLOWFIN=m
  22.731  CONFIG_R8169=m
  22.732 -# CONFIG_R8169_NAPI is not set
  22.733 -# CONFIG_R8169_VLAN is not set
  22.734 +CONFIG_R8169_NAPI=y
  22.735 +CONFIG_R8169_VLAN=y
  22.736  CONFIG_SK98LIN=m
  22.737  CONFIG_VIA_VELOCITY=m
  22.738  CONFIG_TIGON3=m
  22.739 @@ -1101,9 +1056,9 @@ CONFIG_BNX2=m
  22.740  # Ethernet (10000 Mbit)
  22.741  #
  22.742  CONFIG_IXGB=m
  22.743 -# CONFIG_IXGB_NAPI is not set
  22.744 +CONFIG_IXGB_NAPI=y
  22.745  CONFIG_S2IO=m
  22.746 -# CONFIG_S2IO_NAPI is not set
  22.747 +CONFIG_S2IO_NAPI=y
  22.748  # CONFIG_2BUFF_MODE is not set
  22.749  
  22.750  #
  22.751 @@ -1124,7 +1079,7 @@ CONFIG_NET_RADIO=y
  22.752  #
  22.753  # Obsolete Wireless cards support (pre-802.11)
  22.754  #
  22.755 -CONFIG_STRIP=m
  22.756 +# CONFIG_STRIP is not set
  22.757  
  22.758  #
  22.759  # Wireless 802.11b ISA/PCI cards support
  22.760 @@ -1145,35 +1100,7 @@ CONFIG_NET_WIRELESS=y
  22.761  #
  22.762  # Wan interfaces
  22.763  #
  22.764 -CONFIG_WAN=y
  22.765 -CONFIG_DSCC4=m
  22.766 -CONFIG_DSCC4_PCISYNC=y
  22.767 -CONFIG_DSCC4_PCI_RST=y
  22.768 -CONFIG_LANMEDIA=m
  22.769 -CONFIG_SYNCLINK_SYNCPPP=m
  22.770 -CONFIG_HDLC=m
  22.771 -CONFIG_HDLC_RAW=y
  22.772 -CONFIG_HDLC_RAW_ETH=y
  22.773 -CONFIG_HDLC_CISCO=y
  22.774 -CONFIG_HDLC_FR=y
  22.775 -CONFIG_HDLC_PPP=y
  22.776 -CONFIG_HDLC_X25=y
  22.777 -CONFIG_PCI200SYN=m
  22.778 -CONFIG_WANXL=m
  22.779 -CONFIG_PC300=m
  22.780 -CONFIG_PC300_MLPPP=y
  22.781 -CONFIG_FARSYNC=m
  22.782 -CONFIG_DLCI=m
  22.783 -CONFIG_DLCI_COUNT=24
  22.784 -CONFIG_DLCI_MAX=8
  22.785 -CONFIG_WAN_ROUTER_DRIVERS=y
  22.786 -# CONFIG_VENDOR_SANGOMA is not set
  22.787 -CONFIG_CYCLADES_SYNC=m
  22.788 -CONFIG_CYCLOMX_X25=y
  22.789 -CONFIG_LAPBETHER=m
  22.790 -CONFIG_X25_ASY=m
  22.791 -CONFIG_SBNI=m
  22.792 -# CONFIG_SBNI_MULTILINE is not set
  22.793 +# CONFIG_WAN is not set
  22.794  
  22.795  #
  22.796  # ATM drivers
  22.797 @@ -1184,8 +1111,7 @@ CONFIG_ATM_ENI=m
  22.798  # CONFIG_ATM_ENI_DEBUG is not set
  22.799  # CONFIG_ATM_ENI_TUNE_BURST is not set
  22.800  CONFIG_ATM_FIRESTREAM=m
  22.801 -CONFIG_ATM_ZATM=m
  22.802 -# CONFIG_ATM_ZATM_DEBUG is not set
  22.803 +# CONFIG_ATM_ZATM is not set
  22.804  CONFIG_ATM_IDT77252=m
  22.805  # CONFIG_ATM_IDT77252_DEBUG is not set
  22.806  # CONFIG_ATM_IDT77252_RCV_ALL is not set
  22.807 @@ -1195,20 +1121,13 @@ CONFIG_ATM_AMBASSADOR=m
  22.808  CONFIG_ATM_HORIZON=m
  22.809  # CONFIG_ATM_HORIZON_DEBUG is not set
  22.810  CONFIG_ATM_FORE200E_MAYBE=m
  22.811 -CONFIG_ATM_FORE200E_PCA=y
  22.812 -CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
  22.813 -# CONFIG_ATM_FORE200E_USE_TASKLET is not set
  22.814 -CONFIG_ATM_FORE200E_TX_RETRY=16
  22.815 -CONFIG_ATM_FORE200E_DEBUG=0
  22.816 -CONFIG_ATM_FORE200E=m
  22.817 +# CONFIG_ATM_FORE200E_PCA is not set
  22.818  CONFIG_ATM_HE=m
  22.819 -CONFIG_ATM_HE_USE_SUNI=y
  22.820 +# CONFIG_ATM_HE_USE_SUNI is not set
  22.821  CONFIG_FDDI=y
  22.822 -CONFIG_DEFXX=m
  22.823 +# CONFIG_DEFXX is not set
  22.824  CONFIG_SKFP=m
  22.825 -CONFIG_HIPPI=y
  22.826 -CONFIG_ROADRUNNER=m
  22.827 -# CONFIG_ROADRUNNER_LARGE_RINGS is not set
  22.828 +# CONFIG_HIPPI is not set
  22.829  CONFIG_PLIP=m
  22.830  CONFIG_PPP=m
  22.831  CONFIG_PPP_MULTILINK=y
  22.832 @@ -1216,15 +1135,15 @@ CONFIG_PPP_FILTER=y
  22.833  CONFIG_PPP_ASYNC=m
  22.834  CONFIG_PPP_SYNC_TTY=m
  22.835  CONFIG_PPP_DEFLATE=m
  22.836 -CONFIG_PPP_BSDCOMP=m
  22.837 +# CONFIG_PPP_BSDCOMP is not set
  22.838  CONFIG_PPPOE=m
  22.839  CONFIG_PPPOATM=m
  22.840  CONFIG_SLIP=m
  22.841  CONFIG_SLIP_COMPRESSED=y
  22.842  CONFIG_SLIP_SMART=y
  22.843 -CONFIG_SLIP_MODE_SLIP6=y
  22.844 +# CONFIG_SLIP_MODE_SLIP6 is not set
  22.845  CONFIG_NET_FC=y
  22.846 -CONFIG_SHAPER=m
  22.847 +# CONFIG_SHAPER is not set
  22.848  CONFIG_NETCONSOLE=m
  22.849  
  22.850  #
  22.851 @@ -1240,16 +1159,15 @@ CONFIG_ISDN_PPP=y
  22.852  CONFIG_ISDN_PPP_VJ=y
  22.853  CONFIG_ISDN_MPP=y
  22.854  CONFIG_IPPP_FILTER=y
  22.855 -CONFIG_ISDN_PPP_BSDCOMP=m
  22.856 +# CONFIG_ISDN_PPP_BSDCOMP is not set
  22.857  CONFIG_ISDN_AUDIO=y
  22.858  CONFIG_ISDN_TTY_FAX=y
  22.859 -CONFIG_ISDN_X25=y
  22.860  
  22.861  #
  22.862  # ISDN feature submodules
  22.863  #
  22.864  CONFIG_ISDN_DRV_LOOP=m
  22.865 -# CONFIG_ISDN_DIVERSION is not set
  22.866 +CONFIG_ISDN_DIVERSION=m
  22.867  
  22.868  #
  22.869  # ISDN4Linux hardware drivers
  22.870 @@ -1265,9 +1183,9 @@ CONFIG_ISDN_DRV_HISAX=m
  22.871  #
  22.872  CONFIG_HISAX_EURO=y
  22.873  CONFIG_DE_AOC=y
  22.874 -# CONFIG_HISAX_NO_SENDCOMPLETE is not set
  22.875 -# CONFIG_HISAX_NO_LLC is not set
  22.876 -# CONFIG_HISAX_NO_KEYPAD is not set
  22.877 +CONFIG_HISAX_NO_SENDCOMPLETE=y
  22.878 +CONFIG_HISAX_NO_LLC=y
  22.879 +CONFIG_HISAX_NO_KEYPAD=y
  22.880  CONFIG_HISAX_1TR6=y
  22.881  CONFIG_HISAX_NI1=y
  22.882  CONFIG_HISAX_MAX_CARDS=8
  22.883 @@ -1342,19 +1260,12 @@ CONFIG_ISDN_DRV_AVMB1_C4=m
  22.884  #
  22.885  # Active Eicon DIVA Server cards
  22.886  #
  22.887 -CONFIG_CAPI_EICON=y
  22.888 -CONFIG_ISDN_DIVAS=m
  22.889 -CONFIG_ISDN_DIVAS_BRIPCI=y
  22.890 -CONFIG_ISDN_DIVAS_PRIPCI=y
  22.891 -CONFIG_ISDN_DIVAS_DIVACAPI=m
  22.892 -CONFIG_ISDN_DIVAS_USERIDI=m
  22.893 -CONFIG_ISDN_DIVAS_MAINT=m
  22.894 +# CONFIG_CAPI_EICON is not set
  22.895  
  22.896  #
  22.897  # Telephony Support
  22.898  #
  22.899 -CONFIG_PHONE=m
  22.900 -CONFIG_PHONE_IXJ=m
  22.901 +# CONFIG_PHONE is not set
  22.902  
  22.903  #
  22.904  # Input device support
  22.905 @@ -1365,27 +1276,25 @@ CONFIG_INPUT=y
  22.906  # Userland interfaces
  22.907  #
  22.908  CONFIG_INPUT_MOUSEDEV=y
  22.909 -CONFIG_INPUT_MOUSEDEV_PSAUX=y
  22.910 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
  22.911  CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  22.912  CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  22.913  CONFIG_INPUT_JOYDEV=m
  22.914 -CONFIG_INPUT_TSDEV=m
  22.915 -CONFIG_INPUT_TSDEV_SCREEN_X=240
  22.916 -CONFIG_INPUT_TSDEV_SCREEN_Y=320
  22.917 -CONFIG_INPUT_EVDEV=m
  22.918 -CONFIG_INPUT_EVBUG=m
  22.919 +# CONFIG_INPUT_TSDEV is not set
  22.920 +CONFIG_INPUT_EVDEV=y
  22.921 +# CONFIG_INPUT_EVBUG is not set
  22.922  
  22.923  #
  22.924  # Input Device Drivers
  22.925  #
  22.926  CONFIG_INPUT_KEYBOARD=y
  22.927  CONFIG_KEYBOARD_ATKBD=y
  22.928 -CONFIG_KEYBOARD_SUNKBD=m
  22.929 -CONFIG_KEYBOARD_LKKBD=m
  22.930 -CONFIG_KEYBOARD_XTKBD=m
  22.931 -CONFIG_KEYBOARD_NEWTON=m
  22.932 +# CONFIG_KEYBOARD_SUNKBD is not set
  22.933 +# CONFIG_KEYBOARD_LKKBD is not set
  22.934 +# CONFIG_KEYBOARD_XTKBD is not set
  22.935 +# CONFIG_KEYBOARD_NEWTON is not set
  22.936  CONFIG_INPUT_MOUSE=y
  22.937 -CONFIG_MOUSE_PS2=m
  22.938 +CONFIG_MOUSE_PS2=y
  22.939  CONFIG_MOUSE_SERIAL=m
  22.940  CONFIG_MOUSE_VSXXXAA=m
  22.941  CONFIG_INPUT_JOYSTICK=y
  22.942 @@ -1427,19 +1336,19 @@ CONFIG_INPUT_UINPUT=m
  22.943  #
  22.944  CONFIG_SERIO=y
  22.945  CONFIG_SERIO_I8042=y
  22.946 -CONFIG_SERIO_SERPORT=m
  22.947 -CONFIG_SERIO_CT82C710=m
  22.948 -CONFIG_SERIO_PARKBD=m
  22.949 -CONFIG_SERIO_PCIPS2=m
  22.950 +CONFIG_SERIO_SERPORT=y
  22.951 +# CONFIG_SERIO_CT82C710 is not set
  22.952 +# CONFIG_SERIO_PARKBD is not set
  22.953 +# CONFIG_SERIO_PCIPS2 is not set
  22.954  CONFIG_SERIO_LIBPS2=y
  22.955 -CONFIG_SERIO_RAW=m
  22.956 +# CONFIG_SERIO_RAW is not set
  22.957  CONFIG_GAMEPORT=m
  22.958  CONFIG_GAMEPORT_NS558=m
  22.959  CONFIG_GAMEPORT_L4=m
  22.960  CONFIG_GAMEPORT_EMU10K1=m
  22.961  CONFIG_GAMEPORT_VORTEX=m
  22.962  CONFIG_GAMEPORT_FM801=m
  22.963 -# CONFIG_GAMEPORT_CS461X is not set
  22.964 +CONFIG_GAMEPORT_CS461X=m
  22.965  
  22.966  #
  22.967  # Character devices
  22.968 @@ -1452,21 +1361,16 @@ CONFIG_HW_CONSOLE=y
  22.969  #
  22.970  # Serial drivers
  22.971  #
  22.972 -CONFIG_SERIAL_8250=m
  22.973 -# CONFIG_SERIAL_8250_ACPI is not set
  22.974 -CONFIG_SERIAL_8250_NR_UARTS=4
  22.975 -# CONFIG_SERIAL_8250_EXTENDED is not set
  22.976 +# CONFIG_SERIAL_8250 is not set
  22.977  
  22.978  #
  22.979  # Non-8250 serial port support
  22.980  #
  22.981 -CONFIG_SERIAL_CORE=m
  22.982 -CONFIG_SERIAL_JSM=m
  22.983 +# CONFIG_SERIAL_JSM is not set
  22.984  CONFIG_UNIX98_PTYS=y
  22.985 -CONFIG_LEGACY_PTYS=y
  22.986 -CONFIG_LEGACY_PTY_COUNT=256
  22.987 +# CONFIG_LEGACY_PTYS is not set
  22.988  CONFIG_PRINTER=m
  22.989 -# CONFIG_LP_CONSOLE is not set
  22.990 +CONFIG_LP_CONSOLE=y
  22.991  CONFIG_PPDEV=m
  22.992  CONFIG_TIPAR=m
  22.993  
  22.994 @@ -1500,7 +1404,7 @@ CONFIG_IB700_WDT=m
  22.995  CONFIG_WAFER_WDT=m
  22.996  CONFIG_I8XX_TCO=m
  22.997  CONFIG_SC1200_WDT=m
  22.998 -CONFIG_60XX_WDT=m
  22.999 +# CONFIG_60XX_WDT is not set
 22.1000  CONFIG_CPU5_WDT=m
 22.1001  CONFIG_W83627HF_WDT=m
 22.1002  CONFIG_W83877F_WDT=m
 22.1003 @@ -1518,67 +1422,31 @@ CONFIG_WDT_501_PCI=y
 22.1004  #
 22.1005  CONFIG_USBPCWATCHDOG=m
 22.1006  CONFIG_HW_RANDOM=m
 22.1007 -CONFIG_NVRAM=m
 22.1008 -CONFIG_RTC=m
 22.1009 -CONFIG_GEN_RTC=m
 22.1010 -CONFIG_GEN_RTC_X=y
 22.1011 +# CONFIG_NVRAM is not set
 22.1012 +CONFIG_RTC=y
 22.1013  CONFIG_DTLK=m
 22.1014  CONFIG_R3964=m
 22.1015 -CONFIG_APPLICOM=m
 22.1016 +# CONFIG_APPLICOM is not set
 22.1017  
 22.1018  #
 22.1019  # Ftape, the floppy tape device driver
 22.1020  #
 22.1021 -CONFIG_FTAPE=m
 22.1022 -CONFIG_ZFTAPE=m
 22.1023 -CONFIG_ZFT_DFLT_BLK_SZ=10240
 22.1024 -
 22.1025 -#
 22.1026 -# The compressor will be built as a module only!
 22.1027 -#
 22.1028 -CONFIG_ZFT_COMPRESSOR=m
 22.1029 -CONFIG_FT_NR_BUFFERS=3
 22.1030 -CONFIG_FT_PROC_FS=y
 22.1031 -CONFIG_FT_NORMAL_DEBUG=y
 22.1032 -# CONFIG_FT_FULL_DEBUG is not set
 22.1033 -# CONFIG_FT_NO_TRACE is not set
 22.1034 -# CONFIG_FT_NO_TRACE_AT_ALL is not set
 22.1035 -
 22.1036 -#
 22.1037 -# Hardware configuration
 22.1038 -#
 22.1039 -CONFIG_FT_STD_FDC=y
 22.1040 -# CONFIG_FT_MACH2 is not set
 22.1041 -# CONFIG_FT_PROBE_FC10 is not set
 22.1042 -# CONFIG_FT_ALT_FDC is not set
 22.1043 -CONFIG_FT_FDC_THR=8
 22.1044 -CONFIG_FT_FDC_MAX_RATE=2000
 22.1045 -CONFIG_FT_ALPHA_CLOCK=0
 22.1046 -CONFIG_AGP=m
 22.1047 -CONFIG_AGP_AMD64=m
 22.1048 -CONFIG_AGP_INTEL=m
 22.1049 +# CONFIG_FTAPE is not set
 22.1050 +# CONFIG_AGP is not set
 22.1051  CONFIG_DRM=m
 22.1052  CONFIG_DRM_TDFX=m
 22.1053  # CONFIG_DRM_GAMMA is not set
 22.1054  CONFIG_DRM_R128=m
 22.1055  CONFIG_DRM_RADEON=m
 22.1056 -CONFIG_DRM_I810=m
 22.1057 -CONFIG_DRM_I830=m
 22.1058 -CONFIG_DRM_I915=m
 22.1059 -CONFIG_DRM_MGA=m
 22.1060 -CONFIG_DRM_SIS=m
 22.1061 -CONFIG_MWAVE=m
 22.1062 -CONFIG_RAW_DRIVER=m
 22.1063 +# CONFIG_MWAVE is not set
 22.1064 +# CONFIG_RAW_DRIVER is not set
 22.1065  # CONFIG_HPET is not set
 22.1066 -CONFIG_MAX_RAW_DEVS=256
 22.1067  CONFIG_HANGCHECK_TIMER=m
 22.1068  
 22.1069  #
 22.1070  # TPM devices
 22.1071  #
 22.1072 -CONFIG_TCG_TPM=m
 22.1073 -CONFIG_TCG_NSC=m
 22.1074 -CONFIG_TCG_ATMEL=m
 22.1075 +# CONFIG_TCG_TPM is not set
 22.1076  
 22.1077  #
 22.1078  # I2C support
 22.1079 @@ -1596,24 +1464,24 @@ CONFIG_I2C_ALGOPCA=m
 22.1080  #
 22.1081  # I2C Hardware Bus support
 22.1082  #
 22.1083 -CONFIG_I2C_ALI1535=m
 22.1084 -CONFIG_I2C_ALI1563=m
 22.1085 -CONFIG_I2C_ALI15X3=m
 22.1086 +# CONFIG_I2C_ALI1535 is not set
 22.1087 +# CONFIG_I2C_ALI1563 is not set
 22.1088 +# CONFIG_I2C_ALI15X3 is not set
 22.1089  CONFIG_I2C_AMD756=m
 22.1090  CONFIG_I2C_AMD756_S4882=m
 22.1091  CONFIG_I2C_AMD8111=m
 22.1092 -CONFIG_I2C_I801=m
 22.1093 -CONFIG_I2C_I810=m
 22.1094 -CONFIG_I2C_PIIX4=m
 22.1095 +# CONFIG_I2C_I801 is not set
 22.1096 +# CONFIG_I2C_I810 is not set
 22.1097 +# CONFIG_I2C_PIIX4 is not set
 22.1098  CONFIG_I2C_ISA=m
 22.1099  CONFIG_I2C_NFORCE2=m
 22.1100 -CONFIG_I2C_PARPORT=m
 22.1101 -CONFIG_I2C_PARPORT_LIGHT=m
 22.1102 +# CONFIG_I2C_PARPORT is not set
 22.1103 +# CONFIG_I2C_PARPORT_LIGHT is not set
 22.1104  CONFIG_I2C_PROSAVAGE=m
 22.1105  CONFIG_I2C_SAVAGE4=m
 22.1106 -CONFIG_SCx200_ACB=m
 22.1107 -CONFIG_I2C_SIS5595=m
 22.1108 -CONFIG_I2C_SIS630=m
 22.1109 +# CONFIG_SCx200_ACB is not set
 22.1110 +# CONFIG_I2C_SIS5595 is not set
 22.1111 +# CONFIG_I2C_SIS630 is not set
 22.1112  CONFIG_I2C_SIS96X=m
 22.1113  CONFIG_I2C_STUB=m
 22.1114  CONFIG_I2C_VIA=m
 22.1115 @@ -1648,7 +1516,7 @@ CONFIG_SENSORS_LM90=m
 22.1116  CONFIG_SENSORS_LM92=m
 22.1117  CONFIG_SENSORS_MAX1619=m
 22.1118  CONFIG_SENSORS_PC87360=m
 22.1119 -# CONFIG_SENSORS_SMSC47B397 is not set
 22.1120 +CONFIG_SENSORS_SMSC47B397=m
 22.1121  CONFIG_SENSORS_SIS5595=m
 22.1122  CONFIG_SENSORS_SMSC47M1=m
 22.1123  CONFIG_SENSORS_VIA686A=m
 22.1124 @@ -1682,7 +1550,7 @@ CONFIG_W1_SMEM=m
 22.1125  #
 22.1126  # Misc devices
 22.1127  #
 22.1128 -CONFIG_IBM_ASM=m
 22.1129 +# CONFIG_IBM_ASM is not set
 22.1130  
 22.1131  #
 22.1132  # Multimedia devices
 22.1133 @@ -1714,13 +1582,14 @@ CONFIG_VIDEO_ZORAN_DC30=m
 22.1134  CONFIG_VIDEO_ZORAN_LML33=m
 22.1135  CONFIG_VIDEO_ZORAN_LML33R10=m
 22.1136  # CONFIG_VIDEO_ZR36120 is not set
 22.1137 -# CONFIG_VIDEO_SAA7134 is not set
 22.1138 +CONFIG_VIDEO_SAA7134=m
 22.1139 +CONFIG_VIDEO_SAA7134_DVB=m
 22.1140  CONFIG_VIDEO_MXB=m
 22.1141  CONFIG_VIDEO_DPC=m
 22.1142  CONFIG_VIDEO_HEXIUM_ORION=m
 22.1143  CONFIG_VIDEO_HEXIUM_GEMINI=m
 22.1144  CONFIG_VIDEO_CX88=m
 22.1145 -# CONFIG_VIDEO_CX88_DVB is not set
 22.1146 +CONFIG_VIDEO_CX88_DVB=m
 22.1147  CONFIG_VIDEO_OVCAMCHIP=m
 22.1148  
 22.1149  #
 22.1150 @@ -1740,7 +1609,7 @@ CONFIG_DVB_CORE=m
 22.1151  # Supported SAA7146 based PCI Adapters
 22.1152  #
 22.1153  CONFIG_DVB_AV7110=m
 22.1154 -# CONFIG_DVB_AV7110_OSD is not set
 22.1155 +CONFIG_DVB_AV7110_OSD=y
 22.1156  CONFIG_DVB_BUDGET=m
 22.1157  CONFIG_DVB_BUDGET_CI=m
 22.1158  CONFIG_DVB_BUDGET_AV=m
 22.1159 @@ -1755,7 +1624,12 @@ CONFIG_DVB_DIBUSB=m
 22.1160  CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES=y
 22.1161  # CONFIG_DVB_DIBCOM_DEBUG is not set
 22.1162  CONFIG_DVB_CINERGYT2=m
 22.1163 -# CONFIG_DVB_CINERGYT2_TUNING is not set
 22.1164 +CONFIG_DVB_CINERGYT2_TUNING=y
 22.1165 +CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32
 22.1166 +CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512
 22.1167 +CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250
 22.1168 +CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y
 22.1169 +CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100
 22.1170  
 22.1171  #
 22.1172  # Supported FlexCopII (B2C2) Adapters
 22.1173 @@ -1822,6 +1696,7 @@ CONFIG_VIDEO_SAA7146_VV=m
 22.1174  CONFIG_VIDEO_VIDEOBUF=m
 22.1175  CONFIG_VIDEO_TUNER=m
 22.1176  CONFIG_VIDEO_BUF=m
 22.1177 +CONFIG_VIDEO_BUF_DVB=m
 22.1178  CONFIG_VIDEO_BTCX=m
 22.1179  CONFIG_VIDEO_IR=m
 22.1180  CONFIG_VIDEO_TVEEPROM=m
 22.1181 @@ -1830,36 +1705,34 @@ CONFIG_VIDEO_TVEEPROM=m
 22.1182  # Graphics support
 22.1183  #
 22.1184  CONFIG_FB=y
 22.1185 -CONFIG_FB_CFB_FILLRECT=m
 22.1186 -CONFIG_FB_CFB_COPYAREA=m
 22.1187 -CONFIG_FB_CFB_IMAGEBLIT=m
 22.1188 -CONFIG_FB_SOFT_CURSOR=m
 22.1189 +CONFIG_FB_CFB_FILLRECT=y
 22.1190 +CONFIG_FB_CFB_COPYAREA=y
 22.1191 +CONFIG_FB_CFB_IMAGEBLIT=y
 22.1192 +CONFIG_FB_SOFT_CURSOR=y
 22.1193  # CONFIG_FB_MACMODES is not set
 22.1194  CONFIG_FB_MODE_HELPERS=y
 22.1195  CONFIG_FB_TILEBLITTING=y
 22.1196  CONFIG_FB_CIRRUS=m
 22.1197 -CONFIG_FB_PM2=m
 22.1198 -CONFIG_FB_PM2_FIFO_DISCONNECT=y
 22.1199 -CONFIG_FB_CYBER2000=m
 22.1200 +# CONFIG_FB_PM2 is not set
 22.1201 +# CONFIG_FB_CYBER2000 is not set
 22.1202  # CONFIG_FB_ASILIANT is not set
 22.1203  # CONFIG_FB_IMSTT is not set
 22.1204  CONFIG_FB_VGA16=m
 22.1205 -# CONFIG_FB_VESA is not set
 22.1206 +CONFIG_FB_VESA=y
 22.1207  CONFIG_VIDEO_SELECT=y
 22.1208 -CONFIG_FB_HGA=m
 22.1209 -# CONFIG_FB_HGA_ACCEL is not set
 22.1210 -CONFIG_FB_NVIDIA=m
 22.1211 -CONFIG_FB_NVIDIA_I2C=y
 22.1212 +# CONFIG_FB_HGA is not set
 22.1213 +# CONFIG_FB_NVIDIA is not set
 22.1214  CONFIG_FB_RIVA=m
 22.1215 -CONFIG_FB_RIVA_I2C=y
 22.1216 -CONFIG_FB_RIVA_DEBUG=y
 22.1217 +# CONFIG_FB_RIVA_I2C is not set
 22.1218 +# CONFIG_FB_RIVA_DEBUG is not set
 22.1219  CONFIG_FB_MATROX=m
 22.1220  CONFIG_FB_MATROX_MILLENIUM=y
 22.1221  CONFIG_FB_MATROX_MYSTIQUE=y
 22.1222 -# CONFIG_FB_MATROX_G is not set
 22.1223 +CONFIG_FB_MATROX_G=y
 22.1224  CONFIG_FB_MATROX_I2C=m
 22.1225 +CONFIG_FB_MATROX_MAVEN=m
 22.1226  CONFIG_FB_MATROX_MULTIHEAD=y
 22.1227 -CONFIG_FB_RADEON_OLD=m
 22.1228 +# CONFIG_FB_RADEON_OLD is not set
 22.1229  CONFIG_FB_RADEON=m
 22.1230  CONFIG_FB_RADEON_I2C=y
 22.1231  # CONFIG_FB_RADEON_DEBUG is not set
 22.1232 @@ -1867,33 +1740,30 @@ CONFIG_FB_ATY128=m
 22.1233  CONFIG_FB_ATY=m
 22.1234  CONFIG_FB_ATY_CT=y
 22.1235  CONFIG_FB_ATY_GENERIC_LCD=y
 22.1236 -CONFIG_FB_ATY_XL_INIT=y
 22.1237 +# CONFIG_FB_ATY_XL_INIT is not set
 22.1238  CONFIG_FB_ATY_GX=y
 22.1239  CONFIG_FB_SAVAGE=m
 22.1240  CONFIG_FB_SAVAGE_I2C=y
 22.1241  CONFIG_FB_SAVAGE_ACCEL=y
 22.1242 -CONFIG_FB_SIS=m
 22.1243 -CONFIG_FB_SIS_300=y
 22.1244 -CONFIG_FB_SIS_315=y
 22.1245 +# CONFIG_FB_SIS is not set
 22.1246  CONFIG_FB_NEOMAGIC=m
 22.1247  CONFIG_FB_KYRO=m
 22.1248  CONFIG_FB_3DFX=m
 22.1249 -# CONFIG_FB_3DFX_ACCEL is not set
 22.1250 +CONFIG_FB_3DFX_ACCEL=y
 22.1251  CONFIG_FB_VOODOO1=m
 22.1252  CONFIG_FB_TRIDENT=m
 22.1253 -# CONFIG_FB_TRIDENT_ACCEL is not set
 22.1254 +CONFIG_FB_TRIDENT_ACCEL=y
 22.1255  # CONFIG_FB_PM3 is not set
 22.1256 -CONFIG_FB_GEODE=y
 22.1257 -CONFIG_FB_GEODE_GX1=m
 22.1258 -CONFIG_FB_S1D13XXX=m
 22.1259 -CONFIG_FB_VIRTUAL=m
 22.1260 +# CONFIG_FB_GEODE is not set
 22.1261 +# CONFIG_FB_S1D13XXX is not set
 22.1262 +# CONFIG_FB_VIRTUAL is not set
 22.1263  
 22.1264  #
 22.1265  # Console display driver support
 22.1266  #
 22.1267  CONFIG_VGA_CONSOLE=y
 22.1268  CONFIG_DUMMY_CONSOLE=y
 22.1269 -CONFIG_FRAMEBUFFER_CONSOLE=m
 22.1270 +CONFIG_FRAMEBUFFER_CONSOLE=y
 22.1271  # CONFIG_FONTS is not set
 22.1272  CONFIG_FONT_8x8=y
 22.1273  CONFIG_FONT_8x16=y
 22.1274 @@ -1901,8 +1771,15 @@ CONFIG_FONT_8x16=y
 22.1275  #
 22.1276  # Logo configuration
 22.1277  #
 22.1278 -# CONFIG_LOGO is not set
 22.1279 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 22.1280 +CONFIG_LOGO=y
 22.1281 +# CONFIG_LOGO_LINUX_MONO is not set
 22.1282 +# CONFIG_LOGO_LINUX_VGA16 is not set
 22.1283 +CONFIG_LOGO_LINUX_CLUT224=y
 22.1284 +CONFIG_BACKLIGHT_LCD_SUPPORT=y
 22.1285 +CONFIG_BACKLIGHT_CLASS_DEVICE=m
 22.1286 +CONFIG_BACKLIGHT_DEVICE=y
 22.1287 +CONFIG_LCD_CLASS_DEVICE=m
 22.1288 +CONFIG_LCD_DEVICE=y
 22.1289  
 22.1290  #
 22.1291  # Sound
 22.1292 @@ -1936,7 +1813,7 @@ CONFIG_SND_VX_LIB=m
 22.1293  CONFIG_SND_DUMMY=m
 22.1294  CONFIG_SND_VIRMIDI=m
 22.1295  CONFIG_SND_MTPAV=m
 22.1296 -CONFIG_SND_SERIAL_U16550=m
 22.1297 +# CONFIG_SND_SERIAL_U16550 is not set
 22.1298  CONFIG_SND_MPU401=m
 22.1299  
 22.1300  #
 22.1301 @@ -1956,8 +1833,8 @@ CONFIG_SND_CS46XX=m
 22.1302  CONFIG_SND_CS46XX_NEW_DSP=y
 22.1303  CONFIG_SND_CS4281=m
 22.1304  CONFIG_SND_EMU10K1=m
 22.1305 -# CONFIG_SND_EMU10K1X is not set
 22.1306 -# CONFIG_SND_CA0106 is not set
 22.1307 +CONFIG_SND_EMU10K1X=m
 22.1308 +CONFIG_SND_CA0106=m
 22.1309  CONFIG_SND_KORG1212=m
 22.1310  CONFIG_SND_MIXART=m
 22.1311  CONFIG_SND_NM256=m
 22.1312 @@ -1982,7 +1859,7 @@ CONFIG_SND_INTEL8X0=m
 22.1313  CONFIG_SND_INTEL8X0M=m
 22.1314  CONFIG_SND_SONICVIBES=m
 22.1315  CONFIG_SND_VIA82XX=m
 22.1316 -# CONFIG_SND_VIA82XX_MODEM is not set
 22.1317 +CONFIG_SND_VIA82XX_MODEM=m
 22.1318  CONFIG_SND_VX222=m
 22.1319  CONFIG_SND_HDA_INTEL=m
 22.1320  
 22.1321 @@ -1995,75 +1872,7 @@ CONFIG_SND_USB_USX2Y=m
 22.1322  #
 22.1323  # Open Sound System
 22.1324  #
 22.1325 -CONFIG_SOUND_PRIME=m
 22.1326 -CONFIG_SOUND_BT878=m
 22.1327 -CONFIG_SOUND_CMPCI=m
 22.1328 -# CONFIG_SOUND_CMPCI_FM is not set
 22.1329 -# CONFIG_SOUND_CMPCI_MIDI is not set
 22.1330 -CONFIG_SOUND_CMPCI_JOYSTICK=y
 22.1331 -CONFIG_SOUND_EMU10K1=m
 22.1332 -CONFIG_MIDI_EMU10K1=y
 22.1333 -CONFIG_SOUND_FUSION=m
 22.1334 -CONFIG_SOUND_CS4281=m
 22.1335 -CONFIG_SOUND_ES1370=m
 22.1336 -CONFIG_SOUND_ES1371=m
 22.1337 -CONFIG_SOUND_ESSSOLO1=m
 22.1338 -CONFIG_SOUND_MAESTRO=m
 22.1339 -CONFIG_SOUND_MAESTRO3=m
 22.1340 -CONFIG_SOUND_ICH=m
 22.1341 -CONFIG_SOUND_SONICVIBES=m
 22.1342 -CONFIG_SOUND_TRIDENT=m
 22.1343 -# CONFIG_SOUND_MSNDCLAS is not set
 22.1344 -# CONFIG_SOUND_MSNDPIN is not set
 22.1345 -CONFIG_SOUND_VIA82CXXX=m
 22.1346 -CONFIG_MIDI_VIA82CXXX=y
 22.1347 -CONFIG_SOUND_OSS=m
 22.1348 -# CONFIG_SOUND_TRACEINIT is not set
 22.1349 -# CONFIG_SOUND_DMAP is not set
 22.1350 -# CONFIG_SOUND_AD1816 is not set
 22.1351 -CONFIG_SOUND_AD1889=m
 22.1352 -CONFIG_SOUND_SGALAXY=m
 22.1353 -CONFIG_SOUND_ADLIB=m
 22.1354 -CONFIG_SOUND_ACI_MIXER=m
 22.1355 -CONFIG_SOUND_CS4232=m
 22.1356 -CONFIG_SOUND_SSCAPE=m
 22.1357 -CONFIG_SOUND_GUS=m
 22.1358 -CONFIG_SOUND_GUS16=y
 22.1359 -CONFIG_SOUND_GUSMAX=y
 22.1360 -CONFIG_SOUND_VMIDI=m
 22.1361 -CONFIG_SOUND_TRIX=m
 22.1362 -CONFIG_SOUND_MSS=m
 22.1363 -CONFIG_SOUND_MPU401=m
 22.1364 -CONFIG_SOUND_NM256=m
 22.1365 -CONFIG_SOUND_MAD16=m
 22.1366 -CONFIG_MAD16_OLDCARD=y
 22.1367 -CONFIG_SOUND_PAS=m
 22.1368 -CONFIG_SOUND_PSS=m
 22.1369 -CONFIG_PSS_MIXER=y
 22.1370 -CONFIG_SOUND_SB=m
 22.1371 -# CONFIG_SOUND_AWE32_SYNTH is not set
 22.1372 -CONFIG_SOUND_WAVEFRONT=m
 22.1373 -CONFIG_SOUND_MAUI=m
 22.1374 -CONFIG_SOUND_YM3812=m
 22.1375 -CONFIG_SOUND_OPL3SA1=m
 22.1376 -CONFIG_SOUND_OPL3SA2=m
 22.1377 -CONFIG_SOUND_YMFPCI=m
 22.1378 -# CONFIG_SOUND_YMFPCI_LEGACY is not set
 22.1379 -CONFIG_SOUND_UART6850=m
 22.1380 -CONFIG_SOUND_AEDSP16=m
 22.1381 -CONFIG_SC6600=y
 22.1382 -CONFIG_SC6600_JOY=y
 22.1383 -CONFIG_SC6600_CDROM=4
 22.1384 -CONFIG_SC6600_CDROMBASE=0x0
 22.1385 -# CONFIG_AEDSP16_MSS is not set
 22.1386 -# CONFIG_AEDSP16_SBPRO is not set
 22.1387 -# CONFIG_AEDSP16_MPU401 is not set
 22.1388 -CONFIG_SOUND_TVMIXER=m
 22.1389 -CONFIG_SOUND_KAHLUA=m
 22.1390 -CONFIG_SOUND_ALI5455=m
 22.1391 -CONFIG_SOUND_FORTE=m
 22.1392 -CONFIG_SOUND_RME96XX=m
 22.1393 -CONFIG_SOUND_AD1980=m
 22.1394 +# CONFIG_SOUND_PRIME is not set
 22.1395  
 22.1396  #
 22.1397  # USB support
 22.1398 @@ -2077,14 +1886,14 @@ CONFIG_USB=y
 22.1399  # Miscellaneous USB options
 22.1400  #
 22.1401  CONFIG_USB_DEVICEFS=y
 22.1402 -CONFIG_USB_BANDWIDTH=y
 22.1403 +# CONFIG_USB_BANDWIDTH is not set
 22.1404  # CONFIG_USB_DYNAMIC_MINORS is not set
 22.1405  # CONFIG_USB_OTG is not set
 22.1406  
 22.1407  #
 22.1408  # USB Host Controller Drivers
 22.1409  #
 22.1410 -CONFIG_USB_EHCI_HCD=y
 22.1411 +CONFIG_USB_EHCI_HCD=m
 22.1412  CONFIG_USB_EHCI_SPLIT_ISO=y
 22.1413  CONFIG_USB_EHCI_ROOT_HUB_TT=y
 22.1414  CONFIG_USB_OHCI_HCD=m
 22.1415 @@ -2096,7 +1905,7 @@ CONFIG_USB_SL811_HCD=m
 22.1416  #
 22.1417  # USB Device Class drivers
 22.1418  #
 22.1419 -CONFIG_USB_AUDIO=m
 22.1420 +# CONFIG_USB_AUDIO is not set
 22.1421  
 22.1422  #
 22.1423  # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
 22.1424 @@ -2122,16 +1931,13 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
 22.1425  #
 22.1426  # USB Input Devices
 22.1427  #
 22.1428 -CONFIG_USB_HID=m
 22.1429 +CONFIG_USB_HID=y
 22.1430  CONFIG_USB_HIDINPUT=y
 22.1431 -# CONFIG_HID_FF is not set
 22.1432 +CONFIG_HID_FF=y
 22.1433 +CONFIG_HID_PID=y
 22.1434 +CONFIG_LOGITECH_FF=y
 22.1435 +CONFIG_THRUSTMASTER_FF=y
 22.1436  CONFIG_USB_HIDDEV=y
 22.1437 -
 22.1438 -#
 22.1439 -# USB HID Boot Protocol drivers
 22.1440 -#
 22.1441 -CONFIG_USB_KBD=y
 22.1442 -CONFIG_USB_MOUSE=y
 22.1443  CONFIG_USB_AIPTEK=m
 22.1444  CONFIG_USB_WACOM=m
 22.1445  CONFIG_USB_KBTAB=m
 22.1446 @@ -2150,7 +1956,7 @@ CONFIG_USB_MICROTEK=m
 22.1447  #
 22.1448  # USB Multimedia devices
 22.1449  #
 22.1450 -# CONFIG_USB_DABUSB is not set
 22.1451 +CONFIG_USB_DABUSB=m
 22.1452  CONFIG_USB_VICAM=m
 22.1453  CONFIG_USB_DSBR=m
 22.1454  CONFIG_USB_IBMCAM=m
 22.1455 @@ -2220,30 +2026,30 @@ CONFIG_USB_SERIAL_IPAQ=m
 22.1456  CONFIG_USB_SERIAL_IR=m
 22.1457  CONFIG_USB_SERIAL_EDGEPORT=m
 22.1458  CONFIG_USB_SERIAL_EDGEPORT_TI=m
 22.1459 -# CONFIG_USB_SERIAL_GARMIN is not set
 22.1460 +CONFIG_USB_SERIAL_GARMIN=m
 22.1461  CONFIG_USB_SERIAL_IPW=m
 22.1462  CONFIG_USB_SERIAL_KEYSPAN_PDA=m
 22.1463  CONFIG_USB_SERIAL_KEYSPAN=m
 22.1464 -# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
 22.1465 -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
 22.1466 -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
 22.1467 -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
 22.1468 -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
 22.1469 -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
 22.1470 -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
 22.1471 -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
 22.1472 -# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set
 22.1473 -# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set
 22.1474 -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
 22.1475 -# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
 22.1476 +CONFIG_USB_SERIAL_KEYSPAN_MPR=y
 22.1477 +CONFIG_USB_SERIAL_KEYSPAN_USA28=y
 22.1478 +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
 22.1479 +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
 22.1480 +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
 22.1481 +CONFIG_USB_SERIAL_KEYSPAN_USA19=y
 22.1482 +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
 22.1483 +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
 22.1484 +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
 22.1485 +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
 22.1486 +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
 22.1487 +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 22.1488  CONFIG_USB_SERIAL_KLSI=m
 22.1489  CONFIG_USB_SERIAL_KOBIL_SCT=m
 22.1490  CONFIG_USB_SERIAL_MCT_U232=m
 22.1491  CONFIG_USB_SERIAL_PL2303=m
 22.1492  CONFIG_USB_SERIAL_HP4X=m
 22.1493  CONFIG_USB_SERIAL_SAFE=m
 22.1494 -# CONFIG_USB_SERIAL_SAFE_PADDED is not set
 22.1495 -# CONFIG_USB_SERIAL_TI is not set
 22.1496 +CONFIG_USB_SERIAL_SAFE_PADDED=y
 22.1497 +CONFIG_USB_SERIAL_TI=m
 22.1498  CONFIG_USB_SERIAL_CYBERJACK=m
 22.1499  CONFIG_USB_SERIAL_XIRCOM=m
 22.1500  CONFIG_USB_SERIAL_OMNINET=m
 22.1501 @@ -2252,17 +2058,17 @@ CONFIG_USB_EZUSB=y
 22.1502  #
 22.1503  # USB Miscellaneous drivers
 22.1504  #
 22.1505 -# CONFIG_USB_EMI62 is not set
 22.1506 +CONFIG_USB_EMI62=m
 22.1507  # CONFIG_USB_EMI26 is not set
 22.1508  CONFIG_USB_AUERSWALD=m
 22.1509  CONFIG_USB_RIO500=m
 22.1510  CONFIG_USB_LEGOTOWER=m
 22.1511  CONFIG_USB_LCD=m
 22.1512  CONFIG_USB_LED=m
 22.1513 -CONFIG_USB_CYTHERM=m
 22.1514 +# CONFIG_USB_CYTHERM is not set
 22.1515  CONFIG_USB_PHIDGETKIT=m
 22.1516  CONFIG_USB_PHIDGETSERVO=m
 22.1517 -# CONFIG_USB_IDMOUSE is not set
 22.1518 +CONFIG_USB_IDMOUSE=m
 22.1519  CONFIG_USB_SISUSBVGA=m
 22.1520  CONFIG_USB_TEST=m
 22.1521  
 22.1522 @@ -2275,33 +2081,24 @@ CONFIG_USB_SPEEDTOUCH=m
 22.1523  #
 22.1524  # USB Gadget Support
 22.1525  #
 22.1526 -CONFIG_USB_GADGET=m
 22.1527 -# CONFIG_USB_GADGET_DEBUG_FILES is not set
 22.1528 -CONFIG_USB_GADGET_NET2280=y
 22.1529 -CONFIG_USB_NET2280=m
 22.1530 -# CONFIG_USB_GADGET_PXA2XX is not set
 22.1531 -# CONFIG_USB_GADGET_GOKU is not set
 22.1532 -# CONFIG_USB_GADGET_LH7A40X is not set
 22.1533 -# CONFIG_USB_GADGET_OMAP is not set
 22.1534 -# CONFIG_USB_GADGET_DUMMY_HCD is not set
 22.1535 -CONFIG_USB_GADGET_DUALSPEED=y
 22.1536 -CONFIG_USB_ZERO=m
 22.1537 -CONFIG_USB_ETH=m
 22.1538 -CONFIG_USB_ETH_RNDIS=y
 22.1539 -CONFIG_USB_GADGETFS=m
 22.1540 -CONFIG_USB_FILE_STORAGE=m
 22.1541 -# CONFIG_USB_FILE_STORAGE_TEST is not set
 22.1542 -CONFIG_USB_G_SERIAL=m
 22.1543 +# CONFIG_USB_GADGET is not set
 22.1544  
 22.1545  #
 22.1546  # MMC/SD Card support
 22.1547  #
 22.1548 -# CONFIG_MMC is not set
 22.1549 +CONFIG_MMC=m
 22.1550 +# CONFIG_MMC_DEBUG is not set
 22.1551 +CONFIG_MMC_BLOCK=m
 22.1552 +CONFIG_MMC_WBSD=m
 22.1553  
 22.1554  #
 22.1555  # InfiniBand support
 22.1556  #
 22.1557 -# CONFIG_INFINIBAND is not set
 22.1558 +CONFIG_INFINIBAND=m
 22.1559 +CONFIG_INFINIBAND_MTHCA=m
 22.1560 +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
 22.1561 +CONFIG_INFINIBAND_IPOIB=m
 22.1562 +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
 22.1563  
 22.1564  #
 22.1565  # Power management options
 22.1566 @@ -2335,7 +2132,7 @@ CONFIG_ACPI_SYSTEM=y
 22.1567  #
 22.1568  # File systems
 22.1569  #
 22.1570 -CONFIG_EXT2_FS=m
 22.1571 +CONFIG_EXT2_FS=y
 22.1572  CONFIG_EXT2_FS_XATTR=y
 22.1573  CONFIG_EXT2_FS_POSIX_ACL=y
 22.1574  CONFIG_EXT2_FS_SECURITY=y
 22.1575 @@ -2345,16 +2142,18 @@ CONFIG_EXT3_FS_POSIX_ACL=y
 22.1576  CONFIG_EXT3_FS_SECURITY=y
 22.1577  CONFIG_JBD=m
 22.1578  # CONFIG_JBD_DEBUG is not set
 22.1579 -CONFIG_FS_MBCACHE=m
 22.1580 +CONFIG_FS_MBCACHE=y
 22.1581  CONFIG_REISERFS_FS=m
 22.1582  # CONFIG_REISERFS_CHECK is not set
 22.1583 -# CONFIG_REISERFS_PROC_INFO is not set
 22.1584 -# CONFIG_REISERFS_FS_XATTR is not set
 22.1585 +CONFIG_REISERFS_PROC_INFO=y
 22.1586 +CONFIG_REISERFS_FS_XATTR=y
 22.1587 +CONFIG_REISERFS_FS_POSIX_ACL=y
 22.1588 +CONFIG_REISERFS_FS_SECURITY=y
 22.1589  CONFIG_JFS_FS=m
 22.1590  CONFIG_JFS_POSIX_ACL=y
 22.1591 -# CONFIG_JFS_SECURITY is not set
 22.1592 +CONFIG_JFS_SECURITY=y
 22.1593  # CONFIG_JFS_DEBUG is not set
 22.1594 -CONFIG_JFS_STATISTICS=y
 22.1595 +# CONFIG_JFS_STATISTICS is not set
 22.1596  CONFIG_FS_POSIX_ACL=y
 22.1597  
 22.1598  #
 22.1599 @@ -2362,15 +2161,15 @@ CONFIG_FS_POSIX_ACL=y
 22.1600  #
 22.1601  CONFIG_XFS_FS=m
 22.1602  CONFIG_XFS_EXPORT=y
 22.1603 -CONFIG_XFS_RT=y
 22.1604 +# CONFIG_XFS_RT is not set
 22.1605  CONFIG_XFS_QUOTA=y
 22.1606  CONFIG_XFS_SECURITY=y
 22.1607  CONFIG_XFS_POSIX_ACL=y
 22.1608  CONFIG_MINIX_FS=m
 22.1609  CONFIG_ROMFS_FS=m
 22.1610  CONFIG_QUOTA=y
 22.1611 -CONFIG_QFMT_V1=m
 22.1612 -CONFIG_QFMT_V2=m
 22.1613 +# CONFIG_QFMT_V1 is not set
 22.1614 +CONFIG_QFMT_V2=y
 22.1615  CONFIG_QUOTACTL=y
 22.1616  CONFIG_DNOTIFY=y
 22.1617  CONFIG_AUTOFS_FS=m
 22.1618 @@ -2379,10 +2178,10 @@ CONFIG_AUTOFS4_FS=m
 22.1619  #
 22.1620  # CD-ROM/DVD Filesystems
 22.1621  #
 22.1622 -CONFIG_ISO9660_FS=m
 22.1623 +CONFIG_ISO9660_FS=y
 22.1624  CONFIG_JOLIET=y
 22.1625  CONFIG_ZISOFS=y
 22.1626 -CONFIG_ZISOFS_FS=m
 22.1627 +CONFIG_ZISOFS_FS=y
 22.1628  CONFIG_UDF_FS=m
 22.1629  CONFIG_UDF_NLS=y
 22.1630  
 22.1631 @@ -2393,10 +2192,8 @@ CONFIG_FAT_FS=m
 22.1632  CONFIG_MSDOS_FS=m
 22.1633  CONFIG_VFAT_FS=m
 22.1634  CONFIG_FAT_DEFAULT_CODEPAGE=437
 22.1635 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 22.1636 -CONFIG_NTFS_FS=m
 22.1637 -# CONFIG_NTFS_DEBUG is not set
 22.1638 -# CONFIG_NTFS_RW is not set
 22.1639 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
 22.1640 +# CONFIG_NTFS_FS is not set
 22.1641  
 22.1642  #
 22.1643  # Pseudo filesystems
 22.1644 @@ -2404,9 +2201,7 @@ CONFIG_NTFS_FS=m
 22.1645  CONFIG_PROC_FS=y
 22.1646  CONFIG_PROC_KCORE=y
 22.1647  CONFIG_SYSFS=y
 22.1648 -CONFIG_DEVFS_FS=y
 22.1649 -# CONFIG_DEVFS_MOUNT is not set
 22.1650 -# CONFIG_DEVFS_DEBUG is not set
 22.1651 +# CONFIG_DEVFS_FS is not set
 22.1652  CONFIG_DEVPTS_FS_XATTR=y
 22.1653  CONFIG_DEVPTS_FS_SECURITY=y
 22.1654  CONFIG_TMPFS=y
 22.1655 @@ -2419,8 +2214,7 @@ CONFIG_RAMFS=y
 22.1656  #
 22.1657  # Miscellaneous filesystems
 22.1658  #
 22.1659 -CONFIG_ADFS_FS=m
 22.1660 -# CONFIG_ADFS_FS_RW is not set
 22.1661 +# CONFIG_ADFS_FS is not set
 22.1662  CONFIG_AFFS_FS=m
 22.1663  CONFIG_HFS_FS=m
 22.1664  CONFIG_HFSPLUS_FS=m
 22.1665 @@ -2428,20 +2222,18 @@ CONFIG_BEFS_FS=m
 22.1666  # CONFIG_BEFS_DEBUG is not set
 22.1667  CONFIG_BFS_FS=m
 22.1668  CONFIG_EFS_FS=m
 22.1669 -CONFIG_JFFS_FS=m
 22.1670 -CONFIG_JFFS_FS_VERBOSE=0
 22.1671 -CONFIG_JFFS_PROC_FS=y
 22.1672 +# CONFIG_JFFS_FS is not set
 22.1673  CONFIG_JFFS2_FS=m
 22.1674  CONFIG_JFFS2_FS_DEBUG=0
 22.1675 -# CONFIG_JFFS2_FS_NAND is not set
 22.1676 +CONFIG_JFFS2_FS_NAND=y
 22.1677  # CONFIG_JFFS2_FS_NOR_ECC is not set
 22.1678  # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 22.1679  CONFIG_JFFS2_ZLIB=y
 22.1680  CONFIG_JFFS2_RTIME=y
 22.1681  # CONFIG_JFFS2_RUBIN is not set
 22.1682 -CONFIG_CRAMFS=y
 22.1683 +CONFIG_CRAMFS=m
 22.1684  CONFIG_VXFS_FS=m
 22.1685 -CONFIG_HPFS_FS=m
 22.1686 +# CONFIG_HPFS_FS is not set
 22.1687  CONFIG_QNX4FS_FS=m
 22.1688  # CONFIG_QNX4FS_RW is not set
 22.1689  CONFIG_SYSV_FS=m
 22.1690 @@ -2470,7 +2262,8 @@ CONFIG_SMB_FS=m
 22.1691  # CONFIG_SMB_NLS_DEFAULT is not set
 22.1692  CONFIG_CIFS=m
 22.1693  # CONFIG_CIFS_STATS is not set
 22.1694 -# CONFIG_CIFS_XATTR is not set
 22.1695 +CONFIG_CIFS_XATTR=y
 22.1696 +CONFIG_CIFS_POSIX=y
 22.1697  # CONFIG_CIFS_EXPERIMENTAL is not set
 22.1698  CONFIG_NCP_FS=m
 22.1699  CONFIG_NCPFS_PACKET_SIGNING=y
 22.1700 @@ -2478,38 +2271,29 @@ CONFIG_NCPFS_IOCTL_LOCKING=y
 22.1701  CONFIG_NCPFS_STRONG=y
 22.1702  CONFIG_NCPFS_NFS_NS=y
 22.1703  CONFIG_NCPFS_OS2_NS=y
 22.1704 -# CONFIG_NCPFS_SMALLDOS is not set
 22.1705 +CONFIG_NCPFS_SMALLDOS=y
 22.1706  CONFIG_NCPFS_NLS=y
 22.1707  CONFIG_NCPFS_EXTRAS=y
 22.1708 -CONFIG_CODA_FS=m
 22.1709 -# CONFIG_CODA_FS_OLD_API is not set
 22.1710 -CONFIG_AFS_FS=m
 22.1711 -CONFIG_RXRPC=m
 22.1712 +# CONFIG_CODA_FS is not set
 22.1713 +# CONFIG_AFS_FS is not set
 22.1714  
 22.1715  #
 22.1716  # Partition Types
 22.1717  #
 22.1718  CONFIG_PARTITION_ADVANCED=y
 22.1719 -CONFIG_ACORN_PARTITION=y
 22.1720 -CONFIG_ACORN_PARTITION_CUMANA=y
 22.1721 -# CONFIG_ACORN_PARTITION_EESOX is not set
 22.1722 -CONFIG_ACORN_PARTITION_ICS=y
 22.1723 -# CONFIG_ACORN_PARTITION_ADFS is not set
 22.1724 -# CONFIG_ACORN_PARTITION_POWERTEC is not set
 22.1725 -CONFIG_ACORN_PARTITION_RISCIX=y
 22.1726 +# CONFIG_ACORN_PARTITION is not set
 22.1727  CONFIG_OSF_PARTITION=y
 22.1728  CONFIG_AMIGA_PARTITION=y
 22.1729 -CONFIG_ATARI_PARTITION=y
 22.1730 +# CONFIG_ATARI_PARTITION is not set
 22.1731  CONFIG_MAC_PARTITION=y
 22.1732  CONFIG_MSDOS_PARTITION=y
 22.1733  CONFIG_BSD_DISKLABEL=y
 22.1734  CONFIG_MINIX_SUBPARTITION=y
 22.1735  CONFIG_SOLARIS_X86_PARTITION=y
 22.1736  CONFIG_UNIXWARE_DISKLABEL=y
 22.1737 -CONFIG_LDM_PARTITION=y
 22.1738 -# CONFIG_LDM_DEBUG is not set
 22.1739 +# CONFIG_LDM_PARTITION is not set
 22.1740  CONFIG_SGI_PARTITION=y
 22.1741 -CONFIG_ULTRIX_PARTITION=y
 22.1742 +# CONFIG_ULTRIX_PARTITION is not set
 22.1743  CONFIG_SUN_PARTITION=y
 22.1744  CONFIG_EFI_PARTITION=y
 22.1745  
 22.1746 @@ -2517,8 +2301,8 @@ CONFIG_EFI_PARTITION=y
 22.1747  # Native Language Support
 22.1748  #
 22.1749  CONFIG_NLS=y
 22.1750 -CONFIG_NLS_DEFAULT="cp437"
 22.1751 -CONFIG_NLS_CODEPAGE_437=m
 22.1752 +CONFIG_NLS_DEFAULT="utf8"
 22.1753 +CONFIG_NLS_CODEPAGE_437=y
 22.1754  CONFIG_NLS_CODEPAGE_737=m
 22.1755  CONFIG_NLS_CODEPAGE_775=m
 22.1756  CONFIG_NLS_CODEPAGE_850=m
 22.1757 @@ -2541,7 +2325,7 @@ CONFIG_NLS_CODEPAGE_874=m
 22.1758  CONFIG_NLS_ISO8859_8=m
 22.1759  CONFIG_NLS_CODEPAGE_1250=m
 22.1760  CONFIG_NLS_CODEPAGE_1251=m
 22.1761 -CONFIG_NLS_ASCII=m
 22.1762 +CONFIG_NLS_ASCII=y
 22.1763  CONFIG_NLS_ISO8859_1=m
 22.1764  CONFIG_NLS_ISO8859_2=m
 22.1765  CONFIG_NLS_ISO8859_3=m
 22.1766 @@ -2561,15 +2345,15 @@ CONFIG_NLS_UTF8=m
 22.1767  # Security options
 22.1768  #
 22.1769  CONFIG_KEYS=y
 22.1770 -# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
 22.1771 +CONFIG_KEYS_DEBUG_PROC_KEYS=y
 22.1772  CONFIG_SECURITY=y
 22.1773 -# CONFIG_SECURITY_NETWORK is not set
 22.1774 -CONFIG_SECURITY_CAPABILITIES=m
 22.1775 -CONFIG_SECURITY_ROOTPLUG=m
 22.1776 -CONFIG_SECURITY_SECLVL=m
 22.1777 +CONFIG_SECURITY_NETWORK=y
 22.1778 +CONFIG_SECURITY_CAPABILITIES=y
 22.1779 +# CONFIG_SECURITY_ROOTPLUG is not set
 22.1780 +# CONFIG_SECURITY_SECLVL is not set
 22.1781  CONFIG_SECURITY_SELINUX=y
 22.1782  CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 22.1783 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
 22.1784 +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
 22.1785  CONFIG_SECURITY_SELINUX_DISABLE=y
 22.1786  CONFIG_SECURITY_SELINUX_DEVELOP=y
 22.1787  CONFIG_SECURITY_SELINUX_AVC_STATS=y
 22.1788 @@ -2582,8 +2366,8 @@ CONFIG_CRYPTO=y
 22.1789  CONFIG_CRYPTO_HMAC=y
 22.1790  CONFIG_CRYPTO_NULL=m
 22.1791  CONFIG_CRYPTO_MD4=m
 22.1792 -CONFIG_CRYPTO_MD5=y
 22.1793 -CONFIG_CRYPTO_SHA1=m
 22.1794 +CONFIG_CRYPTO_MD5=m
 22.1795 +CONFIG_CRYPTO_SHA1=y
 22.1796  CONFIG_CRYPTO_SHA256=m
 22.1797  CONFIG_CRYPTO_SHA512=m
 22.1798  CONFIG_CRYPTO_WP512=m
 22.1799 @@ -2602,7 +2386,7 @@ CONFIG_CRYPTO_ANUBIS=m
 22.1800  CONFIG_CRYPTO_DEFLATE=m
 22.1801  CONFIG_CRYPTO_MICHAEL_MIC=m
 22.1802  CONFIG_CRYPTO_CRC32C=m
 22.1803 -CONFIG_CRYPTO_TEST=m
 22.1804 +# CONFIG_CRYPTO_TEST is not set
 22.1805  
 22.1806  #
 22.1807  # Hardware crypto devices
 22.1808 @@ -2616,8 +2400,6 @@ CONFIG_CRC32=y
 22.1809  CONFIG_LIBCRC32C=m
 22.1810  CONFIG_ZLIB_INFLATE=y
 22.1811  CONFIG_ZLIB_DEFLATE=m
 22.1812 -CONFIG_REED_SOLOMON=m
 22.1813 -CONFIG_REED_SOLOMON_DEC16=y
 22.1814  
 22.1815  #
 22.1816  # Kernel hacking
 22.1817 @@ -2625,7 +2407,7 @@ CONFIG_REED_SOLOMON_DEC16=y
 22.1818  # CONFIG_PRINTK_TIME is not set
 22.1819  CONFIG_DEBUG_KERNEL=y
 22.1820  CONFIG_MAGIC_SYSRQ=y
 22.1821 -CONFIG_LOG_BUF_SHIFT=14
 22.1822 +CONFIG_LOG_BUF_SHIFT=15
 22.1823  # CONFIG_SCHEDSTATS is not set
 22.1824  # CONFIG_DEBUG_SLAB is not set
 22.1825  # CONFIG_DEBUG_SPINLOCK is not set
 22.1826 @@ -2640,5 +2422,4 @@ CONFIG_LOG_BUF_SHIFT=14
 22.1827  # CONFIG_4KSTACKS is not set
 22.1828  CONFIG_X86_FIND_SMP_CONFIG=y
 22.1829  CONFIG_X86_MPPARSE=y
 22.1830 -# CONFIG_CHECKING is not set
 22.1831  # CONFIG_INIT_DEBUG is not set
    23.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Tue Aug 23 18:43:18 2005 -0800
    23.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Thu Aug 25 15:53:20 2005 -0700
    23.3 @@ -533,6 +533,11 @@ config X86_CPUID
    23.4  	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
    23.5  	  /dev/cpu/31/cpuid.
    23.6  
    23.7 +config SWIOTLB
    23.8 +       bool
    23.9 +       depends on PCI
   23.10 +       default y
   23.11 +
   23.12  source "drivers/firmware/Kconfig"
   23.13  
   23.14  choice
    24.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile	Tue Aug 23 18:43:18 2005 -0800
    24.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile	Thu Aug 25 15:53:20 2005 -0700
    24.3 @@ -14,8 +14,7 @@ obj-y	:= process.o signal.o entry.o trap
    24.4  
    24.5  c-obj-y	:= semaphore.o vm86.o \
    24.6  		ptrace.o sys_i386.o \
    24.7 -		i387.o dmi_scan.o bootflag.o \
    24.8 -		doublefault.o
    24.9 +		i387.o dmi_scan.o bootflag.o
   24.10  s-obj-y	:=
   24.11  
   24.12  obj-y				+= cpu/
   24.13 @@ -44,6 +43,7 @@ c-obj-$(CONFIG_HPET_TIMER) 	+= time_hpet
   24.14  c-obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
   24.15  c-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
   24.16  c-obj-$(CONFIG_SMP_ALTERNATIVES)+= smpalts.o
   24.17 +obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
   24.18  
   24.19  EXTRA_AFLAGS   := -traditional
   24.20  
   24.21 @@ -84,7 +84,7 @@ SYSCFLAGS_vsyscall-syms.o = -r
   24.22  			$(obj)/vsyscall-sysenter.o FORCE
   24.23  	$(call if_changed,syscall)
   24.24  
   24.25 -c-link	:= init_task.o
   24.26 +c-link	:=
   24.27  s-link	:= vsyscall-int80.o vsyscall-sysenter.o vsyscall-sigreturn.o vsyscall.lds.o syscall_table.o
   24.28  
   24.29  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-obj-m) $(c-link)) $(patsubst %.o,$(obj)/%.S,$(s-obj-y) $(s-link)):
   24.30 @@ -92,6 +92,7 @@ s-link	:= vsyscall-int80.o vsyscall-syse
   24.31  
   24.32  $(obj)/vsyscall-int80.S: $(obj)/vsyscall-sigreturn.S
   24.33  
   24.34 +EXTRA_AFLAGS	+= -I$(obj)
   24.35  $(obj)/entry.o: $(src)/entry.S $(src)/syscall_table.S
   24.36  
   24.37  obj-y	+= $(c-obj-y) $(s-obj-y)
    25.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Tue Aug 23 18:43:18 2005 -0800
    25.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Thu Aug 25 15:53:20 2005 -0700
    25.3 @@ -19,11 +19,13 @@
    25.4  
    25.5  #include "cpu.h"
    25.6  
    25.7 +#ifndef CONFIG_XEN
    25.8  DEFINE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
    25.9  EXPORT_PER_CPU_SYMBOL(cpu_gdt_table);
   25.10  
   25.11  DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
   25.12  EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
   25.13 +#endif
   25.14  
   25.15  static int cachesize_override __initdata = -1;
   25.16  static int disable_x86_fxsr __initdata = 0;
   25.17 @@ -569,7 +571,7 @@ void __init cpu_gdt_init(struct Xgt_desc
   25.18  	for (va = gdt_descr->address, f = 0;
   25.19  	     va < gdt_descr->address + gdt_descr->size;
   25.20  	     va += PAGE_SIZE, f++) {
   25.21 -		frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
   25.22 +		frames[f] = virt_to_mfn(va);
   25.23  		make_page_readonly((void *)va);
   25.24  	}
   25.25  	if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
    26.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Tue Aug 23 18:43:18 2005 -0800
    26.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Thu Aug 25 15:53:20 2005 -0700
    26.3 @@ -136,9 +136,6 @@ cpu_gdt_descr:
    26.4  ENTRY(empty_zero_page)
    26.5  
    26.6  .org 0x2000
    26.7 -ENTRY(swapper_pg_dir)
    26.8 -
    26.9 -.org 0x3000
   26.10  ENTRY(cpu_gdt_table)
   26.11  	.quad 0x0000000000000000	/* NULL descriptor */
   26.12  	.quad 0x0000000000000000	/* 0x0b reserved */
   26.13 @@ -190,10 +187,10 @@ ENTRY(cpu_gdt_table)
   26.14  	.quad 0x0000000000000000	/* 0xf8 - GDT entry 31: double-fault TSS */
   26.15  	.fill GDT_ENTRIES-32,8,0
   26.16  
   26.17 -.org 0x4000
   26.18 +.org 0x3000
   26.19  ENTRY(default_ldt)
   26.20  
   26.21 -.org 0x5000
   26.22 +.org 0x4000
   26.23  /*
   26.24   * Real beginning of normal "text" segment
   26.25   */
    27.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c	Tue Aug 23 18:43:18 2005 -0800
    27.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c	Thu Aug 25 15:53:20 2005 -0700
    27.3 @@ -115,9 +115,6 @@ EXPORT_SYMBOL(__copy_from_user_ll);
    27.4  EXPORT_SYMBOL(__copy_to_user_ll);
    27.5  EXPORT_SYMBOL(strnlen_user);
    27.6  
    27.7 -EXPORT_SYMBOL(dma_alloc_coherent);
    27.8 -EXPORT_SYMBOL(dma_free_coherent);
    27.9 -
   27.10  #ifdef CONFIG_PCI
   27.11  EXPORT_SYMBOL(pci_mem_start);
   27.12  #endif
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/init_task.c	Thu Aug 25 15:53:20 2005 -0700
    28.3 @@ -0,0 +1,49 @@
    28.4 +#include <linux/mm.h>
    28.5 +#include <linux/module.h>
    28.6 +#include <linux/sched.h>
    28.7 +#include <linux/init.h>
    28.8 +#include <linux/init_task.h>
    28.9 +#include <linux/fs.h>
   28.10 +#include <linux/mqueue.h>
   28.11 +
   28.12 +#include <asm/uaccess.h>
   28.13 +#include <asm/pgtable.h>
   28.14 +#include <asm/desc.h>
   28.15 +
   28.16 +static struct fs_struct init_fs = INIT_FS;
   28.17 +static struct files_struct init_files = INIT_FILES;
   28.18 +static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
   28.19 +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
   28.20 +
   28.21 +#define swapper_pg_dir ((pgd_t *)NULL)
   28.22 +struct mm_struct init_mm = INIT_MM(init_mm);
   28.23 +#undef swapper_pg_dir
   28.24 +
   28.25 +EXPORT_SYMBOL(init_mm);
   28.26 +
   28.27 +/*
   28.28 + * Initial thread structure.
   28.29 + *
   28.30 + * We need to make sure that this is THREAD_SIZE aligned due to the
   28.31 + * way process stacks are handled. This is done by having a special
   28.32 + * "init_task" linker map entry..
   28.33 + */
   28.34 +union thread_union init_thread_union 
   28.35 +	__attribute__((__section__(".data.init_task"))) =
   28.36 +		{ INIT_THREAD_INFO(init_task) };
   28.37 +
   28.38 +/*
   28.39 + * Initial task structure.
   28.40 + *
   28.41 + * All other task structs will be allocated on slabs in fork.c
   28.42 + */
   28.43 +struct task_struct init_task = INIT_TASK(init_task);
   28.44 +
   28.45 +EXPORT_SYMBOL(init_task);
   28.46 +
   28.47 +/*
   28.48 + * per-CPU TSS segments. Threads are completely 'soft' on Linux,
   28.49 + * no more per-task TSS's.
   28.50 + */ 
   28.51 +DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp = INIT_TSS;
   28.52 +
    29.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Tue Aug 23 18:43:18 2005 -0800
    29.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Thu Aug 25 15:53:20 2005 -0700
    29.3 @@ -80,7 +80,7 @@ asmlinkage long sys_ioperm(unsigned long
    29.4  		t->io_bitmap_ptr = bitmap;
    29.5  
    29.6  		op.cmd = PHYSDEVOP_SET_IOBITMAP;
    29.7 -		op.u.set_iobitmap.bitmap   = (unsigned long)bitmap;
    29.8 +		op.u.set_iobitmap.bitmap   = (char *)bitmap;
    29.9  		op.u.set_iobitmap.nr_ports = IO_BITMAP_BITS;
   29.10  		HYPERVISOR_physdev_op(&op);
   29.11  	}
   29.12 @@ -113,16 +113,12 @@ asmlinkage long sys_iopl(unsigned int ne
   29.13  	if ((new_io_pl > old_io_pl) && !capable(CAP_SYS_RAWIO))
   29.14  		return -EPERM;
   29.15  
   29.16 -	/* Maintain OS privileges even if user attempts to relinquish them. */
   29.17 -	if (new_io_pl == 0)
   29.18 -		new_io_pl = 1;
   29.19 -
   29.20  	/* Change our version of the privilege levels. */
   29.21  	current->thread.io_pl = new_io_pl;
   29.22  
   29.23  	/* Force the change at ring 0. */
   29.24  	op.cmd             = PHYSDEVOP_SET_IOPL;
   29.25 -	op.u.set_iopl.iopl = new_io_pl;
   29.26 +	op.u.set_iopl.iopl = (new_io_pl == 0) ? 1 : new_io_pl;
   29.27  	HYPERVISOR_physdev_op(&op);
   29.28  
   29.29  	return 0;
    30.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c	Tue Aug 23 18:43:18 2005 -0800
    30.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c	Thu Aug 25 15:53:20 2005 -0700
    30.3 @@ -198,7 +198,7 @@ static int write_ldt(void __user * ptr, 
    30.4  {
    30.5  	struct mm_struct * mm = current->mm;
    30.6  	__u32 entry_1, entry_2, *lp;
    30.7 -	unsigned long mach_lp;
    30.8 +	maddr_t mach_lp;
    30.9  	int error;
   30.10  	struct user_desc ldt_info;
   30.11  
   30.12 @@ -245,7 +245,8 @@ static int write_ldt(void __user * ptr, 
   30.13  
   30.14  	/* Install the new entry ...  */
   30.15  install:
   30.16 -	error = HYPERVISOR_update_descriptor(mach_lp, entry_1, entry_2);
   30.17 +	error = HYPERVISOR_update_descriptor(
   30.18 +		mach_lp, (u64)entry_1 | ((u64)entry_2<<32));
   30.19  
   30.20  out_unlock:
   30.21  	up(&mm->context.sem);
    31.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c	Tue Aug 23 18:43:18 2005 -0800
    31.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c	Thu Aug 25 15:53:20 2005 -0700
    31.3 @@ -784,7 +784,9 @@ static int __init smp_scan_config (unsig
    31.4  
    31.5  void __init find_smp_config (void)
    31.6  {
    31.7 +#ifndef CONFIG_XEN
    31.8  	unsigned int address;
    31.9 +#endif
   31.10  
   31.11  	/*
   31.12  	 * FIXME: Linux assumes you have 640K of base ram..
    32.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Tue Aug 23 18:43:18 2005 -0800
    32.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Aug 25 15:53:20 2005 -0700
    32.3 @@ -24,6 +24,104 @@ struct dma_coherent_mem {
    32.4  	unsigned long	*bitmap;
    32.5  };
    32.6  
    32.7 +#define IOMMU_BUG_ON(test)				\
    32.8 +do {							\
    32.9 +	if (unlikely(test)) {				\
   32.10 +		printk(KERN_ALERT "Fatal DMA error! "	\
   32.11 +		       "Please use 'swiotlb=force'\n");	\
   32.12 +		BUG();					\
   32.13 +	}						\
   32.14 +} while (0)
   32.15 +
   32.16 +int
   32.17 +dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
   32.18 +	   enum dma_data_direction direction)
   32.19 +{
   32.20 +	int i, rc;
   32.21 +
   32.22 +	BUG_ON(direction == DMA_NONE);
   32.23 +
   32.24 +	if (swiotlb) {
   32.25 +		rc = swiotlb_map_sg(hwdev, sg, nents, direction);
   32.26 +	} else {
   32.27 +		for (i = 0; i < nents; i++ ) {
   32.28 +			sg[i].dma_address =
   32.29 +				page_to_phys(sg[i].page) + sg[i].offset;
   32.30 +			sg[i].dma_length  = sg[i].length;
   32.31 +			BUG_ON(!sg[i].page);
   32.32 +			IOMMU_BUG_ON(address_needs_mapping(
   32.33 +				hwdev, sg[i].dma_address));
   32.34 +		}
   32.35 +		rc = nents;
   32.36 +	}
   32.37 +
   32.38 +	flush_write_buffers();
   32.39 +	return rc;
   32.40 +}
   32.41 +EXPORT_SYMBOL(dma_map_sg);
   32.42 +
   32.43 +void
   32.44 +dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
   32.45 +	     enum dma_data_direction direction)
   32.46 +{
   32.47 +	BUG_ON(direction == DMA_NONE);
   32.48 +	if (swiotlb)
   32.49 +		swiotlb_unmap_sg(hwdev, sg, nents, direction);
   32.50 +}
   32.51 +EXPORT_SYMBOL(dma_unmap_sg);
   32.52 +
   32.53 +dma_addr_t
   32.54 +dma_map_page(struct device *dev, struct page *page, unsigned long offset,
   32.55 +	     size_t size, enum dma_data_direction direction)
   32.56 +{
   32.57 +	dma_addr_t dma_addr;
   32.58 +
   32.59 +	BUG_ON(direction == DMA_NONE);
   32.60 +
   32.61 +	if (swiotlb) {
   32.62 +		dma_addr = swiotlb_map_page(
   32.63 +			dev, page, offset, size, direction);
   32.64 +	} else {
   32.65 +		dma_addr = page_to_phys(page) + offset;
   32.66 +		IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr));
   32.67 +	}
   32.68 +
   32.69 +	return dma_addr;
   32.70 +}
   32.71 +EXPORT_SYMBOL(dma_map_page);
   32.72 +
   32.73 +void
   32.74 +dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
   32.75 +	       enum dma_data_direction direction)
   32.76 +{
   32.77 +	BUG_ON(direction == DMA_NONE);
   32.78 +	if (swiotlb)
   32.79 +		swiotlb_unmap_page(dev, dma_address, size, direction);
   32.80 +}
   32.81 +EXPORT_SYMBOL(dma_unmap_page);
   32.82 +
   32.83 +int
   32.84 +dma_mapping_error(dma_addr_t dma_addr)
   32.85 +{
   32.86 +	if (swiotlb)
   32.87 +		return swiotlb_dma_mapping_error(dma_addr);
   32.88 +	return 0;
   32.89 +}
   32.90 +EXPORT_SYMBOL(dma_mapping_error);
   32.91 +
   32.92 +int
   32.93 +dma_supported(struct device *dev, u64 mask)
   32.94 +{
   32.95 +	if (swiotlb)
   32.96 +		return swiotlb_dma_supported(dev, mask);
   32.97 +	/*
   32.98 +         * By default we'll BUG when an infeasible DMA is requested, and
   32.99 +         * request swiotlb=force (see IOMMU_BUG_ON).
  32.100 +         */
  32.101 +	return 1;
  32.102 +}
  32.103 +EXPORT_SYMBOL(dma_supported);
  32.104 +
  32.105  void *dma_alloc_coherent(struct device *dev, size_t size,
  32.106  			   dma_addr_t *dma_handle, unsigned int __nocast gfp)
  32.107  {
  32.108 @@ -54,13 +152,14 @@ void *dma_alloc_coherent(struct device *
  32.109  	ret = (void *)vstart;
  32.110  
  32.111  	if (ret != NULL) {
  32.112 -		xen_contig_memory(vstart, order);
  32.113 +		xen_create_contiguous_region(vstart, order);
  32.114  
  32.115  		memset(ret, 0, size);
  32.116  		*dma_handle = virt_to_bus(ret);
  32.117  	}
  32.118  	return ret;
  32.119  }
  32.120 +EXPORT_SYMBOL(dma_alloc_coherent);
  32.121  
  32.122  void dma_free_coherent(struct device *dev, size_t size,
  32.123  			 void *vaddr, dma_addr_t dma_handle)
  32.124 @@ -72,9 +171,12 @@ void dma_free_coherent(struct device *de
  32.125  		int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
  32.126  
  32.127  		bitmap_release_region(mem->bitmap, page, order);
  32.128 -	} else
  32.129 +	} else {
  32.130 +		xen_destroy_contiguous_region((unsigned long)vaddr, order);
  32.131  		free_pages((unsigned long)vaddr, order);
  32.132 +	}
  32.133  }
  32.134 +EXPORT_SYMBOL(dma_free_coherent);
  32.135  
  32.136  int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
  32.137  				dma_addr_t device_addr, size_t size, int flags)
  32.138 @@ -153,46 +255,20 @@ void *dma_mark_declared_memory_occupied(
  32.139  }
  32.140  EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
  32.141  
  32.142 -static LIST_HEAD(dma_map_head);
  32.143 -static DEFINE_SPINLOCK(dma_map_lock);
  32.144 -struct dma_map_entry {
  32.145 -	struct list_head list;
  32.146 -	dma_addr_t dma;
  32.147 -	char *bounce, *host;
  32.148 -	size_t size;
  32.149 -};
  32.150 -#define DMA_MAP_MATCHES(e,d) (((e)->dma<=(d)) && (((e)->dma+(e)->size)>(d)))
  32.151 -
  32.152  dma_addr_t
  32.153  dma_map_single(struct device *dev, void *ptr, size_t size,
  32.154  	       enum dma_data_direction direction)
  32.155  {
  32.156 -	struct dma_map_entry *ent;
  32.157 -	void *bnc;
  32.158  	dma_addr_t dma;
  32.159 -	unsigned long flags;
  32.160  
  32.161  	BUG_ON(direction == DMA_NONE);
  32.162  
  32.163 -	/*
  32.164 -	 * Even if size is sub-page, the buffer may still straddle a page
  32.165 -	 * boundary. Take into account buffer start offset. All other calls are
  32.166 -	 * conservative and always search the dma_map list if it's non-empty.
  32.167 -	 */
  32.168 -	if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) {
  32.169 -		dma = virt_to_bus(ptr);
  32.170 +	if (swiotlb) {
  32.171 +		dma = swiotlb_map_single(dev, ptr, size, direction);
  32.172  	} else {
  32.173 -		BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL);
  32.174 -		BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL);
  32.175 -		if (direction != DMA_FROM_DEVICE)
  32.176 -			memcpy(bnc, ptr, size);
  32.177 -		ent->dma    = dma;
  32.178 -		ent->bounce = bnc;
  32.179 -		ent->host   = ptr;
  32.180 -		ent->size   = size;
  32.181 -		spin_lock_irqsave(&dma_map_lock, flags);
  32.182 -		list_add(&ent->list, &dma_map_head);
  32.183 -		spin_unlock_irqrestore(&dma_map_lock, flags);
  32.184 +		dma = virt_to_bus(ptr);
  32.185 +		IOMMU_BUG_ON(range_straddles_page_boundary(ptr, size));
  32.186 +		IOMMU_BUG_ON(address_needs_mapping(dev, dma));
  32.187  	}
  32.188  
  32.189  	flush_write_buffers();
  32.190 @@ -204,30 +280,9 @@ void
  32.191  dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
  32.192  		 enum dma_data_direction direction)
  32.193  {
  32.194 -	struct dma_map_entry *ent;
  32.195 -	unsigned long flags;
  32.196 -
  32.197  	BUG_ON(direction == DMA_NONE);
  32.198 -
  32.199 -	/* Fast-path check: are there any multi-page DMA mappings? */
  32.200 -	if (!list_empty(&dma_map_head)) {
  32.201 -		spin_lock_irqsave(&dma_map_lock, flags);
  32.202 -		list_for_each_entry ( ent, &dma_map_head, list ) {
  32.203 -			if (DMA_MAP_MATCHES(ent, dma_addr)) {
  32.204 -				list_del(&ent->list);
  32.205 -				break;
  32.206 -			}
  32.207 -		}
  32.208 -		spin_unlock_irqrestore(&dma_map_lock, flags);
  32.209 -		if (&ent->list != &dma_map_head) {
  32.210 -			BUG_ON(dma_addr != ent->dma);
  32.211 -			BUG_ON(size != ent->size);
  32.212 -			if (direction != DMA_TO_DEVICE)
  32.213 -				memcpy(ent->host, ent->bounce, size);
  32.214 -			dma_free_coherent(dev, size, ent->bounce, ent->dma);
  32.215 -			kfree(ent);
  32.216 -		}
  32.217 -	}
  32.218 +	if (swiotlb)
  32.219 +		swiotlb_unmap_single(dev, dma_addr, size, direction);
  32.220  }
  32.221  EXPORT_SYMBOL(dma_unmap_single);
  32.222  
  32.223 @@ -235,23 +290,8 @@ void
  32.224  dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
  32.225  			enum dma_data_direction direction)
  32.226  {
  32.227 -	struct dma_map_entry *ent;
  32.228 -	unsigned long flags, off;
  32.229 -
  32.230 -	/* Fast-path check: are there any multi-page DMA mappings? */
  32.231 -	if (!list_empty(&dma_map_head)) {
  32.232 -		spin_lock_irqsave(&dma_map_lock, flags);
  32.233 -		list_for_each_entry ( ent, &dma_map_head, list )
  32.234 -			if (DMA_MAP_MATCHES(ent, dma_handle))
  32.235 -				break;
  32.236 -		spin_unlock_irqrestore(&dma_map_lock, flags);
  32.237 -		if (&ent->list != &dma_map_head) {
  32.238 -			off = dma_handle - ent->dma;
  32.239 -			BUG_ON((off + size) > ent->size);
  32.240 -			/*if (direction != DMA_TO_DEVICE)*/
  32.241 -				memcpy(ent->host+off, ent->bounce+off, size);
  32.242 -		}
  32.243 -	}
  32.244 +	if (swiotlb)
  32.245 +		swiotlb_sync_single_for_cpu(dev, dma_handle, size, direction);
  32.246  }
  32.247  EXPORT_SYMBOL(dma_sync_single_for_cpu);
  32.248  
  32.249 @@ -259,24 +299,17 @@ void
  32.250  dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
  32.251                             enum dma_data_direction direction)
  32.252  {
  32.253 -	struct dma_map_entry *ent;
  32.254 -	unsigned long flags, off;
  32.255 -
  32.256 -	/* Fast-path check: are there any multi-page DMA mappings? */
  32.257 -	if (!list_empty(&dma_map_head)) {
  32.258 -		spin_lock_irqsave(&dma_map_lock, flags);
  32.259 -		list_for_each_entry ( ent, &dma_map_head, list )
  32.260 -			if (DMA_MAP_MATCHES(ent, dma_handle))
  32.261 -				break;
  32.262 -		spin_unlock_irqrestore(&dma_map_lock, flags);
  32.263 -		if (&ent->list != &dma_map_head) {
  32.264 -			off = dma_handle - ent->dma;
  32.265 -			BUG_ON((off + size) > ent->size);
  32.266 -			/*if (direction != DMA_FROM_DEVICE)*/
  32.267 -				memcpy(ent->bounce+off, ent->host+off, size);
  32.268 -		}
  32.269 -	}
  32.270 -
  32.271 -	flush_write_buffers();
  32.272 +	if (swiotlb)
  32.273 +		swiotlb_sync_single_for_device(dev, dma_handle, size, direction);
  32.274  }
  32.275  EXPORT_SYMBOL(dma_sync_single_for_device);
  32.276 +
  32.277 +/*
  32.278 + * Local variables:
  32.279 + *  c-file-style: "linux"
  32.280 + *  indent-tabs-mode: t
  32.281 + *  c-indent-level: 8
  32.282 + *  c-basic-offset: 8
  32.283 + *  tab-width: 8
  32.284 + * End:
  32.285 + */
    33.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Tue Aug 23 18:43:18 2005 -0800
    33.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Thu Aug 25 15:53:20 2005 -0700
    33.3 @@ -115,20 +115,12 @@ void xen_idle(void)
    33.4  /* We don't actually take CPU down, just spin without interrupts. */
    33.5  static inline void play_dead(void)
    33.6  {
    33.7 -	/* Ack it */
    33.8 -	__get_cpu_var(cpu_state) = CPU_DEAD;
    33.9 -
   33.10 -	/* We shouldn't have to disable interrupts while dead, but
   33.11 -	 * some interrupts just don't seem to go away, and this makes
   33.12 -	 * it "work" for testing purposes. */
   33.13  	/* Death loop */
   33.14  	while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
   33.15  		HYPERVISOR_yield();
   33.16  
   33.17 -	local_irq_disable();
   33.18  	__flush_tlb_all();
   33.19  	cpu_set(smp_processor_id(), cpu_online_map);
   33.20 -	local_irq_enable();
   33.21  }
   33.22  #else
   33.23  static inline void play_dead(void)
   33.24 @@ -156,12 +148,19 @@ void cpu_idle (void)
   33.25  			rmb();
   33.26  
   33.27  			if (cpu_is_offline(cpu)) {
   33.28 +				local_irq_disable();
   33.29  #if defined(CONFIG_XEN) && defined(CONFIG_HOTPLUG_CPU)
   33.30 +				/* Ack it.  From this point on until
   33.31 +				   we get woken up, we're not allowed
   33.32 +				   to take any locks.  In particular,
   33.33 +				   don't printk. */
   33.34 +				__get_cpu_var(cpu_state) = CPU_DEAD;
   33.35  				/* Tell hypervisor to take vcpu down. */
   33.36  				HYPERVISOR_vcpu_down(cpu);
   33.37  #endif
   33.38  				play_dead();
   33.39 -         }
   33.40 +				local_irq_enable();
   33.41 +			}
   33.42  
   33.43  			__get_cpu_var(irq_stat).idle_timestamp = jiffies;
   33.44  			xen_idle();
   33.45 @@ -523,23 +522,22 @@ struct task_struct fastcall * __switch_t
   33.46  	 * Load the per-thread Thread-Local Storage descriptor.
   33.47  	 * This is load_TLS(next, cpu) with multicalls.
   33.48  	 */
   33.49 -#define C(i) do {                                                       \
   33.50 -	if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||    \
   33.51 -		     next->tls_array[i].b != prev->tls_array[i].b)) {   \
   33.52 -		mcl->op      = __HYPERVISOR_update_descriptor;          \
   33.53 -		mcl->args[0] = virt_to_machine(&get_cpu_gdt_table(cpu)  \
   33.54 -					 [GDT_ENTRY_TLS_MIN + i]);      \
   33.55 -		mcl->args[1] = ((u32 *)&next->tls_array[i])[0];         \
   33.56 -		mcl->args[2] = ((u32 *)&next->tls_array[i])[1];         \
   33.57 -		mcl++;                                                  \
   33.58 -	}                                                               \
   33.59 +#define C(i) do {							\
   33.60 +	if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||	\
   33.61 +		     next->tls_array[i].b != prev->tls_array[i].b)) {	\
   33.62 +		mcl->op = __HYPERVISOR_update_descriptor;		\
   33.63 +		*(u64 *)&mcl->args[0] =	virt_to_machine(		\
   33.64 +			&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]);\
   33.65 +		*(u64 *)&mcl->args[2] = *(u64 *)&next->tls_array[i];	\
   33.66 +		mcl++;							\
   33.67 +	}								\
   33.68  } while (0)
   33.69  	C(0); C(1); C(2);
   33.70  #undef C
   33.71  
   33.72  	if (unlikely(prev->io_pl != next->io_pl)) {
   33.73  		iopl_op.cmd             = PHYSDEVOP_SET_IOPL;
   33.74 -		iopl_op.u.set_iopl.iopl = next->io_pl;
   33.75 +		iopl_op.u.set_iopl.iopl = (next->io_pl == 0) ? 1 : next->io_pl;
   33.76  		mcl->op      = __HYPERVISOR_physdev_op;
   33.77  		mcl->args[0] = (unsigned long)&iopl_op;
   33.78  		mcl++;
   33.79 @@ -549,7 +547,7 @@ struct task_struct fastcall * __switch_t
   33.80  		iobmp_op.cmd                     =
   33.81  			PHYSDEVOP_SET_IOBITMAP;
   33.82  		iobmp_op.u.set_iobitmap.bitmap   =
   33.83 -			(unsigned long)next->io_bitmap_ptr;
   33.84 +			(char *)next->io_bitmap_ptr;
   33.85  		iobmp_op.u.set_iobitmap.nr_ports =
   33.86  			next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
   33.87  		mcl->op      = __HYPERVISOR_physdev_op;
   33.88 @@ -791,3 +789,10 @@ unsigned long arch_align_stack(unsigned 
   33.89  		sp -= get_random_int() % 8192;
   33.90  	return sp & ~0xf;
   33.91  }
   33.92 +
   33.93 +
   33.94 +#ifndef CONFIG_X86_SMP
   33.95 +void _restore_vcpu(void)
   33.96 +{
   33.97 +}
   33.98 +#endif
    34.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Aug 23 18:43:18 2005 -0800
    34.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Thu Aug 25 15:53:20 2005 -0700
    34.3 @@ -1575,19 +1575,20 @@ void __init setup_arch(char **cmdline_p)
    34.4  	/* Make sure we have a correctly sized P->M table. */
    34.5  	if (max_pfn != xen_start_info.nr_pages) {
    34.6  		phys_to_machine_mapping = alloc_bootmem_low_pages(
    34.7 -			max_pfn * sizeof(unsigned long));
    34.8 +			max_pfn * sizeof(unsigned int));
    34.9  
   34.10  		if (max_pfn > xen_start_info.nr_pages) {
   34.11  			/* set to INVALID_P2M_ENTRY */
   34.12  			memset(phys_to_machine_mapping, ~0,
   34.13 -				max_pfn * sizeof(unsigned long));
   34.14 +				max_pfn * sizeof(unsigned int));
   34.15  			memcpy(phys_to_machine_mapping,
   34.16 -				(unsigned long *)xen_start_info.mfn_list,
   34.17 -				xen_start_info.nr_pages * sizeof(unsigned long));
   34.18 +				(unsigned int *)xen_start_info.mfn_list,
   34.19 +				xen_start_info.nr_pages * sizeof(unsigned int));
   34.20  		} else {
   34.21  			memcpy(phys_to_machine_mapping,
   34.22 -				(unsigned long *)xen_start_info.mfn_list,
   34.23 -				max_pfn * sizeof(unsigned long));
   34.24 +				(unsigned int *)xen_start_info.mfn_list,
   34.25 +				max_pfn * sizeof(unsigned int));
   34.26 +			/* N.B. below relies on sizeof(int) == sizeof(long). */
   34.27  			if (HYPERVISOR_dom_mem_op(
   34.28  				MEMOP_decrease_reservation,
   34.29  				(unsigned long *)xen_start_info.mfn_list + max_pfn,
   34.30 @@ -1597,18 +1598,17 @@ void __init setup_arch(char **cmdline_p)
   34.31  		free_bootmem(
   34.32  			__pa(xen_start_info.mfn_list), 
   34.33  			PFN_PHYS(PFN_UP(xen_start_info.nr_pages *
   34.34 -			sizeof(unsigned long))));
   34.35 +			sizeof(unsigned int))));
   34.36  	}
   34.37  
   34.38  	pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
   34.39 -	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
   34.40 +	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned int)), j++ )
   34.41  	{	
   34.42  	     pfn_to_mfn_frame_list[j] = 
   34.43 -		  virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
   34.44 +		  virt_to_mfn(&phys_to_machine_mapping[i]);
   34.45  	}
   34.46  	HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
   34.47 -	     virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
   34.48 -
   34.49 +	     virt_to_mfn(pfn_to_mfn_frame_list);
   34.50  
   34.51  	/*
   34.52  	 * NOTE: at this point the bootmem allocator is fully available.
   34.53 @@ -1636,7 +1636,7 @@ void __init setup_arch(char **cmdline_p)
   34.54  		efi_map_memmap();
   34.55  
   34.56  	op.cmd             = PHYSDEVOP_SET_IOPL;
   34.57 -	op.u.set_iopl.iopl = current->thread.io_pl = 1;
   34.58 +	op.u.set_iopl.iopl = 1;
   34.59  	HYPERVISOR_physdev_op(&op);
   34.60  
   34.61  #ifdef CONFIG_ACPI_BOOT
    35.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Aug 23 18:43:18 2005 -0800
    35.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Thu Aug 25 15:53:20 2005 -0700
    35.3 @@ -62,6 +62,8 @@
    35.4  #include <mach_wakecpu.h>
    35.5  #include <smpboot_hooks.h>
    35.6  
    35.7 +#include <asm-xen/evtchn.h>
    35.8 +
    35.9  /* Set if we find a B stepping CPU */
   35.10  static int __initdata smp_b_stepping;
   35.11  
   35.12 @@ -129,15 +131,7 @@ static void map_cpu_to_logical_apicid(vo
   35.13   */
   35.14  void __init smp_alloc_memory(void)
   35.15  {
   35.16 -#if 1
   35.17 -	int cpu;
   35.18 -
   35.19 -	for (cpu = 1; cpu < NR_CPUS; cpu++) {
   35.20 -		cpu_gdt_descr[cpu].address = (unsigned long)
   35.21 -			alloc_bootmem_low_pages(PAGE_SIZE);
   35.22 -		/* XXX free unused pages later */
   35.23 -	}
   35.24 -#else
   35.25 +#if 0
   35.26  	trampoline_base = (void *) alloc_bootmem_low_pages(PAGE_SIZE);
   35.27  	/*
   35.28  	 * Has to be in very low memory so we can execute
   35.29 @@ -859,8 +853,8 @@ static int __init do_boot_cpu(int apicid
   35.30  	atomic_set(&init_deasserted, 0);
   35.31  
   35.32  #if 1
   35.33 -	if (cpu_gdt_descr[0].size > PAGE_SIZE)
   35.34 -		BUG();
   35.35 +	cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL);
   35.36 +	BUG_ON(cpu_gdt_descr[0].size > PAGE_SIZE);
   35.37  	cpu_gdt_descr[cpu].size = cpu_gdt_descr[0].size;
   35.38  	printk("GDT: copying %d bytes from %lx to %lx\n",
   35.39  		cpu_gdt_descr[0].size, cpu_gdt_descr[0].address,
   35.40 @@ -878,7 +872,8 @@ static int __init do_boot_cpu(int apicid
   35.41  	ctxt.user_regs.cs = __KERNEL_CS;
   35.42  	ctxt.user_regs.eip = start_eip;
   35.43  	ctxt.user_regs.esp = idle->thread.esp;
   35.44 -	ctxt.user_regs.eflags = (1<<9) | (1<<2) | (idle->thread.io_pl<<12);
   35.45 +#define X86_EFLAGS_IOPL_RING1 0x1000
   35.46 +	ctxt.user_regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_IOPL_RING1;
   35.47  
   35.48  	/* FPU is set up to default initial state. */
   35.49  	memset(&ctxt.fpu_ctxt, 0, sizeof(ctxt.fpu_ctxt));
   35.50 @@ -901,7 +896,7 @@ static int __init do_boot_cpu(int apicid
   35.51  		for (va = cpu_gdt_descr[cpu].address, f = 0;
   35.52  		     va < cpu_gdt_descr[cpu].address + cpu_gdt_descr[cpu].size;
   35.53  		     va += PAGE_SIZE, f++) {
   35.54 -			ctxt.gdt_frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
   35.55 +			ctxt.gdt_frames[f] = virt_to_mfn(va);
   35.56  			make_page_readonly((void *)va);
   35.57  		}
   35.58  		ctxt.gdt_ents = cpu_gdt_descr[cpu].size / 8;
   35.59 @@ -917,10 +912,11 @@ static int __init do_boot_cpu(int apicid
   35.60  	ctxt.failsafe_callback_cs  = __KERNEL_CS;
   35.61  	ctxt.failsafe_callback_eip = (unsigned long)failsafe_callback;
   35.62  
   35.63 -	ctxt.ctrlreg[3] = (unsigned long)virt_to_machine(swapper_pg_dir);
   35.64 +	ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
   35.65  
   35.66  	boot_error = HYPERVISOR_boot_vcpu(cpu, &ctxt);
   35.67 -	printk("boot error: %ld\n", boot_error);
   35.68 +	if (boot_error)
   35.69 +		printk("boot error: %ld\n", boot_error);
   35.70  
   35.71  	if (!boot_error) {
   35.72  		/*
   35.73 @@ -1321,15 +1317,128 @@ void __devinit smp_prepare_boot_cpu(void
   35.74  }
   35.75  
   35.76  #ifdef CONFIG_HOTPLUG_CPU
   35.77 -#include <asm-xen/ctrl_if.h>
   35.78 -
   35.79 +#include <asm-xen/xenbus.h>
   35.80  /* hotplug down/up funtion pointer and target vcpu */
   35.81  struct vcpu_hotplug_handler_t {
   35.82 -	void (*fn)(int vcpu);
   35.83 +	void (*fn) (int vcpu);
   35.84  	u32 vcpu;
   35.85  };
   35.86  static struct vcpu_hotplug_handler_t vcpu_hotplug_handler;
   35.87  
   35.88 +static int vcpu_hotplug_cpu_process(void *unused)
   35.89 +{
   35.90 +	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
   35.91 +
   35.92 +	if (handler->fn) {
   35.93 +		(*(handler->fn)) (handler->vcpu);
   35.94 +		handler->fn = NULL;
   35.95 +	}
   35.96 +	return 0;
   35.97 +}
   35.98 +
   35.99 +static void __vcpu_hotplug_handler(void *unused)
  35.100 +{
  35.101 +	int err;
  35.102 +
  35.103 +	err = kernel_thread(vcpu_hotplug_cpu_process,
  35.104 +			    NULL, CLONE_FS | CLONE_FILES);
  35.105 +	if (err < 0)
  35.106 +		printk(KERN_ALERT "Error creating hotplug_cpu process!\n");
  35.107 +}
  35.108 +
  35.109 +static void handle_vcpu_hotplug_event(struct xenbus_watch *, const char *);
  35.110 +static struct notifier_block xsn_cpu;
  35.111 +
  35.112 +/* xenbus watch struct */
  35.113 +static struct xenbus_watch cpu_watch = {
  35.114 +	.node = "cpu",
  35.115 +	.callback = handle_vcpu_hotplug_event
  35.116 +};
  35.117 +
  35.118 +/* NB: Assumes xenbus_lock is held! */
  35.119 +static int setup_cpu_watcher(struct notifier_block *notifier,
  35.120 +			      unsigned long event, void *data)
  35.121 +{
  35.122 +	int err = 0;
  35.123 +
  35.124 +	BUG_ON(down_trylock(&xenbus_lock) == 0);
  35.125 +	err = register_xenbus_watch(&cpu_watch);
  35.126 +
  35.127 +	if (err) {
  35.128 +		printk("Failed to register watch on /cpu\n");
  35.129 +	}
  35.130 +
  35.131 +	return NOTIFY_DONE;
  35.132 +}
  35.133 +
  35.134 +static void handle_vcpu_hotplug_event(struct xenbus_watch *watch, const char *node)
  35.135 +{
  35.136 +	static DECLARE_WORK(vcpu_hotplug_work, __vcpu_hotplug_handler, NULL);
  35.137 +	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
  35.138 +	ssize_t ret;
  35.139 +	int err, cpu;
  35.140 +	char state[8];
  35.141 +	char dir[32];
  35.142 +	char *cpustr;
  35.143 +
  35.144 +	/* get a pointer to start of cpu string */
  35.145 +	if ((cpustr = strstr(node, "cpu/")) != NULL) {
  35.146 +
  35.147 +		/* find which cpu state changed, note vcpu for handler */
  35.148 +		sscanf(cpustr, "cpu/%d", &cpu);
  35.149 +		handler->vcpu = cpu;
  35.150 +
  35.151 +		/* calc the dir for xenbus read */
  35.152 +		sprintf(dir, "cpu/%d", cpu);
  35.153 +
  35.154 +		/* make sure watch that was triggered is changes to the correct key */
  35.155 +		if ((strcmp(node + strlen(dir), "/availability")) != 0)
  35.156 +			return;
  35.157 +
  35.158 +		/* get the state value */
  35.159 +		xenbus_transaction_start("cpu");
  35.160 +		err = xenbus_scanf(dir, "availability", "%s", state);
  35.161 +		xenbus_transaction_end(0);
  35.162 +
  35.163 +		if (err != 1) {
  35.164 +			printk(KERN_ERR
  35.165 +			       "XENBUS: Unable to read cpu state\n");
  35.166 +			return;
  35.167 +		}
  35.168 +
  35.169 +		/* if we detect a state change, take action */
  35.170 +		if (strcmp(state, "online") == 0) {
  35.171 +			/* offline -> online */
  35.172 +			if (!cpu_isset(cpu, cpu_online_map)) {
  35.173 +				handler->fn = (void *)&cpu_up;
  35.174 +				ret = schedule_work(&vcpu_hotplug_work);
  35.175 +			} 
  35.176 +		} else if (strcmp(state, "offline") == 0) {
  35.177 +			/* online -> offline */
  35.178 +			if (cpu_isset(cpu, cpu_online_map)) {
  35.179 +				handler->fn = (void *)&cpu_down;
  35.180 +				ret = schedule_work(&vcpu_hotplug_work);
  35.181 +			} 
  35.182 +		} else {
  35.183 +			printk(KERN_ERR
  35.184 +			       "XENBUS: unknown state(%s) on node(%s)\n", state,
  35.185 +			       node);
  35.186 +		}
  35.187 +	}
  35.188 +	return;
  35.189 +}
  35.190 +
  35.191 +static int __init setup_vcpu_hotplug_event(void)
  35.192 +{
  35.193 +	xsn_cpu.notifier_call = setup_cpu_watcher;
  35.194 +
  35.195 +	register_xenstore_notifier(&xsn_cpu);
  35.196 +
  35.197 +	return 0;
  35.198 +}
  35.199 +
  35.200 +subsys_initcall(setup_vcpu_hotplug_event);
  35.201 +
  35.202  /* must be called with the cpucontrol mutex held */
  35.203  static int __devinit cpu_enable(unsigned int cpu)
  35.204  {
  35.205 @@ -1398,77 +1507,6 @@ void __cpu_die(unsigned int cpu)
  35.206   	printk(KERN_ERR "CPU %u didn't die...\n", cpu);
  35.207  }
  35.208  
  35.209 -static int vcpu_hotplug_cpu_process(void *unused)
  35.210 -{
  35.211 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
  35.212 -
  35.213 -	if (handler->fn) {
  35.214 -		(*(handler->fn))(handler->vcpu);
  35.215 -		handler->fn = NULL;
  35.216 -	}
  35.217 -	return 0;
  35.218 -}
  35.219 -
  35.220 -static void __vcpu_hotplug_handler(void *unused)
  35.221 -{
  35.222 -	int err;
  35.223 -
  35.224 -	err = kernel_thread(vcpu_hotplug_cpu_process, 
  35.225 -			    NULL, CLONE_FS | CLONE_FILES);
  35.226 -	if (err < 0)
  35.227 -		printk(KERN_ALERT "Error creating hotplug_cpu process!\n");
  35.228 -
  35.229 -}
  35.230 -
  35.231 -static void vcpu_hotplug_event_handler(ctrl_msg_t *msg, unsigned long id)
  35.232 -{
  35.233 -	static DECLARE_WORK(vcpu_hotplug_work, __vcpu_hotplug_handler, NULL);
  35.234 -	vcpu_hotplug_t *req = (vcpu_hotplug_t *)&msg->msg[0];
  35.235 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
  35.236 -	ssize_t ret;
  35.237 -
  35.238 -	if (msg->length != sizeof(vcpu_hotplug_t))
  35.239 -		goto parse_error;
  35.240 -
  35.241 -	/* grab target vcpu from msg */
  35.242 -	handler->vcpu = req->vcpu;
  35.243 -
  35.244 -	/* determine which function to call based on msg subtype */
  35.245 -	switch (msg->subtype) {
  35.246 -        case CMSG_VCPU_HOTPLUG_OFF:
  35.247 -		handler->fn = (void *)&cpu_down;
  35.248 -		ret = schedule_work(&vcpu_hotplug_work);
  35.249 -		req->status = (u32) ret;
  35.250 -		break;
  35.251 -        case CMSG_VCPU_HOTPLUG_ON:
  35.252 -		handler->fn = (void *)&cpu_up;
  35.253 -		ret = schedule_work(&vcpu_hotplug_work);
  35.254 -		req->status = (u32) ret;
  35.255 -		break;
  35.256 -        default:
  35.257 -		goto parse_error;
  35.258 -	}
  35.259 -
  35.260 -	ctrl_if_send_response(msg);
  35.261 -	return;
  35.262 - parse_error:
  35.263 -	msg->length = 0;
  35.264 -	ctrl_if_send_response(msg);
  35.265 -}
  35.266 -
  35.267 -static int __init setup_vcpu_hotplug_event(void)
  35.268 -{
  35.269 -	struct vcpu_hotplug_handler_t *handler = &vcpu_hotplug_handler;
  35.270 -
  35.271 -	handler->fn = NULL;
  35.272 -	ctrl_if_register_receiver(CMSG_VCPU_HOTPLUG,
  35.273 -				  vcpu_hotplug_event_handler, 0);
  35.274 -
  35.275 -	return 0;
  35.276 -}
  35.277 -
  35.278 -__initcall(setup_vcpu_hotplug_event);
  35.279 -
  35.280  #else /* ... !CONFIG_HOTPLUG_CPU */
  35.281  int __cpu_disable(void)
  35.282  {
  35.283 @@ -1529,20 +1567,66 @@ void __init smp_cpus_done(unsigned int m
  35.284  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
  35.285  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
  35.286  
  35.287 -void __init smp_intr_init(void)
  35.288 +void smp_intr_init(void)
  35.289  {
  35.290  	int cpu = smp_processor_id();
  35.291  
  35.292  	per_cpu(resched_irq, cpu) =
  35.293 -		bind_ipi_on_cpu_to_irq(RESCHEDULE_VECTOR);
  35.294 +		bind_ipi_to_irq(RESCHEDULE_VECTOR);
  35.295  	sprintf(resched_name[cpu], "resched%d", cpu);
  35.296  	BUG_ON(request_irq(per_cpu(resched_irq, cpu), smp_reschedule_interrupt,
  35.297  	                   SA_INTERRUPT, resched_name[cpu], NULL));
  35.298  
  35.299  	per_cpu(callfunc_irq, cpu) =
  35.300 -		bind_ipi_on_cpu_to_irq(CALL_FUNCTION_VECTOR);
  35.301 +		bind_ipi_to_irq(CALL_FUNCTION_VECTOR);
  35.302  	sprintf(callfunc_name[cpu], "callfunc%d", cpu);
  35.303  	BUG_ON(request_irq(per_cpu(callfunc_irq, cpu),
  35.304  	                   smp_call_function_interrupt,
  35.305  	                   SA_INTERRUPT, callfunc_name[cpu], NULL));
  35.306  }
  35.307 +
  35.308 +static void smp_intr_exit(void)
  35.309 +{
  35.310 +	int cpu = smp_processor_id();
  35.311 +
  35.312 +	free_irq(per_cpu(resched_irq, cpu), NULL);
  35.313 +	unbind_ipi_from_irq(RESCHEDULE_VECTOR);
  35.314 +
  35.315 +	free_irq(per_cpu(callfunc_irq, cpu), NULL);
  35.316 +	unbind_ipi_from_irq(CALL_FUNCTION_VECTOR);
  35.317 +}
  35.318 +
  35.319 +extern void local_setup_timer_irq(void);
  35.320 +extern void local_teardown_timer_irq(void);
  35.321 +
  35.322 +void smp_suspend(void)
  35.323 +{
  35.324 +	/* XXX todo: take down time and ipi's on all cpus */
  35.325 +	local_teardown_timer_irq();
  35.326 +	smp_intr_exit();
  35.327 +}
  35.328 +
  35.329 +void smp_resume(void)
  35.330 +{
  35.331 +	/* XXX todo: restore time and ipi's on all cpus */
  35.332 +	smp_intr_init();
  35.333 +	local_setup_timer_irq();
  35.334 +}
  35.335 +
  35.336 +DECLARE_PER_CPU(int, timer_irq);
  35.337 +
  35.338 +void _restore_vcpu(void)
  35.339 +{
  35.340 +	int cpu = smp_processor_id();
  35.341 +	extern atomic_t vcpus_rebooting;
  35.342 +
  35.343 +	/* We are the first thing the vcpu runs when it comes back,
  35.344 +	   and we are supposed to restore the IPIs and timer
  35.345 +	   interrupts etc.  When we return, the vcpu's idle loop will
  35.346 +	   start up again. */
  35.347 +	_bind_virq_to_irq(VIRQ_TIMER, cpu, per_cpu(timer_irq, cpu));
  35.348 +	_bind_virq_to_irq(VIRQ_DEBUG, cpu, per_cpu(ldebug_irq, cpu));
  35.349 +	_bind_ipi_to_irq(RESCHEDULE_VECTOR, cpu, per_cpu(resched_irq, cpu) );
  35.350 +	_bind_ipi_to_irq(CALL_FUNCTION_VECTOR, cpu, per_cpu(callfunc_irq, cpu) );
  35.351 +	atomic_dec(&vcpus_rebooting);
  35.352 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Thu Aug 25 15:53:20 2005 -0700
    36.3 @@ -0,0 +1,660 @@
    36.4 +/*
    36.5 + * Dynamic DMA mapping support.
    36.6 + *
    36.7 + * This implementation is a fallback for platforms that do not support
    36.8 + * I/O TLBs (aka DMA address translation hardware).
    36.9 + * Copyright (C) 2000 Asit Mallick <Asit.K.Mallick@intel.com>
   36.10 + * Copyright (C) 2000 Goutham Rao <goutham.rao@intel.com>
   36.11 + * Copyright (C) 2000, 2003 Hewlett-Packard Co
   36.12 + *	David Mosberger-Tang <davidm@hpl.hp.com>
   36.13 + * Copyright (C) 2005 Keir Fraser <keir@xensource.com>
   36.14 + */
   36.15 +
   36.16 +#include <linux/cache.h>
   36.17 +#include <linux/mm.h>
   36.18 +#include <linux/module.h>
   36.19 +#include <linux/pci.h>
   36.20 +#include <linux/spinlock.h>
   36.21 +#include <linux/string.h>
   36.22 +#include <linux/types.h>
   36.23 +#include <linux/ctype.h>
   36.24 +#include <linux/init.h>
   36.25 +#include <linux/bootmem.h>
   36.26 +#include <linux/highmem.h>
   36.27 +#include <asm/io.h>
   36.28 +#include <asm/pci.h>
   36.29 +#include <asm/dma.h>
   36.30 +
   36.31 +#define OFFSET(val,align) ((unsigned long)((val) & ( (align) - 1)))
   36.32 +
   36.33 +#define SG_ENT_PHYS_ADDRESS(sg)	(page_to_phys((sg)->page) + (sg)->offset)
   36.34 +
   36.35 +/*
   36.36 + * Maximum allowable number of contiguous slabs to map,
   36.37 + * must be a power of 2.  What is the appropriate value ?
   36.38 + * The complexity of {map,unmap}_single is linearly dependent on this value.
   36.39 + */
   36.40 +#define IO_TLB_SEGSIZE	128
   36.41 +
   36.42 +/*
   36.43 + * log of the size of each IO TLB slab.  The number of slabs is command line
   36.44 + * controllable.
   36.45 + */
   36.46 +#define IO_TLB_SHIFT 11
   36.47 +
   36.48 +int swiotlb_force;
   36.49 +static char *iotlb_virt_start;
   36.50 +static unsigned long iotlb_nslabs;
   36.51 +
   36.52 +/*
   36.53 + * Used to do a quick range check in swiotlb_unmap_single and
   36.54 + * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
   36.55 + * API.
   36.56 + */
   36.57 +static dma_addr_t iotlb_bus_start, iotlb_bus_mask;
   36.58 +
   36.59 +/* Does the given dma address reside within the swiotlb aperture? */
   36.60 +#define in_swiotlb_aperture(a) (!(((a) ^ iotlb_bus_start) & iotlb_bus_mask))
   36.61 +
   36.62 +/*
   36.63 + * When the IOMMU overflows we return a fallback buffer. This sets the size.
   36.64 + */
   36.65 +static unsigned long io_tlb_overflow = 32*1024;
   36.66 +
   36.67 +void *io_tlb_overflow_buffer;
   36.68 +
   36.69 +/*
   36.70 + * This is a free list describing the number of free entries available from
   36.71 + * each index
   36.72 + */
   36.73 +static unsigned int *io_tlb_list;
   36.74 +static unsigned int io_tlb_index;
   36.75 +
   36.76 +/*
   36.77 + * We need to save away the original address corresponding to a mapped entry
   36.78 + * for the sync operations.
   36.79 + */
   36.80 +static struct phys_addr {
   36.81 +	struct page *page;
   36.82 +	unsigned int offset;
   36.83 +} *io_tlb_orig_addr;
   36.84 +
   36.85 +/*
   36.86 + * Protect the above data structures in the map and unmap calls
   36.87 + */
   36.88 +static DEFINE_SPINLOCK(io_tlb_lock);
   36.89 +
   36.90 +static int __init
   36.91 +setup_io_tlb_npages(char *str)
   36.92 +{
   36.93 +	/* Unlike ia64, the size is aperture in megabytes, not 'slabs'! */
   36.94 +	if (isdigit(*str)) {
   36.95 +		iotlb_nslabs = simple_strtoul(str, &str, 0) <<
   36.96 +			(20 - IO_TLB_SHIFT);
   36.97 +		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
   36.98 +		/* Round up to power of two (xen_create_contiguous_region). */
   36.99 +		while (iotlb_nslabs & (iotlb_nslabs-1))
  36.100 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
  36.101 +	}
  36.102 +	if (*str == ',')
  36.103 +		++str;
  36.104 +	/*
  36.105 +         * NB. 'force' enables the swiotlb, but doesn't force its use for
  36.106 +         * every DMA like it does on native Linux.
  36.107 +         */
  36.108 +	if (!strcmp(str, "force"))
  36.109 +		swiotlb_force = 1;
  36.110 +	return 1;
  36.111 +}
  36.112 +__setup("swiotlb=", setup_io_tlb_npages);
  36.113 +/* make io_tlb_overflow tunable too? */
  36.114 +
  36.115 +/*
  36.116 + * Statically reserve bounce buffer space and initialize bounce buffer data
  36.117 + * structures for the software IO TLB used to implement the PCI DMA API.
  36.118 + */
  36.119 +void
  36.120 +swiotlb_init_with_default_size (size_t default_size)
  36.121 +{
  36.122 +	unsigned long i, bytes;
  36.123 +
  36.124 +	if (!iotlb_nslabs) {
  36.125 +		iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
  36.126 +		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
  36.127 +		/* Round up to power of two (xen_create_contiguous_region). */
  36.128 +		while (iotlb_nslabs & (iotlb_nslabs-1))
  36.129 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
  36.130 +	}
  36.131 +
  36.132 +	bytes = iotlb_nslabs * (1UL << IO_TLB_SHIFT);
  36.133 +
  36.134 +	/*
  36.135 +	 * Get IO TLB memory from the low pages
  36.136 +	 */
  36.137 +	iotlb_virt_start = alloc_bootmem_low_pages(bytes);
  36.138 +	if (!iotlb_virt_start)
  36.139 +		panic("Cannot allocate SWIOTLB buffer!\n"
  36.140 +		      "Use dom0_mem Xen boot parameter to reserve\n"
  36.141 +		      "some DMA memory (e.g., dom0_mem=-128M).\n");
  36.142 +
  36.143 +	xen_create_contiguous_region(
  36.144 +		(unsigned long)iotlb_virt_start, get_order(bytes));
  36.145 +
  36.146 +	/*
  36.147 +	 * Allocate and initialize the free list array.  This array is used
  36.148 +	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE.
  36.149 +	 */
  36.150 +	io_tlb_list = alloc_bootmem(iotlb_nslabs * sizeof(int));
  36.151 +	for (i = 0; i < iotlb_nslabs; i++)
  36.152 + 		io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
  36.153 +	io_tlb_index = 0;
  36.154 +	io_tlb_orig_addr = alloc_bootmem(
  36.155 +		iotlb_nslabs * sizeof(*io_tlb_orig_addr));
  36.156 +
  36.157 +	/*
  36.158 +	 * Get the overflow emergency buffer
  36.159 +	 */
  36.160 +	io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
  36.161 +
  36.162 +	iotlb_bus_start = virt_to_bus(iotlb_virt_start);
  36.163 +	iotlb_bus_mask  = ~(dma_addr_t)(bytes - 1);
  36.164 +
  36.165 +	printk(KERN_INFO "Software IO TLB enabled: \n"
  36.166 +	       " Aperture:     %lu megabytes\n"
  36.167 +	       " Bus range:    0x%016lx - 0x%016lx\n"
  36.168 +	       " Kernel range: 0x%016lx - 0x%016lx\n",
  36.169 +	       bytes >> 20,
  36.170 +	       (unsigned long)iotlb_bus_start,
  36.171 +	       (unsigned long)iotlb_bus_start + bytes,
  36.172 +	       (unsigned long)iotlb_virt_start,
  36.173 +	       (unsigned long)iotlb_virt_start + bytes);
  36.174 +}
  36.175 +
  36.176 +void
  36.177 +swiotlb_init(void)
  36.178 +{
  36.179 +	/* The user can forcibly enable swiotlb. */
  36.180 +	if (swiotlb_force)
  36.181 +		swiotlb = 1;
  36.182 +
  36.183 +	/*
  36.184 +         * Otherwise, enable for domain 0 if the machine has 'lots of memory',
  36.185 +         * which we take to mean more than 2GB.
  36.186 +         */
  36.187 +	if (xen_start_info.flags & SIF_INITDOMAIN) {
  36.188 +		dom0_op_t op;
  36.189 +		op.cmd = DOM0_PHYSINFO;
  36.190 +		if ((HYPERVISOR_dom0_op(&op) == 0) &&
  36.191 +		    (op.u.physinfo.total_pages > 0x7ffff))
  36.192 +			swiotlb = 1;
  36.193 +	}
  36.194 +
  36.195 +	if (swiotlb)
  36.196 +		swiotlb_init_with_default_size(64 * (1<<20));
  36.197 +}
  36.198 +
  36.199 +static void
  36.200 +__sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir)
  36.201 +{
  36.202 +	if (PageHighMem(buffer.page)) {
  36.203 +		size_t len, bytes;
  36.204 +		char *dev, *host, *kmp;
  36.205 +		len = size;
  36.206 +		while (len != 0) {
  36.207 +			if (((bytes = len) + buffer.offset) > PAGE_SIZE)
  36.208 +				bytes = PAGE_SIZE - buffer.offset;
  36.209 +			kmp  = kmap_atomic(buffer.page, KM_SWIOTLB);
  36.210 +			dev  = dma_addr + size - len;
  36.211 +			host = kmp + buffer.offset;
  36.212 +			memcpy((dir == DMA_FROM_DEVICE) ? host : dev,
  36.213 +			       (dir == DMA_FROM_DEVICE) ? dev : host,
  36.214 +			       bytes);
  36.215 +			kunmap_atomic(kmp, KM_SWIOTLB);
  36.216 +			len -= bytes;
  36.217 +			buffer.page++;
  36.218 +			buffer.offset = 0;
  36.219 +		}
  36.220 +	} else {
  36.221 +		char *host = (char *)phys_to_virt(
  36.222 +			page_to_pseudophys(buffer.page)) + buffer.offset;
  36.223 +		if (dir == DMA_FROM_DEVICE)
  36.224 +			memcpy(host, dma_addr, size);
  36.225 +		else if (dir == DMA_TO_DEVICE)
  36.226 +			memcpy(dma_addr, host, size);
  36.227 +	}
  36.228 +}
  36.229 +
  36.230 +/*
  36.231 + * Allocates bounce buffer and returns its kernel virtual address.
  36.232 + */
  36.233 +static void *
  36.234 +map_single(struct device *hwdev, struct phys_addr buffer, size_t size, int dir)
  36.235 +{
  36.236 +	unsigned long flags;
  36.237 +	char *dma_addr;
  36.238 +	unsigned int nslots, stride, index, wrap;
  36.239 +	int i;
  36.240 +
  36.241 +	/*
  36.242 +	 * For mappings greater than a page, we limit the stride (and
  36.243 +	 * hence alignment) to a page size.
  36.244 +	 */
  36.245 +	nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
  36.246 +	if (size > PAGE_SIZE)
  36.247 +		stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
  36.248 +	else
  36.249 +		stride = 1;
  36.250 +
  36.251 +	BUG_ON(!nslots);
  36.252 +
  36.253 +	/*
  36.254 +	 * Find suitable number of IO TLB entries size that will fit this
  36.255 +	 * request and allocate a buffer from that IO TLB pool.
  36.256 +	 */
  36.257 +	spin_lock_irqsave(&io_tlb_lock, flags);
  36.258 +	{
  36.259 +		wrap = index = ALIGN(io_tlb_index, stride);
  36.260 +
  36.261 +		if (index >= iotlb_nslabs)
  36.262 +			wrap = index = 0;
  36.263 +
  36.264 +		do {
  36.265 +			/*
  36.266 +			 * If we find a slot that indicates we have 'nslots'
  36.267 +			 * number of contiguous buffers, we allocate the
  36.268 +			 * buffers from that slot and mark the entries as '0'
  36.269 +			 * indicating unavailable.
  36.270 +			 */
  36.271 +			if (io_tlb_list[index] >= nslots) {
  36.272 +				int count = 0;
  36.273 +
  36.274 +				for (i = index; i < (int)(index + nslots); i++)
  36.275 +					io_tlb_list[i] = 0;
  36.276 +				for (i = index - 1;
  36.277 +				     (OFFSET(i, IO_TLB_SEGSIZE) !=
  36.278 +				      IO_TLB_SEGSIZE -1) && io_tlb_list[i];
  36.279 +				     i--)
  36.280 +					io_tlb_list[i] = ++count;
  36.281 +				dma_addr = iotlb_virt_start +
  36.282 +					(index << IO_TLB_SHIFT);
  36.283 +
  36.284 +				/*
  36.285 +				 * Update the indices to avoid searching in
  36.286 +				 * the next round.
  36.287 +				 */
  36.288 +				io_tlb_index = 
  36.289 +					((index + nslots) < iotlb_nslabs
  36.290 +					 ? (index + nslots) : 0);
  36.291 +
  36.292 +				goto found;
  36.293 +			}
  36.294 +			index += stride;
  36.295 +			if (index >= iotlb_nslabs)
  36.296 +				index = 0;
  36.297 +		} while (index != wrap);
  36.298 +
  36.299 +		spin_unlock_irqrestore(&io_tlb_lock, flags);
  36.300 +		return NULL;
  36.301 +	}
  36.302 +  found:
  36.303 +	spin_unlock_irqrestore(&io_tlb_lock, flags);
  36.304 +
  36.305 +	/*
  36.306 +	 * Save away the mapping from the original address to the DMA address.
  36.307 +	 * This is needed when we sync the memory.  Then we sync the buffer if
  36.308 +	 * needed.
  36.309 +	 */
  36.310 +	io_tlb_orig_addr[index] = buffer;
  36.311 +	if ((dir == DMA_TO_DEVICE) || (dir == DMA_BIDIRECTIONAL))
  36.312 +		__sync_single(buffer, dma_addr, size, DMA_TO_DEVICE);
  36.313 +
  36.314 +	return dma_addr;
  36.315 +}
  36.316 +
  36.317 +/*
  36.318 + * dma_addr is the kernel virtual address of the bounce buffer to unmap.
  36.319 + */
  36.320 +static void
  36.321 +unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
  36.322 +{
  36.323 +	unsigned long flags;
  36.324 +	int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
  36.325 +	int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
  36.326 +	struct phys_addr buffer = io_tlb_orig_addr[index];
  36.327 +
  36.328 +	/*
  36.329 +	 * First, sync the memory before unmapping the entry
  36.330 +	 */
  36.331 +	if ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))
  36.332 +		__sync_single(buffer, dma_addr, size, DMA_FROM_DEVICE);
  36.333 +
  36.334 +	/*
  36.335 +	 * Return the buffer to the free list by setting the corresponding
  36.336 +	 * entries to indicate the number of contigous entries available.
  36.337 +	 * While returning the entries to the free list, we merge the entries
  36.338 +	 * with slots below and above the pool being returned.
  36.339 +	 */
  36.340 +	spin_lock_irqsave(&io_tlb_lock, flags);
  36.341 +	{
  36.342 +		count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ?
  36.343 +			 io_tlb_list[index + nslots] : 0);
  36.344 +		/*
  36.345 +		 * Step 1: return the slots to the free list, merging the
  36.346 +		 * slots with superceeding slots
  36.347 +		 */
  36.348 +		for (i = index + nslots - 1; i >= index; i--)
  36.349 +			io_tlb_list[i] = ++count;
  36.350 +		/*
  36.351 +		 * Step 2: merge the returned slots with the preceding slots,
  36.352 +		 * if available (non zero)
  36.353 +		 */
  36.354 +		for (i = index - 1;
  36.355 +		     (OFFSET(i, IO_TLB_SEGSIZE) !=
  36.356 +		      IO_TLB_SEGSIZE -1) && io_tlb_list[i];
  36.357 +		     i--)
  36.358 +			io_tlb_list[i] = ++count;
  36.359 +	}
  36.360 +	spin_unlock_irqrestore(&io_tlb_lock, flags);
  36.361 +}
  36.362 +
  36.363 +static void
  36.364 +sync_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
  36.365 +{
  36.366 +	int index = (dma_addr - iotlb_virt_start) >> IO_TLB_SHIFT;
  36.367 +	struct phys_addr buffer = io_tlb_orig_addr[index];
  36.368 +	BUG_ON((dir != DMA_FROM_DEVICE) && (dir != DMA_TO_DEVICE));
  36.369 +	__sync_single(buffer, dma_addr, size, dir);
  36.370 +}
  36.371 +
  36.372 +static void
  36.373 +swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
  36.374 +{
  36.375 +	/*
  36.376 +	 * Ran out of IOMMU space for this operation. This is very bad.
  36.377 +	 * Unfortunately the drivers cannot handle this operation properly.
  36.378 +	 * unless they check for pci_dma_mapping_error (most don't)
  36.379 +	 * When the mapping is small enough return a static buffer to limit
  36.380 +	 * the damage, or panic when the transfer is too big.
  36.381 +	 */
  36.382 +	printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
  36.383 +	       "device %s\n", (unsigned long)size, dev ? dev->bus_id : "?");
  36.384 +
  36.385 +	if (size > io_tlb_overflow && do_panic) {
  36.386 +		if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
  36.387 +			panic("PCI-DMA: Memory would be corrupted\n");
  36.388 +		if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL)
  36.389 +			panic("PCI-DMA: Random memory would be DMAed\n");
  36.390 +	}
  36.391 +}
  36.392 +
  36.393 +/*
  36.394 + * Map a single buffer of the indicated size for DMA in streaming mode.  The
  36.395 + * PCI address to use is returned.
  36.396 + *
  36.397 + * Once the device is given the dma address, the device owns this memory until
  36.398 + * either swiotlb_unmap_single or swiotlb_dma_sync_single is performed.
  36.399 + */
  36.400 +dma_addr_t
  36.401 +swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
  36.402 +{
  36.403 +	dma_addr_t dev_addr = virt_to_bus(ptr);
  36.404 +	void *map;
  36.405 +	struct phys_addr buffer;
  36.406 +
  36.407 +	BUG_ON(dir == DMA_NONE);
  36.408 +
  36.409 +	/*
  36.410 +	 * If the pointer passed in happens to be in the device's DMA window,
  36.411 +	 * we can safely return the device addr and not worry about bounce
  36.412 +	 * buffering it.
  36.413 +	 */
  36.414 +	if (!range_straddles_page_boundary(ptr, size) &&
  36.415 +	    !address_needs_mapping(hwdev, dev_addr))
  36.416 +		return dev_addr;
  36.417 +
  36.418 +	/*
  36.419 +	 * Oh well, have to allocate and map a bounce buffer.
  36.420 +	 */
  36.421 +	buffer.page   = virt_to_page(ptr);
  36.422 +	buffer.offset = (unsigned long)ptr & ~PAGE_MASK;
  36.423 +	map = map_single(hwdev, buffer, size, dir);
  36.424 +	if (!map) {
  36.425 +		swiotlb_full(hwdev, size, dir, 1);
  36.426 +		map = io_tlb_overflow_buffer;
  36.427 +	}
  36.428 +
  36.429 +	dev_addr = virt_to_bus(map);
  36.430 +
  36.431 +	/*
  36.432 +	 * Ensure that the address returned is DMA'ble
  36.433 +	 */
  36.434 +	if (address_needs_mapping(hwdev, dev_addr))
  36.435 +		panic("map_single: bounce buffer is not DMA'ble");
  36.436 +
  36.437 +	return dev_addr;
  36.438 +}
  36.439 +
  36.440 +/*
  36.441 + * Unmap a single streaming mode DMA translation.  The dma_addr and size must
  36.442 + * match what was provided for in a previous swiotlb_map_single call.  All
  36.443 + * other usages are undefined.
  36.444 + *
  36.445 + * After this call, reads by the cpu to the buffer are guaranteed to see
  36.446 + * whatever the device wrote there.
  36.447 + */
  36.448 +void
  36.449 +swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size,
  36.450 +		     int dir)
  36.451 +{
  36.452 +	BUG_ON(dir == DMA_NONE);
  36.453 +	if (in_swiotlb_aperture(dev_addr))
  36.454 +		unmap_single(hwdev, bus_to_virt(dev_addr), size, dir);
  36.455 +}
  36.456 +
  36.457 +/*
  36.458 + * Make physical memory consistent for a single streaming mode DMA translation
  36.459 + * after a transfer.
  36.460 + *
  36.461 + * If you perform a swiotlb_map_single() but wish to interrogate the buffer
  36.462 + * using the cpu, yet do not wish to teardown the PCI dma mapping, you must
  36.463 + * call this function before doing so.  At the next point you give the PCI dma
  36.464 + * address back to the card, you must first perform a
  36.465 + * swiotlb_dma_sync_for_device, and then the device again owns the buffer
  36.466 + */
  36.467 +void
  36.468 +swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
  36.469 +			    size_t size, int dir)
  36.470 +{
  36.471 +	BUG_ON(dir == DMA_NONE);
  36.472 +	if (in_swiotlb_aperture(dev_addr))
  36.473 +		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
  36.474 +}
  36.475 +
  36.476 +void
  36.477 +swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
  36.478 +			       size_t size, int dir)
  36.479 +{
  36.480 +	BUG_ON(dir == DMA_NONE);
  36.481 +	if (in_swiotlb_aperture(dev_addr))
  36.482 +		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
  36.483 +}
  36.484 +
  36.485 +/*
  36.486 + * Map a set of buffers described by scatterlist in streaming mode for DMA.
  36.487 + * This is the scatter-gather version of the above swiotlb_map_single
  36.488 + * interface.  Here the scatter gather list elements are each tagged with the
  36.489 + * appropriate dma address and length.  They are obtained via
  36.490 + * sg_dma_{address,length}(SG).
  36.491 + *
  36.492 + * NOTE: An implementation may be able to use a smaller number of
  36.493 + *       DMA address/length pairs than there are SG table elements.
  36.494 + *       (for example via virtual mapping capabilities)
  36.495 + *       The routine returns the number of addr/length pairs actually
  36.496 + *       used, at most nents.
  36.497 + *
  36.498 + * Device ownership issues as mentioned above for swiotlb_map_single are the
  36.499 + * same here.
  36.500 + */
  36.501 +int
  36.502 +swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
  36.503 +	       int dir)
  36.504 +{
  36.505 +	struct phys_addr buffer;
  36.506 +	dma_addr_t dev_addr;
  36.507 +	char *map;
  36.508 +	int i;
  36.509 +
  36.510 +	BUG_ON(dir == DMA_NONE);
  36.511 +
  36.512 +	for (i = 0; i < nelems; i++, sg++) {
  36.513 +		dev_addr = SG_ENT_PHYS_ADDRESS(sg);
  36.514 +		if (address_needs_mapping(hwdev, dev_addr)) {
  36.515 +			buffer.page   = sg->page;
  36.516 +			buffer.offset = sg->offset;
  36.517 +			map = map_single(hwdev, buffer, sg->length, dir);
  36.518 +			if (!map) {
  36.519 +				/* Don't panic here, we expect map_sg users
  36.520 +				   to do proper error handling. */
  36.521 +				swiotlb_full(hwdev, sg->length, dir, 0);
  36.522 +				swiotlb_unmap_sg(hwdev, sg - i, i, dir);
  36.523 +				sg[0].dma_length = 0;
  36.524 +				return 0;
  36.525 +			}
  36.526 +			sg->dma_address = (dma_addr_t)virt_to_bus(map);
  36.527 +		} else
  36.528 +			sg->dma_address = dev_addr;
  36.529 +		sg->dma_length = sg->length;
  36.530 +	}
  36.531 +	return nelems;
  36.532 +}
  36.533 +
  36.534 +/*
  36.535 + * Unmap a set of streaming mode DMA translations.  Again, cpu read rules
  36.536 + * concerning calls here are the same as for swiotlb_unmap_single() above.
  36.537 + */
  36.538 +void
  36.539 +swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
  36.540 +		 int dir)
  36.541 +{
  36.542 +	int i;
  36.543 +
  36.544 +	BUG_ON(dir == DMA_NONE);
  36.545 +
  36.546 +	for (i = 0; i < nelems; i++, sg++)
  36.547 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
  36.548 +			unmap_single(hwdev, 
  36.549 +				     (void *)bus_to_virt(sg->dma_address),
  36.550 +				     sg->dma_length, dir);
  36.551 +}
  36.552 +
  36.553 +/*
  36.554 + * Make physical memory consistent for a set of streaming mode DMA translations
  36.555 + * after a transfer.
  36.556 + *
  36.557 + * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules
  36.558 + * and usage.
  36.559 + */
  36.560 +void
  36.561 +swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
  36.562 +			int nelems, int dir)
  36.563 +{
  36.564 +	int i;
  36.565 +
  36.566 +	BUG_ON(dir == DMA_NONE);
  36.567 +
  36.568 +	for (i = 0; i < nelems; i++, sg++)
  36.569 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
  36.570 +			sync_single(hwdev,
  36.571 +				    (void *)bus_to_virt(sg->dma_address),
  36.572 +				    sg->dma_length, dir);
  36.573 +}
  36.574 +
  36.575 +void
  36.576 +swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
  36.577 +			   int nelems, int dir)
  36.578 +{
  36.579 +	int i;
  36.580 +
  36.581 +	BUG_ON(dir == DMA_NONE);
  36.582 +
  36.583 +	for (i = 0; i < nelems; i++, sg++)
  36.584 +		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
  36.585 +			sync_single(hwdev,
  36.586 +				    (void *)bus_to_virt(sg->dma_address),
  36.587 +				    sg->dma_length, dir);
  36.588 +}
  36.589 +
  36.590 +dma_addr_t
  36.591 +swiotlb_map_page(struct device *hwdev, struct page *page,
  36.592 +		 unsigned long offset, size_t size,
  36.593 +		 enum dma_data_direction direction)
  36.594 +{
  36.595 +	struct phys_addr buffer;
  36.596 +	dma_addr_t dev_addr;
  36.597 +	char *map;
  36.598 +
  36.599 +	dev_addr = page_to_phys(page) + offset;
  36.600 +	if (address_needs_mapping(hwdev, dev_addr)) {
  36.601 +		buffer.page   = page;
  36.602 +		buffer.offset = offset;
  36.603 +		map = map_single(hwdev, buffer, size, direction);
  36.604 +		if (!map) {
  36.605 +			swiotlb_full(hwdev, size, direction, 1);
  36.606 +			map = io_tlb_overflow_buffer;
  36.607 +		}
  36.608 +		dev_addr = (dma_addr_t)virt_to_bus(map);
  36.609 +	}
  36.610 +
  36.611 +	return dev_addr;
  36.612 +}
  36.613 +
  36.614 +void
  36.615 +swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address,
  36.616 +		   size_t size, enum dma_data_direction direction)
  36.617 +{
  36.618 +	BUG_ON(direction == DMA_NONE);
  36.619 +	if (in_swiotlb_aperture(dma_address))
  36.620 +		unmap_single(hwdev, bus_to_virt(dma_address), size, direction);
  36.621 +}
  36.622 +
  36.623 +int
  36.624 +swiotlb_dma_mapping_error(dma_addr_t dma_addr)
  36.625 +{
  36.626 +	return (dma_addr == virt_to_bus(io_tlb_overflow_buffer));
  36.627 +}
  36.628 +
  36.629 +/*
  36.630 + * Return whether the given PCI device DMA address mask can be supported
  36.631 + * properly.  For example, if your device can only drive the low 24-bits
  36.632 + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to
  36.633 + * this function.
  36.634 + */
  36.635 +int
  36.636 +swiotlb_dma_supported (struct device *hwdev, u64 mask)
  36.637 +{
  36.638 +	return (mask >= 0xffffffffUL);
  36.639 +}
  36.640 +
  36.641 +EXPORT_SYMBOL(swiotlb_init);
  36.642 +EXPORT_SYMBOL(swiotlb_map_single);
  36.643 +EXPORT_SYMBOL(swiotlb_unmap_single);
  36.644 +EXPORT_SYMBOL(swiotlb_map_sg);
  36.645 +EXPORT_SYMBOL(swiotlb_unmap_sg);
  36.646 +EXPORT_SYMBOL(swiotlb_sync_single_for_cpu);
  36.647 +EXPORT_SYMBOL(swiotlb_sync_single_for_device);
  36.648 +EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu);
  36.649 +EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
  36.650 +EXPORT_SYMBOL(swiotlb_map_page);
  36.651 +EXPORT_SYMBOL(swiotlb_unmap_page);
  36.652 +EXPORT_SYMBOL(swiotlb_dma_mapping_error);
  36.653 +EXPORT_SYMBOL(swiotlb_dma_supported);
  36.654 +
  36.655 +/*
  36.656 + * Local variables:
  36.657 + *  c-file-style: "linux"
  36.658 + *  indent-tabs-mode: t
  36.659 + *  c-indent-level: 8
  36.660 + *  c-basic-offset: 8
  36.661 + *  tab-width: 8
  36.662 + * End:
  36.663 + */
    37.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Tue Aug 23 18:43:18 2005 -0800
    37.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Thu Aug 25 15:53:20 2005 -0700
    37.3 @@ -70,6 +70,8 @@
    37.4  
    37.5  #include "io_ports.h"
    37.6  
    37.7 +#include <asm-xen/evtchn.h>
    37.8 +
    37.9  extern spinlock_t i8259A_lock;
   37.10  int pit_latch_buggy;              /* extern */
   37.11  
   37.12 @@ -113,26 +115,15 @@ struct shadow_time_info {
   37.13  	u32 version;
   37.14  };
   37.15  static DEFINE_PER_CPU(struct shadow_time_info, shadow_time);
   37.16 -static struct timeval shadow_tv;
   37.17 +static struct timespec shadow_tv;
   37.18 +static u32 shadow_tv_version;
   37.19  
   37.20  /* Keep track of last time we did processing/updating of jiffies and xtime. */
   37.21  static u64 processed_system_time;   /* System time (ns) at last processing. */
   37.22  static DEFINE_PER_CPU(u64, processed_system_time);
   37.23  
   37.24 -#define NS_PER_TICK (1000000000ULL/HZ)
   37.25 +#define NS_PER_TICK (1000000000L/HZ)
   37.26  
   37.27 -#define HANDLE_USEC_UNDERFLOW(_tv) do {		\
   37.28 -	while ((_tv).tv_usec < 0) {		\
   37.29 -		(_tv).tv_usec += USEC_PER_SEC;	\
   37.30 -		(_tv).tv_sec--;			\
   37.31 -	}					\
   37.32 -} while (0)
   37.33 -#define HANDLE_USEC_OVERFLOW(_tv) do {		\
   37.34 -	while ((_tv).tv_usec >= USEC_PER_SEC) {	\
   37.35 -		(_tv).tv_usec -= USEC_PER_SEC;	\
   37.36 -		(_tv).tv_sec++;			\
   37.37 -	}					\
   37.38 -} while (0)
   37.39  static inline void __normalize_time(time_t *sec, s64 *nsec)
   37.40  {
   37.41  	while (*nsec >= NSEC_PER_SEC) {
   37.42 @@ -153,8 +144,6 @@ static int __init __independent_wallcloc
   37.43  	return 1;
   37.44  }
   37.45  __setup("independent_wallclock", __independent_wallclock);
   37.46 -#define INDEPENDENT_WALLCLOCK() \
   37.47 -    (independent_wallclock || (xen_start_info.flags & SIF_INITDOMAIN))
   37.48  
   37.49  int tsc_disable __initdata = 0;
   37.50  
   37.51 @@ -175,25 +164,40 @@ struct timer_opts timer_tsc = {
   37.52  	.delay = delay_tsc,
   37.53  };
   37.54  
   37.55 -static inline u32 down_shift(u64 time, int shift)
   37.56 -{
   37.57 -	if ( shift < 0 )
   37.58 -		return (u32)(time >> -shift);
   37.59 -	return (u32)((u32)time << shift);
   37.60 -}
   37.61 -
   37.62  /*
   37.63 - * 32-bit multiplication of integer multiplicand and fractional multiplier
   37.64 - * yielding 32-bit integer product.
   37.65 + * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
   37.66 + * yielding a 64-bit result.
   37.67   */
   37.68 -static inline u32 mul_frac(u32 multiplicand, u32 multiplier)
   37.69 +static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
   37.70  {
   37.71 -	u32 product_int, product_frac;
   37.72 +	u64 product;
   37.73 +#ifdef __i386__
   37.74 +	u32 tmp1, tmp2;
   37.75 +#endif
   37.76 +
   37.77 +	if ( shift < 0 )
   37.78 +		delta >>= -shift;
   37.79 +	else
   37.80 +		delta <<= shift;
   37.81 +
   37.82 +#ifdef __i386__
   37.83  	__asm__ (
   37.84 -		"mul %3"
   37.85 -		: "=a" (product_frac), "=d" (product_int)
   37.86 -		: "0" (multiplicand), "r" (multiplier) );
   37.87 -	return product_int;
   37.88 +		"mul  %5       ; "
   37.89 +		"mov  %4,%%eax ; "
   37.90 +		"mov  %%edx,%4 ; "
   37.91 +		"mul  %5       ; "
   37.92 +		"add  %4,%%eax ; "
   37.93 +		"xor  %5,%5    ; "
   37.94 +		"adc  %5,%%edx ; "
   37.95 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
   37.96 +		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
   37.97 +#else
   37.98 +	__asm__ (
   37.99 +		"mul %%rdx ; shrd $32,%%rdx,%%rax"
  37.100 +		: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
  37.101 +#endif
  37.102 +
  37.103 +	return product;
  37.104  }
  37.105  
  37.106  void init_cpu_khz(void)
  37.107 @@ -201,55 +205,43 @@ void init_cpu_khz(void)
  37.108  	u64 __cpu_khz = 1000000ULL << 32;
  37.109  	struct vcpu_time_info *info = &HYPERVISOR_shared_info->vcpu_time[0];
  37.110  	do_div(__cpu_khz, info->tsc_to_system_mul);
  37.111 -	cpu_khz = down_shift(__cpu_khz, -info->tsc_shift);
  37.112 -	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n",
  37.113 -	       cpu_khz / 1000, cpu_khz % 1000);
  37.114 +	if ( info->tsc_shift < 0 )
  37.115 +		cpu_khz = __cpu_khz << -info->tsc_shift;
  37.116 +	else
  37.117 +		cpu_khz = __cpu_khz >> info->tsc_shift;
  37.118  }
  37.119  
  37.120  static u64 get_nsec_offset(struct shadow_time_info *shadow)
  37.121  {
  37.122 -	u64 now;
  37.123 -	u32 delta;
  37.124 +	u64 now, delta;
  37.125  	rdtscll(now);
  37.126 -	delta = down_shift(now - shadow->tsc_timestamp, shadow->tsc_shift);
  37.127 -	return mul_frac(delta, shadow->tsc_to_nsec_mul);
  37.128 +	delta = now - shadow->tsc_timestamp;
  37.129 +	return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
  37.130  }
  37.131  
  37.132  static unsigned long get_usec_offset(struct shadow_time_info *shadow)
  37.133  {
  37.134 -	u64 now;
  37.135 -	u32 delta;
  37.136 +	u64 now, delta;
  37.137  	rdtscll(now);
  37.138 -	delta = down_shift(now - shadow->tsc_timestamp, shadow->tsc_shift);
  37.139 -	return mul_frac(delta, shadow->tsc_to_usec_mul);
  37.140 +	delta = now - shadow->tsc_timestamp;
  37.141 +	return scale_delta(delta, shadow->tsc_to_usec_mul, shadow->tsc_shift);
  37.142  }
  37.143  
  37.144 -static void update_wallclock(void)
  37.145 +static void __update_wallclock(time_t sec, long nsec)
  37.146  {
  37.147 -	shared_info_t *s = HYPERVISOR_shared_info;
  37.148  	long wtm_nsec, xtime_nsec;
  37.149  	time_t wtm_sec, xtime_sec;
  37.150 -	u64 tmp, usec;
  37.151 -
  37.152 -	shadow_tv.tv_sec  = s->wc_sec;
  37.153 -	shadow_tv.tv_usec = s->wc_usec;
  37.154 -
  37.155 -	if (INDEPENDENT_WALLCLOCK())
  37.156 -		return;
  37.157 -
  37.158 -	if ((time_status & STA_UNSYNC) != 0)
  37.159 -		return;
  37.160 +	u64 tmp, wc_nsec;
  37.161  
  37.162  	/* Adjust wall-clock time base based on wall_jiffies ticks. */
  37.163 -	usec = processed_system_time;
  37.164 -	do_div(usec, 1000);
  37.165 -	usec += (u64)shadow_tv.tv_sec * 1000000ULL;
  37.166 -	usec += (u64)shadow_tv.tv_usec;
  37.167 -	usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
  37.168 +	wc_nsec = processed_system_time;
  37.169 +	wc_nsec += (u64)sec * 1000000000ULL;
  37.170 +	wc_nsec += (u64)nsec;
  37.171 +	wc_nsec -= (jiffies - wall_jiffies) * (u64)(NSEC_PER_SEC / HZ);
  37.172  
  37.173  	/* Split wallclock base into seconds and nanoseconds. */
  37.174 -	tmp = usec;
  37.175 -	xtime_nsec = do_div(tmp, 1000000) * 1000ULL;
  37.176 +	tmp = wc_nsec;
  37.177 +	xtime_nsec = do_div(tmp, 1000000000);
  37.178  	xtime_sec  = (time_t)tmp;
  37.179  
  37.180  	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - xtime_sec);
  37.181 @@ -257,13 +249,35 @@ static void update_wallclock(void)
  37.182  
  37.183  	set_normalized_timespec(&xtime, xtime_sec, xtime_nsec);
  37.184  	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
  37.185 +
  37.186 +	time_adjust = 0;		/* stop active adjtime() */
  37.187 +	time_status |= STA_UNSYNC;
  37.188 +	time_maxerror = NTP_PHASE_LIMIT;
  37.189 +	time_esterror = NTP_PHASE_LIMIT;
  37.190 +}
  37.191 +
  37.192 +static void update_wallclock(void)
  37.193 +{
  37.194 +	shared_info_t *s = HYPERVISOR_shared_info;
  37.195 +
  37.196 +	do {
  37.197 +		shadow_tv_version = s->wc_version;
  37.198 +		rmb();
  37.199 +		shadow_tv.tv_sec  = s->wc_sec;
  37.200 +		shadow_tv.tv_nsec = s->wc_nsec;
  37.201 +		rmb();
  37.202 +	}
  37.203 +	while ((s->wc_version & 1) | (shadow_tv_version ^ s->wc_version));
  37.204 +
  37.205 +	if (!independent_wallclock)
  37.206 +		__update_wallclock(shadow_tv.tv_sec, shadow_tv.tv_nsec);
  37.207  }
  37.208  
  37.209  /*
  37.210   * Reads a consistent set of time-base values from Xen, into a shadow data
  37.211 - * area. Must be called with the xtime_lock held for writing.
  37.212 + * area.
  37.213   */
  37.214 -static void __get_time_values_from_xen(void)
  37.215 +static void get_time_values_from_xen(void)
  37.216  {
  37.217  	shared_info_t           *s = HYPERVISOR_shared_info;
  37.218  	struct vcpu_time_info   *src;
  37.219 @@ -273,7 +287,7 @@ static void __get_time_values_from_xen(v
  37.220  	dst = &per_cpu(shadow_time, smp_processor_id());
  37.221  
  37.222  	do {
  37.223 -		dst->version = src->time_version2;
  37.224 +		dst->version = src->version;
  37.225  		rmb();
  37.226  		dst->tsc_timestamp     = src->tsc_timestamp;
  37.227  		dst->system_timestamp  = src->system_time;
  37.228 @@ -281,13 +295,9 @@ static void __get_time_values_from_xen(v
  37.229  		dst->tsc_shift         = src->tsc_shift;
  37.230  		rmb();
  37.231  	}
  37.232 -	while (dst->version != src->time_version1);
  37.233 +	while ((src->version & 1) | (dst->version ^ src->version));
  37.234  
  37.235  	dst->tsc_to_usec_mul = dst->tsc_to_nsec_mul / 1000;
  37.236 -
  37.237 -	if ((shadow_tv.tv_sec != s->wc_sec) ||
  37.238 -	    (shadow_tv.tv_usec != s->wc_usec))
  37.239 -		update_wallclock();
  37.240  }
  37.241  
  37.242  static inline int time_values_up_to_date(int cpu)
  37.243 @@ -298,7 +308,7 @@ static inline int time_values_up_to_date
  37.244  	src = &HYPERVISOR_shared_info->vcpu_time[cpu]; 
  37.245  	dst = &per_cpu(shadow_time, cpu); 
  37.246  
  37.247 -	return (dst->version == src->time_version2);
  37.248 +	return (dst->version == src->version);
  37.249  }
  37.250  
  37.251  /*
  37.252 @@ -339,10 +349,10 @@ void do_gettimeofday(struct timeval *tv)
  37.253  	unsigned long seq;
  37.254  	unsigned long usec, sec;
  37.255  	unsigned long max_ntp_tick;
  37.256 -	unsigned long flags;
  37.257  	s64 nsec;
  37.258  	unsigned int cpu;
  37.259  	struct shadow_time_info *shadow;
  37.260 +	u32 local_time_version;
  37.261  
  37.262  	cpu = get_cpu();
  37.263  	shadow = &per_cpu(shadow_time, cpu);
  37.264 @@ -350,6 +360,7 @@ void do_gettimeofday(struct timeval *tv)
  37.265  	do {
  37.266  		unsigned long lost;
  37.267  
  37.268 +		local_time_version = shadow->version;
  37.269  		seq = read_seqbegin(&xtime_lock);
  37.270  
  37.271  		usec = get_usec_offset(shadow);
  37.272 @@ -385,12 +396,11 @@ void do_gettimeofday(struct timeval *tv)
  37.273  			 * overflowed). Detect that and recalculate
  37.274  			 * with fresh values.
  37.275  			 */
  37.276 -			write_seqlock_irqsave(&xtime_lock, flags);
  37.277 -			__get_time_values_from_xen();
  37.278 -			write_sequnlock_irqrestore(&xtime_lock, flags);
  37.279 +			get_time_values_from_xen();
  37.280  			continue;
  37.281  		}
  37.282 -	} while (read_seqretry(&xtime_lock, seq));
  37.283 +	} while (read_seqretry(&xtime_lock, seq) ||
  37.284 +		 (local_time_version != shadow->version));
  37.285  
  37.286  	put_cpu();
  37.287  
  37.288 @@ -407,19 +417,15 @@ EXPORT_SYMBOL(do_gettimeofday);
  37.289  
  37.290  int do_settimeofday(struct timespec *tv)
  37.291  {
  37.292 -	time_t wtm_sec, sec = tv->tv_sec;
  37.293 -	long wtm_nsec;
  37.294 +	time_t sec;
  37.295  	s64 nsec;
  37.296 -	struct timespec xentime;
  37.297  	unsigned int cpu;
  37.298  	struct shadow_time_info *shadow;
  37.299 +	dom0_op_t op;
  37.300  
  37.301  	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
  37.302  		return -EINVAL;
  37.303  
  37.304 -	if (!INDEPENDENT_WALLCLOCK())
  37.305 -		return 0; /* Silent failure? */
  37.306 -
  37.307  	cpu = get_cpu();
  37.308  	shadow = &per_cpu(shadow_time, cpu);
  37.309  
  37.310 @@ -430,50 +436,30 @@ int do_settimeofday(struct timespec *tv)
  37.311  	 * overflows. If that were to happen then our shadow time values would
  37.312  	 * be stale, so we can retry with fresh ones.
  37.313  	 */
  37.314 - again:
  37.315 -	nsec = (s64)tv->tv_nsec - (s64)get_nsec_offset(shadow);
  37.316 -	if (unlikely(!time_values_up_to_date(cpu))) {
  37.317 -		__get_time_values_from_xen();
  37.318 -		goto again;
  37.319 +	for ( ; ; ) {
  37.320 +		nsec = (s64)tv->tv_nsec - (s64)get_nsec_offset(shadow);
  37.321 +		if (time_values_up_to_date(cpu))
  37.322 +			break;
  37.323 +		get_time_values_from_xen();
  37.324 +	}
  37.325 +	sec = tv->tv_sec;
  37.326 +	__normalize_time(&sec, &nsec);
  37.327 +
  37.328 +	if ((xen_start_info.flags & SIF_INITDOMAIN) &&
  37.329 +	    !independent_wallclock) {
  37.330 +		op.cmd = DOM0_SETTIME;
  37.331 +		op.u.settime.secs        = sec;
  37.332 +		op.u.settime.nsecs       = nsec;
  37.333 +		op.u.settime.system_time = shadow->system_timestamp;
  37.334 +		HYPERVISOR_dom0_op(&op);
  37.335 +		update_wallclock();
  37.336 +	} else if (independent_wallclock) {
  37.337 +		nsec -= shadow->system_timestamp;
  37.338 +		__normalize_time(&sec, &nsec);
  37.339 +		__update_wallclock(sec, nsec);
  37.340  	}
  37.341  
  37.342 -	__normalize_time(&sec, &nsec);
  37.343 -	set_normalized_timespec(&xentime, sec, nsec);
  37.344 -
  37.345 -	/*
  37.346 -	 * This is revolting. We need to set "xtime" correctly. However, the
  37.347 -	 * value in this location is the value at the most recent update of
  37.348 -	 * wall time.  Discover what correction gettimeofday() would have
  37.349 -	 * made, and then undo it!
  37.350 -	 */
  37.351 -	nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
  37.352 -
  37.353 -	nsec -= (shadow->system_timestamp - processed_system_time);
  37.354 -
  37.355 -	__normalize_time(&sec, &nsec);
  37.356 -	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
  37.357 -	wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
  37.358 -
  37.359 -	set_normalized_timespec(&xtime, sec, nsec);
  37.360 -	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
  37.361 -
  37.362 -	time_adjust = 0;		/* stop active adjtime() */
  37.363 -	time_status |= STA_UNSYNC;
  37.364 -	time_maxerror = NTP_PHASE_LIMIT;
  37.365 -	time_esterror = NTP_PHASE_LIMIT;
  37.366 -
  37.367 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  37.368 -	if (xen_start_info.flags & SIF_INITDOMAIN) {
  37.369 -		dom0_op_t op;
  37.370 -		op.cmd = DOM0_SETTIME;
  37.371 -		op.u.settime.secs        = xentime.tv_sec;
  37.372 -		op.u.settime.usecs       = xentime.tv_nsec / NSEC_PER_USEC;
  37.373 -		op.u.settime.system_time = shadow->system_timestamp;
  37.374 -		write_sequnlock_irq(&xtime_lock);
  37.375 -		HYPERVISOR_dom0_op(&op);
  37.376 -	} else
  37.377 -#endif
  37.378 -		write_sequnlock_irq(&xtime_lock);
  37.379 +	write_sequnlock_irq(&xtime_lock);
  37.380  
  37.381  	put_cpu();
  37.382  
  37.383 @@ -490,6 +476,9 @@ static int set_rtc_mmss(unsigned long no
  37.384  
  37.385  	WARN_ON(irqs_disabled());
  37.386  
  37.387 +	if (!(xen_start_info.flags & SIF_INITDOMAIN))
  37.388 +		return 0;
  37.389 +
  37.390  	/* gets recalled with irq locally disabled */
  37.391  	spin_lock_irq(&rtc_lock);
  37.392  	if (efi_enabled)
  37.393 @@ -515,21 +504,21 @@ unsigned long long monotonic_clock(void)
  37.394  {
  37.395  	int cpu = get_cpu();
  37.396  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
  37.397 -	s64 off;
  37.398 -	unsigned long flags;
  37.399 -	
  37.400 -	for ( ; ; ) {
  37.401 -		off = get_nsec_offset(shadow);
  37.402 -		if (time_values_up_to_date(cpu))
  37.403 -			break;
  37.404 -		write_seqlock_irqsave(&xtime_lock, flags);
  37.405 -		__get_time_values_from_xen();
  37.406 -		write_sequnlock_irqrestore(&xtime_lock, flags);
  37.407 -	}
  37.408 +	u64 time;
  37.409 +	u32 local_time_version;
  37.410 +
  37.411 +	do {
  37.412 +		local_time_version = shadow->version;
  37.413 +		smp_rmb();
  37.414 +		time = shadow->system_timestamp + get_nsec_offset(shadow);
  37.415 +		if (!time_values_up_to_date(cpu))
  37.416 +			get_time_values_from_xen();
  37.417 +		smp_rmb();
  37.418 +	} while (local_time_version != shadow->version);
  37.419  
  37.420  	put_cpu();
  37.421  
  37.422 -	return shadow->system_timestamp + off;
  37.423 +	return time;
  37.424  }
  37.425  EXPORT_SYMBOL(monotonic_clock);
  37.426  
  37.427 @@ -551,19 +540,16 @@ unsigned long profile_pc(struct pt_regs 
  37.428  EXPORT_SYMBOL(profile_pc);
  37.429  #endif
  37.430  
  37.431 -/*
  37.432 - * timer_interrupt() needs to keep up the real-time clock,
  37.433 - * as well as call the "do_timer()" routine every clocktick
  37.434 - */
  37.435 -static inline void do_timer_interrupt(int irq, void *dev_id,
  37.436 -					struct pt_regs *regs)
  37.437 +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  37.438  {
  37.439  	s64 delta, delta_cpu;
  37.440  	int cpu = smp_processor_id();
  37.441  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
  37.442  
  37.443 +	write_seqlock(&xtime_lock);
  37.444 +
  37.445  	do {
  37.446 -		__get_time_values_from_xen();
  37.447 +		get_time_values_from_xen();
  37.448  
  37.449  		delta = delta_cpu = 
  37.450  			shadow->system_timestamp + get_nsec_offset(shadow);
  37.451 @@ -572,7 +558,7 @@ static inline void do_timer_interrupt(in
  37.452  	}
  37.453  	while (!time_values_up_to_date(cpu));
  37.454  
  37.455 -	if (unlikely(delta < 0) || unlikely(delta_cpu < 0)) {
  37.456 +	if (unlikely(delta < (s64)-1000000) || unlikely(delta_cpu < 0)) {
  37.457  		printk("Timer ISR/%d: Time went backwards: "
  37.458  		       "delta=%lld cpu_delta=%lld shadow=%lld "
  37.459  		       "off=%lld processed=%lld cpu_processed=%lld\n",
  37.460 @@ -583,7 +569,6 @@ static inline void do_timer_interrupt(in
  37.461  		for (cpu = 0; cpu < num_online_cpus(); cpu++)
  37.462  			printk(" %d: %lld\n", cpu,
  37.463  			       per_cpu(processed_system_time, cpu));
  37.464 -		return;
  37.465  	}
  37.466  
  37.467  	/* System-wide jiffy work. */
  37.468 @@ -593,32 +578,25 @@ static inline void do_timer_interrupt(in
  37.469  		do_timer(regs);
  37.470  	}
  37.471  
  37.472 -	/* Local CPU jiffy work. */
  37.473 +	if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) {
  37.474 +		update_wallclock();
  37.475 +		clock_was_set();
  37.476 +	}
  37.477 +
  37.478 +	write_sequnlock(&xtime_lock);
  37.479 +
  37.480 +	/*
  37.481 +         * Local CPU jiffy work. No need to hold xtime_lock, and I'm not sure
  37.482 +         * if there is risk of deadlock if we do (since update_process_times
  37.483 +         * may do scheduler rebalancing work and thus acquire runqueue locks).
  37.484 +         */
  37.485  	while (delta_cpu >= NS_PER_TICK) {
  37.486  		delta_cpu -= NS_PER_TICK;
  37.487  		per_cpu(processed_system_time, cpu) += NS_PER_TICK;
  37.488  		update_process_times(user_mode(regs));
  37.489  		profile_tick(CPU_PROFILING, regs);
  37.490  	}
  37.491 -}
  37.492  
  37.493 -/*
  37.494 - * This is the same as the above, except we _also_ save the current
  37.495 - * Time Stamp Counter value at the time of the timer interrupt, so that
  37.496 - * we later on can estimate the time of day more exactly.
  37.497 - */
  37.498 -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  37.499 -{
  37.500 -	/*
  37.501 -	 * Here we are in the timer irq handler. We just have irqs locally
  37.502 -	 * disabled but we don't know if the timer_bh is running on the other
  37.503 -	 * CPU. We need to avoid to SMP race with it. NOTE: we don' t need
  37.504 -	 * the irq version of write_lock because as just said we have irq
  37.505 -	 * locally disabled. -arca
  37.506 -	 */
  37.507 -	write_seqlock(&xtime_lock);
  37.508 -	do_timer_interrupt(irq, NULL, regs);
  37.509 -	write_sequnlock(&xtime_lock);
  37.510  	return IRQ_HANDLED;
  37.511  }
  37.512  
  37.513 @@ -767,7 +745,7 @@ static void __init hpet_time_init(void)
  37.514  #endif
  37.515  
  37.516  /* Dynamically-mapped IRQ. */
  37.517 -static DEFINE_PER_CPU(int, timer_irq);
  37.518 +DEFINE_PER_CPU(int, timer_irq);
  37.519  
  37.520  static struct irqaction irq_timer = {
  37.521  	timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer0",
  37.522 @@ -786,15 +764,16 @@ void __init time_init(void)
  37.523  		return;
  37.524  	}
  37.525  #endif
  37.526 -	__get_time_values_from_xen();
  37.527 -	xtime.tv_sec = shadow_tv.tv_sec;
  37.528 -	xtime.tv_nsec = shadow_tv.tv_usec * NSEC_PER_USEC;
  37.529 -	set_normalized_timespec(&wall_to_monotonic,
  37.530 -		-xtime.tv_sec, -xtime.tv_nsec);
  37.531 +	get_time_values_from_xen();
  37.532 +
  37.533  	processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
  37.534  	per_cpu(processed_system_time, 0) = processed_system_time;
  37.535  
  37.536 +	update_wallclock();
  37.537 +
  37.538  	init_cpu_khz();
  37.539 +	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n",
  37.540 +	       cpu_khz / 1000, cpu_khz % 1000);
  37.541  
  37.542  #if defined(__x86_64__)
  37.543  	vxtime.mode = VXTIME_TSC;
  37.544 @@ -860,6 +839,8 @@ void start_hz_timer(void)
  37.545  void time_suspend(void)
  37.546  {
  37.547  	/* nothing */
  37.548 +	teardown_irq(per_cpu(timer_irq, 0), &irq_timer);
  37.549 +	unbind_virq_from_irq(VIRQ_TIMER);
  37.550  }
  37.551  
  37.552  /* No locking required. We are only CPU running, and interrupts are off. */
  37.553 @@ -867,17 +848,31 @@ void time_resume(void)
  37.554  {
  37.555  	init_cpu_khz();
  37.556  
  37.557 -	/* Get timebases for new environment. */ 
  37.558 -	__get_time_values_from_xen();
  37.559 +	get_time_values_from_xen();
  37.560  
  37.561 -	/* Reset our own concept of passage of system time. */
  37.562 -	processed_system_time =
  37.563 -		per_cpu(shadow_time, smp_processor_id()).system_timestamp;
  37.564 +	processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
  37.565  	per_cpu(processed_system_time, 0) = processed_system_time;
  37.566 +
  37.567 +	update_wallclock();
  37.568 +
  37.569 +	per_cpu(timer_irq, 0) = bind_virq_to_irq(VIRQ_TIMER);
  37.570 +	(void)setup_irq(per_cpu(timer_irq, 0), &irq_timer);
  37.571  }
  37.572  
  37.573  #ifdef CONFIG_SMP
  37.574  static char timer_name[NR_CPUS][15];
  37.575 +void local_setup_timer_irq(void)
  37.576 +{
  37.577 +	int cpu = smp_processor_id();
  37.578 +
  37.579 +	if (cpu == 0)
  37.580 +		return;
  37.581 +	per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
  37.582 +	sprintf(timer_name[cpu], "timer%d", cpu);
  37.583 +	BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
  37.584 +	                   SA_INTERRUPT, timer_name[cpu], NULL));
  37.585 +}
  37.586 +
  37.587  void local_setup_timer(void)
  37.588  {
  37.589  	int seq, cpu = smp_processor_id();
  37.590 @@ -888,10 +883,17 @@ void local_setup_timer(void)
  37.591  			per_cpu(shadow_time, cpu).system_timestamp;
  37.592  	} while (read_seqretry(&xtime_lock, seq));
  37.593  
  37.594 -	per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
  37.595 -	sprintf(timer_name[cpu], "timer%d", cpu);
  37.596 -	BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
  37.597 -	                   SA_INTERRUPT, timer_name[cpu], NULL));
  37.598 +	local_setup_timer_irq();
  37.599 +}
  37.600 +
  37.601 +void local_teardown_timer_irq(void)
  37.602 +{
  37.603 +	int cpu = smp_processor_id();
  37.604 +
  37.605 +	if (cpu == 0)
  37.606 +		return;
  37.607 +	free_irq(per_cpu(timer_irq, cpu), NULL);
  37.608 +	unbind_virq_from_irq(VIRQ_TIMER);
  37.609  }
  37.610  #endif
  37.611  
    38.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/timers/Makefile	Tue Aug 23 18:43:18 2005 -0800
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,17 +0,0 @@
    38.4 -#
    38.5 -# Makefile for x86 timers
    38.6 -#
    38.7 -
    38.8 -XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
    38.9 -
   38.10 -obj-y :=	timer_tsc.o
   38.11 -c-obj-y :=
   38.12 -
   38.13 -c-link	:=
   38.14 -
   38.15 -$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
   38.16 -	@ln -fsn $(srctree)/arch/i386/kernel/timers/$(notdir $@) $@
   38.17 -
   38.18 -obj-y	+= $(c-obj-y)
   38.19 -
   38.20 -clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
    39.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c	Tue Aug 23 18:43:18 2005 -0800
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,379 +0,0 @@
    39.4 -/*
    39.5 - * This code largely moved from arch/i386/kernel/time.c.
    39.6 - * See comments there for proper credits.
    39.7 - */
    39.8 -
    39.9 -#include <linux/spinlock.h>
   39.10 -#include <linux/init.h>
   39.11 -#include <linux/timex.h>
   39.12 -#include <linux/errno.h>
   39.13 -#include <linux/cpufreq.h>
   39.14 -#include <linux/string.h>
   39.15 -#include <linux/jiffies.h>
   39.16 -
   39.17 -#include <asm/timer.h>
   39.18 -#include <asm/io.h>
   39.19 -/* processor.h for distable_tsc flag */
   39.20 -#include <asm/processor.h>
   39.21 -
   39.22 -#include "io_ports.h"
   39.23 -#include "mach_timer.h"
   39.24 -
   39.25 -#include <asm/hpet.h>
   39.26 -
   39.27 -#ifdef CONFIG_HPET_TIMER
   39.28 -static unsigned long hpet_usec_quotient;
   39.29 -static unsigned long hpet_last;
   39.30 -static struct timer_opts timer_tsc;
   39.31 -#endif
   39.32 -
   39.33 -static inline void cpufreq_delayed_get(void);
   39.34 -
   39.35 -int tsc_disable __initdata = 0;
   39.36 -
   39.37 -extern spinlock_t i8253_lock;
   39.38 -
   39.39 -static int use_tsc;
   39.40 -
   39.41 -static unsigned long long monotonic_base;
   39.42 -static u32 monotonic_offset;
   39.43 -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
   39.44 -
   39.45 -/* convert from cycles(64bits) => nanoseconds (64bits)
   39.46 - *  basic equation:
   39.47 - *		ns = cycles / (freq / ns_per_sec)
   39.48 - *		ns = cycles * (ns_per_sec / freq)
   39.49 - *		ns = cycles * (10^9 / (cpu_mhz * 10^6))
   39.50 - *		ns = cycles * (10^3 / cpu_mhz)
   39.51 - *
   39.52 - *	Then we use scaling math (suggested by george@mvista.com) to get:
   39.53 - *		ns = cycles * (10^3 * SC / cpu_mhz) / SC
   39.54 - *		ns = cycles * cyc2ns_scale / SC
   39.55 - *
   39.56 - *	And since SC is a constant power of two, we can convert the div
   39.57 - *  into a shift.   
   39.58 - *			-johnstul@us.ibm.com "math is hard, lets go shopping!"
   39.59 - */
   39.60 -static unsigned long cyc2ns_scale; 
   39.61 -#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
   39.62 -
   39.63 -static inline void set_cyc2ns_scale(unsigned long cpu_mhz)
   39.64 -{
   39.65 -	cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
   39.66 -}
   39.67 -
   39.68 -static inline unsigned long long cycles_2_ns(unsigned long long cyc)
   39.69 -{
   39.70 -	return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
   39.71 -}
   39.72 -
   39.73 -/* Cached *multiplier* to convert TSC counts to microseconds.
   39.74 - * (see the equation below).
   39.75 - * Equal to 2^32 * (1 / (clocks per usec) ).
   39.76 - * Initialized in time_init.
   39.77 - */
   39.78 -static unsigned long fast_gettimeoffset_quotient;
   39.79 -
   39.80 -extern u32 shadow_tsc_stamp;
   39.81 -extern u64 shadow_system_time;
   39.82 -
   39.83 -static unsigned long get_offset_tsc(void)
   39.84 -{
   39.85 -	register unsigned long eax, edx;
   39.86 -
   39.87 -	/* Read the Time Stamp Counter */
   39.88 -
   39.89 -	rdtsc(eax,edx);
   39.90 -
   39.91 -	/* .. relative to previous jiffy (32 bits is enough) */
   39.92 -	eax -= shadow_tsc_stamp;
   39.93 -
   39.94 -	/*
   39.95 -         * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient
   39.96 -         *             = (tsc_low delta) * (usecs_per_clock)
   39.97 -         *             = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy)
   39.98 -	 *
   39.99 -	 * Using a mull instead of a divl saves up to 31 clock cycles
  39.100 -	 * in the critical path.
  39.101 -         */
  39.102 -
  39.103 -	__asm__("mull %2"
  39.104 -		:"=a" (eax), "=d" (edx)
  39.105 -		:"rm" (fast_gettimeoffset_quotient),
  39.106 -		 "0" (eax));
  39.107 -
  39.108 -	/* our adjusted time offset in microseconds */
  39.109 -	return edx;
  39.110 -}
  39.111 -
  39.112 -static unsigned long long monotonic_clock_tsc(void)
  39.113 -{
  39.114 -	unsigned long long last_offset, this_offset, base;
  39.115 -	unsigned seq;
  39.116 -	
  39.117 -	/* atomically read monotonic base & last_offset */
  39.118 -	do {
  39.119 -		seq = read_seqbegin(&monotonic_lock);
  39.120 -		last_offset = monotonic_offset;
  39.121 -		base = monotonic_base;
  39.122 -	} while (read_seqretry(&monotonic_lock, seq));
  39.123 -
  39.124 -	/* Read the Time Stamp Counter */
  39.125 -	rdtscll(this_offset);
  39.126 -
  39.127 -	/* return the value in ns */
  39.128 -	return base + cycles_2_ns(this_offset - last_offset);
  39.129 -}
  39.130 -
  39.131 -/*
  39.132 - * Scheduler clock - returns current time in nanosec units.
  39.133 - */
  39.134 -unsigned long long sched_clock(void)
  39.135 -{
  39.136 -	unsigned long long this_offset;
  39.137 -
  39.138 -	/*
  39.139 -	 * In the NUMA case we dont use the TSC as they are not
  39.140 -	 * synchronized across all CPUs.
  39.141 -	 */
  39.142 -#ifndef CONFIG_NUMA
  39.143 -	if (!use_tsc)
  39.144 -#endif
  39.145 -		/* no locking but a rare wrong value is not a big deal */
  39.146 -		return jiffies_64 * (1000000000 / HZ);
  39.147 -
  39.148 -	/* Read the Time Stamp Counter */
  39.149 -	rdtscll(this_offset);
  39.150 -
  39.151 -	/* return the value in ns */
  39.152 -	return cycles_2_ns(this_offset);
  39.153 -}
  39.154 -
  39.155 -
  39.156 -static void mark_offset_tsc(void)
  39.157 -{
  39.158 -
  39.159 -	/* update the monotonic base value */
  39.160 -	write_seqlock(&monotonic_lock);
  39.161 -	monotonic_base = shadow_system_time;
  39.162 -	monotonic_offset = shadow_tsc_stamp;
  39.163 -	write_sequnlock(&monotonic_lock);
  39.164 -}
  39.165 -
  39.166 -static void delay_tsc(unsigned long loops)
  39.167 -{
  39.168 -	unsigned long bclock, now;
  39.169 -	
  39.170 -	rdtscl(bclock);
  39.171 -	do
  39.172 -	{
  39.173 -		rep_nop();
  39.174 -		rdtscl(now);
  39.175 -	} while ((now-bclock) < loops);
  39.176 -}
  39.177 -
  39.178 -#ifdef CONFIG_HPET_TIMER
  39.179 -static void mark_offset_tsc_hpet(void)
  39.180 -{
  39.181 -	unsigned long long this_offset, last_offset;
  39.182 - 	unsigned long offset, temp, hpet_current;
  39.183 -
  39.184 -	write_seqlock(&monotonic_lock);
  39.185 -	last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
  39.186 -	/*
  39.187 -	 * It is important that these two operations happen almost at
  39.188 -	 * the same time. We do the RDTSC stuff first, since it's
  39.189 -	 * faster. To avoid any inconsistencies, we need interrupts
  39.190 -	 * disabled locally.
  39.191 -	 */
  39.192 -	/*
  39.193 -	 * Interrupts are just disabled locally since the timer irq
  39.194 -	 * has the SA_INTERRUPT flag set. -arca
  39.195 -	 */
  39.196 -	/* read Pentium cycle counter */
  39.197 -
  39.198 -	hpet_current = hpet_readl(HPET_COUNTER);
  39.199 -	rdtsc(last_tsc_low, last_tsc_high);
  39.200 -
  39.201 -	/* lost tick compensation */
  39.202 -	offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
  39.203 -	if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
  39.204 -		int lost_ticks = (offset - hpet_last) / hpet_tick;
  39.205 -		jiffies_64 += lost_ticks;
  39.206 -	}
  39.207 -	hpet_last = hpet_current;
  39.208 -
  39.209 -	/* update the monotonic base value */
  39.210 -	this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
  39.211 -	monotonic_base += cycles_2_ns(this_offset - last_offset);
  39.212 -	write_sequnlock(&monotonic_lock);
  39.213 -
  39.214 -	/* calculate delay_at_last_interrupt */
  39.215 -	/*
  39.216 -	 * Time offset = (hpet delta) * ( usecs per HPET clock )
  39.217 -	 *             = (hpet delta) * ( usecs per tick / HPET clocks per tick)
  39.218 -	 *             = (hpet delta) * ( hpet_usec_quotient ) / (2^32)
  39.219 -	 * Where,
  39.220 -	 * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick
  39.221 -	 */
  39.222 -	delay_at_last_interrupt = hpet_current - offset;
  39.223 -	ASM_MUL64_REG(temp, delay_at_last_interrupt,
  39.224 -			hpet_usec_quotient, delay_at_last_interrupt);
  39.225 -}
  39.226 -#endif
  39.227 -
  39.228 -
  39.229 -#ifdef CONFIG_CPU_FREQ
  39.230 -#include <linux/workqueue.h>
  39.231 -
  39.232 -static unsigned int cpufreq_delayed_issched = 0;
  39.233 -static unsigned int cpufreq_init = 0;
  39.234 -static struct work_struct cpufreq_delayed_get_work;
  39.235 -
  39.236 -static void handle_cpufreq_delayed_get(void *v)
  39.237 -{
  39.238 -	unsigned int cpu;
  39.239 -	for_each_online_cpu(cpu) {
  39.240 -		cpufreq_get(cpu);
  39.241 -	}
  39.242 -	cpufreq_delayed_issched = 0;
  39.243 -}
  39.244 -
  39.245 -/* if we notice lost ticks, schedule a call to cpufreq_get() as it tries
  39.246 - * to verify the CPU frequency the timing core thinks the CPU is running
  39.247 - * at is still correct.
  39.248 - */
  39.249 -static inline void cpufreq_delayed_get(void) 
  39.250 -{
  39.251 -	if (cpufreq_init && !cpufreq_delayed_issched) {
  39.252 -		cpufreq_delayed_issched = 1;
  39.253 -		printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n");
  39.254 -		schedule_work(&cpufreq_delayed_get_work);
  39.255 -	}
  39.256 -}
  39.257 -
  39.258 -/* If the CPU frequency is scaled, TSC-based delays will need a different
  39.259 - * loops_per_jiffy value to function properly.
  39.260 - */
  39.261 -
  39.262 -static unsigned int  ref_freq = 0;
  39.263 -static unsigned long loops_per_jiffy_ref = 0;
  39.264 -
  39.265 -#ifndef CONFIG_SMP
  39.266 -static unsigned long fast_gettimeoffset_ref = 0;
  39.267 -static unsigned long cpu_khz_ref = 0;
  39.268 -#endif
  39.269 -
  39.270 -static int
  39.271 -time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
  39.272 -		       void *data)
  39.273 -{
  39.274 -	struct cpufreq_freqs *freq = data;
  39.275 -
  39.276 -	if (val != CPUFREQ_RESUMECHANGE)
  39.277 -		write_seqlock_irq(&xtime_lock);
  39.278 -	if (!ref_freq) {
  39.279 -		ref_freq = freq->old;
  39.280 -		loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
  39.281 -#ifndef CONFIG_SMP
  39.282 -		fast_gettimeoffset_ref = fast_gettimeoffset_quotient;
  39.283 -		cpu_khz_ref = cpu_khz;
  39.284 -#endif
  39.285 -	}
  39.286 -
  39.287 -	if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
  39.288 -	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
  39.289 -	    (val == CPUFREQ_RESUMECHANGE)) {
  39.290 -		if (!(freq->flags & CPUFREQ_CONST_LOOPS))
  39.291 -			cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
  39.292 -#ifndef CONFIG_SMP
  39.293 -		if (cpu_khz)
  39.294 -			cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
  39.295 -		if (use_tsc) {
  39.296 -			if (!(freq->flags & CPUFREQ_CONST_LOOPS)) {
  39.297 -				fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
  39.298 -				set_cyc2ns_scale(cpu_khz/1000);
  39.299 -			}
  39.300 -		}
  39.301 -#endif
  39.302 -	}
  39.303 -
  39.304 -	if (val != CPUFREQ_RESUMECHANGE)
  39.305 -		write_sequnlock_irq(&xtime_lock);
  39.306 -
  39.307 -	return 0;
  39.308 -}
  39.309 -
  39.310 -static struct notifier_block time_cpufreq_notifier_block = {
  39.311 -	.notifier_call	= time_cpufreq_notifier
  39.312 -};
  39.313 -
  39.314 -
  39.315 -static int __init cpufreq_tsc(void)
  39.316 -{
  39.317 -	int ret;
  39.318 -	INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get, NULL);
  39.319 -	ret = cpufreq_register_notifier(&time_cpufreq_notifier_block,
  39.320 -					CPUFREQ_TRANSITION_NOTIFIER);
  39.321 -	if (!ret)
  39.322 -		cpufreq_init = 1;
  39.323 -	return ret;
  39.324 -}
  39.325 -core_initcall(cpufreq_tsc);
  39.326 -
  39.327 -#else /* CONFIG_CPU_FREQ */
  39.328 -static inline void cpufreq_delayed_get(void) { return; }
  39.329 -#endif 
  39.330 -
  39.331 -
  39.332 -static int init_tsc(char* override)
  39.333 -{
  39.334 -	u64 __cpu_khz;
  39.335 -
  39.336 -	__cpu_khz = HYPERVISOR_shared_info->cpu_freq;
  39.337 -	do_div(__cpu_khz, 1000);
  39.338 -	cpu_khz = (u32)__cpu_khz;
  39.339 -	printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n", 
  39.340 -	       cpu_khz / 1000, cpu_khz % 1000);
  39.341 -
  39.342 -	/* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz =
  39.343 -	   (2^32 * 1 / (clocks/us)) */
  39.344 -	{
  39.345 -		unsigned long eax=0, edx=1000;
  39.346 -		__asm__("divl %2"
  39.347 -		    :"=a" (fast_gettimeoffset_quotient), "=d" (edx)
  39.348 -		    :"r" (cpu_khz),
  39.349 -		    "0" (eax), "1" (edx));
  39.350 -	}
  39.351 -
  39.352 -	set_cyc2ns_scale(cpu_khz/1000);
  39.353 -
  39.354 -	use_tsc = 1;
  39.355 -
  39.356 -	return 0;
  39.357 -}
  39.358 -
  39.359 -static int __init tsc_setup(char *str)
  39.360 -{
  39.361 -	printk(KERN_WARNING "notsc: cannot disable TSC in Xen/Linux.\n");
  39.362 -	return 1;
  39.363 -}
  39.364 -__setup("notsc", tsc_setup);
  39.365 -
  39.366 -
  39.367 -
  39.368 -/************************************************************/
  39.369 -
  39.370 -/* tsc timer_opts struct */
  39.371 -struct timer_opts timer_tsc = {
  39.372 -	.name = "tsc",
  39.373 -	.mark_offset = mark_offset_tsc, 
  39.374 -	.get_offset = get_offset_tsc,
  39.375 -	.monotonic_clock = monotonic_clock_tsc,
  39.376 -	.delay = delay_tsc,
  39.377 -};
  39.378 -
  39.379 -struct init_timer_opts timer_tsc_init = {
  39.380 -	.init = init_tsc,
  39.381 -	.opts = &timer_tsc,
  39.382 -};
    40.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Tue Aug 23 18:43:18 2005 -0800
    40.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Thu Aug 25 15:53:20 2005 -0700
    40.3 @@ -871,6 +871,7 @@ fastcall void do_simd_coprocessor_error(
    40.4  	}
    40.5  }
    40.6  
    40.7 +#ifndef CONFIG_XEN
    40.8  fastcall void setup_x86_bogus_stack(unsigned char * stk)
    40.9  {
   40.10  	unsigned long *switch16_ptr, *switch32_ptr;
   40.11 @@ -915,6 +916,7 @@ fastcall unsigned char * fixup_x86_bogus
   40.12  	memcpy(stack32, stack16, len);
   40.13  	return stack32;
   40.14  }
   40.15 +#endif
   40.16  
   40.17  /*
   40.18   *  'math_state_restore()' saves the current math information in the
    41.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Tue Aug 23 18:43:18 2005 -0800
    41.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Thu Aug 25 15:53:20 2005 -0700
    41.3 @@ -281,7 +281,7 @@ fastcall void do_page_fault(struct pt_re
    41.4  	siginfo_t info;
    41.5  
    41.6  	/* Set the "privileged fault" bit to something sane. */
    41.7 -	error_code &= 3;
    41.8 +	error_code &= ~4;
    41.9  	error_code |= (regs->xcs & 2) << 1;
   41.10  	if (regs->eflags & X86_EFLAGS_VM)
   41.11  		error_code |= 4;
    42.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Tue Aug 23 18:43:18 2005 -0800
    42.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Thu Aug 25 15:53:20 2005 -0700
    42.3 @@ -41,8 +41,7 @@ static void *__kmap_atomic(struct page *
    42.4  	if (!pte_none(*(kmap_pte-idx)))
    42.5  		BUG();
    42.6  #endif
    42.7 -	set_pte(kmap_pte-idx, mk_pte(page, prot));
    42.8 -	__flush_tlb_one(vaddr);
    42.9 +	set_pte_at_sync(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
   42.10  
   42.11  	return (void*) vaddr;
   42.12  }
    43.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Aug 23 18:43:18 2005 -0800
    43.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Aug 25 15:53:20 2005 -0700
    43.3 @@ -35,6 +35,7 @@
    43.4  #include <asm/pgtable.h>
    43.5  #include <asm-xen/hypervisor.h>
    43.6  #include <asm-xen/balloon.h>
    43.7 +#include <linux/module.h>
    43.8  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    43.9  #include <linux/percpu.h>
   43.10  #include <asm/tlbflush.h>
   43.11 @@ -58,124 +59,124 @@
   43.12  #ifndef CONFIG_XEN_SHADOW_MODE
   43.13  void xen_l1_entry_update(pte_t *ptr, pte_t val)
   43.14  {
   43.15 -    mmu_update_t u;
   43.16 -    u.ptr = virt_to_machine(ptr);
   43.17 -    u.val = pte_val_ma(val);
   43.18 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.19 +	mmu_update_t u;
   43.20 +	u.ptr = virt_to_machine(ptr);
   43.21 +	u.val = pte_val_ma(val);
   43.22 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.23  }
   43.24  
   43.25  void xen_l2_entry_update(pmd_t *ptr, pmd_t val)
   43.26  {
   43.27 -    mmu_update_t u;
   43.28 -    u.ptr = virt_to_machine(ptr);
   43.29 -    u.val = pmd_val_ma(val);
   43.30 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.31 +	mmu_update_t u;
   43.32 +	u.ptr = virt_to_machine(ptr);
   43.33 +	u.val = pmd_val_ma(val);
   43.34 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.35  }
   43.36  
   43.37  #ifdef CONFIG_X86_PAE
   43.38  void xen_l3_entry_update(pud_t *ptr, pud_t val)
   43.39  {
   43.40 -    mmu_update_t u;
   43.41 -    u.ptr = virt_to_machine(ptr);
   43.42 -    u.val = pud_val_ma(val);
   43.43 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.44 +	mmu_update_t u;
   43.45 +	u.ptr = virt_to_machine(ptr);
   43.46 +	u.val = pud_val_ma(val);
   43.47 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.48  }
   43.49  #endif
   43.50  
   43.51  #ifdef CONFIG_X86_64
   43.52  void xen_l3_entry_update(pud_t *ptr, pud_t val)
   43.53  {
   43.54 -    mmu_update_t u;
   43.55 -    u.ptr = virt_to_machine(ptr);
   43.56 -    u.val = val.pud;
   43.57 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.58 +	mmu_update_t u;
   43.59 +	u.ptr = virt_to_machine(ptr);
   43.60 +	u.val = val.pud;
   43.61 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.62  }
   43.63  
   43.64  void xen_l4_entry_update(pgd_t *ptr, pgd_t val)
   43.65  {
   43.66 -    mmu_update_t u;
   43.67 -    u.ptr = virt_to_machine(ptr);
   43.68 -    u.val = val.pgd;
   43.69 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.70 +	mmu_update_t u;
   43.71 +	u.ptr = virt_to_machine(ptr);
   43.72 +	u.val = val.pgd;
   43.73 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.74  }
   43.75  #endif /* CONFIG_X86_64 */
   43.76  #endif /* CONFIG_XEN_SHADOW_MODE */
   43.77  
   43.78  void xen_machphys_update(unsigned long mfn, unsigned long pfn)
   43.79  {
   43.80 -    mmu_update_t u;
   43.81 -    u.ptr = (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
   43.82 -    u.val = pfn;
   43.83 -    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.84 +	mmu_update_t u;
   43.85 +	u.ptr = (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
   43.86 +	u.val = pfn;
   43.87 +	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
   43.88  }
   43.89  
   43.90  void xen_pt_switch(unsigned long ptr)
   43.91  {
   43.92 -    struct mmuext_op op;
   43.93 -    op.cmd = MMUEXT_NEW_BASEPTR;
   43.94 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
   43.95 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
   43.96 +	struct mmuext_op op;
   43.97 +	op.cmd = MMUEXT_NEW_BASEPTR;
   43.98 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
   43.99 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.100  }
  43.101  
  43.102  void xen_new_user_pt(unsigned long ptr)
  43.103  {
  43.104 -    struct mmuext_op op;
  43.105 -    op.cmd = MMUEXT_NEW_USER_BASEPTR;
  43.106 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.107 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.108 +	struct mmuext_op op;
  43.109 +	op.cmd = MMUEXT_NEW_USER_BASEPTR;
  43.110 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.111 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.112  }
  43.113  
  43.114  void xen_tlb_flush(void)
  43.115  {
  43.116 -    struct mmuext_op op;
  43.117 -    op.cmd = MMUEXT_TLB_FLUSH_LOCAL;
  43.118 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.119 +	struct mmuext_op op;
  43.120 +	op.cmd = MMUEXT_TLB_FLUSH_LOCAL;
  43.121 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.122  }
  43.123  
  43.124  void xen_invlpg(unsigned long ptr)
  43.125  {
  43.126 -    struct mmuext_op op;
  43.127 -    op.cmd = MMUEXT_INVLPG_LOCAL;
  43.128 -    op.linear_addr = ptr & PAGE_MASK;
  43.129 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.130 +	struct mmuext_op op;
  43.131 +	op.cmd = MMUEXT_INVLPG_LOCAL;
  43.132 +	op.linear_addr = ptr & PAGE_MASK;
  43.133 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.134  }
  43.135  
  43.136  #ifdef CONFIG_SMP
  43.137  
  43.138  void xen_tlb_flush_all(void)
  43.139  {
  43.140 -    struct mmuext_op op;
  43.141 -    op.cmd = MMUEXT_TLB_FLUSH_ALL;
  43.142 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.143 +	struct mmuext_op op;
  43.144 +	op.cmd = MMUEXT_TLB_FLUSH_ALL;
  43.145 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.146  }
  43.147  
  43.148  void xen_tlb_flush_mask(cpumask_t *mask)
  43.149  {
  43.150 -    struct mmuext_op op;
  43.151 -    if ( cpus_empty(*mask) )
  43.152 -        return;
  43.153 -    op.cmd = MMUEXT_TLB_FLUSH_MULTI;
  43.154 -    op.vcpumask = mask->bits;
  43.155 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.156 +	struct mmuext_op op;
  43.157 +	if ( cpus_empty(*mask) )
  43.158 +		return;
  43.159 +	op.cmd = MMUEXT_TLB_FLUSH_MULTI;
  43.160 +	op.vcpumask = mask->bits;
  43.161 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.162  }
  43.163  
  43.164  void xen_invlpg_all(unsigned long ptr)
  43.165  {
  43.166 -    struct mmuext_op op;
  43.167 -    op.cmd = MMUEXT_INVLPG_ALL;
  43.168 -    op.linear_addr = ptr & PAGE_MASK;
  43.169 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.170 +	struct mmuext_op op;
  43.171 +	op.cmd = MMUEXT_INVLPG_ALL;
  43.172 +	op.linear_addr = ptr & PAGE_MASK;
  43.173 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.174  }
  43.175  
  43.176  void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr)
  43.177  {
  43.178 -    struct mmuext_op op;
  43.179 -    if ( cpus_empty(*mask) )
  43.180 -        return;
  43.181 -    op.cmd = MMUEXT_INVLPG_MULTI;
  43.182 -    op.vcpumask = mask->bits;
  43.183 -    op.linear_addr = ptr & PAGE_MASK;
  43.184 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.185 +	struct mmuext_op op;
  43.186 +	if ( cpus_empty(*mask) )
  43.187 +		return;
  43.188 +	op.cmd = MMUEXT_INVLPG_MULTI;
  43.189 +	op.vcpumask = mask->bits;
  43.190 +	op.linear_addr = ptr & PAGE_MASK;
  43.191 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.192  }
  43.193  
  43.194  #endif /* CONFIG_SMP */
  43.195 @@ -183,181 +184,233 @@ void xen_invlpg_mask(cpumask_t *mask, un
  43.196  #ifndef CONFIG_XEN_SHADOW_MODE
  43.197  void xen_pgd_pin(unsigned long ptr)
  43.198  {
  43.199 -    struct mmuext_op op;
  43.200 +	struct mmuext_op op;
  43.201  #ifdef CONFIG_X86_64
  43.202 -    op.cmd = MMUEXT_PIN_L4_TABLE;
  43.203 +	op.cmd = MMUEXT_PIN_L4_TABLE;
  43.204  #elif defined(CONFIG_X86_PAE)
  43.205 -    op.cmd = MMUEXT_PIN_L3_TABLE;
  43.206 +	op.cmd = MMUEXT_PIN_L3_TABLE;
  43.207  #else
  43.208 -    op.cmd = MMUEXT_PIN_L2_TABLE;
  43.209 +	op.cmd = MMUEXT_PIN_L2_TABLE;
  43.210  #endif
  43.211 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.212 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.213 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.214 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.215  }
  43.216  
  43.217  void xen_pgd_unpin(unsigned long ptr)
  43.218  {
  43.219 -    struct mmuext_op op;
  43.220 -    op.cmd = MMUEXT_UNPIN_TABLE;
  43.221 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.222 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.223 +	struct mmuext_op op;
  43.224 +	op.cmd = MMUEXT_UNPIN_TABLE;
  43.225 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.226 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.227  }
  43.228  
  43.229  void xen_pte_pin(unsigned long ptr)
  43.230  {
  43.231 -    struct mmuext_op op;
  43.232 -    op.cmd = MMUEXT_PIN_L1_TABLE;
  43.233 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.234 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.235 +	struct mmuext_op op;
  43.236 +	op.cmd = MMUEXT_PIN_L1_TABLE;
  43.237 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.238 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.239  }
  43.240  
  43.241  void xen_pte_unpin(unsigned long ptr)
  43.242  {
  43.243 -    struct mmuext_op op;
  43.244 -    op.cmd = MMUEXT_UNPIN_TABLE;
  43.245 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.246 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.247 +	struct mmuext_op op;
  43.248 +	op.cmd = MMUEXT_UNPIN_TABLE;
  43.249 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.250 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.251  }
  43.252  
  43.253  #ifdef CONFIG_X86_64
  43.254  void xen_pud_pin(unsigned long ptr)
  43.255  {
  43.256 -    struct mmuext_op op;
  43.257 -    op.cmd = MMUEXT_PIN_L3_TABLE;
  43.258 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.259 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.260 +	struct mmuext_op op;
  43.261 +	op.cmd = MMUEXT_PIN_L3_TABLE;
  43.262 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.263 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.264  }
  43.265  
  43.266  void xen_pud_unpin(unsigned long ptr)
  43.267  {
  43.268 -    struct mmuext_op op;
  43.269 -    op.cmd = MMUEXT_UNPIN_TABLE;
  43.270 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.271 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.272 +	struct mmuext_op op;
  43.273 +	op.cmd = MMUEXT_UNPIN_TABLE;
  43.274 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.275 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.276  }
  43.277  
  43.278  void xen_pmd_pin(unsigned long ptr)
  43.279  {
  43.280 -    struct mmuext_op op;
  43.281 -    op.cmd = MMUEXT_PIN_L2_TABLE;
  43.282 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.283 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.284 +	struct mmuext_op op;
  43.285 +	op.cmd = MMUEXT_PIN_L2_TABLE;
  43.286 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.287 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.288  }
  43.289  
  43.290  void xen_pmd_unpin(unsigned long ptr)
  43.291  {
  43.292 -    struct mmuext_op op;
  43.293 -    op.cmd = MMUEXT_UNPIN_TABLE;
  43.294 -    op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.295 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.296 +	struct mmuext_op op;
  43.297 +	op.cmd = MMUEXT_UNPIN_TABLE;
  43.298 +	op.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
  43.299 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.300  }
  43.301  #endif /* CONFIG_X86_64 */
  43.302  #endif /* CONFIG_XEN_SHADOW_MODE */
  43.303  
  43.304  void xen_set_ldt(unsigned long ptr, unsigned long len)
  43.305  {
  43.306 -    struct mmuext_op op;
  43.307 -    op.cmd = MMUEXT_SET_LDT;
  43.308 -    op.linear_addr = ptr;
  43.309 -    op.nr_ents = len;
  43.310 -    BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.311 +	struct mmuext_op op;
  43.312 +	op.cmd = MMUEXT_SET_LDT;
  43.313 +	op.linear_addr = ptr;
  43.314 +	op.nr_ents = len;
  43.315 +	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
  43.316  }
  43.317  
  43.318 -void xen_contig_memory(unsigned long vstart, unsigned int order)
  43.319 -{
  43.320 -    /*
  43.321 -     * Ensure multi-page extents are contiguous in machine memory. This code 
  43.322 -     * could be cleaned up some, and the number of hypercalls reduced.
  43.323 -     */
  43.324 -    pgd_t         *pgd; 
  43.325 -    pud_t         *pud; 
  43.326 -    pmd_t         *pmd;
  43.327 -    pte_t         *pte;
  43.328 -    unsigned long  mfn, i, flags;
  43.329 -
  43.330 -    scrub_pages(vstart, 1 << order);
  43.331 -
  43.332 -    balloon_lock(flags);
  43.333 +/*
  43.334 + * Bitmap is indexed by page number. If bit is set, the page is part of a
  43.335 + * xen_create_contiguous_region() area of memory.
  43.336 + */
  43.337 +unsigned long *contiguous_bitmap;
  43.338  
  43.339 -    /* 1. Zap current PTEs, giving away the underlying pages. */
  43.340 -    for (i = 0; i < (1<<order); i++) {
  43.341 -        pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
  43.342 -        pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  43.343 -        pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  43.344 -        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  43.345 -        mfn = pte_mfn(*pte);
  43.346 -        HYPERVISOR_update_va_mapping(
  43.347 -            vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
  43.348 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  43.349 -            INVALID_P2M_ENTRY;
  43.350 -        BUG_ON(HYPERVISOR_dom_mem_op(
  43.351 -            MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
  43.352 -    }
  43.353 +static void contiguous_bitmap_set(
  43.354 +	unsigned long first_page, unsigned long nr_pages)
  43.355 +{
  43.356 +	unsigned long start_off, end_off, curr_idx, end_idx;
  43.357  
  43.358 -    /* 2. Get a new contiguous memory extent. */
  43.359 -    BUG_ON(HYPERVISOR_dom_mem_op(
  43.360 -	       MEMOP_increase_reservation, &mfn, 1, order | (32<<8)) != 1);
  43.361 +	curr_idx  = first_page / BITS_PER_LONG;
  43.362 +	start_off = first_page & (BITS_PER_LONG-1);
  43.363 +	end_idx   = (first_page + nr_pages) / BITS_PER_LONG;
  43.364 +	end_off   = (first_page + nr_pages) & (BITS_PER_LONG-1);
  43.365  
  43.366 -    /* 3. Map the new extent in place of old pages. */
  43.367 -    for (i = 0; i < (1<<order); i++) {
  43.368 -        HYPERVISOR_update_va_mapping(
  43.369 -            vstart + (i*PAGE_SIZE),
  43.370 -            __pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0);
  43.371 -        xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
  43.372 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
  43.373 -    }
  43.374 -
  43.375 -    flush_tlb_all();
  43.376 -
  43.377 -    balloon_unlock(flags);
  43.378 +	if (curr_idx == end_idx) {
  43.379 +		contiguous_bitmap[curr_idx] |=
  43.380 +			((1UL<<end_off)-1) & -(1UL<<start_off);
  43.381 +	} else {
  43.382 +		contiguous_bitmap[curr_idx] |= -(1UL<<start_off);
  43.383 +		while ( ++curr_idx < end_idx )
  43.384 +			contiguous_bitmap[curr_idx] = ~0UL;
  43.385 +		contiguous_bitmap[curr_idx] |= (1UL<<end_off)-1;
  43.386 +	}
  43.387  }
  43.388  
  43.389 -#ifdef CONFIG_XEN_PHYSDEV_ACCESS
  43.390 -
  43.391 -unsigned long allocate_empty_lowmem_region(unsigned long pages)
  43.392 +static void contiguous_bitmap_clear(
  43.393 +	unsigned long first_page, unsigned long nr_pages)
  43.394  {
  43.395 -    pgd_t         *pgd;
  43.396 -    pud_t         *pud; 
  43.397 -    pmd_t         *pmd;
  43.398 -    pte_t         *pte;
  43.399 -    unsigned long *pfn_array;
  43.400 -    unsigned long  vstart;
  43.401 -    unsigned long  i;
  43.402 -    unsigned int   order = get_order(pages*PAGE_SIZE);
  43.403 -
  43.404 -    vstart = __get_free_pages(GFP_KERNEL, order);
  43.405 -    if ( vstart == 0 )
  43.406 -        return 0UL;
  43.407 -
  43.408 -    scrub_pages(vstart, 1 << order);
  43.409 -
  43.410 -    pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
  43.411 -    if ( pfn_array == NULL )
  43.412 -        BUG();
  43.413 +	unsigned long start_off, end_off, curr_idx, end_idx;
  43.414  
  43.415 -    for ( i = 0; i < (1<<order); i++ )
  43.416 -    {
  43.417 -        pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
  43.418 -        pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  43.419 -        pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  43.420 -        pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); 
  43.421 -        pfn_array[i] = pte_mfn(*pte);
  43.422 -#ifdef CONFIG_X86_64
  43.423 -        xen_l1_entry_update(pte, __pte(0));
  43.424 -#else
  43.425 -        HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
  43.426 -#endif
  43.427 -        phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  43.428 -            INVALID_P2M_ENTRY;
  43.429 -    }
  43.430 +	curr_idx  = first_page / BITS_PER_LONG;
  43.431 +	start_off = first_page & (BITS_PER_LONG-1);
  43.432 +	end_idx   = (first_page + nr_pages) / BITS_PER_LONG;
  43.433 +	end_off   = (first_page + nr_pages) & (BITS_PER_LONG-1);
  43.434  
  43.435 -    flush_tlb_all();
  43.436 -
  43.437 -    balloon_put_pages(pfn_array, 1 << order);
  43.438 -
  43.439 -    vfree(pfn_array);
  43.440 -
  43.441 -    return vstart;
  43.442 +	if (curr_idx == end_idx) {
  43.443 +		contiguous_bitmap[curr_idx] &=
  43.444 +			-(1UL<<end_off) | ((1UL<<start_off)-1);
  43.445 +	} else {
  43.446 +		contiguous_bitmap[curr_idx] &= (1UL<<start_off)-1;
  43.447 +		while ( ++curr_idx != end_idx )
  43.448 +			contiguous_bitmap[curr_idx] = 0;
  43.449 +		contiguous_bitmap[curr_idx] &= -(1UL<<end_off);
  43.450 +	}
  43.451  }
  43.452  
  43.453 -#endif /* CONFIG_XEN_PHYSDEV_ACCESS */
  43.454 +/* Ensure multi-page extents are contiguous in machine memory. */
  43.455 +void xen_create_contiguous_region(unsigned long vstart, unsigned int order)
  43.456 +{
  43.457 +	pgd_t         *pgd; 
  43.458 +	pud_t         *pud; 
  43.459 +	pmd_t         *pmd;
  43.460 +	pte_t         *pte;
  43.461 +	unsigned long  mfn, i, flags;
  43.462 +
  43.463 +	scrub_pages(vstart, 1 << order);
  43.464 +
  43.465 +	balloon_lock(flags);
  43.466 +
  43.467 +	/* 1. Zap current PTEs, giving away the underlying pages. */
  43.468 +	for (i = 0; i < (1<<order); i++) {
  43.469 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
  43.470 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  43.471 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  43.472 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  43.473 +		mfn = pte_mfn(*pte);
  43.474 +		BUG_ON(HYPERVISOR_update_va_mapping(
  43.475 +			vstart + (i*PAGE_SIZE), __pte_ma(0), 0));
  43.476 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  43.477 +			INVALID_P2M_ENTRY;
  43.478 +		BUG_ON(HYPERVISOR_dom_mem_op(
  43.479 +			MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
  43.480 +	}
  43.481 +
  43.482 +	/* 2. Get a new contiguous memory extent. */
  43.483 +	BUG_ON(HYPERVISOR_dom_mem_op(
  43.484 +		MEMOP_increase_reservation, &mfn, 1, order | (32<<8)) != 1);
  43.485 +
  43.486 +	/* 3. Map the new extent in place of old pages. */
  43.487 +	for (i = 0; i < (1<<order); i++) {
  43.488 +		BUG_ON(HYPERVISOR_update_va_mapping(
  43.489 +			vstart + (i*PAGE_SIZE),
  43.490 +			pfn_pte_ma(mfn+i, PAGE_KERNEL), 0));
  43.491 +		xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
  43.492 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
  43.493 +	}
  43.494 +
  43.495 +	flush_tlb_all();
  43.496 +
  43.497 +	contiguous_bitmap_set(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
  43.498 +
  43.499 +	balloon_unlock(flags);
  43.500 +}
  43.501 +
  43.502 +void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
  43.503 +{
  43.504 +	pgd_t         *pgd; 
  43.505 +	pud_t         *pud; 
  43.506 +	pmd_t         *pmd;
  43.507 +	pte_t         *pte;
  43.508 +	unsigned long  mfn, i, flags;
  43.509 +
  43.510 +	scrub_pages(vstart, 1 << order);
  43.511 +
  43.512 +	balloon_lock(flags);
  43.513 +
  43.514 +	contiguous_bitmap_clear(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
  43.515 +
  43.516 +	/* 1. Zap current PTEs, giving away the underlying pages. */
  43.517 +	for (i = 0; i < (1<<order); i++) {
  43.518 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
  43.519 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  43.520 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  43.521 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  43.522 +		mfn = pte_mfn(*pte);
  43.523 +		BUG_ON(HYPERVISOR_update_va_mapping(
  43.524 +			vstart + (i*PAGE_SIZE), __pte_ma(0), 0));
  43.525 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  43.526 +			INVALID_P2M_ENTRY;
  43.527 +		BUG_ON(HYPERVISOR_dom_mem_op(
  43.528 +			MEMOP_decrease_reservation, &mfn, 1, 0) != 1);
  43.529 +	}
  43.530 +
  43.531 +	/* 2. Map new pages in place of old pages. */
  43.532 +	for (i = 0; i < (1<<order); i++) {
  43.533 +		BUG_ON(HYPERVISOR_dom_mem_op(
  43.534 +			MEMOP_increase_reservation, &mfn, 1, 0) != 1);
  43.535 +		BUG_ON(HYPERVISOR_update_va_mapping(
  43.536 +			vstart + (i*PAGE_SIZE),
  43.537 +			pfn_pte_ma(mfn, PAGE_KERNEL), 0));
  43.538 +		xen_machphys_update(mfn, (__pa(vstart)>>PAGE_SHIFT)+i);
  43.539 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn;
  43.540 +	}
  43.541 +
  43.542 +	flush_tlb_all();
  43.543 +
  43.544 +	balloon_unlock(flags);
  43.545 +}
  43.546 +
  43.547 +/*
  43.548 + * Local variables:
  43.549 + *  c-file-style: "linux"
  43.550 + *  indent-tabs-mode: t
  43.551 + *  c-indent-level: 8
  43.552 + *  c-basic-offset: 8
  43.553 + *  tab-width: 8
  43.554 + * End:
  43.555 + */
    44.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Tue Aug 23 18:43:18 2005 -0800
    44.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Thu Aug 25 15:53:20 2005 -0700
    44.3 @@ -41,6 +41,14 @@
    44.4  #include <asm/sections.h>
    44.5  #include <asm-xen/hypervisor.h>
    44.6  
    44.7 +extern unsigned long *contiguous_bitmap;
    44.8 +
    44.9 +#if defined(CONFIG_SWIOTLB)
   44.10 +extern void swiotlb_init(void);
   44.11 +int swiotlb;
   44.12 +EXPORT_SYMBOL(swiotlb);
   44.13 +#endif
   44.14 +
   44.15  unsigned int __VMALLOC_RESERVE = 128 << 20;
   44.16  
   44.17  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
   44.18 @@ -334,18 +342,18 @@ unsigned long long __PAGE_KERNEL_EXEC = 
   44.19  extern void __init remap_numa_kva(void);
   44.20  #endif
   44.21  
   44.22 +pgd_t *swapper_pg_dir;
   44.23 +
   44.24  static void __init pagetable_init (void)
   44.25  {
   44.26  	unsigned long vaddr;
   44.27 -	pgd_t *pgd_base = swapper_pg_dir;
   44.28 -	pgd_t *old_pgd = (pgd_t *)xen_start_info.pt_base;
   44.29 +	pgd_t *pgd_base = (pgd_t *)xen_start_info.pt_base;
   44.30 +	int i;
   44.31  
   44.32 -#ifdef CONFIG_X86_PAE
   44.33 -	int i;
   44.34 -	/* Init entries of the first-level page table to the zero page */
   44.35 -	for (i = 0; i < PTRS_PER_PGD; i++)
   44.36 -		set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT));
   44.37 -#endif
   44.38 +	swapper_pg_dir = pgd_base;
   44.39 +	init_mm.pgd    = pgd_base;
   44.40 +	for (i = 0; i < NR_CPUS; i++)
   44.41 +		per_cpu(cur_pgd, i) = pgd_base;
   44.42  
   44.43  	/* Enable PSE if available */
   44.44  	if (cpu_has_pse) {
   44.45 @@ -359,44 +367,6 @@ static void __init pagetable_init (void)
   44.46  		__PAGE_KERNEL_EXEC |= _PAGE_GLOBAL;
   44.47  	}
   44.48  
   44.49 -	/*
   44.50 -	 * Switch to proper mm_init page directory. Initialise from the current
   44.51 -	 * page directory, write-protect the new page directory, then switch to
   44.52 -	 * it. We clean up by write-enabling and then freeing the old page dir.
   44.53 -	 */
   44.54 -#ifndef CONFIG_X86_PAE
   44.55 -	memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
   44.56 -	make_page_readonly(pgd_base);
   44.57 -	xen_pgd_pin(__pa(pgd_base));
   44.58 -	load_cr3(pgd_base);
   44.59 -	xen_pgd_unpin(__pa(old_pgd));
   44.60 -	make_page_writable(old_pgd);
   44.61 -	__flush_tlb_all();
   44.62 -	free_bootmem(__pa(old_pgd), PAGE_SIZE);
   44.63 -#else
   44.64 -	{
   44.65 -		pud_t *old_pud = pud_offset(old_pgd+3, PAGE_OFFSET);
   44.66 -		pmd_t *old_pmd = pmd_offset(old_pud, PAGE_OFFSET);
   44.67 -		pmd_t *new_pmd = alloc_bootmem_low_pages(PAGE_SIZE);
   44.68 -
   44.69 -		memcpy(new_pmd,  old_pmd, PAGE_SIZE);
   44.70 -		memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
   44.71 -		set_pgd(&pgd_base[3], __pgd(__pa(new_pmd) | _PAGE_PRESENT));
   44.72 -
   44.73 -		make_page_readonly(new_pmd);
   44.74 -		make_page_readonly(pgd_base);
   44.75 -		xen_pgd_pin(__pa(pgd_base));
   44.76 -		load_cr3(pgd_base);
   44.77 -		xen_pgd_unpin(__pa(old_pgd));
   44.78 -		make_page_writable(old_pgd);
   44.79 -		make_page_writable(old_pmd);
   44.80 -		__flush_tlb_all();
   44.81 -
   44.82 -		free_bootmem(__pa(old_pgd), PAGE_SIZE);
   44.83 -		free_bootmem(__pa(old_pmd), PAGE_SIZE);
   44.84 -	}
   44.85 -#endif
   44.86 -
   44.87  	init_mm.context.pinned = 1;
   44.88  	kernel_physical_mapping_init(pgd_base);
   44.89  	remap_numa_kva();
   44.90 @@ -409,17 +379,6 @@ static void __init pagetable_init (void)
   44.91  	page_table_range_init(vaddr, 0, pgd_base);
   44.92  
   44.93  	permanent_kmaps_init(pgd_base);
   44.94 -
   44.95 -#if 0 /* def CONFIG_X86_PAE */
   44.96 -	/*
   44.97 -	 * Add low memory identity-mappings - SMP needs it when
   44.98 -	 * starting up on an AP from real-mode. In the non-PAE
   44.99 -	 * case we already have these mappings through head.S.
  44.100 -	 * All user-space mappings are explicitly cleared after
  44.101 -	 * SMP startup.
  44.102 -	 */
  44.103 -	set_pgd(&pgd_base[0], pgd_base[USER_PTRS_PER_PGD]);
  44.104 -#endif
  44.105  }
  44.106  
  44.107  #if defined(CONFIG_PM_DISK) || defined(CONFIG_SOFTWARE_SUSPEND)
  44.108 @@ -631,6 +590,15 @@ void __init mem_init(void)
  44.109  	int bad_ppro;
  44.110  	unsigned long pfn;
  44.111  
  44.112 +	contiguous_bitmap = alloc_bootmem_low_pages(
  44.113 +		(max_low_pfn + 2*BITS_PER_LONG) >> 3);
  44.114 +	BUG_ON(!contiguous_bitmap);
  44.115 +	memset(contiguous_bitmap, 0, (max_low_pfn + 2*BITS_PER_LONG) >> 3);
  44.116 +
  44.117 +#if defined(CONFIG_SWIOTLB)
  44.118 +	swiotlb_init();	
  44.119 +#endif
  44.120 +
  44.121  #ifndef CONFIG_DISCONTIGMEM
  44.122  	if (!mem_map)
  44.123  		BUG();
    45.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c	Tue Aug 23 18:43:18 2005 -0800
    45.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c	Thu Aug 25 15:53:20 2005 -0700
    45.3 @@ -36,6 +36,8 @@ void iounmap(volatile void __iomem *addr
    45.4  {
    45.5  }
    45.6  
    45.7 +#ifdef __i386__
    45.8 +
    45.9  void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
   45.10  {
   45.11  	return NULL;
   45.12 @@ -45,6 +47,8 @@ void __init bt_iounmap(void *addr, unsig
   45.13  {
   45.14  }
   45.15  
   45.16 +#endif /* __i386__ */
   45.17 +
   45.18  #else
   45.19  
   45.20  /*
   45.21 @@ -58,7 +62,7 @@ static inline int is_local_lowmem(unsign
   45.22  	extern unsigned long max_low_pfn;
   45.23  	unsigned long mfn = address >> PAGE_SHIFT;
   45.24  	unsigned long pfn = mfn_to_pfn(mfn);
   45.25 -	return ((pfn < max_low_pfn) && (pfn_to_mfn(pfn) == mfn));
   45.26 +	return ((pfn < max_low_pfn) && (phys_to_machine_mapping[pfn] == mfn));
   45.27  }
   45.28  
   45.29  /*
   45.30 @@ -126,10 +130,12 @@ void __iomem * __ioremap(unsigned long p
   45.31  		return NULL;
   45.32  	area->phys_addr = phys_addr;
   45.33  	addr = (void __iomem *) area->addr;
   45.34 +	flags |= _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED;
   45.35 +#ifdef __x86_64__
   45.36 +	flags |= _PAGE_USER;
   45.37 +#endif
   45.38  	if (direct_remap_area_pages(&init_mm, (unsigned long) addr, phys_addr,
   45.39 -				    size, __pgprot(_PAGE_PRESENT | _PAGE_RW |
   45.40 -						   _PAGE_DIRTY | _PAGE_ACCESSED
   45.41 -						   | flags), domid)) {
   45.42 +				    size, __pgprot(flags), domid)) {
   45.43  		vunmap((void __force *) addr);
   45.44  		return NULL;
   45.45  	}
   45.46 @@ -218,6 +224,8 @@ void iounmap(volatile void __iomem *addr
   45.47  	kfree(p); 
   45.48  }
   45.49  
   45.50 +#ifdef __i386__
   45.51 +
   45.52  void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
   45.53  {
   45.54  	unsigned long offset, last_addr;
   45.55 @@ -289,6 +297,8 @@ void __init bt_iounmap(void *addr, unsig
   45.56  	}
   45.57  }
   45.58  
   45.59 +#endif /* __i386__ */
   45.60 +
   45.61  #endif /* CONFIG_XEN_PHYSDEV_ACCESS */
   45.62  
   45.63  /* These hacky macros avoid phys->machine translations. */
   45.64 @@ -298,90 +308,20 @@ void __init bt_iounmap(void *addr, unsig
   45.65  #define direct_mk_pte_phys(physpage, pgprot) \
   45.66    __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot)
   45.67  
   45.68 -static inline void direct_remap_area_pte(pte_t *pte, 
   45.69 -					 unsigned long address, 
   45.70 -					 unsigned long size,
   45.71 -					 mmu_update_t **v)
   45.72 -{
   45.73 -	unsigned long end;
   45.74 -
   45.75 -	address &= ~PMD_MASK;
   45.76 -	end = address + size;
   45.77 -	if (end > PMD_SIZE)
   45.78 -		end = PMD_SIZE;
   45.79 -	if (address >= end)
   45.80 -		BUG();
   45.81 -
   45.82 -	do {
   45.83 -		(*v)->ptr = virt_to_machine(pte);
   45.84 -		(*v)++;
   45.85 -		address += PAGE_SIZE;
   45.86 -		pte++;
   45.87 -	} while (address && (address < end));
   45.88 -}
   45.89  
   45.90 -static inline int direct_remap_area_pmd(struct mm_struct *mm,
   45.91 -					pmd_t *pmd, 
   45.92 -					unsigned long address, 
   45.93 -					unsigned long size,
   45.94 -					mmu_update_t **v)
   45.95 +static int direct_remap_area_pte_fn(pte_t *pte, 
   45.96 +				    struct page *pte_page,
   45.97 +				    unsigned long address, 
   45.98 +				    void *data)
   45.99  {
  45.100 -	unsigned long end;
  45.101 +	mmu_update_t **v = (mmu_update_t **)data;
  45.102  
  45.103 -	address &= ~PGDIR_MASK;
  45.104 -	end = address + size;
  45.105 -	if (end > PGDIR_SIZE)
  45.106 -		end = PGDIR_SIZE;
  45.107 -	if (address >= end)
  45.108 -		BUG();
  45.109 -	do {
  45.110 -		pte_t *pte = (mm == &init_mm) ? 
  45.111 -			pte_alloc_kernel(mm, pmd, address) :
  45.112 -			pte_alloc_map(mm, pmd, address);
  45.113 -		if (!pte)
  45.114 -			return -ENOMEM;
  45.115 -		direct_remap_area_pte(pte, address, end - address, v);
  45.116 -		pte_unmap(pte);
  45.117 -		address = (address + PMD_SIZE) & PMD_MASK;
  45.118 -		pmd++;
  45.119 -	} while (address && (address < end));
  45.120 +	(*v)->ptr = ((maddr_t)pfn_to_mfn(page_to_pfn(pte_page)) <<
  45.121 +		     PAGE_SHIFT) | ((unsigned long)pte & ~PAGE_MASK);
  45.122 +	(*v)++;
  45.123 +
  45.124  	return 0;
  45.125  }
  45.126 - 
  45.127 -int __direct_remap_area_pages(struct mm_struct *mm,
  45.128 -			      unsigned long address, 
  45.129 -			      unsigned long size, 
  45.130 -			      mmu_update_t *v)
  45.131 -{
  45.132 -	pgd_t * dir;
  45.133 -	unsigned long end = address + size;
  45.134 -	int error;
  45.135 -
  45.136 -	dir = pgd_offset(mm, address);
  45.137 -	if (address >= end)
  45.138 -		BUG();
  45.139 -	spin_lock(&mm->page_table_lock);
  45.140 -	do {
  45.141 -		pud_t *pud;
  45.142 -		pmd_t *pmd;
  45.143 -
  45.144 -		error = -ENOMEM;
  45.145 -		pud = pud_alloc(mm, dir, address);
  45.146 -		if (!pud)
  45.147 -			break;
  45.148 -		pmd = pmd_alloc(mm, pud, address);
  45.149 -		if (!pmd)
  45.150 -			break;
  45.151 -		error = 0;
  45.152 -		direct_remap_area_pmd(mm, pmd, address, end - address, &v);
  45.153 -		address = (address + PGDIR_SIZE) & PGDIR_MASK;
  45.154 -		dir++;
  45.155 -
  45.156 -	} while (address && (address < end));
  45.157 -	spin_unlock(&mm->page_table_lock);
  45.158 -	return error;
  45.159 -}
  45.160 -
  45.161  
  45.162  int direct_remap_area_pages(struct mm_struct *mm,
  45.163  			    unsigned long address, 
  45.164 @@ -393,7 +333,7 @@ int direct_remap_area_pages(struct mm_st
  45.165  	int i;
  45.166  	unsigned long start_address;
  45.167  #define MAX_DIRECTMAP_MMU_QUEUE 130
  45.168 -	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v = u;
  45.169 +	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v = u, *w = u;
  45.170  
  45.171  	start_address = address;
  45.172  
  45.173 @@ -402,11 +342,10 @@ int direct_remap_area_pages(struct mm_st
  45.174  	for (i = 0; i < size; i += PAGE_SIZE) {
  45.175  		if ((v - u) == MAX_DIRECTMAP_MMU_QUEUE) {
  45.176  			/* Fill in the PTE pointers. */
  45.177 -			__direct_remap_area_pages(mm,
  45.178 -						  start_address, 
  45.179 -						  address-start_address, 
  45.180 -						  u);
  45.181 - 
  45.182 +			generic_page_range(mm, start_address, 
  45.183 +					   address - start_address,
  45.184 +					   direct_remap_area_pte_fn, &w);
  45.185 +			w = u;
  45.186  			if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
  45.187  				return -EFAULT;
  45.188  			v = u;
  45.189 @@ -417,7 +356,7 @@ int direct_remap_area_pages(struct mm_st
  45.190  		 * Fill in the machine address: PTE ptr is done later by
  45.191  		 * __direct_remap_area_pages(). 
  45.192  		 */
  45.193 -		v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot);
  45.194 +		v->val = pte_val_ma(pfn_pte_ma(machine_addr >> PAGE_SHIFT, prot));
  45.195  
  45.196  		machine_addr += PAGE_SIZE;
  45.197  		address += PAGE_SIZE; 
  45.198 @@ -426,10 +365,8 @@ int direct_remap_area_pages(struct mm_st
  45.199  
  45.200  	if (v != u) {
  45.201  		/* get the ptep's filled in */
  45.202 -		__direct_remap_area_pages(mm,
  45.203 -					  start_address, 
  45.204 -					  address-start_address, 
  45.205 -					  u);
  45.206 +		generic_page_range(mm, start_address, address - start_address,
  45.207 +				   direct_remap_area_pte_fn, &w);
  45.208  		if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0))
  45.209  			return -EFAULT;
  45.210  	}
  45.211 @@ -440,3 +377,48 @@ int direct_remap_area_pages(struct mm_st
  45.212  }
  45.213  
  45.214  EXPORT_SYMBOL(direct_remap_area_pages);
  45.215 +
  45.216 +static int lookup_pte_fn(
  45.217 +	pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
  45.218 +{
  45.219 +	unsigned long *ptep = (unsigned long *)data;
  45.220 +	if (ptep)
  45.221 +		*ptep = (pfn_to_mfn(page_to_pfn(pte_page)) <<
  45.222 +			 PAGE_SHIFT) |
  45.223 +			((unsigned long)pte & ~PAGE_MASK);
  45.224 +	return 0;
  45.225 +}
  45.226 +
  45.227 +int create_lookup_pte_addr(struct mm_struct *mm, 
  45.228 +			   unsigned long address,
  45.229 +			   unsigned long *ptep)
  45.230 +{
  45.231 +	return generic_page_range(mm, address, PAGE_SIZE, lookup_pte_fn, ptep);
  45.232 +}
  45.233 +
  45.234 +EXPORT_SYMBOL(create_lookup_pte_addr);
  45.235 +
  45.236 +static int noop_fn(
  45.237 +	pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
  45.238 +{
  45.239 +	return 0;
  45.240 +}
  45.241 +
  45.242 +int touch_pte_range(struct mm_struct *mm,
  45.243 +		    unsigned long address,
  45.244 +		    unsigned long size)
  45.245 +{
  45.246 +	return generic_page_range(mm, address, size, noop_fn, NULL);
  45.247 +} 
  45.248 +
  45.249 +EXPORT_SYMBOL(touch_pte_range);
  45.250 +
  45.251 +/*
  45.252 + * Local variables:
  45.253 + *  c-file-style: "linux"
  45.254 + *  indent-tabs-mode: t
  45.255 + *  c-indent-level: 8
  45.256 + *  c-basic-offset: 8
  45.257 + *  tab-width: 8
  45.258 + * End:
  45.259 + */
    46.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Tue Aug 23 18:43:18 2005 -0800
    46.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Aug 25 15:53:20 2005 -0700
    46.3 @@ -25,6 +25,7 @@
    46.4  #include <asm/mmu_context.h>
    46.5  
    46.6  #include <asm-xen/foreign_page.h>
    46.7 +#include <asm-xen/hypervisor.h>
    46.8  
    46.9  void show_mem(void)
   46.10  {
   46.11 @@ -169,7 +170,7 @@ void set_pmd_pfn(unsigned long vaddr, un
   46.12  	__flush_tlb_one(vaddr);
   46.13  }
   46.14  
   46.15 -void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
   46.16 +void __set_fixmap (enum fixed_addresses idx, maddr_t phys, pgprot_t flags)
   46.17  {
   46.18  	unsigned long address = __fix_to_virt(idx);
   46.19  
   46.20 @@ -221,8 +222,8 @@ void pte_free(struct page *pte)
   46.21  	unsigned long va = (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT);
   46.22  
   46.23  	if (!pte_write(*virt_to_ptep(va)))
   46.24 -		HYPERVISOR_update_va_mapping(
   46.25 -			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0);
   46.26 +		BUG_ON(HYPERVISOR_update_va_mapping(
   46.27 +			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0));
   46.28  
   46.29  	ClearPageForeign(pte);
   46.30  	set_page_count(pte, 1);
   46.31 @@ -274,6 +275,11 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
   46.32  {
   46.33  	unsigned long flags;
   46.34  
   46.35 +#ifdef CONFIG_X86_PAE
   46.36 +	/* this gives us a page below 4GB */
   46.37 +	xen_create_contiguous_region((unsigned long)pgd, 0);
   46.38 +#endif
   46.39 +
   46.40  	if (!HAVE_SHARED_KERNEL_PMD)
   46.41  		spin_lock_irqsave(&pgd_lock, flags);
   46.42  
   46.43 @@ -349,16 +355,17 @@ void pgd_free(pgd_t *pgd)
   46.44  
   46.45  	if (!pte_write(*ptep)) {
   46.46  		xen_pgd_unpin(__pa(pgd));
   46.47 -		HYPERVISOR_update_va_mapping(
   46.48 +		BUG_ON(HYPERVISOR_update_va_mapping(
   46.49  			(unsigned long)pgd,
   46.50  			pfn_pte(virt_to_phys(pgd)>>PAGE_SHIFT, PAGE_KERNEL),
   46.51 -			0);
   46.52 +			0));
   46.53  	}
   46.54  
   46.55  	/* in the PAE case user pgd entries are overwritten before usage */
   46.56  	if (PTRS_PER_PMD > 1) {
   46.57  		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
   46.58  			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   46.59 +			make_page_writable(pmd);
   46.60  			kmem_cache_free(pmd_cache, pmd);
   46.61  		}
   46.62  		if (!HAVE_SHARED_KERNEL_PMD) {
   46.63 @@ -444,9 +451,9 @@ static inline void mm_walk_set_prot(void
   46.64  
   46.65  	if (PageHighMem(page))
   46.66  		return;
   46.67 -	HYPERVISOR_update_va_mapping(
   46.68 +	BUG_ON(HYPERVISOR_update_va_mapping(
   46.69  		(unsigned long)__va(pfn << PAGE_SHIFT),
   46.70 -		pfn_pte(pfn, flags), 0);
   46.71 +		pfn_pte(pfn, flags), 0));
   46.72  }
   46.73  
   46.74  static void mm_walk(struct mm_struct *mm, pgprot_t flags)
   46.75 @@ -485,10 +492,10 @@ void mm_pin(struct mm_struct *mm)
   46.76      spin_lock(&mm->page_table_lock);
   46.77  
   46.78      mm_walk(mm, PAGE_KERNEL_RO);
   46.79 -    HYPERVISOR_update_va_mapping(
   46.80 +    BUG_ON(HYPERVISOR_update_va_mapping(
   46.81          (unsigned long)mm->pgd,
   46.82          pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL_RO),
   46.83 -        UVMF_TLB_FLUSH);
   46.84 +        UVMF_TLB_FLUSH));
   46.85      xen_pgd_pin(__pa(mm->pgd));
   46.86      mm->context.pinned = 1;
   46.87      spin_lock(&mm_unpinned_lock);
   46.88 @@ -503,9 +510,9 @@ void mm_unpin(struct mm_struct *mm)
   46.89      spin_lock(&mm->page_table_lock);
   46.90  
   46.91      xen_pgd_unpin(__pa(mm->pgd));
   46.92 -    HYPERVISOR_update_va_mapping(
   46.93 +    BUG_ON(HYPERVISOR_update_va_mapping(
   46.94          (unsigned long)mm->pgd,
   46.95 -        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0);
   46.96 +        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0));
   46.97      mm_walk(mm, PAGE_KERNEL);
   46.98      xen_tlb_flush();
   46.99      mm->context.pinned = 0;
    47.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile	Tue Aug 23 18:43:18 2005 -0800
    47.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile	Thu Aug 25 15:53:20 2005 -0700
    47.3 @@ -17,7 +17,7 @@ l-pci-y				+= irq.o
    47.4  c-pci-$(CONFIG_X86_VISWS)	:= visws.o fixup.o
    47.5  pci-$(CONFIG_X86_VISWS)		:=
    47.6  c-pci-$(CONFIG_X86_NUMAQ)	:= numa.o
    47.7 -pci-$(CONFIG_X86_NUMAQ)		:= irq.o
    47.8 +l-pci-$(CONFIG_X86_NUMAQ)	:= irq.o
    47.9  
   47.10  obj-y				+= $(pci-y)
   47.11  c-obj-y				+= $(c-pci-y) common.o
   47.12 @@ -27,6 +27,7 @@ c-link	:=
   47.13  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
   47.14  	@ln -fsn $(srctree)/arch/i386/pci/$(notdir $@) $@
   47.15  
   47.16 -obj-y	+= $(c-obj-y) $(l-pci-y)
   47.17 +# Make sure irq.o gets linked in before common.o
   47.18 +obj-y	+= $(patsubst common.o,$(l-pci-y) common.o,$(c-obj-y))
   47.19  
   47.20  clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
    48.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Tue Aug 23 18:43:18 2005 -0800
    48.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Thu Aug 25 15:53:20 2005 -0700
    48.3 @@ -116,9 +116,9 @@ extern asmlinkage unsigned int do_IRQ(st
    48.4  #elif defined (__x86_64__)
    48.5  #define IRQ_REG orig_rax
    48.6  #endif
    48.7 -#define do_IRQ(irq, regs) do {		\
    48.8 -    (regs)->IRQ_REG = (irq);		\
    48.9 -    do_IRQ((regs));			\
   48.10 +#define do_IRQ(irq, regs) do {                  \
   48.11 +    (regs)->IRQ_REG = (irq);                    \
   48.12 +    do_IRQ((regs));                             \
   48.13  } while (0)
   48.14  #endif
   48.15  
   48.16 @@ -137,14 +137,14 @@ void force_evtchn_callback(void)
   48.17  /* NB. Interrupts are disabled on entry. */
   48.18  asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
   48.19  {
   48.20 -    u32 	   l1, l2;
   48.21 +    u32     l1, l2;
   48.22      unsigned int   l1i, l2i, port;
   48.23      int            irq, cpu = smp_processor_id();
   48.24      shared_info_t *s = HYPERVISOR_shared_info;
   48.25      vcpu_info_t   *vcpu_info = &s->vcpu_data[cpu];
   48.26  
   48.27      vcpu_info->evtchn_upcall_pending = 0;
   48.28 -    
   48.29 +
   48.30      /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
   48.31      l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
   48.32      while ( l1 != 0 )
   48.33 @@ -158,9 +158,9 @@ asmlinkage void evtchn_do_upcall(struct 
   48.34              l2 &= ~(1 << l2i);
   48.35              
   48.36              port = (l1i << 5) + l2i;
   48.37 -            if ( (irq = evtchn_to_irq[port]) != -1 )
   48.38 +            if ( (irq = evtchn_to_irq[port]) != -1 ) {
   48.39                  do_IRQ(irq, regs);
   48.40 -            else
   48.41 +	    } else
   48.42                  evtchn_device_upcall(port);
   48.43          }
   48.44      }
   48.45 @@ -229,13 +229,14 @@ void unbind_virq_from_irq(int virq)
   48.46          if ( HYPERVISOR_event_channel_op(&op) != 0 )
   48.47              panic("Failed to unbind virtual IRQ %d\n", virq);
   48.48  
   48.49 -	/* This is a slight hack.  Interdomain ports can be allocated
   48.50 -	   directly by userspace, and at that point they get bound by
   48.51 -	   Xen to vcpu 0.  We therefore need to make sure that if we
   48.52 -	   get an event on an event channel we don't know about vcpu 0
   48.53 -	   handles it.  Binding channels to vcpu 0 when closing them
   48.54 -	   achieves this. */
   48.55 -	bind_evtchn_to_cpu(evtchn, 0);
   48.56 +        /*
   48.57 +         * This is a slight hack. Interdomain ports can be allocated directly 
   48.58 +         * by userspace, and at that point they get bound by Xen to vcpu 0. We 
   48.59 +         * therefore need to make sure that if we get an event on an event 
   48.60 +         * channel we don't know about vcpu 0 handles it. Binding channels to 
   48.61 +         * vcpu 0 when closing them achieves this.
   48.62 +         */
   48.63 +        bind_evtchn_to_cpu(evtchn, 0);
   48.64          evtchn_to_irq[evtchn] = -1;
   48.65          irq_to_evtchn[irq]    = -1;
   48.66          per_cpu(virq_to_irq, cpu)[virq]     = -1;
   48.67 @@ -244,7 +245,75 @@ void unbind_virq_from_irq(int virq)
   48.68      spin_unlock(&irq_mapping_update_lock);
   48.69  }
   48.70  
   48.71 -int bind_ipi_on_cpu_to_irq(int ipi)
   48.72 +/* This is only used when a vcpu from an xm save.  The ipi is expected
   48.73 +   to have been bound before we suspended, and so all of the xenolinux
   48.74 +   state is set up; we only need to restore the Xen side of things.
   48.75 +   The irq number has to be the same, but the evtchn number can
   48.76 +   change. */
   48.77 +void _bind_ipi_to_irq(int ipi, int vcpu, int irq)
   48.78 +{
   48.79 +    evtchn_op_t op;
   48.80 +    int evtchn;
   48.81 +
   48.82 +    spin_lock(&irq_mapping_update_lock);
   48.83 +
   48.84 +    op.cmd = EVTCHNOP_bind_ipi;
   48.85 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
   48.86 +	panic("Failed to bind virtual IPI %d on cpu %d\n", ipi, vcpu);
   48.87 +    evtchn = op.u.bind_ipi.port;
   48.88 +
   48.89 +    printk("<0>IPI %d, old evtchn %d, evtchn %d.\n",
   48.90 +	   ipi, per_cpu(ipi_to_evtchn, vcpu)[ipi],
   48.91 +	   evtchn);
   48.92 +
   48.93 +    evtchn_to_irq[irq_to_evtchn[irq]] = -1;
   48.94 +    irq_to_evtchn[irq] = -1;
   48.95 +
   48.96 +    evtchn_to_irq[evtchn] = irq;
   48.97 +    irq_to_evtchn[irq]    = evtchn;
   48.98 +
   48.99 +    printk("<0>evtchn_to_irq[%d] = %d.\n", evtchn,
  48.100 +	   evtchn_to_irq[evtchn]);
  48.101 +    per_cpu(ipi_to_evtchn, vcpu)[ipi] = evtchn;
  48.102 +
  48.103 +    bind_evtchn_to_cpu(evtchn, vcpu);
  48.104 +
  48.105 +    spin_unlock(&irq_mapping_update_lock);
  48.106 +
  48.107 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_mask);
  48.108 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_pending);
  48.109 +}
  48.110 +
  48.111 +void _bind_virq_to_irq(int virq, int cpu, int irq)
  48.112 +{
  48.113 +    evtchn_op_t op;
  48.114 +    int evtchn;
  48.115 +
  48.116 +    spin_lock(&irq_mapping_update_lock);
  48.117 +
  48.118 +    op.cmd              = EVTCHNOP_bind_virq;
  48.119 +    op.u.bind_virq.virq = virq;
  48.120 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.121 +            panic("Failed to bind virtual IRQ %d\n", virq);
  48.122 +    evtchn = op.u.bind_virq.port;
  48.123 +
  48.124 +    evtchn_to_irq[irq_to_evtchn[irq]] = -1;
  48.125 +    irq_to_evtchn[irq] = -1;
  48.126 +
  48.127 +    evtchn_to_irq[evtchn] = irq;
  48.128 +    irq_to_evtchn[irq]    = evtchn;
  48.129 +
  48.130 +    per_cpu(virq_to_irq, cpu)[virq] = irq;
  48.131 +
  48.132 +    bind_evtchn_to_cpu(evtchn, cpu);
  48.133 +
  48.134 +    spin_unlock(&irq_mapping_update_lock);
  48.135 +
  48.136 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_mask);
  48.137 +    clear_bit(evtchn, (unsigned long *)HYPERVISOR_shared_info->evtchn_pending);
  48.138 +}
  48.139 +
  48.140 +int bind_ipi_to_irq(int ipi)
  48.141  {
  48.142      evtchn_op_t op;
  48.143      int evtchn, irq;
  48.144 @@ -269,7 +338,7 @@ int bind_ipi_on_cpu_to_irq(int ipi)
  48.145      } 
  48.146      else
  48.147      {
  48.148 -	irq = evtchn_to_irq[evtchn];
  48.149 +        irq = evtchn_to_irq[evtchn];
  48.150      }
  48.151  
  48.152      irq_bindcount[irq]++;
  48.153 @@ -284,29 +353,29 @@ void unbind_ipi_from_irq(int ipi)
  48.154      evtchn_op_t op;
  48.155      int cpu    = smp_processor_id();
  48.156      int evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi];
  48.157 -    int irq    = irq_to_evtchn[evtchn];
  48.158 +    int irq    = evtchn_to_irq[evtchn];
  48.159  
  48.160      spin_lock(&irq_mapping_update_lock);
  48.161  
  48.162      if ( --irq_bindcount[irq] == 0 )
  48.163      {
  48.164 -	op.cmd          = EVTCHNOP_close;
  48.165 -	op.u.close.dom  = DOMID_SELF;
  48.166 -	op.u.close.port = evtchn;
  48.167 -	if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.168 -	    panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
  48.169 +        op.cmd          = EVTCHNOP_close;
  48.170 +        op.u.close.dom  = DOMID_SELF;
  48.171 +        op.u.close.port = evtchn;
  48.172 +        if ( HYPERVISOR_event_channel_op(&op) != 0 )
  48.173 +            panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
  48.174  
  48.175 -	/* See comments in unbind_virq_from_irq */
  48.176 -	bind_evtchn_to_cpu(evtchn, 0);
  48.177 +        /* See comments in unbind_virq_from_irq */
  48.178 +        bind_evtchn_to_cpu(evtchn, 0);
  48.179          evtchn_to_irq[evtchn] = -1;
  48.180          irq_to_evtchn[irq]    = -1;
  48.181 -	per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
  48.182 +        per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
  48.183      }
  48.184  
  48.185      spin_unlock(&irq_mapping_update_lock);
  48.186  }
  48.187  
  48.188 -int bind_evtchn_to_irq(int evtchn)
  48.189 +int bind_evtchn_to_irq(unsigned int evtchn)
  48.190  {
  48.191      int irq;
  48.192  
  48.193 @@ -326,7 +395,7 @@ int bind_evtchn_to_irq(int evtchn)
  48.194      return irq;
  48.195  }
  48.196  
  48.197 -void unbind_evtchn_from_irq(int evtchn)
  48.198 +void unbind_evtchn_from_irq(unsigned int evtchn)
  48.199  {
  48.200      int irq = evtchn_to_irq[evtchn];
  48.201  
  48.202 @@ -341,9 +410,36 @@ void unbind_evtchn_from_irq(int evtchn)
  48.203      spin_unlock(&irq_mapping_update_lock);
  48.204  }
  48.205  
  48.206 +int bind_evtchn_to_irqhandler(
  48.207 +    unsigned int evtchn,
  48.208 +    irqreturn_t (*handler)(int, void *, struct pt_regs *),
  48.209 +    unsigned long irqflags,
  48.210 +    const char *devname,
  48.211 +    void *dev_id)
  48.212 +{
  48.213 +    unsigned int irq;
  48.214 +    int retval;
  48.215 +
  48.216 +    irq = bind_evtchn_to_irq(evtchn);
  48.217 +    retval = request_irq(irq, handler, irqflags, devname, dev_id);
  48.218 +    if ( retval != 0 )
  48.219 +        unbind_evtchn_from_irq(evtchn);
  48.220 +
  48.221 +    return retval;
  48.222 +}
  48.223 +
  48.224 +void unbind_evtchn_from_irqhandler(unsigned int evtchn, void *dev_id)
  48.225 +{
  48.226 +    unsigned int irq = evtchn_to_irq[evtchn];
  48.227 +    free_irq(irq, dev_id);
  48.228 +    unbind_evtchn_from_irq(evtchn);
  48.229 +}
  48.230 +
  48.231 +#ifdef CONFIG_SMP
  48.232  static void do_nothing_function(void *ign)
  48.233  {
  48.234  }
  48.235 +#endif
  48.236  
  48.237  /* Rebind an evtchn so that it gets delivered to a specific cpu */
  48.238  static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
  48.239 @@ -354,38 +450,37 @@ static void rebind_irq_to_cpu(unsigned i
  48.240      spin_lock(&irq_mapping_update_lock);
  48.241      evtchn = irq_to_evtchn[irq];
  48.242      if (!VALID_EVTCHN(evtchn)) {
  48.243 -	spin_unlock(&irq_mapping_update_lock);
  48.244 -	return;
  48.245 +        spin_unlock(&irq_mapping_update_lock);
  48.246 +        return;
  48.247      }
  48.248  
  48.249 -    /* Tell Xen to send future instances of this interrupt to the
  48.250 -       other vcpu */
  48.251 +    /* Tell Xen to send future instances of this interrupt to other vcpu. */
  48.252      op.cmd = EVTCHNOP_bind_vcpu;
  48.253      op.u.bind_vcpu.port = evtchn;
  48.254      op.u.bind_vcpu.vcpu = tcpu;
  48.255  
  48.256 -    /* If this fails, it usually just indicates that we're dealing
  48.257 -       with a virq or IPI channel, which don't actually need to be
  48.258 -       rebound.  Ignore it, but don't do the xenlinux-level rebind
  48.259 -       in that case. */
  48.260 +    /*
  48.261 +     * If this fails, it usually just indicates that we're dealing with a virq 
  48.262 +     * or IPI channel, which don't actually need to be rebound. Ignore it, 
  48.263 +     * but don't do the xenlinux-level rebind in that case.
  48.264 +     */
  48.265      if (HYPERVISOR_event_channel_op(&op) >= 0)
  48.266 -	bind_evtchn_to_cpu(evtchn, tcpu);
  48.267 +        bind_evtchn_to_cpu(evtchn, tcpu);
  48.268  
  48.269      spin_unlock(&irq_mapping_update_lock);
  48.270  
  48.271 -    /* Now send the new target processor a NOP IPI.  When this
  48.272 -       returns, it will check for any pending interrupts, and so
  48.273 -       service any that got delivered to the wrong processor by
  48.274 -       mistake. */
  48.275 -    /* XXX: The only time this is called with interrupts disabled is
  48.276 -       from the hotplug/hotunplug path.  In that case, all cpus are
  48.277 -       stopped with interrupts disabled, and the missed interrupts
  48.278 -       will be picked up when they start again.  This is kind of a
  48.279 -       hack.
  48.280 -    */
  48.281 -    if (!irqs_disabled()) {
  48.282 -	smp_call_function(do_nothing_function, NULL, 0, 0);
  48.283 -    }
  48.284 +    /*
  48.285 +     * Now send the new target processor a NOP IPI. When this returns, it 
  48.286 +     * will check for any pending interrupts, and so service any that got 
  48.287 +     * delivered to the wrong processor by mistake.
  48.288 +     * 
  48.289 +     * XXX: The only time this is called with interrupts disabled is from the 
  48.290 +     * hotplug/hotunplug path. In that case, all cpus are stopped with 
  48.291 +     * interrupts disabled, and the missed interrupts will be picked up when 
  48.292 +     * they start again. This is kind of a hack.
  48.293 +     */
  48.294 +    if (!irqs_disabled())
  48.295 +        smp_call_function(do_nothing_function, NULL, 0, 0);
  48.296  }
  48.297  
  48.298  
  48.299 @@ -585,6 +680,16 @@ static struct hw_interrupt_type pirq_typ
  48.300      set_affinity_irq
  48.301  };
  48.302  
  48.303 +void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
  48.304 +{
  48.305 +    int evtchn = irq_to_evtchn[i];
  48.306 +    shared_info_t *s = HYPERVISOR_shared_info;
  48.307 +    if ( !VALID_EVTCHN(evtchn) )
  48.308 +        return;
  48.309 +    BUG_ON(!synch_test_bit(evtchn, &s->evtchn_mask[0]));
  48.310 +    synch_set_bit(evtchn, &s->evtchn_pending[0]);
  48.311 +}
  48.312 +
  48.313  void irq_suspend(void)
  48.314  {
  48.315      int pirq, virq, irq, evtchn;
  48.316 @@ -631,7 +736,7 @@ void irq_resume(void)
  48.317          evtchn = op.u.bind_virq.port;
  48.318          
  48.319          /* Record the new mapping. */
  48.320 -	bind_evtchn_to_cpu(evtchn, 0);
  48.321 +        bind_evtchn_to_cpu(evtchn, 0);
  48.322          evtchn_to_irq[evtchn] = irq;
  48.323          irq_to_evtchn[irq]    = evtchn;
  48.324  
  48.325 @@ -655,9 +760,9 @@ void __init init_IRQ(void)
  48.326  #endif
  48.327  
  48.328      for ( cpu = 0; cpu < NR_CPUS; cpu++ ) {
  48.329 -	/* No VIRQ -> IRQ mappings. */
  48.330 -	for ( i = 0; i < NR_VIRQS; i++ )
  48.331 -	    per_cpu(virq_to_irq, cpu)[i] = -1;
  48.332 +        /* No VIRQ -> IRQ mappings. */
  48.333 +        for ( i = 0; i < NR_VIRQS; i++ )
  48.334 +            per_cpu(virq_to_irq, cpu)[i] = -1;
  48.335      }
  48.336  
  48.337      /* No event-channel -> IRQ mappings. */
    49.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Tue Aug 23 18:43:18 2005 -0800
    49.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Aug 25 15:53:20 2005 -0700
    49.3 @@ -34,44 +34,90 @@
    49.4  
    49.5  
    49.6  EXPORT_SYMBOL(gnttab_grant_foreign_access);
    49.7 +EXPORT_SYMBOL(gnttab_end_foreign_access_ref);
    49.8  EXPORT_SYMBOL(gnttab_end_foreign_access);
    49.9  EXPORT_SYMBOL(gnttab_query_foreign_access);
   49.10  EXPORT_SYMBOL(gnttab_grant_foreign_transfer);
   49.11 +EXPORT_SYMBOL(gnttab_end_foreign_transfer_ref);
   49.12  EXPORT_SYMBOL(gnttab_end_foreign_transfer);
   49.13  EXPORT_SYMBOL(gnttab_alloc_grant_references);
   49.14  EXPORT_SYMBOL(gnttab_free_grant_references);
   49.15 +EXPORT_SYMBOL(gnttab_free_grant_reference);
   49.16  EXPORT_SYMBOL(gnttab_claim_grant_reference);
   49.17  EXPORT_SYMBOL(gnttab_release_grant_reference);
   49.18  EXPORT_SYMBOL(gnttab_grant_foreign_access_ref);
   49.19  EXPORT_SYMBOL(gnttab_grant_foreign_transfer_ref);
   49.20  
   49.21 -static grant_ref_t gnttab_free_list[NR_GRANT_ENTRIES];
   49.22 +#define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
   49.23 +#define GNTTAB_LIST_END (NR_GRANT_ENTRIES + 1)
   49.24 +
   49.25 +static grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
   49.26 +static int gnttab_free_count = NR_GRANT_ENTRIES;
   49.27  static grant_ref_t gnttab_free_head;
   49.28 +static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
   49.29  
   49.30  static grant_entry_t *shared;
   49.31  
   49.32 -/*
   49.33 - * Lock-free grant-entry allocator
   49.34 - */
   49.35 +static struct gnttab_free_callback *gnttab_free_callback_list = NULL;
   49.36  
   49.37 -static inline int
   49.38 -get_free_entry(
   49.39 -    void)
   49.40 +static int
   49.41 +get_free_entries(int count)
   49.42  {
   49.43 -    grant_ref_t fh, nfh = gnttab_free_head;
   49.44 -    do { if ( unlikely((fh = nfh) == NR_GRANT_ENTRIES) ) return -1; }
   49.45 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh,
   49.46 -                                    gnttab_free_list[fh])) != fh) );
   49.47 -    return fh;
   49.48 +    unsigned long flags;
   49.49 +    int ref;
   49.50 +    grant_ref_t head;
   49.51 +    spin_lock_irqsave(&gnttab_list_lock, flags);
   49.52 +    if (gnttab_free_count < count) {
   49.53 +	spin_unlock_irqrestore(&gnttab_list_lock, flags);
   49.54 +	return -1;
   49.55 +    }
   49.56 +    ref = head = gnttab_free_head;
   49.57 +    gnttab_free_count -= count;
   49.58 +    while (count-- > 1)
   49.59 +	head = gnttab_list[head];
   49.60 +    gnttab_free_head = gnttab_list[head];
   49.61 +    gnttab_list[head] = GNTTAB_LIST_END;
   49.62 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
   49.63 +    return ref;
   49.64 +}
   49.65 +
   49.66 +#define get_free_entry() get_free_entries(1)
   49.67 +
   49.68 +static void
   49.69 +do_free_callbacks(void)
   49.70 +{
   49.71 +    struct gnttab_free_callback *callback = gnttab_free_callback_list, *next;
   49.72 +    gnttab_free_callback_list = NULL;
   49.73 +    while (callback) {
   49.74 +	next = callback->next;
   49.75 +	if (gnttab_free_count >= callback->count) {
   49.76 +	    callback->next = NULL;
   49.77 +	    callback->fn(callback->arg);
   49.78 +	} else {
   49.79 +	    callback->next = gnttab_free_callback_list;
   49.80 +	    gnttab_free_callback_list = callback;
   49.81 +	}
   49.82 +	callback = next;
   49.83 +    }
   49.84  }
   49.85  
   49.86  static inline void
   49.87 -put_free_entry(
   49.88 -    grant_ref_t ref)
   49.89 +check_free_callbacks(void)
   49.90  {
   49.91 -    grant_ref_t fh, nfh = gnttab_free_head;
   49.92 -    do { gnttab_free_list[ref] = fh = nfh; wmb(); }
   49.93 -    while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh, ref)) != fh) );
   49.94 +    if (unlikely(gnttab_free_callback_list))
   49.95 +	do_free_callbacks();
   49.96 +}
   49.97 +
   49.98 +static void
   49.99 +put_free_entry(grant_ref_t ref)
  49.100 +{
  49.101 +    unsigned long flags;
  49.102 +    spin_lock_irqsave(&gnttab_list_lock, flags);
  49.103 +    gnttab_list[ref] = gnttab_free_head;
  49.104 +    gnttab_free_head = ref;
  49.105 +    gnttab_free_count++;
  49.106 +    check_free_callbacks();
  49.107 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
  49.108  }
  49.109  
  49.110  /*
  49.111 @@ -79,8 +125,7 @@ put_free_entry(
  49.112   */
  49.113  
  49.114  int
  49.115 -gnttab_grant_foreign_access(
  49.116 -    domid_t domid, unsigned long frame, int readonly)
  49.117 +gnttab_grant_foreign_access(domid_t domid, unsigned long frame, int readonly)
  49.118  {
  49.119      int ref;
  49.120      
  49.121 @@ -96,8 +141,8 @@ gnttab_grant_foreign_access(
  49.122  }
  49.123  
  49.124  void
  49.125 -gnttab_grant_foreign_access_ref(
  49.126 -    grant_ref_t ref, domid_t domid, unsigned long frame, int readonly)
  49.127 +gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
  49.128 +				unsigned long frame, int readonly)
  49.129  {
  49.130      shared[ref].frame = frame;
  49.131      shared[ref].domid = domid;
  49.132 @@ -107,7 +152,7 @@ gnttab_grant_foreign_access_ref(
  49.133  
  49.134  
  49.135  int
  49.136 -gnttab_query_foreign_access( grant_ref_t ref )
  49.137 +gnttab_query_foreign_access(grant_ref_t ref)
  49.138  {
  49.139      u16 nflags;
  49.140  
  49.141 @@ -117,7 +162,7 @@ gnttab_query_foreign_access( grant_ref_t
  49.142  }
  49.143  
  49.144  void
  49.145 -gnttab_end_foreign_access( grant_ref_t ref, int readonly )
  49.146 +gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly)
  49.147  {
  49.148      u16 flags, nflags;
  49.149  
  49.150 @@ -127,13 +172,17 @@ gnttab_end_foreign_access( grant_ref_t r
  49.151              printk(KERN_ALERT "WARNING: g.e. still in use!\n");
  49.152      }
  49.153      while ( (nflags = synch_cmpxchg(&shared[ref].flags, flags, 0)) != flags );
  49.154 +}
  49.155  
  49.156 +void
  49.157 +gnttab_end_foreign_access(grant_ref_t ref, int readonly)
  49.158 +{
  49.159 +    gnttab_end_foreign_access_ref(ref, readonly);
  49.160      put_free_entry(ref);
  49.161  }
  49.162  
  49.163  int
  49.164 -gnttab_grant_foreign_transfer(
  49.165 -    domid_t domid, unsigned long pfn )
  49.166 +gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn)
  49.167  {
  49.168      int ref;
  49.169  
  49.170 @@ -149,8 +198,8 @@ gnttab_grant_foreign_transfer(
  49.171  }
  49.172  
  49.173  void
  49.174 -gnttab_grant_foreign_transfer_ref(
  49.175 -    grant_ref_t ref, domid_t domid, unsigned long pfn )
  49.176 +gnttab_grant_foreign_transfer_ref(grant_ref_t ref, domid_t domid,
  49.177 +				  unsigned long pfn)
  49.178  {
  49.179      shared[ref].frame = pfn;
  49.180      shared[ref].domid = domid;
  49.181 @@ -159,21 +208,13 @@ gnttab_grant_foreign_transfer_ref(
  49.182  }
  49.183  
  49.184  unsigned long
  49.185 -gnttab_end_foreign_transfer(
  49.186 -    grant_ref_t ref)
  49.187 +gnttab_end_foreign_transfer_ref(grant_ref_t ref)
  49.188  {
  49.189      unsigned long frame = 0;
  49.190      u16           flags;
  49.191  
  49.192      flags = shared[ref].flags;
  49.193 -#ifdef CONFIG_XEN_NETDEV_GRANT_RX
  49.194 -    /*
  49.195 -     * But can't flags == (GTF_accept_transfer | GTF_transfer_completed)
  49.196 -     * if gnttab_donate executes without interruption???
  49.197 -     */
  49.198 -#else
  49.199 -    ASSERT(flags == (GTF_accept_transfer | GTF_transfer_committed));
  49.200 -#endif
  49.201 +
  49.202      /*
  49.203       * If a transfer is committed then wait for the frame address to appear.
  49.204       * Otherwise invalidate the grant entry against future use.
  49.205 @@ -183,67 +224,93 @@ gnttab_end_foreign_transfer(
  49.206          while ( unlikely((frame = shared[ref].frame) == 0) )
  49.207              cpu_relax();
  49.208  
  49.209 +    return frame;
  49.210 +}
  49.211 +
  49.212 +unsigned long
  49.213 +gnttab_end_foreign_transfer(grant_ref_t ref)
  49.214 +{
  49.215 +    unsigned long frame = gnttab_end_foreign_transfer_ref(ref);
  49.216      put_free_entry(ref);
  49.217 -
  49.218      return frame;
  49.219  }
  49.220  
  49.221  void
  49.222 -gnttab_free_grant_references( u16 count, grant_ref_t head )
  49.223 +gnttab_free_grant_reference(grant_ref_t ref)
  49.224  {
  49.225 -    /* TODO: O(N)...? */
  49.226 -    grant_ref_t to_die = 0, next = head;
  49.227 -    int i;
  49.228  
  49.229 -    for ( i = 0; i < count; i++ )
  49.230 -    {
  49.231 -        to_die = next;
  49.232 -        next = gnttab_free_list[next];
  49.233 -        put_free_entry( to_die );
  49.234 +    put_free_entry(ref);
  49.235 +}
  49.236 +
  49.237 +void
  49.238 +gnttab_free_grant_references(grant_ref_t head)
  49.239 +{
  49.240 +    grant_ref_t ref;
  49.241 +    unsigned long flags;
  49.242 +    int count = 1;
  49.243 +    if (head == GNTTAB_LIST_END)
  49.244 +	return;
  49.245 +    spin_lock_irqsave(&gnttab_list_lock, flags);
  49.246 +    ref = head;
  49.247 +    while (gnttab_list[ref] != GNTTAB_LIST_END) {
  49.248 +	ref = gnttab_list[ref];
  49.249 +	count++;
  49.250      }
  49.251 +    gnttab_list[ref] = gnttab_free_head;
  49.252 +    gnttab_free_head = head;
  49.253 +    gnttab_free_count += count;
  49.254 +    check_free_callbacks();
  49.255 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
  49.256  }
  49.257  
  49.258  int
  49.259 -gnttab_alloc_grant_references( u16 count,
  49.260 -                               grant_ref_t *head,
  49.261 -                               grant_ref_t *terminal )
  49.262 +gnttab_alloc_grant_references(u16 count, grant_ref_t *head)
  49.263  {
  49.264 -    int i;
  49.265 -    grant_ref_t h = gnttab_free_head;
  49.266 +    int h = get_free_entries(count);
  49.267  
  49.268 -    for ( i = 0; i < count; i++ )
  49.269 -        if ( unlikely(get_free_entry() == -1) )
  49.270 -            goto not_enough_refs;
  49.271 +    if (h == -1)
  49.272 +	return -ENOSPC;
  49.273  
  49.274      *head = h;
  49.275 -    *terminal = gnttab_free_head;
  49.276  
  49.277      return 0;
  49.278 -
  49.279 -not_enough_refs:
  49.280 -    gnttab_free_head = h;
  49.281 -    return -ENOSPC;
  49.282  }
  49.283  
  49.284  int
  49.285 -gnttab_claim_grant_reference( grant_ref_t *private_head,
  49.286 -                              grant_ref_t  terminal )
  49.287 +gnttab_claim_grant_reference(grant_ref_t *private_head)
  49.288  {
  49.289 -    grant_ref_t g;
  49.290 -    if ( unlikely((g = *private_head) == terminal) )
  49.291 +    grant_ref_t g = *private_head;
  49.292 +    if (unlikely(g == GNTTAB_LIST_END))
  49.293          return -ENOSPC;
  49.294 -    *private_head = gnttab_free_list[g];
  49.295 +    *private_head = gnttab_list[g];
  49.296      return g;
  49.297  }
  49.298  
  49.299  void
  49.300 -gnttab_release_grant_reference( grant_ref_t *private_head,
  49.301 -                                grant_ref_t  release )
  49.302 +gnttab_release_grant_reference(grant_ref_t *private_head, grant_ref_t  release)
  49.303  {
  49.304 -    gnttab_free_list[release] = *private_head;
  49.305 +    gnttab_list[release] = *private_head;
  49.306      *private_head = release;
  49.307  }
  49.308  
  49.309 +void
  49.310 +gnttab_request_free_callback(struct gnttab_free_callback *callback,
  49.311 +			     void (*fn)(void *), void *arg, u16 count)
  49.312 +{
  49.313 +    unsigned long flags;
  49.314 +    spin_lock_irqsave(&gnttab_list_lock, flags);
  49.315 +    if (callback->next)
  49.316 +	goto out;
  49.317 +    callback->fn = fn;
  49.318 +    callback->arg = arg;
  49.319 +    callback->count = count;
  49.320 +    callback->next = gnttab_free_callback_list;
  49.321 +    gnttab_free_callback_list = callback;
  49.322 +    check_free_callbacks();
  49.323 + out:
  49.324 +    spin_unlock_irqrestore(&gnttab_list_lock, flags);
  49.325 +}
  49.326 +
  49.327  /*
  49.328   * ProcFS operations
  49.329   */
  49.330 @@ -252,8 +319,9 @@ gnttab_release_grant_reference( grant_re
  49.331  
  49.332  static struct proc_dir_entry *grant_pde;
  49.333  
  49.334 -static int grant_ioctl(struct inode *inode, struct file *file,
  49.335 -                       unsigned int cmd, unsigned long data)
  49.336 +static int
  49.337 +grant_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
  49.338 +	    unsigned long data)
  49.339  {
  49.340      int                     ret;
  49.341      privcmd_hypercall_t     hypercall;
  49.342 @@ -291,8 +359,9 @@ static struct file_operations grant_file
  49.343      ioctl:  grant_ioctl,
  49.344  };
  49.345  
  49.346 -static int grant_read(char *page, char **start, off_t off,
  49.347 -                      int count, int *eof, void *data)
  49.348 +static int
  49.349 +grant_read(char *page, char **start, off_t off, int count, int *eof,
  49.350 +	   void *data)
  49.351  {
  49.352      int             len;
  49.353      unsigned int    i;
  49.354 @@ -321,8 +390,9 @@ static int grant_read(char *page, char *
  49.355      return len;
  49.356  }
  49.357  
  49.358 -static int grant_write(struct file *file, const char __user *buffer,
  49.359 -                       unsigned long count, void *data)
  49.360 +static int
  49.361 +grant_write(struct file *file, const char __user *buffer, unsigned long count,
  49.362 +	    void *data)
  49.363  {
  49.364      /* TODO: implement this */
  49.365      return -ENOSYS;
  49.366 @@ -330,7 +400,8 @@ static int grant_write(struct file *file
  49.367  
  49.368  #endif /* CONFIG_PROC_FS */
  49.369  
  49.370 -int gnttab_resume(void)
  49.371 +int
  49.372 +gnttab_resume(void)
  49.373  {
  49.374      gnttab_setup_table_t setup;
  49.375      unsigned long        frames[NR_GRANT_FRAMES];
  49.376 @@ -349,7 +420,8 @@ int gnttab_resume(void)
  49.377      return 0;
  49.378  }
  49.379  
  49.380 -int gnttab_suspend(void)
  49.381 +int
  49.382 +gnttab_suspend(void)
  49.383  {
  49.384      int i;
  49.385  
  49.386 @@ -359,7 +431,8 @@ int gnttab_suspend(void)
  49.387      return 0;
  49.388  }
  49.389  
  49.390 -static int __init gnttab_init(void)
  49.391 +static int __init
  49.392 +gnttab_init(void)
  49.393  {
  49.394      int i;
  49.395  
  49.396 @@ -368,7 +441,7 @@ static int __init gnttab_init(void)
  49.397      shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
  49.398  
  49.399      for ( i = 0; i < NR_GRANT_ENTRIES; i++ )
  49.400 -        gnttab_free_list[i] = i + 1;
  49.401 +        gnttab_list[i] = i + 1;
  49.402      
  49.403  #ifdef CONFIG_PROC_FS
  49.404      /*
    50.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Aug 23 18:43:18 2005 -0800
    50.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Thu Aug 25 15:53:20 2005 -0700
    50.3 @@ -1,7 +1,4 @@
    50.4 -
    50.5  #define __KERNEL_SYSCALLS__
    50.6 -static int errno;
    50.7 -#include <linux/errno.h>
    50.8  #include <linux/version.h>
    50.9  #include <linux/kernel.h>
   50.10  #include <linux/mm.h>
   50.11 @@ -9,13 +6,23 @@ static int errno;
   50.12  #include <linux/module.h>
   50.13  #include <linux/reboot.h>
   50.14  #include <linux/sysrq.h>
   50.15 +#include <linux/stringify.h>
   50.16  #include <asm/irq.h>
   50.17  #include <asm/mmu_context.h>
   50.18 -#include <asm-xen/ctrl_if.h>
   50.19 +#include <asm-xen/evtchn.h>
   50.20  #include <asm-xen/hypervisor.h>
   50.21  #include <asm-xen/xen-public/dom0_ops.h>
   50.22  #include <asm-xen/linux-public/suspend.h>
   50.23  #include <asm-xen/queues.h>
   50.24 +#include <asm-xen/xenbus.h>
   50.25 +#include <asm-xen/ctrl_if.h>
   50.26 +#include <linux/cpu.h>
   50.27 +#include <linux/kthread.h>
   50.28 +
   50.29 +#define SHUTDOWN_INVALID  -1
   50.30 +#define SHUTDOWN_POWEROFF  0
   50.31 +#define SHUTDOWN_REBOOT    1
   50.32 +#define SHUTDOWN_SUSPEND   2
   50.33  
   50.34  void machine_restart(char * __unused)
   50.35  {
   50.36 @@ -51,30 +58,76 @@ EXPORT_SYMBOL(machine_power_off);
   50.37   */
   50.38  
   50.39  /* Ignore multiple shutdown requests. */
   50.40 -static int shutting_down = -1;
   50.41 +static int shutting_down = SHUTDOWN_INVALID;
   50.42  
   50.43 -static void __do_suspend(void)
   50.44 +#ifndef CONFIG_HOTPLUG_CPU
   50.45 +#define cpu_down(x) (-EOPNOTSUPP)
   50.46 +#define cpu_up(x) (-EOPNOTSUPP)
   50.47 +#endif
   50.48 +
   50.49 +static void save_vcpu_context(int vcpu, vcpu_guest_context_t *ctxt)
   50.50 +{
   50.51 +    int r;
   50.52 +    int gdt_pages;
   50.53 +    r = HYPERVISOR_vcpu_pickle(vcpu, ctxt);
   50.54 +    if (r != 0)
   50.55 +	panic("pickling vcpu %d -> %d!\n", vcpu, r);
   50.56 +
   50.57 +    /* Translate from machine to physical addresses where necessary,
   50.58 +       so that they can be translated to our new machine address space
   50.59 +       after resume.  libxc is responsible for doing this to vcpu0,
   50.60 +       but we do it to the others. */
   50.61 +    gdt_pages = (ctxt->gdt_ents + 511) / 512;
   50.62 +    ctxt->ctrlreg[3] = machine_to_phys(ctxt->ctrlreg[3]);
   50.63 +    for (r = 0; r < gdt_pages; r++)
   50.64 +	ctxt->gdt_frames[r] = mfn_to_pfn(ctxt->gdt_frames[r]);
   50.65 +}
   50.66 +
   50.67 +void _restore_vcpu(int cpu);
   50.68 +
   50.69 +atomic_t vcpus_rebooting;
   50.70 +
   50.71 +static int restore_vcpu_context(int vcpu, vcpu_guest_context_t *ctxt)
   50.72 +{
   50.73 +    int r;
   50.74 +    int gdt_pages = (ctxt->gdt_ents + 511) / 512;
   50.75 +
   50.76 +    /* This is kind of a hack, and implicitly relies on the fact that
   50.77 +       the vcpu stops in a place where all of the call clobbered
   50.78 +       registers are already dead. */
   50.79 +    ctxt->user_regs.esp -= 4;
   50.80 +    ((unsigned long *)ctxt->user_regs.esp)[0] = ctxt->user_regs.eip;
   50.81 +    ctxt->user_regs.eip = (unsigned long)_restore_vcpu;
   50.82 +
   50.83 +    /* De-canonicalise.  libxc handles this for vcpu 0, but we need
   50.84 +       to do it for the other vcpus. */
   50.85 +    ctxt->ctrlreg[3] = phys_to_machine(ctxt->ctrlreg[3]);
   50.86 +    for (r = 0; r < gdt_pages; r++)
   50.87 +	ctxt->gdt_frames[r] = pfn_to_mfn(ctxt->gdt_frames[r]);
   50.88 +
   50.89 +    atomic_set(&vcpus_rebooting, 1);
   50.90 +    r = HYPERVISOR_boot_vcpu(vcpu, ctxt);
   50.91 +    if (r != 0) {
   50.92 +	printk(KERN_EMERG "Failed to reboot vcpu %d (%d)\n", vcpu, r);
   50.93 +	return -1;
   50.94 +    }
   50.95 +
   50.96 +    /* Make sure we wait for the new vcpu to come up before trying to do
   50.97 +       anything with it or starting the next one. */
   50.98 +    while (atomic_read(&vcpus_rebooting))
   50.99 +	barrier();
  50.100 +
  50.101 +    return 0;
  50.102 +}
  50.103 +
  50.104 +static int __do_suspend(void *ignore)
  50.105  {
  50.106      int i, j;
  50.107      suspend_record_t *suspend_record;
  50.108 +    static vcpu_guest_context_t suspended_cpu_records[NR_CPUS];
  50.109  
  50.110      /* Hmmm... a cleaner interface to suspend/resume blkdevs would be nice. */
  50.111  	/* XXX SMH: yes it would :-( */	
  50.112 -#ifdef CONFIG_XEN_BLKDEV_FRONTEND
  50.113 -    extern void blkdev_suspend(void);
  50.114 -    extern void blkdev_resume(void);
  50.115 -#else
  50.116 -#define blkdev_suspend() do{}while(0)
  50.117 -#define blkdev_resume()  do{}while(0)
  50.118 -#endif
  50.119 -
  50.120 -#ifdef CONFIG_XEN_NETDEV_FRONTEND
  50.121 -    extern void netif_suspend(void);
  50.122 -    extern void netif_resume(void);  
  50.123 -#else
  50.124 -#define netif_suspend() do{}while(0)
  50.125 -#define netif_resume()  do{}while(0)
  50.126 -#endif
  50.127  
  50.128  #ifdef CONFIG_XEN_USB_FRONTEND
  50.129      extern void usbif_resume();
  50.130 @@ -82,37 +135,88 @@ static void __do_suspend(void)
  50.131  #define usbif_resume() do{}while(0)
  50.132  #endif
  50.133  
  50.134 -#ifdef CONFIG_XEN_BLKDEV_GRANT
  50.135      extern int gnttab_suspend(void);
  50.136      extern int gnttab_resume(void);
  50.137 -#else
  50.138 -#define gnttab_suspend() do{}while(0)
  50.139 -#define gnttab_resume()  do{}while(0)
  50.140 +
  50.141 +#ifdef CONFIG_SMP
  50.142 +    extern void smp_suspend(void);
  50.143 +    extern void smp_resume(void);
  50.144  #endif
  50.145 -
  50.146      extern void time_suspend(void);
  50.147      extern void time_resume(void);
  50.148      extern unsigned long max_pfn;
  50.149      extern unsigned int *pfn_to_mfn_frame_list;
  50.150  
  50.151 +    cpumask_t prev_online_cpus, prev_present_cpus;
  50.152 +    int err = 0;
  50.153 +
  50.154 +    BUG_ON(smp_processor_id() != 0);
  50.155 +    BUG_ON(in_interrupt());
  50.156 +
  50.157 +#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
  50.158 +    if (num_online_cpus() > 1) {
  50.159 +	printk(KERN_WARNING "Can't suspend SMP guests without CONFIG_HOTPLUG_CPU\n");
  50.160 +	return -EOPNOTSUPP;
  50.161 +    }
  50.162 +#endif
  50.163 +
  50.164      suspend_record = (suspend_record_t *)__get_free_page(GFP_KERNEL);
  50.165      if ( suspend_record == NULL )
  50.166          goto out;
  50.167  
  50.168 +    /* Take all of the other cpus offline.  We need to be careful not
  50.169 +       to get preempted between the final test for num_online_cpus()
  50.170 +       == 1 and disabling interrupts, since otherwise userspace could
  50.171 +       bring another cpu online, and then we'd be stuffed.  At the
  50.172 +       same time, cpu_down can reschedule, so we need to enable
  50.173 +       preemption while doing that.  This kind of sucks, but should be
  50.174 +       correct. */
  50.175 +    /* (We don't need to worry about other cpus bringing stuff up,
  50.176 +       since by the time num_online_cpus() == 1, there aren't any
  50.177 +       other cpus) */
  50.178 +    cpus_clear(prev_online_cpus);
  50.179 +    preempt_disable();
  50.180 +    while (num_online_cpus() > 1) {
  50.181 +	preempt_enable();
  50.182 +	for_each_online_cpu(i) {
  50.183 +	    if (i == 0)
  50.184 +		continue;
  50.185 +	    err = cpu_down(i);
  50.186 +	    if (err != 0) {
  50.187 +		printk(KERN_CRIT "Failed to take all CPUs down: %d.\n", err);
  50.188 +		goto out_reenable_cpus;
  50.189 +	    }
  50.190 +	    cpu_set(i, prev_online_cpus);
  50.191 +	}
  50.192 +	preempt_disable();
  50.193 +    }
  50.194 +
  50.195      suspend_record->nr_pfns = max_pfn; /* final number of pfns */
  50.196  
  50.197      __cli();
  50.198  
  50.199 +    preempt_enable();
  50.200 +
  50.201 +    cpus_clear(prev_present_cpus);
  50.202 +    for_each_present_cpu(i) {
  50.203 +	if (i == 0)
  50.204 +	    continue;
  50.205 +	save_vcpu_context(i, &suspended_cpu_records[i]);
  50.206 +	cpu_set(i, prev_present_cpus);
  50.207 +    }
  50.208 +
  50.209  #ifdef __i386__
  50.210      mm_pin_all();
  50.211      kmem_cache_shrink(pgd_cache);
  50.212  #endif
  50.213  
  50.214 -    netif_suspend();
  50.215 +    time_suspend();
  50.216  
  50.217 -    blkdev_suspend();
  50.218 +#ifdef CONFIG_SMP
  50.219 +    smp_suspend();
  50.220 +#endif
  50.221  
  50.222 -    time_suspend();
  50.223 +    xenbus_suspend();
  50.224  
  50.225      ctrl_if_suspend();
  50.226  
  50.227 @@ -126,9 +230,11 @@ static void __do_suspend(void)
  50.228      memcpy(&suspend_record->resume_info, &xen_start_info,
  50.229             sizeof(xen_start_info));
  50.230  
  50.231 -    HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT);
  50.232 +    /* We'll stop somewhere inside this hypercall.  When it returns,
  50.233 +       we'll start resuming after the restore. */
  50.234 +    HYPERVISOR_suspend(virt_to_mfn(suspend_record));
  50.235  
  50.236 -    shutting_down = -1; 
  50.237 +    shutting_down = SHUTDOWN_INVALID; 
  50.238  
  50.239      memcpy(&xen_start_info, &suspend_record->resume_info,
  50.240             sizeof(xen_start_info));
  50.241 @@ -142,10 +248,10 @@ static void __do_suspend(void)
  50.242      for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
  50.243      {
  50.244          pfn_to_mfn_frame_list[j] = 
  50.245 -            virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
  50.246 +            virt_to_mfn(&phys_to_machine_mapping[i]);
  50.247      }
  50.248      HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
  50.249 -        virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
  50.250 +        virt_to_mfn(pfn_to_mfn_frame_list);
  50.251  
  50.252      gnttab_resume();
  50.253  
  50.254 @@ -153,19 +259,36 @@ static void __do_suspend(void)
  50.255  
  50.256      ctrl_if_resume();
  50.257  
  50.258 -    time_resume();
  50.259 +    xenbus_resume();
  50.260  
  50.261 -    blkdev_resume();
  50.262 +#ifdef CONFIG_SMP
  50.263 +    smp_resume();
  50.264 +#endif
  50.265  
  50.266 -    netif_resume();
  50.267 +    time_resume();
  50.268  
  50.269      usbif_resume();
  50.270  
  50.271 +    for_each_cpu_mask(i, prev_present_cpus) {
  50.272 +	restore_vcpu_context(i, &suspended_cpu_records[i]);
  50.273 +    }
  50.274 +
  50.275      __sti();
  50.276  
  50.277 + out_reenable_cpus:
  50.278 +    for_each_cpu_mask(i, prev_online_cpus) {
  50.279 +	j = cpu_up(i);
  50.280 +	if (j != 0) {
  50.281 +	    printk(KERN_CRIT "Failed to bring cpu %d back up (%d).\n",
  50.282 +		   i, j);
  50.283 +	    err = j;
  50.284 +	}
  50.285 +    }
  50.286 +
  50.287   out:
  50.288      if ( suspend_record != NULL )
  50.289          free_page((unsigned long)suspend_record);
  50.290 +    return err;
  50.291  }
  50.292  
  50.293  static int shutdown_process(void *__unused)
  50.294 @@ -186,7 +309,7 @@ static int shutdown_process(void *__unus
  50.295  
  50.296      switch ( shutting_down )
  50.297      {
  50.298 -    case CMSG_SHUTDOWN_POWEROFF:
  50.299 +    case SHUTDOWN_POWEROFF:
  50.300          if ( execve("/sbin/poweroff", poweroff_argv, envp) < 0 )
  50.301          {
  50.302              sys_reboot(LINUX_REBOOT_MAGIC1,
  50.303 @@ -196,7 +319,7 @@ static int shutdown_process(void *__unus
  50.304          }
  50.305          break;
  50.306  
  50.307 -    case CMSG_SHUTDOWN_REBOOT:
  50.308 +    case SHUTDOWN_REBOOT:
  50.309          if ( execve("/sbin/reboot", restart_argv, envp) < 0 )
  50.310          {
  50.311              sys_reboot(LINUX_REBOOT_MAGIC1,
  50.312 @@ -207,16 +330,28 @@ static int shutdown_process(void *__unus
  50.313          break;
  50.314      }
  50.315  
  50.316 -    shutting_down = -1; /* could try again */
  50.317 +    shutting_down = SHUTDOWN_INVALID; /* could try again */
  50.318  
  50.319      return 0;
  50.320  }
  50.321  
  50.322 +static struct task_struct *kthread_create_on_cpu(int (*f)(void *arg),
  50.323 +						 void *arg,
  50.324 +						 const char *name,
  50.325 +						 int cpu)
  50.326 +{
  50.327 +    struct task_struct *p;
  50.328 +    p = kthread_create(f, arg, name);
  50.329 +    kthread_bind(p, cpu);
  50.330 +    wake_up_process(p);
  50.331 +    return p;
  50.332 +}
  50.333 +
  50.334  static void __shutdown_handler(void *unused)
  50.335  {
  50.336      int err;
  50.337  
  50.338 -    if ( shutting_down != CMSG_SHUTDOWN_SUSPEND )
  50.339 +    if ( shutting_down != SHUTDOWN_SUSPEND )
  50.340      {
  50.341          err = kernel_thread(shutdown_process, NULL, CLONE_FS | CLONE_FILES);
  50.342          if ( err < 0 )
  50.343 @@ -224,46 +359,121 @@ static void __shutdown_handler(void *unu
  50.344      }
  50.345      else
  50.346      {
  50.347 -        __do_suspend();
  50.348 +	kthread_create_on_cpu(__do_suspend, NULL, "suspender", 0);
  50.349      }
  50.350  }
  50.351  
  50.352 -static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
  50.353 +static void shutdown_handler(struct xenbus_watch *watch, const char *node)
  50.354  {
  50.355      static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
  50.356  
  50.357 -    if ( msg->subtype == CMSG_SHUTDOWN_SYSRQ )
  50.358 -    {
  50.359 -	int sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
  50.360 -	
  50.361 +    char *str;
  50.362 +
  50.363 +    str = (char *)xenbus_read("control", "shutdown", NULL);
  50.364 +    /* Ignore read errors. */
  50.365 +    if (IS_ERR(str))
  50.366 +        return;
  50.367 +    if (strlen(str) == 0) {
  50.368 +        kfree(str);
  50.369 +        return;
  50.370 +    }
  50.371 +
  50.372 +    xenbus_write("control", "shutdown", "", O_CREAT);
  50.373 +
  50.374 +    if (strcmp(str, "poweroff") == 0)
  50.375 +        shutting_down = SHUTDOWN_POWEROFF;
  50.376 +    else if (strcmp(str, "reboot") == 0)
  50.377 +        shutting_down = SHUTDOWN_REBOOT;
  50.378 +    else if (strcmp(str, "suspend") == 0)
  50.379 +        shutting_down = SHUTDOWN_SUSPEND;
  50.380 +    else {
  50.381 +        printk("Ignoring shutdown request: %s\n", str);
  50.382 +        shutting_down = SHUTDOWN_INVALID;
  50.383 +    }
  50.384 +
  50.385 +    kfree(str);
  50.386 +
  50.387 +    if (shutting_down != SHUTDOWN_INVALID)
  50.388 +        schedule_work(&shutdown_work);
  50.389 +}
  50.390 +
  50.391  #ifdef CONFIG_MAGIC_SYSRQ
  50.392 +static void sysrq_handler(struct xenbus_watch *watch, const char *node)
  50.393 +{
  50.394 +    char sysrq_key = '\0';
  50.395 +    
  50.396 +    if (!xenbus_scanf("control", "sysrq", "%c", &sysrq_key)) {
  50.397 +        printk(KERN_ERR "Unable to read sysrq code in control/sysrq\n");
  50.398 +        return;
  50.399 +    }
  50.400 +
  50.401 +    xenbus_printf("control", "sysrq", "%c", '\0');
  50.402 +
  50.403 +    if (sysrq_key != '\0') {
  50.404 +
  50.405  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  50.406 -	handle_sysrq(sysrq, NULL, NULL);
  50.407 +        handle_sysrq(sysrq_key, NULL, NULL);
  50.408  #else
  50.409 -	handle_sysrq(sysrq, NULL, NULL, NULL);
  50.410 -#endif
  50.411 +        handle_sysrq(sysrq_key, NULL, NULL, NULL);
  50.412  #endif
  50.413      }
  50.414 -    else if ( (shutting_down == -1) &&
  50.415 -         ((msg->subtype == CMSG_SHUTDOWN_POWEROFF) ||
  50.416 -          (msg->subtype == CMSG_SHUTDOWN_REBOOT) ||
  50.417 -          (msg->subtype == CMSG_SHUTDOWN_SUSPEND)) )
  50.418 -    {
  50.419 -        shutting_down = msg->subtype;
  50.420 -        schedule_work(&shutdown_work);
  50.421 +}
  50.422 +#endif
  50.423 +
  50.424 +static struct xenbus_watch shutdown_watch = {
  50.425 +    .node = "control/shutdown",
  50.426 +    .callback = shutdown_handler
  50.427 +};
  50.428 +
  50.429 +#ifdef CONFIG_MAGIC_SYSRQ
  50.430 +static struct xenbus_watch sysrq_watch = {
  50.431 +    .node ="control/sysrq",
  50.432 +    .callback = sysrq_handler
  50.433 +};
  50.434 +#endif
  50.435 +
  50.436 +static struct notifier_block xenstore_notifier;
  50.437 +
  50.438 +/* Setup our watcher
  50.439 +   NB: Assumes xenbus_lock is held!
  50.440 +*/
  50.441 +static int setup_shutdown_watcher(struct notifier_block *notifier,
  50.442 +                                  unsigned long event,
  50.443 +                                  void *data)
  50.444 +{
  50.445 +    int err1 = 0;
  50.446 +#ifdef CONFIG_MAGIC_SYSRQ
  50.447 +    int err2 = 0;
  50.448 +#endif
  50.449 +
  50.450 +    BUG_ON(down_trylock(&xenbus_lock) == 0);
  50.451 +
  50.452 +    err1 = register_xenbus_watch(&shutdown_watch);
  50.453 +#ifdef CONFIG_MAGIC_SYSRQ
  50.454 +    err2 = register_xenbus_watch(&sysrq_watch);
  50.455 +#endif
  50.456 +
  50.457 +    if (err1) {
  50.458 +        printk(KERN_ERR "Failed to set shutdown watcher\n");
  50.459      }
  50.460 -    else
  50.461 -    {
  50.462 -        printk("Ignore spurious shutdown request\n");
  50.463 +    
  50.464 +#ifdef CONFIG_MAGIC_SYSRQ
  50.465 +    if (err2) {
  50.466 +        printk(KERN_ERR "Failed to set sysrq watcher\n");
  50.467      }
  50.468 +#endif
  50.469  
  50.470 -    ctrl_if_send_response(msg);
  50.471 +    return NOTIFY_DONE;
  50.472  }
  50.473  
  50.474  static int __init setup_shutdown_event(void)
  50.475  {
  50.476 -    ctrl_if_register_receiver(CMSG_SHUTDOWN, shutdown_handler, 0);
  50.477 +    
  50.478 +    xenstore_notifier.notifier_call = setup_shutdown_watcher;
  50.479 +
  50.480 +    register_xenstore_notifier(&xenstore_notifier);
  50.481 +    
  50.482      return 0;
  50.483  }
  50.484  
  50.485 -__initcall(setup_shutdown_event);
  50.486 +subsys_initcall(setup_shutdown_event);
    51.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Tue Aug 23 18:43:18 2005 -0800
    51.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Thu Aug 25 15:53:20 2005 -0700
    51.3 @@ -5,8 +5,6 @@
    51.4  #include <linux/kernel.h>
    51.5  #include <linux/sched.h>
    51.6  #include <linux/slab.h>
    51.7 -#include <linux/string.h>
    51.8 -#include <linux/errno.h>
    51.9  #include <linux/netdevice.h>
   51.10  #include <linux/inetdevice.h>
   51.11  #include <linux/etherdevice.h>
   51.12 @@ -14,34 +12,86 @@
   51.13  #include <linux/init.h>
   51.14  #include <asm/io.h>
   51.15  #include <asm/page.h>
   51.16 -
   51.17 -EXPORT_SYMBOL(__dev_alloc_skb);
   51.18 +#include <asm-xen/hypervisor.h>
   51.19  
   51.20  /* Referenced in netback.c. */
   51.21  /*static*/ kmem_cache_t *skbuff_cachep;
   51.22  
   51.23 -/* Size must be cacheline-aligned (alloc_skb uses SKB_DATA_ALIGN). */
   51.24 -#define XEN_SKB_SIZE \
   51.25 -    ((PAGE_SIZE - sizeof(struct skb_shared_info)) & ~(SMP_CACHE_BYTES - 1))
   51.26 +#define MAX_SKBUFF_ORDER 2
   51.27 +static kmem_cache_t *skbuff_order_cachep[MAX_SKBUFF_ORDER + 1];
   51.28  
   51.29  struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
   51.30  {
   51.31 -    struct sk_buff *skb;
   51.32 -    skb = alloc_skb_from_cache(skbuff_cachep, length + 16, gfp_mask);
   51.33 -    if ( likely(skb != NULL) )
   51.34 -        skb_reserve(skb, 16);
   51.35 -    return skb;
   51.36 +	struct sk_buff *skb;
   51.37 +	int order;
   51.38 +
   51.39 +	length = SKB_DATA_ALIGN(length + 16);
   51.40 +	order = get_order(length + sizeof(struct skb_shared_info));
   51.41 +	if (order > MAX_SKBUFF_ORDER) {
   51.42 +		printk(KERN_ALERT "Attempt to allocate order %d skbuff. "
   51.43 +		       "Increase MAX_SKBUFF_ORDER.\n", order);
   51.44 +		return NULL;
   51.45 +	}
   51.46 +
   51.47 +	skb = alloc_skb_from_cache(
   51.48 +		skbuff_order_cachep[order], length, gfp_mask);
   51.49 +	if (skb != NULL)
   51.50 +		skb_reserve(skb, 16);
   51.51 +
   51.52 +	return skb;
   51.53  }
   51.54  
   51.55  static void skbuff_ctor(void *buf, kmem_cache_t *cachep, unsigned long unused)
   51.56  {
   51.57 -    scrub_pages(buf, 1);
   51.58 +	int order = 0;
   51.59 +
   51.60 +	while (skbuff_order_cachep[order] != cachep)
   51.61 +		order++;
   51.62 +
   51.63 +	if (order != 0)
   51.64 +		xen_create_contiguous_region((unsigned long)buf, order);
   51.65 +
   51.66 +	scrub_pages(buf, 1 << order);
   51.67 +}
   51.68 +
   51.69 +static void skbuff_dtor(void *buf, kmem_cache_t *cachep, unsigned long unused)
   51.70 +{
   51.71 +	int order = 0;
   51.72 +
   51.73 +	while (skbuff_order_cachep[order] != cachep)
   51.74 +		order++;
   51.75 +
   51.76 +	if (order != 0)
   51.77 +		xen_destroy_contiguous_region((unsigned long)buf, order);
   51.78  }
   51.79  
   51.80  static int __init skbuff_init(void)
   51.81  {
   51.82 -    skbuff_cachep = kmem_cache_create(
   51.83 -        "xen-skb", PAGE_SIZE, PAGE_SIZE, 0, skbuff_ctor, NULL);
   51.84 -    return 0;
   51.85 +	static char name[MAX_SKBUFF_ORDER + 1][20];
   51.86 +	unsigned long size;
   51.87 +	int order;
   51.88 +
   51.89 +	for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
   51.90 +		size = PAGE_SIZE << order;
   51.91 +		sprintf(name[order], "xen-skb-%lu", size);
   51.92 +		skbuff_order_cachep[order] = kmem_cache_create(
   51.93 +			name[order], size, size, 0, skbuff_ctor, skbuff_dtor);
   51.94 +	}
   51.95 +
   51.96 +	skbuff_cachep = skbuff_order_cachep[0];
   51.97 +
   51.98 +	return 0;
   51.99  }
  51.100  __initcall(skbuff_init);
  51.101 +
  51.102 +EXPORT_SYMBOL(__dev_alloc_skb);
  51.103 +
  51.104 +/*
  51.105 + * Local variables:
  51.106 + *  c-file-style: "linux"
  51.107 + *  indent-tabs-mode: t
  51.108 + *  c-indent-level: 8
  51.109 + *  c-basic-offset: 8
  51.110 + *  tab-width: 8
  51.111 + * End:
  51.112 + */
    52.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig	Tue Aug 23 18:43:18 2005 -0800
    52.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig	Thu Aug 25 15:53:20 2005 -0700
    52.3 @@ -126,6 +126,10 @@ config X86_IO_APIC
    52.4  	bool
    52.5  	default XEN_PRIVILEGED_GUEST
    52.6  
    52.7 +config X86_XEN_GENAPIC
    52.8 +	bool
    52.9 +	default XEN_PRIVILEGED_GUEST || SMP
   52.10 +
   52.11  config X86_LOCAL_APIC
   52.12  	bool
   52.13  	default XEN_PRIVILEGED_GUEST
   52.14 @@ -325,12 +329,12 @@ config GART_IOMMU
   52.15  # need this always enabled with GART_IOMMU for the VIA workaround
   52.16  config SWIOTLB
   52.17         bool
   52.18 -       depends on GART_IOMMU
   52.19 +       depends on PCI
   52.20         default y
   52.21  
   52.22  config DUMMY_IOMMU
   52.23  	bool
   52.24 -	depends on !GART_IOMMU && !SWIOTLB
   52.25 +	depends on !GART_IOMMU
   52.26  	default y
   52.27  	help
   52.28  	  Don't use IOMMU code. This will cause problems when you have more than 4GB
    53.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/Makefile	Tue Aug 23 18:43:18 2005 -0800
    53.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/Makefile	Thu Aug 25 15:53:20 2005 -0700
    53.3 @@ -79,14 +79,15 @@ xenflags-y += -Iinclude/asm-xen/asm-x86_
    53.4  CFLAGS += $(xenflags-y)
    53.5  AFLAGS += $(xenflags-y)
    53.6  
    53.7 -prepare: include/asm-$(XENARCH)/asm_offset.h
    53.8 -CLEAN_FILES += include/asm-$(XENARCH)/asm_offset.h
    53.9 +prepare: include/asm-$(XENARCH)/asm_offsets.h
   53.10 +CLEAN_FILES += include/asm-$(XENARCH)/asm_offsets.h
   53.11  
   53.12  arch/$(XENARCH)/kernel/asm-offsets.s: include/asm include/.asm-ignore \
   53.13  	include/linux/version.h include/config/MARKER
   53.14  
   53.15 +include/asm-$(XENARCH)/offset.h: arch/$(XENARCH)/kernel/asm-offsets.s
   53.16 +	$(call filechk,gen-asm-offsets)
   53.17  
   53.18 -include/asm-$(XENARCH)/asm_offset.h: arch/xen/x86_64/kernel/asm-offsets.s
   53.19 -	$(call filechk,gen-asm-offsets)
   53.20 -	ln -fsn asm_offset.h include/asm-$(XENARCH)/offset.h
   53.21 -
   53.22 +include/asm-$(XENARCH)/asm_offsets.h: include/asm-$(XENARCH)/offset.h
   53.23 +	ln -fsn offset.h include/asm-$(XENARCH)/asm_offsets.h
   53.24 +	ln -fsn offset.h include/asm-$(XENARCH)/asm_offset.h
    54.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Tue Aug 23 18:43:18 2005 -0800
    54.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Thu Aug 25 15:53:20 2005 -0700
    54.3 @@ -36,8 +36,8 @@ quiet_cmd_syscall = SYSCALL $@
    54.4  	$(call if_changed,syscall)
    54.5  
    54.6  AFLAGS_vsyscall-int80.o = -m32 -I$(obj)
    54.7 -AFLAGS_vsyscall-sysenter.o = -m32
    54.8 -AFLAGS_vsyscall-syscall.o = -m32
    54.9 +AFLAGS_vsyscall-sysenter.o = -m32 -I$(obj)
   54.10 +AFLAGS_vsyscall-syscall.o = -m32 -I$(obj)
   54.11  CFLAGS_ia32_ioctl.o += -Ifs/
   54.12  
   54.13  s-link	:= vsyscall-syscall.o vsyscall-sysenter.o vsyscall-sigreturn.o
   54.14 @@ -48,13 +48,11 @@ s-link	:= vsyscall-syscall.o vsyscall-sy
   54.15  $(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)) $(patsubst %.o,$(obj)/%.S,$(s-obj-y) $(s-link)):
   54.16  	@ln -fsn $(srctree)/arch/x86_64/ia32/$(notdir $@) $@
   54.17  
   54.18 -$(obj)/vsyscall-int80.S: $(obj)/vsyscall-sigreturn.S ../../i386/kernel/vsyscall-note.S
   54.19 -$(obj)/vsyscall-sysenter.S: $(obj)/vsyscall-sigreturn.S
   54.20 -$(obj)/vsyscall-syscall.S: $(obj)/vsyscall-sigreturn.S
   54.21 +$(obj)/vsyscall-int80.o $(obj)/vsyscall-sysenter.o $(obj)/vsyscall-syscall.o: \
   54.22 +	$(obj)/vsyscall-sigreturn.S $(obj)/../../i386/kernel/vsyscall-note.S
   54.23  
   54.24 -../../i386/kernel/vsyscall-note.S:
   54.25 -	@ln -fsn $(srctree)/arch/i386/kernel/$(notdir $@) $(srctree)/arch/xen/i386/kernel/$(notdir $@)
   54.26 -	make -C arch/xen/i386/kernel vsyscall-note.S
   54.27 +$(obj)/../../i386/kernel/vsyscall-note.S:
   54.28 +	@ln -fsn $(srctree)/arch/i386/kernel/$(notdir $@) $@
   54.29  
   54.30  obj-y	+= $(c-obj-y) $(s-obj-y)
   54.31  
    55.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c	Tue Aug 23 18:43:18 2005 -0800
    55.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c	Thu Aug 25 15:53:20 2005 -0700
    55.3 @@ -128,8 +128,12 @@ static int __init init_syscall32(void)
    55.4  #endif
    55.5  	return 0;
    55.6  } 
    55.7 -	
    55.8 -__initcall(init_syscall32); 
    55.9 +
   55.10 +/*
   55.11 + * This must be done early in case we have an initrd containing 32-bit
   55.12 + * binaries (e.g., hotplug). This could be pushed upstream to arch/x86_64.
   55.13 + */	
   55.14 +core_initcall(init_syscall32); 
   55.15  
   55.16  /* May not be __init: called during resume */
   55.17  void syscall32_cpu_init(void)
    56.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile	Tue Aug 23 18:43:18 2005 -0800
    56.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile	Thu Aug 25 15:53:20 2005 -0700
    56.3 @@ -25,30 +25,32 @@ obj-$(CONFIG_ACPI_BOOT)		+= acpi/
    56.4  c-obj-$(CONFIG_X86_MSR)		+= msr.o
    56.5  obj-$(CONFIG_MICROCODE)		+= microcode.o
    56.6  obj-$(CONFIG_X86_CPUID)		+= cpuid.o
    56.7 -#obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
    56.8 +obj-$(CONFIG_SMP)		+= smp.o smpboot.o
    56.9  obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o
   56.10  c-obj-$(CONFIG_X86_LOCAL_APIC)	+= nmi.o
   56.11  obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o mpparse.o
   56.12 -c-obj-$(CONFIG_X86_IO_APIC)	+= genapic.o genapic_cluster.o genapic_flat.o
   56.13 +obj-$(CONFIG_X86_XEN_GENAPIC)	+= genapic.o genapic_xen.o
   56.14 +c-obj-$(CONFIG_X86_IO_APIC)	+= genapic_cluster.o genapic_flat.o
   56.15  #obj-$(CONFIG_PM)		+= suspend.o
   56.16  #obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
   56.17  #obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
   56.18  #obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
   56.19  #obj-$(CONFIG_GART_IOMMU)	+= pci-gart.o aperture.o
   56.20 -c-obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
   56.21 -#obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
   56.22 +obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o
   56.23 +i386-obj-$(CONFIG_DUMMY_IOMMU)	+= pci-dma.o
   56.24 +i386-obj-$(CONFIG_SWIOTLB)	+= swiotlb.o
   56.25  obj-$(CONFIG_KPROBES)		+= kprobes.o
   56.26  obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer.o
   56.27  
   56.28  c-obj-$(CONFIG_MODULES)		+= module.o
   56.29  
   56.30 -#obj-y				+= topology.o
   56.31 +obj-y				+= topology.o
   56.32  c-obj-y				+= intel_cacheinfo.o
   56.33  
   56.34  bootflag-y			+= ../../../i386/kernel/bootflag.o
   56.35  cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../../i386/kernel/cpuid.o
   56.36  topology-y                     += ../../../i386/mach-default/topology.o
   56.37 -swiotlb-$(CONFIG_SWIOTLB)      += ../../../ia64/lib/swiotlb.o
   56.38 +#swiotlb-$(CONFIG_SWIOTLB)      += ../../../ia64/lib/swiotlb.o
   56.39  microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../../i386/kernel/microcode.o
   56.40  intel_cacheinfo-y		+= ../../../i386/kernel/cpu/intel_cacheinfo.o
   56.41  quirks-y			+= ../../i386/kernel/quirks.o
    57.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c	Tue Aug 23 18:43:18 2005 -0800
    57.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c	Thu Aug 25 15:53:20 2005 -0700
    57.3 @@ -45,10 +45,11 @@ int disable_apic;
    57.4  
    57.5  void smp_local_timer_interrupt(struct pt_regs *regs)
    57.6  {
    57.7 +
    57.8 +	profile_tick(CPU_PROFILING, regs);
    57.9 +#ifndef CONFIG_XEN
   57.10  	int cpu = smp_processor_id();
   57.11  
   57.12 -	profile_tick(CPU_PROFILING, regs);
   57.13 -#if 0
   57.14  	if (--per_cpu(prof_counter, cpu) <= 0) {
   57.15  		/*
   57.16  		 * The multiplier may have changed since the last time we got
    58.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/asm-offsets.c	Tue Aug 23 18:43:18 2005 -0800
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,70 +0,0 @@
    58.4 -/*
    58.5 - * Generate definitions needed by assembly language modules.
    58.6 - * This code generates raw asm output which is post-processed to extract
    58.7 - * and format the required data.
    58.8 - */
    58.9 -
   58.10 -#include <linux/sched.h> 
   58.11 -#include <linux/stddef.h>
   58.12 -#include <linux/errno.h> 
   58.13 -#include <linux/hardirq.h>
   58.14 -#include <linux/suspend.h>
   58.15 -#include <asm/pda.h>
   58.16 -#include <asm/processor.h>
   58.17 -#include <asm/segment.h>
   58.18 -#include <asm/thread_info.h>
   58.19 -#include <asm/ia32.h>
   58.20 -
   58.21 -#define DEFINE(sym, val) \
   58.22 -        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
   58.23 -
   58.24 -#define BLANK() asm volatile("\n->" : : )
   58.25 -
   58.26 -int main(void)
   58.27 -{
   58.28 -#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
   58.29 -	ENTRY(state);
   58.30 -	ENTRY(flags); 
   58.31 -	ENTRY(thread); 
   58.32 -	ENTRY(pid);
   58.33 -	BLANK();
   58.34 -#undef ENTRY
   58.35 -#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry))
   58.36 -	ENTRY(flags);
   58.37 -	ENTRY(addr_limit);
   58.38 -	ENTRY(preempt_count);
   58.39 -	BLANK();
   58.40 -#undef ENTRY
   58.41 -#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
   58.42 -	ENTRY(kernelstack); 
   58.43 -	ENTRY(oldrsp); 
   58.44 -	ENTRY(pcurrent); 
   58.45 -	ENTRY(irqrsp);
   58.46 -	ENTRY(irqcount);
   58.47 -	ENTRY(cpunumber);
   58.48 -	ENTRY(irqstackptr);
   58.49 -	ENTRY(kernel_mode);
   58.50 -	BLANK();
   58.51 -#undef ENTRY
   58.52 -#ifdef CONFIG_IA32_EMULATION
   58.53 -#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
   58.54 -	ENTRY(eax);
   58.55 -	ENTRY(ebx);
   58.56 -	ENTRY(ecx);
   58.57 -	ENTRY(edx);
   58.58 -	ENTRY(esi);
   58.59 -	ENTRY(edi);
   58.60 -	ENTRY(ebp);
   58.61 -	ENTRY(esp);
   58.62 -	ENTRY(eip);
   58.63 -	BLANK();
   58.64 -#undef ENTRY
   58.65 -	DEFINE(IA32_RT_SIGFRAME_sigcontext,
   58.66 -	       offsetof (struct rt_sigframe32, uc.uc_mcontext));
   58.67 -	BLANK();
   58.68 -#endif
   58.69 -	DEFINE(pbe_address, offsetof(struct pbe, address));
   58.70 -	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
   58.71 -	DEFINE(pbe_next, offsetof(struct pbe, next));
   58.72 -	return 0;
   58.73 -}
    59.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Tue Aug 23 18:43:18 2005 -0800
    59.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Thu Aug 25 15:53:20 2005 -0700
    59.3 @@ -46,7 +46,7 @@ void __init add_memory_region(unsigned l
    59.4  	e820.nr_map++;
    59.5  }
    59.6  
    59.7 -#if 0
    59.8 +#ifndef CONFIG_XEN
    59.9  extern char _end[];
   59.10  
   59.11  /* 
   59.12 @@ -235,7 +235,6 @@ void __init e820_reserve_resources(void)
   59.13  	}
   59.14  }
   59.15  
   59.16 -
   59.17  void __init e820_print_map(char *who)
   59.18  {
   59.19  	int i;
   59.20 @@ -516,10 +515,32 @@ void __init setup_memory_region(void)
   59.21  	printk(KERN_INFO "BIOS-provided physical RAM map:\n");
   59.22  	e820_print_map(who);
   59.23  }
   59.24 +
   59.25 +#else  /* CONFIX_XEN */
   59.26 +extern unsigned long xen_override_max_pfn;
   59.27 +extern union xen_start_info_union xen_start_info_union;
   59.28 +/*
   59.29 + * Guest physical starts from 0.
   59.30 + */
   59.31 +unsigned long __init e820_end_of_ram(void)
   59.32 +{
   59.33 +        unsigned long max_end_pfn = xen_start_info.nr_pages;
   59.34 +
   59.35 +	if ( xen_override_max_pfn <  max_end_pfn)
   59.36 +		xen_override_max_pfn = max_end_pfn;
   59.37 +	
   59.38 +        return xen_override_max_pfn;
   59.39 +}
   59.40 +
   59.41 +
   59.42 +
   59.43 +void __init e820_reserve_resources(void) 
   59.44 +{
   59.45 +	return;			/* Xen won't have reserved entries */
   59.46 +}
   59.47 +
   59.48  #endif
   59.49  
   59.50 -extern unsigned long xen_override_max_pfn;
   59.51 -
   59.52  void __init parse_memopt(char *p, char **from) 
   59.53  { 
   59.54  	end_user_pfn = memparse(p, from);
    60.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c	Tue Aug 23 18:43:18 2005 -0800
    60.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c	Thu Aug 25 15:53:20 2005 -0700
    60.3 @@ -6,6 +6,8 @@
    60.4  #include <asm/io.h>
    60.5  #include <asm/processor.h>
    60.6  
    60.7 +#ifndef CONFIG_XEN
    60.8 +
    60.9  /* Simple VGA output */
   60.10  
   60.11  #ifdef __i386__
   60.12 @@ -59,7 +61,6 @@ static struct console early_vga_console 
   60.13  	.index =	-1,
   60.14  };
   60.15  
   60.16 -#ifndef CONFIG_XEN
   60.17  /* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ 
   60.18  
   60.19  static int early_serial_base = 0x3f8;  /* ttyS0 */
   60.20 @@ -148,7 +149,8 @@ static __init void early_serial_init(cha
   60.21  	outb((divisor >> 8) & 0xff, early_serial_base + DLH); 
   60.22  	outb(c & ~DLAB, early_serial_base + LCR);
   60.23  }
   60.24 -#else
   60.25 +
   60.26 +#else /* CONFIG_XEN */
   60.27  
   60.28  static void
   60.29  early_serial_write(struct console *con, const char *s, unsigned count)
   60.30 @@ -167,6 +169,13 @@ early_serial_write(struct console *con, 
   60.31  static __init void early_serial_init(char *s)
   60.32  {
   60.33  }
   60.34 +
   60.35 +/*
   60.36 + * No early VGA console on Xen, as we do not have convenient ISA-space
   60.37 + * mappings. Someone should fix this for domain 0. For now, use fake serial.
   60.38 + */
   60.39 +#define early_vga_console early_serial_console
   60.40 +
   60.41  #endif
   60.42  
   60.43  static struct console early_serial_console = {
    61.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S	Tue Aug 23 18:43:18 2005 -0800
    61.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S	Thu Aug 25 15:53:20 2005 -0700
    61.3 @@ -128,7 +128,6 @@
    61.4           * #define VGCF_IN_SYSCALL (1<<8) 
    61.5           */
    61.6          .macro SWITCH_TO_USER flag
    61.7 -        movl $0,%gs:pda_kernel_mode     # change to user mode
    61.8          subq $8*4,%rsp                   # reuse rip, cs, rflags, rsp, ss in the stack
    61.9          movq %rax,(%rsp)
   61.10          movq %r11,1*8(%rsp)
   61.11 @@ -139,7 +138,6 @@
   61.12          .endm
   61.13  
   61.14          .macro SWITCH_TO_KERNEL ssoff,adjust=0
   61.15 -  	btsq $0,%gs:pda_kernel_mode
   61.16  	jc  1f
   61.17  	orb  $1,\ssoff-\adjust+4(%rsp)
   61.18  1:
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic.c	Thu Aug 25 15:53:20 2005 -0700
    62.3 @@ -0,0 +1,123 @@
    62.4 +/*
    62.5 + * Copyright 2004 James Cleverdon, IBM.
    62.6 + * Subject to the GNU Public License, v.2
    62.7 + *
    62.8 + * Generic APIC sub-arch probe layer.
    62.9 + *
   62.10 + * Hacked for x86-64 by James Cleverdon from i386 architecture code by
   62.11 + * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
   62.12 + * James Cleverdon.
   62.13 + */
   62.14 +#include <linux/config.h>
   62.15 +#include <linux/threads.h>
   62.16 +#include <linux/cpumask.h>
   62.17 +#include <linux/string.h>
   62.18 +#include <linux/kernel.h>
   62.19 +#include <linux/ctype.h>
   62.20 +#include <linux/init.h>
   62.21 +#include <linux/module.h>
   62.22 +
   62.23 +#include <asm/smp.h>
   62.24 +#include <asm/ipi.h>
   62.25 +
   62.26 +#if defined(CONFIG_ACPI_BUS)
   62.27 +#include <acpi/acpi_bus.h>
   62.28 +#endif
   62.29 +
   62.30 +/* which logical CPU number maps to which CPU (physical APIC ID) */
   62.31 +u8 x86_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
   62.32 +EXPORT_SYMBOL(x86_cpu_to_apicid);
   62.33 +u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
   62.34 +
   62.35 +extern struct genapic apic_cluster;
   62.36 +extern struct genapic apic_flat;
   62.37 +
   62.38 +#ifndef CONFIG_XEN
   62.39 +struct genapic *genapic = &apic_flat;
   62.40 +#else
   62.41 +extern struct genapic apic_xen;
   62.42 +struct genapic *genapic = &apic_xen;
   62.43 +#endif
   62.44 +
   62.45 +
   62.46 +/*
   62.47 + * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
   62.48 + */
   62.49 +void __init clustered_apic_check(void)
   62.50 +{
   62.51 +#ifndef CONFIG_XEN
   62.52 +	long i;
   62.53 +	u8 clusters, max_cluster;
   62.54 +	u8 id;
   62.55 +	u8 cluster_cnt[NUM_APIC_CLUSTERS];
   62.56 +
   62.57 +	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
   62.58 +		/* AMD always uses flat mode right now */
   62.59 +		genapic = &apic_flat;
   62.60 +		goto print;
   62.61 +	}
   62.62 +
   62.63 +#if defined(CONFIG_ACPI_BUS)
   62.64 +	/*
   62.65 +	 * Some x86_64 machines use physical APIC mode regardless of how many
   62.66 +	 * procs/clusters are present (x86_64 ES7000 is an example).
   62.67 +	 */
   62.68 +	if (acpi_fadt.revision > FADT2_REVISION_ID)
   62.69 +		if (acpi_fadt.force_apic_physical_destination_mode) {
   62.70 +			genapic = &apic_cluster;
   62.71 +			goto print;
   62.72 +		}
   62.73 +#endif
   62.74 +
   62.75 +	memset(cluster_cnt, 0, sizeof(cluster_cnt));
   62.76 +
   62.77 +	for (i = 0; i < NR_CPUS; i++) {
   62.78 +		id = bios_cpu_apicid[i];
   62.79 +		if (id != BAD_APICID)
   62.80 +			cluster_cnt[APIC_CLUSTERID(id)]++;
   62.81 +	}
   62.82 +
   62.83 +	clusters = 0;
   62.84 +	max_cluster = 0;
   62.85 +	for (i = 0; i < NUM_APIC_CLUSTERS; i++) {
   62.86 +		if (cluster_cnt[i] > 0) {
   62.87 +			++clusters;
   62.88 +			if (cluster_cnt[i] > max_cluster)
   62.89 +				max_cluster = cluster_cnt[i];
   62.90 +		}
   62.91 +	}
   62.92 +
   62.93 +	/*
   62.94 +	 * If we have clusters <= 1 and CPUs <= 8 in cluster 0, then flat mode,
   62.95 +	 * else if max_cluster <= 4 and cluster_cnt[15] == 0, clustered logical
   62.96 +	 * else physical mode.
   62.97 +	 * (We don't use lowest priority delivery + HW APIC IRQ steering, so
   62.98 +	 * can ignore the clustered logical case and go straight to physical.)
   62.99 +	 */
  62.100 +	if (clusters <= 1 && max_cluster <= 8 && cluster_cnt[0] == max_cluster)
  62.101 +		genapic = &apic_flat;
  62.102 +	else
  62.103 +		genapic = &apic_cluster;
  62.104 +
  62.105 +print:
  62.106 +#else
  62.107 +	/* hardcode to xen apic functions */
  62.108 +	genapic = &apic_xen;
  62.109 +#endif
  62.110 +	printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name);
  62.111 +}
  62.112 +
  62.113 +/* Same for both flat and clustered. */
  62.114 +
  62.115 +#ifdef CONFIG_XEN
  62.116 +extern void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest);
  62.117 +#endif
  62.118 +
  62.119 +void send_IPI_self(int vector)
  62.120 +{
  62.121 +#ifndef CONFIG_XEN
  62.122 +	__send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
  62.123 +#else
  62.124 +	xen_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
  62.125 +#endif
  62.126 +}
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic_xen.c	Thu Aug 25 15:53:20 2005 -0700
    63.3 @@ -0,0 +1,167 @@
    63.4 +/*
    63.5 + * Copyright 2004 James Cleverdon, IBM.
    63.6 + * Subject to the GNU Public License, v.2
    63.7 + *
    63.8 + * Xen APIC subarch code.  Maximum 8 CPUs, logical delivery.
    63.9 + *
   63.10 + * Hacked for x86-64 by James Cleverdon from i386 architecture code by
   63.11 + * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
   63.12 + * James Cleverdon.
   63.13 + *
   63.14 + * Hacked to pieces for Xen by Chris Wright.
   63.15 + */
   63.16 +#include <linux/config.h>
   63.17 +#include <linux/threads.h>
   63.18 +#include <linux/cpumask.h>
   63.19 +#include <linux/string.h>
   63.20 +#include <linux/kernel.h>
   63.21 +#include <linux/ctype.h>
   63.22 +#include <linux/init.h>
   63.23 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
   63.24 +#include <asm/smp.h>
   63.25 +#include <asm/ipi.h>
   63.26 +#else
   63.27 +#include <asm/apic.h>
   63.28 +#include <asm/apicdef.h>
   63.29 +#include <asm/genapic.h>
   63.30 +#endif
   63.31 +#include <asm-xen/evtchn.h>
   63.32 +
   63.33 +DECLARE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
   63.34 +
   63.35 +static inline void __send_IPI_one(unsigned int cpu, int vector)
   63.36 +{
   63.37 +	unsigned int evtchn;
   63.38 +	Dprintk("%s\n", __FUNCTION__);
   63.39 +
   63.40 +	evtchn = per_cpu(ipi_to_evtchn, cpu)[vector];
   63.41 +	if (evtchn)
   63.42 +		notify_via_evtchn(evtchn);
   63.43 +	else
   63.44 +		printk("send_IPI to unbound port %d/%d", cpu, vector);
   63.45 +}
   63.46 +
   63.47 +void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
   63.48 +{
   63.49 +	int cpu;
   63.50 +
   63.51 +	switch (shortcut) {
   63.52 +	case APIC_DEST_SELF:
   63.53 +		__send_IPI_one(smp_processor_id(), vector);
   63.54 +		break;
   63.55 +	case APIC_DEST_ALLBUT:
   63.56 +		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
   63.57 +			if (cpu == smp_processor_id())
   63.58 +				continue;
   63.59 +			if (cpu_isset(cpu, cpu_online_map)) {
   63.60 +				__send_IPI_one(cpu, vector);
   63.61 +			}
   63.62 +		}
   63.63 +		break;
   63.64 +	case