ia64/xen-unstable

changeset 4445:174a86411818

bitkeeper revision 1.1236.54.1 (424f001fylJD_smguTvRssBAMspunA)

First code drop for x86-64 support; further clenaups still required.

Signed-Off-By: Asit Mallick <asit.k.mallick@intel.com>
Signed-Off-By: Arun Sharma <arun.sharma@intel.com>
Signed-Off-By: Benjamin Liu <Benjamin.liu@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk[cl349]
date Sat Apr 02 20:27:11 2005 +0000 (2005-04-02)
parents e7f3366cfafd
children 7e49a7314748
files .rootkeys linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64 linux-2.6.11-xen-sparse/arch/xen/x86_64/Kconfig linux-2.6.11-xen-sparse/arch/xen/x86_64/Makefile linux-2.6.11-xen-sparse/arch/xen/x86_64/defconfig linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/Makefile linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/asm-offsets.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/e820.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/early_printk.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head.S linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head64.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/init_task.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ioport.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/irq.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ldt.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-nommu.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup64.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/signal.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smp.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smpboot.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/time.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/traps.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/vsyscall.c linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/x8664_ksyms.c linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/Makefile linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/fault.c linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/init.c linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/ioremap.c linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/pageattr.c linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile-BUS linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/arch_hooks.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/fixmap.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/floppy.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/io.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/irq.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/io_ports.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/irq_vectors.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_time.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_timer.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_pre.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/smpboot_hooks.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/page.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/param.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pci.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pda.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgalloc.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/processor.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/ptrace.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/segment.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/smp.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/system.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/timer.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/tlbflush.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/vga.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/xor.h patches/linux-2.6.11/x86_64-linux.patch
line diff
     1.1 --- a/.rootkeys	Sat Apr 02 19:39:22 2005 +0000
     1.2 +++ b/.rootkeys	Sat Apr 02 20:27:11 2005 +0000
     1.3 @@ -210,7 +210,9 @@ 40f56237utH41NPukqHksuNf29IC9A linux-2.6
     1.4  40f56237penAAlWVBVDpeQZNFIg8CA linux-2.6.11-xen-sparse/arch/xen/Makefile
     1.5  40f56237JTc60m1FRlUxkUaGSQKrNw linux-2.6.11-xen-sparse/arch/xen/boot/Makefile
     1.6  40f56237hRxbacU_3PdoAl6DjZ3Jnw linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32
     1.7 +424f001dsaMEQ1wWQnPmu0ejo6pgPA linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64
     1.8  40f56237wubfjJKlfIzZlI3ZM2VgGA linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32
     1.9 +424f001dsBzCezYZD8vAn-h5D9ZRtQ linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64
    1.10  40f56237Mta0yHNaMS_qtM2rge0qYA linux-2.6.11-xen-sparse/arch/xen/i386/Kconfig
    1.11  40f56238u2CJdXNpjsZgHBxeVyY-2g linux-2.6.11-xen-sparse/arch/xen/i386/Makefile
    1.12  40f56238eczveJ86k_4hNxCLRQIF-g linux-2.6.11-xen-sparse/arch/xen/i386/kernel/Makefile
    1.13 @@ -257,6 +259,40 @@ 40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6
    1.14  414c113396tK1HTVeUalm3u-1DF16g linux-2.6.11-xen-sparse/arch/xen/kernel/skbuff.c
    1.15  418f90e4lGdeJK9rmbOB1kN-IKSjsQ linux-2.6.11-xen-sparse/arch/xen/kernel/smp.c
    1.16  3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.11-xen-sparse/arch/xen/kernel/xen_proc.c
    1.17 +424efaa6xahU2q85_dT-SjUJEaivfg linux-2.6.11-xen-sparse/arch/xen/x86_64/Kconfig
    1.18 +424efaa6kKleWe45IrqsG8gkejgEQA linux-2.6.11-xen-sparse/arch/xen/x86_64/Makefile
    1.19 +424efaa7hjpGexXRf5TYBwgP7uT5Wg linux-2.6.11-xen-sparse/arch/xen/x86_64/defconfig
    1.20 +424efaa6HSyuVodl6SxFGj39vlp6MA linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/Makefile
    1.21 +424efaa7bVAw3Z_q0SdFivfNVavyIg linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/asm-offsets.c
    1.22 +424efaa7ddTVabh547Opf0u9vKmUXw linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/e820.c
    1.23 +424efaa72fQEHYQ-Sp2IW9X2xTA5zQ linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/early_printk.c
    1.24 +424efaa7B_BWrAkLPJNoKk4EQY2a7w linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S
    1.25 +424efaa7vhgi7th5QVICjfuHmEWOkw linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head.S
    1.26 +424efaa7tiMEZSAYepwyjaNWxyXF7Q linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head64.c
    1.27 +424efaa6M6AGf53TJa2y9cl6coos0g linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/init_task.c
    1.28 +424efaa6wHXXaloZygAv6ywDb7u7nQ linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ioport.c
    1.29 +424efaa6gOkc9_uHCLgvY_DXPqh_sg linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/irq.c
    1.30 +424efaa6ibN3xXEeXoxURmKfJF_CUA linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ldt.c
    1.31 +424efaa6aX4JkXAzBf4nqxRmLUfhqQ linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c
    1.32 +424efaa7e8nVw04q-pK8XRFaHPVx_A linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-nommu.c
    1.33 +424efaa7CxY9cbhqapUfqVYnD7T9LQ linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c
    1.34 +424efaa7I-DPzj1fkZeYPJS7rA4FAw linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup.c
    1.35 +424efaa7DIVTR1U4waPGHucha9Xilg linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup64.c
    1.36 +424efaa6L1lrzwCIadTNxogSvljFwg linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/signal.c
    1.37 +424efaa61XzweJyW3v5Lb9egpe3rtw linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smp.c
    1.38 +424efaa778MkpdkAIq0An1FjQENN_Q linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smpboot.c
    1.39 +424efaa7vzbNdhwhkQPhs1V7LrAH4Q linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/time.c
    1.40 +424efaa7szEu90xkjpXk5TufZxxa4g linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/traps.c
    1.41 +424efaa6sJsuHdGIGxm0r-ugsss3OQ linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/vsyscall.c
    1.42 +424efaa6xbX9LkKyaXvgbL9s_39Trw linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/x8664_ksyms.c
    1.43 +424efaa670zlQTtnOYK_aNgqhmSx-Q linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/Makefile
    1.44 +424efaa6HUC68-hBHgiWOMDfKZogIA linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/fault.c
    1.45 +424f001d6S-OiHsk1n9gv1jGwws-9w linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c
    1.46 +424efaa65ELRJ3JfgQQKLzW6y0ECYQ linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/init.c
    1.47 +424efaa60dTbHfv65JBLVhNLcNPcRA linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/ioremap.c
    1.48 +424efaa6uMX8YJASAVJT8ral74dz9Q linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/pageattr.c
    1.49 +424efaa629XgfZi3vvTAuQmhCqmvIA linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile
    1.50 +424efaa64SRL9FZhtQovFJAVh9sZlQ linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile-BUS
    1.51  41261688yS8eAyy-7kzG4KBs0xbYCA linux-2.6.11-xen-sparse/drivers/Makefile
    1.52  4108f5c1WfTIrs0HZFeV39sttekCTw linux-2.6.11-xen-sparse/drivers/char/mem.c
    1.53  4111308bZAIzwf_Kzu6x1TZYZ3E0_Q linux-2.6.11-xen-sparse/drivers/char/tty_io.c
    1.54 @@ -329,6 +365,39 @@ 40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6
    1.55  40f5623bVdKP7Dt7qm8twu3NcnGNbA linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/system.h
    1.56  40f5623bc8LKPRO09wY5dGDnY_YCpw linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/tlbflush.h
    1.57  41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/vga.h
    1.58 +424f001delsctIT-_5gdbHsN9VfaQA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/arch_hooks.h
    1.59 +424efa21QfpO4QqQf9ADB4U_2zo8dQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h
    1.60 +424efa21riixePBPesLRsVnhFxfEfQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h
    1.61 +424efa21iAXuoKIT3-zDni6aryFlPQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h
    1.62 +424efa21QCdU7W3An0BM0bboJZ6f4Q linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/fixmap.h
    1.63 +424efa21S7Ruo0JzTFH1qwezpdtCbw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/floppy.h
    1.64 +424f001ds3cL9WAgSH5Nja1BAkZfDg linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h
    1.65 +424efa20tMbuEQuxvPjow-wkBx83rA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/io.h
    1.66 +424efa20meDrUt6I2XWbpuf72e4gEw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/irq.h
    1.67 +424f001d3cpZoX9SZD_zjTapOs-ZIQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/io_ports.h
    1.68 +424f001eirTAXdX_1gCugGtzSGJUXw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/irq_vectors.h
    1.69 +424f001eTD7ATy8MC71Lm2rOHHyUCA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_time.h
    1.70 +424f001ew4jIwfKeZUNa_U54UAaJcw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_timer.h
    1.71 +424f001ePIPWhBJGeTgj-KmiHOYvqw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h
    1.72 +424f001e0S9hTGOoEN8pgheQJ76yqQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_pre.h
    1.73 +424f001eQPBrY1621DbCPKn9wK36ZQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/smpboot_hooks.h
    1.74 +424efa21FvJNdHFfm2w2TOWohNsqDQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h
    1.75 +424efa214neirHds4zbtwaefvG5PYA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/page.h
    1.76 +424efa21-7jaHj-W-T4E9oM3kqFA7Q linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/param.h
    1.77 +424efa20I76WtOlPh71MaXtai3-qZA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pci.h
    1.78 +424efa20Fs7EHhAV6Hz_UtifwEfczg linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pda.h
    1.79 +424efa20CGx-5HD8ahpdHxPW2KlrtA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgalloc.h
    1.80 +424efa21YaMjX7hz7eCkVNcNWRK42A linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
    1.81 +424efa21wPKwwFR1fcqrPD0_o3GKWA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/processor.h
    1.82 +424efa20fTFqmaE0stH6lfB_4yN_lA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/ptrace.h
    1.83 +424efa21fY4IvK0luYgDJHKV-MD3eQ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/segment.h
    1.84 +424efa21KcupuJlHgmPiTk_T214FrA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/smp.h
    1.85 +424f001eT-7wjT_7K5AMlNVigIcuHA linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h
    1.86 +424efa210ZRt2U_8WmtyI7g74Nz-4Q linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/system.h
    1.87 +424f001eBp9fMbZ0Mo2kRJQ84gMgRw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/timer.h
    1.88 +424efa21Xk2acvaHYnpyTCLE6nU6hw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/tlbflush.h
    1.89 +424efa21Ey6Q4L4AsXxcEwH3vMDeiw linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/vga.h
    1.90 +424efa214gNhOfFimFJHq4in24Yp1g linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/xor.h
    1.91  41af4017PDMuSmMWtSRU5UC9Vylw5g linux-2.6.11-xen-sparse/include/asm-xen/balloon.h
    1.92  40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.11-xen-sparse/include/asm-xen/ctrl_if.h
    1.93  40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h
    1.94 @@ -387,6 +456,7 @@ 422e4430-gOD358H8nGGnNWes08Nng netbsd-2.
    1.95  413cb3b53nyOv1OIeDSsCXhBFDXvJA netbsd-2.0-xen-sparse/sys/nfs/files.nfs
    1.96  413aa1d0oNP8HXLvfPuMe6cSroUfSA patches/linux-2.6.11/agpgart.patch
    1.97  42372652KCUP-IOH9RN19YQmGhs4aA patches/linux-2.6.11/iomap.patch
    1.98 +424f001e_M1Tnxc52rDrmCLelnDWMQ patches/linux-2.6.11/x86_64-linux.patch
    1.99  3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
   1.100  40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Rules.mk
   1.101  4209033eUwhDBJ_bxejiv5c6gjXS4A tools/blktap/Makefile
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Sat Apr 02 20:27:11 2005 +0000
     2.3 @@ -0,0 +1,703 @@
     2.4 +#
     2.5 +# Automatically generated make config: don't edit
     2.6 +# Linux kernel version: 2.6.10-xen0
     2.7 +# Tue Mar 15 10:39:50 2005
     2.8 +#
     2.9 +CONFIG_XEN=y
    2.10 +CONFIG_ARCH_XEN=y
    2.11 +CONFIG_NO_IDLE_HZ=y
    2.12 +
    2.13 +#
    2.14 +# XEN
    2.15 +#
    2.16 +CONFIG_XEN_PRIVILEGED_GUEST=y
    2.17 +CONFIG_XEN_PHYSDEV_ACCESS=y
    2.18 +CONFIG_XEN_BLKDEV_BACKEND=y
    2.19 +# CONFIG_XEN_BLKDEV_TAP_BE is not set
    2.20 +CONFIG_XEN_NETDEV_BACKEND=y
    2.21 +CONFIG_XEN_BLKDEV_FRONTEND=y
    2.22 +CONFIG_XEN_NETDEV_FRONTEND=y
    2.23 +# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    2.24 +# CONFIG_XEN_BLKDEV_TAP is not set
    2.25 +# CONFIG_XEN_WRITABLE_PAGETABLES=y
    2.26 +CONFIG_XEN_SCRUB_PAGES=y
    2.27 +# CONFIG_XEN_X86 is not set
    2.28 +CONFIG_XEN_X86_64=y
    2.29 +CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    2.30 +
    2.31 +#
    2.32 +# Code maturity level options
    2.33 +#
    2.34 +# CONFIG_EXPERIMENTAL is not set
    2.35 +CONFIG_CLEAN_COMPILE=y
    2.36 +CONFIG_BROKEN_ON_SMP=y
    2.37 +
    2.38 +#
    2.39 +# General setup
    2.40 +#
    2.41 +CONFIG_LOCALVERSION=""
    2.42 +# CONFIG_SWAP is not set
    2.43 +# CONFIG_SYSVIPC is not set
    2.44 +# CONFIG_BSD_PROCESS_ACCT is not set
    2.45 +# CONFIG_SYSCTL is not set
    2.46 +# CONFIG_AUDIT is not set
    2.47 +CONFIG_LOG_BUF_SHIFT=14
    2.48 +# CONFIG_HOTPLUG is not set
    2.49 +CONFIG_KOBJECT_UEVENT=y
    2.50 +# CONFIG_IKCONFIG is not set
    2.51 +# CONFIG_EMBEDDED is not set
    2.52 +CONFIG_KALLSYMS=y
    2.53 +CONFIG_KALLSYMS_EXTRA_PASS=y
    2.54 +CONFIG_FUTEX=y
    2.55 +CONFIG_EPOLL=y
    2.56 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
    2.57 +CONFIG_SHMEM=y
    2.58 +CONFIG_CC_ALIGN_FUNCTIONS=0
    2.59 +CONFIG_CC_ALIGN_LABELS=0
    2.60 +CONFIG_CC_ALIGN_LOOPS=0
    2.61 +CONFIG_CC_ALIGN_JUMPS=0
    2.62 +# CONFIG_TINY_SHMEM is not set
    2.63 +
    2.64 +#
    2.65 +# Loadable module support
    2.66 +#
    2.67 +CONFIG_MODULES=y
    2.68 +CONFIG_MODULE_UNLOAD=y
    2.69 +CONFIG_OBSOLETE_MODPARM=y
    2.70 +# CONFIG_MODULE_SRCVERSION_ALL is not set
    2.71 +CONFIG_KMOD=y
    2.72 +CONFIG_XENARCH="x86_64"
    2.73 +CONFIG_MMU=y
    2.74 +CONFIG_GENERIC_ISA_DMA=y
    2.75 +CONFIG_GENERIC_IOMAP=y
    2.76 +# CONFIG_MK8 is not set
    2.77 +CONFIG_X86_CMPXCHG=y
    2.78 +CONFIG_X86_L1_CACHE_SHIFT=7
    2.79 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
    2.80 +CONFIG_X86_GOOD_APIC=y
    2.81 +# CONFIG_HPET_TIMER is not set
    2.82 +# CONFIG_SMP is not set
    2.83 +# CONFIG_PREEMPT is not set
    2.84 +# CONFIG_MICROCODE is not set
    2.85 +# CONFIG_X86_CPUID is not set
    2.86 +# CONFIG_NUMA is not set
    2.87 +# CONFIG_MTRR is not set
    2.88 +CONFIG_PCI=y
    2.89 +CONFIG_PCI_DIRECT=y
    2.90 +CONFIG_EARLY_PRINTK=y
    2.91 +CONFIG_GENERIC_HARDIRQS=y
    2.92 +CONFIG_GENERIC_IRQ_PROBE=y
    2.93 +
    2.94 +#
    2.95 +# X86_64 processor configuration
    2.96 +#
    2.97 +CONFIG_X86_64=y
    2.98 +CONFIG_X86=y
    2.99 +CONFIG_64BIT=y
   2.100 +
   2.101 +#
   2.102 +# Processor type and features
   2.103 +#
   2.104 +# CONFIG_MPSC is not set
   2.105 +CONFIG_GENERIC_CPU=y
   2.106 +CONFIG_X86_L1_CACHE_BYTES=128
   2.107 +# CONFIG_X86_TSC is not set
   2.108 +# CONFIG_X86_MSR is not set
   2.109 +# CONFIG_GART_IOMMU is not set
   2.110 +CONFIG_DUMMY_IOMMU=y
   2.111 +# CONFIG_X86_MCE is not set
   2.112 +
   2.113 +#
   2.114 +# Power management options
   2.115 +#
   2.116 +# CONFIG_PM is not set
   2.117 +
   2.118 +#
   2.119 +# ACPI (Advanced Configuration and Power Interface) Support
   2.120 +#
   2.121 +# CONFIG_ACPI is not set
   2.122 +# CONFIG_ACPI_BLACKLIST_YEAR=0
   2.123 +
   2.124 +#
   2.125 +# CPU Frequency scaling
   2.126 +#
   2.127 +# CONFIG_CPU_FREQ is not set
   2.128 +
   2.129 +#
   2.130 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
   2.131 +#
   2.132 +CONFIG_PCI=y
   2.133 +CONFIG_PCI_DIRECT=y
   2.134 +CONFIG_PCI_LEGACY_PROC=y
   2.135 +# CONFIG_PCI_NAMES is not set
   2.136 +# CONFIG_PCI_MMCONFIG is not set
   2.137 +
   2.138 +#
   2.139 +# PCCARD (PCMCIA/CardBus) support
   2.140 +#
   2.141 +# CONFIG_PCCARD is not set
   2.142 +
   2.143 +#
   2.144 +# Executable file formats / Emulations
   2.145 +#
   2.146 +# CONFIG_IA32_EMULATION is not set
   2.147 +
   2.148 +#
   2.149 +# Executable file formats
   2.150 +#
   2.151 +CONFIG_BINFMT_ELF=y
   2.152 +CONFIG_BINFMT_MISC=y
   2.153 +
   2.154 +#
   2.155 +# Device Drivers
   2.156 +#
   2.157 +
   2.158 +#
   2.159 +# Generic Driver Options
   2.160 +#
   2.161 +CONFIG_STANDALONE=y
   2.162 +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
   2.163 +# CONFIG_FW_LOADER is not set
   2.164 +
   2.165 +#
   2.166 +# Memory Technology Devices (MTD)
   2.167 +#
   2.168 +# CONFIG_MTD is not set
   2.169 +
   2.170 +#
   2.171 +# Parallel port support
   2.172 +#
   2.173 +# CONFIG_PARPORT is not set
   2.174 +
   2.175 +#
   2.176 +# Plug and Play support
   2.177 +#
   2.178 +
   2.179 +#
   2.180 +# Block devices
   2.181 +#
   2.182 +CONFIG_BLK_DEV_FD=y
   2.183 +# CONFIG_BLK_CPQ_DA is not set
   2.184 +# CONFIG_BLK_CPQ_CISS_DA is not set
   2.185 +# CONFIG_BLK_DEV_DAC960 is not set
   2.186 +CONFIG_BLK_DEV_LOOP=y
   2.187 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
   2.188 +# CONFIG_BLK_DEV_NBD is not set
   2.189 +# CONFIG_BLK_DEV_SX8 is not set
   2.190 +CONFIG_BLK_DEV_RAM=y
   2.191 +CONFIG_BLK_DEV_RAM_COUNT=16
   2.192 +CONFIG_BLK_DEV_RAM_SIZE=16384
   2.193 +CONFIG_BLK_DEV_INITRD=y
   2.194 +CONFIG_INITRAMFS_SOURCE=""
   2.195 +# CONFIG_LBD is not set
   2.196 +# CONFIG_CDROM_PKTCDVD is not set
   2.197 +
   2.198 +#
   2.199 +# IO Schedulers
   2.200 +#
   2.201 +CONFIG_IOSCHED_NOOP=y
   2.202 +CONFIG_IOSCHED_AS=y
   2.203 +CONFIG_IOSCHED_DEADLINE=y
   2.204 +CONFIG_IOSCHED_CFQ=y
   2.205 +# CONFIG_ATA_OVER_ETH is not set
   2.206 +
   2.207 +#
   2.208 +# ATA/ATAPI/MFM/RLL support
   2.209 +#
   2.210 +# CONFIG_IDE is not set
   2.211 +
   2.212 +#
   2.213 +# SCSI device support
   2.214 +#
   2.215 +CONFIG_SCSI=y
   2.216 +CONFIG_SCSI_PROC_FS=y
   2.217 +
   2.218 +#
   2.219 +# SCSI support type (disk, tape, CD-ROM)
   2.220 +#
   2.221 +CONFIG_BLK_DEV_SD=y
   2.222 +CONFIG_CHR_DEV_ST=y
   2.223 +CONFIG_CHR_DEV_OSST=y
   2.224 +CONFIG_BLK_DEV_SR=y
   2.225 +CONFIG_BLK_DEV_SR_VENDOR=y
   2.226 +CONFIG_CHR_DEV_SG=y
   2.227 +
   2.228 +#
   2.229 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
   2.230 +#
   2.231 +# CONFIG_SCSI_MULTI_LUN is not set
   2.232 +CONFIG_SCSI_CONSTANTS=y
   2.233 +CONFIG_SCSI_LOGGING=y
   2.234 +
   2.235 +#
   2.236 +# SCSI Transport Attributes
   2.237 +#
   2.238 +# CONFIG_SCSI_SPI_ATTRS is not set
   2.239 +# CONFIG_SCSI_FC_ATTRS is not set
   2.240 +# CONFIG_SCSI_ISCSI_ATTRS is not set
   2.241 +
   2.242 +#
   2.243 +# SCSI low-level drivers
   2.244 +#
   2.245 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
   2.246 +# CONFIG_SCSI_3W_9XXX is not set
   2.247 +# CONFIG_SCSI_ACARD is not set
   2.248 +# CONFIG_SCSI_AACRAID is not set
   2.249 +# CONFIG_SCSI_AIC7XXX is not set
   2.250 +# CONFIG_SCSI_AIC7XXX_OLD is not set
   2.251 +# CONFIG_SCSI_AIC79XX is not set
   2.252 +# CONFIG_MEGARAID_NEWGEN is not set
   2.253 +# CONFIG_MEGARAID_LEGACY is not set
   2.254 +CONFIG_SCSI_SATA=y
   2.255 +# CONFIG_SCSI_SATA_AHCI is not set
   2.256 +# CONFIG_SCSI_SATA_SVW is not set
   2.257 +CONFIG_SCSI_ATA_PIIX=y
   2.258 +# CONFIG_SCSI_SATA_NV is not set
   2.259 +CONFIG_SCSI_SATA_PROMISE=y
   2.260 +# CONFIG_SCSI_SATA_QSTOR is not set
   2.261 +CONFIG_SCSI_SATA_SX4=y
   2.262 +CONFIG_SCSI_SATA_SIL=y
   2.263 +# CONFIG_SCSI_SATA_SIS is not set
   2.264 +# CONFIG_SCSI_SATA_ULI is not set
   2.265 +# CONFIG_SCSI_SATA_VIA is not set
   2.266 +# CONFIG_SCSI_SATA_VITESSE is not set
   2.267 +CONFIG_SCSI_BUSLOGIC=y
   2.268 +# CONFIG_SCSI_OMIT_FLASHPOINT is not set
   2.269 +# CONFIG_SCSI_CPQFCTS is not set
   2.270 +# CONFIG_SCSI_DMX3191D is not set
   2.271 +# CONFIG_SCSI_DTC3280 is not set
   2.272 +# CONFIG_SCSI_EATA is not set
   2.273 +# CONFIG_SCSI_EATA_PIO is not set
   2.274 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
   2.275 +# CONFIG_SCSI_GDTH is not set
   2.276 +# CONFIG_SCSI_GENERIC_NCR5380 is not set
   2.277 +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
   2.278 +# CONFIG_SCSI_IPS is not set
   2.279 +# CONFIG_SCSI_INITIO is not set
   2.280 +# CONFIG_SCSI_INIA100 is not set
   2.281 +# CONFIG_SCSI_NCR53C406A is not set
   2.282 +# CONFIG_SCSI_SYM53C8XX_2 is not set
   2.283 +# CONFIG_SCSI_IPR is not set
   2.284 +# CONFIG_SCSI_PAS16 is not set
   2.285 +# CONFIG_SCSI_PCI2000 is not set
   2.286 +# CONFIG_SCSI_PCI2220I is not set
   2.287 +# CONFIG_SCSI_PSI240I is not set
   2.288 +# CONFIG_SCSI_QLOGIC_FAS is not set
   2.289 +# CONFIG_SCSI_QLOGIC_ISP is not set
   2.290 +# CONFIG_SCSI_QLOGIC_FC is not set
   2.291 +# CONFIG_SCSI_QLOGIC_1280 is not set
   2.292 +CONFIG_SCSI_QLA2XXX=y
   2.293 +# CONFIG_SCSI_QLA21XX is not set
   2.294 +# CONFIG_SCSI_QLA22XX is not set
   2.295 +# CONFIG_SCSI_QLA2300 is not set
   2.296 +# CONFIG_SCSI_QLA2322 is not set
   2.297 +# CONFIG_SCSI_QLA6312 is not set
   2.298 +# CONFIG_SCSI_SEAGATE is not set
   2.299 +# CONFIG_SCSI_SYM53C416 is not set
   2.300 +# CONFIG_SCSI_DC395x is not set
   2.301 +# CONFIG_SCSI_DC390T is not set
   2.302 +# CONFIG_SCSI_T128 is not set
   2.303 +# CONFIG_SCSI_U14_34F is not set
   2.304 +# CONFIG_SCSI_ULTRASTOR is not set
   2.305 +# CONFIG_SCSI_NSP32 is not set
   2.306 +# CONFIG_SCSI_DEBUG is not set
   2.307 +
   2.308 +#
   2.309 +# Multi-device support (RAID and LVM)
   2.310 +#
   2.311 +# CONFIG_MD is not set
   2.312 +
   2.313 +#
   2.314 +# Fusion MPT device support
   2.315 +#
   2.316 +# CONFIG_FUSION is not set
   2.317 +
   2.318 +#
   2.319 +# IEEE 1394 (FireWire) support
   2.320 +#
   2.321 +# CONFIG_IEEE1394 is not set
   2.322 +
   2.323 +#
   2.324 +# I2O device support
   2.325 +#
   2.326 +# CONFIG_I2O is not set
   2.327 +
   2.328 +#
   2.329 +# Networking support
   2.330 +#
   2.331 +CONFIG_NET=y
   2.332 +
   2.333 +#
   2.334 +# Networking options
   2.335 +#
   2.336 +# CONFIG_PACKET is not set
   2.337 +# CONFIG_NETLINK_DEV is not set
   2.338 +# CONFIG_UNIX is not set
   2.339 +# CONFIG_NET_KEY is not set
   2.340 +CONFIG_INET=y
   2.341 +# CONFIG_IP_MULTICAST is not set
   2.342 +# CONFIG_IP_ADVANCED_ROUTER is not set
   2.343 +# CONFIG_IP_PNP is not set
   2.344 +# CONFIG_NET_IPIP is not set
   2.345 +# CONFIG_NET_IPGRE is not set
   2.346 +# CONFIG_SYN_COOKIES is not set
   2.347 +# CONFIG_INET_AH is not set
   2.348 +# CONFIG_INET_ESP is not set
   2.349 +# CONFIG_INET_IPCOMP is not set
   2.350 +# CONFIG_INET_TUNNEL is not set
   2.351 +CONFIG_IP_TCPDIAG=y
   2.352 +# CONFIG_IP_TCPDIAG_IPV6 is not set
   2.353 +# CONFIG_NETFILTER is not set
   2.354 +# CONFIG_BRIDGE is not set
   2.355 +# CONFIG_VLAN_8021Q is not set
   2.356 +# CONFIG_DECNET is not set
   2.357 +# CONFIG_LLC2 is not set
   2.358 +# CONFIG_IPX is not set
   2.359 +# CONFIG_ATALK is not set
   2.360 +
   2.361 +#
   2.362 +# QoS and/or fair queueing
   2.363 +#
   2.364 +# CONFIG_NET_SCHED is not set
   2.365 +# CONFIG_NET_CLS_ROUTE is not set
   2.366 +
   2.367 +#
   2.368 +# Network testing
   2.369 +#
   2.370 +# CONFIG_NET_PKTGEN is not set
   2.371 +# CONFIG_NETPOLL is not set
   2.372 +# CONFIG_NET_POLL_CONTROLLER is not set
   2.373 +# CONFIG_HAMRADIO is not set
   2.374 +# CONFIG_IRDA is not set
   2.375 +# CONFIG_BT is not set
   2.376 +# CONFIG_NETDEVICES is not set
   2.377 +
   2.378 +#
   2.379 +# ISDN subsystem
   2.380 +#
   2.381 +# CONFIG_ISDN is not set
   2.382 +
   2.383 +#
   2.384 +# Telephony Support
   2.385 +#
   2.386 +# CONFIG_PHONE is not set
   2.387 +
   2.388 +#
   2.389 +# Input device support
   2.390 +#
   2.391 +CONFIG_INPUT=y
   2.392 +
   2.393 +#
   2.394 +# Userland interfaces
   2.395 +#
   2.396 +CONFIG_INPUT_MOUSEDEV=y
   2.397 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
   2.398 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
   2.399 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
   2.400 +# CONFIG_INPUT_JOYDEV is not set
   2.401 +# CONFIG_INPUT_TSDEV is not set
   2.402 +# CONFIG_INPUT_EVDEV is not set
   2.403 +# CONFIG_INPUT_EVBUG is not set
   2.404 +
   2.405 +#
   2.406 +# Input I/O drivers
   2.407 +#
   2.408 +# CONFIG_GAMEPORT is not set
   2.409 +CONFIG_SOUND_GAMEPORT=y
   2.410 +CONFIG_SERIO=y
   2.411 +CONFIG_SERIO_I8042=y
   2.412 +CONFIG_SERIO_SERPORT=y
   2.413 +# CONFIG_SERIO_CT82C710 is not set
   2.414 +# CONFIG_SERIO_PCIPS2 is not set
   2.415 +# CONFIG_SERIO_RAW is not set
   2.416 +
   2.417 +#
   2.418 +# Input Device Drivers
   2.419 +#
   2.420 +CONFIG_INPUT_KEYBOARD=y
   2.421 +CONFIG_KEYBOARD_ATKBD=y
   2.422 +# CONFIG_KEYBOARD_SUNKBD is not set
   2.423 +# CONFIG_KEYBOARD_LKKBD is not set
   2.424 +# CONFIG_KEYBOARD_XTKBD is not set
   2.425 +# CONFIG_KEYBOARD_NEWTON is not set
   2.426 +CONFIG_INPUT_MOUSE=y
   2.427 +CONFIG_MOUSE_PS2=y
   2.428 +# CONFIG_MOUSE_SERIAL is not set
   2.429 +# CONFIG_MOUSE_VSXXXAA is not set
   2.430 +# CONFIG_INPUT_JOYSTICK is not set
   2.431 +# CONFIG_INPUT_TOUCHSCREEN is not set
   2.432 +# CONFIG_INPUT_MISC is not set
   2.433 +
   2.434 +#
   2.435 +# Character devices
   2.436 +#
   2.437 +CONFIG_VT=y
   2.438 +CONFIG_VT_CONSOLE=y
   2.439 +CONFIG_HW_CONSOLE=y
   2.440 +# CONFIG_SERIAL_NONSTANDARD is not set
   2.441 +
   2.442 +#
   2.443 +# Serial drivers
   2.444 +#
   2.445 +# CONFIG_SERIAL_8250 is not set
   2.446 +
   2.447 +#
   2.448 +# Non-8250 serial port support
   2.449 +#
   2.450 +CONFIG_UNIX98_PTYS=y
   2.451 +CONFIG_LEGACY_PTYS=y
   2.452 +CONFIG_LEGACY_PTY_COUNT=256
   2.453 +
   2.454 +#
   2.455 +# IPMI
   2.456 +#
   2.457 +# CONFIG_IPMI_HANDLER is not set
   2.458 +
   2.459 +#
   2.460 +# Watchdog Cards
   2.461 +#
   2.462 +# CONFIG_WATCHDOG is not set
   2.463 +# CONFIG_HW_RANDOM is not set
   2.464 +# CONFIG_NVRAM is not set
   2.465 +# CONFIG_RTC is not set
   2.466 +# CONFIG_GEN_RTC is not set
   2.467 +# CONFIG_DTLK is not set
   2.468 +# CONFIG_R3964 is not set
   2.469 +# CONFIG_APPLICOM is not set
   2.470 +
   2.471 +#
   2.472 +# Ftape, the floppy tape device driver
   2.473 +#
   2.474 +# CONFIG_FTAPE is not set
   2.475 +# CONFIG_AGP is not set
   2.476 +# CONFIG_DRM is not set
   2.477 +# CONFIG_MWAVE is not set
   2.478 +# CONFIG_RAW_DRIVER is not set
   2.479 +# CONFIG_HANGCHECK_TIMER is not set
   2.480 +
   2.481 +#
   2.482 +# I2C support
   2.483 +#
   2.484 +# CONFIG_I2C is not set
   2.485 +
   2.486 +#
   2.487 +# Dallas's 1-wire bus
   2.488 +#
   2.489 +# CONFIG_W1 is not set
   2.490 +
   2.491 +#
   2.492 +# Misc devices
   2.493 +#
   2.494 +
   2.495 +#
   2.496 +# Multimedia devices
   2.497 +#
   2.498 +# CONFIG_VIDEO_DEV is not set
   2.499 +
   2.500 +#
   2.501 +# Digital Video Broadcasting Devices
   2.502 +#
   2.503 +# CONFIG_DVB is not set
   2.504 +
   2.505 +#
   2.506 +# Graphics support
   2.507 +#
   2.508 +# CONFIG_FB is not set
   2.509 +# CONFIG_VIDEO_SELECT is not set
   2.510 +
   2.511 +#
   2.512 +# Console display driver support
   2.513 +#
   2.514 +CONFIG_VGA_CONSOLE=y
   2.515 +CONFIG_DUMMY_CONSOLE=y
   2.516 +
   2.517 +#
   2.518 +# Sound
   2.519 +#
   2.520 +# CONFIG_SOUND is not set
   2.521 +
   2.522 +#
   2.523 +# USB support
   2.524 +#
   2.525 +# CONFIG_USB is not set
   2.526 +CONFIG_USB_ARCH_HAS_HCD=y
   2.527 +CONFIG_USB_ARCH_HAS_OHCI=y
   2.528 +
   2.529 +#
   2.530 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
   2.531 +#
   2.532 +
   2.533 +#
   2.534 +# USB Gadget Support
   2.535 +#
   2.536 +# CONFIG_USB_GADGET is not set
   2.537 +
   2.538 +#
   2.539 +# File systems
   2.540 +#
   2.541 +CONFIG_EXT2_FS=y
   2.542 +CONFIG_EXT2_FS_XATTR=y
   2.543 +# CONFIG_EXT2_FS_POSIX_ACL is not set
   2.544 +# CONFIG_EXT2_FS_SECURITY is not set
   2.545 +CONFIG_EXT3_FS=y
   2.546 +CONFIG_EXT3_FS_XATTR=y
   2.547 +# CONFIG_EXT3_FS_POSIX_ACL is not set
   2.548 +# CONFIG_EXT3_FS_SECURITY is not set
   2.549 +CONFIG_JBD=y
   2.550 +# CONFIG_JBD_DEBUG is not set
   2.551 +CONFIG_FS_MBCACHE=y
   2.552 +# CONFIG_REISERFS_FS is not set
   2.553 +# CONFIG_JFS_FS is not set
   2.554 +# CONFIG_XFS_FS is not set
   2.555 +# CONFIG_MINIX_FS is not set
   2.556 +# CONFIG_ROMFS_FS is not set
   2.557 +# CONFIG_QUOTA is not set
   2.558 +CONFIG_DNOTIFY=y
   2.559 +# CONFIG_AUTOFS_FS is not set
   2.560 +# CONFIG_AUTOFS4_FS is not set
   2.561 +
   2.562 +#
   2.563 +# CD-ROM/DVD Filesystems
   2.564 +#
   2.565 +CONFIG_ISO9660_FS=y
   2.566 +CONFIG_JOLIET=y
   2.567 +CONFIG_ZISOFS=y
   2.568 +CONFIG_ZISOFS_FS=y
   2.569 +CONFIG_UDF_FS=y
   2.570 +CONFIG_UDF_NLS=y
   2.571 +
   2.572 +#
   2.573 +# DOS/FAT/NT Filesystems
   2.574 +#
   2.575 +CONFIG_FAT_FS=y
   2.576 +CONFIG_MSDOS_FS=y
   2.577 +CONFIG_VFAT_FS=y
   2.578 +CONFIG_FAT_DEFAULT_CODEPAGE=437
   2.579 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
   2.580 +# CONFIG_NTFS_FS is not set
   2.581 +
   2.582 +#
   2.583 +# Pseudo filesystems
   2.584 +#
   2.585 +CONFIG_PROC_FS=y
   2.586 +CONFIG_PROC_KCORE=y
   2.587 +CONFIG_SYSFS=y
   2.588 +CONFIG_DEVPTS_FS_XATTR=y
   2.589 +CONFIG_DEVPTS_FS_SECURITY=y
   2.590 +CONFIG_TMPFS=y
   2.591 +CONFIG_TMPFS_XATTR=y
   2.592 +CONFIG_TMPFS_SECURITY=y
   2.593 +# CONFIG_HUGETLBFS is not set
   2.594 +# CONFIG_HUGETLB_PAGE is not set
   2.595 +CONFIG_RAMFS=y
   2.596 +
   2.597 +#
   2.598 +# Miscellaneous filesystems
   2.599 +#
   2.600 +# CONFIG_HFSPLUS_FS is not set
   2.601 +# CONFIG_CRAMFS is not set
   2.602 +# CONFIG_VXFS_FS is not set
   2.603 +# CONFIG_HPFS_FS is not set
   2.604 +# CONFIG_QNX4FS_FS is not set
   2.605 +# CONFIG_SYSV_FS is not set
   2.606 +# CONFIG_UFS_FS is not set
   2.607 +
   2.608 +#
   2.609 +# Network File Systems
   2.610 +#
   2.611 +# CONFIG_NFS_FS is not set
   2.612 +# CONFIG_NFSD is not set
   2.613 +# CONFIG_EXPORTFS is not set
   2.614 +# CONFIG_SMB_FS is not set
   2.615 +# CONFIG_CIFS is not set
   2.616 +# CONFIG_NCP_FS is not set
   2.617 +# CONFIG_CODA_FS is not set
   2.618 +
   2.619 +#
   2.620 +# Partition Types
   2.621 +#
   2.622 +CONFIG_PARTITION_ADVANCED=y
   2.623 +# CONFIG_ACORN_PARTITION is not set
   2.624 +# CONFIG_OSF_PARTITION is not set
   2.625 +# CONFIG_AMIGA_PARTITION is not set
   2.626 +# CONFIG_ATARI_PARTITION is not set
   2.627 +# CONFIG_MAC_PARTITION is not set
   2.628 +CONFIG_MSDOS_PARTITION=y
   2.629 +CONFIG_BSD_DISKLABEL=y
   2.630 +# CONFIG_MINIX_SUBPARTITION is not set
   2.631 +# CONFIG_SOLARIS_X86_PARTITION is not set
   2.632 +# CONFIG_UNIXWARE_DISKLABEL is not set
   2.633 +# CONFIG_LDM_PARTITION is not set
   2.634 +# CONFIG_SGI_PARTITION is not set
   2.635 +# CONFIG_ULTRIX_PARTITION is not set
   2.636 +# CONFIG_SUN_PARTITION is not set
   2.637 +CONFIG_EFI_PARTITION=y
   2.638 +
   2.639 +#
   2.640 +# Native Language Support
   2.641 +#
   2.642 +CONFIG_NLS=y
   2.643 +CONFIG_NLS_DEFAULT="utf8"
   2.644 +CONFIG_NLS_CODEPAGE_437=y
   2.645 +# CONFIG_NLS_CODEPAGE_737 is not set
   2.646 +# CONFIG_NLS_CODEPAGE_775 is not set
   2.647 +# CONFIG_NLS_CODEPAGE_850 is not set
   2.648 +# CONFIG_NLS_CODEPAGE_852 is not set
   2.649 +# CONFIG_NLS_CODEPAGE_855 is not set
   2.650 +# CONFIG_NLS_CODEPAGE_857 is not set
   2.651 +# CONFIG_NLS_CODEPAGE_860 is not set
   2.652 +# CONFIG_NLS_CODEPAGE_861 is not set
   2.653 +# CONFIG_NLS_CODEPAGE_862 is not set
   2.654 +# CONFIG_NLS_CODEPAGE_863 is not set
   2.655 +# CONFIG_NLS_CODEPAGE_864 is not set
   2.656 +# CONFIG_NLS_CODEPAGE_865 is not set
   2.657 +# CONFIG_NLS_CODEPAGE_866 is not set
   2.658 +# CONFIG_NLS_CODEPAGE_869 is not set
   2.659 +# CONFIG_NLS_CODEPAGE_936 is not set
   2.660 +# CONFIG_NLS_CODEPAGE_950 is not set
   2.661 +# CONFIG_NLS_CODEPAGE_932 is not set
   2.662 +# CONFIG_NLS_CODEPAGE_949 is not set
   2.663 +# CONFIG_NLS_CODEPAGE_874 is not set
   2.664 +# CONFIG_NLS_ISO8859_8 is not set
   2.665 +# CONFIG_NLS_CODEPAGE_1250 is not set
   2.666 +# CONFIG_NLS_CODEPAGE_1251 is not set
   2.667 +# CONFIG_NLS_ASCII is not set
   2.668 +# CONFIG_NLS_ISO8859_1 is not set
   2.669 +# CONFIG_NLS_ISO8859_2 is not set
   2.670 +# CONFIG_NLS_ISO8859_3 is not set
   2.671 +# CONFIG_NLS_ISO8859_4 is not set
   2.672 +# CONFIG_NLS_ISO8859_5 is not set
   2.673 +# CONFIG_NLS_ISO8859_6 is not set
   2.674 +# CONFIG_NLS_ISO8859_7 is not set
   2.675 +# CONFIG_NLS_ISO8859_9 is not set
   2.676 +# CONFIG_NLS_ISO8859_13 is not set
   2.677 +# CONFIG_NLS_ISO8859_14 is not set
   2.678 +# CONFIG_NLS_ISO8859_15 is not set
   2.679 +# CONFIG_NLS_KOI8_R is not set
   2.680 +# CONFIG_NLS_KOI8_U is not set
   2.681 +# CONFIG_NLS_UTF8 is not set
   2.682 +
   2.683 +#
   2.684 +# Security options
   2.685 +#
   2.686 +# CONFIG_KEYS is not set
   2.687 +# CONFIG_SECURITY is not set
   2.688 +
   2.689 +#
   2.690 +# Cryptographic options
   2.691 +#
   2.692 +# CONFIG_CRYPTO is not set
   2.693 +
   2.694 +#
   2.695 +# Library routines
   2.696 +#
   2.697 +CONFIG_CRC_CCITT=y
   2.698 +CONFIG_CRC32=y
   2.699 +CONFIG_LIBCRC32C=y
   2.700 +CONFIG_ZLIB_INFLATE=y
   2.701 +
   2.702 +#
   2.703 +# Firmware Drivers
   2.704 +#
   2.705 +CONFIG_PCI_LEGACY_PROC=y
   2.706 +CONFIG_PCI_NAMES=y
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Sat Apr 02 20:27:11 2005 +0000
     3.3 @@ -0,0 +1,513 @@
     3.4 +#
     3.5 +# Automatically generated make config: don't edit
     3.6 +# Linux kernel version: 2.6.10-xenU
     3.7 +# Mon Dec 27 10:15:03 2004
     3.8 +#
     3.9 +CONFIG_XEN=y
    3.10 +CONFIG_ARCH_XEN=y
    3.11 +CONFIG_NO_IDLE_HZ=y
    3.12 +
    3.13 +#
    3.14 +# XEN
    3.15 +#
    3.16 +# CONFIG_XEN_PRIVILEGED_GUEST is not set
    3.17 +# CONFIG_XEN_PHYSDEV_ACCESS is not set
    3.18 +# CONFIG_XEN_BLKDEV_BACKEND is not set
    3.19 +# CONFIG_XEN_NETDEV_BACKEND is not set
    3.20 +CONFIG_XEN_BLKDEV_FRONTEND=y
    3.21 +CONFIG_XEN_NETDEV_FRONTEND=y
    3.22 +# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    3.23 +# CONFIG_XEN_BLKDEV_TAP is not set
    3.24 +CONFIG_XEN_WRITABLE_PAGETABLES=y
    3.25 +CONFIG_XEN_SCRUB_PAGES=y
    3.26 +CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    3.27 +CONFIG_X86=y
    3.28 +# CONFIG_X86_64 is not set
    3.29 +
    3.30 +#
    3.31 +# Code maturity level options
    3.32 +#
    3.33 +CONFIG_EXPERIMENTAL=y
    3.34 +CONFIG_CLEAN_COMPILE=y
    3.35 +CONFIG_BROKEN_ON_SMP=y
    3.36 +CONFIG_LOCK_KERNEL=y
    3.37 +
    3.38 +#
    3.39 +# General setup
    3.40 +#
    3.41 +CONFIG_LOCALVERSION=""
    3.42 +CONFIG_SWAP=y
    3.43 +CONFIG_SYSVIPC=y
    3.44 +# CONFIG_POSIX_MQUEUE is not set
    3.45 +# CONFIG_BSD_PROCESS_ACCT is not set
    3.46 +CONFIG_SYSCTL=y
    3.47 +# CONFIG_AUDIT is not set
    3.48 +CONFIG_LOG_BUF_SHIFT=14
    3.49 +CONFIG_HOTPLUG=y
    3.50 +CONFIG_KOBJECT_UEVENT=y
    3.51 +# CONFIG_IKCONFIG is not set
    3.52 +# CONFIG_EMBEDDED is not set
    3.53 +CONFIG_KALLSYMS=y
    3.54 +# CONFIG_KALLSYMS_ALL is not set
    3.55 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
    3.56 +CONFIG_FUTEX=y
    3.57 +CONFIG_EPOLL=y
    3.58 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
    3.59 +CONFIG_SHMEM=y
    3.60 +CONFIG_CC_ALIGN_FUNCTIONS=0
    3.61 +CONFIG_CC_ALIGN_LABELS=0
    3.62 +CONFIG_CC_ALIGN_LOOPS=0
    3.63 +CONFIG_CC_ALIGN_JUMPS=0
    3.64 +# CONFIG_TINY_SHMEM is not set
    3.65 +
    3.66 +#
    3.67 +# Loadable module support
    3.68 +#
    3.69 +CONFIG_MODULES=y
    3.70 +CONFIG_MODULE_UNLOAD=y
    3.71 +# CONFIG_MODULE_FORCE_UNLOAD is not set
    3.72 +CONFIG_OBSOLETE_MODPARM=y
    3.73 +# CONFIG_MODVERSIONS is not set
    3.74 +# CONFIG_MODULE_SRCVERSION_ALL is not set
    3.75 +CONFIG_KMOD=y
    3.76 +
    3.77 +#
    3.78 +# X86 Processor Configuration
    3.79 +#
    3.80 +CONFIG_XENARCH="x86_64"
    3.81 +CONFIG_MMU=y
    3.82 +CONFIG_UID16=y
    3.83 +CONFIG_GENERIC_ISA_DMA=y
    3.84 +CONFIG_GENERIC_IOMAP=y
    3.85 +# CONFIG_M386 is not set
    3.86 +# CONFIG_M486 is not set
    3.87 +# CONFIG_M586 is not set
    3.88 +# CONFIG_M586TSC is not set
    3.89 +# CONFIG_M586MMX is not set
    3.90 +# CONFIG_M686 is not set
    3.91 +# CONFIG_MPENTIUMII is not set
    3.92 +# CONFIG_MPENTIUMIII is not set
    3.93 +# CONFIG_MPENTIUMM is not set
    3.94 +CONFIG_MPENTIUM4=y
    3.95 +# CONFIG_MK6 is not set
    3.96 +# CONFIG_MK7 is not set
    3.97 +# CONFIG_MK8 is not set
    3.98 +# CONFIG_MCRUSOE is not set
    3.99 +# CONFIG_MEFFICEON is not set
   3.100 +# CONFIG_MWINCHIPC6 is not set
   3.101 +# CONFIG_MWINCHIP2 is not set
   3.102 +# CONFIG_MWINCHIP3D is not set
   3.103 +# CONFIG_MCYRIXIII is not set
   3.104 +# CONFIG_MVIAC3_2 is not set
   3.105 +# CONFIG_X86_GENERIC is not set
   3.106 +CONFIG_X86_CMPXCHG=y
   3.107 +CONFIG_X86_XADD=y
   3.108 +CONFIG_X86_L1_CACHE_SHIFT=7
   3.109 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
   3.110 +CONFIG_X86_WP_WORKS_OK=y
   3.111 +CONFIG_X86_INVLPG=y
   3.112 +CONFIG_X86_BSWAP=y
   3.113 +CONFIG_X86_POPAD_OK=y
   3.114 +CONFIG_X86_GOOD_APIC=y
   3.115 +CONFIG_X86_INTEL_USERCOPY=y
   3.116 +CONFIG_X86_USE_PPRO_CHECKSUM=y
   3.117 +# CONFIG_HPET_TIMER is not set
   3.118 +# CONFIG_HPET_EMULATE_RTC is not set
   3.119 +# CONFIG_SMP is not set
   3.120 +CONFIG_PREEMPT=y
   3.121 +CONFIG_X86_CPUID=y
   3.122 +
   3.123 +#
   3.124 +# Firmware Drivers
   3.125 +#
   3.126 +# CONFIG_EDD is not set
   3.127 +CONFIG_NOHIGHMEM=y
   3.128 +# CONFIG_HIGHMEM4G is not set
   3.129 +CONFIG_HAVE_DEC_LOCK=y
   3.130 +# CONFIG_REGPARM is not set
   3.131 +
   3.132 +#
   3.133 +# Kernel hacking
   3.134 +#
   3.135 +# CONFIG_DEBUG_KERNEL is not set
   3.136 +CONFIG_EARLY_PRINTK=y
   3.137 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
   3.138 +# CONFIG_FRAME_POINTER is not set
   3.139 +# CONFIG_4KSTACKS is not set
   3.140 +CONFIG_GENERIC_HARDIRQS=y
   3.141 +CONFIG_GENERIC_IRQ_PROBE=y
   3.142 +CONFIG_X86_BIOS_REBOOT=y
   3.143 +CONFIG_PC=y
   3.144 +
   3.145 +#
   3.146 +# Executable file formats
   3.147 +#
   3.148 +CONFIG_BINFMT_ELF=y
   3.149 +# CONFIG_BINFMT_AOUT is not set
   3.150 +# CONFIG_BINFMT_MISC is not set
   3.151 +
   3.152 +#
   3.153 +# Device Drivers
   3.154 +#
   3.155 +
   3.156 +#
   3.157 +# Generic Driver Options
   3.158 +#
   3.159 +CONFIG_STANDALONE=y
   3.160 +CONFIG_PREVENT_FIRMWARE_BUILD=y
   3.161 +# CONFIG_FW_LOADER is not set
   3.162 +# CONFIG_DEBUG_DRIVER is not set
   3.163 +
   3.164 +#
   3.165 +# Block devices
   3.166 +#
   3.167 +# CONFIG_BLK_DEV_FD is not set
   3.168 +CONFIG_BLK_DEV_LOOP=m
   3.169 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
   3.170 +CONFIG_BLK_DEV_NBD=m
   3.171 +CONFIG_BLK_DEV_RAM=y
   3.172 +CONFIG_BLK_DEV_RAM_COUNT=16
   3.173 +CONFIG_BLK_DEV_RAM_SIZE=4096
   3.174 +CONFIG_BLK_DEV_INITRD=y
   3.175 +CONFIG_INITRAMFS_SOURCE=""
   3.176 +# CONFIG_LBD is not set
   3.177 +# CONFIG_CDROM_PKTCDVD is not set
   3.178 +
   3.179 +#
   3.180 +# IO Schedulers
   3.181 +#
   3.182 +CONFIG_IOSCHED_NOOP=y
   3.183 +CONFIG_IOSCHED_AS=y
   3.184 +CONFIG_IOSCHED_DEADLINE=y
   3.185 +CONFIG_IOSCHED_CFQ=y
   3.186 +
   3.187 +#
   3.188 +# SCSI device support
   3.189 +#
   3.190 +CONFIG_SCSI=m
   3.191 +CONFIG_SCSI_PROC_FS=y
   3.192 +
   3.193 +#
   3.194 +# SCSI support type (disk, tape, CD-ROM)
   3.195 +#
   3.196 +CONFIG_BLK_DEV_SD=m
   3.197 +# CONFIG_CHR_DEV_ST is not set
   3.198 +# CONFIG_CHR_DEV_OSST is not set
   3.199 +# CONFIG_BLK_DEV_SR is not set
   3.200 +# CONFIG_CHR_DEV_SG is not set
   3.201 +
   3.202 +#
   3.203 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
   3.204 +#
   3.205 +# CONFIG_SCSI_MULTI_LUN is not set
   3.206 +# CONFIG_SCSI_CONSTANTS is not set
   3.207 +# CONFIG_SCSI_LOGGING is not set
   3.208 +
   3.209 +#
   3.210 +# SCSI Transport Attributes
   3.211 +#
   3.212 +# CONFIG_SCSI_SPI_ATTRS is not set
   3.213 +# CONFIG_SCSI_FC_ATTRS is not set
   3.214 +
   3.215 +#
   3.216 +# SCSI low-level drivers
   3.217 +#
   3.218 +# CONFIG_SCSI_SATA is not set
   3.219 +# CONFIG_SCSI_DEBUG is not set
   3.220 +
   3.221 +#
   3.222 +# Multi-device support (RAID and LVM)
   3.223 +#
   3.224 +# CONFIG_MD is not set
   3.225 +
   3.226 +#
   3.227 +# Networking support
   3.228 +#
   3.229 +CONFIG_NET=y
   3.230 +
   3.231 +#
   3.232 +# Networking options
   3.233 +#
   3.234 +CONFIG_PACKET=y
   3.235 +# CONFIG_PACKET_MMAP is not set
   3.236 +# CONFIG_NETLINK_DEV is not set
   3.237 +CONFIG_UNIX=y
   3.238 +# CONFIG_NET_KEY is not set
   3.239 +CONFIG_INET=y
   3.240 +# CONFIG_IP_MULTICAST is not set
   3.241 +# CONFIG_IP_ADVANCED_ROUTER is not set
   3.242 +CONFIG_IP_PNP=y
   3.243 +# CONFIG_IP_PNP_DHCP is not set
   3.244 +# CONFIG_IP_PNP_BOOTP is not set
   3.245 +# CONFIG_IP_PNP_RARP is not set
   3.246 +# CONFIG_NET_IPIP is not set
   3.247 +# CONFIG_NET_IPGRE is not set
   3.248 +# CONFIG_ARPD is not set
   3.249 +# CONFIG_SYN_COOKIES is not set
   3.250 +# CONFIG_INET_AH is not set
   3.251 +# CONFIG_INET_ESP is not set
   3.252 +# CONFIG_INET_IPCOMP is not set
   3.253 +# CONFIG_INET_TUNNEL is not set
   3.254 +CONFIG_IP_TCPDIAG=y
   3.255 +# CONFIG_IP_TCPDIAG_IPV6 is not set
   3.256 +# CONFIG_IPV6 is not set
   3.257 +# CONFIG_NETFILTER is not set
   3.258 +
   3.259 +#
   3.260 +# SCTP Configuration (EXPERIMENTAL)
   3.261 +#
   3.262 +# CONFIG_IP_SCTP is not set
   3.263 +# CONFIG_ATM is not set
   3.264 +# CONFIG_BRIDGE is not set
   3.265 +# CONFIG_VLAN_8021Q is not set
   3.266 +# CONFIG_DECNET is not set
   3.267 +# CONFIG_LLC2 is not set
   3.268 +# CONFIG_IPX is not set
   3.269 +# CONFIG_ATALK is not set
   3.270 +# CONFIG_X25 is not set
   3.271 +# CONFIG_LAPB is not set
   3.272 +# CONFIG_NET_DIVERT is not set
   3.273 +# CONFIG_ECONET is not set
   3.274 +# CONFIG_WAN_ROUTER is not set
   3.275 +
   3.276 +#
   3.277 +# QoS and/or fair queueing
   3.278 +#
   3.279 +# CONFIG_NET_SCHED is not set
   3.280 +# CONFIG_NET_CLS_ROUTE is not set
   3.281 +
   3.282 +#
   3.283 +# Network testing
   3.284 +#
   3.285 +# CONFIG_NET_PKTGEN is not set
   3.286 +# CONFIG_NETPOLL is not set
   3.287 +# CONFIG_NET_POLL_CONTROLLER is not set
   3.288 +# CONFIG_HAMRADIO is not set
   3.289 +# CONFIG_IRDA is not set
   3.290 +# CONFIG_BT is not set
   3.291 +CONFIG_NETDEVICES=y
   3.292 +# CONFIG_DUMMY is not set
   3.293 +# CONFIG_BONDING is not set
   3.294 +# CONFIG_EQUALIZER is not set
   3.295 +# CONFIG_TUN is not set
   3.296 +
   3.297 +#
   3.298 +# Ethernet (10 or 100Mbit)
   3.299 +#
   3.300 +# CONFIG_NET_ETHERNET is not set
   3.301 +
   3.302 +#
   3.303 +# Ethernet (1000 Mbit)
   3.304 +#
   3.305 +
   3.306 +#
   3.307 +# Ethernet (10000 Mbit)
   3.308 +#
   3.309 +
   3.310 +#
   3.311 +# Token Ring devices
   3.312 +#
   3.313 +
   3.314 +#
   3.315 +# Wireless LAN (non-hamradio)
   3.316 +#
   3.317 +# CONFIG_NET_RADIO is not set
   3.318 +
   3.319 +#
   3.320 +# Wan interfaces
   3.321 +#
   3.322 +# CONFIG_WAN is not set
   3.323 +# CONFIG_PPP is not set
   3.324 +# CONFIG_SLIP is not set
   3.325 +# CONFIG_SHAPER is not set
   3.326 +# CONFIG_NETCONSOLE is not set
   3.327 +CONFIG_UNIX98_PTYS=y
   3.328 +
   3.329 +#
   3.330 +# File systems
   3.331 +#
   3.332 +CONFIG_EXT2_FS=y
   3.333 +# CONFIG_EXT2_FS_XATTR is not set
   3.334 +CONFIG_EXT3_FS=y
   3.335 +CONFIG_EXT3_FS_XATTR=y
   3.336 +# CONFIG_EXT3_FS_POSIX_ACL is not set
   3.337 +# CONFIG_EXT3_FS_SECURITY is not set
   3.338 +CONFIG_JBD=y
   3.339 +# CONFIG_JBD_DEBUG is not set
   3.340 +CONFIG_FS_MBCACHE=y
   3.341 +CONFIG_REISERFS_FS=y
   3.342 +# CONFIG_REISERFS_CHECK is not set
   3.343 +# CONFIG_REISERFS_PROC_INFO is not set
   3.344 +# CONFIG_REISERFS_FS_XATTR is not set
   3.345 +# CONFIG_JFS_FS is not set
   3.346 +# CONFIG_XFS_FS is not set
   3.347 +# CONFIG_MINIX_FS is not set
   3.348 +# CONFIG_ROMFS_FS is not set
   3.349 +# CONFIG_QUOTA is not set
   3.350 +CONFIG_DNOTIFY=y
   3.351 +CONFIG_AUTOFS_FS=y
   3.352 +CONFIG_AUTOFS4_FS=y
   3.353 +
   3.354 +#
   3.355 +# CD-ROM/DVD Filesystems
   3.356 +#
   3.357 +CONFIG_ISO9660_FS=y
   3.358 +CONFIG_JOLIET=y
   3.359 +CONFIG_ZISOFS=y
   3.360 +CONFIG_ZISOFS_FS=y
   3.361 +# CONFIG_UDF_FS is not set
   3.362 +
   3.363 +#
   3.364 +# DOS/FAT/NT Filesystems
   3.365 +#
   3.366 +CONFIG_FAT_FS=m
   3.367 +CONFIG_MSDOS_FS=m
   3.368 +CONFIG_VFAT_FS=m
   3.369 +CONFIG_FAT_DEFAULT_CODEPAGE=437
   3.370 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
   3.371 +# CONFIG_NTFS_FS is not set
   3.372 +
   3.373 +#
   3.374 +# Pseudo filesystems
   3.375 +#
   3.376 +CONFIG_PROC_FS=y
   3.377 +CONFIG_PROC_KCORE=y
   3.378 +CONFIG_SYSFS=y
   3.379 +# CONFIG_DEVFS_FS is not set
   3.380 +CONFIG_DEVPTS_FS_XATTR=y
   3.381 +# CONFIG_DEVPTS_FS_SECURITY is not set
   3.382 +CONFIG_TMPFS=y
   3.383 +# CONFIG_TMPFS_XATTR is not set
   3.384 +# CONFIG_HUGETLBFS is not set
   3.385 +# CONFIG_HUGETLB_PAGE is not set
   3.386 +CONFIG_RAMFS=y
   3.387 +
   3.388 +#
   3.389 +# Miscellaneous filesystems
   3.390 +#
   3.391 +# CONFIG_ADFS_FS is not set
   3.392 +# CONFIG_AFFS_FS is not set
   3.393 +# CONFIG_HFS_FS is not set
   3.394 +# CONFIG_HFSPLUS_FS is not set
   3.395 +# CONFIG_BEFS_FS is not set
   3.396 +# CONFIG_BFS_FS is not set
   3.397 +# CONFIG_EFS_FS is not set
   3.398 +# CONFIG_CRAMFS is not set
   3.399 +# CONFIG_VXFS_FS is not set
   3.400 +# CONFIG_HPFS_FS is not set
   3.401 +# CONFIG_QNX4FS_FS is not set
   3.402 +# CONFIG_SYSV_FS is not set
   3.403 +# CONFIG_UFS_FS is not set
   3.404 +
   3.405 +#
   3.406 +# Network File Systems
   3.407 +#
   3.408 +CONFIG_NFS_FS=y
   3.409 +CONFIG_NFS_V3=y
   3.410 +# CONFIG_NFS_V4 is not set
   3.411 +# CONFIG_NFS_DIRECTIO is not set
   3.412 +# CONFIG_NFSD is not set
   3.413 +CONFIG_ROOT_NFS=y
   3.414 +CONFIG_LOCKD=y
   3.415 +CONFIG_LOCKD_V4=y
   3.416 +# CONFIG_EXPORTFS is not set
   3.417 +CONFIG_SUNRPC=y
   3.418 +# CONFIG_RPCSEC_GSS_KRB5 is not set
   3.419 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
   3.420 +# CONFIG_SMB_FS is not set
   3.421 +# CONFIG_CIFS is not set
   3.422 +# CONFIG_NCP_FS is not set
   3.423 +# CONFIG_CODA_FS is not set
   3.424 +# CONFIG_AFS_FS is not set
   3.425 +
   3.426 +#
   3.427 +# Partition Types
   3.428 +#
   3.429 +# CONFIG_PARTITION_ADVANCED is not set
   3.430 +CONFIG_MSDOS_PARTITION=y
   3.431 +
   3.432 +#
   3.433 +# Native Language Support
   3.434 +#
   3.435 +CONFIG_NLS=y
   3.436 +CONFIG_NLS_DEFAULT="iso8859-1"
   3.437 +CONFIG_NLS_CODEPAGE_437=y
   3.438 +# CONFIG_NLS_CODEPAGE_737 is not set
   3.439 +# CONFIG_NLS_CODEPAGE_775 is not set
   3.440 +# CONFIG_NLS_CODEPAGE_850 is not set
   3.441 +# CONFIG_NLS_CODEPAGE_852 is not set
   3.442 +# CONFIG_NLS_CODEPAGE_855 is not set
   3.443 +# CONFIG_NLS_CODEPAGE_857 is not set
   3.444 +# CONFIG_NLS_CODEPAGE_860 is not set
   3.445 +# CONFIG_NLS_CODEPAGE_861 is not set
   3.446 +# CONFIG_NLS_CODEPAGE_862 is not set
   3.447 +# CONFIG_NLS_CODEPAGE_863 is not set
   3.448 +# CONFIG_NLS_CODEPAGE_864 is not set
   3.449 +# CONFIG_NLS_CODEPAGE_865 is not set
   3.450 +# CONFIG_NLS_CODEPAGE_866 is not set
   3.451 +# CONFIG_NLS_CODEPAGE_869 is not set
   3.452 +# CONFIG_NLS_CODEPAGE_936 is not set
   3.453 +# CONFIG_NLS_CODEPAGE_950 is not set
   3.454 +# CONFIG_NLS_CODEPAGE_932 is not set
   3.455 +# CONFIG_NLS_CODEPAGE_949 is not set
   3.456 +# CONFIG_NLS_CODEPAGE_874 is not set
   3.457 +# CONFIG_NLS_ISO8859_8 is not set
   3.458 +# CONFIG_NLS_CODEPAGE_1250 is not set
   3.459 +# CONFIG_NLS_CODEPAGE_1251 is not set
   3.460 +# CONFIG_NLS_ASCII is not set
   3.461 +CONFIG_NLS_ISO8859_1=y
   3.462 +# CONFIG_NLS_ISO8859_2 is not set
   3.463 +# CONFIG_NLS_ISO8859_3 is not set
   3.464 +# CONFIG_NLS_ISO8859_4 is not set
   3.465 +# CONFIG_NLS_ISO8859_5 is not set
   3.466 +# CONFIG_NLS_ISO8859_6 is not set
   3.467 +# CONFIG_NLS_ISO8859_7 is not set
   3.468 +# CONFIG_NLS_ISO8859_9 is not set
   3.469 +# CONFIG_NLS_ISO8859_13 is not set
   3.470 +# CONFIG_NLS_ISO8859_14 is not set
   3.471 +# CONFIG_NLS_ISO8859_15 is not set
   3.472 +# CONFIG_NLS_KOI8_R is not set
   3.473 +# CONFIG_NLS_KOI8_U is not set
   3.474 +# CONFIG_NLS_UTF8 is not set
   3.475 +
   3.476 +#
   3.477 +# Security options
   3.478 +#
   3.479 +# CONFIG_KEYS is not set
   3.480 +# CONFIG_SECURITY is not set
   3.481 +
   3.482 +#
   3.483 +# Cryptographic options
   3.484 +#
   3.485 +CONFIG_CRYPTO=y
   3.486 +# CONFIG_CRYPTO_HMAC is not set
   3.487 +# CONFIG_CRYPTO_NULL is not set
   3.488 +# CONFIG_CRYPTO_MD4 is not set
   3.489 +CONFIG_CRYPTO_MD5=m
   3.490 +# CONFIG_CRYPTO_SHA1 is not set
   3.491 +# CONFIG_CRYPTO_SHA256 is not set
   3.492 +# CONFIG_CRYPTO_SHA512 is not set
   3.493 +# CONFIG_CRYPTO_WP512 is not set
   3.494 +# CONFIG_CRYPTO_DES is not set
   3.495 +# CONFIG_CRYPTO_BLOWFISH is not set
   3.496 +# CONFIG_CRYPTO_TWOFISH is not set
   3.497 +# CONFIG_CRYPTO_SERPENT is not set
   3.498 +# CONFIG_CRYPTO_AES_586 is not set
   3.499 +# CONFIG_CRYPTO_CAST5 is not set
   3.500 +# CONFIG_CRYPTO_CAST6 is not set
   3.501 +# CONFIG_CRYPTO_TEA is not set
   3.502 +# CONFIG_CRYPTO_ARC4 is not set
   3.503 +# CONFIG_CRYPTO_KHAZAD is not set
   3.504 +# CONFIG_CRYPTO_ANUBIS is not set
   3.505 +# CONFIG_CRYPTO_DEFLATE is not set
   3.506 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
   3.507 +CONFIG_CRYPTO_CRC32C=m
   3.508 +# CONFIG_CRYPTO_TEST is not set
   3.509 +
   3.510 +#
   3.511 +# Library routines
   3.512 +#
   3.513 +# CONFIG_CRC_CCITT is not set
   3.514 +# CONFIG_CRC32 is not set
   3.515 +CONFIG_LIBCRC32C=m
   3.516 +CONFIG_ZLIB_INFLATE=y
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/Kconfig	Sat Apr 02 20:27:11 2005 +0000
     4.3 @@ -0,0 +1,463 @@
     4.4 +#
     4.5 +# For a description of the syntax of this configuration file,
     4.6 +# see Documentation/kbuild/kconfig-language.txt.
     4.7 +#
     4.8 +# Note: ISA is disabled and will hopefully never be enabled.
     4.9 +# If you managed to buy an ISA x86-64 box you'll have to fix all the
    4.10 +# ISA drivers you need yourself.
    4.11 +#
    4.12 +
    4.13 +menu "X86_64 processor configuration"
    4.14 +	depends XEN_X86_64
    4.15 +
    4.16 +config XENARCH
    4.17 +	string
    4.18 +	default x86_64
    4.19 +
    4.20 +config X86_64
    4.21 +	bool
    4.22 +	default y
    4.23 +	help
    4.24 +	  Port to the x86-64 architecture. x86-64 is a 64-bit extension to the
    4.25 +	  classical 32-bit x86 architecture. For details see
    4.26 +	  <http://www.x86-64.org/>.
    4.27 +
    4.28 +config X86
    4.29 +        bool
    4.30 +        default y
    4.31 +
    4.32 +config 64BIT
    4.33 +	def_bool y
    4.34 +
    4.35 +#config X86
    4.36 +#	bool
    4.37 +#	default y
    4.38 +
    4.39 +config MMU
    4.40 +	bool
    4.41 +	default y
    4.42 +
    4.43 +config ISA
    4.44 +	bool
    4.45 +
    4.46 +config SBUS
    4.47 +	bool
    4.48 +
    4.49 +config RWSEM_GENERIC_SPINLOCK
    4.50 +	bool
    4.51 +	default y
    4.52 +
    4.53 +config RWSEM_XCHGADD_ALGORITHM
    4.54 +	bool
    4.55 +
    4.56 +config GENERIC_CALIBRATE_DELAY
    4.57 +	bool
    4.58 +	default y
    4.59 +
    4.60 +config X86_CMPXCHG
    4.61 +	bool
    4.62 +	default y
    4.63 +
    4.64 +config EARLY_PRINTK
    4.65 +	bool "Early Printk"
    4.66 +	default n
    4.67 +	help
    4.68 +	  Write kernel log output directly into the VGA buffer or to a serial
    4.69 +	  port.
    4.70 +
    4.71 +	  This is useful for kernel debugging when your machine crashes very
    4.72 +	  early before the console code is initialized. For normal operation
    4.73 +	  it is not recommended because it looks ugly and doesn't cooperate
    4.74 +	  with klogd/syslogd or the X server. You should normally N here,
    4.75 +	  unless you want to debug such a crash.
    4.76 +
    4.77 +config HPET_TIMER
    4.78 +	bool
    4.79 +	default n
    4.80 +	help
    4.81 +	  Use the IA-PC HPET (High Precision Event Timer) to manage
    4.82 +	  time in preference to the PIT and RTC, if a HPET is
    4.83 +	  present.  The HPET provides a stable time base on SMP
    4.84 +	  systems, unlike the RTC, but it is more expensive to access,
    4.85 +	  as it is off-chip.  You can find the HPET spec at
    4.86 +	  <http://www.intel.com/labs/platcomp/hpet/hpetspec.htm>.
    4.87 +
    4.88 +	  If unsure, say Y.
    4.89 +
    4.90 +config HPET_EMULATE_RTC
    4.91 +	bool "Provide RTC interrupt"
    4.92 +	depends on HPET_TIMER && RTC=y
    4.93 +
    4.94 +config GENERIC_ISA_DMA
    4.95 +	bool
    4.96 +	default y
    4.97 +
    4.98 +config GENERIC_IOMAP
    4.99 +	bool
   4.100 +	default y
   4.101 +
   4.102 +#source "init/Kconfig"
   4.103 +
   4.104 +
   4.105 +menu "Processor type and features"
   4.106 +
   4.107 +choice
   4.108 +	prompt "Processor family"
   4.109 +	default MK8
   4.110 +
   4.111 +config MK8
   4.112 +	bool "AMD-Opteron/Athlon64"
   4.113 +	help
   4.114 +	  Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs.
   4.115 +
   4.116 +config MPSC
   4.117 +       bool "Intel x86-64"
   4.118 +       help
   4.119 +	  Optimize for Intel IA32 with 64bit extension CPUs
   4.120 +	  (Prescott/Nocona/Potomac)
   4.121 +
   4.122 +config GENERIC_CPU
   4.123 +	bool "Generic-x86-64"
   4.124 +	help
   4.125 +	  Generic x86-64 CPU.
   4.126 +
   4.127 +endchoice
   4.128 +
   4.129 +#
   4.130 +# Define implied options from the CPU selection here
   4.131 +#
   4.132 +config X86_L1_CACHE_BYTES
   4.133 +	int
   4.134 +	default "128" if GENERIC_CPU || MPSC
   4.135 +	default "64" if MK8
   4.136 +
   4.137 +config X86_L1_CACHE_SHIFT
   4.138 +	int
   4.139 +	default "7" if GENERIC_CPU || MPSC
   4.140 +	default "6" if MK8
   4.141 +
   4.142 +config X86_TSC
   4.143 +	bool
   4.144 +	default n
   4.145 +
   4.146 +config X86_GOOD_APIC
   4.147 +	bool
   4.148 +	default y
   4.149 +
   4.150 +config MICROCODE
   4.151 +	tristate "/dev/cpu/microcode - Intel CPU microcode support"
   4.152 +	---help---
   4.153 +	  If you say Y here the 'File systems' section, you will be
   4.154 +	  able to update the microcode on Intel processors. You will
   4.155 +	  obviously need the actual microcode binary data itself which is
   4.156 +	  not shipped with the Linux kernel.
   4.157 +
   4.158 +	  For latest news and information on obtaining all the required
   4.159 +	  ingredients for this driver, check:
   4.160 +	  <http://www.urbanmyth.org/microcode/>.
   4.161 +
   4.162 +	  To compile this driver as a module, choose M here: the
   4.163 +	  module will be called microcode.
   4.164 +	  If you use modprobe or kmod you may also want to add the line
   4.165 +	  'alias char-major-10-184 microcode' to your /etc/modules.conf file.
   4.166 +
   4.167 +config X86_MSR
   4.168 +	tristate "/dev/cpu/*/msr - Model-specific register support"
   4.169 +	help
   4.170 +	  This device gives privileged processes access to the x86
   4.171 +	  Model-Specific Registers (MSRs).  It is a character device with
   4.172 +	  major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr.
   4.173 +	  MSR accesses are directed to a specific CPU on multi-processor
   4.174 +	  systems.
   4.175 +
   4.176 +config X86_CPUID
   4.177 +	tristate "/dev/cpu/*/cpuid - CPU information support"
   4.178 +	help
   4.179 +	  This device gives processes access to the x86 CPUID instruction to
   4.180 +	  be executed on a specific processor.  It is a character device
   4.181 +	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
   4.182 +	  /dev/cpu/31/cpuid.
   4.183 +
   4.184 +# disable it for opteron optimized builds because it pulls in ACPI_BOOT
   4.185 +config X86_HT
   4.186 +	bool
   4.187 +	depends on SMP && !MK8
   4.188 +	default y
   4.189 +
   4.190 +config MATH_EMULATION
   4.191 +	bool
   4.192 +
   4.193 +config MCA
   4.194 +	bool
   4.195 +
   4.196 +config EISA
   4.197 +	bool
   4.198 +
   4.199 +#config X86_IO_APIC
   4.200 +#	bool
   4.201 +#	default n
   4.202 +
   4.203 +#config X86_LOCAL_APIC
   4.204 +#	bool
   4.205 +#	default n
   4.206 +
   4.207 +config MTRR
   4.208 +	bool "MTRR (Memory Type Range Register) support"
   4.209 +	---help---
   4.210 +	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
   4.211 +	  the Memory Type Range Registers (MTRRs) may be used to control
   4.212 +	  processor access to memory ranges. This is most useful if you have
   4.213 +	  a video (VGA) card on a PCI or AGP bus. Enabling write-combining
   4.214 +	  allows bus write transfers to be combined into a larger transfer
   4.215 +	  before bursting over the PCI/AGP bus. This can increase performance
   4.216 +	  of image write operations 2.5 times or more. Saying Y here creates a
   4.217 +	  /proc/mtrr file which may be used to manipulate your processor's
   4.218 +	  MTRRs. Typically the X server should use this.
   4.219 +
   4.220 +	  This code has a reasonably generic interface so that similar
   4.221 +	  control registers on other processors can be easily supported
   4.222 +	  as well.
   4.223 +
   4.224 +	  Saying Y here also fixes a problem with buggy SMP BIOSes which only
   4.225 +	  set the MTRRs for the boot CPU and not for the secondary CPUs. This
   4.226 +	  can lead to all sorts of problems, so it's good to say Y here.
   4.227 +
   4.228 +	  Just say Y here, all x86-64 machines support MTRRs.
   4.229 +
   4.230 +	  See <file:Documentation/mtrr.txt> for more information.
   4.231 +
   4.232 +config SMP
   4.233 +	bool "Symmetric multi-processing support"
   4.234 +	---help---
   4.235 +	  This enables support for systems with more than one CPU. If you have
   4.236 +	  a system with only one CPU, like most personal computers, say N. If
   4.237 +	  you have a system with more than one CPU, say Y.
   4.238 +
   4.239 +	  If you say N here, the kernel will run on single and multiprocessor
   4.240 +	  machines, but will use only one CPU of a multiprocessor machine. If
   4.241 +	  you say Y here, the kernel will run on many, but not all,
   4.242 +	  singleprocessor machines. On a singleprocessor machine, the kernel
   4.243 +	  will run faster if you say N here.
   4.244 +
   4.245 +	  If you don't know what to do here, say N.
   4.246 +
   4.247 +config PREEMPT
   4.248 +	bool "Preemptible Kernel"
   4.249 +	---help---
   4.250 +	  This option reduces the latency of the kernel when reacting to
   4.251 +	  real-time or interactive events by allowing a low priority process to
   4.252 +	  be preempted even if it is in kernel mode executing a system call.
   4.253 +	  This allows applications to run more reliably even when the system is
   4.254 +	  under load. On contrary it may also break your drivers and add
   4.255 +	  priority inheritance problems to your system. Don't select it if
   4.256 +	  you rely on a stable system or have slightly obscure hardware.
   4.257 +	  It's also not very well tested on x86-64 currently.
   4.258 +	  You have been warned.
   4.259 +
   4.260 +	  Say Y here if you are feeling brave and building a kernel for a
   4.261 +	  desktop, embedded or real-time system.  Say N if you are unsure.
   4.262 +
   4.263 +config SCHED_SMT
   4.264 +	bool "SMT (Hyperthreading) scheduler support"
   4.265 +	depends on SMP
   4.266 +	default off
   4.267 +	help
   4.268 +	  SMT scheduler support improves the CPU scheduler's decision making
   4.269 +	  when dealing with Intel Pentium 4 chips with HyperThreading at a
   4.270 +	  cost of slightly increased overhead in some places. If unsure say
   4.271 +	  N here.
   4.272 +
   4.273 +config K8_NUMA
   4.274 +       bool "K8 NUMA support"
   4.275 +       select NUMA
   4.276 +       depends on SMP
   4.277 +       help
   4.278 +	  Enable NUMA (Non Unified Memory Architecture) support for
   4.279 +	  AMD Opteron Multiprocessor systems. The kernel will try to allocate
   4.280 +	  memory used by a CPU on the local memory controller of the CPU
   4.281 +	  and add some more NUMA awareness to the kernel.
   4.282 +	  This code is recommended on all multiprocessor Opteron systems
   4.283 +	  and normally doesn't hurt on others.
   4.284 +
   4.285 +config NUMA_EMU
   4.286 +	bool "NUMA emulation support"
   4.287 +	select NUMA
   4.288 +	depends on SMP
   4.289 +	help
   4.290 +	  Enable NUMA emulation. A flat machine will be split
   4.291 +	  into virtual nodes when booted with "numa=fake=N", where N is the
   4.292 +	  number of nodes. This is only useful for debugging.
   4.293 +
   4.294 +config DISCONTIGMEM
   4.295 +       bool
   4.296 +       depends on NUMA
   4.297 +       default y
   4.298 +
   4.299 +config NUMA
   4.300 +       bool
   4.301 +       default n
   4.302 +
   4.303 +config HAVE_DEC_LOCK
   4.304 +	bool
   4.305 +	depends on SMP
   4.306 +	default y
   4.307 +
   4.308 +# actually 64 maximum, but you need to fix the APIC code first
   4.309 +# to use clustered mode or whatever your big iron needs
   4.310 +config NR_CPUS
   4.311 +	int "Maximum number of CPUs (2-8)"
   4.312 +	range 2 8
   4.313 +	depends on SMP
   4.314 +	default "8"
   4.315 +	help
   4.316 +	  This allows you to specify the maximum number of CPUs which this
   4.317 +	  kernel will support.  The maximum supported value is 32 and the
   4.318 +	  minimum value which makes sense is 2.
   4.319 +
   4.320 +	  This is purely to save memory - each supported CPU requires
   4.321 +	  memory in the static kernel configuration.
   4.322 +
   4.323 +config GART_IOMMU
   4.324 +	bool "IOMMU support"
   4.325 +	depends on PCI
   4.326 +	help
   4.327 +	  Support the K8 IOMMU. Needed to run systems with more than 4GB of memory
   4.328 +	  properly with 32-bit PCI devices that do not support DAC (Double Address
   4.329 +	  Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter.
   4.330 +	  Normally the kernel will take the right choice by itself.
   4.331 +	  If unsure, say Y.
   4.332 +
   4.333 +# need this always enabled with GART_IOMMU for the VIA workaround
   4.334 +config SWIOTLB
   4.335 +       bool
   4.336 +       depends on GART_IOMMU
   4.337 +       default y
   4.338 +
   4.339 +config DUMMY_IOMMU
   4.340 +	bool
   4.341 +	depends on !GART_IOMMU && !SWIOTLB
   4.342 +	default y
   4.343 +	help
   4.344 +	  Don't use IOMMU code. This will cause problems when you have more than 4GB
   4.345 +	  of memory and any 32-bit devices. Don't turn on unless you know what you
   4.346 +	  are doing.
   4.347 +
   4.348 +config X86_MCE
   4.349 +	bool "Machine check support" if EMBEDDED
   4.350 +	default n
   4.351 +	help
   4.352 +	   Include a machine check error handler to report hardware errors.
   4.353 +	   This version will require the mcelog utility to decode some
   4.354 +	   machine check error logs. See
   4.355 +	   ftp://ftp.x86-64.org/pub/linux/tools/mcelog
   4.356 +
   4.357 +endmenu
   4.358 +
   4.359 +#
   4.360 +# Use the generic interrupt handling code in kernel/irq/:
   4.361 +#
   4.362 +config GENERIC_HARDIRQS
   4.363 +	bool
   4.364 +	default y
   4.365 +
   4.366 +config GENERIC_IRQ_PROBE
   4.367 +	bool
   4.368 +	default y
   4.369 +
   4.370 +menu "Power management options"
   4.371 +
   4.372 +source kernel/power/Kconfig
   4.373 +
   4.374 +source "drivers/acpi/Kconfig"
   4.375 +
   4.376 +source "arch/x86_64/kernel/cpufreq/Kconfig"
   4.377 +
   4.378 +endmenu
   4.379 +
   4.380 +menu "Bus options (PCI etc.)"
   4.381 +
   4.382 +config PCI
   4.383 +	bool "PCI support"
   4.384 +
   4.385 +# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
   4.386 +config PCI_DIRECT
   4.387 +	bool
   4.388 +	depends on PCI
   4.389 +	default y
   4.390 +
   4.391 +config PCI_MMCONFIG
   4.392 +	bool "Support mmconfig PCI config space access"
   4.393 +	depends on PCI
   4.394 +	select ACPI_BOOT
   4.395 +
   4.396 +config UNORDERED_IO
   4.397 +       bool "Unordered IO mapping access"
   4.398 +       depends on EXPERIMENTAL
   4.399 +       help
   4.400 +         Use unordered stores to access IO memory mappings in device drivers.
   4.401 +	 Still very experimental. When a driver works on IA64/ppc64/pa-risc it should
   4.402 +	 work with this option, but it makes the drivers behave differently
   4.403 +	 from i386. Requires that the driver writer used memory barriers
   4.404 +	 properly.
   4.405 +
   4.406 +#source "drivers/pci/Kconfig"
   4.407 +
   4.408 +#source "drivers/pcmcia/Kconfig"
   4.409 +
   4.410 +#source "drivers/pci/hotplug/Kconfig"
   4.411 +
   4.412 +endmenu
   4.413 +
   4.414 +
   4.415 +menu "Executable file formats / Emulations"
   4.416 +
   4.417 +# source "fs/Kconfig.binfmt"
   4.418 +
   4.419 +config IA32_EMULATION
   4.420 +	bool "IA32 Emulation"
   4.421 +	help
   4.422 +	  Include code to run 32-bit programs under a 64-bit kernel. You should likely
   4.423 +	  turn this on, unless you're 100% sure that you don't have any 32-bit programs
   4.424 +	  left.
   4.425 +
   4.426 +config IA32_AOUT
   4.427 +       bool "IA32 a.out support"
   4.428 +       depends on IA32_EMULATION
   4.429 +       help
   4.430 +         Support old a.out binaries in the 32bit emulation.
   4.431 +
   4.432 +config COMPAT
   4.433 +	bool
   4.434 +	depends on IA32_EMULATION
   4.435 +	default y
   4.436 +
   4.437 +config SYSVIPC_COMPAT
   4.438 +	bool
   4.439 +	depends on COMPAT && SYSVIPC
   4.440 +	default y
   4.441 +
   4.442 +config UID16
   4.443 +	bool
   4.444 +	depends on IA32_EMULATION
   4.445 +	default y
   4.446 +
   4.447 +endmenu
   4.448 +
   4.449 +# source drivers/Kconfig
   4.450 +
   4.451 +# source "drivers/firmware/Kconfig"
   4.452 +
   4.453 +# source fs/Kconfig
   4.454 +
   4.455 +#source "arch/x86_64/oprofile/Kconfig"
   4.456 +
   4.457 +#source "arch/x86_64/Kconfig.debug"
   4.458 +
   4.459 +# source "security/Kconfig"
   4.460 +
   4.461 +# source "crypto/Kconfig"
   4.462 +
   4.463 +# source "lib/Kconfig"
   4.464 +
   4.465 +endmenu
   4.466 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/Makefile	Sat Apr 02 20:27:11 2005 +0000
     5.3 @@ -0,0 +1,92 @@
     5.4 +#
     5.5 +# x86_64/Makefile
     5.6 +#
     5.7 +# This file is included by the global makefile so that you can add your own
     5.8 +# architecture-specific flags and dependencies. Remember to do have actions
     5.9 +# for "archclean" and "archdep" for cleaning up and making dependencies for
    5.10 +# this architecture
    5.11 +#
    5.12 +# This file is subject to the terms and conditions of the GNU General Public
    5.13 +# License.  See the file "COPYING" in the main directory of this archive
    5.14 +# for more details.
    5.15 +#
    5.16 +# Copyright (C) 1994 by Linus Torvalds
    5.17 +#
    5.18 +# 19990713  Artur Skawina <skawina@geocities.com>
    5.19 +#           Added '-march' and '-mpreferred-stack-boundary' support
    5.20 +# 20000913  Pavel Machek <pavel@suse.cz>
    5.21 +#	    Converted for x86_64 architecture
    5.22 +# 20010105  Andi Kleen, add IA32 compiler.
    5.23 +#           ....and later removed it again....
    5.24 +# 20050205  Jun Nakajima <jun.nakajima@intel.com> 
    5.25 +#           Modified for Xen
    5.26 +#
    5.27 +# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
    5.28 +
    5.29 +#
    5.30 +# early bootup linking needs 32bit. You can either use real 32bit tools
    5.31 +# here or 64bit tools in 32bit mode.
    5.32 +#
    5.33 +XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
    5.34 +
    5.35 +IA32_CC := $(CC) $(CPPFLAGS) -m32 -O2 -fomit-frame-pointer
    5.36 +IA32_LD := $(LD) -m elf_i386
    5.37 +IA32_AS := $(CC) $(AFLAGS) -m32 -Wa,--32 -traditional -c
    5.38 +IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
    5.39 +IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
    5.40 +export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
    5.41 +
    5.42 +
    5.43 +LDFLAGS		:= -m elf_x86_64
    5.44 +#LDFLAGS_vmlinux := -e stext
    5.45 +
    5.46 +CHECKFLAGS      += -D__x86_64__ -m64
    5.47 +
    5.48 +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
    5.49 +cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
    5.50 +CFLAGS += $(cflags-y)
    5.51 +
    5.52 +CFLAGS += -mno-red-zone
    5.53 +CFLAGS += -mcmodel=kernel
    5.54 +CFLAGS += -pipe
    5.55 +# this makes reading assembly source easier, but produces worse code
    5.56 +# actually it makes the kernel smaller too.
    5.57 +CFLAGS += -fno-reorder-blocks	
    5.58 +CFLAGS += -Wno-sign-compare
    5.59 +ifneq ($(CONFIG_DEBUG_INFO),y)
    5.60 +CFLAGS += -fno-asynchronous-unwind-tables
    5.61 +# -fweb shrinks the kernel a bit, but the difference is very small
    5.62 +# it also messes up debugging, so don't use it for now.
    5.63 +#CFLAGS += $(call cc-option,-fweb)
    5.64 +endif
    5.65 +# -funit-at-a-time shrinks the kernel .text considerably
    5.66 +# unfortunately it makes reading oopses harder.
    5.67 +CFLAGS += $(call cc-option,-funit-at-a-time,)
    5.68 +
    5.69 +head-y := arch/xen/x86_64/kernel/head.o arch/xen/x86_64/kernel/head64.o arch/xen/x86_64/kernel/init_task.o
    5.70 +
    5.71 +libs-y 					+= arch/x86_64/lib/
    5.72 +core-y					+= arch/xen/x86_64/kernel/ arch/xen/x86_64/mm/
    5.73 +core-$(CONFIG_IA32_EMULATION)		+= arch/xen/x86_64/ia32/
    5.74 +drivers-$(CONFIG_PCI)			+= arch/xen/x86_64/pci/
    5.75 +drivers-$(CONFIG_OPROFILE)		+= arch/x86_64/oprofile/
    5.76 +
    5.77 +# for clean
    5.78 +obj-	+= kernel/ mm/ pci/
    5.79 +
    5.80 +xenflags-y += -Iinclude/asm-xen/asm-x86_64/mach-xen
    5.81 +
    5.82 +CFLAGS += $(xenflags-y)
    5.83 +AFLAGS += $(xenflags-y)
    5.84 +
    5.85 +prepare: include/asm-$(XENARCH)/asm_offset.h
    5.86 +CLEAN_FILES += include/asm-$(XENARCH)/asm_offset.h
    5.87 +
    5.88 +arch/$(XENARCH)/kernel/asm-offsets.s: include/asm include/.asm-ignore \
    5.89 +	include/linux/version.h include/config/MARKER
    5.90 +
    5.91 +
    5.92 +include/asm-$(XENARCH)/asm_offset.h: arch/xen/x86_64/kernel/asm-offsets.s
    5.93 +	$(call filechk,gen-asm-offsets)
    5.94 +	ln -fsn asm_offset.h include/asm-$(XENARCH)/offset.h
    5.95 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/defconfig	Sat Apr 02 20:27:11 2005 +0000
     6.3 @@ -0,0 +1,1249 @@
     6.4 +#
     6.5 +# Automatically generated make config: don't edit
     6.6 +# Linux kernel version: 2.6.10-xen0
     6.7 +# Fri Mar 11 14:30:42 2005
     6.8 +#
     6.9 +CONFIG_XEN=y
    6.10 +CONFIG_ARCH_XEN=y
    6.11 +CONFIG_NO_IDLE_HZ=y
    6.12 +
    6.13 +#
    6.14 +# XEN
    6.15 +#
    6.16 +CONFIG_XEN_PRIVILEGED_GUEST=y
    6.17 +CONFIG_XEN_PHYSDEV_ACCESS=y
    6.18 +CONFIG_XEN_BLKDEV_BACKEND=y
    6.19 +CONFIG_XEN_NETDEV_BACKEND=y
    6.20 +CONFIG_XEN_BLKDEV_FRONTEND=y
    6.21 +CONFIG_XEN_NETDEV_FRONTEND=y
    6.22 +# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    6.23 +# CONFIG_XEN_BLKDEV_TAP is not set
    6.24 +CONFIG_XEN_WRITABLE_PAGETABLES=y
    6.25 +CONFIG_XEN_SCRUB_PAGES=y
    6.26 +# CONFIG_XEN_X86 is not set
    6.27 +CONFIG_XEN_X86_64=y
    6.28 +CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    6.29 +
    6.30 +#
    6.31 +# Code maturity level options
    6.32 +#
    6.33 +CONFIG_EXPERIMENTAL=y
    6.34 +CONFIG_CLEAN_COMPILE=y
    6.35 +CONFIG_BROKEN_ON_SMP=y
    6.36 +
    6.37 +#
    6.38 +# General setup
    6.39 +#
    6.40 +CONFIG_LOCALVERSION=""
    6.41 +CONFIG_SWAP=y
    6.42 +CONFIG_SYSVIPC=y
    6.43 +CONFIG_POSIX_MQUEUE=y
    6.44 +CONFIG_BSD_PROCESS_ACCT=y
    6.45 +# CONFIG_BSD_PROCESS_ACCT_V3 is not set
    6.46 +CONFIG_SYSCTL=y
    6.47 +CONFIG_AUDIT=y
    6.48 +CONFIG_AUDITSYSCALL=y
    6.49 +CONFIG_LOG_BUF_SHIFT=14
    6.50 +# CONFIG_HOTPLUG is not set
    6.51 +CONFIG_KOBJECT_UEVENT=y
    6.52 +# CONFIG_IKCONFIG is not set
    6.53 +# CONFIG_EMBEDDED is not set
    6.54 +CONFIG_KALLSYMS=y
    6.55 +CONFIG_KALLSYMS_EXTRA_PASS=y
    6.56 +CONFIG_FUTEX=y
    6.57 +CONFIG_EPOLL=y
    6.58 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
    6.59 +CONFIG_SHMEM=y
    6.60 +CONFIG_CC_ALIGN_FUNCTIONS=0
    6.61 +CONFIG_CC_ALIGN_LABELS=0
    6.62 +CONFIG_CC_ALIGN_LOOPS=0
    6.63 +CONFIG_CC_ALIGN_JUMPS=0
    6.64 +# CONFIG_TINY_SHMEM is not set
    6.65 +
    6.66 +#
    6.67 +# Loadable module support
    6.68 +#
    6.69 +CONFIG_MODULES=y
    6.70 +CONFIG_MODULE_UNLOAD=y
    6.71 +# CONFIG_MODULE_FORCE_UNLOAD is not set
    6.72 +CONFIG_OBSOLETE_MODPARM=y
    6.73 +CONFIG_MODVERSIONS=y
    6.74 +# CONFIG_MODULE_SRCVERSION_ALL is not set
    6.75 +CONFIG_KMOD=y
    6.76 +CONFIG_XENARCH="x86_64"
    6.77 +CONFIG_MMU=y
    6.78 +CONFIG_GENERIC_ISA_DMA=y
    6.79 +CONFIG_GENERIC_IOMAP=y
    6.80 +# CONFIG_MK8 is not set
    6.81 +CONFIG_X86_CMPXCHG=y
    6.82 +CONFIG_X86_L1_CACHE_SHIFT=7
    6.83 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
    6.84 +CONFIG_X86_GOOD_APIC=y
    6.85 +# CONFIG_HPET_TIMER is not set
    6.86 +# CONFIG_SMP is not set
    6.87 +# CONFIG_PREEMPT is not set
    6.88 +CONFIG_MICROCODE=y
    6.89 +CONFIG_X86_CPUID=y
    6.90 +# CONFIG_NUMA is not set
    6.91 +# CONFIG_MTRR is not set
    6.92 +CONFIG_PCI=y
    6.93 +CONFIG_PCI_DIRECT=y
    6.94 +# CONFIG_EARLY_PRINTK is not set
    6.95 +CONFIG_GENERIC_HARDIRQS=y
    6.96 +CONFIG_GENERIC_IRQ_PROBE=y
    6.97 +
    6.98 +#
    6.99 +# X86_64 processor configuration
   6.100 +#
   6.101 +CONFIG_X86_64=y
   6.102 +CONFIG_X86=y
   6.103 +CONFIG_64BIT=y
   6.104 +
   6.105 +#
   6.106 +# Processor type and features
   6.107 +#
   6.108 +# CONFIG_MPSC is not set
   6.109 +CONFIG_GENERIC_CPU=y
   6.110 +CONFIG_X86_L1_CACHE_BYTES=128
   6.111 +# CONFIG_X86_TSC is not set
   6.112 +# CONFIG_X86_MSR is not set
   6.113 +# CONFIG_GART_IOMMU is not set
   6.114 +CONFIG_DUMMY_IOMMU=y
   6.115 +# CONFIG_X86_MCE is not set
   6.116 +
   6.117 +#
   6.118 +# Power management options
   6.119 +#
   6.120 +# CONFIG_PM is not set
   6.121 +
   6.122 +#
   6.123 +# ACPI (Advanced Configuration and Power Interface) Support
   6.124 +#
   6.125 +# CONFIG_ACPI is not set
   6.126 +CONFIG_ACPI_BLACKLIST_YEAR=0
   6.127 +
   6.128 +#
   6.129 +# CPU Frequency scaling
   6.130 +#
   6.131 +# CONFIG_CPU_FREQ is not set
   6.132 +
   6.133 +#
   6.134 +# Bus options (PCI etc.)
   6.135 +#
   6.136 +# CONFIG_PCI_MMCONFIG is not set
   6.137 +# CONFIG_UNORDERED_IO is not set
   6.138 +
   6.139 +#
   6.140 +# Executable file formats / Emulations
   6.141 +#
   6.142 +# CONFIG_IA32_EMULATION is not set
   6.143 +
   6.144 +#
   6.145 +# Executable file formats
   6.146 +#
   6.147 +CONFIG_BINFMT_ELF=y
   6.148 +CONFIG_BINFMT_MISC=y
   6.149 +
   6.150 +#
   6.151 +# Device Drivers
   6.152 +#
   6.153 +
   6.154 +#
   6.155 +# Generic Driver Options
   6.156 +#
   6.157 +CONFIG_STANDALONE=y
   6.158 +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
   6.159 +CONFIG_FW_LOADER=m
   6.160 +
   6.161 +#
   6.162 +# Memory Technology Devices (MTD)
   6.163 +#
   6.164 +# CONFIG_MTD is not set
   6.165 +
   6.166 +#
   6.167 +# Parallel port support
   6.168 +#
   6.169 +# CONFIG_PARPORT is not set
   6.170 +
   6.171 +#
   6.172 +# Plug and Play support
   6.173 +#
   6.174 +
   6.175 +#
   6.176 +# Block devices
   6.177 +#
   6.178 +# CONFIG_BLK_DEV_FD is not set
   6.179 +# CONFIG_BLK_CPQ_DA is not set
   6.180 +# CONFIG_BLK_CPQ_CISS_DA is not set
   6.181 +# CONFIG_BLK_DEV_DAC960 is not set
   6.182 +# CONFIG_BLK_DEV_UMEM is not set
   6.183 +CONFIG_BLK_DEV_LOOP=y
   6.184 +CONFIG_BLK_DEV_CRYPTOLOOP=m
   6.185 +CONFIG_BLK_DEV_NBD=m
   6.186 +# CONFIG_BLK_DEV_SX8 is not set
   6.187 +CONFIG_BLK_DEV_RAM=y
   6.188 +CONFIG_BLK_DEV_RAM_COUNT=16
   6.189 +CONFIG_BLK_DEV_RAM_SIZE=16384
   6.190 +CONFIG_BLK_DEV_INITRD=y
   6.191 +CONFIG_INITRAMFS_SOURCE=""
   6.192 +# CONFIG_LBD is not set
   6.193 +# CONFIG_CDROM_PKTCDVD is not set
   6.194 +
   6.195 +#
   6.196 +# IO Schedulers
   6.197 +#
   6.198 +CONFIG_IOSCHED_NOOP=y
   6.199 +CONFIG_IOSCHED_AS=y
   6.200 +CONFIG_IOSCHED_DEADLINE=y
   6.201 +CONFIG_IOSCHED_CFQ=y
   6.202 +
   6.203 +#
   6.204 +# ATA/ATAPI/MFM/RLL support
   6.205 +#
   6.206 +CONFIG_IDE=y
   6.207 +CONFIG_BLK_DEV_IDE=y
   6.208 +
   6.209 +#
   6.210 +# Please see Documentation/ide.txt for help/info on IDE drives
   6.211 +#
   6.212 +# CONFIG_BLK_DEV_IDE_SATA is not set
   6.213 +# CONFIG_BLK_DEV_HD_IDE is not set
   6.214 +CONFIG_BLK_DEV_IDEDISK=y
   6.215 +CONFIG_IDEDISK_MULTI_MODE=y
   6.216 +CONFIG_BLK_DEV_IDECD=y
   6.217 +# CONFIG_BLK_DEV_IDETAPE is not set
   6.218 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
   6.219 +CONFIG_BLK_DEV_IDESCSI=y
   6.220 +# CONFIG_IDE_TASK_IOCTL is not set
   6.221 +
   6.222 +#
   6.223 +# IDE chipset support/bugfixes
   6.224 +#
   6.225 +CONFIG_IDE_GENERIC=y
   6.226 +# CONFIG_BLK_DEV_CMD640 is not set
   6.227 +CONFIG_BLK_DEV_IDEPCI=y
   6.228 +CONFIG_IDEPCI_SHARE_IRQ=y
   6.229 +# CONFIG_BLK_DEV_OFFBOARD is not set
   6.230 +CONFIG_BLK_DEV_GENERIC=y
   6.231 +# CONFIG_BLK_DEV_OPTI621 is not set
   6.232 +# CONFIG_BLK_DEV_RZ1000 is not set
   6.233 +CONFIG_BLK_DEV_IDEDMA_PCI=y
   6.234 +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
   6.235 +CONFIG_IDEDMA_PCI_AUTO=y
   6.236 +# CONFIG_IDEDMA_ONLYDISK is not set
   6.237 +# CONFIG_BLK_DEV_AEC62XX is not set
   6.238 +# CONFIG_BLK_DEV_ALI15X3 is not set
   6.239 +# CONFIG_BLK_DEV_AMD74XX is not set
   6.240 +# CONFIG_BLK_DEV_ATIIXP is not set
   6.241 +# CONFIG_BLK_DEV_CMD64X is not set
   6.242 +# CONFIG_BLK_DEV_TRIFLEX is not set
   6.243 +# CONFIG_BLK_DEV_CY82C693 is not set
   6.244 +# CONFIG_BLK_DEV_CS5520 is not set
   6.245 +# CONFIG_BLK_DEV_CS5530 is not set
   6.246 +# CONFIG_BLK_DEV_HPT34X is not set
   6.247 +# CONFIG_BLK_DEV_HPT366 is not set
   6.248 +# CONFIG_BLK_DEV_SC1200 is not set
   6.249 +CONFIG_BLK_DEV_PIIX=y
   6.250 +# CONFIG_BLK_DEV_NS87415 is not set
   6.251 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
   6.252 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
   6.253 +# CONFIG_BLK_DEV_SVWKS is not set
   6.254 +# CONFIG_BLK_DEV_SIIMAGE is not set
   6.255 +# CONFIG_BLK_DEV_SIS5513 is not set
   6.256 +# CONFIG_BLK_DEV_SLC90E66 is not set
   6.257 +# CONFIG_BLK_DEV_TRM290 is not set
   6.258 +# CONFIG_BLK_DEV_VIA82CXXX is not set
   6.259 +# CONFIG_IDE_ARM is not set
   6.260 +CONFIG_BLK_DEV_IDEDMA=y
   6.261 +# CONFIG_IDEDMA_IVB is not set
   6.262 +CONFIG_IDEDMA_AUTO=y
   6.263 +# CONFIG_BLK_DEV_HD is not set
   6.264 +
   6.265 +#
   6.266 +# SCSI device support
   6.267 +#
   6.268 +CONFIG_SCSI=y
   6.269 +CONFIG_SCSI_PROC_FS=y
   6.270 +
   6.271 +#
   6.272 +# SCSI support type (disk, tape, CD-ROM)
   6.273 +#
   6.274 +CONFIG_BLK_DEV_SD=y
   6.275 +CONFIG_CHR_DEV_ST=m
   6.276 +CONFIG_CHR_DEV_OSST=m
   6.277 +CONFIG_BLK_DEV_SR=m
   6.278 +CONFIG_BLK_DEV_SR_VENDOR=y
   6.279 +CONFIG_CHR_DEV_SG=y
   6.280 +
   6.281 +#
   6.282 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
   6.283 +#
   6.284 +# CONFIG_SCSI_MULTI_LUN is not set
   6.285 +CONFIG_SCSI_CONSTANTS=y
   6.286 +CONFIG_SCSI_LOGGING=y
   6.287 +
   6.288 +#
   6.289 +# SCSI Transport Attributes
   6.290 +#
   6.291 +CONFIG_SCSI_SPI_ATTRS=m
   6.292 +CONFIG_SCSI_FC_ATTRS=m
   6.293 +
   6.294 +#
   6.295 +# SCSI low-level drivers
   6.296 +#
   6.297 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
   6.298 +# CONFIG_SCSI_3W_9XXX is not set
   6.299 +# CONFIG_SCSI_ACARD is not set
   6.300 +# CONFIG_SCSI_AACRAID is not set
   6.301 +# CONFIG_SCSI_AIC7XXX is not set
   6.302 +# CONFIG_SCSI_AIC7XXX_OLD is not set
   6.303 +# CONFIG_SCSI_AIC79XX is not set
   6.304 +# CONFIG_MEGARAID_NEWGEN is not set
   6.305 +# CONFIG_MEGARAID_LEGACY is not set
   6.306 +CONFIG_SCSI_SATA=y
   6.307 +# CONFIG_SCSI_SATA_AHCI is not set
   6.308 +# CONFIG_SCSI_SATA_SVW is not set
   6.309 +CONFIG_SCSI_ATA_PIIX=y
   6.310 +# CONFIG_SCSI_SATA_NV is not set
   6.311 +# CONFIG_SCSI_SATA_PROMISE is not set
   6.312 +# CONFIG_SCSI_SATA_SX4 is not set
   6.313 +# CONFIG_SCSI_SATA_SIL is not set
   6.314 +# CONFIG_SCSI_SATA_SIS is not set
   6.315 +# CONFIG_SCSI_SATA_ULI is not set
   6.316 +# CONFIG_SCSI_SATA_VIA is not set
   6.317 +# CONFIG_SCSI_SATA_VITESSE is not set
   6.318 +# CONFIG_SCSI_BUSLOGIC is not set
   6.319 +# CONFIG_SCSI_DMX3191D is not set
   6.320 +# CONFIG_SCSI_EATA is not set
   6.321 +# CONFIG_SCSI_EATA_PIO is not set
   6.322 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
   6.323 +# CONFIG_SCSI_GDTH is not set
   6.324 +# CONFIG_SCSI_IPS is not set
   6.325 +# CONFIG_SCSI_INITIO is not set
   6.326 +# CONFIG_SCSI_INIA100 is not set
   6.327 +# CONFIG_SCSI_SYM53C8XX_2 is not set
   6.328 +# CONFIG_SCSI_IPR is not set
   6.329 +# CONFIG_SCSI_QLOGIC_ISP is not set
   6.330 +# CONFIG_SCSI_QLOGIC_FC is not set
   6.331 +# CONFIG_SCSI_QLOGIC_1280 is not set
   6.332 +CONFIG_SCSI_QLA2XXX=y
   6.333 +# CONFIG_SCSI_QLA21XX is not set
   6.334 +# CONFIG_SCSI_QLA22XX is not set
   6.335 +# CONFIG_SCSI_QLA2300 is not set
   6.336 +# CONFIG_SCSI_QLA2322 is not set
   6.337 +# CONFIG_SCSI_QLA6312 is not set
   6.338 +# CONFIG_SCSI_QLA6322 is not set
   6.339 +# CONFIG_SCSI_DC395x is not set
   6.340 +# CONFIG_SCSI_DC390T is not set
   6.341 +# CONFIG_SCSI_DEBUG is not set
   6.342 +
   6.343 +#
   6.344 +# Multi-device support (RAID and LVM)
   6.345 +#
   6.346 +CONFIG_MD=y
   6.347 +CONFIG_BLK_DEV_MD=y
   6.348 +CONFIG_MD_LINEAR=m
   6.349 +CONFIG_MD_RAID0=m
   6.350 +CONFIG_MD_RAID1=m
   6.351 +CONFIG_MD_RAID10=m
   6.352 +CONFIG_MD_RAID5=m
   6.353 +CONFIG_MD_RAID6=m
   6.354 +CONFIG_MD_MULTIPATH=m
   6.355 +# CONFIG_MD_FAULTY is not set
   6.356 +CONFIG_BLK_DEV_DM=m
   6.357 +CONFIG_DM_CRYPT=m
   6.358 +CONFIG_DM_SNAPSHOT=m
   6.359 +CONFIG_DM_MIRROR=m
   6.360 +CONFIG_DM_ZERO=m
   6.361 +
   6.362 +#
   6.363 +# Fusion MPT device support
   6.364 +#
   6.365 +# CONFIG_FUSION is not set
   6.366 +
   6.367 +#
   6.368 +# IEEE 1394 (FireWire) support
   6.369 +#
   6.370 +# CONFIG_IEEE1394 is not set
   6.371 +
   6.372 +#
   6.373 +# I2O device support
   6.374 +#
   6.375 +# CONFIG_I2O is not set
   6.376 +
   6.377 +#
   6.378 +# Networking support
   6.379 +#
   6.380 +CONFIG_NET=y
   6.381 +
   6.382 +#
   6.383 +# Networking options
   6.384 +#
   6.385 +CONFIG_PACKET=y
   6.386 +CONFIG_PACKET_MMAP=y
   6.387 +CONFIG_NETLINK_DEV=y
   6.388 +CONFIG_UNIX=y
   6.389 +CONFIG_NET_KEY=m
   6.390 +CONFIG_INET=y
   6.391 +CONFIG_IP_MULTICAST=y
   6.392 +CONFIG_IP_ADVANCED_ROUTER=y
   6.393 +CONFIG_IP_MULTIPLE_TABLES=y
   6.394 +CONFIG_IP_ROUTE_FWMARK=y
   6.395 +CONFIG_IP_ROUTE_MULTIPATH=y
   6.396 +CONFIG_IP_ROUTE_VERBOSE=y
   6.397 +# CONFIG_IP_PNP is not set
   6.398 +CONFIG_NET_IPIP=m
   6.399 +CONFIG_NET_IPGRE=m
   6.400 +CONFIG_NET_IPGRE_BROADCAST=y
   6.401 +CONFIG_IP_MROUTE=y
   6.402 +CONFIG_IP_PIMSM_V1=y
   6.403 +CONFIG_IP_PIMSM_V2=y
   6.404 +# CONFIG_ARPD is not set
   6.405 +CONFIG_SYN_COOKIES=y
   6.406 +CONFIG_INET_AH=m
   6.407 +CONFIG_INET_ESP=m
   6.408 +CONFIG_INET_IPCOMP=m
   6.409 +CONFIG_INET_TUNNEL=m
   6.410 +CONFIG_IP_TCPDIAG=y
   6.411 +# CONFIG_IP_TCPDIAG_IPV6 is not set
   6.412 +
   6.413 +#
   6.414 +# IP: Virtual Server Configuration
   6.415 +#
   6.416 +CONFIG_IP_VS=m
   6.417 +# CONFIG_IP_VS_DEBUG is not set
   6.418 +CONFIG_IP_VS_TAB_BITS=12
   6.419 +
   6.420 +#
   6.421 +# IPVS transport protocol load balancing support
   6.422 +#
   6.423 +CONFIG_IP_VS_PROTO_TCP=y
   6.424 +CONFIG_IP_VS_PROTO_UDP=y
   6.425 +CONFIG_IP_VS_PROTO_ESP=y
   6.426 +CONFIG_IP_VS_PROTO_AH=y
   6.427 +
   6.428 +#
   6.429 +# IPVS scheduler
   6.430 +#
   6.431 +CONFIG_IP_VS_RR=m
   6.432 +CONFIG_IP_VS_WRR=m
   6.433 +CONFIG_IP_VS_LC=m
   6.434 +CONFIG_IP_VS_WLC=m
   6.435 +CONFIG_IP_VS_LBLC=m
   6.436 +CONFIG_IP_VS_LBLCR=m
   6.437 +CONFIG_IP_VS_DH=m
   6.438 +CONFIG_IP_VS_SH=m
   6.439 +CONFIG_IP_VS_SED=m
   6.440 +CONFIG_IP_VS_NQ=m
   6.441 +
   6.442 +#
   6.443 +# IPVS application helper
   6.444 +#
   6.445 +CONFIG_IP_VS_FTP=m
   6.446 +CONFIG_IPV6=m
   6.447 +CONFIG_IPV6_PRIVACY=y
   6.448 +CONFIG_INET6_AH=m
   6.449 +CONFIG_INET6_ESP=m
   6.450 +CONFIG_INET6_IPCOMP=m
   6.451 +CONFIG_INET6_TUNNEL=m
   6.452 +CONFIG_IPV6_TUNNEL=m
   6.453 +CONFIG_NETFILTER=y
   6.454 +# CONFIG_NETFILTER_DEBUG is not set
   6.455 +CONFIG_BRIDGE_NETFILTER=y
   6.456 +
   6.457 +#
   6.458 +# IP: Netfilter Configuration
   6.459 +#
   6.460 +CONFIG_IP_NF_CONNTRACK=m
   6.461 +CONFIG_IP_NF_CT_ACCT=y
   6.462 +# CONFIG_IP_NF_CONNTRACK_MARK is not set
   6.463 +CONFIG_IP_NF_CT_PROTO_SCTP=m
   6.464 +CONFIG_IP_NF_FTP=m
   6.465 +CONFIG_IP_NF_IRC=m
   6.466 +CONFIG_IP_NF_TFTP=m
   6.467 +CONFIG_IP_NF_AMANDA=m
   6.468 +CONFIG_IP_NF_QUEUE=m
   6.469 +CONFIG_IP_NF_IPTABLES=m
   6.470 +CONFIG_IP_NF_MATCH_LIMIT=m
   6.471 +CONFIG_IP_NF_MATCH_IPRANGE=m
   6.472 +CONFIG_IP_NF_MATCH_MAC=m
   6.473 +CONFIG_IP_NF_MATCH_PKTTYPE=m
   6.474 +CONFIG_IP_NF_MATCH_MARK=m
   6.475 +CONFIG_IP_NF_MATCH_MULTIPORT=m
   6.476 +CONFIG_IP_NF_MATCH_TOS=m
   6.477 +CONFIG_IP_NF_MATCH_RECENT=m
   6.478 +CONFIG_IP_NF_MATCH_ECN=m
   6.479 +CONFIG_IP_NF_MATCH_DSCP=m
   6.480 +CONFIG_IP_NF_MATCH_AH_ESP=m
   6.481 +CONFIG_IP_NF_MATCH_LENGTH=m
   6.482 +CONFIG_IP_NF_MATCH_TTL=m
   6.483 +CONFIG_IP_NF_MATCH_TCPMSS=m
   6.484 +CONFIG_IP_NF_MATCH_HELPER=m
   6.485 +CONFIG_IP_NF_MATCH_STATE=m
   6.486 +CONFIG_IP_NF_MATCH_CONNTRACK=m
   6.487 +CONFIG_IP_NF_MATCH_OWNER=m
   6.488 +CONFIG_IP_NF_MATCH_PHYSDEV=m
   6.489 +CONFIG_IP_NF_MATCH_ADDRTYPE=m
   6.490 +CONFIG_IP_NF_MATCH_REALM=m
   6.491 +CONFIG_IP_NF_MATCH_SCTP=m
   6.492 +CONFIG_IP_NF_MATCH_COMMENT=m
   6.493 +# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
   6.494 +CONFIG_IP_NF_FILTER=m
   6.495 +CONFIG_IP_NF_TARGET_REJECT=m
   6.496 +CONFIG_IP_NF_TARGET_LOG=m
   6.497 +CONFIG_IP_NF_TARGET_ULOG=m
   6.498 +CONFIG_IP_NF_TARGET_TCPMSS=m
   6.499 +CONFIG_IP_NF_NAT=m
   6.500 +CONFIG_IP_NF_NAT_NEEDED=y
   6.501 +CONFIG_IP_NF_TARGET_MASQUERADE=m
   6.502 +CONFIG_IP_NF_TARGET_REDIRECT=m
   6.503 +CONFIG_IP_NF_TARGET_NETMAP=m
   6.504 +CONFIG_IP_NF_TARGET_SAME=m
   6.505 +CONFIG_IP_NF_NAT_LOCAL=y
   6.506 +CONFIG_IP_NF_NAT_SNMP_BASIC=m
   6.507 +CONFIG_IP_NF_NAT_IRC=m
   6.508 +CONFIG_IP_NF_NAT_FTP=m
   6.509 +CONFIG_IP_NF_NAT_TFTP=m
   6.510 +CONFIG_IP_NF_NAT_AMANDA=m
   6.511 +CONFIG_IP_NF_MANGLE=m
   6.512 +CONFIG_IP_NF_TARGET_TOS=m
   6.513 +CONFIG_IP_NF_TARGET_ECN=m
   6.514 +CONFIG_IP_NF_TARGET_DSCP=m
   6.515 +CONFIG_IP_NF_TARGET_MARK=m
   6.516 +CONFIG_IP_NF_TARGET_CLASSIFY=m
   6.517 +CONFIG_IP_NF_RAW=m
   6.518 +CONFIG_IP_NF_TARGET_NOTRACK=m
   6.519 +CONFIG_IP_NF_ARPTABLES=m
   6.520 +CONFIG_IP_NF_ARPFILTER=m
   6.521 +CONFIG_IP_NF_ARP_MANGLE=m
   6.522 +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
   6.523 +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
   6.524 +
   6.525 +#
   6.526 +# IPv6: Netfilter Configuration
   6.527 +#
   6.528 +# CONFIG_IP6_NF_QUEUE is not set
   6.529 +CONFIG_IP6_NF_IPTABLES=m
   6.530 +CONFIG_IP6_NF_MATCH_LIMIT=m
   6.531 +CONFIG_IP6_NF_MATCH_MAC=m
   6.532 +CONFIG_IP6_NF_MATCH_RT=m
   6.533 +CONFIG_IP6_NF_MATCH_OPTS=m
   6.534 +CONFIG_IP6_NF_MATCH_FRAG=m
   6.535 +CONFIG_IP6_NF_MATCH_HL=m
   6.536 +CONFIG_IP6_NF_MATCH_MULTIPORT=m
   6.537 +CONFIG_IP6_NF_MATCH_OWNER=m
   6.538 +CONFIG_IP6_NF_MATCH_MARK=m
   6.539 +CONFIG_IP6_NF_MATCH_IPV6HEADER=m
   6.540 +CONFIG_IP6_NF_MATCH_AHESP=m
   6.541 +CONFIG_IP6_NF_MATCH_LENGTH=m
   6.542 +CONFIG_IP6_NF_MATCH_EUI64=m
   6.543 +CONFIG_IP6_NF_MATCH_PHYSDEV=m
   6.544 +CONFIG_IP6_NF_FILTER=m
   6.545 +CONFIG_IP6_NF_TARGET_LOG=m
   6.546 +CONFIG_IP6_NF_MANGLE=m
   6.547 +CONFIG_IP6_NF_TARGET_MARK=m
   6.548 +CONFIG_IP6_NF_RAW=m
   6.549 +
   6.550 +#
   6.551 +# Bridge: Netfilter Configuration
   6.552 +#
   6.553 +CONFIG_BRIDGE_NF_EBTABLES=m
   6.554 +CONFIG_BRIDGE_EBT_BROUTE=m
   6.555 +CONFIG_BRIDGE_EBT_T_FILTER=m
   6.556 +CONFIG_BRIDGE_EBT_T_NAT=m
   6.557 +CONFIG_BRIDGE_EBT_802_3=m
   6.558 +CONFIG_BRIDGE_EBT_AMONG=m
   6.559 +CONFIG_BRIDGE_EBT_ARP=m
   6.560 +CONFIG_BRIDGE_EBT_IP=m
   6.561 +CONFIG_BRIDGE_EBT_LIMIT=m
   6.562 +CONFIG_BRIDGE_EBT_MARK=m
   6.563 +CONFIG_BRIDGE_EBT_PKTTYPE=m
   6.564 +CONFIG_BRIDGE_EBT_STP=m
   6.565 +CONFIG_BRIDGE_EBT_VLAN=m
   6.566 +CONFIG_BRIDGE_EBT_ARPREPLY=m
   6.567 +CONFIG_BRIDGE_EBT_DNAT=m
   6.568 +CONFIG_BRIDGE_EBT_MARK_T=m
   6.569 +CONFIG_BRIDGE_EBT_REDIRECT=m
   6.570 +CONFIG_BRIDGE_EBT_SNAT=m
   6.571 +CONFIG_BRIDGE_EBT_LOG=m
   6.572 +CONFIG_XFRM=y
   6.573 +CONFIG_XFRM_USER=y
   6.574 +
   6.575 +#
   6.576 +# SCTP Configuration (EXPERIMENTAL)
   6.577 +#
   6.578 +CONFIG_IP_SCTP=m
   6.579 +# CONFIG_SCTP_DBG_MSG is not set
   6.580 +# CONFIG_SCTP_DBG_OBJCNT is not set
   6.581 +# CONFIG_SCTP_HMAC_NONE is not set
   6.582 +# CONFIG_SCTP_HMAC_SHA1 is not set
   6.583 +CONFIG_SCTP_HMAC_MD5=y
   6.584 +CONFIG_ATM=m
   6.585 +CONFIG_ATM_CLIP=m
   6.586 +# CONFIG_ATM_CLIP_NO_ICMP is not set
   6.587 +CONFIG_ATM_LANE=m
   6.588 +# CONFIG_ATM_MPOA is not set
   6.589 +CONFIG_ATM_BR2684=m
   6.590 +# CONFIG_ATM_BR2684_IPFILTER is not set
   6.591 +CONFIG_BRIDGE=m
   6.592 +CONFIG_VLAN_8021Q=m
   6.593 +# CONFIG_DECNET is not set
   6.594 +CONFIG_LLC=m
   6.595 +# CONFIG_LLC2 is not set
   6.596 +CONFIG_IPX=m
   6.597 +# CONFIG_IPX_INTERN is not set
   6.598 +CONFIG_ATALK=m
   6.599 +CONFIG_DEV_APPLETALK=y
   6.600 +CONFIG_IPDDP=m
   6.601 +CONFIG_IPDDP_ENCAP=y
   6.602 +CONFIG_IPDDP_DECAP=y
   6.603 +# CONFIG_X25 is not set
   6.604 +# CONFIG_LAPB is not set
   6.605 +CONFIG_NET_DIVERT=y
   6.606 +# CONFIG_ECONET is not set
   6.607 +CONFIG_WAN_ROUTER=m
   6.608 +
   6.609 +#
   6.610 +# QoS and/or fair queueing
   6.611 +#
   6.612 +CONFIG_NET_SCHED=y
   6.613 +CONFIG_NET_SCH_CLK_JIFFIES=y
   6.614 +# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
   6.615 +# CONFIG_NET_SCH_CLK_CPU is not set
   6.616 +CONFIG_NET_SCH_CBQ=m
   6.617 +CONFIG_NET_SCH_HTB=m
   6.618 +CONFIG_NET_SCH_HFSC=m
   6.619 +CONFIG_NET_SCH_ATM=m
   6.620 +CONFIG_NET_SCH_PRIO=m
   6.621 +CONFIG_NET_SCH_RED=m
   6.622 +CONFIG_NET_SCH_SFQ=m
   6.623 +CONFIG_NET_SCH_TEQL=m
   6.624 +CONFIG_NET_SCH_TBF=m
   6.625 +CONFIG_NET_SCH_GRED=m
   6.626 +CONFIG_NET_SCH_DSMARK=m
   6.627 +CONFIG_NET_SCH_NETEM=m
   6.628 +CONFIG_NET_SCH_INGRESS=m
   6.629 +CONFIG_NET_QOS=y
   6.630 +CONFIG_NET_ESTIMATOR=y
   6.631 +CONFIG_NET_CLS=y
   6.632 +CONFIG_NET_CLS_TCINDEX=m
   6.633 +CONFIG_NET_CLS_ROUTE4=m
   6.634 +CONFIG_NET_CLS_ROUTE=y
   6.635 +CONFIG_NET_CLS_FW=m
   6.636 +CONFIG_NET_CLS_U32=m
   6.637 +CONFIG_CLS_U32_PERF=y
   6.638 +CONFIG_NET_CLS_IND=y
   6.639 +CONFIG_NET_CLS_RSVP=m
   6.640 +CONFIG_NET_CLS_RSVP6=m
   6.641 +# CONFIG_NET_CLS_ACT is not set
   6.642 +CONFIG_NET_CLS_POLICE=y
   6.643 +
   6.644 +#
   6.645 +# Network testing
   6.646 +#
   6.647 +# CONFIG_NET_PKTGEN is not set
   6.648 +CONFIG_NETPOLL=y
   6.649 +# CONFIG_NETPOLL_RX is not set
   6.650 +CONFIG_NETPOLL_TRAP=y
   6.651 +CONFIG_NET_POLL_CONTROLLER=y
   6.652 +# CONFIG_HAMRADIO is not set
   6.653 +CONFIG_IRDA=m
   6.654 +
   6.655 +#
   6.656 +# IrDA protocols
   6.657 +#
   6.658 +CONFIG_IRLAN=m
   6.659 +CONFIG_IRNET=m
   6.660 +CONFIG_IRCOMM=m
   6.661 +# CONFIG_IRDA_ULTRA is not set
   6.662 +
   6.663 +#
   6.664 +# IrDA options
   6.665 +#
   6.666 +CONFIG_IRDA_CACHE_LAST_LSAP=y
   6.667 +CONFIG_IRDA_FAST_RR=y
   6.668 +# CONFIG_IRDA_DEBUG is not set
   6.669 +
   6.670 +#
   6.671 +# Infrared-port device drivers
   6.672 +#
   6.673 +
   6.674 +#
   6.675 +# SIR device drivers
   6.676 +#
   6.677 +CONFIG_IRTTY_SIR=m
   6.678 +
   6.679 +#
   6.680 +# Dongle support
   6.681 +#
   6.682 +CONFIG_DONGLE=y
   6.683 +CONFIG_ESI_DONGLE=m
   6.684 +CONFIG_ACTISYS_DONGLE=m
   6.685 +CONFIG_TEKRAM_DONGLE=m
   6.686 +CONFIG_LITELINK_DONGLE=m
   6.687 +CONFIG_MA600_DONGLE=m
   6.688 +CONFIG_GIRBIL_DONGLE=m
   6.689 +CONFIG_MCP2120_DONGLE=m
   6.690 +CONFIG_OLD_BELKIN_DONGLE=m
   6.691 +CONFIG_ACT200L_DONGLE=m
   6.692 +
   6.693 +#
   6.694 +# Old SIR device drivers
   6.695 +#
   6.696 +# CONFIG_IRPORT_SIR is not set
   6.697 +
   6.698 +#
   6.699 +# Old Serial dongle support
   6.700 +#
   6.701 +
   6.702 +#
   6.703 +# FIR device drivers
   6.704 +#
   6.705 +# CONFIG_VLSI_FIR is not set
   6.706 +CONFIG_BT=m
   6.707 +CONFIG_BT_L2CAP=m
   6.708 +CONFIG_BT_SCO=m
   6.709 +CONFIG_BT_RFCOMM=m
   6.710 +CONFIG_BT_RFCOMM_TTY=y
   6.711 +CONFIG_BT_BNEP=m
   6.712 +CONFIG_BT_BNEP_MC_FILTER=y
   6.713 +CONFIG_BT_BNEP_PROTO_FILTER=y
   6.714 +CONFIG_BT_HIDP=m
   6.715 +
   6.716 +#
   6.717 +# Bluetooth device drivers
   6.718 +#
   6.719 +CONFIG_BT_HCIUART=m
   6.720 +CONFIG_BT_HCIUART_H4=y
   6.721 +CONFIG_BT_HCIUART_BCSP=y
   6.722 +CONFIG_BT_HCIUART_BCSP_TXCRC=y
   6.723 +CONFIG_BT_HCIVHCI=m
   6.724 +CONFIG_NETDEVICES=y
   6.725 +CONFIG_DUMMY=m
   6.726 +CONFIG_BONDING=m
   6.727 +CONFIG_EQUALIZER=m
   6.728 +CONFIG_TUN=m
   6.729 +CONFIG_ETHERTAP=m
   6.730 +
   6.731 +#
   6.732 +# ARCnet devices
   6.733 +#
   6.734 +# CONFIG_ARCNET is not set
   6.735 +
   6.736 +#
   6.737 +# Ethernet (10 or 100Mbit)
   6.738 +#
   6.739 +CONFIG_NET_ETHERNET=y
   6.740 +CONFIG_MII=y
   6.741 +# CONFIG_HAPPYMEAL is not set
   6.742 +# CONFIG_SUNGEM is not set
   6.743 +# CONFIG_NET_VENDOR_3COM is not set
   6.744 +
   6.745 +#
   6.746 +# Tulip family network device support
   6.747 +#
   6.748 +# CONFIG_NET_TULIP is not set
   6.749 +CONFIG_HP100=y
   6.750 +CONFIG_NET_PCI=y
   6.751 +# CONFIG_PCNET32 is not set
   6.752 +# CONFIG_AMD8111_ETH is not set
   6.753 +# CONFIG_ADAPTEC_STARFIRE is not set
   6.754 +# CONFIG_B44 is not set
   6.755 +# CONFIG_FORCEDETH is not set
   6.756 +# CONFIG_DGRS is not set
   6.757 +# CONFIG_EEPRO100 is not set
   6.758 +CONFIG_E100=y
   6.759 +# CONFIG_E100_NAPI is not set
   6.760 +# CONFIG_FEALNX is not set
   6.761 +# CONFIG_NATSEMI is not set
   6.762 +# CONFIG_NE2K_PCI is not set
   6.763 +# CONFIG_8139CP is not set
   6.764 +# CONFIG_8139TOO is not set
   6.765 +# CONFIG_SIS900 is not set
   6.766 +# CONFIG_EPIC100 is not set
   6.767 +# CONFIG_SUNDANCE is not set
   6.768 +# CONFIG_VIA_RHINE is not set
   6.769 +
   6.770 +#
   6.771 +# Ethernet (1000 Mbit)
   6.772 +#
   6.773 +# CONFIG_ACENIC is not set
   6.774 +# CONFIG_DL2K is not set
   6.775 +CONFIG_E1000=y
   6.776 +# CONFIG_E1000_NAPI is not set
   6.777 +# CONFIG_NS83820 is not set
   6.778 +# CONFIG_HAMACHI is not set
   6.779 +# CONFIG_YELLOWFIN is not set
   6.780 +# CONFIG_R8169 is not set
   6.781 +# CONFIG_SK98LIN is not set
   6.782 +# CONFIG_VIA_VELOCITY is not set
   6.783 +# CONFIG_TIGON3 is not set
   6.784 +
   6.785 +#
   6.786 +# Ethernet (10000 Mbit)
   6.787 +#
   6.788 +# CONFIG_IXGB is not set
   6.789 +# CONFIG_S2IO is not set
   6.790 +
   6.791 +#
   6.792 +# Token Ring devices
   6.793 +#
   6.794 +# CONFIG_TR is not set
   6.795 +
   6.796 +#
   6.797 +# Wireless LAN (non-hamradio)
   6.798 +#
   6.799 +CONFIG_NET_RADIO=y
   6.800 +
   6.801 +#
   6.802 +# Obsolete Wireless cards support (pre-802.11)
   6.803 +#
   6.804 +# CONFIG_STRIP is not set
   6.805 +
   6.806 +#
   6.807 +# Wireless 802.11b ISA/PCI cards support
   6.808 +#
   6.809 +# CONFIG_HERMES is not set
   6.810 +CONFIG_ATMEL=m
   6.811 +# CONFIG_PCI_ATMEL is not set
   6.812 +
   6.813 +#
   6.814 +# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
   6.815 +#
   6.816 +CONFIG_NET_WIRELESS=y
   6.817 +
   6.818 +#
   6.819 +# Wan interfaces
   6.820 +#
   6.821 +# CONFIG_WAN is not set
   6.822 +
   6.823 +#
   6.824 +# ATM drivers
   6.825 +#
   6.826 +CONFIG_ATM_TCP=m
   6.827 +# CONFIG_ATM_LANAI is not set
   6.828 +# CONFIG_ATM_ENI is not set
   6.829 +# CONFIG_ATM_FIRESTREAM is not set
   6.830 +# CONFIG_ATM_ZATM is not set
   6.831 +# CONFIG_ATM_IDT77252 is not set
   6.832 +# CONFIG_ATM_AMBASSADOR is not set
   6.833 +# CONFIG_ATM_HORIZON is not set
   6.834 +# CONFIG_ATM_FORE200E_MAYBE is not set
   6.835 +# CONFIG_ATM_HE is not set
   6.836 +# CONFIG_FDDI is not set
   6.837 +# CONFIG_HIPPI is not set
   6.838 +CONFIG_PPP=m
   6.839 +CONFIG_PPP_MULTILINK=y
   6.840 +CONFIG_PPP_FILTER=y
   6.841 +CONFIG_PPP_ASYNC=m
   6.842 +CONFIG_PPP_SYNC_TTY=m
   6.843 +CONFIG_PPP_DEFLATE=m
   6.844 +# CONFIG_PPP_BSDCOMP is not set
   6.845 +CONFIG_PPPOE=m
   6.846 +CONFIG_PPPOATM=m
   6.847 +CONFIG_SLIP=m
   6.848 +CONFIG_SLIP_COMPRESSED=y
   6.849 +CONFIG_SLIP_SMART=y
   6.850 +# CONFIG_SLIP_MODE_SLIP6 is not set
   6.851 +# CONFIG_NET_FC is not set
   6.852 +# CONFIG_SHAPER is not set
   6.853 +CONFIG_NETCONSOLE=m
   6.854 +
   6.855 +#
   6.856 +# ISDN subsystem
   6.857 +#
   6.858 +# CONFIG_ISDN is not set
   6.859 +
   6.860 +#
   6.861 +# Telephony Support
   6.862 +#
   6.863 +# CONFIG_PHONE is not set
   6.864 +
   6.865 +#
   6.866 +# Input device support
   6.867 +#
   6.868 +CONFIG_INPUT=y
   6.869 +
   6.870 +#
   6.871 +# Userland interfaces
   6.872 +#
   6.873 +CONFIG_INPUT_MOUSEDEV=y
   6.874 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
   6.875 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
   6.876 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
   6.877 +# CONFIG_INPUT_JOYDEV is not set
   6.878 +# CONFIG_INPUT_TSDEV is not set
   6.879 +# CONFIG_INPUT_EVDEV is not set
   6.880 +# CONFIG_INPUT_EVBUG is not set
   6.881 +
   6.882 +#
   6.883 +# Input I/O drivers
   6.884 +#
   6.885 +# CONFIG_GAMEPORT is not set
   6.886 +CONFIG_SOUND_GAMEPORT=y
   6.887 +CONFIG_SERIO=y
   6.888 +CONFIG_SERIO_I8042=y
   6.889 +CONFIG_SERIO_SERPORT=y
   6.890 +# CONFIG_SERIO_CT82C710 is not set
   6.891 +# CONFIG_SERIO_PCIPS2 is not set
   6.892 +# CONFIG_SERIO_RAW is not set
   6.893 +
   6.894 +#
   6.895 +# Input Device Drivers
   6.896 +#
   6.897 +CONFIG_INPUT_KEYBOARD=y
   6.898 +CONFIG_KEYBOARD_ATKBD=y
   6.899 +# CONFIG_KEYBOARD_SUNKBD is not set
   6.900 +# CONFIG_KEYBOARD_LKKBD is not set
   6.901 +# CONFIG_KEYBOARD_XTKBD is not set
   6.902 +# CONFIG_KEYBOARD_NEWTON is not set
   6.903 +CONFIG_INPUT_MOUSE=y
   6.904 +CONFIG_MOUSE_PS2=y
   6.905 +# CONFIG_MOUSE_SERIAL is not set
   6.906 +# CONFIG_MOUSE_VSXXXAA is not set
   6.907 +# CONFIG_INPUT_JOYSTICK is not set
   6.908 +# CONFIG_INPUT_TOUCHSCREEN is not set
   6.909 +# CONFIG_INPUT_MISC is not set
   6.910 +
   6.911 +#
   6.912 +# Character devices
   6.913 +#
   6.914 +CONFIG_VT=y
   6.915 +CONFIG_VT_CONSOLE=y
   6.916 +CONFIG_HW_CONSOLE=y
   6.917 +# CONFIG_SERIAL_NONSTANDARD is not set
   6.918 +
   6.919 +#
   6.920 +# Serial drivers
   6.921 +#
   6.922 +# CONFIG_SERIAL_8250 is not set
   6.923 +
   6.924 +#
   6.925 +# Non-8250 serial port support
   6.926 +#
   6.927 +CONFIG_UNIX98_PTYS=y
   6.928 +CONFIG_LEGACY_PTYS=y
   6.929 +CONFIG_LEGACY_PTY_COUNT=256
   6.930 +
   6.931 +#
   6.932 +# IPMI
   6.933 +#
   6.934 +# CONFIG_IPMI_HANDLER is not set
   6.935 +
   6.936 +#
   6.937 +# Watchdog Cards
   6.938 +#
   6.939 +# CONFIG_WATCHDOG is not set
   6.940 +# CONFIG_HW_RANDOM is not set
   6.941 +# CONFIG_NVRAM is not set
   6.942 +# CONFIG_RTC is not set
   6.943 +# CONFIG_GEN_RTC is not set
   6.944 +# CONFIG_DTLK is not set
   6.945 +# CONFIG_R3964 is not set
   6.946 +# CONFIG_APPLICOM is not set
   6.947 +
   6.948 +#
   6.949 +# Ftape, the floppy tape device driver
   6.950 +#
   6.951 +# CONFIG_FTAPE is not set
   6.952 +# CONFIG_AGP is not set
   6.953 +# CONFIG_DRM is not set
   6.954 +# CONFIG_MWAVE is not set
   6.955 +# CONFIG_RAW_DRIVER is not set
   6.956 +# CONFIG_HANGCHECK_TIMER is not set
   6.957 +
   6.958 +#
   6.959 +# I2C support
   6.960 +#
   6.961 +# CONFIG_I2C is not set
   6.962 +
   6.963 +#
   6.964 +# Dallas's 1-wire bus
   6.965 +#
   6.966 +# CONFIG_W1 is not set
   6.967 +
   6.968 +#
   6.969 +# Misc devices
   6.970 +#
   6.971 +# CONFIG_IBM_ASM is not set
   6.972 +
   6.973 +#
   6.974 +# Multimedia devices
   6.975 +#
   6.976 +# CONFIG_VIDEO_DEV is not set
   6.977 +
   6.978 +#
   6.979 +# Digital Video Broadcasting Devices
   6.980 +#
   6.981 +# CONFIG_DVB is not set
   6.982 +
   6.983 +#
   6.984 +# Graphics support
   6.985 +#
   6.986 +# CONFIG_FB is not set
   6.987 +# CONFIG_VIDEO_SELECT is not set
   6.988 +
   6.989 +#
   6.990 +# Console display driver support
   6.991 +#
   6.992 +CONFIG_VGA_CONSOLE=y
   6.993 +CONFIG_DUMMY_CONSOLE=y
   6.994 +
   6.995 +#
   6.996 +# Sound
   6.997 +#
   6.998 +# CONFIG_SOUND is not set
   6.999 +
  6.1000 +#
  6.1001 +# USB support
  6.1002 +#
  6.1003 +# CONFIG_USB is not set
  6.1004 +CONFIG_USB_ARCH_HAS_HCD=y
  6.1005 +CONFIG_USB_ARCH_HAS_OHCI=y
  6.1006 +
  6.1007 +#
  6.1008 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
  6.1009 +#
  6.1010 +
  6.1011 +#
  6.1012 +# USB Gadget Support
  6.1013 +#
  6.1014 +# CONFIG_USB_GADGET is not set
  6.1015 +
  6.1016 +#
  6.1017 +# File systems
  6.1018 +#
  6.1019 +# CONFIG_EXT2_FS is not set
  6.1020 +CONFIG_EXT3_FS=y
  6.1021 +CONFIG_EXT3_FS_XATTR=y
  6.1022 +CONFIG_EXT3_FS_POSIX_ACL=y
  6.1023 +CONFIG_EXT3_FS_SECURITY=y
  6.1024 +CONFIG_JBD=y
  6.1025 +# CONFIG_JBD_DEBUG is not set
  6.1026 +CONFIG_FS_MBCACHE=y
  6.1027 +# CONFIG_REISERFS_FS is not set
  6.1028 +# CONFIG_JFS_FS is not set
  6.1029 +CONFIG_FS_POSIX_ACL=y
  6.1030 +# CONFIG_XFS_FS is not set
  6.1031 +# CONFIG_MINIX_FS is not set
  6.1032 +# CONFIG_ROMFS_FS is not set
  6.1033 +# CONFIG_QUOTA is not set
  6.1034 +CONFIG_DNOTIFY=y
  6.1035 +# CONFIG_AUTOFS_FS is not set
  6.1036 +# CONFIG_AUTOFS4_FS is not set
  6.1037 +
  6.1038 +#
  6.1039 +# CD-ROM/DVD Filesystems
  6.1040 +#
  6.1041 +CONFIG_ISO9660_FS=y
  6.1042 +CONFIG_JOLIET=y
  6.1043 +CONFIG_ZISOFS=y
  6.1044 +CONFIG_ZISOFS_FS=y
  6.1045 +CONFIG_UDF_FS=m
  6.1046 +CONFIG_UDF_NLS=y
  6.1047 +
  6.1048 +#
  6.1049 +# DOS/FAT/NT Filesystems
  6.1050 +#
  6.1051 +CONFIG_FAT_FS=m
  6.1052 +CONFIG_MSDOS_FS=m
  6.1053 +CONFIG_VFAT_FS=m
  6.1054 +CONFIG_FAT_DEFAULT_CODEPAGE=437
  6.1055 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
  6.1056 +# CONFIG_NTFS_FS is not set
  6.1057 +
  6.1058 +#
  6.1059 +# Pseudo filesystems
  6.1060 +#
  6.1061 +CONFIG_PROC_FS=y
  6.1062 +# CONFIG_PROC_KCORE is not set
  6.1063 +CONFIG_SYSFS=y
  6.1064 +# CONFIG_DEVFS_FS is not set
  6.1065 +CONFIG_DEVPTS_FS_XATTR=y
  6.1066 +CONFIG_DEVPTS_FS_SECURITY=y
  6.1067 +CONFIG_TMPFS=y
  6.1068 +CONFIG_TMPFS_XATTR=y
  6.1069 +CONFIG_TMPFS_SECURITY=y
  6.1070 +# CONFIG_HUGETLBFS is not set
  6.1071 +# CONFIG_HUGETLB_PAGE is not set
  6.1072 +CONFIG_RAMFS=y
  6.1073 +
  6.1074 +#
  6.1075 +# Miscellaneous filesystems
  6.1076 +#
  6.1077 +# CONFIG_ADFS_FS is not set
  6.1078 +CONFIG_AFFS_FS=m
  6.1079 +CONFIG_HFS_FS=m
  6.1080 +CONFIG_HFSPLUS_FS=m
  6.1081 +CONFIG_BEFS_FS=m
  6.1082 +# CONFIG_BEFS_DEBUG is not set
  6.1083 +CONFIG_BFS_FS=m
  6.1084 +CONFIG_EFS_FS=m
  6.1085 +CONFIG_CRAMFS=m
  6.1086 +CONFIG_VXFS_FS=m
  6.1087 +# CONFIG_HPFS_FS is not set
  6.1088 +CONFIG_QNX4FS_FS=m
  6.1089 +# CONFIG_QNX4FS_RW is not set
  6.1090 +CONFIG_SYSV_FS=m
  6.1091 +CONFIG_UFS_FS=m
  6.1092 +# CONFIG_UFS_FS_WRITE is not set
  6.1093 +
  6.1094 +#
  6.1095 +# Network File Systems
  6.1096 +#
  6.1097 +CONFIG_NFS_FS=m
  6.1098 +CONFIG_NFS_V3=y
  6.1099 +CONFIG_NFS_V4=y
  6.1100 +CONFIG_NFS_DIRECTIO=y
  6.1101 +CONFIG_NFSD=m
  6.1102 +CONFIG_NFSD_V3=y
  6.1103 +CONFIG_NFSD_V4=y
  6.1104 +CONFIG_NFSD_TCP=y
  6.1105 +CONFIG_LOCKD=m
  6.1106 +CONFIG_LOCKD_V4=y
  6.1107 +CONFIG_EXPORTFS=m
  6.1108 +CONFIG_SUNRPC=m
  6.1109 +CONFIG_SUNRPC_GSS=m
  6.1110 +CONFIG_RPCSEC_GSS_KRB5=m
  6.1111 +CONFIG_RPCSEC_GSS_SPKM3=m
  6.1112 +CONFIG_SMB_FS=m
  6.1113 +# CONFIG_SMB_NLS_DEFAULT is not set
  6.1114 +CONFIG_CIFS=m
  6.1115 +# CONFIG_CIFS_STATS is not set
  6.1116 +CONFIG_CIFS_XATTR=y
  6.1117 +CONFIG_CIFS_POSIX=y
  6.1118 +# CONFIG_CIFS_EXPERIMENTAL is not set
  6.1119 +CONFIG_NCP_FS=m
  6.1120 +CONFIG_NCPFS_PACKET_SIGNING=y
  6.1121 +CONFIG_NCPFS_IOCTL_LOCKING=y
  6.1122 +CONFIG_NCPFS_STRONG=y
  6.1123 +CONFIG_NCPFS_NFS_NS=y
  6.1124 +CONFIG_NCPFS_OS2_NS=y
  6.1125 +CONFIG_NCPFS_SMALLDOS=y
  6.1126 +CONFIG_NCPFS_NLS=y
  6.1127 +CONFIG_NCPFS_EXTRAS=y
  6.1128 +# CONFIG_CODA_FS is not set
  6.1129 +# CONFIG_AFS_FS is not set
  6.1130 +
  6.1131 +#
  6.1132 +# Partition Types
  6.1133 +#
  6.1134 +CONFIG_PARTITION_ADVANCED=y
  6.1135 +# CONFIG_ACORN_PARTITION is not set
  6.1136 +CONFIG_OSF_PARTITION=y
  6.1137 +# CONFIG_AMIGA_PARTITION is not set
  6.1138 +# CONFIG_ATARI_PARTITION is not set
  6.1139 +CONFIG_MAC_PARTITION=y
  6.1140 +CONFIG_MSDOS_PARTITION=y
  6.1141 +CONFIG_BSD_DISKLABEL=y
  6.1142 +CONFIG_MINIX_SUBPARTITION=y
  6.1143 +CONFIG_SOLARIS_X86_PARTITION=y
  6.1144 +CONFIG_UNIXWARE_DISKLABEL=y
  6.1145 +# CONFIG_LDM_PARTITION is not set
  6.1146 +CONFIG_SGI_PARTITION=y
  6.1147 +# CONFIG_ULTRIX_PARTITION is not set
  6.1148 +CONFIG_SUN_PARTITION=y
  6.1149 +CONFIG_EFI_PARTITION=y
  6.1150 +
  6.1151 +#
  6.1152 +# Native Language Support
  6.1153 +#
  6.1154 +CONFIG_NLS=y
  6.1155 +CONFIG_NLS_DEFAULT="utf8"
  6.1156 +CONFIG_NLS_CODEPAGE_437=y
  6.1157 +CONFIG_NLS_CODEPAGE_737=m
  6.1158 +CONFIG_NLS_CODEPAGE_775=m
  6.1159 +CONFIG_NLS_CODEPAGE_850=m
  6.1160 +CONFIG_NLS_CODEPAGE_852=m
  6.1161 +CONFIG_NLS_CODEPAGE_855=m
  6.1162 +CONFIG_NLS_CODEPAGE_857=m
  6.1163 +CONFIG_NLS_CODEPAGE_860=m
  6.1164 +CONFIG_NLS_CODEPAGE_861=m
  6.1165 +CONFIG_NLS_CODEPAGE_862=m
  6.1166 +CONFIG_NLS_CODEPAGE_863=m
  6.1167 +CONFIG_NLS_CODEPAGE_864=m
  6.1168 +CONFIG_NLS_CODEPAGE_865=m
  6.1169 +CONFIG_NLS_CODEPAGE_866=m
  6.1170 +CONFIG_NLS_CODEPAGE_869=m
  6.1171 +CONFIG_NLS_CODEPAGE_936=m
  6.1172 +CONFIG_NLS_CODEPAGE_950=m
  6.1173 +CONFIG_NLS_CODEPAGE_932=m
  6.1174 +CONFIG_NLS_CODEPAGE_949=m
  6.1175 +CONFIG_NLS_CODEPAGE_874=m
  6.1176 +CONFIG_NLS_ISO8859_8=m
  6.1177 +CONFIG_NLS_CODEPAGE_1250=m
  6.1178 +CONFIG_NLS_CODEPAGE_1251=m
  6.1179 +CONFIG_NLS_ASCII=y
  6.1180 +CONFIG_NLS_ISO8859_1=m
  6.1181 +CONFIG_NLS_ISO8859_2=m
  6.1182 +CONFIG_NLS_ISO8859_3=m
  6.1183 +CONFIG_NLS_ISO8859_4=m
  6.1184 +CONFIG_NLS_ISO8859_5=m
  6.1185 +CONFIG_NLS_ISO8859_6=m
  6.1186 +CONFIG_NLS_ISO8859_7=m
  6.1187 +CONFIG_NLS_ISO8859_9=m
  6.1188 +CONFIG_NLS_ISO8859_13=m
  6.1189 +CONFIG_NLS_ISO8859_14=m
  6.1190 +CONFIG_NLS_ISO8859_15=m
  6.1191 +CONFIG_NLS_KOI8_R=m
  6.1192 +CONFIG_NLS_KOI8_U=m
  6.1193 +CONFIG_NLS_UTF8=m
  6.1194 +
  6.1195 +#
  6.1196 +# Security options
  6.1197 +#
  6.1198 +# CONFIG_KEYS is not set
  6.1199 +CONFIG_SECURITY=y
  6.1200 +CONFIG_SECURITY_NETWORK=y
  6.1201 +CONFIG_SECURITY_CAPABILITIES=y
  6.1202 +# CONFIG_SECURITY_SECLVL is not set
  6.1203 +CONFIG_SECURITY_SELINUX=y
  6.1204 +CONFIG_SECURITY_SELINUX_BOOTPARAM=y
  6.1205 +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
  6.1206 +CONFIG_SECURITY_SELINUX_DISABLE=y
  6.1207 +CONFIG_SECURITY_SELINUX_DEVELOP=y
  6.1208 +# CONFIG_SECURITY_SELINUX_MLS is not set
  6.1209 +
  6.1210 +#
  6.1211 +# Cryptographic options
  6.1212 +#
  6.1213 +CONFIG_CRYPTO=y
  6.1214 +CONFIG_CRYPTO_HMAC=y
  6.1215 +CONFIG_CRYPTO_NULL=m
  6.1216 +CONFIG_CRYPTO_MD4=m
  6.1217 +CONFIG_CRYPTO_MD5=m
  6.1218 +CONFIG_CRYPTO_SHA1=y
  6.1219 +CONFIG_CRYPTO_SHA256=m
  6.1220 +CONFIG_CRYPTO_SHA512=m
  6.1221 +CONFIG_CRYPTO_WP512=m
  6.1222 +CONFIG_CRYPTO_DES=m
  6.1223 +CONFIG_CRYPTO_BLOWFISH=m
  6.1224 +CONFIG_CRYPTO_TWOFISH=m
  6.1225 +CONFIG_CRYPTO_SERPENT=m
  6.1226 +# CONFIG_CRYPTO_AES is not set
  6.1227 +CONFIG_CRYPTO_CAST5=m
  6.1228 +CONFIG_CRYPTO_CAST6=m
  6.1229 +CONFIG_CRYPTO_TEA=m
  6.1230 +CONFIG_CRYPTO_ARC4=m
  6.1231 +CONFIG_CRYPTO_KHAZAD=m
  6.1232 +# CONFIG_CRYPTO_ANUBIS is not set
  6.1233 +CONFIG_CRYPTO_DEFLATE=m
  6.1234 +CONFIG_CRYPTO_MICHAEL_MIC=m
  6.1235 +CONFIG_CRYPTO_CRC32C=m
  6.1236 +# CONFIG_CRYPTO_TEST is not set
  6.1237 +
  6.1238 +#
  6.1239 +# Library routines
  6.1240 +#
  6.1241 +CONFIG_CRC_CCITT=m
  6.1242 +CONFIG_CRC32=y
  6.1243 +CONFIG_LIBCRC32C=m
  6.1244 +CONFIG_ZLIB_INFLATE=y
  6.1245 +CONFIG_ZLIB_DEFLATE=m
  6.1246 +
  6.1247 +#
  6.1248 +# Firmware Drivers
  6.1249 +#
  6.1250 +# CONFIG_EDD is not set
  6.1251 +# CONFIG_PCI_LEGACY_PROC is not set
  6.1252 +# CONFIG_PCI_NAMES is not set
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/Makefile	Sat Apr 02 20:27:11 2005 +0000
     7.3 @@ -0,0 +1,61 @@
     7.4 +#
     7.5 +# Makefile for the linux kernel.
     7.6 +#
     7.7 +XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
     7.8 +
     7.9 +CFLAGS	+= -Iarch/$(XENARCH)/kernel
    7.10 +
    7.11 +extra-y 	:= head.o head64.o init_task.o
    7.12 +
    7.13 +obj-y	:= process.o signal.o entry.o traps.o  \
    7.14 +		time.o ioport.o ldt.o setup.o \
    7.15 +		x8664_ksyms.o vsyscall.o \
    7.16 +		setup64.o e820.o irq.o early_printk.o
    7.17 +c-obj-y	:= semaphore.o i387.o sys_x86_64.o \
    7.18 +		ptrace.o quirks.o syscall.o
    7.19 +obj-y				+= ../../i386/kernel/timers/
    7.20 +
    7.21 +s-obj-y	:=
    7.22 +
    7.23 +#obj-$(CONFIG_X86_MCE)         += mce.o
    7.24 +#obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
    7.25 +#obj-$(CONFIG_ACPI_BOOT)		+= acpi/
    7.26 +obj-$(CONFIG_X86_MSR)		+= msr.o
    7.27 +obj-$(CONFIG_MICROCODE)		+= microcode.o
    7.28 +obj-$(CONFIG_X86_CPUID)		+= cpuid.o
    7.29 +#obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
    7.30 +#obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o  nmi.o
    7.31 +#obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o mpparse.o \
    7.32 +#		genapic.o genapic_cluster.o genapic_flat.o
    7.33 +#obj-$(CONFIG_PM)		+= suspend.o
    7.34 +#obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
    7.35 +#obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
    7.36 +#obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
    7.37 +#obj-$(CONFIG_GART_IOMMU)	+= pci-gart.o aperture.o
    7.38 +c-obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
    7.39 +#obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
    7.40 +obj-$(CONFIG_KPROBES)		+= kprobes.o
    7.41 +
    7.42 +c-obj-$(CONFIG_MODULES)		+= module.o
    7.43 +
    7.44 +#obj-y				+= topology.o
    7.45 +c-obj-y				+= intel_cacheinfo.o
    7.46 +
    7.47 +bootflag-y			+= ../../../i386/kernel/bootflag.o
    7.48 +cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../../i386/kernel/cpuid.o
    7.49 +topology-y                     += ../../../i386/mach-default/topology.o
    7.50 +swiotlb-$(CONFIG_SWIOTLB)      += ../../../ia64/lib/swiotlb.o
    7.51 +microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../../i386/kernel/microcode.o
    7.52 +intel_cacheinfo-y		+= ../../../i386/kernel/cpu/intel_cacheinfo.o
    7.53 +quirks-y			+= ../../../i386/kernel/quirks.o
    7.54 +
    7.55 +c-link	:= init_task.o
    7.56 +s-link	:= vsyscall.o 
    7.57 +
    7.58 +$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)) $(patsubst %.o,$(obj)/%.S,$(s-obj-y) $(s-link)):
    7.59 +	ln -fsn $(srctree)/arch/x86_64/kernel/$(notdir $@) $@
    7.60 +
    7.61 +obj-y	+= $(c-obj-y) $(s-obj-y)
    7.62 +
    7.63 +clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
    7.64 +clean-files += $(patsubst %.o,%.S,$(s-obj-y) $(s-obj-) $(s-link))
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/asm-offsets.c	Sat Apr 02 20:27:11 2005 +0000
     8.3 @@ -0,0 +1,70 @@
     8.4 +/*
     8.5 + * Generate definitions needed by assembly language modules.
     8.6 + * This code generates raw asm output which is post-processed to extract
     8.7 + * and format the required data.
     8.8 + */
     8.9 +
    8.10 +#include <linux/sched.h> 
    8.11 +#include <linux/stddef.h>
    8.12 +#include <linux/errno.h> 
    8.13 +#include <linux/hardirq.h>
    8.14 +#include <linux/suspend.h>
    8.15 +#include <asm/pda.h>
    8.16 +#include <asm/processor.h>
    8.17 +#include <asm/segment.h>
    8.18 +#include <asm/thread_info.h>
    8.19 +#include <asm/ia32.h>
    8.20 +
    8.21 +#define DEFINE(sym, val) \
    8.22 +        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
    8.23 +
    8.24 +#define BLANK() asm volatile("\n->" : : )
    8.25 +
    8.26 +int main(void)
    8.27 +{
    8.28 +#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
    8.29 +	ENTRY(state);
    8.30 +	ENTRY(flags); 
    8.31 +	ENTRY(thread); 
    8.32 +	ENTRY(pid);
    8.33 +	BLANK();
    8.34 +#undef ENTRY
    8.35 +#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry))
    8.36 +	ENTRY(flags);
    8.37 +	ENTRY(addr_limit);
    8.38 +	ENTRY(preempt_count);
    8.39 +	BLANK();
    8.40 +#undef ENTRY
    8.41 +#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
    8.42 +	ENTRY(kernelstack); 
    8.43 +	ENTRY(oldrsp); 
    8.44 +	ENTRY(pcurrent); 
    8.45 +	ENTRY(irqrsp);
    8.46 +	ENTRY(irqcount);
    8.47 +	ENTRY(cpunumber);
    8.48 +	ENTRY(irqstackptr);
    8.49 +	ENTRY(kernel_mode);
    8.50 +	BLANK();
    8.51 +#undef ENTRY
    8.52 +#ifdef CONFIG_IA32_EMULATION
    8.53 +#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
    8.54 +	ENTRY(eax);
    8.55 +	ENTRY(ebx);
    8.56 +	ENTRY(ecx);
    8.57 +	ENTRY(edx);
    8.58 +	ENTRY(esi);
    8.59 +	ENTRY(edi);
    8.60 +	ENTRY(ebp);
    8.61 +	ENTRY(esp);
    8.62 +	ENTRY(eip);
    8.63 +	BLANK();
    8.64 +#undef ENTRY
    8.65 +	DEFINE(IA32_RT_SIGFRAME_sigcontext,
    8.66 +	       offsetof (struct rt_sigframe32, uc.uc_mcontext));
    8.67 +	BLANK();
    8.68 +#endif
    8.69 +	DEFINE(SIZEOF_PBE, sizeof(struct pbe));
    8.70 +	DEFINE(pbe_address, offsetof(struct pbe, address));
    8.71 +	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
    8.72 +	return 0;
    8.73 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/e820.c	Sat Apr 02 20:27:11 2005 +0000
     9.3 @@ -0,0 +1,533 @@
     9.4 +/* 
     9.5 + * Handle the memory map.
     9.6 + * The functions here do the job until bootmem takes over.
     9.7 + * $Id: e820.c,v 1.4 2002/09/19 19:25:32 ak Exp $
     9.8 + */
     9.9 +#include <linux/config.h>
    9.10 +#include <linux/kernel.h>
    9.11 +#include <linux/types.h>
    9.12 +#include <linux/init.h>
    9.13 +#include <linux/bootmem.h>
    9.14 +#include <linux/ioport.h>
    9.15 +#include <linux/string.h>
    9.16 +#include <asm/page.h>
    9.17 +#include <asm/e820.h>
    9.18 +#include <asm/proto.h>
    9.19 +#include <asm/bootsetup.h>
    9.20 +
    9.21 +/* 
    9.22 + * PFN of last memory page.
    9.23 + */
    9.24 +unsigned long end_pfn; 
    9.25 +unsigned long end_user_pfn = MAXMEM>>PAGE_SHIFT;  
    9.26 +unsigned long end_pfn_map; 
    9.27 +
    9.28 +/* 
    9.29 + * Add a memory region to the kernel e820 map.
    9.30 + */ 
    9.31 +void __init add_memory_region(unsigned long start, unsigned long size, int type)
    9.32 +{
    9.33 +	int x = e820.nr_map;
    9.34 +
    9.35 +	if (x == E820MAX) {
    9.36 +		printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
    9.37 +		return;
    9.38 +	}
    9.39 +
    9.40 +	e820.map[x].addr = start;
    9.41 +	e820.map[x].size = size;
    9.42 +	e820.map[x].type = type;
    9.43 +	e820.nr_map++;
    9.44 +}
    9.45 +
    9.46 +#if 0
    9.47 +extern char _end[];
    9.48 +
    9.49 +/* 
    9.50 + * end_pfn only includes RAM, while end_pfn_map includes all e820 entries.
    9.51 + * The direct mapping extends to end_pfn_map, so that we can directly access
    9.52 + * apertures, ACPI and other tables without having to play with fixmaps.
    9.53 + */ 
    9.54 +
    9.55 +/* 
    9.56 + * Last pfn which the user wants to use.
    9.57 + */
    9.58 +
    9.59 +extern struct resource code_resource, data_resource;
    9.60 +
    9.61 +/* Check for some hardcoded bad areas that early boot is not allowed to touch */ 
    9.62 +static inline int bad_addr(unsigned long *addrp, unsigned long size)
    9.63 +{ 
    9.64 +	unsigned long addr = *addrp, last = addr + size; 
    9.65 +
    9.66 +	/* various gunk below that needed for SMP startup */
    9.67 +	if (addr < 0x8000) { 
    9.68 +		*addrp = 0x8000;
    9.69 +		return 1; 
    9.70 +	}
    9.71 +
    9.72 +	/* direct mapping tables of the kernel */
    9.73 +	if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) { 
    9.74 +		*addrp = table_end << PAGE_SHIFT; 
    9.75 +		return 1;
    9.76 +	} 
    9.77 +
    9.78 +	/* initrd */ 
    9.79 +#ifdef CONFIG_BLK_DEV_INITRD
    9.80 +	if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 
    9.81 +	    addr < INITRD_START+INITRD_SIZE) { 
    9.82 +		*addrp = INITRD_START + INITRD_SIZE; 
    9.83 +		return 1;
    9.84 +	} 
    9.85 +#endif
    9.86 +	/* kernel code + 640k memory hole (later should not be needed, but 
    9.87 +	   be paranoid for now) */
    9.88 +	if (last >= 640*1024 && addr < __pa_symbol(&_end)) { 
    9.89 +		*addrp = __pa_symbol(&_end);
    9.90 +		return 1;
    9.91 +	}
    9.92 +	/* XXX ramdisk image here? */ 
    9.93 +	return 0;
    9.94 +} 
    9.95 +
    9.96 +int __init e820_mapped(unsigned long start, unsigned long end, unsigned type) 
    9.97 +{ 
    9.98 +	int i;
    9.99 +	for (i = 0; i < e820.nr_map; i++) { 
   9.100 +		struct e820entry *ei = &e820.map[i]; 
   9.101 +		if (type && ei->type != type) 
   9.102 +			continue;
   9.103 +		if (ei->addr >= end || ei->addr + ei->size < start) 
   9.104 +			continue; 
   9.105 +		return 1; 
   9.106 +	} 
   9.107 +	return 0;
   9.108 +}
   9.109 +
   9.110 +/* 
   9.111 + * Find a free area in a specific range. 
   9.112 + */ 
   9.113 +unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsigned size) 
   9.114 +{ 
   9.115 +	int i; 
   9.116 +	for (i = 0; i < e820.nr_map; i++) { 
   9.117 +		struct e820entry *ei = &e820.map[i]; 
   9.118 +		unsigned long addr = ei->addr, last; 
   9.119 +		if (ei->type != E820_RAM) 
   9.120 +			continue; 
   9.121 +		if (addr < start) 
   9.122 +			addr = start;
   9.123 +		if (addr > ei->addr + ei->size) 
   9.124 +			continue; 
   9.125 +		while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size)
   9.126 +			;
   9.127 +		last = addr + size;
   9.128 +		if (last > ei->addr + ei->size)
   9.129 +			continue;
   9.130 +		if (last > end) 
   9.131 +			continue;
   9.132 +		return addr; 
   9.133 +	} 
   9.134 +	return -1UL;		
   9.135 +} 
   9.136 +
   9.137 +/* 
   9.138 + * Free bootmem based on the e820 table for a node.
   9.139 + */
   9.140 +void __init e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end)
   9.141 +{
   9.142 +	int i;
   9.143 +	for (i = 0; i < e820.nr_map; i++) {
   9.144 +		struct e820entry *ei = &e820.map[i]; 
   9.145 +		unsigned long last, addr;
   9.146 +
   9.147 +		if (ei->type != E820_RAM || 
   9.148 +		    ei->addr+ei->size <= start || 
   9.149 +		    ei->addr > end)
   9.150 +			continue;
   9.151 +
   9.152 +		addr = round_up(ei->addr, PAGE_SIZE);
   9.153 +		if (addr < start) 
   9.154 +			addr = start;
   9.155 +
   9.156 +		last = round_down(ei->addr + ei->size, PAGE_SIZE); 
   9.157 +		if (last >= end)
   9.158 +			last = end; 
   9.159 +
   9.160 +		if (last > addr && last-addr >= PAGE_SIZE)
   9.161 +			free_bootmem_node(pgdat, addr, last-addr);
   9.162 +	}
   9.163 +}
   9.164 +
   9.165 +/*
   9.166 + * Find the highest page frame number we have available
   9.167 + */
   9.168 +unsigned long __init e820_end_of_ram(void)
   9.169 +{
   9.170 +	int i;
   9.171 +	unsigned long end_pfn = 0;
   9.172 +	
   9.173 +	for (i = 0; i < e820.nr_map; i++) {
   9.174 +		struct e820entry *ei = &e820.map[i]; 
   9.175 +		unsigned long start, end;
   9.176 +
   9.177 +		start = round_up(ei->addr, PAGE_SIZE); 
   9.178 +		end = round_down(ei->addr + ei->size, PAGE_SIZE); 
   9.179 +		if (start >= end)
   9.180 +			continue;
   9.181 +		if (ei->type == E820_RAM) { 
   9.182 +		if (end > end_pfn<<PAGE_SHIFT)
   9.183 +			end_pfn = end>>PAGE_SHIFT;
   9.184 +		} else { 
   9.185 +			if (end > end_pfn_map<<PAGE_SHIFT) 
   9.186 +				end_pfn_map = end>>PAGE_SHIFT;
   9.187 +		} 
   9.188 +	}
   9.189 +
   9.190 +	if (end_pfn > end_pfn_map) 
   9.191 +		end_pfn_map = end_pfn;
   9.192 +	if (end_pfn_map > MAXMEM>>PAGE_SHIFT)
   9.193 +		end_pfn_map = MAXMEM>>PAGE_SHIFT;
   9.194 +	if (end_pfn > end_user_pfn)
   9.195 +		end_pfn = end_user_pfn;
   9.196 +	if (end_pfn > end_pfn_map) 
   9.197 +		end_pfn = end_pfn_map; 
   9.198 +
   9.199 +	return end_pfn;	
   9.200 +}
   9.201 +
   9.202 +/* 
   9.203 + * Mark e820 reserved areas as busy for the resource manager.
   9.204 + */
   9.205 +void __init e820_reserve_resources(void)
   9.206 +{
   9.207 +	int i;
   9.208 +	for (i = 0; i < e820.nr_map; i++) {
   9.209 +		struct resource *res;
   9.210 +		if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL)
   9.211 +			continue;
   9.212 +		res = alloc_bootmem_low(sizeof(struct resource));
   9.213 +		switch (e820.map[i].type) {
   9.214 +		case E820_RAM:	res->name = "System RAM"; break;
   9.215 +		case E820_ACPI:	res->name = "ACPI Tables"; break;
   9.216 +		case E820_NVS:	res->name = "ACPI Non-volatile Storage"; break;
   9.217 +		default:	res->name = "reserved";
   9.218 +		}
   9.219 +		res->start = e820.map[i].addr;
   9.220 +		res->end = res->start + e820.map[i].size - 1;
   9.221 +		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
   9.222 +		request_resource(&iomem_resource, res);
   9.223 +		if (e820.map[i].type == E820_RAM) {
   9.224 +			/*
   9.225 +			 *  We don't know which RAM region contains kernel data,
   9.226 +			 *  so we try it repeatedly and let the resource manager
   9.227 +			 *  test it.
   9.228 +			 */
   9.229 +			request_resource(res, &code_resource);
   9.230 +			request_resource(res, &data_resource);
   9.231 +		}
   9.232 +	}
   9.233 +}
   9.234 +
   9.235 +
   9.236 +void __init e820_print_map(char *who)
   9.237 +{
   9.238 +	int i;
   9.239 +
   9.240 +	for (i = 0; i < e820.nr_map; i++) {
   9.241 +		printk(" %s: %016Lx - %016Lx ", who,
   9.242 +			(unsigned long long) e820.map[i].addr,
   9.243 +			(unsigned long long) (e820.map[i].addr + e820.map[i].size));
   9.244 +		switch (e820.map[i].type) {
   9.245 +		case E820_RAM:	printk("(usable)\n");
   9.246 +				break;
   9.247 +		case E820_RESERVED:
   9.248 +				printk("(reserved)\n");
   9.249 +				break;
   9.250 +		case E820_ACPI:
   9.251 +				printk("(ACPI data)\n");
   9.252 +				break;
   9.253 +		case E820_NVS:
   9.254 +				printk("(ACPI NVS)\n");
   9.255 +				break;
   9.256 +		default:	printk("type %u\n", e820.map[i].type);
   9.257 +				break;
   9.258 +		}
   9.259 +	}
   9.260 +}
   9.261 +
   9.262 +/*
   9.263 + * Sanitize the BIOS e820 map.
   9.264 + *
   9.265 + * Some e820 responses include overlapping entries.  The following 
   9.266 + * replaces the original e820 map with a new one, removing overlaps.
   9.267 + *
   9.268 + */
   9.269 +static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
   9.270 +{
   9.271 +	struct change_member {
   9.272 +		struct e820entry *pbios; /* pointer to original bios entry */
   9.273 +		unsigned long long addr; /* address for this change point */
   9.274 +	};
   9.275 +	static struct change_member change_point_list[2*E820MAX] __initdata;
   9.276 +	static struct change_member *change_point[2*E820MAX] __initdata;
   9.277 +	static struct e820entry *overlap_list[E820MAX] __initdata;
   9.278 +	static struct e820entry new_bios[E820MAX] __initdata;
   9.279 +	struct change_member *change_tmp;
   9.280 +	unsigned long current_type, last_type;
   9.281 +	unsigned long long last_addr;
   9.282 +	int chgidx, still_changing;
   9.283 +	int overlap_entries;
   9.284 +	int new_bios_entry;
   9.285 +	int old_nr, new_nr;
   9.286 +	int i;
   9.287 +
   9.288 +	/*
   9.289 +		Visually we're performing the following (1,2,3,4 = memory types)...
   9.290 +
   9.291 +		Sample memory map (w/overlaps):
   9.292 +		   ____22__________________
   9.293 +		   ______________________4_
   9.294 +		   ____1111________________
   9.295 +		   _44_____________________
   9.296 +		   11111111________________
   9.297 +		   ____________________33__
   9.298 +		   ___________44___________
   9.299 +		   __________33333_________
   9.300 +		   ______________22________
   9.301 +		   ___________________2222_
   9.302 +		   _________111111111______
   9.303 +		   _____________________11_
   9.304 +		   _________________4______
   9.305 +
   9.306 +		Sanitized equivalent (no overlap):
   9.307 +		   1_______________________
   9.308 +		   _44_____________________
   9.309 +		   ___1____________________
   9.310 +		   ____22__________________
   9.311 +		   ______11________________
   9.312 +		   _________1______________
   9.313 +		   __________3_____________
   9.314 +		   ___________44___________
   9.315 +		   _____________33_________
   9.316 +		   _______________2________
   9.317 +		   ________________1_______
   9.318 +		   _________________4______
   9.319 +		   ___________________2____
   9.320 +		   ____________________33__
   9.321 +		   ______________________4_
   9.322 +	*/
   9.323 +
   9.324 +	/* if there's only one memory region, don't bother */
   9.325 +	if (*pnr_map < 2)
   9.326 +		return -1;
   9.327 +
   9.328 +	old_nr = *pnr_map;
   9.329 +
   9.330 +	/* bail out if we find any unreasonable addresses in bios map */
   9.331 +	for (i=0; i<old_nr; i++)
   9.332 +		if (biosmap[i].addr + biosmap[i].size < biosmap[i].addr)
   9.333 +			return -1;
   9.334 +
   9.335 +	/* create pointers for initial change-point information (for sorting) */
   9.336 +	for (i=0; i < 2*old_nr; i++)
   9.337 +		change_point[i] = &change_point_list[i];
   9.338 +
   9.339 +	/* record all known change-points (starting and ending addresses) */
   9.340 +	chgidx = 0;
   9.341 +	for (i=0; i < old_nr; i++)	{
   9.342 +		change_point[chgidx]->addr = biosmap[i].addr;
   9.343 +		change_point[chgidx++]->pbios = &biosmap[i];
   9.344 +		change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size;
   9.345 +		change_point[chgidx++]->pbios = &biosmap[i];
   9.346 +	}
   9.347 +
   9.348 +	/* sort change-point list by memory addresses (low -> high) */
   9.349 +	still_changing = 1;
   9.350 +	while (still_changing)	{
   9.351 +		still_changing = 0;
   9.352 +		for (i=1; i < 2*old_nr; i++)  {
   9.353 +			/* if <current_addr> > <last_addr>, swap */
   9.354 +			/* or, if current=<start_addr> & last=<end_addr>, swap */
   9.355 +			if ((change_point[i]->addr < change_point[i-1]->addr) ||
   9.356 +				((change_point[i]->addr == change_point[i-1]->addr) &&
   9.357 +				 (change_point[i]->addr == change_point[i]->pbios->addr) &&
   9.358 +				 (change_point[i-1]->addr != change_point[i-1]->pbios->addr))
   9.359 +			   )
   9.360 +			{
   9.361 +				change_tmp = change_point[i];
   9.362 +				change_point[i] = change_point[i-1];
   9.363 +				change_point[i-1] = change_tmp;
   9.364 +				still_changing=1;
   9.365 +			}
   9.366 +		}
   9.367 +	}
   9.368 +
   9.369 +	/* create a new bios memory map, removing overlaps */
   9.370 +	overlap_entries=0;	 /* number of entries in the overlap table */
   9.371 +	new_bios_entry=0;	 /* index for creating new bios map entries */
   9.372 +	last_type = 0;		 /* start with undefined memory type */
   9.373 +	last_addr = 0;		 /* start with 0 as last starting address */
   9.374 +	/* loop through change-points, determining affect on the new bios map */
   9.375 +	for (chgidx=0; chgidx < 2*old_nr; chgidx++)
   9.376 +	{
   9.377 +		/* keep track of all overlapping bios entries */
   9.378 +		if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr)
   9.379 +		{
   9.380 +			/* add map entry to overlap list (> 1 entry implies an overlap) */
   9.381 +			overlap_list[overlap_entries++]=change_point[chgidx]->pbios;
   9.382 +		}
   9.383 +		else
   9.384 +		{
   9.385 +			/* remove entry from list (order independent, so swap with last) */
   9.386 +			for (i=0; i<overlap_entries; i++)
   9.387 +			{
   9.388 +				if (overlap_list[i] == change_point[chgidx]->pbios)
   9.389 +					overlap_list[i] = overlap_list[overlap_entries-1];
   9.390 +			}
   9.391 +			overlap_entries--;
   9.392 +		}
   9.393 +		/* if there are overlapping entries, decide which "type" to use */
   9.394 +		/* (larger value takes precedence -- 1=usable, 2,3,4,4+=unusable) */
   9.395 +		current_type = 0;
   9.396 +		for (i=0; i<overlap_entries; i++)
   9.397 +			if (overlap_list[i]->type > current_type)
   9.398 +				current_type = overlap_list[i]->type;
   9.399 +		/* continue building up new bios map based on this information */
   9.400 +		if (current_type != last_type)	{
   9.401 +			if (last_type != 0)	 {
   9.402 +				new_bios[new_bios_entry].size =
   9.403 +					change_point[chgidx]->addr - last_addr;
   9.404 +				/* move forward only if the new size was non-zero */
   9.405 +				if (new_bios[new_bios_entry].size != 0)
   9.406 +					if (++new_bios_entry >= E820MAX)
   9.407 +						break; 	/* no more space left for new bios entries */
   9.408 +			}
   9.409 +			if (current_type != 0)	{
   9.410 +				new_bios[new_bios_entry].addr = change_point[chgidx]->addr;
   9.411 +				new_bios[new_bios_entry].type = current_type;
   9.412 +				last_addr=change_point[chgidx]->addr;
   9.413 +			}
   9.414 +			last_type = current_type;
   9.415 +		}
   9.416 +	}
   9.417 +	new_nr = new_bios_entry;   /* retain count for new bios entries */
   9.418 +
   9.419 +	/* copy new bios mapping into original location */
   9.420 +	memcpy(biosmap, new_bios, new_nr*sizeof(struct e820entry));
   9.421 +	*pnr_map = new_nr;
   9.422 +
   9.423 +	return 0;
   9.424 +}
   9.425 +
   9.426 +/*
   9.427 + * Copy the BIOS e820 map into a safe place.
   9.428 + *
   9.429 + * Sanity-check it while we're at it..
   9.430 + *
   9.431 + * If we're lucky and live on a modern system, the setup code
   9.432 + * will have given us a memory map that we can use to properly
   9.433 + * set up memory.  If we aren't, we'll fake a memory map.
   9.434 + *
   9.435 + * We check to see that the memory map contains at least 2 elements
   9.436 + * before we'll use it, because the detection code in setup.S may
   9.437 + * not be perfect and most every PC known to man has two memory
   9.438 + * regions: one from 0 to 640k, and one from 1mb up.  (The IBM
   9.439 + * thinkpad 560x, for example, does not cooperate with the memory
   9.440 + * detection code.)
   9.441 + */
   9.442 +static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
   9.443 +{
   9.444 +	/* Only one memory region (or negative)? Ignore it */
   9.445 +	if (nr_map < 2)
   9.446 +		return -1;
   9.447 +
   9.448 +	do {
   9.449 +		unsigned long start = biosmap->addr;
   9.450 +		unsigned long size = biosmap->size;
   9.451 +		unsigned long end = start + size;
   9.452 +		unsigned long type = biosmap->type;
   9.453 +
   9.454 +		/* Overflow in 64 bits? Ignore the memory map. */
   9.455 +		if (start > end)
   9.456 +			return -1;
   9.457 +
   9.458 +		/*
   9.459 +		 * Some BIOSes claim RAM in the 640k - 1M region.
   9.460 +		 * Not right. Fix it up.
   9.461 +		 * 
   9.462 +		 * This should be removed on Hammer which is supposed to not
   9.463 +		 * have non e820 covered ISA mappings there, but I had some strange
   9.464 +		 * problems so it stays for now.  -AK
   9.465 +		 */
   9.466 +		if (type == E820_RAM) {
   9.467 +			if (start < 0x100000ULL && end > 0xA0000ULL) {
   9.468 +				if (start < 0xA0000ULL)
   9.469 +					add_memory_region(start, 0xA0000ULL-start, type);
   9.470 +				if (end <= 0x100000ULL)
   9.471 +					continue;
   9.472 +				start = 0x100000ULL;
   9.473 +				size = end - start;
   9.474 +			}
   9.475 +		}
   9.476 +
   9.477 +		add_memory_region(start, size, type);
   9.478 +	} while (biosmap++,--nr_map);
   9.479 +	return 0;
   9.480 +}
   9.481 +
   9.482 +void __init setup_memory_region(void)
   9.483 +{
   9.484 +	char *who = "BIOS-e820";
   9.485 +
   9.486 +	/*
   9.487 +	 * Try to copy the BIOS-supplied E820-map.
   9.488 +	 *
   9.489 +	 * Otherwise fake a memory map; one section from 0k->640k,
   9.490 +	 * the next section from 1mb->appropriate_mem_k
   9.491 +	 */
   9.492 +	sanitize_e820_map(E820_MAP, &E820_MAP_NR);
   9.493 +	if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
   9.494 +		unsigned long mem_size;
   9.495 +
   9.496 +		/* compare results from other methods and take the greater */
   9.497 +		if (ALT_MEM_K < EXT_MEM_K) {
   9.498 +			mem_size = EXT_MEM_K;
   9.499 +			who = "BIOS-88";
   9.500 +		} else {
   9.501 +			mem_size = ALT_MEM_K;
   9.502 +			who = "BIOS-e801";
   9.503 +		}
   9.504 +
   9.505 +		e820.nr_map = 0;
   9.506 +		add_memory_region(0, LOWMEMSIZE(), E820_RAM);
   9.507 +		add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
   9.508 +  	}
   9.509 +	printk(KERN_INFO "BIOS-provided physical RAM map:\n");
   9.510 +	e820_print_map(who);
   9.511 +}
   9.512 +#endif
   9.513 +
   9.514 +extern unsigned long xen_override_max_pfn;
   9.515 +
   9.516 +void __init parse_memopt(char *p, char **from) 
   9.517 +{ 
   9.518 +	/*
   9.519 +	 * mem=XXX[kKmM] limits kernel memory to XXX+1MB
   9.520 +	 *
   9.521 +	 * It would be more logical to count from 0 instead of from
   9.522 +	 * HIGH_MEMORY, but we keep that for now for i386 compatibility. 
   9.523 +	 *	
   9.524 +	 * No support for custom mapping like i386.  The reason is
   9.525 +	 * that we need to read the e820 map anyways to handle the
   9.526 +	 * ACPI mappings in the direct map.  Also on x86-64 there
   9.527 +	 * should be always a good e820 map. This is only an upper
   9.528 +	 * limit, you cannot force usage of memory not in e820.
   9.529 +	 *
   9.530 +	 * -AK
   9.531 +			 */
   9.532 +	end_user_pfn = memparse(p, from) + HIGH_MEMORY;
   9.533 +	end_user_pfn >>= PAGE_SHIFT;	
   9.534 +        xen_override_max_pfn = (unsigned long) end_user_pfn;
   9.535 +} 
   9.536 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/early_printk.c	Sat Apr 02 20:27:11 2005 +0000
    10.3 @@ -0,0 +1,240 @@
    10.4 +#include <linux/console.h>
    10.5 +#include <linux/kernel.h>
    10.6 +#include <linux/init.h>
    10.7 +#include <linux/string.h>
    10.8 +#include <asm/io.h>
    10.9 +#include <asm/processor.h>
   10.10 +
   10.11 +/* Simple VGA output */
   10.12 +
   10.13 +#ifdef __i386__
   10.14 +#define VGABASE		(__ISA_IO_base + 0xb8000)
   10.15 +#else
   10.16 +#define VGABASE		((void __iomem *)0xffffffff800b8000UL)
   10.17 +#endif
   10.18 +
   10.19 +#define MAX_YPOS	25
   10.20 +#define MAX_XPOS	80
   10.21 +
   10.22 +#if 0
   10.23 +static int current_ypos = 1, current_xpos = 0; 
   10.24 +
   10.25 +static void early_vga_write(struct console *con, const char *str, unsigned n)
   10.26 +{
   10.27 +	char c;
   10.28 +	int  i, k, j;
   10.29 +
   10.30 +	while ((c = *str++) != '\0' && n-- > 0) {
   10.31 +		if (current_ypos >= MAX_YPOS) {
   10.32 +			/* scroll 1 line up */
   10.33 +			for (k = 1, j = 0; k < MAX_YPOS; k++, j++) {
   10.34 +				for (i = 0; i < MAX_XPOS; i++) {
   10.35 +					writew(readw(VGABASE + 2*(MAX_XPOS*k + i)),
   10.36 +					       VGABASE + 2*(MAX_XPOS*j + i));
   10.37 +				}
   10.38 +			}
   10.39 +			for (i = 0; i < MAX_XPOS; i++)
   10.40 +				writew(0x720, VGABASE + 2*(MAX_XPOS*j + i));
   10.41 +			current_ypos = MAX_YPOS-1;
   10.42 +		}
   10.43 +		if (c == '\n') {
   10.44 +			current_xpos = 0;
   10.45 +			current_ypos++;
   10.46 +		} else if (c != '\r')  {
   10.47 +			writew(((0x7 << 8) | (unsigned short) c),
   10.48 +			       VGABASE + 2*(MAX_XPOS*current_ypos +
   10.49 +						current_xpos++));
   10.50 +			if (current_xpos >= MAX_XPOS) {
   10.51 +				current_xpos = 0;
   10.52 +				current_ypos++;
   10.53 +			}
   10.54 +		}
   10.55 +	}
   10.56 +}
   10.57 +
   10.58 +static struct console early_vga_console = {
   10.59 +	.name =		"earlyvga",
   10.60 +	.write =	early_vga_write,
   10.61 +	.flags =	CON_PRINTBUFFER,
   10.62 +	.index =	-1,
   10.63 +};
   10.64 +#endif
   10.65 +
   10.66 +/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ 
   10.67 +
   10.68 +int early_serial_base = 0x3f8;  /* ttyS0 */ 
   10.69 +
   10.70 +#define XMTRDY          0x20
   10.71 +
   10.72 +#define DLAB		0x80
   10.73 +
   10.74 +#define TXR             0       /*  Transmit register (WRITE) */
   10.75 +#define RXR             0       /*  Receive register  (READ)  */
   10.76 +#define IER             1       /*  Interrupt Enable          */
   10.77 +#define IIR             2       /*  Interrupt ID              */
   10.78 +#define FCR             2       /*  FIFO control              */
   10.79 +#define LCR             3       /*  Line control              */
   10.80 +#define MCR             4       /*  Modem control             */
   10.81 +#define LSR             5       /*  Line Status               */
   10.82 +#define MSR             6       /*  Modem Status              */
   10.83 +#define DLL             0       /*  Divisor Latch Low         */
   10.84 +#define DLH             1       /*  Divisor latch High        */
   10.85 +
   10.86 +#if 0
   10.87 +static int early_serial_putc(unsigned char ch) 
   10.88 +{ 
   10.89 +	unsigned timeout = 0xffff; 
   10.90 +	while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout) 
   10.91 +		cpu_relax();
   10.92 +	outb(ch, early_serial_base + TXR);
   10.93 +	return timeout ? 0 : -1;
   10.94 +} 
   10.95 +
   10.96 +static void early_serial_write(struct console *con, const char *s, unsigned n)
   10.97 +{
   10.98 +	while (*s && n-- > 0) { 
   10.99 +		early_serial_putc(*s); 
  10.100 +		if (*s == '\n') 
  10.101 +			early_serial_putc('\r'); 
  10.102 +		s++; 
  10.103 +	} 
  10.104 +} 
  10.105 +#endif
  10.106 +
  10.107 +#define DEFAULT_BAUD 9600
  10.108 +
  10.109 +#if 0
  10.110 +static __init void early_serial_init(char *s)
  10.111 +{
  10.112 +	unsigned char c; 
  10.113 +	unsigned divisor;
  10.114 +	unsigned baud = DEFAULT_BAUD;
  10.115 +	char *e;
  10.116 +
  10.117 +	if (*s == ',')
  10.118 +		++s;
  10.119 +
  10.120 +	if (*s) {
  10.121 +		unsigned port; 
  10.122 +		if (!strncmp(s,"0x",2)) {
  10.123 +			early_serial_base = simple_strtoul(s, &e, 16);
  10.124 +		} else {
  10.125 +			static int bases[] = { 0x3f8, 0x2f8 };
  10.126 +
  10.127 +			if (!strncmp(s,"ttyS",4))
  10.128 +				s += 4;
  10.129 +			port = simple_strtoul(s, &e, 10);
  10.130 +			if (port > 1 || s == e)
  10.131 +				port = 0;
  10.132 +			early_serial_base = bases[port];
  10.133 +		}
  10.134 +		s += strcspn(s, ",");
  10.135 +		if (*s == ',')
  10.136 +			s++;
  10.137 +	}
  10.138 +
  10.139 +	outb(0x3, early_serial_base + LCR);	/* 8n1 */
  10.140 +	outb(0, early_serial_base + IER);	/* no interrupt */
  10.141 +	outb(0, early_serial_base + FCR);	/* no fifo */
  10.142 +	outb(0x3, early_serial_base + MCR);	/* DTR + RTS */
  10.143 +
  10.144 +	if (*s) {
  10.145 +		baud = simple_strtoul(s, &e, 0); 
  10.146 +		if (baud == 0 || s == e) 
  10.147 +			baud = DEFAULT_BAUD;
  10.148 +	} 
  10.149 +	
  10.150 +	divisor = 115200 / baud; 
  10.151 +	c = inb(early_serial_base + LCR); 
  10.152 +	outb(c | DLAB, early_serial_base + LCR); 
  10.153 +	outb(divisor & 0xff, early_serial_base + DLL); 
  10.154 +	outb((divisor >> 8) & 0xff, early_serial_base + DLH); 
  10.155 +	outb(c & ~DLAB, early_serial_base + LCR);
  10.156 +}
  10.157 +
  10.158 +static struct console early_serial_console = {
  10.159 +	.name =		"earlyser",
  10.160 +	.write =	early_serial_write,
  10.161 +	.flags =	CON_PRINTBUFFER,
  10.162 +	.index =	-1,
  10.163 +};
  10.164 +#endif
  10.165 +
  10.166 +static void xen_console_write(struct console *con, const char *s, unsigned n)
  10.167 +{
  10.168 +        HYPERVISOR_console_io(CONSOLEIO_write, n, (char *) s);
  10.169 +}
  10.170 +
  10.171 +static struct console xen_console = {
  10.172 +        .name =         "xen",
  10.173 +        .write =        xen_console_write,
  10.174 +        .flags =        CON_PRINTBUFFER,
  10.175 +        .index =        -1,
  10.176 +};
  10.177 +
  10.178 +/* Direct interface for emergencies */
  10.179 +struct console *early_console = &xen_console;
  10.180 +/* struct console *early_console = &early_vga_console; */
  10.181 +static int early_console_initialized = 0;
  10.182 +
  10.183 +void early_printk(const char *fmt, ...)
  10.184 +{ 
  10.185 +	char buf[512]; 
  10.186 +	int n; 
  10.187 +	va_list ap;
  10.188 +
  10.189 +	va_start(ap,fmt); 
  10.190 +	n = vscnprintf(buf,512,fmt,ap);
  10.191 +	early_console->write(early_console,buf,n);
  10.192 +	va_end(ap); 
  10.193 +} 
  10.194 +
  10.195 +static int keep_early; 
  10.196 +
  10.197 +int __init setup_early_printk(char *opt) 
  10.198 +{  
  10.199 +
  10.200 +        early_console = &xen_console; 
  10.201 +#if 0
  10.202 +	if (early_console_initialized)
  10.203 +		return -1;
  10.204 +
  10.205 +	opt = strchr(opt, '=') + 1;
  10.206 +
  10.207 +	strlcpy(buf,opt,sizeof(buf)); 
  10.208 +	space = strchr(buf, ' '); 
  10.209 +	if (space)
  10.210 +		*space = 0; 
  10.211 +
  10.212 +	if (strstr(buf,"keep"))
  10.213 +		keep_early = 1; 
  10.214 +
  10.215 +	if (!strncmp(buf, "serial", 6)) { 
  10.216 +		early_serial_init(buf + 6);
  10.217 +		early_console = &early_serial_console;
  10.218 +	} else if (!strncmp(buf, "ttyS", 4)) { 
  10.219 +		early_serial_init(buf);
  10.220 +		early_console = &early_serial_console;		
  10.221 +	} else if (!strncmp(buf, "vga", 3)) {
  10.222 +		early_console = &early_vga_console; 
  10.223 +	}
  10.224 +#endif
  10.225 +	early_console_initialized = 1;
  10.226 +	register_console(early_console);       
  10.227 +	return 0;
  10.228 +}
  10.229 +
  10.230 +void __init disable_early_printk(void)
  10.231 +{ 
  10.232 +	if (!early_console_initialized || !early_console)
  10.233 +		return;
  10.234 +	if (!keep_early) {
  10.235 +		printk("disabling early console\n");
  10.236 +		unregister_console(early_console);
  10.237 +		early_console_initialized = 0;
  10.238 +	} else { 
  10.239 +		printk("keeping early console\n");
  10.240 +	}
  10.241 +} 
  10.242 +
  10.243 +__setup("earlyprintk=", setup_early_printk);
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S	Sat Apr 02 20:27:11 2005 +0000
    11.3 @@ -0,0 +1,1158 @@
    11.4 +/*
    11.5 + *  linux/arch/x86_64/entry.S
    11.6 + *
    11.7 + *  Copyright (C) 1991, 1992  Linus Torvalds
    11.8 + *  Copyright (C) 2000, 2001, 2002  Andi Kleen SuSE Labs
    11.9 + *  Copyright (C) 2000  Pavel Machek <pavel@suse.cz>
   11.10 + * 
   11.11 + *  $Id$
   11.12 + *
   11.13 + *  Jun Nakajima <jun.nakajima@intel.com>
   11.14 + *  Asit Mallick <asit.k.mallick@intel.com>
   11.15 + *      Modified for Xen
   11.16 + */
   11.17 +
   11.18 +/*
   11.19 + * entry.S contains the system-call and fault low-level handling routines.
   11.20 + *
   11.21 + * NOTE: This code handles signal-recognition, which happens every time
   11.22 + * after an interrupt and after each system call.
   11.23 + * 
   11.24 + * Normal syscalls and interrupts don't save a full stack frame, this is 
   11.25 + * only done for syscall tracing, signals or fork/exec et.al.
   11.26 + * 
   11.27 + * A note on terminology:	 
   11.28 + * - top of stack: Architecture defined interrupt frame from SS to RIP 
   11.29 + * at the top of the kernel process stack.	
   11.30 + * - partial stack frame: partially saved registers upto R11.
   11.31 + * - full stack frame: Like partial stack frame, but all register saved. 
   11.32 + *	
   11.33 + * TODO:	 
   11.34 + * - schedule it carefully for the final hardware.
   11.35 + */
   11.36 +
   11.37 +#define ASSEMBLY 1
   11.38 +#include <linux/config.h>
   11.39 +#include <linux/linkage.h>
   11.40 +#include <asm/segment.h>
   11.41 +#include <asm/smp.h>
   11.42 +#include <asm/cache.h>
   11.43 +#include <asm/errno.h>
   11.44 +#include <asm/dwarf2.h>
   11.45 +#include <asm/calling.h>
   11.46 +#include <asm/asm_offset.h>
   11.47 +#include <asm/msr.h>
   11.48 +#include <asm/unistd.h>
   11.49 +#include <asm/thread_info.h>
   11.50 +#include <asm/hw_irq.h>
   11.51 +#include <asm/errno.h>
   11.52 +#include <asm-xen/xen-public/arch-x86_64.h>
   11.53 +
   11.54 +
   11.55 +EVENT_MASK      = (CS+4)
   11.56 +ECF_IN_SYSCALL  = (1<<8)
   11.57 +        
   11.58 +/*
   11.59 + * Copied from arch/xen/i386/kernel/entry.S
   11.60 + */                        
   11.61 +/* Offsets into shared_info_t. */                
   11.62 +#define evtchn_upcall_pending		0
   11.63 +#define evtchn_upcall_mask		1
   11.64 +
   11.65 +#define sizeof_vcpu_shift		3
   11.66 +
   11.67 +#ifdef CONFIG_SMP
   11.68 +#define XEN_GET_VCPU_INFO(reg)
   11.69 +#define preempt_disable(reg)	incl TI_preempt_count(reg)
   11.70 +#define preempt_enable(reg)	decl TI_preempt_count(reg)
   11.71 +#define XEN_LOCK_VCPU_INFO_SMP(reg) preempt_disable(%rbp)		; \
   11.72 +				movl TI_cpu(%rbp),reg			; \
   11.73 +				shl  $sizeof_vcpu_shift,reg		; \
   11.74 +				addl HYPERVISOR_shared_info,reg
   11.75 +#define XEN_UNLOCK_VCPU_INFO_SMP(reg) preempt_enable(%rbp)
   11.76 +#define XEN_UNLOCK_VCPU_INFO_SMP_fixup .byte 0xff,0xff,0xff
   11.77 +#define Ux00 0xff
   11.78 +#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
   11.79 +#define XEN_BLOCK_EVENTS(reg)	XEN_LOCK_VCPU_INFO_SMP(reg)		; \
   11.80 +				XEN_LOCKED_BLOCK_EVENTS(reg)		; \
   11.81 +    				XEN_UNLOCK_VCPU_INFO_SMP(reg)
   11.82 +#define XEN_UNBLOCK_EVENTS(reg)	XEN_LOCK_VCPU_INFO_SMP(reg)		; \
   11.83 +				movb $0,evtchn_upcall_mask(reg)		; \
   11.84 +    				XEN_UNLOCK_VCPU_INFO_SMP(reg)
   11.85 +#define XEN_SAVE_UPCALL_MASK(reg,tmp,off) GET_THREAD_INFO(%ebp)		; \
   11.86 +				XEN_LOCK_VCPU_INFO_SMP(reg)		; \
   11.87 +				movb evtchn_upcall_mask(reg), tmp	; \
   11.88 +				movb tmp, off(%rsp)			; \
   11.89 +    				XEN_UNLOCK_VCPU_INFO_SMP(reg)
   11.90 +#else
   11.91 +#define XEN_GET_VCPU_INFO(reg)	movq HYPERVISOR_shared_info,reg
   11.92 +#define XEN_LOCK_VCPU_INFO_SMP(reg) movq HYPERVISOR_shared_info,reg
   11.93 +#define XEN_UNLOCK_VCPU_INFO_SMP(reg)
   11.94 +#define XEN_UNLOCK_VCPU_INFO_SMP_fixup
   11.95 +#define Ux00 0x00
   11.96 +#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
   11.97 +#define XEN_BLOCK_EVENTS(reg)	XEN_LOCKED_BLOCK_EVENTS(reg)
   11.98 +#define XEN_UNBLOCK_EVENTS(reg)	movb $0,evtchn_upcall_mask(reg)
   11.99 +#define XEN_SAVE_UPCALL_MASK(reg,tmp,off) \
  11.100 +	movb evtchn_upcall_mask(reg), tmp; \
  11.101 +	movb tmp, off(%rsp)
  11.102 +#endif
  11.103 +
  11.104 +#define XEN_TEST_PENDING(reg)	testb $0xFF,evtchn_upcall_pending(reg)
  11.105 +
  11.106 +	.code64
  11.107 +
  11.108 +#ifdef CONFIG_PREEMPT
  11.109 +#define preempt_stop XEN_BLOCK_EVENTS(%rsi)
  11.110 +#else
  11.111 +#define preempt_stop
  11.112 +#define retint_kernel retint_restore_args
  11.113 +#endif	
  11.114 +
  11.115 +
  11.116 +/*
  11.117 + * C code is not supposed to know about undefined top of stack. Every time 
  11.118 + * a C function with an pt_regs argument is called from the SYSCALL based 
  11.119 + * fast path FIXUP_TOP_OF_STACK is needed.
  11.120 + * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
  11.121 + * manipulation.
  11.122 + */        	
  11.123 +		
  11.124 +
  11.125 +	.macro FAKE_STACK_FRAME child_rip
  11.126 +	/* push in order ss, rsp, eflags, cs, rip */
  11.127 +	xorq %rax, %rax
  11.128 +	pushq %rax /* ss */
  11.129 +	CFI_ADJUST_CFA_OFFSET	8
  11.130 +	pushq %rax /* rsp */
  11.131 +	CFI_ADJUST_CFA_OFFSET	8
  11.132 +	CFI_OFFSET	rip,0
  11.133 +	pushq $(1<<9) /* eflags - interrupts on */
  11.134 +	CFI_ADJUST_CFA_OFFSET	8
  11.135 +	pushq $__KERNEL_CS /* cs */
  11.136 +	CFI_ADJUST_CFA_OFFSET	8
  11.137 +	pushq \child_rip /* rip */
  11.138 +	CFI_ADJUST_CFA_OFFSET	8
  11.139 +	CFI_OFFSET	rip,0
  11.140 +	pushq	%rax /* orig rax */
  11.141 +	CFI_ADJUST_CFA_OFFSET	8
  11.142 +	.endm
  11.143 +
  11.144 +	.macro UNFAKE_STACK_FRAME
  11.145 +	addq $8*6, %rsp
  11.146 +	CFI_ADJUST_CFA_OFFSET	-(6*8)
  11.147 +	.endm
  11.148 +
  11.149 +	.macro	CFI_DEFAULT_STACK
  11.150 +	CFI_ADJUST_CFA_OFFSET  (SS)
  11.151 +	CFI_OFFSET	r15,R15-SS
  11.152 +	CFI_OFFSET	r14,R14-SS
  11.153 +	CFI_OFFSET	r13,R13-SS
  11.154 +	CFI_OFFSET	r12,R12-SS
  11.155 +	CFI_OFFSET	rbp,RBP-SS
  11.156 +	CFI_OFFSET	rbx,RBX-SS
  11.157 +	CFI_OFFSET	r11,R11-SS
  11.158 +	CFI_OFFSET	r10,R10-SS
  11.159 +	CFI_OFFSET	r9,R9-SS
  11.160 +	CFI_OFFSET	r8,R8-SS
  11.161 +	CFI_OFFSET	rax,RAX-SS
  11.162 +	CFI_OFFSET	rcx,RCX-SS
  11.163 +	CFI_OFFSET	rdx,RDX-SS
  11.164 +	CFI_OFFSET	rsi,RSI-SS
  11.165 +	CFI_OFFSET	rdi,RDI-SS
  11.166 +	CFI_OFFSET	rsp,RSP-SS
  11.167 +	CFI_OFFSET	rip,RIP-SS
  11.168 +	.endm
  11.169 +
  11.170 +        /*
  11.171 +         * Must be consistent with the definition in arch_x86_64.h:    
  11.172 +         *     struct switch_to_user {
  11.173 +         *        u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
  11.174 +         *     } PACKED;
  11.175 +         * #define ECF_IN_SYSCALL (1<<8) 
  11.176 +         */
  11.177 +        .macro SWITCH_TO_USER flag
  11.178 +        movl $0,%gs:pda_kernel_mode     # change to user mode
  11.179 +        subq $8*4,%rsp                   # reuse rip, cs, rflags, rsp, ss in the stack
  11.180 +        movq %rax,(%rsp)
  11.181 +        movq %r11,1*8(%rsp)
  11.182 +        movq %rcx,2*8(%rsp)              # we saved %rcx upon exceptions
  11.183 +        movq $\flag,3*8(%rsp)
  11.184 +        movq $__USER_CS,5*8(%rsp)
  11.185 +        movq $__USER_DS,8*8(%rsp)
  11.186 +        movq $__HYPERVISOR_switch_to_user,%rax
  11.187 +        syscall
  11.188 +        .endm
  11.189 +
  11.190 +        .macro SWITCH_TO_KERNEL ssoff,adjust=0
  11.191 +  	btsq $0,%gs:pda_kernel_mode
  11.192 +	jc  1f
  11.193 +	orb  $1,\ssoff-\adjust+4(%rsp)
  11.194 +1:
  11.195 +        .endm
  11.196 +
  11.197 +/*        
  11.198 + * A newly forked process directly context switches into this.
  11.199 + */ 	
  11.200 +/* rdi:	prev */	
  11.201 +ENTRY(ret_from_fork)
  11.202 +	CFI_STARTPROC
  11.203 +	CFI_DEFAULT_STACK
  11.204 +	call schedule_tail
  11.205 +	GET_THREAD_INFO(%rcx)
  11.206 +	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
  11.207 +	jnz rff_trace
  11.208 +rff_action:	
  11.209 +	RESTORE_REST
  11.210 +	cmpl $__KERNEL_CS,CS-ARGOFFSET(%rsp)	# from kernel_thread?
  11.211 +	je   int_ret_from_sys_call
  11.212 +	testl $_TIF_IA32,threadinfo_flags(%rcx)
  11.213 +	jnz  int_ret_from_sys_call
  11.214 +	jmp ret_from_sys_call
  11.215 +rff_trace:
  11.216 +	movq %rsp,%rdi
  11.217 +	call syscall_trace_leave
  11.218 +	GET_THREAD_INFO(%rcx)	
  11.219 +	jmp rff_action
  11.220 +	CFI_ENDPROC
  11.221 +
  11.222 +/*
  11.223 + * System call entry. Upto 6 arguments in registers are supported.
  11.224 + *
  11.225 + * SYSCALL does not save anything on the stack and does not change the
  11.226 + * stack pointer.
  11.227 + */
  11.228 +		
  11.229 +/*
  11.230 + * Register setup:	
  11.231 + * rax  system call number
  11.232 + * rdi  arg0
  11.233 + * rcx  return address for syscall/sysret, C arg3 
  11.234 + * rsi  arg1
  11.235 + * rdx  arg2	
  11.236 + * r10  arg3 	(--> moved to rcx for C)
  11.237 + * r8   arg4
  11.238 + * r9   arg5
  11.239 + * r11  eflags for syscall/sysret, temporary for C
  11.240 + * r12-r15,rbp,rbx saved by C code, not touched. 		
  11.241 + * 
  11.242 + * Interrupts are off on entry.
  11.243 + * Only called from user space.
  11.244 + *
  11.245 + * XXX	if we had a free scratch register we could save the RSP into the stack frame
  11.246 + *      and report it properly in ps. Unfortunately we haven't.
  11.247 + */ 			 		
  11.248 +
  11.249 +ENTRY(system_call)
  11.250 +	CFI_STARTPROC
  11.251 +	SAVE_ARGS -8,0
  11.252 +	movq  %rax,ORIG_RAX-ARGOFFSET(%rsp) 
  11.253 +        XEN_GET_VCPU_INFO(%r11)
  11.254 +        XEN_SAVE_UPCALL_MASK(%r11,%cl,EVENT_MASK-ARGOFFSET)      # saved %rcx          
  11.255 +        XEN_UNBLOCK_EVENTS(%r11)        
  11.256 +	GET_THREAD_INFO(%rcx)
  11.257 +	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
  11.258 +	jnz tracesys
  11.259 +	cmpq $__NR_syscall_max,%rax
  11.260 +	ja badsys
  11.261 +	movq %r10,%rcx
  11.262 +	call *sys_call_table(,%rax,8)  # XXX:	 rip relative
  11.263 +	movq %rax,RAX-ARGOFFSET(%rsp)
  11.264 +/*
  11.265 + * Syscall return path ending with SYSRET (fast path)
  11.266 + * Has incomplete stack frame and undefined top of stack. 
  11.267 + */		
  11.268 +	.globl ret_from_sys_call
  11.269 +ret_from_sys_call:
  11.270 +	movl $_TIF_WORK_MASK,%edi
  11.271 +	/* edi:	flagmask */
  11.272 +sysret_check:		
  11.273 +	GET_THREAD_INFO(%rcx)
  11.274 +        XEN_GET_VCPU_INFO(%r11)
  11.275 +        XEN_BLOCK_EVENTS(%r11)        
  11.276 +	movl threadinfo_flags(%rcx),%edx
  11.277 +	andl %edi,%edx
  11.278 +	jnz  sysret_careful 
  11.279 +        XEN_UNBLOCK_EVENTS(%r11)                
  11.280 +	RESTORE_ARGS 0,8,0
  11.281 +        SWITCH_TO_USER ECF_IN_SYSCALL
  11.282 +        
  11.283 +	/* Handle reschedules */
  11.284 +	/* edx:	work, edi: workmask */	
  11.285 +sysret_careful:
  11.286 +	bt $TIF_NEED_RESCHED,%edx
  11.287 +	jnc sysret_signal
  11.288 +        XEN_GET_VCPU_INFO(%r11)
  11.289 +        XEN_BLOCK_EVENTS(%r11)        
  11.290 +	pushq %rdi
  11.291 +	call schedule
  11.292 +	popq  %rdi
  11.293 +	jmp sysret_check
  11.294 +
  11.295 +	/* Handle a signal */ 
  11.296 +sysret_signal:
  11.297 +/*	sti */
  11.298 +        XEN_GET_VCPU_INFO(%r11)
  11.299 +        XEN_UNBLOCK_EVENTS(%r11)        
  11.300 +	testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
  11.301 +	jz    1f
  11.302 +
  11.303 +	/* Really a signal */
  11.304 +	/* edx:	work flags (arg3) */
  11.305 +	leaq do_notify_resume(%rip),%rax
  11.306 +	leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
  11.307 +	xorl %esi,%esi # oldset -> arg2
  11.308 +	call ptregscall_common
  11.309 +1:	movl $_TIF_NEED_RESCHED,%edi
  11.310 +	jmp sysret_check
  11.311 +	
  11.312 +	/* Do syscall tracing */
  11.313 +tracesys:			 
  11.314 +	SAVE_REST
  11.315 +	movq $-ENOSYS,RAX(%rsp)
  11.316 +	movq %rsp,%rdi
  11.317 +	call syscall_trace_enter
  11.318 +	LOAD_ARGS ARGOFFSET  /* reload args from stack in case ptrace changed it */
  11.319 +	RESTORE_REST
  11.320 +	cmpq $__NR_syscall_max,%rax
  11.321 +	ja  1f
  11.322 +	movq %r10,%rcx	/* fixup for C */
  11.323 +	call *sys_call_table(,%rax,8)
  11.324 +	movq %rax,RAX-ARGOFFSET(%rsp)
  11.325 +1:	SAVE_REST
  11.326 +	movq %rsp,%rdi
  11.327 +	call syscall_trace_leave
  11.328 +	RESTORE_REST
  11.329 +	jmp ret_from_sys_call
  11.330 +		
  11.331 +badsys:
  11.332 +	movq $-ENOSYS,RAX-ARGOFFSET(%rsp)	
  11.333 +	jmp ret_from_sys_call
  11.334 +
  11.335 +/* 
  11.336 + * Syscall return path ending with IRET.
  11.337 + * Has correct top of stack, but partial stack frame.
  11.338 + */ 	
  11.339 +ENTRY(int_ret_from_sys_call)	
  11.340 +        XEN_GET_VCPU_INFO(%r11)
  11.341 +        XEN_BLOCK_EVENTS(%r11)
  11.342 +	testb $1,SS-ARGOFFSET+4(%rsp)
  11.343 +        jnz 1f
  11.344 +        /* Need to set the proper %ss (not NULL) for ring 3 iretq */
  11.345 +        movl $__KERNEL_DS,SS-ARGOFFSET(%rsp)
  11.346 +        jmp retint_restore_args   # retrun from ring3 kernel
  11.347 +1:              
  11.348 +	movl $_TIF_ALLWORK_MASK,%edi
  11.349 +	/* edi:	mask to check */
  11.350 +int_with_check:
  11.351 +	GET_THREAD_INFO(%rcx)
  11.352 +	movl threadinfo_flags(%rcx),%edx
  11.353 +	andl %edi,%edx
  11.354 +	jnz   int_careful
  11.355 +	jmp   retint_restore_args
  11.356 +
  11.357 +	/* Either reschedule or signal or syscall exit tracking needed. */
  11.358 +	/* First do a reschedule test. */
  11.359 +	/* edx:	work, edi: workmask */
  11.360 +int_careful:
  11.361 +	bt $TIF_NEED_RESCHED,%edx
  11.362 +	jnc  int_very_careful
  11.363 +/*	sti */
  11.364 +        XEN_GET_VCPU_INFO(%r11)
  11.365 +        XEN_UNBLOCK_EVENTS(%r11)
  11.366 +	pushq %rdi
  11.367 +	call schedule
  11.368 +	popq %rdi
  11.369 +	jmp int_with_check
  11.370 +
  11.371 +	/* handle signals and tracing -- both require a full stack frame */
  11.372 +int_very_careful:
  11.373 +/*	sti */
  11.374 +	SAVE_REST
  11.375 +	/* Check for syscall exit trace */	
  11.376 +	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx
  11.377 +	jz int_signal
  11.378 +	pushq %rdi
  11.379 +	leaq 8(%rsp),%rdi	# &ptregs -> arg1	
  11.380 +	call syscall_trace_leave
  11.381 +	popq %rdi
  11.382 +	btr  $TIF_SYSCALL_TRACE,%edi
  11.383 +	btr  $TIF_SYSCALL_AUDIT,%edi
  11.384 +	btr  $TIF_SINGLESTEP,%edi
  11.385 +	jmp int_restore_rest
  11.386 +	
  11.387 +int_signal:
  11.388 +	testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
  11.389 +	jz 1f
  11.390 +	movq %rsp,%rdi		# &ptregs -> arg1
  11.391 +	xorl %esi,%esi		# oldset -> arg2
  11.392 +	call do_notify_resume
  11.393 +1:	movl $_TIF_NEED_RESCHED,%edi	
  11.394 +int_restore_rest:
  11.395 +	RESTORE_REST
  11.396 +	jmp int_with_check
  11.397 +	CFI_ENDPROC
  11.398 +		
  11.399 +/* 
  11.400 + * Certain special system calls that need to save a complete full stack frame.
  11.401 + */ 								
  11.402 +	
  11.403 +	.macro PTREGSCALL label,func,arg
  11.404 +	.globl \label
  11.405 +\label:
  11.406 +	leaq	\func(%rip),%rax
  11.407 +	leaq    -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
  11.408 +	jmp	ptregscall_common
  11.409 +	.endm
  11.410 +
  11.411 +	PTREGSCALL stub_clone, sys_clone, %r8
  11.412 +	PTREGSCALL stub_fork, sys_fork, %rdi
  11.413 +	PTREGSCALL stub_vfork, sys_vfork, %rdi
  11.414 +	PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx
  11.415 +	PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
  11.416 +	PTREGSCALL stub_iopl, sys_iopl, %rsi
  11.417 +
  11.418 +ENTRY(ptregscall_common)
  11.419 +	CFI_STARTPROC
  11.420 +	popq %r11
  11.421 +	CFI_ADJUST_CFA_OFFSET	-8
  11.422 +	SAVE_REST
  11.423 +	movq %r11, %r15
  11.424 +	call *%rax
  11.425 +	movq %r15, %r11
  11.426 +	RESTORE_REST
  11.427 +	pushq %r11
  11.428 +	CFI_ADJUST_CFA_OFFSET	8
  11.429 +	ret
  11.430 +	CFI_ENDPROC
  11.431 +	
  11.432 +ENTRY(stub_execve)
  11.433 +	CFI_STARTPROC
  11.434 +	popq %r11
  11.435 +	CFI_ADJUST_CFA_OFFSET	-8
  11.436 +	SAVE_REST
  11.437 +	movq %r11, %r15
  11.438 +	call sys_execve
  11.439 +	GET_THREAD_INFO(%rcx)
  11.440 +	bt $TIF_IA32,threadinfo_flags(%rcx)
  11.441 +	jc exec_32bit
  11.442 +	movq %r15, %r11
  11.443 +	RESTORE_REST
  11.444 +	push %r11
  11.445 +	ret
  11.446 +
  11.447 +exec_32bit:
  11.448 +	CFI_ADJUST_CFA_OFFSET	REST_SKIP
  11.449 +	movq %rax,RAX(%rsp)
  11.450 +	RESTORE_REST
  11.451 +	jmp int_ret_from_sys_call
  11.452 +	CFI_ENDPROC
  11.453 +	
  11.454 +/*
  11.455 + * sigreturn is special because it needs to restore all registers on return.
  11.456 + * This cannot be done with SYSRET, so use the IRET return path instead.
  11.457 + */                
  11.458 +ENTRY(stub_rt_sigreturn)
  11.459 +	CFI_STARTPROC
  11.460 +	addq $8, %rsp		
  11.461 +	SAVE_REST
  11.462 +	movq %rsp,%rdi
  11.463 +	call sys_rt_sigreturn
  11.464 +	movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
  11.465 +	RESTORE_REST
  11.466 +	jmp int_ret_from_sys_call
  11.467 +	CFI_ENDPROC
  11.468 +
  11.469 +
  11.470 +/* 
  11.471 + * Interrupt entry/exit.
  11.472 + *
  11.473 + * Interrupt entry points save only callee clobbered registers in fast path.
  11.474 + *	
  11.475 + * Entry runs with interrupts off.	
  11.476 + */ 
  11.477 +
  11.478 +/* 0(%rsp): interrupt number */ 
  11.479 +	.macro interrupt func
  11.480 +	CFI_STARTPROC	simple
  11.481 +	CFI_DEF_CFA	rsp,(SS-RDI)
  11.482 +	CFI_REL_OFFSET	rsp,(RSP-ORIG_RAX)
  11.483 +	CFI_REL_OFFSET	rip,(RIP-ORIG_RAX)
  11.484 +	cld
  11.485 +#ifdef CONFIG_DEBUG_INFO
  11.486 +	SAVE_ALL	
  11.487 +	movq %rsp,%rdi
  11.488 +	/*
  11.489 +	 * Setup a stack frame pointer.  This allows gdb to trace
  11.490 +	 * back to the original stack.
  11.491 +	 */
  11.492 +	movq %rsp,%rbp
  11.493 +	CFI_DEF_CFA_REGISTER	rbp
  11.494 +#else		
  11.495 +	SAVE_ARGS
  11.496 +	leaq -ARGOFFSET(%rsp),%rdi	# arg1 for handler
  11.497 +#endif
  11.498 +#if 0 /* For Xen we don't need to do this */       
  11.499 +	testl $3,CS(%rdi)
  11.500 +	je 1f
  11.501 +	swapgs
  11.502 +#endif        
  11.503 +1:	addl $1,%gs:pda_irqcount	# RED-PEN should check preempt count
  11.504 +	movq %gs:pda_irqstackptr,%rax
  11.505 +	cmoveq %rax,%rsp							
  11.506 +	pushq %rdi			# save old stack	
  11.507 +	call \func
  11.508 +	.endm
  11.509 +
  11.510 +retint_check:			
  11.511 +	movl threadinfo_flags(%rcx),%edx
  11.512 +	andl %edi,%edx
  11.513 +	jnz  retint_careful
  11.514 +retint_restore_args:
  11.515 +	RESTORE_ARGS 0,8,0
  11.516 +        testb $3,8(%rsp)                # check CS
  11.517 +        jnz  user_mode
  11.518 +kernel_mode:
  11.519 +        orb   $3,1*8(%rsp)
  11.520 +        iretq
  11.521 +user_mode:
  11.522 +        SWITCH_TO_USER 0                        
  11.523 +                
  11.524 +	/* edi: workmask, edx: work */	
  11.525 +retint_careful:
  11.526 +	bt    $TIF_NEED_RESCHED,%edx
  11.527 +	jnc   retint_signal
  11.528 +        XEN_GET_VCPU_INFO(%r11)
  11.529 +        XEN_UNBLOCK_EVENTS(%r11)
  11.530 +/*	sti */        
  11.531 +	pushq %rdi
  11.532 +	call  schedule
  11.533 +	popq %rdi
  11.534 +        XEN_GET_VCPU_INFO(%r11)        
  11.535 +        XEN_BLOCK_EVENTS(%r11)		
  11.536 +	GET_THREAD_INFO(%rcx)
  11.537 +/*	cli */
  11.538 +	jmp retint_check
  11.539 +	
  11.540 +retint_signal:
  11.541 +	testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
  11.542 +	jz    retint_restore_args
  11.543 +        XEN_GET_VCPU_INFO(%r11)
  11.544 +        XEN_UNBLOCK_EVENTS(%r11)
  11.545 +	SAVE_REST
  11.546 +	movq $-1,ORIG_RAX(%rsp) 			
  11.547 +	xorq %rsi,%rsi		# oldset
  11.548 +	movq %rsp,%rdi		# &pt_regs
  11.549 +	call do_notify_resume
  11.550 +	RESTORE_REST
  11.551 +        XEN_GET_VCPU_INFO(%r11)        
  11.552 +        XEN_BLOCK_EVENTS(%r11)		
  11.553 +	movl $_TIF_NEED_RESCHED,%edi
  11.554 +	GET_THREAD_INFO(%rcx)	
  11.555 +	jmp retint_check
  11.556 +
  11.557 +#ifdef CONFIG_PREEMPT
  11.558 +	/* Returning to kernel space. Check if we need preemption */
  11.559 +	/* rcx:	 threadinfo. interrupts off. */
  11.560 +	.p2align
  11.561 +retint_kernel:	
  11.562 +	cmpl $0,threadinfo_preempt_count(%rcx)
  11.563 +	jnz  retint_restore_args
  11.564 +	bt  $TIF_NEED_RESCHED,threadinfo_flags(%rcx)
  11.565 +	jnc  retint_restore_args
  11.566 +	bt   $9,EFLAGS-ARGOFFSET(%rsp)	/* interrupts off? */
  11.567 +	jc   retint_restore_args
  11.568 +	movl $PREEMPT_ACTIVE,threadinfo_preempt_count(%rcx)
  11.569 +/*	sti */
  11.570 +        XEN_GET_VCPU_INFO(%r11)
  11.571 +        XEN_BLOCK_EVENTS(%r11)
  11.572 +	call schedule
  11.573 +        XEN_GET_VCPU_INFO(%r11) /* %esi can be different */
  11.574 +        XEN_UNBLOCK_EVENTS(%r11)
  11.575 +/*	cli */
  11.576 +	GET_THREAD_INFO(%rcx)
  11.577 +	movl $0,threadinfo_preempt_count(%rcx) 
  11.578 +	jmp retint_kernel       /* check again */
  11.579 +#endif	
  11.580 +	CFI_ENDPROC
  11.581 +	
  11.582 +/*
  11.583 + * APIC interrupts.
  11.584 + */		
  11.585 +	.macro apicinterrupt num,func
  11.586 +	pushq $\num-256
  11.587 +	interrupt \func
  11.588 +	jmp ret_from_intr
  11.589 +	CFI_ENDPROC
  11.590 +	.endm
  11.591 +
  11.592 +#ifdef CONFIG_SMP	
  11.593 +ENTRY(reschedule_interrupt)
  11.594 +	apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt
  11.595 +
  11.596 +ENTRY(invalidate_interrupt)
  11.597 +	apicinterrupt INVALIDATE_TLB_VECTOR,smp_invalidate_interrupt
  11.598 +
  11.599 +ENTRY(call_function_interrupt)
  11.600 +	apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
  11.601 +#endif
  11.602 +
  11.603 +#ifdef CONFIG_X86_LOCAL_APIC	
  11.604 +ENTRY(apic_timer_interrupt)
  11.605 +	apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
  11.606 +
  11.607 +ENTRY(error_interrupt)
  11.608 +	apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt
  11.609 +
  11.610 +ENTRY(spurious_interrupt)
  11.611 +	apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
  11.612 +#endif
  11.613 +				
  11.614 +/*
  11.615 + * Exception entry points.
  11.616 + */ 		
  11.617 +	.macro zeroentry sym
  11.618 +        movq (%rsp),%rcx
  11.619 +        movq 8(%rsp),%r11
  11.620 +        addq $0x10,%rsp /* skip rcx and r11 */
  11.621 +	pushq $0	/* push error code/oldrax */ 
  11.622 +	pushq %rax	/* push real oldrax to the rdi slot */ 
  11.623 +	leaq  \sym(%rip),%rax
  11.624 +	jmp error_entry
  11.625 +	.endm	
  11.626 +
  11.627 +	.macro errorentry sym
  11.628 +        movq (%rsp),%rcx
  11.629 +        movq 8(%rsp),%r11
  11.630 +        addq $0x18,%rsp /* rsp points to the error code */
  11.631 +	pushq %rax
  11.632 +	leaq  \sym(%rip),%rax
  11.633 +	jmp error_entry
  11.634 +	.endm
  11.635 +
  11.636 +	/* error code is on the stack already */
  11.637 +	/* handle NMI like exceptions that can happen everywhere */
  11.638 +	.macro paranoidentry sym
  11.639 +        movq (%rsp),%rcx
  11.640 +        movq 8(%rsp),%r11
  11.641 +        addq $0x10,%rsp /* skip rcx and r11 */        
  11.642 +	SAVE_ALL
  11.643 +	cld
  11.644 +	movl $1,%ebx
  11.645 +	movl  $MSR_GS_BASE,%ecx
  11.646 +	rdmsr
  11.647 +	testl %edx,%edx
  11.648 +	js    1f
  11.649 +/*	swapgs */
  11.650 +	xorl  %ebx,%ebx
  11.651 +1:	movq %rsp,%rdi
  11.652 +	movq ORIG_RAX(%rsp),%rsi
  11.653 +	movq $-1,ORIG_RAX(%rsp)
  11.654 +	call \sym
  11.655 +	.endm
  11.656 +	
  11.657 +/*
  11.658 + * Exception entry point. This expects an error code/orig_rax on the stack
  11.659 + * and the exception handler in %rax.	
  11.660 + */ 		  				
  11.661 +ENTRY(error_entry)
  11.662 +	CFI_STARTPROC	simple
  11.663 +	CFI_DEF_CFA	rsp,(SS-RDI)
  11.664 +	CFI_REL_OFFSET	rsp,(RSP-RDI)
  11.665 +	CFI_REL_OFFSET	rip,(RIP-RDI)
  11.666 +	/* rdi slot contains rax, oldrax contains error code */
  11.667 +	cld
  11.668 +	subq  $14*8,%rsp
  11.669 +	CFI_ADJUST_CFA_OFFSET	(14*8)
  11.670 +	movq %rsi,13*8(%rsp)
  11.671 +	CFI_REL_OFFSET	rsi,RSI
  11.672 +	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
  11.673 +	movq %rdx,12*8(%rsp)
  11.674 +	CFI_REL_OFFSET	rdx,RDX
  11.675 +	movq %rcx,11*8(%rsp)
  11.676 +	CFI_REL_OFFSET	rcx,RCX
  11.677 +	movq %rsi,10*8(%rsp)	/* store rax */ 
  11.678 +	CFI_REL_OFFSET	rax,RAX
  11.679 +	movq %r8, 9*8(%rsp)
  11.680 +	CFI_REL_OFFSET	r8,R8
  11.681 +	movq %r9, 8*8(%rsp)
  11.682 +	CFI_REL_OFFSET	r9,R9
  11.683 +	movq %r10,7*8(%rsp)
  11.684 +	CFI_REL_OFFSET	r10,R10
  11.685 +	movq %r11,6*8(%rsp)
  11.686 +	CFI_REL_OFFSET	r11,R11
  11.687 +	movq %rbx,5*8(%rsp) 
  11.688 +	CFI_REL_OFFSET	rbx,RBX
  11.689 +	movq %rbp,4*8(%rsp) 
  11.690 +	CFI_REL_OFFSET	rbp,RBP
  11.691 +	movq %r12,3*8(%rsp) 
  11.692 +	CFI_REL_OFFSET	r12,R12
  11.693 +	movq %r13,2*8(%rsp) 
  11.694 +	CFI_REL_OFFSET	r13,R13
  11.695 +	movq %r14,1*8(%rsp) 
  11.696 +	CFI_REL_OFFSET	r14,R14
  11.697 +	movq %r15,(%rsp) 
  11.698 +	CFI_REL_OFFSET	r15,R15
  11.699 +#if 0        
  11.700 +	cmpl $__KERNEL_CS,CS(%rsp)
  11.701 +	je  error_kernelspace
  11.702 +#endif        
  11.703 +error_call_handler:
  11.704 +	movq %rdi, RDI(%rsp)            
  11.705 +	movq %rsp,%rdi
  11.706 +	movq ORIG_RAX(%rsp),%rsi	# get error code 
  11.707 +	movq $-1,ORIG_RAX(%rsp)
  11.708 +        leaq do_hypervisor_callback,%rcx
  11.709 +        cmpq %rax,%rcx
  11.710 +        je 0f                           # don't save event mask for callbacks
  11.711 +        XEN_GET_VCPU_INFO(%r11)
  11.712 +        XEN_SAVE_UPCALL_MASK(%r11,%cl,EVENT_MASK)
  11.713 +0:              
  11.714 +	call *%rax
  11.715 +error_check_event:
  11.716 +        movb EVENT_MASK(%rsp), %al
  11.717 +        notb %al			# %al == ~saved_mask
  11.718 +        XEN_LOCK_VCPU_INFO_SMP(%rsi)
  11.719 +        andb evtchn_upcall_mask(%rsi),%al
  11.720 +	andb $1,%al			# %al == mask & ~saved_mask
  11.721 +	jnz restore_all_enable_events	# != 0 => reenable event delivery      
  11.722 +        XEN_UNLOCK_VCPU_INFO_SMP(%rsi)
  11.723 +error_exit:
  11.724 +	RESTORE_REST
  11.725 +/*	cli */
  11.726 +	GET_THREAD_INFO(%rcx)	
  11.727 +	testb $3,CS-REST_SKIP(%rsp)
  11.728 +	jz retint_kernel
  11.729 +	movl  threadinfo_flags(%rcx),%edx
  11.730 +	movl  $_TIF_WORK_MASK,%edi
  11.731 +	andl  %edi,%edx
  11.732 +	jnz  retint_careful
  11.733 +	RESTORE_ARGS 0,8,0
  11.734 +        SWITCH_TO_USER 0
  11.735 +	CFI_ENDPROC
  11.736 +
  11.737 +error_kernelspace:
  11.738 +         /*
  11.739 +         * We need to re-write the logic here because we don't do iretq to 
  11.740 +         * to return to user mode. It's still possible that we get trap/fault
  11.741 +         * in the kernel (when accessing buffers pointed to by system calls, 
  11.742 +         * for example).
  11.743 +         *
  11.744 +         */           
  11.745 +#if 0
  11.746 +	incl %ebx
  11.747 +       /* There are two places in the kernel that can potentially fault with
  11.748 +          usergs. Handle them here. The exception handlers after
  11.749 +	   iret run with kernel gs again, so don't set the user space flag.
  11.750 +	   B stepping K8s sometimes report an truncated RIP for IRET 
  11.751 +	   exceptions returning to compat mode. Check for these here too. */
  11.752 +	leaq iret_label(%rip),%rbp
  11.753 +	cmpq %rbp,RIP(%rsp) 
  11.754 +	je   error_swapgs
  11.755 +	movl %ebp,%ebp	/* zero extend */
  11.756 +	cmpq %rbp,RIP(%rsp) 
  11.757 +	je   error_swapgs
  11.758 +	cmpq $gs_change,RIP(%rsp)
  11.759 +        je   error_swapgs
  11.760 +	jmp  error_sti
  11.761 +#endif        
  11.762 +  
  11.763 +ENTRY(hypervisor_callback)
  11.764 +	zeroentry do_hypervisor_callback
  11.765 +        
  11.766 +/*
  11.767 + * Copied from arch/xen/i386/kernel/entry.S
  11.768 + */               
  11.769 +# A note on the "critical region" in our callback handler.
  11.770 +# We want to avoid stacking callback handlers due to events occurring
  11.771 +# during handling of the last event. To do this, we keep events disabled
  11.772 +# until we've done all processing. HOWEVER, we must enable events before
  11.773 +# popping the stack frame (can't be done atomically) and so it would still
  11.774 +# be possible to get enough handler activations to overflow the stack.
  11.775 +# Although unlikely, bugs of that kind are hard to track down, so we'd
  11.776 +# like to avoid the possibility.
  11.777 +# So, on entry to the handler we detect whether we interrupted an
  11.778 +# existing activation in its critical region -- if so, we pop the current
  11.779 +# activation and restart the handler using the previous one.
  11.780 +
  11.781 +ENTRY(do_hypervisor_callback)   # do_hyperviosr_callback(struct *pt_regs)
  11.782 +# Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
  11.783 +# see the correct pointer to the pt_regs
  11.784 +        addq $8, %rsp            # we don't return, adjust the stack frame
  11.785 +        movq RIP(%rsp),%rax
  11.786 +	cmpq $scrit,%rax
  11.787 +	jb   11f
  11.788 +	cmpq $ecrit,%rax
  11.789 +	jb   critical_region_fixup
  11.790 +11:	movb $0, EVENT_MASK(%rsp)         
  11.791 +	call evtchn_do_upcall
  11.792 +        jmp  error_check_event
  11.793 +
  11.794 +        ALIGN
  11.795 +restore_all_enable_events:  
  11.796 +	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
  11.797 +scrit:	/**** START OF CRITICAL REGION ****/
  11.798 +	XEN_TEST_PENDING(%rsi)
  11.799 +	jnz  14f			# process more events if necessary...
  11.800 +	XEN_UNLOCK_VCPU_INFO_SMP(%rsi)
  11.801 +        RESTORE_REST
  11.802 +        jmp retint_restore_args
  11.803 +        
  11.804 +14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
  11.805 +	XEN_UNLOCK_VCPU_INFO_SMP(%rsi)
  11.806 +        movq %rsp,%rdi                  # set the argument again
  11.807 +	jmp  11b
  11.808 +ecrit:  /**** END OF CRITICAL REGION ****/
  11.809 +# [How we do the fixup]. We want to merge the current stack frame with the
  11.810 +# just-interrupted frame. How we do this depends on where in the critical
  11.811 +# region the interrupted handler was executing, and so how many saved
  11.812 +# registers are in each frame. We do this quickly using the lookup table
  11.813 +# 'critical_fixup_table'. For each byte offset in the critical region, it
  11.814 +# provides the number of bytes which have already been popped from the
  11.815 +# interrupted stack frame. 
  11.816 +critical_region_fixup:
  11.817 +     	subq $scrit,%rax
  11.818 +	shlq $1,%rax
  11.819 +	addq $critical_fixup_table,%rax
  11.820 +	movzwq (%rax),%rcx
  11.821 +	xorq  %rax,%rax
  11.822 +	movb  %ch,%al
  11.823 +	movb  $0,%ch
  11.824 +#ifdef CONFIG_SMP
  11.825 +	cmpb $0xff,%al
  11.826 +	jne  15f
  11.827 +	add  $1,%al
  11.828 +	GET_THREAD_INFO(%rbp)
  11.829 +	XEN_UNLOCK_VCPU_INFO_SMP(%r11)
  11.830 +15:
  11.831 +#endif
  11.832 +    	movq  %rsp,%rsi
  11.833 +	movq  %rsi,%rdi
  11.834 +	addq  $0xa8,%rax
  11.835 +	addq  %rax,%rdi
  11.836 +	addq  %rcx,%rsi
  11.837 +	shrq  $3,%rcx			# convert words to bytes
  11.838 +	je    17f			# skip loop if nothing to copy
  11.839 +16:	subq  $8,%rsi			# pre-decrementing copy loop
  11.840 +	subq  $8,%rdi
  11.841 +	movq  (%rsi),%rax
  11.842 +	movq  %rax,(%rdi)
  11.843 +	loop  16b
  11.844 +17:	movq  %rdi,%rsp			# final %edi is top of merged stack
  11.845 +	jmp   11b
  11.846 +
  11.847 +critical_fixup_table:
  11.848 +	.word 0x0000,0x0000,0x0000,0x0000         # testb  $0xff,0x0(%rsi)
  11.849 +	.word 0x0000,0x0000                       # jne    ffffffff8010daa0 14f
  11.850 +	.word 0x0000,0x0000,0x0000,0x0000         # mov    (%rsp),%r15
  11.851 +	.word 0x0808,0x0808,0x0808,0x0808,0x0808  # mov    0x8(%rsp),%r14
  11.852 +	.word 0x1010,0x1010,0x1010,0x1010,0x1010  # mov    0x10(%rsp),%r13
  11.853 +	.word 0x1818,0x1818,0x1818,0x1818,0x1818  # mov    0x18(%rsp),%r12
  11.854 +	.word 0x2020,0x2020,0x2020,0x2020,0x2020  # mov    0x20(%rsp),%rbp
  11.855 +	.word 0x2828,0x2828,0x2828,0x2828,0x2828  # mov    0x28(%rsp),%rbx
  11.856 +	.word 0x3030,0x3030,0x3030,0x3030         # add    $0x30,%rsp
  11.857 +	.word 0x0030,0x0030,0x0030,0x0030,0x0030  # testb  $0x1,0x74(%rsp)
  11.858 +	.word 0x0030,0x0030,0x0030,0x0030,0x0030,0x0030 # jne    ffffffff8010d740 <user_mode>
  11.859 +	.word 0x0030,0x0030,0x0030,0x0030         # mov    (%rsp),%r11
  11.860 +	.word 0x0838,0x0838,0x0838,0x0838,0x0838  # mov    0x8(%rsp),%r10
  11.861 +	.word 0x1040,0x1040,0x1040,0x1040,0x1040  # mov    0x10(%rsp),%r9
  11.862 +	.word 0x1848,0x1848,0x1848,0x1848,0x1848  # mov    0x18(%rsp),%r8
  11.863 +	.word 0x2060,0x2060,0x2060,0x2060,0x2060  # mov    0x20(%rsp),%rax
  11.864 +	.word 0x2868,0x2868,0x2868,0x2868,0x2868  # mov    0x28(%rsp),%rcx
  11.865 +	.word 0x3070,0x3070,0x3070,0x3070,0x3070  # mov    0x30(%rsp),%rdx
  11.866 +	.word 0x3878,0x3878,0x3878,0x3878,0x3878  # mov    0x38(%rsp),%rsi
  11.867 +	.word 0x4080,0x4080,0x4080,0x4080,0x4080  # mov    0x40(%rsp),%rdi
  11.868 +	.word 0x4888,0x4888,0x4888,0x4888         # add    $0x50,%rsp
  11.869 +	.word 0x0000,0x0000                       # iretq
  11.870 +	.word 0x0000,0x0000,0x0000,0x0000         # movb   $0x1,0x1(%rsi)
  11.871 +	.word 0x0000,0x0000,0x0000                # mov    %rsp,%rdi
  11.872 +	.word 0x0000,0x0000,0x0000,0x0000,0x0000  # jmpq   11b
  11.873 + 
  11.874 +# Hypervisor uses this for application faults while it executes.
  11.875 +ENTRY(failsafe_callback)
  11.876 +        hlt         
  11.877 +#if 0        
  11.878 +1:	movl (%rsp),%ds
  11.879 +2:	movl 8(%rsp),%es
  11.880 +3:	movl 16(%rsp),%fs
  11.881 +4:	movl 24(%rsp),%gs
  11.882 +        subq $14,%rsp
  11.883 +	SAVE_ALL
  11.884 +	jmp  ret_from_exception
  11.885 +.section .fixup,"ax";	\
  11.886 +6:	movq $0,(%rsp);	\
  11.887 +	jmp 1b;		\
  11.888 +7:	movq $0,(%rsp);	\
  11.889 +	jmp 2b;		\
  11.890 +8:	movq $0,(%rsp);	\
  11.891 +	jmp 3b;		\
  11.892 +9:	movq $0,(%rsp);	\
  11.893 +	jmp 4b;		\
  11.894 +.previous;		\
  11.895 +.section __ex_table,"a";\
  11.896 +	.align 8;	\
  11.897 +	.long 1b,6b;	\
  11.898 +	.long 2b,7b;	\
  11.899 +	.long 3b,8b;	\
  11.900 +	.long 4b,9b;	\
  11.901 +.previous
  11.902 +             
  11.903 +        .section __ex_table,"a"
  11.904 +        .align 8
  11.905 +        .quad gs_change,bad_gs
  11.906 +        .previous
  11.907 +        .section .fixup,"ax"
  11.908 +	/* running with kernelgs */
  11.909 +bad_gs: 
  11.910 +/*	swapgs		*/	/* switch back to user gs */
  11.911 +	xorl %eax,%eax
  11.912 +        movl %eax,%gs
  11.913 +        jmp  2b
  11.914 +        .previous       
  11.915 +#endif	
  11.916 +/*
  11.917 + * Create a kernel thread.
  11.918 + *
  11.919 + * C extern interface:
  11.920 + *	extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
  11.921 + *
  11.922 + * asm input arguments:
  11.923 + *	rdi: fn, rsi: arg, rdx: flags
  11.924 + */
  11.925 +ENTRY(kernel_thread)
  11.926 +	CFI_STARTPROC
  11.927 +	FAKE_STACK_FRAME $child_rip
  11.928 +	SAVE_ALL
  11.929 +
  11.930 +	# rdi: flags, rsi: usp, rdx: will be &pt_regs
  11.931 +	movq %rdx,%rdi
  11.932 +	orq  kernel_thread_flags(%rip),%rdi
  11.933 +	movq $-1, %rsi
  11.934 +	movq %rsp, %rdx
  11.935 +
  11.936 +	xorl %r8d,%r8d
  11.937 +	xorl %r9d,%r9d
  11.938 +	
  11.939 +	# clone now
  11.940 +	call do_fork
  11.941 +	movq %rax,RAX(%rsp)
  11.942 +	xorl %edi,%edi
  11.943 +
  11.944 +	/*
  11.945 +	 * It isn't worth to check for reschedule here,
  11.946 +	 * so internally to the x86_64 port you can rely on kernel_thread()
  11.947 +	 * not to reschedule the child before returning, this avoids the need
  11.948 +	 * of hacks for example to fork off the per-CPU idle tasks.
  11.949 +         * [Hopefully no generic code relies on the reschedule -AK]	
  11.950 +	 */
  11.951 +	RESTORE_ALL
  11.952 +	UNFAKE_STACK_FRAME
  11.953 +	ret
  11.954 +	CFI_ENDPROC
  11.955 +
  11.956 +	
  11.957 +child_rip:
  11.958 +	/*
  11.959 +	 * Here we are in the child and the registers are set as they were
  11.960 +	 * at kernel_thread() invocation in the parent.
  11.961 +	 */
  11.962 +	movq %rdi, %rax
  11.963 +	movq %rsi, %rdi
  11.964 +	call *%rax
  11.965 +	# exit
  11.966 +	xorq %rdi, %rdi
  11.967 +	call do_exit
  11.968 +
  11.969 +/*
  11.970 + * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
  11.971 + *
  11.972 + * C extern interface:
  11.973 + *	 extern long execve(char *name, char **argv, char **envp)
  11.974 + *
  11.975 + * asm input arguments:
  11.976 + *	rdi: name, rsi: argv, rdx: envp
  11.977 + *
  11.978 + * We want to fallback into:
  11.979 + *	extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs)
  11.980 + *
  11.981 + * do_sys_execve asm fallback arguments:
  11.982 + *	rdi: name, rsi: argv, rdx: envp, fake frame on the stack
  11.983 + */
  11.984 +ENTRY(execve)
  11.985 +	CFI_STARTPROC
  11.986 +	FAKE_STACK_FRAME $0
  11.987 +	SAVE_ALL	
  11.988 +	call sys_execve
  11.989 +	movq %rax, RAX(%rsp)	
  11.990 +	RESTORE_REST
  11.991 +	testq %rax,%rax
  11.992 +	jne 1f
  11.993 +        jmp int_ret_from_sys_call
  11.994 +1:      RESTORE_ARGS
  11.995 +	UNFAKE_STACK_FRAME
  11.996 +	ret
  11.997 +	CFI_ENDPROC
  11.998 +
  11.999 +
 11.1000 + /*
 11.1001 + * Copy error_entry because of the different stack frame
 11.1002 + */                        
 11.1003 +ENTRY(page_fault)
 11.1004 +        movq (%rsp),%rcx
 11.1005 +        movq 8(%rsp),%r11
 11.1006 +        addq $0x10,%rsp         # now %rsp points to %cr2
 11.1007 +        pushq %rax
 11.1008 +        leaq do_page_fault(%rip),%rax
 11.1009 +	cld	
 11.1010 +	subq  $13*8,%rsp
 11.1011 +	movq %rdx,12*8(%rsp)    # save %rdx
 11.1012 +	movq 13*8(%rsp),%rdx	# load rax
 11.1013 +	movq %rcx,11*8(%rsp)
 11.1014 +	movq %rdx,10*8(%rsp)	# store rax
 11.1015 +        movq %rsi,13*8(%rsp)    # now save %rsi
 11.1016 +        movq 14*8(%rsp),%rdx    # load %cr2, 3rd argument
 11.1017 +	movq %r8, 9*8(%rsp)
 11.1018 +	movq %r9, 8*8(%rsp)
 11.1019 +	movq %r10,7*8(%rsp)
 11.1020 +	movq %r11,6*8(%rsp)
 11.1021 +	movq %rbx,5*8(%rsp) 
 11.1022 +	movq %rbp,4*8(%rsp) 
 11.1023 +	movq %r12,3*8(%rsp) 
 11.1024 +	movq %r13,2*8(%rsp) 
 11.1025 +	movq %r14,1*8(%rsp) 
 11.1026 +	movq %r15,(%rsp)
 11.1027 +#if 0        
 11.1028 +	cmpl $__KERNEL_CS,CS(%rsp)
 11.1029 +	je  error_kernelspace
 11.1030 +#endif
 11.1031 +        /*
 11.1032 +         * 1st and 2nd arguments are set by error_call_handler
 11.1033 +         */
 11.1034 +        jmp error_call_handler
 11.1035 +
 11.1036 +ENTRY(coprocessor_error)
 11.1037 +	zeroentry do_coprocessor_error
 11.1038 +
 11.1039 +ENTRY(simd_coprocessor_error)
 11.1040 +	zeroentry do_simd_coprocessor_error	
 11.1041 +
 11.1042 +ENTRY(device_not_available)
 11.1043 +	zeroentry math_state_restore
 11.1044 +
 11.1045 +	/* runs on exception stack */
 11.1046 +ENTRY(debug)
 11.1047 +	CFI_STARTPROC
 11.1048 +	pushq $0
 11.1049 +	CFI_ADJUST_CFA_OFFSET 8		
 11.1050 +	paranoidentry do_debug
 11.1051 +	/* switch back to process stack to restore the state ptrace touched */
 11.1052 +	movq %rax,%rsp	
 11.1053 +	jmp paranoid_exit
 11.1054 +	CFI_ENDPROC
 11.1055 +
 11.1056 +#if 0
 11.1057 +       	/* runs on exception stack */	
 11.1058 +ENTRY(nmi)
 11.1059 +	CFI_STARTPROC
 11.1060 +	pushq $-1
 11.1061 +	CFI_ADJUST_CFA_OFFSET 8		
 11.1062 +	paranoidentry do_nmi
 11.1063 +	/* ebx:	no swapgs flag */
 11.1064 +#endif        
 11.1065 +paranoid_exit:
 11.1066 +	testl %ebx,%ebx				/* swapgs needed? */
 11.1067 +	jnz paranoid_restore
 11.1068 +paranoid_swapgs:	
 11.1069 +/*	cli
 11.1070 +	swapgs */
 11.1071 +paranoid_restore:	
 11.1072 +	RESTORE_ALL 8
 11.1073 +/*	iretq */
 11.1074 +paranoid_userspace:	
 11.1075 +/*	cli */
 11.1076 +	GET_THREAD_INFO(%rcx)
 11.1077 +	movl threadinfo_flags(%rcx),%edx
 11.1078 +	testl $_TIF_NEED_RESCHED,%edx
 11.1079 +	jnz paranoid_resched
 11.1080 +	testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
 11.1081 +	jnz paranoid_signal
 11.1082 +	jmp paranoid_swapgs
 11.1083 +paranoid_resched:		
 11.1084 +/*	sti */
 11.1085 +	call schedule
 11.1086 +	jmp paranoid_exit
 11.1087 +paranoid_signal:		
 11.1088 +/*	sti */
 11.1089 +	xorl %esi,%esi /* oldset */
 11.1090 +	movq %rsp,%rdi /* &pt_regs */
 11.1091 +	call do_notify_resume
 11.1092 +	jmp paranoid_exit
 11.1093 +	CFI_ENDPROC
 11.1094 +	
 11.1095 +ENTRY(int3)
 11.1096 +	zeroentry do_int3	
 11.1097 +
 11.1098 +ENTRY(overflow)
 11.1099 +	zeroentry do_overflow
 11.1100 +
 11.1101 +ENTRY(bounds)
 11.1102 +	zeroentry do_bounds
 11.1103 +
 11.1104 +ENTRY(invalid_op)
 11.1105 +	zeroentry do_invalid_op	
 11.1106 +
 11.1107 +ENTRY(coprocessor_segment_overrun)
 11.1108 +	zeroentry do_coprocessor_segment_overrun
 11.1109 +
 11.1110 +ENTRY(reserved)
 11.1111 +	zeroentry do_reserved
 11.1112 +
 11.1113 +	/* runs on exception stack */
 11.1114 +ENTRY(double_fault)
 11.1115 +	CFI_STARTPROC
 11.1116 +	paranoidentry do_double_fault
 11.1117 +	movq %rax,%rsp
 11.1118 +	jmp paranoid_exit
 11.1119 +	CFI_ENDPROC
 11.1120 +
 11.1121 +ENTRY(invalid_TSS)
 11.1122 +	errorentry do_invalid_TSS
 11.1123 +
 11.1124 +ENTRY(segment_not_present)
 11.1125 +	errorentry do_segment_not_present
 11.1126 +
 11.1127 +	/* runs on exception stack */
 11.1128 +ENTRY(stack_segment)
 11.1129 +	CFI_STARTPROC
 11.1130 +	paranoidentry do_stack_segment
 11.1131 +	movq %rax,%rsp
 11.1132 +	jmp paranoid_exit
 11.1133 +	CFI_ENDPROC
 11.1134 +
 11.1135 +ENTRY(general_protection)
 11.1136 +	errorentry do_general_protection
 11.1137 +
 11.1138 +ENTRY(alignment_check)
 11.1139 +	errorentry do_alignment_check
 11.1140 +
 11.1141 +ENTRY(divide_error)
 11.1142 +	zeroentry do_divide_error
 11.1143 +
 11.1144 +ENTRY(spurious_interrupt_bug)
 11.1145 +	zeroentry do_spurious_interrupt_bug
 11.1146 +
 11.1147 +#ifdef CONFIG_X86_MCE
 11.1148 +	/* runs on exception stack */
 11.1149 +ENTRY(machine_check)
 11.1150 +	CFI_STARTPROC
 11.1151 +	pushq $0
 11.1152 +	CFI_ADJUST_CFA_OFFSET 8	
 11.1153 +	paranoidentry do_machine_check
 11.1154 +	jmp paranoid_exit
 11.1155 +	CFI_ENDPROC
 11.1156 +#endif
 11.1157 +
 11.1158 +ENTRY(call_debug)
 11.1159 +       zeroentry do_call_debug
 11.1160 +
 11.1161 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head.S	Sat Apr 02 20:27:11 2005 +0000
    12.3 @@ -0,0 +1,207 @@
    12.4 +/*
    12.5 + *  linux/arch/x86_64/kernel/head.S -- start in 32bit and switch to 64bit
    12.6 + *
    12.7 + *  Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
    12.8 + *  Copyright (C) 2000 Pavel Machek <pavel@suse.cz>
    12.9 + *  Copyright (C) 2000 Karsten Keil <kkeil@suse.de>
   12.10 + *  Copyright (C) 2001,2002 Andi Kleen <ak@suse.de>
   12.11 + *
   12.12 + *  $Id: head.S,v 1.49 2002/03/19 17:39:25 ak Exp $
   12.13 + *
   12.14 + *  Jun Nakajima <jun.nakajima@intel.com>
   12.15 + *    Modified for Xen                                
   12.16 + */
   12.17 +
   12.18 +
   12.19 +#include <linux/linkage.h>
   12.20 +
   12.21 +.section __xen_guest
   12.22 +	.ascii	"GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xffffffff80100000"
   12.23 +	.ascii	",LOADER=generic"
   12.24 +/*	.ascii	",PT_MODE_WRITABLE" */
   12.25 +	.byte	0
   12.26 +                
   12.27 +      
   12.28 +#include <linux/threads.h>
   12.29 +#include <asm/desc.h>
   12.30 +#include <asm/segment.h>
   12.31 +#include <asm/page.h>
   12.32 +#include <asm/msr.h>
   12.33 +#include <asm/cache.h>
   12.34 +/* #include <asm/thread_info.h> */
   12.35 +        
   12.36 +	
   12.37 +/* we are not able to switch in one step to the final KERNEL ADRESS SPACE
   12.38 + * because we need identity-mapped pages on setup so define __START_KERNEL to
   12.39 + * 0x100000 for this stage
   12.40 + * 
   12.41 + */
   12.42 +
   12.43 +	.text
   12.44 +	.code64
   12.45 +ENTRY(_start)
   12.46 +        cld                
   12.47 +        movq init_rsp(%rip),%rsp    
   12.48 +	/* Copy the necessary stuff from xen_start_info structure. */
   12.49 +	movq  $xen_start_info_union,%rdi
   12.50 +	movq  $64,%rcx          /* sizeof (union xen_start_info_union) / sizeof (long) */
   12.51 +	rep movsq
   12.52 +
   12.53 +#ifdef CONFIG_SMP
   12.54 +        ENTRY(startup_64_smp)
   12.55 +	cld
   12.56 +#endif /* CONFIG_SMP */
   12.57 +
   12.58 +	/* zero EFLAGS after setting rsp */
   12.59 +	pushq $0
   12.60 +	popfq
   12.61 +	movq	initial_code(%rip),%rax
   12.62 +	jmp	*%rax
   12.63 +
   12.64 +	/* SMP bootup changes these two */	
   12.65 +	.globl	initial_code
   12.66 +initial_code:
   12.67 +	.quad	x86_64_start_kernel
   12.68 +	.globl init_rsp
   12.69 +init_rsp:
   12.70 +	.quad  init_thread_union+THREAD_SIZE-8
   12.71 +
   12.72 +ENTRY(early_idt_handler)
   12.73 +	xorl %eax,%eax
   12.74 +	movq 8(%rsp),%rsi	# get rip
   12.75 +	movq (%rsp),%rdx
   12.76 +	leaq early_idt_msg(%rip),%rdi
   12.77 +1:	hlt                     # generate #GP
   12.78 +	jmp 1b
   12.79 +
   12.80 +early_idt_msg:
   12.81 +	.asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"
   12.82 +
   12.83 +#if 0
   12.84 +ENTRY(lgdt_finish)
   12.85 +        movl $(__USER_DS),%eax          # DS/ES contains default USER segment
   12.86 +        movw %ax,%ds
   12.87 +        movw %ax,%es
   12.88 +        movl $(__KERNEL_DS),%eax        
   12.89 +        movw %ax,%ss                    # after changing gdt.
   12.90 +        popq %rax                       # get the retrun address
   12.91 +        pushq $(__KERNEL_CS)
   12.92 +        pushq %rax
   12.93 +        lretq
   12.94 +#endif 
   12.95 +                       
   12.96 +ENTRY(stext)
   12.97 +ENTRY(_stext)
   12.98 +
   12.99 +	/*
  12.100 +	 * This default setting generates an ident mapping at address 0x100000
  12.101 +	 * and a mapping for the kernel that precisely maps virtual address
  12.102 +	 * 0xffffffff80000000 to physical address 0x000000. (always using
  12.103 +	 * 2Mbyte large pages provided by PAE mode)
  12.104 +	 */
  12.105 +.org 0x1000
  12.106 +ENTRY(init_level4_pgt)
  12.107 +	.fill	512,8,0
  12.108 +
  12.109 +        /*
  12.110 +         * We update two pgd entries to make kernel and user pgd consistent
  12.111 +         * at pgd_populate(). It can be used for kernel modules. So we place 
  12.112 +         * this page here for those cases to avoid memory corruption.
  12.113 +         * We also use this page to establish the initiali mapping for
  12.114 +         * vsyscall area.
  12.115 +         */
  12.116 +.org 0x2000
  12.117 +ENTRY(init_level4_user_pgt)
  12.118 +	.fill	512,8,0
  12.119 +        
  12.120 +        /*
  12.121 +         * This is used for vsyscall area mapping as we have a different
  12.122 +         * level4 page table for user.
  12.123 +         */
  12.124 +.org 0x3000
  12.125 +ENTRY(level3_user_pgt)
  12.126 +        .fill	512,8,0
  12.127 +
  12.128 +.org 0x4000
  12.129 +ENTRY(cpu_gdt_table)
  12.130 +/* The TLS descriptors are currently at a different place compared to i386.
  12.131 +   Hopefully nobody expects them at a fixed place (Wine?) */
  12.132 +	.quad	0x0000000000000000	/* NULL descriptor */
  12.133 +	.quad	0x008ffa000000ffff	/* __KERNEL_COMPAT32_CS */	
  12.134 +	.quad	0x00affa000000ffff	/* __KERNEL_CS */
  12.135 +	.quad	0x00cff2000000ffff	/* __KERNEL_DS */
  12.136 +
  12.137 +       	.quad	0x00cffa000000ffff	/* __USER32_CS */
  12.138 +	.quad	0x00cff2000000ffff	/* __USER_DS, __USER32_DS  */		
  12.139 +	.quad	0x00affa000000ffff	/* __USER_CS */
  12.140 +	.quad	0x00cffa000000ffff	/* __KERNEL32_CS */        
  12.141 +	.quad	0,0			/* TSS */
  12.142 +	.quad	0			/* LDT */
  12.143 +	.quad   0,0,0			/* three TLS descriptors */ 
  12.144 +	.quad	0			/* unused now */
  12.145 +
  12.146 +gdt_end:	
  12.147 +	/* asm/segment.h:GDT_ENTRIES must match this */	
  12.148 +	/* This should be a multiple of the cache line size */
  12.149 +	/* GDTs of other CPUs: */	
  12.150 +	.fill (GDT_SIZE * NR_CPUS) - (gdt_end - cpu_gdt_table)
  12.151 +
  12.152 +.org 0x5000
  12.153 +ENTRY(empty_zero_page)
  12.154 +
  12.155 +.org 0x6000
  12.156 +ENTRY(empty_bad_page)
  12.157 +
  12.158 +.org 0x7000
  12.159 +ENTRY(empty_bad_pte_table)
  12.160 +
  12.161 +.org 0x8000
  12.162 +ENTRY(empty_bad_pmd_table)
  12.163 +
  12.164 +	.org 0x9000
  12.165 +#ifdef CONFIG_ACPI_SLEEP
  12.166 +ENTRY(wakeup_level4_pgt)
  12.167 +	.quad	0x0000000000102007		/* -> level3_ident_pgt */
  12.168 +	.fill	255,8,0
  12.169 +	.quad	0x000000000010a007
  12.170 +	.fill	254,8,0
  12.171 +	/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
  12.172 +	.quad	0x0000000000103007		/* -> level3_kernel_pgt */
  12.173 +#endif
  12.174 +
  12.175 +	.data
  12.176 +
  12.177 +	.align 16
  12.178 +	.globl cpu_gdt_descr
  12.179 +cpu_gdt_descr:
  12.180 +	.word	gdt_end-cpu_gdt_table
  12.181 +gdt:
  12.182 +	.quad	cpu_gdt_table
  12.183 +#ifdef CONFIG_SMP
  12.184 +	.rept	NR_CPUS-1
  12.185 +	.word	0
  12.186 +	.quad	0
  12.187 +	.endr
  12.188 +#endif
  12.189 +
  12.190 +ENTRY(gdt_table32)
  12.191 +	.quad	0x0000000000000000	/* This one is magic */
  12.192 +	.quad	0x0000000000000000	/* unused */
  12.193 +	.quad	0x00af9a000000ffff	/* __KERNEL_CS */
  12.194 +gdt32_end:	
  12.195 +	
  12.196 +/* We need valid kernel segments for data and code in long mode too
  12.197 + * IRET will check the segment types  kkeil 2000/10/28
  12.198 + * Also sysret mandates a special GDT layout 
  12.199 + */
  12.200 +
  12.201 +#if 0        		 		
  12.202 +.align L1_CACHE_BYTES
  12.203 +#endif
  12.204 +	.align  L1_CACHE_BYTES
  12.205 +ENTRY(idt_table)	
  12.206 +	.rept   256
  12.207 +	.quad   0
  12.208 +	.quad 	0
  12.209 +	.endr
  12.210 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/head64.c	Sat Apr 02 20:27:11 2005 +0000
    13.3 @@ -0,0 +1,132 @@
    13.4 +/*
    13.5 + *  linux/arch/x86_64/kernel/head64.c -- prepare to run common code
    13.6 + *
    13.7 + *  Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
    13.8 + *
    13.9 + *  $Id: head64.c,v 1.22 2001/07/06 14:28:20 ak Exp $
   13.10 + *
   13.11 + *  Jun Nakajima <jun.nakajima@intel.com>
   13.12 + *	Modified for Xen.
   13.13 + */
   13.14 +
   13.15 +#include <linux/init.h>
   13.16 +#include <linux/linkage.h>
   13.17 +#include <linux/types.h>
   13.18 +#include <linux/kernel.h>
   13.19 +#include <linux/string.h>
   13.20 +#include <linux/percpu.h>
   13.21 +
   13.22 +#include <asm/processor.h>
   13.23 +#include <asm/proto.h>
   13.24 +#include <asm/smp.h>
   13.25 +#include <asm/bootsetup.h>
   13.26 +#include <asm/setup.h>
   13.27 +#include <asm/desc.h>
   13.28 +
   13.29 +unsigned long start_pfn;
   13.30 +
   13.31 +/* Don't add a printk in there. printk relies on the PDA which is not initialized 
   13.32 +   yet. */
   13.33 +#if 0
   13.34 +static void __init clear_bss(void)
   13.35 +{
   13.36 +	extern char __bss_start[], __bss_end[];
   13.37 +	memset(__bss_start, 0,
   13.38 +	       (unsigned long) __bss_end - (unsigned long) __bss_start);
   13.39 +}
   13.40 +#endif
   13.41 +
   13.42 +extern char x86_boot_params[2048];
   13.43 +
   13.44 +#define NEW_CL_POINTER		0x228	/* Relative to real mode data */
   13.45 +#define OLD_CL_MAGIC_ADDR	0x90020
   13.46 +#define OLD_CL_MAGIC            0xA33F
   13.47 +#define OLD_CL_BASE_ADDR        0x90000
   13.48 +#define OLD_CL_OFFSET           0x90022
   13.49 +
   13.50 +extern char saved_command_line[];
   13.51 +
   13.52 +#if 0
   13.53 +static void __init copy_bootdata(char *real_mode_data)
   13.54 +{
   13.55 +	int new_data;
   13.56 +	char * command_line;
   13.57 +
   13.58 +	memcpy(x86_boot_params, real_mode_data, 2048); 
   13.59 +	new_data = *(int *) (x86_boot_params + NEW_CL_POINTER);
   13.60 +	if (!new_data) {
   13.61 +		if (OLD_CL_MAGIC != * (u16 *) OLD_CL_MAGIC_ADDR) {
   13.62 +			printk("so old bootloader that it does not support commandline?!\n");
   13.63 +			return;
   13.64 +		}
   13.65 +		new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET;
   13.66 +		printk("old bootloader convention, maybe loadlin?\n");
   13.67 +	}
   13.68 +	command_line = (char *) ((u64)(new_data));
   13.69 +	memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
   13.70 +	printk("Bootdata ok (command line is %s)\n", saved_command_line);	
   13.71 +}
   13.72 +#endif
   13.73 +
   13.74 +static void __init setup_boot_cpu_data(void)
   13.75 +{
   13.76 +	int dummy, eax;
   13.77 +
   13.78 +	/* get vendor info */
   13.79 +	cpuid(0, &boot_cpu_data.cpuid_level,
   13.80 +	      (int *)&boot_cpu_data.x86_vendor_id[0],
   13.81 +	      (int *)&boot_cpu_data.x86_vendor_id[8],
   13.82 +	      (int *)&boot_cpu_data.x86_vendor_id[4]);
   13.83 +
   13.84 +	/* get cpu type */
   13.85 +	cpuid(1, &eax, &dummy, &dummy,
   13.86 +		(unsigned int *) &boot_cpu_data.x86_capability);
   13.87 +	boot_cpu_data.x86 = (eax >> 8) & 0xf;
   13.88 +	boot_cpu_data.x86_model = (eax >> 4) & 0xf;
   13.89 +	boot_cpu_data.x86_mask = eax & 0xf;
   13.90 +}
   13.91 +
   13.92 +extern char _end[];
   13.93 +
   13.94 +void __init x86_64_start_kernel(char * real_mode_data)
   13.95 +{
   13.96 +	int i;
   13.97 +
   13.98 +        phys_to_machine_mapping = (u32 *)xen_start_info.mfn_list;
   13.99 +        start_pfn = (__pa(xen_start_info.pt_base) >> PAGE_SHIFT) +  xen_start_info.nr_pt_frames;
  13.100 +
  13.101 +	for (i = 0; i < 256; i++)
  13.102 +		set_intr_gate(i, early_idt_handler);
  13.103 +#if 0
  13.104 +	asm volatile("lidt %0" :: "m" (idt_descr));
  13.105 +#endif
  13.106 +	pda_init(0);
  13.107 +        /*	copy_bootdata(real_mode_data); */
  13.108 +#ifdef CONFIG_SMP
  13.109 +	cpu_set(0, cpu_online_map);
  13.110 +#endif
  13.111 +	/* default console: */
  13.112 +	if (!strstr(saved_command_line, "console="))
  13.113 +		strcat(saved_command_line, " console=tty0"); 
  13.114 +#if 0
  13.115 +	s = strstr(saved_command_line, "earlyprintk=");
  13.116 +	if (s != NULL)
  13.117 +		setup_early_printk(s);
  13.118 +#endif
  13.119 +
  13.120 +#ifdef CONFIG_DISCONTIGMEM
  13.121 +	s = strstr(saved_command_line, "numa=");
  13.122 +	if (s != NULL)
  13.123 +		numa_setup(s+5);
  13.124 +#endif
  13.125 +#ifdef CONFIG_X86_IO_APIC
  13.126 +	if (strstr(saved_command_line, "disableapic"))
  13.127 +		disable_apic = 1;
  13.128 +#endif
  13.129 +	/* You need early console to see that */
  13.130 +	if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE)
  13.131 +		panic("Kernel too big for kernel mapping\n");
  13.132 +
  13.133 +	setup_boot_cpu_data();
  13.134 +	start_kernel();
  13.135 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/init_task.c	Sat Apr 02 20:27:11 2005 +0000
    14.3 @@ -0,0 +1,49 @@
    14.4 +#include <linux/mm.h>
    14.5 +#include <linux/module.h>
    14.6 +#include <linux/sched.h>
    14.7 +#include <linux/init.h>
    14.8 +#include <linux/init_task.h>
    14.9 +#include <linux/fs.h>
   14.10 +#include <linux/mqueue.h>
   14.11 +
   14.12 +#include <asm/uaccess.h>
   14.13 +#include <asm/pgtable.h>
   14.14 +#include <asm/desc.h>
   14.15 +
   14.16 +static struct fs_struct init_fs = INIT_FS;
   14.17 +static struct files_struct init_files = INIT_FILES;
   14.18 +static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
   14.19 +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
   14.20 +struct mm_struct init_mm = INIT_MM(init_mm);
   14.21 +
   14.22 +EXPORT_SYMBOL(init_mm);
   14.23 +
   14.24 +/*
   14.25 + * Initial task structure.
   14.26 + *
   14.27 + * We need to make sure that this is 8192-byte aligned due to the
   14.28 + * way process stacks are handled. This is done by having a special
   14.29 + * "init_task" linker map entry..
   14.30 + */
   14.31 +union thread_union init_thread_union 
   14.32 +	__attribute__((__section__(".data.init_task"))) =
   14.33 +		{ INIT_THREAD_INFO(init_task) };
   14.34 +
   14.35 +/*
   14.36 + * Initial task structure.
   14.37 + *
   14.38 + * All other task structs will be allocated on slabs in fork.c
   14.39 + */
   14.40 +struct task_struct init_task = INIT_TASK(init_task);
   14.41 +
   14.42 +EXPORT_SYMBOL(init_task);
   14.43 +/*
   14.44 + * per-CPU TSS segments. Threads are completely 'soft' on Linux,
   14.45 + * no more per-task TSS's. The TSS size is kept cacheline-aligned
   14.46 + * so they are allowed to end up in the .data.cacheline_aligned
   14.47 + * section. Since TSS's are completely CPU-local, we want them
   14.48 + * on exact cacheline boundaries, to eliminate cacheline ping-pong.
   14.49 + */ 
   14.50 +DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp;
   14.51 +
   14.52 +#define ALIGN_TO_4K __attribute__((section(".data.init_task")))
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ioport.c	Sat Apr 02 20:27:11 2005 +0000
    15.3 @@ -0,0 +1,69 @@
    15.4 +/*
    15.5 + *	linux/arch/x86_64/kernel/ioport.c
    15.6 + *
    15.7 + * This contains the io-permission bitmap code - written by obz, with changes
    15.8 + * by Linus.
    15.9 + */
   15.10 +
   15.11 +#include <linux/sched.h>
   15.12 +#include <linux/kernel.h>
   15.13 +#include <linux/errno.h>
   15.14 +#include <linux/types.h>
   15.15 +#include <linux/ioport.h>
   15.16 +#include <linux/mm.h>
   15.17 +#include <linux/smp.h>
   15.18 +#include <linux/smp_lock.h>
   15.19 +#include <linux/stddef.h>
   15.20 +#include <linux/slab.h>
   15.21 +#include <linux/thread_info.h>
   15.22 +#include <asm-xen/xen-public/dom0_ops.h>
   15.23 +
   15.24 +/*
   15.25 + * sys_iopl has to be used when you want to access the IO ports
   15.26 + * beyond the 0x3ff range: to get the full 65536 ports bitmapped
   15.27 + * you'd need 8kB of bitmaps/process, which is a bit excessive.
   15.28 + *
   15.29 + */
   15.30 +
   15.31 +// asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs)
   15.32 +asmlinkage long sys_iopl(unsigned int new_io_pl)
   15.33 +{
   15.34 +        unsigned int old_io_pl = current->thread.io_pl;
   15.35 +        dom0_op_t op;
   15.36 +
   15.37 +
   15.38 +	if (new_io_pl > 3)
   15.39 +		return -EINVAL;
   15.40 +	/* Trying to gain more privileges? */
   15.41 +	if (new_io_pl > old_io_pl) {
   15.42 +		if (!capable(CAP_SYS_RAWIO))
   15.43 +			return -EPERM;
   15.44 +	}
   15.45 +        
   15.46 +        if (!(xen_start_info.flags & SIF_PRIVILEGED))
   15.47 +                return -EPERM;
   15.48 +
   15.49 +	/* Maintain OS privileges even if user attempts to relinquish them. */
   15.50 +	if (new_io_pl == 0)
   15.51 +		new_io_pl = 1;
   15.52 +
   15.53 +	/* Change our version of the privilege levels. */
   15.54 +	current->thread.io_pl = new_io_pl;
   15.55 +
   15.56 +	/* Force the change at ring 0. */
   15.57 +	op.cmd           = DOM0_IOPL;
   15.58 +	op.u.iopl.domain = DOMID_SELF;
   15.59 +	op.u.iopl.iopl   = new_io_pl;
   15.60 +	HYPERVISOR_dom0_op(&op);
   15.61 +
   15.62 +	return 0;
   15.63 +        
   15.64 +}
   15.65 +
   15.66 +/*
   15.67 + * this changes the io permissions bitmap in the current task.
   15.68 + */
   15.69 +asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
   15.70 +{
   15.71 +  return turn_on ? sys_iopl(3) : 0;
   15.72 +}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/irq.c	Sat Apr 02 20:27:11 2005 +0000
    16.3 @@ -0,0 +1,105 @@
    16.4 +/*
    16.5 + *	linux/arch/x86_64/kernel/irq.c
    16.6 + *
    16.7 + *	Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
    16.8 + *
    16.9 + * This file contains the lowest level x86_64-specific interrupt
   16.10 + * entry and irq statistics code. All the remaining irq logic is
   16.11 + * done by the generic kernel/irq/ code and in the
   16.12 + * x86_64-specific irq controller code. (e.g. i8259.c and
   16.13 + * io_apic.c.)
   16.14 + */
   16.15 +#include <asm/uaccess.h>
   16.16 +#include <linux/module.h>
   16.17 +#include <linux/seq_file.h>
   16.18 +#include <linux/interrupt.h>
   16.19 +#include <linux/kernel_stat.h>
   16.20 +
   16.21 +/*
   16.22 + * Interrupt statistics:
   16.23 + */
   16.24 +
   16.25 +atomic_t irq_err_count;
   16.26 +
   16.27 +
   16.28 +/*
   16.29 + * Generic, controller-independent functions:
   16.30 + */
   16.31 +
   16.32 +int show_interrupts(struct seq_file *p, void *v)
   16.33 +{
   16.34 +	int i = *(loff_t *) v, j;
   16.35 +	struct irqaction * action;
   16.36 +	unsigned long flags;
   16.37 +
   16.38 +	if (i == 0) {
   16.39 +		seq_printf(p, "           ");
   16.40 +		for (j=0; j<NR_CPUS; j++)
   16.41 +			if (cpu_online(j))
   16.42 +				seq_printf(p, "CPU%d       ",j);
   16.43 +		seq_putc(p, '\n');
   16.44 +	}
   16.45 +
   16.46 +	if (i < NR_IRQS) {
   16.47 +		spin_lock_irqsave(&irq_desc[i].lock, flags);
   16.48 +		action = irq_desc[i].action;
   16.49 +		if (!action) 
   16.50 +			goto skip;
   16.51 +		seq_printf(p, "%3d: ",i);
   16.52 +#ifndef CONFIG_SMP
   16.53 +		seq_printf(p, "%10u ", kstat_irqs(i));
   16.54 +#else
   16.55 +		for (j=0; j<NR_CPUS; j++)
   16.56 +			if (cpu_online(j))
   16.57 +			seq_printf(p, "%10u ",
   16.58 +				kstat_cpu(j).irqs[i]);
   16.59 +#endif
   16.60 +		seq_printf(p, " %14s", irq_desc[i].handler->typename);
   16.61 +
   16.62 +		seq_printf(p, "  %s", action->name);
   16.63 +		for (action=action->next; action; action = action->next)
   16.64 +			seq_printf(p, ", %s", action->name);
   16.65 +		seq_putc(p, '\n');
   16.66 +skip:
   16.67 +		spin_unlock_irqrestore(&irq_desc[i].lock, flags);
   16.68 +	} else if (i == NR_IRQS) {
   16.69 +		seq_printf(p, "NMI: ");
   16.70 +		for (j = 0; j < NR_CPUS; j++)
   16.71 +			if (cpu_online(j))
   16.72 +				seq_printf(p, "%10u ", cpu_pda[j].__nmi_count);
   16.73 +		seq_putc(p, '\n');
   16.74 +#ifdef CONFIG_X86_LOCAL_APIC
   16.75 +		seq_printf(p, "LOC: ");
   16.76 +		for (j = 0; j < NR_CPUS; j++)
   16.77 +			if (cpu_online(j))
   16.78 +				seq_printf(p, "%10u ", cpu_pda[j].apic_timer_irqs);
   16.79 +		seq_putc(p, '\n');
   16.80 +#endif
   16.81 +		seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
   16.82 +#ifdef CONFIG_X86_IO_APIC
   16.83 +#ifdef APIC_MISMATCH_DEBUG
   16.84 +		seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
   16.85 +#endif
   16.86 +#endif
   16.87 +	}
   16.88 +	return 0;
   16.89 +}
   16.90 +
   16.91 +/*
   16.92 + * do_IRQ handles all normal device IRQ's (the special
   16.93 + * SMP cross-CPU interrupts have their own specific
   16.94 + * handlers).
   16.95 + */
   16.96 +asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
   16.97 +{	
   16.98 +	/* high bits used in ret_from_ code  */
   16.99 +        int irq = regs->orig_rax & __IRQ_MASK(HARDIRQ_BITS);
  16.100 +
  16.101 +	irq_enter();
  16.102 +
  16.103 +	__do_IRQ(irq, regs);
  16.104 +	irq_exit();
  16.105 +
  16.106 +	return 1;
  16.107 +}
  16.108 +
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/ldt.c	Sat Apr 02 20:27:11 2005 +0000
    17.3 @@ -0,0 +1,273 @@
    17.4 +/*
    17.5 + * linux/arch/x86_64/kernel/ldt.c
    17.6 + *
    17.7 + * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds
    17.8 + * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
    17.9 + * Copyright (C) 2002 Andi Kleen
   17.10 + * 
   17.11 + * This handles calls from both 32bit and 64bit mode.
   17.12 + */
   17.13 +
   17.14 +#include <linux/errno.h>
   17.15 +#include <linux/sched.h>
   17.16 +#include <linux/string.h>
   17.17 +#include <linux/mm.h>
   17.18 +#include <linux/smp.h>
   17.19 +#include <linux/smp_lock.h>
   17.20 +#include <linux/vmalloc.h>
   17.21 +#include <linux/slab.h>
   17.22 +
   17.23 +#include <asm/uaccess.h>
   17.24 +#include <asm/system.h>
   17.25 +#include <asm/ldt.h>
   17.26 +#include <asm/desc.h>
   17.27 +#include <asm/proto.h>
   17.28 +#include <asm/pgalloc.h>
   17.29 +
   17.30 +#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */
   17.31 +static void flush_ldt(void *null)
   17.32 +{
   17.33 +        if (current->active_mm) {
   17.34 +                load_LDT(&current->active_mm->context);
   17.35 +                flush_page_update_queue();
   17.36 +        }
   17.37 +}
   17.38 +#endif
   17.39 +
   17.40 +static int alloc_ldt(mm_context_t *pc, unsigned mincount, int reload)
   17.41 +{
   17.42 +	void *oldldt;
   17.43 +	void *newldt;
   17.44 +	unsigned oldsize;
   17.45 +
   17.46 +	if (mincount <= (unsigned)pc->size)
   17.47 +		return 0;
   17.48 +	oldsize = pc->size;
   17.49 +	mincount = (mincount+511)&(~511);
   17.50 +	if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE)
   17.51 +		newldt = vmalloc(mincount*LDT_ENTRY_SIZE);
   17.52 +	else
   17.53 +		newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL);
   17.54 +
   17.55 +	if (!newldt)
   17.56 +		return -ENOMEM;
   17.57 +
   17.58 +	if (oldsize)
   17.59 +		memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE);
   17.60 +	oldldt = pc->ldt;
   17.61 +	memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE);
   17.62 +	wmb();
   17.63 +	pc->ldt = newldt;
   17.64 +	wmb();
   17.65 +	pc->size = mincount;
   17.66 +	wmb();
   17.67 +	if (reload) {
   17.68 +#ifdef CONFIG_SMP
   17.69 +		cpumask_t mask;
   17.70 +
   17.71 +		preempt_disable();
   17.72 +#endif
   17.73 +		make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) /
   17.74 +				    PAGE_SIZE);
   17.75 +		load_LDT(pc);
   17.76 +		flush_page_update_queue();
   17.77 +#ifdef CONFIG_SMP
   17.78 +		mask = cpumask_of_cpu(smp_processor_id());
   17.79 +		if (!cpus_equal(current->mm->cpu_vm_mask, mask))
   17.80 +			smp_call_function(flush_ldt, NULL, 1, 1);
   17.81 +		preempt_enable();
   17.82 +#else
   17.83 +		load_LDT(pc);
   17.84 +#endif
   17.85 +	}
   17.86 +	if (oldsize) {
   17.87 +		make_pages_writable(oldldt, (oldsize * LDT_ENTRY_SIZE) /
   17.88 +			PAGE_SIZE);
   17.89 +		flush_page_update_queue();
   17.90 +		if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
   17.91 +			vfree(oldldt);
   17.92 +		else
   17.93 +			kfree(oldldt);
   17.94 +	}
   17.95 +	return 0;
   17.96 +}
   17.97 +
   17.98 +static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
   17.99 +{
  17.100 +	int err = alloc_ldt(new, old->size, 0);
  17.101 +	if (err < 0)
  17.102 +		return err;
  17.103 +	memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
  17.104 +	make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
  17.105 +			    PAGE_SIZE);
  17.106 +	flush_page_update_queue();
  17.107 +	return 0;
  17.108 +}
  17.109 +
  17.110 +/*
  17.111 + * we do not have to muck with descriptors here, that is
  17.112 + * done in switch_mm() as needed.
  17.113 + */
  17.114 +int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
  17.115 +{
  17.116 +	struct mm_struct * old_mm;
  17.117 +	int retval = 0;
  17.118 +
  17.119 +	init_MUTEX(&mm->context.sem);
  17.120 +	mm->context.size = 0;
  17.121 +	old_mm = current->mm;
  17.122 +	if (old_mm && old_mm->context.size > 0) {
  17.123 +		down(&old_mm->context.sem);
  17.124 +		retval = copy_ldt(&mm->context, &old_mm->context);
  17.125 +		up(&old_mm->context.sem);
  17.126 +	}
  17.127 +	return retval;
  17.128 +}
  17.129 +
  17.130 +/*
  17.131 + * 
  17.132 + * Don't touch the LDT register - we're already in the next thread.
  17.133 + */
  17.134 +void destroy_context(struct mm_struct *mm)
  17.135 +{
  17.136 +	if (mm->context.size) {
  17.137 +		if (mm == current->active_mm)
  17.138 +			clear_LDT();
  17.139 +		make_pages_writable(mm->context.ldt, 
  17.140 +				    (mm->context.size * LDT_ENTRY_SIZE) /
  17.141 +				    PAGE_SIZE);
  17.142 +		flush_page_update_queue();
  17.143 +		if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
  17.144 +			vfree(mm->context.ldt);
  17.145 +		else
  17.146 +			kfree(mm->context.ldt);
  17.147 +		mm->context.size = 0;
  17.148 +	}
  17.149 +}
  17.150 +
  17.151 +static int read_ldt(void __user * ptr, unsigned long bytecount)
  17.152 +{
  17.153 +	int err;
  17.154 +	unsigned long size;
  17.155 +	struct mm_struct * mm = current->mm;
  17.156 +
  17.157 +	if (!mm->context.size)
  17.158 +		return 0;
  17.159 +	if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES)
  17.160 +		bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES;
  17.161 +
  17.162 +	down(&mm->context.sem);
  17.163 +	size = mm->context.size*LDT_ENTRY_SIZE;
  17.164 +	if (size > bytecount)
  17.165 +		size = bytecount;
  17.166 +
  17.167 +	err = 0;
  17.168 +	if (copy_to_user(ptr, mm->context.ldt, size))
  17.169 +		err = -EFAULT;
  17.170 +	up(&mm->context.sem);
  17.171 +	if (err < 0)
  17.172 +		goto error_return;
  17.173 +	if (size != bytecount) {
  17.174 +		/* zero-fill the rest */
  17.175 +		if (clear_user(ptr+size, bytecount-size) != 0) {
  17.176 +			err = -EFAULT;
  17.177 +			goto error_return;
  17.178 +		}
  17.179 +	}
  17.180 +	return bytecount;
  17.181 +error_return:
  17.182 +	return err;
  17.183 +}
  17.184 +
  17.185 +static int read_default_ldt(void __user * ptr, unsigned long bytecount)
  17.186 +{
  17.187 +	/* Arbitrary number */ 
  17.188 +	/* x86-64 default LDT is all zeros */
  17.189 +	if (bytecount > 128) 
  17.190 +		bytecount = 128; 	
  17.191 +	if (clear_user(ptr, bytecount))
  17.192 +		return -EFAULT;
  17.193 +	return bytecount; 
  17.194 +}
  17.195 +
  17.196 +static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
  17.197 +{
  17.198 +	struct task_struct *me = current;
  17.199 +	struct mm_struct * mm = me->mm;
  17.200 +	unsigned long entry = 0, *lp;
  17.201 +	unsigned long mach_lp;
  17.202 +	int error;
  17.203 +	struct user_desc ldt_info;
  17.204 +
  17.205 +	error = -EINVAL;
  17.206 +
  17.207 +	if (bytecount != sizeof(ldt_info))
  17.208 +		goto out;
  17.209 +	error = -EFAULT; 	
  17.210 +	if (copy_from_user(&ldt_info, ptr, bytecount))
  17.211 +		goto out;
  17.212 +
  17.213 +	error = -EINVAL;
  17.214 +	if (ldt_info.entry_number >= LDT_ENTRIES)
  17.215 +		goto out;
  17.216 +	if (ldt_info.contents == 3) {
  17.217 +		if (oldmode)
  17.218 +			goto out;
  17.219 +		if (ldt_info.seg_not_present == 0)
  17.220 +			goto out;
  17.221 +	}
  17.222 +
  17.223 +	down(&mm->context.sem);
  17.224 +	if (ldt_info.entry_number >= (unsigned)mm->context.size) {
  17.225 +		error = alloc_ldt(&current->mm->context, ldt_info.entry_number+1, 1);
  17.226 +		if (error < 0)
  17.227 +			goto out_unlock;
  17.228 +	}
  17.229 +
  17.230 +	lp = (unsigned long *)((ldt_info.entry_number << 3) + (char *) mm->context.ldt);
  17.231 +	mach_lp = arbitrary_virt_to_machine(lp);
  17.232 +
  17.233 +   	/* Allow LDTs to be cleared by the user. */
  17.234 +   	if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
  17.235 +		if (oldmode || LDT_empty(&ldt_info)) {
  17.236 +                        entry = 0;
  17.237 +			goto install;
  17.238 +		}
  17.239 +	}
  17.240 +
  17.241 +#if 0
  17.242 +	entry = LDT_entry(&ldt_info);
  17.243 +#endif
  17.244 +	if (oldmode)
  17.245 +		entry &= ~(1 << 20);
  17.246 +
  17.247 +	/* Install the new entry ...  */
  17.248 +install:
  17.249 +	error = HYPERVISOR_update_descriptor(mach_lp, entry);
  17.250 +
  17.251 +out_unlock:
  17.252 +	up(&mm->context.sem);
  17.253 +out:
  17.254 +	return error;
  17.255 +}
  17.256 +
  17.257 +asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
  17.258 +{
  17.259 +	int ret = -ENOSYS;
  17.260 +
  17.261 +	switch (func) {
  17.262 +	case 0:
  17.263 +		ret = read_ldt(ptr, bytecount);
  17.264 +		break;
  17.265 +	case 1:
  17.266 +		ret = write_ldt(ptr, bytecount, 1);
  17.267 +		break;
  17.268 +	case 2:
  17.269 +		ret = read_default_ldt(ptr, bytecount);
  17.270 +		break;
  17.271 +	case 0x11:
  17.272 +		ret = write_ldt(ptr, bytecount, 0);
  17.273 +		break;
  17.274 +	}
  17.275 +	return ret;
  17.276 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c	Sat Apr 02 20:27:11 2005 +0000
    18.3 @@ -0,0 +1,284 @@
    18.4 +/*
    18.5 + * Dynamic DMA mapping support.
    18.6 + */
    18.7 +
    18.8 +#include <linux/types.h>
    18.9 +#include <linux/mm.h>
   18.10 +#include <linux/string.h>
   18.11 +#include <linux/pci.h>
   18.12 +#include <linux/module.h>
   18.13 +#include <asm/io.h>
   18.14 +#include <asm-xen/balloon.h>
   18.15 +
   18.16 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
   18.17 +#define pte_offset_kernel pte_offset
   18.18 +#define pud_t pgd_t
   18.19 +#define pud_offset(d, va) d
   18.20 +#endif
   18.21 +
   18.22 +/* Map a set of buffers described by scatterlist in streaming
   18.23 + * mode for DMA.  This is the scatter-gather version of the
   18.24 + * above pci_map_single interface.  Here the scatter gather list
   18.25 + * elements are each tagged with the appropriate dma address
   18.26 + * and length.  They are obtained via sg_dma_{address,length}(SG).
   18.27 + *
   18.28 + * NOTE: An implementation may be able to use a smaller number of
   18.29 + *       DMA address/length pairs than there are SG table elements.
   18.30 + *       (for example via virtual mapping capabilities)
   18.31 + *       The routine returns the number of addr/length pairs actually
   18.32 + *       used, at most nents.
   18.33 + *
   18.34 + * Device ownership issues as mentioned above for pci_map_single are
   18.35 + * the same here.
   18.36 + */
   18.37 +int dma_map_sg(struct device *hwdev, struct scatterlist *sg,
   18.38 +               int nents, int direction)
   18.39 +{
   18.40 +        int i;
   18.41 +
   18.42 +        BUG_ON(direction == DMA_NONE);
   18.43 +        for (i = 0; i < nents; i++ ) {
   18.44 +                struct scatterlist *s = &sg[i];
   18.45 +                BUG_ON(!s->page);
   18.46 +                s->dma_address = virt_to_bus(page_address(s->page) +s->offset);
   18.47 +                s->dma_length = s->length;
   18.48 +        }
   18.49 +        return nents;
   18.50 +}
   18.51 +
   18.52 +EXPORT_SYMBOL(dma_map_sg);
   18.53 +
   18.54 +/* Unmap a set of streaming mode DMA translations.
   18.55 + * Again, cpu read rules concerning calls here are the same as for
   18.56 + * pci_unmap_single() above.
   18.57 + */
   18.58 +void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
   18.59 +                  int nents, int dir)
   18.60 +{
   18.61 +        int i;
   18.62 +        for (i = 0; i < nents; i++) {
   18.63 +                struct scatterlist *s = &sg[i];
   18.64 +                BUG_ON(s->page == NULL);
   18.65 +                BUG_ON(s->dma_address == 0);
   18.66 +                dma_unmap_single(dev, s->dma_address, s->dma_length, dir);
   18.67 +        }
   18.68 +}
   18.69 +
   18.70 +struct dma_coherent_mem {
   18.71 +	void		*virt_base;
   18.72 +	u32		device_base;
   18.73 +	int		size;
   18.74 +	int		flags;
   18.75 +	unsigned long	*bitmap;
   18.76 +};
   18.77 +
   18.78 +static void
   18.79 +xen_contig_memory(unsigned long vstart, unsigned int order)
   18.80 +{
   18.81 +	/*
   18.82 +	 * Ensure multi-page extents are contiguous in machine memory.
   18.83 +	 * This code could be cleaned up some, and the number of
   18.84 +	 * hypercalls reduced.
   18.85 +	 */
   18.86 +	pgd_t         *pgd; 
   18.87 +	pud_t         *pud; 
   18.88 +	pmd_t         *pmd;
   18.89 +	pte_t         *pte;
   18.90 +	unsigned long  pfn, i, flags;
   18.91 +
   18.92 +	scrub_pages(vstart, 1 << order);
   18.93 +
   18.94 +        balloon_lock(flags);
   18.95 +
   18.96 +	/* 1. Zap current PTEs, giving away the underlying pages. */
   18.97 +	for (i = 0; i < (1<<order); i++) {
   18.98 +                pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
   18.99 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  18.100 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  18.101 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  18.102 +		pfn = pte->pte >> PAGE_SHIFT;
  18.103 +		queue_l1_entry_update(pte, 0);
  18.104 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  18.105 +			(u32)INVALID_P2M_ENTRY;
  18.106 +		flush_page_update_queue();
  18.107 +		if (HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
  18.108 +					  &pfn, 1, 0) != 1) BUG();
  18.109 +	}
  18.110 +	/* 2. Get a new contiguous memory extent. */
  18.111 +	if (HYPERVISOR_dom_mem_op(MEMOP_increase_reservation,
  18.112 +				  &pfn, 1, order) != 1) BUG();
  18.113 +	/* 3. Map the new extent in place of old pages. */
  18.114 +	for (i = 0; i < (1<<order); i++) {
  18.115 +		pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
  18.116 +		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
  18.117 +		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
  18.118 +		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
  18.119 +		queue_l1_entry_update(
  18.120 +			pte, ((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL);
  18.121 +		queue_machphys_update(
  18.122 +			pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
  18.123 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
  18.124 +			pfn+i;
  18.125 +	}
  18.126 +	/* Flush updates through and flush the TLB. */
  18.127 +	xen_tlb_flush();
  18.128 +
  18.129 +        balloon_unlock(flags);
  18.130 +}
  18.131 +
  18.132 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  18.133 +void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
  18.134 +			   dma_addr_t *dma_handle)
  18.135 +#else
  18.136 +void *dma_alloc_coherent(struct device *dev, size_t size,
  18.137 +			   dma_addr_t *dma_handle, unsigned gfp)
  18.138 +#endif
  18.139 +{
  18.140 +	void *ret;
  18.141 +	unsigned int order = get_order(size);
  18.142 +	unsigned long vstart;
  18.143 +
  18.144 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  18.145 +	int gfp = GFP_ATOMIC;
  18.146 +
  18.147 +	if (hwdev == NULL || ((u32)hwdev->dma_mask < 0xffffffff))
  18.148 +		gfp |= GFP_DMA;
  18.149 +#else
  18.150 +	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
  18.151 +
  18.152 +	/* ignore region specifiers */
  18.153 +	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
  18.154 +
  18.155 +	if (mem) {
  18.156 +		int page = bitmap_find_free_region(mem->bitmap, mem->size,
  18.157 +						     order);
  18.158 +		if (page >= 0) {
  18.159 +			*dma_handle = mem->device_base + (page << PAGE_SHIFT);
  18.160 +			ret = mem->virt_base + (page << PAGE_SHIFT);
  18.161 +			memset(ret, 0, size);
  18.162 +			return ret;
  18.163 +		}
  18.164 +		if (mem->flags & DMA_MEMORY_EXCLUSIVE)
  18.165 +			return NULL;
  18.166 +	}
  18.167 +
  18.168 +	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
  18.169 +		gfp |= GFP_DMA;
  18.170 +#endif
  18.171 +
  18.172 +	vstart = __get_free_pages(gfp, order);
  18.173 +	ret = (void *)vstart;
  18.174 +	if (ret == NULL)
  18.175 +		return ret;
  18.176 +
  18.177 +	xen_contig_memory(vstart, order);
  18.178 +
  18.179 +	memset(ret, 0, size);
  18.180 +	*dma_handle = virt_to_bus(ret);
  18.181 +
  18.182 +	return ret;
  18.183 +}
  18.184 +EXPORT_SYMBOL(dma_alloc_coherent);
  18.185 +
  18.186 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  18.187 +void pci_free_consistent(struct pci_dev *hwdev, size_t size,
  18.188 +			 void *vaddr, dma_addr_t dma_handle)
  18.189 +{
  18.190 +	free_pages((unsigned long)vaddr, get_order(size));
  18.191 +}
  18.192 +#else
  18.193 +
  18.194 +void dma_free_coherent(struct device *dev, size_t size,
  18.195 +			 void *vaddr, dma_addr_t dma_handle)
  18.196 +{
  18.197 +	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
  18.198 +	int order = get_order(size);
  18.199 +	
  18.200 +	if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
  18.201 +		int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
  18.202 +
  18.203 +		bitmap_release_region(mem->bitmap, page, order);
  18.204 +	} else
  18.205 +		free_pages((unsigned long)vaddr, order);
  18.206 +}
  18.207 +EXPORT_SYMBOL(dma_free_coherent);
  18.208 +
  18.209 +#if 0
  18.210 +int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
  18.211 +				dma_addr_t device_addr, size_t size, int flags)
  18.212 +{
  18.213 +	void __iomem *mem_base;
  18.214 +	int pages = size >> PAGE_SHIFT;
  18.215 +	int bitmap_size = (pages + 31)/32;
  18.216 +
  18.217 +	if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
  18.218 +		goto out;
  18.219 +	if (!size)
  18.220 +		goto out;
  18.221 +	if (dev->dma_mem)
  18.222 +		goto out;
  18.223 +
  18.224 +	/* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
  18.225 +
  18.226 +	mem_base = ioremap(bus_addr, size);
  18.227 +	if (!mem_base)
  18.228 +		goto out;
  18.229 +
  18.230 +	dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
  18.231 +	if (!dev->dma_mem)
  18.232 +		goto out;
  18.233 +	memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem));
  18.234 +	dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL);
  18.235 +	if (!dev->dma_mem->bitmap)
  18.236 +		goto free1_out;
  18.237 +	memset(dev->dma_mem->bitmap, 0, bitmap_size);
  18.238 +
  18.239 +	dev->dma_mem->virt_base = mem_base;
  18.240 +	dev->dma_mem->device_base = device_addr;
  18.241 +	dev->dma_mem->size = pages;
  18.242 +	dev->dma_mem->flags = flags;
  18.243 +
  18.244 +	if (flags & DMA_MEMORY_MAP)
  18.245 +		return DMA_MEMORY_MAP;
  18.246 +
  18.247 +	return DMA_MEMORY_IO;
  18.248 +
  18.249 + free1_out:
  18.250 +	kfree(dev->dma_mem->bitmap);
  18.251 + out:
  18.252 +	return 0;
  18.253 +}
  18.254 +EXPORT_SYMBOL(dma_declare_coherent_memory);
  18.255 +
  18.256 +void dma_release_declared_memory(struct device *dev)
  18.257 +{
  18.258 +	struct dma_coherent_mem *mem = dev->dma_mem;
  18.259 +	
  18.260 +	if(!mem)
  18.261 +		return;
  18.262 +	dev->dma_mem = NULL;
  18.263 +	iounmap(mem->virt_base);
  18.264 +	kfree(mem->bitmap);
  18.265 +	kfree(mem);
  18.266 +}
  18.267 +EXPORT_SYMBOL(dma_release_declared_memory);
  18.268 +
  18.269 +void *dma_mark_declared_memory_occupied(struct device *dev,
  18.270 +					dma_addr_t device_addr, size_t size)
  18.271 +{
  18.272 +	struct dma_coherent_mem *mem = dev->dma_mem;
  18.273 +	int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
  18.274 +	int pos, err;
  18.275 +
  18.276 +	if (!mem)
  18.277 +		return ERR_PTR(-EINVAL);
  18.278 +
  18.279 +	pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
  18.280 +	err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
  18.281 +	if (err != 0)
  18.282 +		return ERR_PTR(err);
  18.283 +	return mem->virt_base + (pos << PAGE_SHIFT);
  18.284 +}
  18.285 +EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
  18.286 +#endif
  18.287 +#endif
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-nommu.c	Sat Apr 02 20:27:11 2005 +0000
    19.3 @@ -0,0 +1,96 @@
    19.4 +/* Fallback functions when the main IOMMU code is not compiled in. This
    19.5 +   code is roughly equivalent to i386. */
    19.6 +#include <linux/mm.h>
    19.7 +#include <linux/init.h>
    19.8 +#include <linux/pci.h>
    19.9 +#include <linux/string.h>
   19.10 +#include <asm/proto.h>
   19.11 +#include <asm/processor.h>
   19.12 +
   19.13 +int iommu_merge = 0;
   19.14 +EXPORT_SYMBOL(iommu_merge);
   19.15 +
   19.16 +dma_addr_t bad_dma_address;
   19.17 +EXPORT_SYMBOL(bad_dma_address);
   19.18 +
   19.19 +int iommu_bio_merge = 0;
   19.20 +EXPORT_SYMBOL(iommu_bio_merge);
   19.21 +
   19.22 +int iommu_sac_force = 0;
   19.23 +EXPORT_SYMBOL(iommu_sac_force);
   19.24 +
   19.25 +#if 0
   19.26 +/* 
   19.27 + * Dummy IO MMU functions
   19.28 + */
   19.29 +
   19.30 +void *dma_alloc_coherent(struct device *hwdev, size_t size,
   19.31 +			 dma_addr_t *dma_handle, unsigned gfp)
   19.32 +{
   19.33 +	void *ret;
   19.34 +	u64 mask;
   19.35 +	int order = get_order(size);
   19.36 +
   19.37 +	if (hwdev)
   19.38 +		mask = hwdev->coherent_dma_mask & *hwdev->dma_mask;
   19.39 +	else
   19.40 +		mask = 0xffffffff;
   19.41 +	for (;;) {
   19.42 +		ret = (void *)__get_free_pages(gfp, order);
   19.43 +		if (ret == NULL)
   19.44 +			return NULL;
   19.45 +		*dma_handle = virt_to_bus(ret);
   19.46 +		if ((*dma_handle & ~mask) == 0)
   19.47 +			break;
   19.48 +		free_pages((unsigned long)ret, order);
   19.49 +		if (gfp & GFP_DMA)
   19.50 +			return NULL;
   19.51 +		gfp |= GFP_DMA;
   19.52 +	}
   19.53 +
   19.54 +	memset(ret, 0, size);
   19.55 +	return ret;
   19.56 +}
   19.57 +EXPORT_SYMBOL(dma_alloc_coherent);
   19.58 +
   19.59 +void dma_free_coherent(struct device *hwdev, size_t size,
   19.60 +			 void *vaddr, dma_addr_t dma_handle)
   19.61 +{
   19.62 +	free_pages((unsigned long)vaddr, get_order(size));
   19.63 +}
   19.64 +EXPORT_SYMBOL(dma_free_coherent);
   19.65 +#endif
   19.66 +
   19.67 +int dma_supported(struct device *hwdev, u64 mask)
   19.68 +{
   19.69 +        /*
   19.70 +         * we fall back to GFP_DMA when the mask isn't all 1s,
   19.71 +         * so we can't guarantee allocations that must be
   19.72 +         * within a tighter range than GFP_DMA..
   19.73 +	 * RED-PEN this won't work for pci_map_single. Caller has to
   19.74 +	 * use GFP_DMA in the first place.
   19.75 +         */
   19.76 +        if (mask < 0x00ffffff)
   19.77 +                return 0;
   19.78 +
   19.79 +	return 1;
   19.80 +} 
   19.81 +EXPORT_SYMBOL(dma_supported);
   19.82 +
   19.83 +int dma_get_cache_alignment(void)
   19.84 +{
   19.85 +	return boot_cpu_data.x86_clflush_size;
   19.86 +}
   19.87 +EXPORT_SYMBOL(dma_get_cache_alignment);
   19.88 +
   19.89 +static int __init check_ram(void) 
   19.90 +{ 
   19.91 +	if (end_pfn >= 0xffffffff>>PAGE_SHIFT) { 
   19.92 +		printk(
   19.93 +		KERN_ERR "WARNING more than 4GB of memory but IOMMU not compiled in.\n"
   19.94 +		KERN_ERR "WARNING 32bit PCI may malfunction.\n");
   19.95 +	} 
   19.96 +	return 0;
   19.97 +} 
   19.98 +__initcall(check_ram);
   19.99 +
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c	Sat Apr 02 20:27:11 2005 +0000
    20.3 @@ -0,0 +1,716 @@
    20.4 +/*
    20.5 + *  linux/arch/x86-64/kernel/process.c
    20.6 + *
    20.7 + *  Copyright (C) 1995  Linus Torvalds
    20.8 + *
    20.9 + *  Pentium III FXSR, SSE support
   20.10 + *	Gareth Hughes <gareth@valinux.com>, May 2000
   20.11 + * 
   20.12 + *  X86-64 port
   20.13 + *	Andi Kleen.
   20.14 + * 
   20.15 + *  $Id: process.c,v 1.38 2002/01/15 10:08:03 ak Exp $
   20.16 + * 
   20.17 + *  Jun Nakajima <jun.nakajima@intel.com> 
   20.18 + *     Modified for Xen
   20.19 + */
   20.20 +
   20.21 +/*
   20.22 + * This file handles the architecture-dependent parts of process handling..
   20.23 + */
   20.24 +
   20.25 +#include <stdarg.h>
   20.26 +
   20.27 +#include <linux/errno.h>
   20.28 +#include <linux/sched.h>
   20.29 +#include <linux/kernel.h>
   20.30 +#include <linux/mm.h>
   20.31 +#include <linux/elfcore.h>
   20.32 +#include <linux/smp.h>
   20.33 +#include <linux/slab.h>
   20.34 +#include <linux/user.h>
   20.35 +#include <linux/module.h>
   20.36 +#include <linux/a.out.h>
   20.37 +#include <linux/interrupt.h>
   20.38 +#include <linux/delay.h>
   20.39 +#include <linux/irq.h>
   20.40 +#include <linux/ptrace.h>
   20.41 +#include <linux/utsname.h>
   20.42 +
   20.43 +#include <asm/uaccess.h>
   20.44 +#include <asm/pgtable.h>
   20.45 +#include <asm/system.h>
   20.46 +#include <asm/io.h>
   20.47 +#include <asm/processor.h>
   20.48 +#include <asm/i387.h>
   20.49 +#include <asm/mmu_context.h>
   20.50 +#include <asm/pda.h>
   20.51 +#include <asm/prctl.h>
   20.52 +#include <asm/kdebug.h>
   20.53 +#include <asm-xen/multicall.h>
   20.54 +#include <asm-xen/xen-public/dom0_ops.h>
   20.55 +#include <asm/desc.h>
   20.56 +#include <asm/proto.h>
   20.57 +#include <asm/hardirq.h>
   20.58 +#include <asm/ia32.h>
   20.59 +
   20.60 +asmlinkage extern void ret_from_fork(void);
   20.61 +
   20.62 +unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
   20.63 +
   20.64 +atomic_t hlt_counter = ATOMIC_INIT(0);
   20.65 +
   20.66 +unsigned long boot_option_idle_override = 0;
   20.67 +EXPORT_SYMBOL(boot_option_idle_override);
   20.68 +
   20.69 +/*
   20.70 + * Powermanagement idle function, if any..
   20.71 + */
   20.72 +void (*pm_idle)(void);
   20.73 +static cpumask_t cpu_idle_map;
   20.74 +
   20.75 +void disable_hlt(void)
   20.76 +{
   20.77 +	atomic_inc(&hlt_counter);
   20.78 +}
   20.79 +
   20.80 +EXPORT_SYMBOL(disable_hlt);
   20.81 +
   20.82 +void enable_hlt(void)
   20.83 +{
   20.84 +	atomic_dec(&hlt_counter);
   20.85 +}
   20.86 +
   20.87 +EXPORT_SYMBOL(enable_hlt);
   20.88 +
   20.89 +/* XXX XEN doesn't use default_idle(), poll_idle(). Use xen_idle() instead. */
   20.90 +extern int set_timeout_timer(void);
   20.91 +void xen_idle(void)
   20.92 +{
   20.93 +	int cpu;
   20.94 +
   20.95 +	cpu = smp_processor_id();
   20.96 +	if (rcu_pending(cpu))
   20.97 +		rcu_check_callbacks(cpu, 0);
   20.98 +
   20.99 +	if (need_resched()) {
  20.100 +		local_irq_enable();
  20.101 +	} else if (set_timeout_timer() == 0) {
  20.102 +		/* NB. Blocking reenable events in a race-free manner. */
  20.103 +		HYPERVISOR_block();
  20.104 +	} else {
  20.105 +		local_irq_enable();
  20.106 +		HYPERVISOR_yield();
  20.107 +	}
  20.108 +        set_need_resched();
  20.109 +}
  20.110 +
  20.111 +/*
  20.112 + * The idle thread. There's no useful work to be
  20.113 + * done, so just try to conserve power and have a
  20.114 + * low exit latency (ie sit in a loop waiting for
  20.115 + * somebody to say that they'd like to reschedule)
  20.116 + */
  20.117 +void cpu_idle (void)
  20.118 +{
  20.119 +	int cpu = smp_processor_id();
  20.120 +
  20.121 +	/* endless idle loop with no priority at all */
  20.122 +	while (1) {
  20.123 +		while (!need_resched()) {
  20.124 +			if (cpu_isset(cpu, cpu_idle_map))
  20.125 +				cpu_clear(cpu, cpu_idle_map);
  20.126 +			rmb();
  20.127 +                        
  20.128 +                        __IRQ_STAT(cpu,idle_timestamp) = jiffies;
  20.129 +			xen_idle();
  20.130 +		}
  20.131 +		schedule();
  20.132 +	}
  20.133 +}
  20.134 +
  20.135 +/* XXX XEN doesn't use mwait_idle(), select_idle_routine(), idle_setup(). */
  20.136 +/* Always use xen_idle() instead. */
  20.137 +void __init select_idle_routine(const struct cpuinfo_x86 *c) {}
  20.138 +
  20.139 +/* Prints also some state that isn't saved in the pt_regs */ 
  20.140 +void __show_regs(struct pt_regs * regs)
  20.141 +{
  20.142 +	unsigned long fs, gs, shadowgs;
  20.143 +	unsigned int fsindex,gsindex;
  20.144 +	unsigned int ds,cs,es; 
  20.145 +
  20.146 +	printk("\n");
  20.147 +	print_modules();
  20.148 +	printk("Pid: %d, comm: %.20s %s %s\n", 
  20.149 +	       current->pid, current->comm, print_tainted(), system_utsname.release);
  20.150 +	printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
  20.151 +	printk_address(regs->rip); 
  20.152 +	printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags);
  20.153 +	printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
  20.154 +	       regs->rax, regs->rbx, regs->rcx);
  20.155 +	printk("RDX: %016lx RSI: %016lx RDI: %016lx\n",
  20.156 +	       regs->rdx, regs->rsi, regs->rdi); 
  20.157 +	printk("RBP: %016lx R08: %016lx R09: %016lx\n",
  20.158 +	       regs->rbp, regs->r8, regs->r9); 
  20.159 +	printk("R10: %016lx R11: %016lx R12: %016lx\n",
  20.160 +	       regs->r10, regs->r11, regs->r12); 
  20.161 +	printk("R13: %016lx R14: %016lx R15: %016lx\n",
  20.162 +	       regs->r13, regs->r14, regs->r15); 
  20.163 +
  20.164 +	asm("movl %%ds,%0" : "=r" (ds)); 
  20.165 +	asm("movl %%cs,%0" : "=r" (cs)); 
  20.166 +	asm("movl %%es,%0" : "=r" (es)); 
  20.167 +	asm("movl %%fs,%0" : "=r" (fsindex));
  20.168 +	asm("movl %%gs,%0" : "=r" (gsindex));
  20.169 +
  20.170 +	rdmsrl(MSR_FS_BASE, fs);
  20.171 +	rdmsrl(MSR_GS_BASE, gs); 
  20.172 +	rdmsrl(MSR_KERNEL_GS_BASE, shadowgs); 
  20.173 +
  20.174 +	printk("FS:  %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", 
  20.175 +	       fs,fsindex,gs,gsindex,shadowgs); 
  20.176 +	printk("CS:  %04x DS: %04x ES: %04x\n", cs, ds, es); 
  20.177 +
  20.178 +}
  20.179 +
  20.180 +void show_regs(struct pt_regs *regs)
  20.181 +{
  20.182 +	__show_regs(regs);
  20.183 +	show_trace(&regs->rsp);
  20.184 +}
  20.185 +
  20.186 +/*
  20.187 + * Free current thread data structures etc..
  20.188 + */
  20.189 +void exit_thread(void)
  20.190 +{
  20.191 +	struct task_struct *me = current;
  20.192 +	struct thread_struct *t = &me->thread;
  20.193 +	if (me->thread.io_bitmap_ptr) { 
  20.194 +		struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
  20.195 +
  20.196 +		kfree(t->io_bitmap_ptr);
  20.197 +		t->io_bitmap_ptr = NULL;
  20.198 +		/*
  20.199 +		 * Careful, clear this in the TSS too:
  20.200 +		 */
  20.201 +		memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
  20.202 +		t->io_bitmap_max = 0;
  20.203 +		put_cpu();
  20.204 +	}
  20.205 +}
  20.206 +
  20.207 +void load_gs_index(unsigned gs)
  20.208 +{
  20.209 +    __load_gs_index(gs);
  20.210 +}
  20.211 +
  20.212 +void flush_thread(void)
  20.213 +{
  20.214 +	struct task_struct *tsk = current;
  20.215 +	struct thread_info *t = current_thread_info();
  20.216 +
  20.217 +	if (t->flags & _TIF_ABI_PENDING)
  20.218 +		t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
  20.219 +
  20.220 +	tsk->thread.debugreg0 = 0;
  20.221 +	tsk->thread.debugreg1 = 0;
  20.222 +	tsk->thread.debugreg2 = 0;
  20.223 +	tsk->thread.debugreg3 = 0;
  20.224 +	tsk->thread.debugreg6 = 0;
  20.225 +	tsk->thread.debugreg7 = 0;
  20.226 +	memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));	
  20.227 +	/*
  20.228 +	 * Forget coprocessor state..
  20.229 +	 */
  20.230 +	clear_fpu(tsk);
  20.231 +	clear_used_math();
  20.232 +}
  20.233 +
  20.234 +void release_thread(struct task_struct *dead_task)
  20.235 +{
  20.236 +	if (dead_task->mm) {
  20.237 +		if (dead_task->mm->context.size) {
  20.238 +			printk("WARNING: dead process %8s still has LDT? <%p/%d>\n",
  20.239 +					dead_task->comm,
  20.240 +					dead_task->mm->context.ldt,
  20.241 +					dead_task->mm->context.size);
  20.242 +			BUG();
  20.243 +		}
  20.244 +	}
  20.245 +}
  20.246 +
  20.247 +static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)
  20.248 +{
  20.249 +	struct user_desc ud = { 
  20.250 +		.base_addr = addr,
  20.251 +		.limit = 0xfffff,
  20.252 +		.seg_32bit = 1,
  20.253 +		.limit_in_pages = 1,
  20.254 +		.useable = 1,
  20.255 +	};
  20.256 +	struct n_desc_struct *desc = (void *)t->thread.tls_array;
  20.257 +	desc += tls;
  20.258 +	desc->a = LDT_entry_a(&ud); 
  20.259 +	desc->b = LDT_entry_b(&ud); 
  20.260 +}
  20.261 +
  20.262 +static inline u32 read_32bit_tls(struct task_struct *t, int tls)
  20.263 +{
  20.264 +	struct desc_struct *desc = (void *)t->thread.tls_array;
  20.265 +	desc += tls;
  20.266 +	return desc->base0 | 
  20.267 +		(((u32)desc->base1) << 16) | 
  20.268 +		(((u32)desc->base2) << 24);
  20.269 +}
  20.270 +
  20.271 +/*
  20.272 + * This gets called before we allocate a new thread and copy
  20.273 + * the current task into it.
  20.274 + */
  20.275 +void prepare_to_copy(struct task_struct *tsk)
  20.276 +{
  20.277 +	unlazy_fpu(tsk);
  20.278 +}
  20.279 +
  20.280 +int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, 
  20.281 +		unsigned long unused,
  20.282 +	struct task_struct * p, struct pt_regs * regs)
  20.283 +{
  20.284 +	int err;
  20.285 +	struct pt_regs * childregs;
  20.286 +	struct task_struct *me = current;
  20.287 +
  20.288 +	childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
  20.289 +
  20.290 +	*childregs = *regs;
  20.291 +
  20.292 +	childregs->rax = 0;
  20.293 +	childregs->rsp = rsp;
  20.294 +	if (rsp == ~0UL) {
  20.295 +		childregs->rsp = (unsigned long)childregs;
  20.296 +	}
  20.297 +
  20.298 +	p->thread.rsp = (unsigned long) childregs;
  20.299 +	p->thread.rsp0 = (unsigned long) (childregs+1);
  20.300 +	p->thread.userrsp = me->thread.userrsp; 
  20.301 +
  20.302 +	set_ti_thread_flag(p->thread_info, TIF_FORK);
  20.303 +
  20.304 +	p->thread.fs = me->thread.fs;
  20.305 +	p->thread.gs = me->thread.gs;
  20.306 +
  20.307 +	asm("movl %%gs,%0" : "=m" (p->thread.gsindex));
  20.308 +	asm("movl %%fs,%0" : "=m" (p->thread.fsindex));
  20.309 +	asm("movl %%es,%0" : "=m" (p->thread.es));
  20.310 +	asm("movl %%ds,%0" : "=m" (p->thread.ds));
  20.311 +
  20.312 +	if (unlikely(me->thread.io_bitmap_ptr != NULL)) { 
  20.313 +		p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
  20.314 +		if (!p->thread.io_bitmap_ptr) {
  20.315 +			p->thread.io_bitmap_max = 0;
  20.316 +			return -ENOMEM;
  20.317 +		}
  20.318 +		memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr, IO_BITMAP_BYTES);
  20.319 +	} 
  20.320 +
  20.321 +	/*
  20.322 +	 * Set a new TLS for the child thread?
  20.323 +	 */
  20.324 +	if (clone_flags & CLONE_SETTLS) {
  20.325 +#ifdef CONFIG_IA32_EMULATION
  20.326 +		if (test_thread_flag(TIF_IA32))
  20.327 +			err = ia32_child_tls(p, childregs); 
  20.328 +		else 			
  20.329 +#endif	 
  20.330 +			err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); 
  20.331 +		if (err) 
  20.332 +			goto out;
  20.333 +	}
  20.334 +        p->thread.io_pl = current->thread.io_pl;
  20.335 +
  20.336 +	err = 0;
  20.337 +out:
  20.338 +	if (err && p->thread.io_bitmap_ptr) {
  20.339 +		kfree(p->thread.io_bitmap_ptr);
  20.340 +		p->thread.io_bitmap_max = 0;
  20.341 +	}
  20.342 +	return err;
  20.343 +}
  20.344 +
  20.345 +/*
  20.346 + * This special macro can be used to load a debugging register
  20.347 + */
  20.348 +#define loaddebug(thread,register) \
  20.349 +		HYPERVISOR_set_debugreg((register),	\
  20.350 +			(thread->debugreg ## register))
  20.351 +
  20.352 +/*
  20.353 + *	switch_to(x,y) should switch tasks from x to y.
  20.354 + *
  20.355 + * This could still be optimized: 
  20.356 + * - fold all the options into a flag word and test it with a single test.
  20.357 + * - could test fs/gs bitsliced
  20.358 + */
  20.359 +struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
  20.360 +{
  20.361 +	struct thread_struct *prev = &prev_p->thread,
  20.362 +				 *next = &next_p->thread;
  20.363 +	int cpu = smp_processor_id();  
  20.364 +	struct tss_struct *tss = &per_cpu(init_tss, cpu);
  20.365 +        dom0_op_t op;
  20.366 +
  20.367 +        /* NB. No need to disable interrupts as already done in sched.c */
  20.368 +        /* __cli(); */
  20.369 +
  20.370 +//	MULTICALL_flush_page_update_queue();
  20.371 +
  20.372 +	/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
  20.373 +
  20.374 +	/*
  20.375 +	 * This is basically '__unlazy_fpu', except that we queue a
  20.376 +	 * multicall to indicate FPU task switch, rather than
  20.377 +	 * synchronously trapping to Xen.
  20.378 +	 */
  20.379 +	if (prev_p->thread_info->status & TS_USEDFPU) {
  20.380 +		save_init_fpu(prev_p);
  20.381 +		queue_multicall0(__HYPERVISOR_fpu_taskswitch);
  20.382 +	}
  20.383 +
  20.384 +	/*
  20.385 +	 * Reload esp0, LDT and the page table pointer:
  20.386 +	 */
  20.387 +	tss->rsp0 = next->rsp0;
  20.388 +//	queue_multicall1(__HYPERVISOR_stack_switch, tss->rsp0);
  20.389 +	HYPERVISOR_stack_switch(__KERNEL_DS, tss->rsp0);
  20.390 +
  20.391 +	/*
  20.392 +	 * Load the per-thread Thread-Local Storage descriptor.
  20.393 +	 * This is load_TLS(next, cpu) with multicalls.
  20.394 +	 */
  20.395 +#define C(i) do {							\
  20.396 +          if (unlikely(next->tls_array[i] != prev->tls_array[i]))       \
  20.397 +            queue_multicall2(__HYPERVISOR_update_descriptor,            \
  20.398 +                             virt_to_machine(&get_cpu_gdt_table(cpu)    \
  20.399 +                                             [GDT_ENTRY_TLS_MIN + i]),  \
  20.400 +                             (unsigned long) &next->tls_array[i]);      \
  20.401 +} while (0)
  20.402 +	C(0); C(1); C(2);
  20.403 +#undef C
  20.404 +
  20.405 +	if (xen_start_info.flags & SIF_PRIVILEGED) {
  20.406 +		op.cmd           = DOM0_IOPL;
  20.407 +		op.u.iopl.domain = DOMID_SELF;
  20.408 +		op.u.iopl.iopl   = next->io_pl;
  20.409 +		op.interface_version = DOM0_INTERFACE_VERSION;
  20.410 +		HYPERVISOR_dom0_op(&op);
  20.411 +#if 0
  20.412 +		queue_multicall1(__HYPERVISOR_dom0_op, (unsigned long)&op);
  20.413 +#endif
  20.414 +	}
  20.415 +
  20.416 +	/* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
  20.417 +//	execute_multicall_list();
  20.418 +        /* __sti(); */
  20.419 +
  20.420 +	/* 
  20.421 +	 * Switch DS and ES.
  20.422 +	 * This won't pick up thread selector changes, but I guess that is ok.
  20.423 +	 */
  20.424 +	asm volatile("movl %%es,%0" : "=m" (prev->es)); 
  20.425 +	if (unlikely(next->es | prev->es))
  20.426 +		loadsegment(es, next->es); 
  20.427 +	
  20.428 +	asm volatile ("movl %%ds,%0" : "=m" (prev->ds)); 
  20.429 +	if (unlikely(next->ds | prev->ds))
  20.430 +		loadsegment(ds, next->ds);
  20.431 +
  20.432 +	/* 
  20.433 +	 * Switch FS and GS.
  20.434 +	 */
  20.435 +	{ 
  20.436 +		unsigned fsindex;
  20.437 +		asm volatile("movl %%fs,%0" : "=g" (fsindex)); 
  20.438 +		/* segment register != 0 always requires a reload. 
  20.439 +		   also reload when it has changed. 
  20.440 +		   when prev process used 64bit base always reload
  20.441 +		   to avoid an information leak. */
  20.442 +		if (unlikely(fsindex | next->fsindex | prev->fs)) {
  20.443 +			loadsegment(fs, next->fsindex);
  20.444 +			/* check if the user used a selector != 0
  20.445 +	                 * if yes clear 64bit base, since overloaded base
  20.446 +                         * is always mapped to the Null selector
  20.447 +                         */
  20.448 +			if (fsindex)
  20.449 +			prev->fs = 0;				
  20.450 +		}
  20.451 +		/* when next process has a 64bit base use it */
  20.452 +		if (next->fs) {
  20.453 +                        HYPERVISOR_set_segment_base(SEGBASE_FS, next->fs); 
  20.454 +                }
  20.455 +		prev->fsindex = fsindex;
  20.456 +	}
  20.457 +	{ 
  20.458 +		unsigned gsindex;
  20.459 +		asm volatile("movl %%gs,%0" : "=g" (gsindex)); 
  20.460 +		if (unlikely(gsindex | next->gsindex | prev->gs)) {
  20.461 +			load_gs_index(next->gsindex);
  20.462 +			if (gsindex)
  20.463 +			prev->gs = 0;				
  20.464 +		}
  20.465 +		if (next->gs)
  20.466 +                    HYPERVISOR_set_segment_base(SEGBASE_GS_USER, next->gs); 
  20.467 +		prev->gsindex = gsindex;
  20.468 +	}
  20.469 +
  20.470 +	/* 
  20.471 +	 * Switch the PDA context.
  20.472 +	 */
  20.473 +	prev->userrsp = read_pda(oldrsp); 
  20.474 +	write_pda(oldrsp, next->userrsp); 
  20.475 +	write_pda(pcurrent, next_p); 
  20.476 +	write_pda(kernelstack, (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET);
  20.477 +
  20.478 +	/*
  20.479 +	 * Now maybe reload the debug registers
  20.480 +	 */
  20.481 +	if (unlikely(next->debugreg7)) {
  20.482 +		loaddebug(next, 0);
  20.483 +		loaddebug(next, 1);
  20.484 +		loaddebug(next, 2);
  20.485 +		loaddebug(next, 3);
  20.486 +		/* no 4 and 5 */
  20.487 +		loaddebug(next, 6);
  20.488 +		loaddebug(next, 7);
  20.489 +	}
  20.490 +
  20.491 +	/* 
  20.492 +	 * Handle the IO bitmap 
  20.493 +	 */ 
  20.494 +	if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) {
  20.495 +		if (next->io_bitmap_ptr)
  20.496 +			/*
  20.497 +			 * Copy the relevant range of the IO bitmap.
  20.498 +			 * Normally this is 128 bytes or less:
  20.499 + 			 */
  20.500 +			memcpy(tss->io_bitmap, next->io_bitmap_ptr,
  20.501 +				max(prev->io_bitmap_max, next->io_bitmap_max));
  20.502 +		else {
  20.503 +			/*
  20.504 +			 * Clear any possible leftover bits:
  20.505 +			 */
  20.506 +			memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
  20.507 +		}
  20.508 +	}
  20.509 +
  20.510 +	return prev_p;
  20.511 +}
  20.512 +
  20.513 +/*
  20.514 + * sys_execve() executes a new program.
  20.515 + */
  20.516 +asmlinkage 
  20.517 +long sys_execve(char __user *name, char __user * __user *argv,
  20.518 +		char __user * __user *envp, struct pt_regs regs)
  20.519 +{
  20.520 +	long error;
  20.521 +	char * filename;
  20.522 +
  20.523 +	filename = getname(name);
  20.524 +	error = PTR_ERR(filename);
  20.525 +	if (IS_ERR(filename)) 
  20.526 +		return error;
  20.527 +	error = do_execve(filename, argv, envp, &regs); 
  20.528 +	if (error == 0) {
  20.529 +		task_lock(current);
  20.530 +		current->ptrace &= ~PT_DTRACE;
  20.531 +		task_unlock(current);
  20.532 +	}
  20.533 +	putname(filename);
  20.534 +	return error;
  20.535 +}
  20.536 +
  20.537 +void set_personality_64bit(void)
  20.538 +{
  20.539 +	/* inherit personality from parent */
  20.540 +
  20.541 +	/* Make sure to be in 64bit mode */
  20.542 +	clear_thread_flag(TIF_IA32); 
  20.543 +
  20.544 +	/* TBD: overwrites user setup. Should have two bits.
  20.545 +	   But 64bit processes have always behaved this way,
  20.546 +	   so it's not too bad. The main problem is just that
  20.547 +   	   32bit childs are affected again. */
  20.548 +	current->personality &= ~READ_IMPLIES_EXEC;
  20.549 +}
  20.550 +
  20.551 +asmlinkage long sys_fork(struct pt_regs *regs)
  20.552 +{
  20.553 +	return do_fork(SIGCHLD, regs->rsp, regs, 0, NULL, NULL);
  20.554 +}
  20.555 +
  20.556 +asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
  20.557 +{
  20.558 +	if (!newsp)
  20.559 +		newsp = regs->rsp;
  20.560 +	return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
  20.561 +}
  20.562 +
  20.563 +/*
  20.564 + * This is trivial, and on the face of it looks like it
  20.565 + * could equally well be done in user mode.
  20.566 + *
  20.567 + * Not so, for quite unobvious reasons - register pressure.
  20.568 + * In user mode vfork() cannot have a stack frame, and if
  20.569 + * done by calling the "clone()" system call directly, you
  20.570 + * do not have enough call-clobbered registers to hold all
  20.571 + * the information you need.
  20.572 + */
  20.573 +asmlinkage long sys_vfork(struct pt_regs *regs)
  20.574 +{
  20.575 +	return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->rsp, regs, 0,
  20.576 +		    NULL, NULL);
  20.577 +}
  20.578 +
  20.579 +unsigned long get_wchan(struct task_struct *p)
  20.580 +{
  20.581 +	unsigned long stack;
  20.582 +	u64 fp,rip;
  20.583 +	int count = 0;
  20.584 +
  20.585 +	if (!p || p == current || p->state==TASK_RUNNING)
  20.586 +		return 0; 
  20.587 +	stack = (unsigned long)p->thread_info; 
  20.588 +	if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE)
  20.589 +		return 0;
  20.590 +	fp = *(u64 *)(p->thread.rsp);
  20.591 +	do { 
  20.592 +		if (fp < (unsigned long)stack || fp > (unsigned long)stack+THREAD_SIZE)
  20.593 +			return 0; 
  20.594 +		rip = *(u64 *)(fp+8); 
  20.595 +		if (!in_sched_functions(rip))
  20.596 +			return rip; 
  20.597 +		fp = *(u64 *)fp; 
  20.598 +	} while (count++ < 16); 
  20.599 +	return 0;
  20.600 +}
  20.601 +
  20.602 +long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
  20.603 +{ 
  20.604 +	int ret = 0; 
  20.605 +	int doit = task == current;
  20.606 +	int cpu;
  20.607 +
  20.608 +	switch (code) { 
  20.609 +	case ARCH_SET_GS:
  20.610 +		if (addr >= TASK_SIZE) 
  20.611 +			return -EPERM; 
  20.612 +		cpu = get_cpu();
  20.613 +		/* handle small bases via the GDT because that's faster to 
  20.614 +		   switch. */
  20.615 +		if (addr <= 0xffffffff) {  
  20.616 +			set_32bit_tls(task, GS_TLS, addr); 
  20.617 +			if (doit) { 
  20.618 +				load_TLS(&task->thread, cpu);
  20.619 +				load_gs_index(GS_TLS_SEL); 
  20.620 +			}
  20.621 +			task->thread.gsindex = GS_TLS_SEL; 
  20.622 +			task->thread.gs = 0;
  20.623 +		} else { 
  20.624 +			task->thread.gsindex = 0;
  20.625 +			task->thread.gs = addr;
  20.626 +			if (doit) {
  20.627 +		load_gs_index(0);
  20.628 +                ret = HYPERVISOR_set_segment_base(SEGBASE_GS_USER, addr);
  20.629 +                printk("do_arch_prctl: SET_SET: addr = %lx\n", addr);
  20.630 +			} 
  20.631 +		}
  20.632 +		put_cpu();
  20.633 +		break;
  20.634 +	case ARCH_SET_FS:
  20.635 +		/* Not strictly needed for fs, but do it for symmetry
  20.636 +		   with gs */
  20.637 +		if (addr >= TASK_SIZE)
  20.638 +			return -EPERM; 
  20.639 +		cpu = get_cpu();
  20.640 +		/* handle small bases via the GDT because that's faster to 
  20.641 +		   switch. */
  20.642 +		if (addr <= 0xffffffff) { 
  20.643 +			set_32bit_tls(task, FS_TLS, addr);
  20.644 +			if (doit) { 
  20.645 +				load_TLS(&task->thread, cpu); 
  20.646 +				asm volatile("movl %0,%%fs" :: "r" (FS_TLS_SEL));
  20.647 +			}
  20.648 +			task->thread.fsindex = FS_TLS_SEL;
  20.649 +			task->thread.fs = 0;
  20.650 +		} else { 
  20.651 +			task->thread.fsindex = 0;
  20.652 +			task->thread.fs = addr;
  20.653 +			if (doit) {
  20.654 +				/* set the selector to 0 to not confuse
  20.655 +				   __switch_to */
  20.656 +                                asm volatile("movl %0,%%fs" :: "r" (0));
  20.657 +                                ret = HYPERVISOR_set_segment_base(SEGBASE_FS, addr);
  20.658 +
  20.659 +			}
  20.660 +		}
  20.661 +		put_cpu();
  20.662 +		break;
  20.663 +	case ARCH_GET_FS: { 
  20.664 +		unsigned long base; 
  20.665 +		if (task->thread.fsindex == FS_TLS_SEL)
  20.666 +			base = read_32bit_tls(task, FS_TLS);
  20.667 +		else if (doit) {
  20.668 +			rdmsrl(MSR_FS_BASE, base);
  20.669 +                        printk("do_arch_prctl: GET_FS: addr = %lx\n", addr);
  20.670 +		} else
  20.671 +			base = task->thread.fs;
  20.672 +		ret = put_user(base, (unsigned long __user *)addr); 
  20.673 +		break; 
  20.674 +	}
  20.675 +	case ARCH_GET_GS: { 
  20.676 +		unsigned long base;
  20.677 +		if (task->thread.gsindex == GS_TLS_SEL)
  20.678 +			base = read_32bit_tls(task, GS_TLS);
  20.679 +		else if (doit) {
  20.680 +			rdmsrl(MSR_KERNEL_GS_BASE, base);
  20.681 +                        printk("do_arch_prctl: GET_GS: addr = %lx\n", addr);
  20.682 +		} else
  20.683 +			base = task->thread.gs;
  20.684 +		ret = put_user(base, (unsigned long __user *)addr); 
  20.685 +		break;
  20.686 +	}
  20.687 +
  20.688 +	default:
  20.689 +		ret = -EINVAL;
  20.690 +		break;
  20.691 +	} 
  20.692 +
  20.693 +	return ret;	
  20.694 +} 
  20.695 +
  20.696 +long sys_arch_prctl(int code, unsigned long addr)
  20.697 +{
  20.698 +	return do_arch_prctl(current, code, addr);
  20.699 +} 
  20.700 +
  20.701 +/* 
  20.702 + * Capture the user space registers if the task is not running (in user space)
  20.703 + */
  20.704 +int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
  20.705 +{
  20.706 +	struct pt_regs *pp, ptregs;
  20.707 +
  20.708 +	pp = (struct pt_regs *)(tsk->thread.rsp0);
  20.709 +	--pp; 
  20.710 +
  20.711 +	ptregs = *pp; 
  20.712 +	ptregs.cs &= 0xffff;
  20.713 +	ptregs.ss &= 0xffff;
  20.714 +
  20.715 +	elf_core_copy_regs(regs, &ptregs);
  20.716 +        
  20.717 +        boot_option_idle_override = 1;
  20.718 +	return 1;
  20.719 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup.c	Sat Apr 02 20:27:11 2005 +0000
    21.3 @@ -0,0 +1,1384 @@
    21.4 +/*
    21.5 + *  linux/arch/x86-64/kernel/setup.c
    21.6 + *
    21.7 + *  Copyright (C) 1995  Linus Torvalds
    21.8 + *
    21.9 + *  Nov 2001 Dave Jones <davej@suse.de>
   21.10 + *  Forked from i386 setup code.
   21.11 + *
   21.12 + *  $Id$
   21.13 + */
   21.14 +
   21.15 +/*
   21.16 + * This file handles the architecture-dependent parts of initialization
   21.17 + */
   21.18 +
   21.19 +#include <linux/errno.h>
   21.20 +#include <linux/sched.h>
   21.21 +#include <linux/kernel.h>
   21.22 +#include <linux/mm.h>
   21.23 +#include <linux/stddef.h>
   21.24 +#include <linux/unistd.h>
   21.25 +#include <linux/ptrace.h>
   21.26 +#include <linux/slab.h>
   21.27 +#include <linux/user.h>
   21.28 +#include <linux/a.out.h>
   21.29 +#include <linux/tty.h>
   21.30 +#include <linux/ioport.h>
   21.31 +#include <linux/delay.h>
   21.32 +#include <linux/config.h>
   21.33 +#include <linux/init.h>
   21.34 +#include <linux/initrd.h>
   21.35 +#include <linux/highmem.h>
   21.36 +#include <linux/bootmem.h>
   21.37 +#include <linux/module.h>
   21.38 +#include <asm/processor.h>
   21.39 +#include <linux/console.h>
   21.40 +#include <linux/seq_file.h>
   21.41 +#include <linux/root_dev.h>
   21.42 +#include <linux/pci.h>
   21.43 +#include <linux/acpi.h>
   21.44 +#include <linux/kallsyms.h>
   21.45 +#include <linux/edd.h>
   21.46 +#include <linux/percpu.h>
   21.47 +#include <asm/mtrr.h>
   21.48 +#include <asm/uaccess.h>
   21.49 +#include <asm/system.h>
   21.50 +#include <asm/io.h>
   21.51 +#include <asm/smp.h>
   21.52 +#include <asm/msr.h>
   21.53 +#include <asm/desc.h>
   21.54 +#include <video/edid.h>
   21.55 +#include <asm/e820.h>
   21.56 +#include <asm/dma.h>
   21.57 +#include <asm/mpspec.h>
   21.58 +#include <asm/mmu_context.h>
   21.59 +#include <asm/bootsetup.h>
   21.60 +#include <asm/proto.h>
   21.61 +#include <asm/setup.h>
   21.62 +#include <asm/mach_apic.h>
   21.63 +#include <asm/numa.h>
   21.64 +
   21.65 +#include "setup_arch_pre.h"
   21.66 +#include <asm-xen/hypervisor.h>
   21.67 +
   21.68 +#define PFN_UP(x)       (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
   21.69 +#define PFN_PHYS(x)     ((x) << PAGE_SHIFT)
   21.70 +
   21.71 +#include <asm/mach-xen/setup_arch_post.h>
   21.72 +
   21.73 +extern unsigned long start_pfn;
   21.74 +
   21.75 +#if 0
   21.76 +struct edid_info {
   21.77 +        unsigned char dummy[128];
   21.78 +};
   21.79 +#endif
   21.80 +
   21.81 +extern struct edid_info edid_info;
   21.82 +
   21.83 +/* Allows setting of maximum possible memory size  */
   21.84 +unsigned long xen_override_max_pfn;
   21.85 +/*
   21.86 + * Machine setup..
   21.87 + */
   21.88 +
   21.89 +struct cpuinfo_x86 boot_cpu_data;
   21.90 +
   21.91 +
   21.92 +unsigned long mmu_cr4_features;
   21.93 +EXPORT_SYMBOL_GPL(mmu_cr4_features);
   21.94 +
   21.95 +int acpi_disabled;
   21.96 +EXPORT_SYMBOL(acpi_disabled);
   21.97 +#ifdef	CONFIG_ACPI_BOOT
   21.98 +extern int __initdata acpi_ht;
   21.99 +extern acpi_interrupt_flags	acpi_sci_flags;
  21.100 +int __initdata acpi_force = 0;
  21.101 +#endif
  21.102 +
  21.103 +int acpi_numa __initdata;
  21.104 +
  21.105 +/* For PCI or other memory-mapped resources */
  21.106 +unsigned long pci_mem_start = 0x10000000;
  21.107 +
  21.108 +/* Boot loader ID as an integer, for the benefit of proc_dointvec */
  21.109 +int bootloader_type;
  21.110 +
  21.111 +unsigned long saved_video_mode;
  21.112 +
  21.113 +#ifdef CONFIG_SWIOTLB
  21.114 +int swiotlb;
  21.115 +EXPORT_SYMBOL(swiotlb);
  21.116 +#endif
  21.117 +
  21.118 +/*
  21.119 + * Setup options
  21.120 + */
  21.121 +struct drive_info_struct { char dummy[32]; } drive_info;
  21.122 +struct screen_info screen_info;
  21.123 +struct sys_desc_table_struct {
  21.124 +	unsigned short length;
  21.125 +	unsigned char table[0];
  21.126 +};
  21.127 +
  21.128 +struct edid_info edid_info;
  21.129 +struct e820map e820;
  21.130 +
  21.131 +unsigned char aux_device_present;
  21.132 +
  21.133 +extern int root_mountflags;
  21.134 +extern char _text, _etext, _edata, _end;
  21.135 +
  21.136 +char command_line[COMMAND_LINE_SIZE];
  21.137 +
  21.138 +struct resource standard_io_resources[] = {
  21.139 +	{ .name = "dma1", .start = 0x00, .end = 0x1f,
  21.140 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.141 +	{ .name = "pic1", .start = 0x20, .end = 0x21,
  21.142 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.143 +	{ .name = "timer0", .start = 0x40, .end = 0x43,
  21.144 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.145 +	{ .name = "timer1", .start = 0x50, .end = 0x53,
  21.146 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.147 +	{ .name = "keyboard", .start = 0x60, .end = 0x6f,
  21.148 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.149 +	{ .name = "dma page reg", .start = 0x80, .end = 0x8f,
  21.150 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.151 +	{ .name = "pic2", .start = 0xa0, .end = 0xa1,
  21.152 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.153 +	{ .name = "dma2", .start = 0xc0, .end = 0xdf,
  21.154 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO },
  21.155 +	{ .name = "fpu", .start = 0xf0, .end = 0xff,
  21.156 +		.flags = IORESOURCE_BUSY | IORESOURCE_IO }
  21.157 +};
  21.158 +
  21.159 +#define STANDARD_IO_RESOURCES \
  21.160 +	(sizeof standard_io_resources / sizeof standard_io_resources[0])
  21.161 +
  21.162 +#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
  21.163 +
  21.164 +struct resource data_resource = {
  21.165 +	.name = "Kernel data",
  21.166 +	.start = 0,
  21.167 +	.end = 0,
  21.168 +	.flags = IORESOURCE_RAM,
  21.169 +};
  21.170 +struct resource code_resource = {
  21.171 +	.name = "Kernel code",
  21.172 +	.start = 0,
  21.173 +	.end = 0,
  21.174 +	.flags = IORESOURCE_RAM,
  21.175 +};
  21.176 +
  21.177 +#define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM)
  21.178 +
  21.179 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  21.180 +static struct resource system_rom_resource = {
  21.181 +	.name = "System ROM",
  21.182 +	.start = 0xf0000,
  21.183 +	.end = 0xfffff,
  21.184 +	.flags = IORESOURCE_ROM,
  21.185 +};
  21.186 +
  21.187 +static struct resource extension_rom_resource = {
  21.188 +	.name = "Extension ROM",
  21.189 +	.start = 0xe0000,
  21.190 +	.end = 0xeffff,
  21.191 +	.flags = IORESOURCE_ROM,
  21.192 +};
  21.193 +
  21.194 +static struct resource adapter_rom_resources[] = {
  21.195 +	{ .name = "Adapter ROM", .start = 0xc8000, .end = 0,
  21.196 +		.flags = IORESOURCE_ROM },
  21.197 +	{ .name = "Adapter ROM", .start = 0, .end = 0,
  21.198 +		.flags = IORESOURCE_ROM },
  21.199 +	{ .name = "Adapter ROM", .start = 0, .end = 0,
  21.200 +		.flags = IORESOURCE_ROM },
  21.201 +	{ .name = "Adapter ROM", .start = 0, .end = 0,
  21.202 +		.flags = IORESOURCE_ROM },
  21.203 +	{ .name = "Adapter ROM", .start = 0, .end = 0,
  21.204 +		.flags = IORESOURCE_ROM },
  21.205 +	{ .name = "Adapter ROM", .start = 0, .end = 0,
  21.206 +		.flags = IORESOURCE_ROM }
  21.207 +};
  21.208 +#endif
  21.209 +
  21.210 +#define ADAPTER_ROM_RESOURCES \
  21.211 +	(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
  21.212 +
  21.213 +static struct resource video_rom_resource = {
  21.214 +	.name = "Video ROM",
  21.215 +	.start = 0xc0000,
  21.216 +	.end = 0xc7fff,
  21.217 +	.flags = IORESOURCE_ROM,
  21.218 +};
  21.219 +
  21.220 +static struct resource video_ram_resource = {
  21.221 +	.name = "Video RAM area",
  21.222 +	.start = 0xa0000,
  21.223 +	.end = 0xbffff,
  21.224 +	.flags = IORESOURCE_RAM,
  21.225 +};
  21.226 +
  21.227 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  21.228 +#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
  21.229 +
  21.230 +static int __init romchecksum(unsigned char *rom, unsigned long length)
  21.231 +{
  21.232 +	unsigned char *p, sum = 0;
  21.233 +
  21.234 +	for (p = rom; p < rom + length; p++)
  21.235 +		sum += *p;
  21.236 +	return sum == 0;
  21.237 +}
  21.238 +
  21.239 +static void __init probe_roms(void)
  21.240 +{
  21.241 +	unsigned long start, length, upper;
  21.242 +	unsigned char *rom;
  21.243 +	int	      i;
  21.244 +
  21.245 +	/* video rom */
  21.246 +	upper = adapter_rom_resources[0].start;
  21.247 +	for (start = video_rom_resource.start; start < upper; start += 2048) {
  21.248 +		rom = isa_bus_to_virt(start);
  21.249 +		if (!romsignature(rom))
  21.250 +			continue;
  21.251 +
  21.252 +		video_rom_resource.start = start;
  21.253 +
  21.254 +		/* 0 < length <= 0x7f * 512, historically */
  21.255 +		length = rom[2] * 512;
  21.256 +
  21.257 +		/* if checksum okay, trust length byte */
  21.258 +		if (length && romchecksum(rom, length))
  21.259 +			video_rom_resource.end = start + length - 1;
  21.260 +
  21.261 +		request_resource(&iomem_resource, &video_rom_resource);
  21.262 +		break;
  21.263 +			}
  21.264 +
  21.265 +	start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
  21.266 +	if (start < upper)
  21.267 +		start = upper;
  21.268 +
  21.269 +	/* system rom */
  21.270 +	request_resource(&iomem_resource, &system_rom_resource);
  21.271 +	upper = system_rom_resource.start;
  21.272 +
  21.273 +	/* check for extension rom (ignore length byte!) */
  21.274 +	rom = isa_bus_to_virt(extension_rom_resource.start);
  21.275 +	if (romsignature(rom)) {
  21.276 +		length = extension_rom_resource.end - extension_rom_resource.start + 1;
  21.277 +		if (romchecksum(rom, length)) {
  21.278 +			request_resource(&iomem_resource, &extension_rom_resource);
  21.279 +			upper = extension_rom_resource.start;
  21.280 +		}
  21.281 +	}
  21.282 +
  21.283 +	/* check for adapter roms on 2k boundaries */
  21.284 +	for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) {
  21.285 +		rom = isa_bus_to_virt(start);
  21.286 +		if (!romsignature(rom))
  21.287 +			continue;
  21.288 +
  21.289 +		/* 0 < length <= 0x7f * 512, historically */
  21.290 +		length = rom[2] * 512;
  21.291 +
  21.292 +		/* but accept any length that fits if checksum okay */
  21.293 +		if (!length || start + length > upper || !romchecksum(rom, length))
  21.294 +			continue;
  21.295 +
  21.296 +		adapter_rom_resources[i].start = start;
  21.297 +		adapter_rom_resources[i].end = start + length - 1;
  21.298 +		request_resource(&iomem_resource, &adapter_rom_resources[i]);
  21.299 +
  21.300 +		start = adapter_rom_resources[i++].end & ~2047UL;
  21.301 +	}
  21.302 +}
  21.303 +#endif
  21.304 +
  21.305 +/*
  21.306 + * Point at the empty zero page to start with. We map the real shared_info
  21.307 + * page as soon as fixmap is up and running.
  21.308 + */
  21.309 +shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
  21.310 +EXPORT_SYMBOL(HYPERVISOR_shared_info);
  21.311 +
  21.312 +u32 *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
  21.313 +
  21.314 +EXPORT_SYMBOL(phys_to_machine_mapping);
  21.315 +
  21.316 +DEFINE_PER_CPU(multicall_entry_t, multicall_list[8]);
  21.317 +DEFINE_PER_CPU(int, nr_multicall_ents);
  21.318 +
  21.319 +/* Raw start-of-day parameters from the hypervisor. */
  21.320 +union xen_start_info_union xen_start_info_union;
  21.321 +
  21.322 +static __init void parse_cmdline_early (char ** cmdline_p)
  21.323 +{
  21.324 +	char c = ' ', *to = command_line, *from = COMMAND_LINE;
  21.325 +	int len = 0;
  21.326 +
  21.327 +	memcpy(saved_command_line, xen_start_info.cmd_line, MAX_CMDLINE);
  21.328 +	/* Save unparsed command line copy for /proc/cmdline */
  21.329 +	memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
  21.330 +	saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
  21.331 +
  21.332 +	for (;;) {
  21.333 +		if (c != ' ') 
  21.334 +			goto next_char; 
  21.335 +
  21.336 +#ifdef  CONFIG_SMP
  21.337 +		/*
  21.338 +		 * If the BIOS enumerates physical processors before logical,
  21.339 +		 * maxcpus=N at enumeration-time can be used to disable HT.
  21.340 +		 */
  21.341 +		else if (!memcmp(from, "maxcpus=", 8)) {
  21.342 +			extern unsigned int maxcpus;
  21.343 +
  21.344 +			maxcpus = simple_strtoul(from + 8, NULL, 0);
  21.345 +		}
  21.346 +#endif
  21.347 +#ifdef CONFIG_ACPI_BOOT
  21.348 +		/* "acpi=off" disables both ACPI table parsing and interpreter init */
  21.349 +		if (!memcmp(from, "acpi=off", 8))
  21.350 +			disable_acpi();
  21.351 +
  21.352 +		if (!memcmp(from, "acpi=force", 10)) { 
  21.353 +			/* add later when we do DMI horrors: */
  21.354 +			acpi_force = 1;
  21.355 +			acpi_disabled = 0;
  21.356 +		}
  21.357 +
  21.358 +		/* acpi=ht just means: do ACPI MADT parsing 
  21.359 +		   at bootup, but don't enable the full ACPI interpreter */
  21.360 +		if (!memcmp(from, "acpi=ht", 7)) { 
  21.361 +			if (!acpi_force)
  21.362 +				disable_acpi();
  21.363 +			acpi_ht = 1; 
  21.364 +		}
  21.365 +                else if (!memcmp(from, "pci=noacpi", 10)) 
  21.366 +			acpi_disable_pci();
  21.367 +		else if (!memcmp(from, "acpi=noirq", 10))
  21.368 +			acpi_noirq_set();
  21.369 +
  21.370 +		else if (!memcmp(from, "acpi_sci=edge", 13))
  21.371 +			acpi_sci_flags.trigger =  1;
  21.372 +		else if (!memcmp(from, "acpi_sci=level", 14))
  21.373 +			acpi_sci_flags.trigger = 3;
  21.374 +		else if (!memcmp(from, "acpi_sci=high", 13))
  21.375 +			acpi_sci_flags.polarity = 1;
  21.376 +		else if (!memcmp(from, "acpi_sci=low", 12))
  21.377 +			acpi_sci_flags.polarity = 3;
  21.378 +
  21.379 +		/* acpi=strict disables out-of-spec workarounds */
  21.380 +		else if (!memcmp(from, "acpi=strict", 11)) {
  21.381 +			acpi_strict = 1;
  21.382 +		}
  21.383 +#endif
  21.384 +
  21.385 +#if 0
  21.386 +		if (!memcmp(from, "nolapic", 7) ||
  21.387 +		    !memcmp(from, "disableapic", 11))
  21.388 +			disable_apic = 1;
  21.389 +
  21.390 +		if (!memcmp(from, "noapic", 6)) 
  21.391 +			skip_ioapic_setp = 1;
  21.392 +
  21.393 +		if (!memcmp(from, "apic", 4)) { 
  21.394 +			skip_ioapic_setup = 0;
  21.395 +			ioapic_force = 1;
  21.396 +		}
  21.397 +#endif
  21.398 +			
  21.399 +		if (!memcmp(from, "mem=", 4))
  21.400 +			parse_memopt(from+4, &from); 
  21.401 +
  21.402 +#ifdef CONFIG_DISCONTIGMEM
  21.403 +		if (!memcmp(from, "numa=", 5))
  21.404 +			numa_setup(from+5); 
  21.405 +#endif
  21.406 +
  21.407 +#ifdef CONFIG_GART_IOMMU 
  21.408 +		if (!memcmp(from,"iommu=",6)) { 
  21.409 +			iommu_setup(from+6); 
  21.410 +		}
  21.411 +#endif
  21.412 +
  21.413 +		if (!memcmp(from,"oops=panic", 10))
  21.414 +			panic_on_oops = 1;
  21.415 +
  21.416 +		if (!memcmp(from, "noexec=", 7))
  21.417 +			nonx_setup(from + 7);
  21.418 +
  21.419 +	next_char:
  21.420 +		c = *(from++);
  21.421 +		if (!c)
  21.422 +			break;
  21.423 +		if (COMMAND_LINE_SIZE <= ++len)
  21.424 +			break;
  21.425 +		*(to++) = c;
  21.426 +	}
  21.427 +	*to = '\0';
  21.428 +	*cmdline_p = command_line;
  21.429 +}
  21.430 +
  21.431 +#ifndef CONFIG_DISCONTIGMEM
  21.432 +static void __init contig_initmem_init(void)
  21.433 +{
  21.434 +        unsigned long bootmap_size, bootmap;
  21.435 +
  21.436 +        /*
  21.437 +	 * partially used pages are not usable - thus
  21.438 +	 * we are rounding upwards:
  21.439 +	 */
  21.440 +
  21.441 +        bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT;
  21.442 +        bootmap = start_pfn;
  21.443 +        bootmap_size = init_bootmem(bootmap, end_pfn);
  21.444 +        reserve_bootmem(bootmap, bootmap_size);
  21.445 +        
  21.446 +        free_bootmem(start_pfn << PAGE_SHIFT, (end_pfn - start_pfn) << PAGE_SHIFT);   
  21.447 +        printk("Registering memory for bootmem: from  %lx, size = %lx\n",
  21.448 +                     start_pfn << PAGE_SHIFT, (end_pfn - start_pfn) << PAGE_SHIFT);
  21.449 +        /* 
  21.450 +         * This should cover kernel_end
  21.451 +         */
  21.452 +#if 0
  21.453 +        reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(start_pfn) +
  21.454 +                                      bootmap_size + PAGE_SIZE-1) - (HIGH_MEMORY));
  21.455 +#endif
  21.456 +        reserve_bootmem(0, (PFN_PHYS(start_pfn) +
  21.457 +                            bootmap_size + PAGE_SIZE-1));
  21.458 +
  21.459 +} 
  21.460 +#endif
  21.461 +
  21.462 +/* Use inline assembly to define this because the nops are defined 
  21.463 +   as inline assembly strings in the include files and we cannot 
  21.464 +   get them easily into strings. */
  21.465 +asm("\t.data\nk8nops: " 
  21.466 +    K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6
  21.467 +    K8_NOP7 K8_NOP8); 
  21.468 +    
  21.469 +extern unsigned char k8nops[];
  21.470 +static unsigned char *k8_nops[ASM_NOP_MAX+1] = { 
  21.471 +     NULL,
  21.472 +     k8nops,
  21.473 +     k8nops + 1,
  21.474 +     k8nops + 1 + 2,
  21.475 +     k8nops + 1 + 2 + 3,
  21.476 +     k8nops + 1 + 2 + 3 + 4,
  21.477 +     k8nops + 1 + 2 + 3 + 4 + 5,
  21.478 +     k8nops + 1 + 2 + 3 + 4 + 5 + 6,
  21.479 +     k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
  21.480 +}; 
  21.481 +
  21.482 +/* Replace instructions with better alternatives for this CPU type.
  21.483 +
  21.484 +   This runs before SMP is initialized to avoid SMP problems with
  21.485 +   self modifying code. This implies that assymetric systems where
  21.486 +   APs have less capabilities than the boot processor are not handled. 
  21.487 +   In this case boot with "noreplacement". */ 
  21.488 +void apply_alternatives(void *start, void *end) 
  21.489 +{ 
  21.490 +	struct alt_instr *a; 
  21.491 +	int diff, i, k;
  21.492 +	for (a = start; (void *)a < end; a++) { 
  21.493 +		if (!boot_cpu_has(a->cpuid))
  21.494 +			continue;
  21.495 +
  21.496 +		BUG_ON(a->replacementlen > a->instrlen); 
  21.497 +		__inline_memcpy(a->instr, a->replacement, a->replacementlen); 
  21.498 +		diff = a->instrlen - a->replacementlen; 
  21.499 +
  21.500 +		/* Pad the rest with nops */
  21.501 +		for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
  21.502 +			k = diff;
  21.503 +			if (k > ASM_NOP_MAX)
  21.504 +				k = ASM_NOP_MAX;
  21.505 +			__inline_memcpy(a->instr + i, k8_nops[k], k); 
  21.506 +		} 
  21.507 +	}
  21.508 +} 
  21.509 +
  21.510 +static int no_replacement __initdata = 0; 
  21.511 + 
  21.512 +void __init alternative_instructions(void)
  21.513 +{
  21.514 +	extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
  21.515 +	if (no_replacement) 
  21.516 +		return;
  21.517 +	apply_alternatives(__alt_instructions, __alt_instructions_end);
  21.518 +}
  21.519 +
  21.520 +static int __init noreplacement_setup(char *s)
  21.521 +{ 
  21.522 +     no_replacement = 1; 
  21.523 +     return 0; 
  21.524 +} 
  21.525 +
  21.526 +__setup("noreplacement", noreplacement_setup); 
  21.527 +
  21.528 +#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
  21.529 +struct edd edd;
  21.530 +#ifdef CONFIG_EDD_MODULE
  21.531 +EXPORT_SYMBOL(edd);
  21.532 +#endif
  21.533 +/**
  21.534 + * copy_edd() - Copy the BIOS EDD information
  21.535 + *              from boot_params into a safe place.
  21.536 + *
  21.537 + */
  21.538 +static inline void copy_edd(void)
  21.539 +{
  21.540 +     memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature));
  21.541 +     memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info));
  21.542 +     edd.mbr_signature_nr = EDD_MBR_SIG_NR;
  21.543 +     edd.edd_info_nr = EDD_NR;
  21.544 +}
  21.545 +#else
  21.546 +static inline void copy_edd(void)
  21.547 +{
  21.548 +}
  21.549 +#endif
  21.550 +
  21.551 +#if 0
  21.552 +#define EBDA_ADDR_POINTER 0x40E
  21.553 +static void __init reserve_ebda_region(void)
  21.554 +{
  21.555 +	unsigned int addr;
  21.556 +	/** 
  21.557 +	 * there is a real-mode segmented pointer pointing to the 
  21.558 +	 * 4K EBDA area at 0x40E
  21.559 +	 */
  21.560 +	addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER);
  21.561 +	addr <<= 4;
  21.562 +	if (addr)
  21.563 +		reserve_bootmem_generic(addr, PAGE_SIZE);
  21.564 +}
  21.565 +#endif
  21.566 +
  21.567 +/*
  21.568 + * Guest physical starts from 0.
  21.569 + */
  21.570 +
  21.571 +unsigned long __init xen_end_of_ram(void)
  21.572 +{
  21.573 +        unsigned long max_end_pfn = xen_start_info.nr_pages;
  21.574 +
  21.575 +	if ( xen_override_max_pfn <  max_end_pfn)
  21.576 +		xen_override_max_pfn = max_end_pfn;
  21.577 +	
  21.578 +        return xen_override_max_pfn;
  21.579 +}
  21.580 +
  21.581 +static void __init print_memory_map(char *who)
  21.582 +{
  21.583 +        int i;
  21.584 +
  21.585 +        for (i = 0; i < e820.nr_map; i++) {
  21.586 +                early_printk(" %s: %016Lx - %016Lx ", who,
  21.587 +                        e820.map[i].addr,
  21.588 +                        e820.map[i].addr + e820.map[i].size);
  21.589 +                switch (e820.map[i].type) {
  21.590 +                case E820_RAM:  early_printk("(usable)\n");
  21.591 +                                break;
  21.592 +                case E820_RESERVED:
  21.593 +                                early_printk("(reserved)\n");
  21.594 +                                break;
  21.595 +                case E820_ACPI:
  21.596 +                                early_printk("(ACPI data)\n");
  21.597 +                                break;
  21.598 +                case E820_NVS:
  21.599 +                                early_printk("(ACPI NVS)\n");
  21.600 +                                break;
  21.601 +                default:        early_printk("type %u\n", e820.map[i].type);
  21.602 +                                break;
  21.603 +                }
  21.604 +        }
  21.605 +}
  21.606 +
  21.607 +void __init setup_arch(char **cmdline_p)
  21.608 +{
  21.609 +	unsigned long low_mem_size;
  21.610 +        int i,j;
  21.611 +#if 0
  21.612 + 	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
  21.613 +#else
  21.614 + 	ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); 
  21.615 +#endif
  21.616 + 	drive_info = DRIVE_INFO;
  21.617 +
  21.618 +#ifdef CONFIG_XEN_PHYSDEV_ACCESS
  21.619 + 	screen_info = SCREEN_INFO;
  21.620 +#endif
  21.621 +	edid_info = EDID_INFO;
  21.622 +	aux_device_present = AUX_DEVICE_INFO;
  21.623 +	saved_video_mode = SAVED_VIDEO_MODE;
  21.624 +	bootloader_type = LOADER_TYPE;
  21.625 +
  21.626 +#ifdef CONFIG_BLK_DEV_RAM
  21.627 +	rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
  21.628 +	rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
  21.629 +	rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
  21.630 +#endif
  21.631 +/*        register_console(&xen_console); */
  21.632 +
  21.633 +#ifdef CONFIG_XEN_PHYSDEV_ACCESS
  21.634 +	/* This is drawn from a dump from vgacon:startup in standard Linux. */
  21.635 +	screen_info.orig_video_mode = 3; 
  21.636 +	screen_info.orig_video_isVGA = 1;
  21.637 +	screen_info.orig_video_lines = 25;
  21.638 +	screen_info.orig_video_cols = 80;
  21.639 +	screen_info.orig_video_ega_bx = 3;
  21.640 +	screen_info.orig_video_points = 16;
  21.641 +#endif       
  21.642 +        ARCH_SETUP
  21.643 +        print_memory_map(machine_specific_memory_setup());
  21.644 +
  21.645 +        /*	copy_edd();  */
  21.646 +
  21.647 +	if (!MOUNT_ROOT_RDONLY)
  21.648 +		root_mountflags &= ~MS_RDONLY;
  21.649 +	init_mm.start_code = (unsigned long) &_text;
  21.650 +	init_mm.end_code = (unsigned long) &_etext;
  21.651 +	init_mm.end_data = (unsigned long) &_edata;
  21.652 +/*	init_mm.brk = (unsigned long) &_end; */
  21.653 +        init_mm.brk = start_pfn << PAGE_SHIFT;
  21.654 +
  21.655 +
  21.656 +#if 0  /* XEN: This is nonsense: kernel may not even be contiguous in RAM. */
  21.657 +	code_resource.start = virt_to_phys(&_text);
  21.658 +	code_resource.end = virt_to_phys(&_etext)-1;
  21.659 +	data_resource.start = virt_to_phys(&_etext);
  21.660 +	data_resource.end = virt_to_phys(&_edata)-1;
  21.661 +#endif
  21.662 +	parse_cmdline_early(cmdline_p);
  21.663 +
  21.664 +	early_identify_cpu(&boot_cpu_data);
  21.665 +
  21.666 +	/*
  21.667 +	 * partially used pages are not usable - thus
  21.668 +	 * we are rounding upwards:
  21.669 +	 */
  21.670 +#if 0
  21.671 +	end_pfn = e820_end_of_ram();
  21.672 +#else
  21.673 +        end_pfn = xen_end_of_ram();
  21.674 +#endif
  21.675 +
  21.676 +	check_efer();
  21.677 +
  21.678 +	init_memory_mapping(0, (end_pfn << PAGE_SHIFT));
  21.679 +
  21.680 +#ifdef CONFIG_ACPI_BOOT
  21.681 +	/*
  21.682 +	 * Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
  21.683 +	 * Call this early for SRAT node setup.
  21.684 +	 */
  21.685 +	acpi_boot_table_init();
  21.686 +#endif
  21.687 +
  21.688 +#ifdef CONFIG_ACPI_NUMA
  21.689 +	/*
  21.690 +	 * Parse SRAT to discover nodes.
  21.691 +	 */
  21.692 +	acpi_numa_init();
  21.693 +#endif
  21.694 +
  21.695 +#ifdef CONFIG_DISCONTIGMEM
  21.696 +	numa_initmem_init(0, end_pfn); 
  21.697 +#else
  21.698 +	contig_initmem_init(); 
  21.699 +#endif
  21.700 +
  21.701 +	/* Reserve direct mapping and shared info etc. */
  21.702 +//	reserve_bootmem_generic(table_start << PAGE_SHIFT, (table_end + 1 - table_start) << PAGE_SHIFT);
  21.703 +
  21.704 +//	reserve_bootmem_generic(0, (table_end + 1) << PAGE_SHIFT);
  21.705 +
  21.706 +	/* reserve kernel */
  21.707 +//	kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE);
  21.708 +
  21.709 +#if 0
  21.710 +	/*
  21.711 +	 * reserve physical page 0 - it's a special BIOS page on many boxes,
  21.712 +	 * enabling clean reboots, SMP operation, laptop functions.
  21.713 +	 */
  21.714 +	reserve_bootmem_generic(0, PAGE_SIZE);
  21.715 +#endif
  21.716 +
  21.717 +	/* reserve ebda region */
  21.718 +/*	reserve_ebda_region(); */
  21.719 +
  21.720 +#ifdef CONFIG_SMP
  21.721 +	/*
  21.722 +	 * But first pinch a few for the stack/trampoline stuff
  21.723 +	 * FIXME: Don't need the extra page at 4K, but need to fix
  21.724 +	 * trampoline before removing it. (see the GDT stuff)
  21.725 +	 */
  21.726 +	reserve_bootmem_generic(PAGE_SIZE, PAGE_SIZE);
  21.727 +
  21.728 +	/* Reserve SMP trampoline */
  21.729 +	reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, PAGE_SIZE);
  21.730 +#endif
  21.731 +
  21.732 +#ifdef CONFIG_ACPI_SLEEP
  21.733 +       /*
  21.734 +        * Reserve low memory region for sleep support.
  21.735 +        */
  21.736 +       acpi_reserve_bootmem();
  21.737 +#endif
  21.738 +#ifdef CONFIG_X86_LOCAL_APIC
  21.739 +	/*
  21.740 +	 * Find and reserve possible boot-time SMP configuration:
  21.741 +	 */
  21.742 +	find_smp_config();
  21.743 +#endif
  21.744 +#ifdef CONFIG_BLK_DEV_INITRD
  21.745 +        if (xen_start_info.mod_start) {
  21.746 +                if (LOADER_TYPE && INITRD_START) {
  21.747 +                        if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) {
  21.748 +                                /* reserve_bootmem_generic(INITRD_START, INITRD_SIZE); */
  21.749 +                                initrd_start = INITRD_START + PAGE_OFFSET;
  21.750 +                                initrd_end = initrd_start+INITRD_SIZE;
  21.751 +                                initrd_below_start_ok = 1;
  21.752 +                        }
  21.753 +                        else {
  21.754 +                                printk(KERN_ERR "initrd extends beyond end of memory "
  21.755 +                                       "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
  21.756 +                                       (unsigned long)(INITRD_START + INITRD_SIZE),
  21.757 +                                       (unsigned long)(end_pfn << PAGE_SHIFT));
  21.758 +                                initrd_start = 0;
  21.759 +                        }
  21.760 +                }
  21.761 +        }
  21.762 +#endif
  21.763 +        paging_init();
  21.764 +
  21.765 +	/* Make sure we have a large enough P->M table. */
  21.766 +	if (end_pfn > xen_start_info.nr_pages) {
  21.767 +		phys_to_machine_mapping = alloc_bootmem(
  21.768 +			max_pfn * sizeof(unsigned long));
  21.769 +		memset(phys_to_machine_mapping, ~0,
  21.770 +			max_pfn * sizeof(unsigned long));
  21.771 +		memcpy(phys_to_machine_mapping,
  21.772 +			(unsigned long *)xen_start_info.mfn_list,
  21.773 +			xen_start_info.nr_pages * sizeof(unsigned long));
  21.774 +		free_bootmem(
  21.775 +			__pa(xen_start_info.mfn_list), 
  21.776 +			PFN_PHYS(PFN_UP(xen_start_info.nr_pages *
  21.777 +			sizeof(unsigned long))));
  21.778 +	}
  21.779 +
  21.780 +	pfn_to_mfn_frame_list = alloc_bootmem(PAGE_SIZE);
  21.781 +
  21.782 +	for ( i=0, j=0; i < end_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
  21.783 +	{	
  21.784 +	     pfn_to_mfn_frame_list[j] = 
  21.785 +		  virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
  21.786 +	}
  21.787 +
  21.788 +#if 0
  21.789 +        check_ioapic();
  21.790 +#endif
  21.791 +
  21.792 +#ifdef CONFIG_ACPI_BOOT
  21.793 +	/*
  21.794 +	 * Read APIC and some other early information from ACPI tables.
  21.795 +	 */
  21.796 +	acpi_boot_init();
  21.797 +#endif
  21.798 +
  21.799 +#ifdef CONFIG_X86_LOCAL_APIC
  21.800 +	/*
  21.801 +	 * get boot-time SMP configuration:
  21.802 +	 */
  21.803 +	if (smp_found_config)
  21.804 +		get_smp_config();
  21.805 +	init_apic_mappings();
  21.806 +#endif
  21.807 +        
  21.808 +        /* XXX Disable irqdebug until we have a way to avoid interrupt
  21.809 +	 * conflicts. */
  21.810 +/*	noirqdebug_setup(""); */
  21.811 +	/* If we are a privileged guest OS then we should request IO privs. */
  21.812 +	if (xen_start_info.flags & SIF_PRIVILEGED) {
  21.813 +		dom0_op_t op;
  21.814 +		op.cmd           = DOM0_IOPL;
  21.815 +		op.u.iopl.domain = DOMID_SELF;
  21.816 +		op.u.iopl.iopl   = 3;
  21.817 +		if (HYPERVISOR_dom0_op(&op) != 0)
  21.818 +			panic("Unable to obtain IOPL, despite SIF_PRIVILEGED");
  21.819 +		current->thread.io_pl = 3;
  21.820 +	}
  21.821 +
  21.822 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  21.823 +	/*
  21.824 +	 * Request address space for all standard RAM and ROM resources
  21.825 +	 * and also for regions reported as reserved by the e820.
  21.826 +	 */
  21.827 +	probe_roms();
  21.828 +#endif
  21.829 +/*	e820_reserve_resources();  */
  21.830 +
  21.831 +	request_resource(&iomem_resource, &video_ram_resource);
  21.832 +
  21.833 +	{
  21.834 +	unsigned i;
  21.835 +	/* request I/O space for devices used on all i[345]86 PCs */
  21.836 +	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
  21.837 +		request_resource(&ioport_resource, &standard_io_resources[i]);
  21.838 +	}
  21.839 +
  21.840 +	/* Will likely break when you have unassigned resources with more
  21.841 +	   than 4GB memory and bridges that don't support more than 4GB. 
  21.842 +	   Doing it properly would require to use pci_alloc_consistent
  21.843 +	   in this case. */
  21.844 +	low_mem_size = ((end_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
  21.845 +	if (low_mem_size > pci_mem_start)
  21.846 +		pci_mem_start = low_mem_size;
  21.847 +
  21.848 +#ifdef CONFIG_GART_IOMMU
  21.849 +       iommu_hole_init();
  21.850 +#endif
  21.851 +
  21.852 +	if (xen_start_info.flags & SIF_INITDOMAIN) {
  21.853 +		if (!(xen_start_info.flags & SIF_PRIVILEGED))
  21.854 +			panic("Xen granted us console access "
  21.855 +			      "but not privileged status");
  21.856 +
  21.857 +#ifdef CONFIG_VT
  21.858 +#if defined(CONFIG_VGA_CONSOLE)
  21.859 +	conswitchp = &vga_con;
  21.860 +#elif defined(CONFIG_DUMMY_CONSOLE)
  21.861 +	conswitchp = &dummy_con;
  21.862 +#endif
  21.863 +#endif
  21.864 +	} else {
  21.865 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  21.866 +		extern const struct consw xennull_con;
  21.867 +		extern int console_use_vt;
  21.868 +#if defined(CONFIG_VGA_CONSOLE)
  21.869 +		/* disable VGA driver */
  21.870 +		ORIG_VIDEO_ISVGA = VIDEO_TYPE_VLFB;
  21.871 +#endif
  21.872 +		conswitchp = &xennull_con;
  21.873 +		console_use_vt = 0;
  21.874 +#endif
  21.875 +	}
  21.876 +}
  21.877 +
  21.878 +static int __init get_model_name(struct cpuinfo_x86 *c)
  21.879 +{
  21.880 +	unsigned int *v;
  21.881 +
  21.882 +	if (c->x86_cpuid_level < 0x80000004)
  21.883 +		return 0;
  21.884 +
  21.885 +	v = (unsigned int *) c->x86_model_id;
  21.886 +	cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
  21.887 +	cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]);
  21.888 +	cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]);
  21.889 +	c->x86_model_id[48] = 0;
  21.890 +	return 1;
  21.891 +}
  21.892 +
  21.893 +
  21.894 +static void __init display_cacheinfo(struct cpuinfo_x86 *c)
  21.895 +{
  21.896 +	unsigned int n, dummy, eax, ebx, ecx, edx;
  21.897 +
  21.898 +	n = c->x86_cpuid_level;
  21.899 +
  21.900 +	if (n >= 0x80000005) {
  21.901 +		cpuid(0x80000005, &dummy, &ebx, &ecx, &edx);
  21.902 +		printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
  21.903 +			edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
  21.904 +		c->x86_cache_size=(ecx>>24)+(edx>>24);
  21.905 +		/* On K8 L1 TLB is inclusive, so don't count it */
  21.906 +		c->x86_tlbsize = 0;
  21.907 +	}
  21.908 +
  21.909 +	if (n >= 0x80000006) {
  21.910 +		cpuid(0x80000006, &dummy, &ebx, &ecx, &edx);
  21.911 +		ecx = cpuid_ecx(0x80000006);
  21.912 +		c->x86_cache_size = ecx >> 16;
  21.913 +		c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff);
  21.914 +
  21.915 +		printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n",
  21.916 +		c->x86_cache_size, ecx & 0xFF);
  21.917 +	}
  21.918 +
  21.919 +	if (n >= 0x80000007)
  21.920 +		cpuid(0x80000007, &dummy, &dummy, &dummy, &c->x86_power); 
  21.921 +	if (n >= 0x80000008) {
  21.922 +		cpuid(0x80000008, &eax, &dummy, &dummy, &dummy); 
  21.923 +		c->x86_virt_bits = (eax >> 8) & 0xff;
  21.924 +		c->x86_phys_bits = eax & 0xff;
  21.925 +	}
  21.926 +}
  21.927 +
  21.928 +
  21.929 +static int __init init_amd(struct cpuinfo_x86 *c)
  21.930 +{
  21.931 +	int r;
  21.932 +	int level;
  21.933 +#ifdef CONFIG_NUMA
  21.934 +	int cpu;
  21.935 +#endif
  21.936 +
  21.937 +	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
  21.938 +	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
  21.939 +	clear_bit(0*32+31, &c->x86_capability);
  21.940 +	
  21.941 +	/* C-stepping K8? */
  21.942 +	level = cpuid_eax(1);
  21.943 +	if ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
  21.944 +		set_bit(X86_FEATURE_K8_C, &c->x86_capability);
  21.945 +
  21.946 +	r = get_model_name(c);
  21.947 +	if (!r) { 
  21.948 +		switch (c->x86) { 
  21.949 +		case 15:
  21.950 +			/* Should distinguish Models here, but this is only
  21.951 +			   a fallback anyways. */
  21.952 +			strcpy(c->x86_model_id, "Hammer");
  21.953 +			break; 
  21.954 +		} 
  21.955 +	} 
  21.956 +	display_cacheinfo(c);
  21.957 +
  21.958 +	if (c->x86_cpuid_level >= 0x80000008) {
  21.959 +		c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
  21.960 +		if (c->x86_num_cores & (c->x86_num_cores - 1))
  21.961 +			c->x86_num_cores = 1;
  21.962 +
  21.963 +#ifdef CONFIG_NUMA
  21.964 +		/* On a dual core setup the lower bits of apic id
  21.965 +		   distingush the cores. Fix up the CPU<->node mappings
  21.966 +		   here based on that.
  21.967 +		   Assumes number of cores is a power of two.
  21.968 +		   When using SRAT use mapping from SRAT. */
  21.969 +		cpu = c->x86_apicid;
  21.970 +		if (acpi_numa <= 0 && c->x86_num_cores > 1) {
  21.971 +			cpu_to_node[cpu] = cpu >> hweight32(c->x86_num_cores - 1);
  21.972 +			if (!node_online(cpu_to_node[cpu]))
  21.973 +				cpu_to_node[cpu] = first_node(node_online_map);
  21.974 +		}
  21.975 +		printk(KERN_INFO "CPU %d(%d) -> Node %d\n",
  21.976 +				cpu, c->x86_num_cores, cpu_to_node[cpu]);
  21.977 +#endif
  21.978 +	}
  21.979 +
  21.980 +	return r;
  21.981 +}
  21.982 +
  21.983 +static void __init detect_ht(struct cpuinfo_x86 *c)
  21.984 +{
  21.985 +#ifdef CONFIG_SMP
  21.986 +	u32 	eax, ebx, ecx, edx;
  21.987 +	int 	index_lsb, index_msb, tmp;
  21.988 +	int 	cpu = smp_processor_id();
  21.989 +	
  21.990 +	if (!cpu_has(c, X86_FEATURE_HT))
  21.991 +		return;
  21.992 +
  21.993 +	cpuid(1, &eax, &ebx, &ecx, &edx);
  21.994 +	smp_num_siblings = (ebx & 0xff0000) >> 16;
  21.995 +	
  21.996 +	if (smp_num_siblings == 1) {
  21.997 +		printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
  21.998 +	} else if (smp_num_siblings > 1) {
  21.999 +		index_lsb = 0;
 21.1000 +		index_msb = 31;
 21.1001 +		/*
 21.1002 +		 * At this point we only support two siblings per
 21.1003 +		 * processor package.
 21.1004 +		 */
 21.1005 +		if (smp_num_siblings > NR_CPUS) {
 21.1006 +			printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings);
 21.1007 +			smp_num_siblings = 1;
 21.1008 +			return;
 21.1009 +		}
 21.1010 +		tmp = smp_num_siblings;
 21.1011 +		while ((tmp & 1) == 0) {
 21.1012 +			tmp >>=1 ;
 21.1013 +			index_lsb++;
 21.1014 +		}
 21.1015 +		tmp = smp_num_siblings;
 21.1016 +		while ((tmp & 0x80000000 ) == 0) {
 21.1017 +			tmp <<=1 ;
 21.1018 +			index_msb--;
 21.1019 +		}
 21.1020 +		if (index_lsb != index_msb )
 21.1021 +			index_msb++;
 21.1022 +		phys_proc_id[cpu] = phys_pkg_id(index_msb);
 21.1023 +		
 21.1024 +		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
 21.1025 +		       phys_proc_id[cpu]);
 21.1026 +	}
 21.1027 +#endif
 21.1028 +}
 21.1029 +
 21.1030 +static void __init sched_cmp_hack(struct cpuinfo_x86 *c)
 21.1031 +{
 21.1032 +#ifdef CONFIG_SMP
 21.1033 +	/* AMD dual core looks like HT but isn't really. Hide it from the
 21.1034 +	   scheduler. This works around problems with the domain scheduler.
 21.1035 +	   Also probably gives slightly better scheduling and disables
 21.1036 +	   SMT nice which is harmful on dual core.
 21.1037 +	   TBD tune the domain scheduler for dual core. */
 21.1038 +	if (c->x86_vendor == X86_VENDOR_AMD && cpu_has(c, X86_FEATURE_CMP_LEGACY))
 21.1039 +		smp_num_siblings = 1;
 21.1040 +#endif
 21.1041 +}
 21.1042 +	
 21.1043 +static void __init init_intel(struct cpuinfo_x86 *c)
 21.1044 +{
 21.1045 +	/* Cache sizes */
 21.1046 +	unsigned n;
 21.1047 +
 21.1048 +	init_intel_cacheinfo(c);
 21.1049 +	n = c->x86_cpuid_level;
 21.1050 +	if (n >= 0x80000008) {
 21.1051 +		unsigned eax = cpuid_eax(0x80000008);
 21.1052 +		c->x86_virt_bits = (eax >> 8) & 0xff;
 21.1053 +		c->x86_phys_bits = eax & 0xff;
 21.1054 +	}
 21.1055 +
 21.1056 +	if (c->x86 == 15)
 21.1057 +		c->x86_cache_alignment = c->x86_clflush_size * 2;
 21.1058 +}
 21.1059 +
 21.1060 +void __init get_cpu_vendor(struct cpuinfo_x86 *c)
 21.1061 +{
 21.1062 +	char *v = c->x86_vendor_id;
 21.1063 +
 21.1064 +	if (!strcmp(v, "AuthenticAMD"))
 21.1065 +		c->x86_vendor = X86_VENDOR_AMD;
 21.1066 +	else if (!strcmp(v, "GenuineIntel"))
 21.1067 +		c->x86_vendor = X86_VENDOR_INTEL;
 21.1068 +	else
 21.1069 +		c->x86_vendor = X86_VENDOR_UNKNOWN;
 21.1070 +}
 21.1071 +
 21.1072 +struct cpu_model_info {
 21.1073 +	int vendor;
 21.1074 +	int family;
 21.1075 +	char *model_names[16];
 21.1076 +};
 21.1077 +
 21.1078 +/* Do some early cpuid on the boot CPU to get some parameter that are
 21.1079 +   needed before check_bugs. Everything advanced is in identify_cpu
 21.1080 +   below. */
 21.1081 +void __init early_identify_cpu(struct cpuinfo_x86 *c)
 21.1082 +{
 21.1083 +	u32 tfms;
 21.1084 +
 21.1085 +	c->loops_per_jiffy = loops_per_jiffy;
 21.1086 +	c->x86_cache_size = -1;
 21.1087 +	c->x86_vendor = X86_VENDOR_UNKNOWN;
 21.1088 +	c->x86_model = c->x86_mask = 0;	/* So far unknown... */
 21.1089 +	c->x86_vendor_id[0] = '\0'; /* Unset */
 21.1090 +	c->x86_model_id[0] = '\0';  /* Unset */
 21.1091 +	c->x86_clflush_size = 64;
 21.1092 +	c->x86_cache_alignment = c->x86_clflush_size;
 21.1093 +	c->x86_num_cores = 1;
 21.1094 +	c->x86_apicid = c == &boot_cpu_data ? 0 : c - cpu_data;
 21.1095 +	c->x86_cpuid_level = 0;
 21.1096 +	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 21.1097 +
 21.1098 +	/* Get vendor name */
 21.1099 +	cpuid(0x00000000, (unsigned int *)&c->cpuid_level,
 21.1100 +	      (unsigned int *)&c->x86_vendor_id[0],
 21.1101 +	      (unsigned int *)&c->x86_vendor_id[8],
 21.1102 +	      (unsigned int *)&c->x86_vendor_id[4]);
 21.1103 +		
 21.1104 +	get_cpu_vendor(c);
 21.1105 +
 21.1106 +	/* Initialize the standard set of capabilities */
 21.1107 +	/* Note that the vendor-specific code below might override */
 21.1108 +
 21.1109 +	/* Intel-defined flags: level 0x00000001 */
 21.1110 +	if (c->cpuid_level >= 0x00000001) {
 21.1111 +		__u32 misc;
 21.1112 +		cpuid(0x00000001, &tfms, &misc, &c->x86_capability[4],
 21.1113 +		      &c->x86_capability[0]);
 21.1114 +		c->x86 = (tfms >> 8) & 0xf;
 21.1115 +		c->x86_model = (tfms >> 4) & 0xf;
 21.1116 +		c->x86_mask = tfms & 0xf;
 21.1117 +		if (c->x86 == 0xf) {
 21.1118 +			c->x86 += (tfms >> 20) & 0xff;
 21.1119 +			c->x86_model += ((tfms >> 16) & 0xF) << 4;
 21.1120 +		} 
 21.1121 +		if (c->x86_capability[0] & (1<<19)) 
 21.1122 +			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
 21.1123 +		c->x86_apicid = misc >> 24;
 21.1124 +	} else {
 21.1125 +		/* Have CPUID level 0 only - unheard of */
 21.1126 +		c->x86 = 4;
 21.1127 +	}
 21.1128 +}
 21.1129 +
 21.1130 +/*
 21.1131 + * This does the hard work of actually picking apart the CPU stuff...
 21.1132 + */
 21.1133 +void __init identify_cpu(struct cpuinfo_x86 *c)
 21.1134 +{
 21.1135 +	int i;
 21.1136 +	u32 xlvl;
 21.1137 +
 21.1138 +	early_identify_cpu(c);
 21.1139 +
 21.1140 +	/* AMD-defined flags: level 0x80000001 */
 21.1141 +	xlvl = cpuid_eax(0x80000000);
 21.1142 +	c->x86_cpuid_level = xlvl;
 21.1143 +	if ((xlvl & 0xffff0000) == 0x80000000) {
 21.1144 +		if (xlvl >= 0x80000001) {
 21.1145 +			c->x86_capability[1] = cpuid_edx(0x80000001);
 21.1146 +			c->x86_capability[5] = cpuid_ecx(0x80000001);
 21.1147 +		}
 21.1148 +		if (xlvl >= 0x80000004)
 21.1149 +			get_model_name(c); /* Default name */
 21.1150 +	}
 21.1151 +
 21.1152 +	/* Transmeta-defined flags: level 0x80860001 */
 21.1153 +	xlvl = cpuid_eax(0x80860000);
 21.1154 +	if ((xlvl & 0xffff0000) == 0x80860000) {
 21.1155 +		/* Don't set x86_cpuid_level here for now to not confuse. */
 21.1156 +		if (xlvl >= 0x80860001)
 21.1157 +			c->x86_capability[2] = cpuid_edx(0x80860001);
 21.1158 +	}
 21.1159 +
 21.1160 +	/*
 21.1161 +	 * Vendor-specific initialization.  In this section we
 21.1162 +	 * canonicalize the feature flags, meaning if there are
 21.1163 +	 * features a certain CPU supports which CPUID doesn't
 21.1164 +	 * tell us, CPUID claiming incorrect flags, or other bugs,
 21.1165 +	 * we handle them here.
 21.1166 +	 *
 21.1167 +	 * At the end of this section, c->x86_capability better
 21.1168 +	 * indicate the features this CPU genuinely supports!
 21.1169 +	 */
 21.1170 +	switch (c->x86_vendor) {
 21.1171 +	case X86_VENDOR_AMD:
 21.1172 +		init_amd(c);
 21.1173 +		break;
 21.1174 +
 21.1175 +	case X86_VENDOR_INTEL:
 21.1176 +		init_intel(c);
 21.1177 +		break;
 21.1178 +
 21.1179 +	case X86_VENDOR_UNKNOWN:
 21.1180 +	default:
 21.1181 +		display_cacheinfo(c);
 21.1182 +		break;
 21.1183 +	}
 21.1184 +
 21.1185 +	select_idle_routine(c);
 21.1186 +	detect_ht(c); 
 21.1187 +	sched_cmp_hack(c);
 21.1188 +
 21.1189 +	/*
 21.1190 +	 * On SMP, boot_cpu_data holds the common feature set between
 21.1191 +	 * all CPUs; so make sure that we indicate which features are
 21.1192 +	 * common between the CPUs.  The first time this routine gets
 21.1193 +	 * executed, c == &boot_cpu_data.
 21.1194 +	 */
 21.1195 +	if (c != &boot_cpu_data) {
 21.1196 +		/* AND the already accumulated flags with these */
 21.1197 +		for (i = 0 ; i < NCAPINTS ; i++)
 21.1198 +			boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
 21.1199 +	}
 21.1200 +
 21.1201 +#ifdef CONFIG_X86_MCE
 21.1202 +	mcheck_init(c);
 21.1203 +#endif
 21.1204 +#ifdef CONFIG_NUMA
 21.1205 +	if (c != &boot_cpu_data)
 21.1206 +		numa_add_cpu(c - cpu_data);
 21.1207 +#endif
 21.1208 +}
 21.1209 + 
 21.1210 +
 21.1211 +void __init print_cpu_info(struct cpuinfo_x86 *c)
 21.1212 +{
 21.1213 +	if (c->x86_model_id[0])
 21.1214 +		printk("%s", c->x86_model_id);
 21.1215 +
 21.1216 +	if (c->x86_mask || c->cpuid_level >= 0) 
 21.1217 +		printk(" stepping %02x\n", c->x86_mask);
 21.1218 +	else
 21.1219 +		printk("\n");
 21.1220 +}
 21.1221 +
 21.1222 +/*
 21.1223 + *	Get CPU information for use by the procfs.
 21.1224 + */
 21.1225 +
 21.1226 +static int show_cpuinfo(struct seq_file *m, void *v)
 21.1227 +{
 21.1228 +	struct cpuinfo_x86 *c = v;
 21.1229 +
 21.1230 +	/* 
 21.1231 +	 * These flag bits must match the definitions in <asm/cpufeature.h>.
 21.1232 +	 * NULL means this bit is undefined or reserved; either way it doesn't
 21.1233 +	 * have meaning as far as Linux is concerned.  Note that it's important
 21.1234 +	 * to realize there is a difference between this table and CPUID -- if
 21.1235 +	 * applications want to get the raw CPUID data, they should access
 21.1236 +	 * /dev/cpu/<cpu_nr>/cpuid instead.
 21.1237 +	 */
 21.1238 +	static char *x86_cap_flags[] = {
 21.1239 +		/* Intel-defined */
 21.1240 +	        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 21.1241 +	        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
 21.1242 +	        "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
 21.1243 +	        "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
 21.1244 +
 21.1245 +		/* AMD-defined */
 21.1246 +		"pni", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1247 +		NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
 21.1248 +		NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL,
 21.1249 +		NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
 21.1250 +
 21.1251 +		/* Transmeta-defined */
 21.1252 +		"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
 21.1253 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1254 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1255 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1256 +
 21.1257 +		/* Other (Linux-defined) */
 21.1258 +		"cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL, NULL, NULL,
 21.1259 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1260 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1261 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1262 +
 21.1263 +		/* Intel-defined (#2) */
 21.1264 +		"pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "est",
 21.1265 +		"tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
 21.1266 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1267 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1268 +
 21.1269 +		/* AMD-defined (#2) */
 21.1270 +		"lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL,
 21.1271 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1272 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 21.1273 +		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
 21.1274 +	};
 21.1275 +	static char *x86_power_flags[] = { 
 21.1276 +		"ts",	/* temperature sensor */
 21.1277 +		"fid",  /* frequency id control */
 21.1278 +		"vid",  /* voltage id control */
 21.1279 +		"ttp",  /* thermal trip */
 21.1280 +	};
 21.1281 +
 21.1282 +
 21.1283 +#ifdef CONFIG_SMP
 21.1284 +	if (!cpu_online(c-cpu_data))
 21.1285 +		return 0;
 21.1286 +#endif
 21.1287 +
 21.1288 +	seq_printf(m,"processor\t: %u\n"
 21.1289 +		     "vendor_id\t: %s\n"
 21.1290 +		     "cpu family\t: %d\n"
 21.1291 +		     "model\t\t: %d\n"
 21.1292 +		     "model name\t: %s\n",
 21.1293 +		     (unsigned)(c-cpu_data),
 21.1294 +		     c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown",
 21.1295 +		     c->x86,
 21.1296 +		     (int)c->x86_model,
 21.1297 +		     c->x86_model_id[0] ? c->x86_model_id : "unknown");
 21.1298 +	
 21.1299 +	if (c->x86_mask || c->cpuid_level >= 0)
 21.1300 +		seq_printf(m, "stepping\t: %d\n", c->x86_mask);
 21.1301 +	else
 21.1302 +		seq_printf(m, "stepping\t: unknown\n");
 21.1303 +	
 21.1304 +	if (cpu_has(c,X86_FEATURE_TSC)) {
 21.1305 +		seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
 21.1306 +			     cpu_khz / 1000, (cpu_khz % 1000));
 21.1307 +	}
 21.1308 +
 21.1309 +	/* Cache size */
 21.1310 +	if (c->x86_cache_size >= 0) 
 21.1311 +		seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 21.1312 +	
 21.1313 +#ifdef CONFIG_SMP
 21.1314 +	seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]);
 21.1315 +	seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings);
 21.1316 +#endif	
 21.1317 +
 21.1318 +	seq_printf(m,
 21.1319 +	        "fpu\t\t: yes\n"
 21.1320 +	        "fpu_exception\t: yes\n"
 21.1321 +	        "cpuid level\t: %d\n"
 21.1322 +	        "wp\t\t: yes\n"
 21.1323 +	        "flags\t\t:",
 21.1324 +		   c->cpuid_level);
 21.1325 +
 21.1326 +	{ 
 21.1327 +		int i; 
 21.1328 +		for ( i = 0 ; i < 32*NCAPINTS ; i++ )
 21.1329 +			if ( test_bit(i, &c->x86_capability) &&
 21.1330 +			     x86_cap_flags[i] != NULL )
 21.1331 +				seq_printf(m, " %s", x86_cap_flags[i]);
 21.1332 +	}
 21.1333 +		
 21.1334 +	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
 21.1335 +		   c->loops_per_jiffy/(500000/HZ),
 21.1336 +		   (c->loops_per_jiffy/(5000/HZ)) % 100);
 21.1337 +
 21.1338 +	if (c->x86_tlbsize > 0) 
 21.1339 +		seq_printf(m, "TLB size\t: %d 4K pages\n", c->x86_tlbsize);
 21.1340 +	seq_printf(m, "clflush size\t: %d\n", c->x86_clflush_size);
 21.1341 +	seq_printf(m, "cache_alignment\t: %d\n", c->x86_cache_alignment);
 21.1342 +
 21.1343 +	seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", 
 21.1344 +		   c->x86_phys_bits, c->x86_virt_bits);
 21.1345 +
 21.1346 +	seq_printf(m, "power management:");
 21.1347 +	{
 21.1348 +		unsigned i;
 21.1349 +		for (i = 0; i < 32; i++) 
 21.1350 +			if (c->x86_power & (1 << i)) {
 21.1351 +				if (i < ARRAY_SIZE(x86_power_flags))
 21.1352 +					seq_printf(m, " %s", x86_power_flags[i]);
 21.1353 +				else
 21.1354 +					seq_printf(m, " [%d]", i);
 21.1355 +			}
 21.1356 +	}
 21.1357 +	seq_printf(m, "\n");
 21.1358 +
 21.1359 +	if (c->x86_num_cores > 1)
 21.1360 +		seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
 21.1361 +
 21.1362 +	seq_printf(m, "\n\n"); 
 21.1363 +
 21.1364 +	return 0;
 21.1365 +}
 21.1366 +
 21.1367 +static void *c_start(struct seq_file *m, loff_t *pos)
 21.1368 +{
 21.1369 +	return *pos < NR_CPUS ? cpu_data + *pos : NULL;
 21.1370 +}
 21.1371 +
 21.1372 +static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 21.1373 +{
 21.1374 +	++*pos;
 21.1375 +	return c_start(m, pos);
 21.1376 +}
 21.1377 +
 21.1378 +static void c_stop(struct seq_file *m, void *v)
 21.1379 +{
 21.1380 +}
 21.1381 +
 21.1382 +struct seq_operations cpuinfo_op = {
 21.1383 +	.start =c_start,
 21.1384 +	.next =	c_next,
 21.1385 +	.stop =	c_stop,
 21.1386 +	.show =	show_cpuinfo,
 21.1387 +};
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/setup64.c	Sat Apr 02 20:27:11 2005 +0000
    22.3 @@ -0,0 +1,350 @@
    22.4 +/* 
    22.5 + * X86-64 specific CPU setup.
    22.6 + * Copyright (C) 1995  Linus Torvalds
    22.7 + * Copyright 2001, 2002, 2003 SuSE Labs / Andi Kleen.
    22.8 + * See setup.c for older changelog.
    22.9 + * $Id: setup64.c,v 1.12 2002/03/21 10:09:17 ak Exp $
   22.10 + *
   22.11 + * Jun Nakajima <jun.nakajima@intel.com> 
   22.12 + *   Modified for Xen
   22.13 + *
   22.14 + */ 
   22.15 +#include <linux/config.h>
   22.16 +#include <linux/init.h>
   22.17 +#include <linux/kernel.h>
   22.18 +#include <linux/sched.h>
   22.19 +#include <linux/string.h>
   22.20 +#include <linux/bootmem.h>
   22.21 +#include <linux/bitops.h>
   22.22 +#include <asm/pda.h>
   22.23 +#include <asm/pgtable.h>
   22.24 +#include <asm/processor.h>
   22.25 +#include <asm/desc.h>
   22.26 +#include <asm/atomic.h>
   22.27 +#include <asm/mmu_context.h>
   22.28 +#include <asm/smp.h>
   22.29 +#include <asm/i387.h>
   22.30 +#include <asm/percpu.h>
   22.31 +#include <asm/mtrr.h>
   22.32 +#include <asm/proto.h>
   22.33 +#include <asm/mman.h>
   22.34 +#include <asm/numa.h>
   22.35 +
   22.36 +#include <asm-xen/hypervisor.h>
   22.37 +
   22.38 +char x86_boot_params[2048] __initdata = {0,};
   22.39 +
   22.40 +cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
   22.41 +
   22.42 +struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned; 
   22.43 +
   22.44 +extern struct task_struct init_task;
   22.45 +
   22.46 +extern unsigned char __per_cpu_start[], __per_cpu_end[]; 
   22.47 +
   22.48 +extern struct desc_ptr cpu_gdt_descr[];
   22.49 +struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 
   22.50 +
   22.51 +char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
   22.52 +
   22.53 +unsigned long __supported_pte_mask = ~0UL;
   22.54 +static int do_not_nx __initdata = 0;
   22.55 +
   22.56 +/* noexec=on|off
   22.57 +Control non executable mappings for 64bit processes.
   22.58 +
   22.59 +on	Enable(default)
   22.60 +off	Disable
   22.61 +*/ 
   22.62 +int __init nonx_setup(char *str)
   22.63 +{
   22.64 +	if (!strcmp(str, "on")) {
   22.65 +                __supported_pte_mask |= _PAGE_NX; 
   22.66 + 		do_not_nx = 0; 
   22.67 +	} else if (!strncmp(str, "off", 3)) {
   22.68 +		do_not_nx = 1;
   22.69 +		__supported_pte_mask &= ~_PAGE_NX;
   22.70 +        }
   22.71 +	return 0;
   22.72 +} 
   22.73 +__setup("noexec=", nonx_setup);	/* parsed early actually */
   22.74 +
   22.75 +int force_personality32 = READ_IMPLIES_EXEC;
   22.76 +
   22.77 +/* noexec32=on|off
   22.78 +Control non executable heap for 32bit processes.
   22.79 +To control the stack too use noexec=off
   22.80 +
   22.81 +on	PROT_READ does not imply PROT_EXEC for 32bit processes
   22.82 +off	PROT_READ implies PROT_EXEC (default)
   22.83 +*/
   22.84 +static int __init nonx32_setup(char *str)
   22.85 +{
   22.86 +	if (!strcmp(str, "on"))
   22.87 +		force_personality32 &= ~READ_IMPLIES_EXEC;
   22.88 +	else if (!strcmp(str, "off"))
   22.89 +		force_personality32 |= READ_IMPLIES_EXEC;
   22.90 +	return 0;
   22.91 +}
   22.92 +__setup("noexec32=", nonx32_setup);
   22.93 +
   22.94 +/*
   22.95 + * Great future plan:
   22.96 + * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
   22.97 + * Always point %gs to its beginning
   22.98 + */
   22.99 +void __init setup_per_cpu_areas(void)
  22.100 +{ 
  22.101 +	int i;
  22.102 +	unsigned long size;
  22.103 +
  22.104 +	/* Copy section for each CPU (we discard the original) */
  22.105 +	size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
  22.106 +#ifdef CONFIG_MODULES
  22.107 +	if (size < PERCPU_ENOUGH_ROOM)
  22.108 +		size = PERCPU_ENOUGH_ROOM;
  22.109 +#endif
  22.110 +
  22.111 +	for (i = 0; i < NR_CPUS; i++) { 
  22.112 +		unsigned char *ptr;
  22.113 +
  22.114 +		if (!NODE_DATA(cpu_to_node(i))) {
  22.115 +			printk("cpu with no node %d, num_online_nodes %d\n",
  22.116 +			       i, num_online_nodes());
  22.117 +			ptr = alloc_bootmem(size);
  22.118 +		} else { 
  22.119 +			ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
  22.120 +		}
  22.121 +		if (!ptr)
  22.122 +			panic("Cannot allocate cpu data for CPU %d\n", i);
  22.123 +		cpu_pda[i].data_offset = ptr - __per_cpu_start;
  22.124 +		memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
  22.125 +	}
  22.126 +} 
  22.127 +
  22.128 +void pda_init(int cpu)
  22.129 +{ 
  22.130 +        pgd_t *old_level4 = (pgd_t *)xen_start_info.pt_base;
  22.131 +	struct x8664_pda *pda = &cpu_pda[cpu];
  22.132 +        
  22.133 +	/* Setup up data that may be needed in __get_free_pages early */
  22.134 +	asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); 
  22.135 +        HYPERVISOR_set_segment_base(SEGBASE_GS_KERNEL, 
  22.136 +                                    (unsigned long)(cpu_pda + cpu));
  22.137 +	
  22.138 +        pda->me = pda;
  22.139 +        pda->cpunumber = cpu; 
  22.140 +        pda->irqcount = -1;
  22.141 +        pda->kernelstack = 
  22.142 +                (unsigned long)stack_thread_info() - PDA_STACKOFFSET + THREAD_SIZE; 
  22.143 +        pda->active_mm = &init_mm;
  22.144 +	pda->mmu_state = 0;
  22.145 +        pda->kernel_mode = 1;
  22.146 +
  22.147 +	if (cpu == 0) {
  22.148 +                memcpy((void *)init_level4_pgt, 
  22.149 +                       (void *) xen_start_info.pt_base, PAGE_SIZE);
  22.150 +		/* others are initialized in smpboot.c */
  22.151 +		pda->pcurrent = &init_task;
  22.152 +		pda->irqstackptr = boot_cpu_stack; 
  22.153 +                make_page_readonly(init_level4_pgt);
  22.154 +                make_page_readonly(init_level4_user_pgt);
  22.155 +                make_page_readonly(level3_user_pgt); /* for vsyscall stuff */
  22.156 +                xen_pgd_pin(__pa_symbol(init_level4_user_pgt));
  22.157 +                xen_pud_pin(__pa_symbol(level3_user_pgt));
  22.158 +                set_pgd((pgd_t *)(init_level4_user_pgt + 511), 
  22.159 +                        mk_kernel_pgd(__pa_symbol(level3_user_pgt)));
  22.160 +	} else {
  22.161 +		pda->irqstackptr = (char *)
  22.162 +			__get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER);
  22.163 +		if (!pda->irqstackptr)
  22.164 +			panic("cannot allocate irqstack for cpu %d", cpu); 
  22.165 +	}
  22.166 +
  22.167 +	xen_pt_switch(__pa(init_level4_pgt));
  22.168 +        xen_new_user_pt(__pa(init_level4_user_pgt));
  22.169 +
  22.170 +	if (cpu == 0) {
  22.171 +                xen_pgd_unpin(__pa(old_level4));
  22.172 +#if 0
  22.173 +                early_printk("__pa: %x, <machine_phys> old_level 4 %x\n", 
  22.174 +                             __pa(xen_start_info.pt_base),
  22.175 +                             pfn_to_mfn(__pa(old_level4) >> PAGE_SHIFT));
  22.176 +#endif
  22.177 +//                make_page_writable(old_level4);
  22.178 +//                free_bootmem(__pa(old_level4), PAGE_SIZE);
  22.179 +        }
  22.180 +
  22.181 +	pda->irqstackptr += IRQSTACKSIZE-64;
  22.182 +} 
  22.183 +
  22.184 +char boot_exception_stacks[N_EXCEPTION_STACKS * EXCEPTION_STKSZ] 
  22.185 +__attribute__((section(".bss.page_aligned")));
  22.186 +
  22.187 +/* May not be marked __init: used by software suspend */
  22.188 +void syscall_init(void)
  22.189 +{
  22.190 +#ifdef CONFIG_IA32_EMULATION   		
  22.191 +	syscall32_cpu_init ();
  22.192 +#endif
  22.193 +}
  22.194 +
  22.195 +void __init check_efer(void)
  22.196 +{
  22.197 +	unsigned long efer;
  22.198 +
  22.199 +        /*	rdmsrl(MSR_EFER, efer);  */
  22.200 +
  22.201 +        /*
  22.202 +         * At this point, Xen does not like the bit 63.
  22.203 +         * So NX is not supported. Come back later.
  22.204 +         */
  22.205 +        efer = 0;
  22.206 +
  22.207 +        if (!(efer & EFER_NX) || do_not_nx) { 
  22.208 +                __supported_pte_mask &= ~_PAGE_NX; 
  22.209 +        }       
  22.210 +}
  22.211 +
  22.212 +void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
  22.213 +{
  22.214 +	unsigned long frames[gdt_descr->size >> PAGE_SHIFT];
  22.215 +	unsigned long va;
  22.216 +	int f;
  22.217 +
  22.218 +	for (va = gdt_descr->address, f = 0;
  22.219 +	     va < gdt_descr->address + gdt_descr->size;
  22.220 +	     va += PAGE_SIZE, f++) {
  22.221 +		frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
  22.222 +		make_page_readonly((void *)va);
  22.223 +	}
  22.224 +	flush_page_update_queue();
  22.225 +	if (HYPERVISOR_set_gdt(frames, gdt_descr->size /
  22.226 +                               sizeof (struct desc_struct)))
  22.227 +		BUG();
  22.228 +}
  22.229 +
  22.230 +
  22.231 +/*
  22.232 + * cpu_init() initializes state that is per-CPU. Some data is already
  22.233 + * initialized (naturally) in the bootstrap process, such as the GDT
  22.234 + * and IDT. We reload them nevertheless, this function acts as a
  22.235 + * 'CPU state barrier', nothing should get across.
  22.236 + * A lot of state is already set up in PDA init.
  22.237 + */
  22.238 +void __init cpu_init (void)
  22.239 +{
  22.240 +#ifdef CONFIG_SMP
  22.241 +	int cpu = stack_smp_processor_id();
  22.242 +#else
  22.243 +	int cpu = smp_processor_id();
  22.244 +#endif
  22.245 +	struct tss_struct *t = &per_cpu(init_tss, cpu);
  22.246 +	unsigned long v; 
  22.247 +	char *estacks = NULL; 
  22.248 +	struct task_struct *me;
  22.249 +	int i;
  22.250 +
  22.251 +	/* CPU 0 is initialised in head64.c */
  22.252 +	if (cpu != 0) {
  22.253 +		pda_init(cpu);
  22.254 +	} else 
  22.255 +		estacks = boot_exception_stacks; 
  22.256 +
  22.257 +	me = current;
  22.258 +
  22.259 +	if (test_and_set_bit(cpu, &cpu_initialized))
  22.260 +		panic("CPU#%d already initialized!\n", cpu);
  22.261 +
  22.262 +	printk("Initializing CPU#%d\n", cpu);
  22.263 +
  22.264 +#if 0
  22.265 +        clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
  22.266 +#endif
  22.267 +	/*
  22.268 +	 * Initialize the per-CPU GDT with the boot GDT,
  22.269 +	 * and set up the GDT descriptor:
  22.270 +	 */
  22.271 +	if (cpu) {
  22.272 +		memcpy(cpu_gdt_table[cpu], cpu_gdt_table[0], GDT_SIZE);
  22.273 +	}	
  22.274 +
  22.275 +	cpu_gdt_descr[cpu].size = GDT_SIZE;
  22.276 +	cpu_gdt_descr[cpu].address = (unsigned long)cpu_gdt_table[cpu];
  22.277 +#if 0
  22.278 +	asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
  22.279 +	asm volatile("lidt %0" :: "m" (idt_descr));
  22.280 +#endif
  22.281 +        cpu_gdt_init(&cpu_gdt_descr[cpu]);
  22.282 +
  22.283 +#if 0
  22.284 +	memcpy(me->thread.tls_array, cpu_gdt_table[cpu], GDT_ENTRY_TLS_ENTRIES * 8);
  22.285 +	
  22.286 +#endif
  22.287 + 	memcpy(me->thread.tls_array, &get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN],
  22.288 +	    GDT_ENTRY_TLS_ENTRIES * 8);
  22.289 +       
  22.290 +        /*
  22.291 +	 * Delete NT
  22.292 +	 */
  22.293 +
  22.294 +	asm volatile("pushfq ; popq %%rax ; btr $14,%%rax ; pushq %%rax ; popfq" ::: "eax");
  22.295 +
  22.296 +	if (cpu == 0) 
  22.297 +		early_identify_cpu(&boot_cpu_data);
  22.298 +
  22.299 +	syscall_init();
  22.300 +
  22.301 +	barrier(); 
  22.302 +	check_efer();
  22.303 +
  22.304 +	/*
  22.305 +	 * set up and load the per-CPU TSS
  22.306 +	 */
  22.307 +	for (v = 0; v < N_EXCEPTION_STACKS; v++) {
  22.308 +		if (cpu) {
  22.309 +			estacks = (char *)__get_free_pages(GFP_ATOMIC, 
  22.310 +						   EXCEPTION_STACK_ORDER);
  22.311 +			if (!estacks)
  22.312 +				panic("Cannot allocate exception stack %ld %d\n",
  22.313 +				      v, cpu); 
  22.314 +		}
  22.315 +		estacks += EXCEPTION_STKSZ;
  22.316 +		t->ist[v] = (unsigned long)estacks;
  22.317 +	}
  22.318 +
  22.319 +	t->io_bitmap_base = offsetof(struct tss_struct, io_bitmap);
  22.320 +	/*
  22.321 +	 * <= is required because the CPU will access up to
  22.322 +	 * 8 bits beyond the end of the IO permission bitmap.
  22.323 +	 */
  22.324 +	for (i = 0; i <= IO_BITMAP_LONGS; i++)
  22.325 +		t->io_bitmap[i] = ~0UL;
  22.326 +
  22.327 +	atomic_inc(&init_mm.mm_count);
  22.328 +	me->active_mm = &init_mm;
  22.329 +	if (me->mm)
  22.330 +		BUG();
  22.331 +	enter_lazy_tlb(&init_mm, me);
  22.332 +
  22.333 +	load_LDT(&init_mm.context);
  22.334 +        flush_page_update_queue();
  22.335 +
  22.336 +#if 0                         
  22.337 +	/*
  22.338 +	 * Clear all 6 debug registers:
  22.339 +	 */
  22.340 +#define CD(register) HYPERVISOR_set_debugreg(register, 0)
  22.341 +
  22.342 +	CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
  22.343 +
  22.344 +#undef CD
  22.345 +#endif
  22.346 +#if 0
  22.347 +	fpu_init(); 
  22.348 +#endif
  22.349 +
  22.350 +#ifdef CONFIG_NUMA
  22.351 +	numa_add_cpu(cpu);
  22.352 +#endif
  22.353 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/signal.c	Sat Apr 02 20:27:11 2005 +0000
    23.3 @@ -0,0 +1,493 @@
    23.4 +/*
    23.5 + *  linux/arch/x86_64/kernel/signal.c
    23.6 + *
    23.7 + *  Copyright (C) 1991, 1992  Linus Torvalds
    23.8 + *  Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs
    23.9 + *
   23.10 + *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
   23.11 + *  2000-06-20  Pentium III FXSR, SSE support by Gareth Hughes
   23.12 + *  2000-2002   x86-64 support by Andi Kleen
   23.13 + * 
   23.14 + *  $Id: signal.c,v 1.18 2001/10/17 22:30:37 ak Exp $
   23.15 + */
   23.16 +
   23.17 +#include <linux/sched.h>
   23.18 +#include <linux/mm.h>
   23.19 +#include <linux/smp.h>
   23.20 +#include <linux/smp_lock.h>
   23.21 +#include <linux/kernel.h>
   23.22 +#include <linux/signal.h>
   23.23 +#include <linux/errno.h>
   23.24 +#include <linux/wait.h>
   23.25 +#include <linux/ptrace.h>
   23.26 +#include <linux/unistd.h>
   23.27 +#include <linux/stddef.h>
   23.28 +#include <linux/personality.h>
   23.29 +#include <linux/compiler.h>
   23.30 +#include <asm/ucontext.h>
   23.31 +#include <asm/uaccess.h>
   23.32 +#include <asm/i387.h>
   23.33 +#include <asm/proto.h>
   23.34 +
   23.35 +/* #define DEBUG_SIG 1 */
   23.36 +
   23.37 +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
   23.38 +
   23.39 +void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
   23.40 +               sigset_t *set, struct pt_regs * regs); 
   23.41 +void ia32_setup_frame(int sig, struct k_sigaction *ka,
   23.42 +            sigset_t *set, struct pt_regs * regs); 
   23.43 +
   23.44 +asmlinkage long
   23.45 +sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs *regs)
   23.46 +{
   23.47 +	sigset_t saveset, newset;
   23.48 +
   23.49 +	/* XXX: Don't preclude handling different sized sigset_t's.  */
   23.50 +	if (sigsetsize != sizeof(sigset_t))
   23.51 +		return -EINVAL;
   23.52 +
   23.53 +	if (copy_from_user(&newset, unewset, sizeof(newset)))
   23.54 +		return -EFAULT;
   23.55 +	sigdelsetmask(&newset, ~_BLOCKABLE);
   23.56 +
   23.57 +	spin_lock_irq(&current->sighand->siglock);
   23.58 +	saveset = current->blocked;
   23.59 +	current->blocked = newset;
   23.60 +	recalc_sigpending();
   23.61 +	spin_unlock_irq(&current->sighand->siglock);
   23.62 +#ifdef DEBUG_SIG
   23.63 +	printk("rt_sigsuspend savset(%lx) newset(%lx) regs(%p) rip(%lx)\n",
   23.64 +		saveset, newset, regs, regs->rip);
   23.65 +#endif 
   23.66 +	regs->rax = -EINTR;
   23.67 +	while (1) {
   23.68 +		current->state = TASK_INTERRUPTIBLE;
   23.69 +		schedule();
   23.70 +		if (do_signal(regs, &saveset))
   23.71 +			return -EINTR;
   23.72 +	}
   23.73 +}
   23.74 +
   23.75 +asmlinkage long
   23.76 +sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
   23.77 +		struct pt_regs *regs)
   23.78 +{
   23.79 +	return do_sigaltstack(uss, uoss, regs->rsp);
   23.80 +}
   23.81 +
   23.82 +
   23.83 +/*
   23.84 + * Do a signal return; undo the signal stack.
   23.85 + */
   23.86 +
   23.87 +struct rt_sigframe
   23.88 +{
   23.89 +	char *pretcode;
   23.90 +	struct ucontext uc;
   23.91 +	struct siginfo info;
   23.92 +};
   23.93 +
   23.94 +static int
   23.95 +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned long *prax)
   23.96 +{
   23.97 +	unsigned int err = 0;
   23.98 +
   23.99 +	/* Always make any pending restarted system calls return -EINTR */
  23.100 +	current_thread_info()->restart_block.fn = do_no_restart_syscall;
  23.101 +
  23.102 +#define COPY(x)		err |= __get_user(regs->x, &sc->x)
  23.103 +
  23.104 +	COPY(rdi); COPY(rsi); COPY(rbp); COPY(rsp); COPY(rbx);
  23.105 +	COPY(rdx); COPY(rcx); COPY(rip);
  23.106 +	COPY(r8);
  23.107 +	COPY(r9);
  23.108 +	COPY(r10);
  23.109 +	COPY(r11);
  23.110 +	COPY(r12);
  23.111 +	COPY(r13);
  23.112 +	COPY(r14);
  23.113 +	COPY(r15);
  23.114 +
  23.115 +	{
  23.116 +		unsigned int tmpflags;
  23.117 +		err |= __get_user(tmpflags, &sc->eflags);
  23.118 +		regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
  23.119 +		regs->orig_rax = -1;		/* disable syscall checks */
  23.120 +	}
  23.121 +
  23.122 +	{
  23.123 +		struct _fpstate __user * buf;
  23.124 +		err |= __get_user(buf, &sc->fpstate);
  23.125 +
  23.126 +		if (buf) {
  23.127 +			if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
  23.128 +				goto badframe;
  23.129 +			err |= restore_i387(buf);
  23.130 +		} else {
  23.131 +			struct task_struct *me = current;
  23.132 +			if (used_math()) {
  23.133 +				clear_fpu(me);
  23.134 +				clear_used_math();
  23.135 +			}
  23.136 +		}
  23.137 +	}
  23.138 +
  23.139 +	err |= __get_user(*prax, &sc->rax);
  23.140 +	return err;
  23.141 +
  23.142 +badframe:
  23.143 +	return 1;
  23.144 +}
  23.145 +
  23.146 +asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
  23.147 +{
  23.148 +	struct rt_sigframe __user *frame;
  23.149 +	sigset_t set;
  23.150 +	unsigned long eax;
  23.151 +
  23.152 +	frame = (struct rt_sigframe __user *)(regs->rsp - 8);
  23.153 +	if (verify_area(VERIFY_READ, frame, sizeof(*frame))) { 
  23.154 +		goto badframe;
  23.155 +	} 
  23.156 +	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) { 
  23.157 +		goto badframe;
  23.158 +	} 
  23.159 +
  23.160 +	sigdelsetmask(&set, ~_BLOCKABLE);
  23.161 +	spin_lock_irq(&current->sighand->siglock);
  23.162 +	current->blocked = set;
  23.163 +	recalc_sigpending();
  23.164 +	spin_unlock_irq(&current->sighand->siglock);
  23.165 +	
  23.166 +	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) {
  23.167 +		goto badframe;
  23.168 +	} 
  23.169 +
  23.170 +#ifdef DEBUG_SIG
  23.171 +	printk("%d sigreturn rip:%lx rsp:%lx frame:%p rax:%lx\n",current->pid,regs.rip,regs.rsp,frame,eax);
  23.172 +#endif
  23.173 +
  23.174 +	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->rsp) == -EFAULT)
  23.175 +		goto badframe;
  23.176 +
  23.177 +	return eax;
  23.178 +
  23.179 +badframe:
  23.180 +	signal_fault(regs,frame,"sigreturn");
  23.181 +	return 0;
  23.182 +}	
  23.183 +
  23.184 +/*
  23.185 + * Set up a signal frame.
  23.186 + */
  23.187 +
  23.188 +static inline int
  23.189 +setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask, struct task_struct *me)
  23.190 +{
  23.191 +	int err = 0;
  23.192 +	unsigned long eflags;
  23.193 +
  23.194 +	err |= __put_user(0, &sc->gs);
  23.195 +	err |= __put_user(0, &sc->fs);
  23.196 +
  23.197 +	err |= __put_user(regs->rdi, &sc->rdi);
  23.198 +	err |= __put_user(regs->rsi, &sc->rsi);
  23.199 +	err |= __put_user(regs->rbp, &sc->rbp);
  23.200 +	err |= __put_user(regs->rsp, &sc->rsp);
  23.201 +	err |= __put_user(regs->rbx, &sc->rbx);
  23.202 +	err |= __put_user(regs->rdx, &sc->rdx);
  23.203 +	err |= __put_user(regs->rcx, &sc->rcx);
  23.204 +	err |= __put_user(regs->rax, &sc->rax);
  23.205 +	err |= __put_user(regs->r8, &sc->r8);
  23.206 +	err |= __put_user(regs->r9, &sc->r9);
  23.207 +	err |= __put_user(regs->r10, &sc->r10);
  23.208 +	err |= __put_user(regs->r11, &sc->r11);
  23.209 +	err |= __put_user(regs->r12, &sc->r12);
  23.210 +	err |= __put_user(regs->r13, &sc->r13);
  23.211 +	err |= __put_user(regs->r14, &sc->r14);
  23.212 +	err |= __put_user(regs->r15, &sc->r15);
  23.213 +	err |= __put_user(me->thread.trap_no, &sc->trapno);
  23.214 +	err |= __put_user(me->thread.error_code, &sc->err);
  23.215 +	err |= __put_user(regs->rip, &sc->rip);
  23.216 +	eflags = regs->eflags;
  23.217 +	if (current->ptrace & PT_PTRACED) {
  23.218 +		eflags &= ~TF_MASK;
  23.219 +	}
  23.220 +	err |= __put_user(eflags, &sc->eflags);
  23.221 +	err |= __put_user(mask, &sc->oldmask);
  23.222 +	err |= __put_user(me->thread.cr2, &sc->cr2);
  23.223 +
  23.224 +	return err;
  23.225 +}
  23.226 +
  23.227 +/*
  23.228 + * Determine which stack to use..
  23.229 + */
  23.230 +
  23.231 +static void __user *
  23.232 +get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size)
  23.233 +{
  23.234 +	unsigned long rsp;
  23.235 +
  23.236 +	/* Default to using normal stack - redzone*/
  23.237 +	rsp = regs->rsp - 128;
  23.238 +
  23.239 +	/* This is the X/Open sanctioned signal stack switching.  */
  23.240 +	/* RED-PEN: redzone on that stack? */
  23.241 +	if (ka->sa.sa_flags & SA_ONSTACK) {
  23.242 +		if (sas_ss_flags(rsp) == 0)
  23.243 +			rsp = current->sas_ss_sp + current->sas_ss_size;
  23.244 +	}
  23.245 +
  23.246 +	return (void __user *)round_down(rsp - size, 16); 
  23.247 +}
  23.248 +
  23.249 +static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
  23.250 +			   sigset_t *set, struct pt_regs * regs)
  23.251 +{
  23.252 +	struct rt_sigframe __user *frame;
  23.253 +	struct _fpstate __user *fp = NULL; 
  23.254 +	int err = 0;
  23.255 +	struct task_struct *me = current;
  23.256 +
  23.257 +	if (used_math()) {
  23.258 +		fp = get_stack(ka, regs, sizeof(struct _fpstate)); 
  23.259 +		frame = (void __user *)round_down((unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8;
  23.260 +
  23.261 +		if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) { 
  23.262 +		goto give_sigsegv;
  23.263 +		}
  23.264 +
  23.265 +		if (save_i387(fp) < 0) 
  23.266 +			err |= -1; 
  23.267 +	} else {
  23.268 +		frame = get_stack(ka, regs, sizeof(struct rt_sigframe)) - 8;
  23.269 +	}
  23.270 +
  23.271 +	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) {
  23.272 +		goto give_sigsegv;
  23.273 +	}
  23.274 +
  23.275 +	if (ka->sa.sa_flags & SA_SIGINFO) { 
  23.276 +		err |= copy_siginfo_to_user(&frame->info, info);
  23.277 +		if (err) { 
  23.278 +			goto give_sigsegv;
  23.279 +	}
  23.280 +	}
  23.281 +		
  23.282 +	/* Create the ucontext.  */
  23.283 +	err |= __put_user(0, &frame->uc.uc_flags);
  23.284 +	err |= __put_user(0, &frame->uc.uc_link);
  23.285 +	err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
  23.286 +	err |= __put_user(sas_ss_flags(regs->rsp),
  23.287 +			  &frame->uc.uc_stack.ss_flags);
  23.288 +	err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
  23.289 +	err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0], me);
  23.290 +	err |= __put_user(fp, &frame->uc.uc_mcontext.fpstate);
  23.291 +	if (sizeof(*set) == 16) { 
  23.292 +		__put_user(set->sig[0], &frame->uc.uc_sigmask.sig[0]);
  23.293 +		__put_user(set->sig[1], &frame->uc.uc_sigmask.sig[1]); 
  23.294 +	} else { 		
  23.295 +	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
  23.296 +	}
  23.297 +
  23.298 +	/* Set up to return from userspace.  If provided, use a stub
  23.299 +	   already in userspace.  */
  23.300 +	/* x86-64 should always use SA_RESTORER. */
  23.301 +	if (ka->sa.sa_flags & SA_RESTORER) {
  23.302 +		err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
  23.303 +	} else {
  23.304 +		/* could use a vstub here */
  23.305 +		goto give_sigsegv; 
  23.306 +	}
  23.307 +
  23.308 +	if (err) { 
  23.309 +		goto give_sigsegv;
  23.310 +	} 
  23.311 +
  23.312 +#ifdef DEBUG_SIG
  23.313 +	printk("%d old rip %lx old rsp %lx old rax %lx\n", current->pid,regs->rip,regs->rsp,regs->rax);
  23.314 +#endif
  23.315 +
  23.316 +	/* Set up registers for signal handler */
  23.317 +	{ 
  23.318 +		struct exec_domain *ed = current_thread_info()->exec_domain;
  23.319 +		if (unlikely(ed && ed->signal_invmap && sig < 32))
  23.320 +			sig = ed->signal_invmap[sig];
  23.321 +	} 
  23.322 +	regs->rdi = sig;
  23.323 +	/* In case the signal handler was declared without prototypes */ 
  23.324 +	regs->rax = 0;	
  23.325 +
  23.326 +	/* This also works for non SA_SIGINFO handlers because they expect the
  23.327 +	   next argument after the signal number on the stack. */
  23.328 +	regs->rsi = (unsigned long)&frame->info; 
  23.329 +	regs->rdx = (unsigned long)&frame->uc; 
  23.330 +	regs->rip = (unsigned long) ka->sa.sa_handler;
  23.331 +
  23.332 +	regs->rsp = (unsigned long)frame;
  23.333 +
  23.334 +	set_fs(USER_DS);
  23.335 +	if (regs->eflags & TF_MASK) {
  23.336 +		if ((current->ptrace & (PT_PTRACED | PT_DTRACE)) == (PT_PTRACED | PT_DTRACE)) {
  23.337 +			ptrace_notify(SIGTRAP);
  23.338 +		} else {
  23.339 +			regs->eflags &= ~TF_MASK;
  23.340 +		}
  23.341 +	}
  23.342 +
  23.343 +#ifdef DEBUG_SIG
  23.344 +	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
  23.345 +		current->comm, current->pid, frame, regs->rip, frame->pretcode);
  23.346 +#endif
  23.347 +
  23.348 +	return;
  23.349 +
  23.350 +give_sigsegv:
  23.351 +	force_sigsegv(sig, current);
  23.352 +}
  23.353 +
  23.354 +/*
  23.355 + * OK, we're invoking a handler
  23.356 + */	
  23.357 +
  23.358 +static void
  23.359 +handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
  23.360 +		sigset_t *oldset, struct pt_regs *regs)
  23.361 +{
  23.362 +#ifdef DEBUG_SIG
  23.363 +	printk("handle_signal pid:%d sig:%lu rip:%lx rsp:%lx regs=%p\n", current->pid, sig, 
  23.364 +		regs->rip, regs->rsp, regs);
  23.365 +#endif
  23.366 +
  23.367 +	/* Are we from a system call? */
  23.368 +	if ((long)regs->orig_rax >= 0) {
  23.369 +		/* If so, check system call restarting.. */
  23.370 +		switch (regs->rax) {
  23.371 +		        case -ERESTART_RESTARTBLOCK:
  23.372 +			case -ERESTARTNOHAND:
  23.373 +				regs->rax = -EINTR;
  23.374 +				break;
  23.375 +
  23.376 +			case -ERESTARTSYS:
  23.377 +				if (!(ka->sa.sa_flags & SA_RESTART)) {
  23.378 +					regs->rax = -EINTR;
  23.379 +					break;
  23.380 +				}
  23.381 +			/* fallthrough */
  23.382 +			case -ERESTARTNOINTR:
  23.383 +				regs->rax = regs->orig_rax;
  23.384 +				regs->rip -= 2;
  23.385 +		}
  23.386 +	}
  23.387 +
  23.388 +#ifdef CONFIG_IA32_EMULATION
  23.389 +	if (test_thread_flag(TIF_IA32)) {
  23.390 +		if (ka->sa.sa_flags & SA_SIGINFO)
  23.391 +			ia32_setup_rt_frame(sig, ka, info, oldset, regs);
  23.392 +		else
  23.393 +			ia32_setup_frame(sig, ka, oldset, regs);
  23.394 +	} else 
  23.395 +#endif
  23.396 +	setup_rt_frame(sig, ka, info, oldset, regs);
  23.397 +
  23.398 +	if (!(ka->sa.sa_flags & SA_NODEFER)) {
  23.399 +		spin_lock_irq(&current->sighand->siglock);
  23.400 +		sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
  23.401 +		sigaddset(&current->blocked,sig);
  23.402 +		recalc_sigpending();
  23.403 +		spin_unlock_irq(&current->sighand->siglock);
  23.404 +	}
  23.405 +}
  23.406 +
  23.407 +/*
  23.408 + * Note that 'init' is a special process: it doesn't get signals it doesn't
  23.409 + * want to handle. Thus you cannot kill init even with a SIGKILL even by
  23.410 + * mistake.
  23.411 + */
  23.412 +int do_signal(struct pt_regs *regs, sigset_t *oldset)
  23.413 +{
  23.414 +	struct k_sigaction ka;
  23.415 +	siginfo_t info;
  23.416 +	int signr;
  23.417 +
  23.418 +	/*
  23.419 +	 * We want the common case to go fast, which
  23.420 +	 * is why we may in certain cases get here from
  23.421 +	 * kernel mode. Just return without doing anything
  23.422 +	 * if so.
  23.423 +	 */
  23.424 +	if ((regs->cs & 2) != 2) {
  23.425 +		return 1;
  23.426 +	} 	
  23.427 +
  23.428 +	if (try_to_freeze(0))
  23.429 +		goto no_signal;
  23.430 +
  23.431 +	if (!oldset)
  23.432 +		oldset = &current->blocked;
  23.433 +
  23.434 +	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
  23.435 +	if (signr > 0) {
  23.436 +		/* Reenable any watchpoints before delivering the
  23.437 +		 * signal to user space. The processor register will
  23.438 +		 * have been cleared if the watchpoint triggered
  23.439 +		 * inside the kernel.
  23.440 +		 */
  23.441 +                if (current->thread.debugreg7) {
  23.442 +                        HYPERVISOR_set_debugreg(7,
  23.443 +						current->thread.debugreg7);
  23.444 +		}
  23.445 +
  23.446 +		/* Whee!  Actually deliver the signal.  */
  23.447 +		handle_signal(signr, &info, &ka, oldset, regs);
  23.448 +		return 1;
  23.449 +	}
  23.450 +
  23.451 + no_signal:
  23.452 +	/* Did we come from a system call? */
  23.453 +	if ((long)regs->orig_rax >= 0) {
  23.454 +		/* Restart the system call - no handlers present */
  23.455 +		long res = regs->rax;
  23.456 +		if (res == -ERESTARTNOHAND ||
  23.457 +		    res == -ERESTARTSYS ||
  23.458 +		    res == -ERESTARTNOINTR) {
  23.459 +			regs->rax = regs->orig_rax;
  23.460 +			regs->rip -= 2;
  23.461 +		}
  23.462 +		if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) {
  23.463 +			regs->rax = __NR_restart_syscall;
  23.464 +			regs->rip -= 2;
  23.465 +		}
  23.466 +	}
  23.467 +	return 0;
  23.468 +}
  23.469 +
  23.470 +void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, __u32 thread_info_flags)
  23.471 +{
  23.472 +#ifdef DEBUG_SIG
  23.473 +	printk("do_notify_resume flags:%x rip:%lx rsp:%lx caller:%lx pending:%lx\n",
  23.474 +	       thread_info_flags, regs->rip, regs->rsp, __builtin_return_address(0),signal_pending(current)); 
  23.475 +#endif
  23.476 +	       
  23.477 +	/* Pending single-step? */
  23.478 +	if (thread_info_flags & _TIF_SINGLESTEP) {
  23.479 +		regs->eflags |= TF_MASK;
  23.480 +		clear_thread_flag(TIF_SINGLESTEP);
  23.481 +	}
  23.482 +
  23.483 +	/* deal with pending signal delivery */
  23.484 +	if (thread_info_flags & _TIF_SIGPENDING)
  23.485 +		do_signal(regs,oldset);
  23.486 +}
  23.487 +
  23.488 +void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
  23.489 +{ 
  23.490 +	struct task_struct *me = current; 
  23.491 +	if (exception_trace)
  23.492 +		printk("%s[%d] bad frame in %s frame:%p rip:%lx rsp:%lx orax:%lx\n",
  23.493 +	       me->comm,me->pid,where,frame,regs->rip,regs->rsp,regs->orig_rax); 
  23.494 +
  23.495 +	force_sig(SIGSEGV, me); 
  23.496 +} 
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smp.c	Sat Apr 02 20:27:11 2005 +0000
    24.3 @@ -0,0 +1,411 @@
    24.4 +/*
    24.5 + *	Intel SMP support routines.
    24.6 + *
    24.7 + *	(c) 1995 Alan Cox, Building #3 <alan@redhat.com>
    24.8 + *	(c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com>
    24.9 + *      (c) 2002,2003 Andi Kleen, SuSE Labs.
   24.10 + *
   24.11 + *	This code is released under the GNU General Public License version 2 or
   24.12 + *	later.
   24.13 + */
   24.14 +
   24.15 +#include <linux/init.h>
   24.16 +
   24.17 +#include <linux/mm.h>
   24.18 +#include <linux/irq.h>
   24.19 +#include <linux/delay.h>
   24.20 +#include <linux/spinlock.h>
   24.21 +#include <linux/smp_lock.h>
   24.22 +#include <linux/smp.h>
   24.23 +#include <linux/kernel_stat.h>
   24.24 +#include <linux/mc146818rtc.h>
   24.25 +#include <linux/interrupt.h>
   24.26 +
   24.27 +#include <asm/mtrr.h>
   24.28 +#include <asm/pgalloc.h>
   24.29 +#include <asm/tlbflush.h>
   24.30 +#include <asm/mach_apic.h>
   24.31 +#include <asm/proto.h>
   24.32 +
   24.33 +/*
   24.34 + *	Smarter SMP flushing macros. 
   24.35 + *		c/o Linus Torvalds.
   24.36 + *
   24.37 + *	These mean you can really definitely utterly forget about
   24.38 + *	writing to user space from interrupts. (Its not allowed anyway).
   24.39 + *
   24.40 + *	Optimizations Manfred Spraul <manfred@colorfullife.com>
   24.41 + */
   24.42 +
   24.43 +static cpumask_t flush_cpumask;
   24.44 +static struct mm_struct * flush_mm;
   24.45 +static unsigned long flush_va;
   24.46 +static DEFINE_SPINLOCK(tlbstate_lock);
   24.47 +#define FLUSH_ALL	0xffffffff
   24.48 +
   24.49 +/*
   24.50 + * We cannot call mmdrop() because we are in interrupt context, 
   24.51 + * instead update mm->cpu_vm_mask.
   24.52 + */
   24.53 +static inline void leave_mm (unsigned long cpu)
   24.54 +{
   24.55 +	if (read_pda(mmu_state) == TLBSTATE_OK)
   24.56 +		BUG();
   24.57 +	clear_bit(cpu, &read_pda(active_mm)->cpu_vm_mask);
   24.58 +	__flush_tlb();
   24.59 +}
   24.60 +
   24.61 +/*
   24.62 + *
   24.63 + * The flush IPI assumes that a thread switch happens in this order:
   24.64 + * [cpu0: the cpu that switches]
   24.65 + * 1) switch_mm() either 1a) or 1b)
   24.66 + * 1a) thread switch to a different mm
   24.67 + * 1a1) clear_bit(cpu, &old_mm->cpu_vm_mask);
   24.68 + * 	Stop ipi delivery for the old mm. This is not synchronized with
   24.69 + * 	the other cpus, but smp_invalidate_interrupt ignore flush ipis
   24.70 + * 	for the wrong mm, and in the worst case we perform a superfluous
   24.71 + * 	tlb flush.
   24.72 + * 1a2) set cpu mmu_state to TLBSTATE_OK
   24.73 + * 	Now the smp_invalidate_interrupt won't call leave_mm if cpu0
   24.74 + *	was in lazy tlb mode.
   24.75 + * 1a3) update cpu active_mm
   24.76 + * 	Now cpu0 accepts tlb flushes for the new mm.
   24.77 + * 1a4) set_bit(cpu, &new_mm->cpu_vm_mask);
   24.78 + * 	Now the other cpus will send tlb flush ipis.
   24.79 + * 1a4) change cr3.
   24.80 + * 1b) thread switch without mm change
   24.81 + *	cpu active_mm is correct, cpu0 already handles
   24.82 + *	flush ipis.
   24.83 + * 1b1) set cpu mmu_state to TLBSTATE_OK
   24.84 + * 1b2) test_and_set the cpu bit in cpu_vm_mask.
   24.85 + * 	Atomically set the bit [other cpus will start sending flush ipis],
   24.86 + * 	and test the bit.
   24.87 + * 1b3) if the bit was 0: leave_mm was called, flush the tlb.
   24.88 + * 2) switch %%esp, ie current
   24.89 + *
   24.90 + * The interrupt must handle 2 special cases:
   24.91 + * - cr3 is changed before %%esp, ie. it cannot use current->{active_,}mm.
   24.92 + * - the cpu performs speculative tlb reads, i.e. even if the cpu only
   24.93 + *   runs in kernel space, the cpu could load tlb entries for user space
   24.94 + *   pages.
   24.95 + *
   24.96 + * The good news is that cpu mmu_state is local to each cpu, no
   24.97 + * write/read ordering problems.
   24.98 + */
   24.99 +
  24.100 +/*
  24.101 + * TLB flush IPI:
  24.102 + *
  24.103 + * 1) Flush the tlb entries if the cpu uses the mm that's being flushed.
  24.104 + * 2) Leave the mm if we are in the lazy tlb mode.
  24.105 + */
  24.106 +
  24.107 +asmlinkage void smp_invalidate_interrupt (void)
  24.108 +{
  24.109 +	unsigned long cpu;
  24.110 +
  24.111 +	cpu = get_cpu();
  24.112 +
  24.113 +	if (!cpu_isset(cpu, flush_cpumask))
  24.114 +		goto out;
  24.115 +		/* 
  24.116 +		 * This was a BUG() but until someone can quote me the
  24.117 +		 * line from the intel manual that guarantees an IPI to
  24.118 +		 * multiple CPUs is retried _only_ on the erroring CPUs
  24.119 +		 * its staying as a return
  24.120 +		 *
  24.121 +		 * BUG();
  24.122 +		 */
  24.123 +		 
  24.124 +	if (flush_mm == read_pda(active_mm)) {
  24.125 +		if (read_pda(mmu_state) == TLBSTATE_OK) {
  24.126 +			if (flush_va == FLUSH_ALL)
  24.127 +				local_flush_tlb();
  24.128 +			else
  24.129 +				__flush_tlb_one(flush_va);
  24.130 +		} else
  24.131 +			leave_mm(cpu);
  24.132 +	}
  24.133 +	ack_APIC_irq();
  24.134 +	cpu_clear(cpu, flush_cpumask);
  24.135 +
  24.136 +out:
  24.137 +	put_cpu_no_resched();
  24.138 +}
  24.139 +
  24.140 +static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
  24.141 +						unsigned long va)
  24.142 +{
  24.143 +	cpumask_t tmp;
  24.144 +	/*
  24.145 +	 * A couple of (to be removed) sanity checks:
  24.146 +	 *
  24.147 +	 * - we do not send IPIs to not-yet booted CPUs.
  24.148 +	 * - current CPU must not be in mask
  24.149 +	 * - mask must exist :)
  24.150 +	 */
  24.151 +	BUG_ON(cpus_empty(cpumask));
  24.152 +	cpus_and(tmp, cpumask, cpu_online_map);
  24.153 +	BUG_ON(!cpus_equal(tmp, cpumask));
  24.154 +	BUG_ON(cpu_isset(smp_processor_id(), cpumask));
  24.155 +	if (!mm)
  24.156 +		BUG();
  24.157 +
  24.158 +	/*
  24.159 +	 * I'm not happy about this global shared spinlock in the
  24.160 +	 * MM hot path, but we'll see how contended it is.
  24.161 +	 * Temporarily this turns IRQs off, so that lockups are
  24.162 +	 * detected by the NMI watchdog.
  24.163 +	 */
  24.164 +	spin_lock(&tlbstate_lock);
  24.165 +	
  24.166 +	flush_mm = mm;
  24.167 +	flush_va = va;
  24.168 +	cpus_or(flush_cpumask, cpumask, flush_cpumask);
  24.169 +
  24.170 +	/*
  24.171 +	 * We have to send the IPI only to
  24.172 +	 * CPUs affected.
  24.173 +	 */
  24.174 +	send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR);
  24.175 +
  24.176 +	while (!cpus_empty(flush_cpumask))
  24.177 +		mb();	/* nothing. lockup detection does not belong here */;
  24.178 +
  24.179 +	flush_mm = NULL;
  24.180 +	flush_va = 0;
  24.181 +	spin_unlock(&tlbstate_lock);
  24.182 +}
  24.183 +	
  24.184 +void flush_tlb_current_task(void)
  24.185 +{
  24.186 +	struct mm_struct *mm = current->mm;
  24.187 +	cpumask_t cpu_mask;
  24.188 +
  24.189 +	preempt_disable();
  24.190 +	cpu_mask = mm->cpu_vm_mask;
  24.191 +	cpu_clear(smp_processor_id(), cpu_mask);
  24.192 +
  24.193 +	local_flush_tlb();
  24.194 +	if (!cpus_empty(cpu_mask))
  24.195 +		flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
  24.196 +	preempt_enable();
  24.197 +}
  24.198 +
  24.199 +void flush_tlb_mm (struct mm_struct * mm)
  24.200 +{
  24.201 +	cpumask_t cpu_mask;
  24.202 +
  24.203 +	preempt_disable();
  24.204 +	cpu_mask = mm->cpu_vm_mask;
  24.205 +	cpu_clear(smp_processor_id(), cpu_mask);
  24.206 +
  24.207 +	if (current->active_mm == mm) {
  24.208 +		if (current->mm)
  24.209 +			local_flush_tlb();
  24.210 +		else
  24.211 +			leave_mm(smp_processor_id());
  24.212 +	}
  24.213 +	if (!cpus_empty(cpu_mask))
  24.214 +		flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
  24.215 +
  24.216 +	preempt_enable();
  24.217 +}
  24.218 +
  24.219 +void flush_tlb_page(struct vm_area_struct * vma, unsigned long va)
  24.220 +{
  24.221 +	struct mm_struct *mm = vma->vm_mm;
  24.222 +	cpumask_t cpu_mask;
  24.223 +
  24.224 +	preempt_disable();
  24.225 +	cpu_mask = mm->cpu_vm_mask;
  24.226 +	cpu_clear(smp_processor_id(), cpu_mask);
  24.227 +
  24.228 +	if (current->active_mm == mm) {
  24.229 +		if(current->mm)
  24.230 +			__flush_tlb_one(va);
  24.231 +		 else
  24.232 +		 	leave_mm(smp_processor_id());
  24.233 +	}
  24.234 +
  24.235 +	if (!cpus_empty(cpu_mask))
  24.236 +		flush_tlb_others(cpu_mask, mm, va);
  24.237 +
  24.238 +	preempt_enable();
  24.239 +}
  24.240 +
  24.241 +static void do_flush_tlb_all(void* info)
  24.242 +{
  24.243 +	unsigned long cpu = smp_processor_id();
  24.244 +
  24.245 +	__flush_tlb_all();
  24.246 +	if (read_pda(mmu_state) == TLBSTATE_LAZY)
  24.247 +		leave_mm(cpu);
  24.248 +}
  24.249 +
  24.250 +void flush_tlb_all(void)
  24.251 +{
  24.252 +	on_each_cpu(do_flush_tlb_all, NULL, 1, 1);
  24.253 +}
  24.254 +
  24.255 +void smp_kdb_stop(void)
  24.256 +{
  24.257 +	send_IPI_allbutself(KDB_VECTOR);
  24.258 +}
  24.259 +
  24.260 +/*
  24.261 + * this function sends a 'reschedule' IPI to another CPU.
  24.262 + * it goes straight through and wastes no time serializing
  24.263 + * anything. Worst case is that we lose a reschedule ...
  24.264 + */
  24.265 +
  24.266 +void smp_send_reschedule(int cpu)
  24.267 +{
  24.268 +	send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
  24.269 +}
  24.270 +
  24.271 +/*
  24.272 + * Structure and data for smp_call_function(). This is designed to minimise
  24.273 + * static memory requirements. It also looks cleaner.
  24.274 + */
  24.275 +static DEFINE_SPINLOCK(call_lock);
  24.276 +
  24.277 +struct call_data_struct {
  24.278 +	void (*func) (void *info);
  24.279 +	void *info;
  24.280 +	atomic_t started;
  24.281 +	atomic_t finished;
  24.282 +	int wait;
  24.283 +};
  24.284 +
  24.285 +static struct call_data_struct * call_data;
  24.286 +
  24.287 +/*
  24.288 + * this function sends a 'generic call function' IPI to all other CPUs
  24.289 + * in the system.
  24.290 + */
  24.291 +static void __smp_call_function (void (*func) (void *info), void *info,
  24.292 +				int nonatomic, int wait)
  24.293 +{
  24.294 +	struct call_data_struct data;
  24.295 +	int cpus = num_online_cpus()-1;
  24.296 +
  24.297 +	if (!cpus)
  24.298 +		return;
  24.299 +
  24.300 +	data.func = func;
  24.301 +	data.info = info;
  24.302 +	atomic_set(&data.started, 0);
  24.303 +	data.wait = wait;
  24.304 +	if (wait)
  24.305 +		atomic_set(&data.finished, 0);
  24.306 +
  24.307 +	call_data = &data;
  24.308 +	wmb();
  24.309 +	/* Send a message to all other CPUs and wait for them to respond */
  24.310 +	send_IPI_allbutself(CALL_FUNCTION_VECTOR);
  24.311 +
  24.312 +	/* Wait for response */
  24.313 +	while (atomic_read(&data.started) != cpus)
  24.314 +		cpu_relax();
  24.315 +
  24.316 +	if (!wait)
  24.317 +		return;
  24.318 +
  24.319 +	while (atomic_read(&data.finished) != cpus)
  24.320 +		cpu_relax();
  24.321 +}
  24.322 +
  24.323 +/*
  24.324 + * smp_call_function - run a function on all other CPUs.
  24.325 + * @func: The function to run. This must be fast and non-blocking.
  24.326 + * @info: An arbitrary pointer to pass to the function.
  24.327 + * @nonatomic: currently unused.
  24.328 + * @wait: If true, wait (atomically) until function has completed on other
  24.329 + *        CPUs.
  24.330 + *
  24.331 + * Returns 0 on success, else a negative status code. Does not return until
  24.332 + * remote CPUs are nearly ready to execute func or are or have executed.
  24.333 + *
  24.334 + * You must not call this function with disabled interrupts or from a
  24.335 + * hardware interrupt handler or from a bottom half handler.
  24.336 + * Actually there are a few legal cases, like panic.
  24.337 + */
  24.338 +int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
  24.339 +			int wait)
  24.340 +{
  24.341 +	spin_lock(&call_lock);
  24.342 +	__smp_call_function(func,info,nonatomic,wait);
  24.343 +	spin_unlock(&call_lock);
  24.344 +	return 0;
  24.345 +}
  24.346 +
  24.347 +void smp_stop_cpu(void)
  24.348 +{
  24.349 +	/*
  24.350 +	 * Remove this CPU:
  24.351 +	 */
  24.352 +	cpu_clear(smp_processor_id(), cpu_online_map);
  24.353 +	local_irq_disable();
  24.354 +	disable_local_APIC();
  24.355 +	local_irq_enable(); 
  24.356 +}
  24.357 +
  24.358 +static void smp_really_stop_cpu(void *dummy)
  24.359 +{
  24.360 +	smp_stop_cpu(); 
  24.361 +	for (;;) 
  24.362 +		asm("hlt"); 
  24.363 +} 
  24.364 +
  24.365 +void smp_send_stop(void)
  24.366 +{
  24.367 +	int nolock = 0;
  24.368 +	if (reboot_force)
  24.369 +		return;
  24.370 +	/* Don't deadlock on the call lock in panic */
  24.371 +	if (!spin_trylock(&call_lock)) {
  24.372 +		/* ignore locking because we have paniced anyways */
  24.373 +		nolock = 1;
  24.374 +	}
  24.375 +	__smp_call_function(smp_really_stop_cpu, NULL, 0, 0);
  24.376 +	if (!nolock)
  24.377 +		spin_unlock(&call_lock);
  24.378 +	smp_stop_cpu();
  24.379 +}
  24.380 +
  24.381 +/*
  24.382 + * Reschedule call back. Nothing to do,
  24.383 + * all the work is done automatically when
  24.384 + * we return from the interrupt.
  24.385 + */
  24.386 +asmlinkage void smp_reschedule_interrupt(void)
  24.387 +{
  24.388 +	ack_APIC_irq();
  24.389 +}
  24.390 +
  24.391 +asmlinkage void smp_call_function_interrupt(void)
  24.392 +{
  24.393 +	void (*func) (void *info) = call_data->func;
  24.394 +	void *info = call_data->info;
  24.395 +	int wait = call_data->wait;
  24.396 +
  24.397 +	ack_APIC_irq();
  24.398 +	/*
  24.399 +	 * Notify initiating CPU that I've grabbed the data and am
  24.400 +	 * about to execute the function
  24.401 +	 */
  24.402 +	mb();
  24.403 +	atomic_inc(&call_data->started);
  24.404 +	/*
  24.405 +	 * At this point the info structure may be out of scope unless wait==1
  24.406 +	 */
  24.407 +	irq_enter();
  24.408 +	(*func)(info);
  24.409 +	irq_exit();
  24.410 +	if (wait) {
  24.411 +		mb();
  24.412 +		atomic_inc(&call_data->finished);
  24.413 +	}
  24.414 +}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/smpboot.c	Sat Apr 02 20:27:11 2005 +0000
    25.3 @@ -0,0 +1,958 @@
    25.4 +/*
    25.5 + *	x86 SMP booting functions
    25.6 + *
    25.7 + *	(c) 1995 Alan Cox, Building #3 <alan@redhat.com>
    25.8 + *	(c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
    25.9 + *	Copyright 2001 Andi Kleen, SuSE Labs.
   25.10 + *
   25.11 + *	Much of the core SMP work is based on previous work by Thomas Radke, to
   25.12 + *	whom a great many thanks are extended.
   25.13 + *
   25.14 + *	Thanks to Intel for making available several different Pentium,
   25.15 + *	Pentium Pro and Pentium-II/Xeon MP machines.
   25.16 + *	Original development of Linux SMP code supported by Caldera.
   25.17 + *
   25.18 + *	This code is released under the GNU General Public License version 2 or
   25.19 + *	later.
   25.20 + *
   25.21 + *	Fixes
   25.22 + *		Felix Koop	:	NR_CPUS used properly
   25.23 + *		Jose Renau	:	Handle single CPU case.
   25.24 + *		Alan Cox	:	By repeated request 8) - Total BogoMIP report.
   25.25 + *		Greg Wright	:	Fix for kernel stacks panic.
   25.26 + *		Erich Boleyn	:	MP v1.4 and additional changes.
   25.27 + *	Matthias Sattler	:	Changes for 2.1 kernel map.
   25.28 + *	Michel Lespinasse	:	Changes for 2.1 kernel map.
   25.29 + *	Michael Chastain	:	Change trampoline.S to gnu as.
   25.30 + *		Alan Cox	:	Dumb bug: 'B' step PPro's are fine
   25.31 + *		Ingo Molnar	:	Added APIC timers, based on code
   25.32 + *					from Jose Renau
   25.33 + *		Ingo Molnar	:	various cleanups and rewrites
   25.34 + *		Tigran Aivazian	:	fixed "0.00 in /proc/uptime on SMP" bug.
   25.35 + *	Maciej W. Rozycki	:	Bits for genuine 82489DX APICs
   25.36 + *	Andi Kleen		:	Changed for SMP boot into long mode.
   25.37 + *		Rusty Russell	:	Hacked into shape for new "hotplug" boot process. 
   25.38 + */
   25.39 +
   25.40 +#include <linux/config.h>
   25.41 +#include <linux/init.h>
   25.42 +
   25.43 +#include <linux/mm.h>
   25.44 +#include <linux/kernel_stat.h>
   25.45 +#include <linux/smp_lock.h>
   25.46 +#include <linux/irq.h>
   25.47 +#include <linux/bootmem.h>
   25.48 +#include <linux/thread_info.h>
   25.49 +#include <linux/module.h>
   25.50 +
   25.51 +#include <linux/delay.h>
   25.52 +#include <linux/mc146818rtc.h>
   25.53 +#include <asm/mtrr.h>
   25.54 +#include <asm/pgalloc.h>
   25.55 +#include <asm/desc.h>
   25.56 +#include <asm/kdebug.h>
   25.57 +#include <asm/tlbflush.h>
   25.58 +#include <asm/proto.h>
   25.59 +
   25.60 +/* Number of siblings per CPU package */
   25.61 +int smp_num_siblings = 1;
   25.62 +/* Package ID of each logical CPU */
   25.63 +u8 phys_proc_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
   25.64 +EXPORT_SYMBOL(phys_proc_id);
   25.65 +
   25.66 +/* Bitmask of currently online CPUs */
   25.67 +cpumask_t cpu_online_map;
   25.68 +
   25.69 +cpumask_t cpu_callin_map;
   25.70 +cpumask_t cpu_callout_map;
   25.71 +static cpumask_t smp_commenced_mask;
   25.72 +
   25.73 +/* Per CPU bogomips and other parameters */
   25.74 +struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
   25.75 +
   25.76 +/* Set when the idlers are all forked */
   25.77 +int smp_threads_ready;
   25.78 +
   25.79 +cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
   25.80 +
   25.81 +/*
   25.82 + * Trampoline 80x86 program as an array.
   25.83 + */
   25.84 +
   25.85 +extern unsigned char trampoline_data [];
   25.86 +extern unsigned char trampoline_end  [];
   25.87 +
   25.88 +/*
   25.89 + * Currently trivial. Write the real->protected mode
   25.90 + * bootstrap into the page concerned. The caller
   25.91 + * has made sure it's suitably aligned.
   25.92 + */
   25.93 +
   25.94 +static unsigned long __init setup_trampoline(void)
   25.95 +{
   25.96 +	void *tramp = __va(SMP_TRAMPOLINE_BASE); 
   25.97 +	extern volatile __u32 tramp_gdt_ptr; 
   25.98 +	tramp_gdt_ptr = __pa_symbol(&cpu_gdt_table); 
   25.99 +	memcpy(tramp, trampoline_data, trampoline_end - trampoline_data);
  25.100 +	return virt_to_phys(tramp);
  25.101 +}
  25.102 +
  25.103 +/*
  25.104 + * The bootstrap kernel entry code has set these up. Save them for
  25.105 + * a given CPU
  25.106 + */
  25.107 +
  25.108 +static void __init smp_store_cpu_info(int id)
  25.109 +{
  25.110 +	struct cpuinfo_x86 *c = cpu_data + id;
  25.111 +
  25.112 +	*c = boot_cpu_data;
  25.113 +	identify_cpu(c);
  25.114 +}
  25.115 +
  25.116 +/*
  25.117 + * TSC synchronization.
  25.118 + *
  25.119 + * We first check whether all CPUs have their TSC's synchronized,
  25.120 + * then we print a warning if not, and always resync.
  25.121 + */
  25.122 +
  25.123 +static atomic_t tsc_start_flag = ATOMIC_INIT(0);
  25.124 +static atomic_t tsc_count_start = ATOMIC_INIT(0);
  25.125 +static atomic_t tsc_count_stop = ATOMIC_INIT(0);
  25.126 +static unsigned long long tsc_values[NR_CPUS];
  25.127 +
  25.128 +#define NR_LOOPS 5
  25.129 +
  25.130 +extern unsigned int fast_gettimeoffset_quotient;
  25.131 +
  25.132 +static void __init synchronize_tsc_bp (void)
  25.133 +{
  25.134 +	int i;
  25.135 +	unsigned long long t0;
  25.136 +	unsigned long long sum, avg;
  25.137 +	long long delta;
  25.138 +	long one_usec;
  25.139 +	int buggy = 0;
  25.140 +
  25.141 +	printk(KERN_INFO "checking TSC synchronization across %u CPUs: ",num_booting_cpus());
  25.142 +
  25.143 +	one_usec = cpu_khz; 
  25.144 +
  25.145 +	atomic_set(&tsc_start_flag, 1);
  25.146 +	wmb();
  25.147 +
  25.148 +	/*
  25.149 +	 * We loop a few times to get a primed instruction cache,
  25.150 +	 * then the last pass is more or less synchronized and
  25.151 +	 * the BP and APs set their cycle counters to zero all at
  25.152 +	 * once. This reduces the chance of having random offsets
  25.153 +	 * between the processors, and guarantees that the maximum
  25.154 +	 * delay between the cycle counters is never bigger than
  25.155 +	 * the latency of information-passing (cachelines) between
  25.156 +	 * two CPUs.
  25.157 +	 */
  25.158 +	for (i = 0; i < NR_LOOPS; i++) {
  25.159 +		/*
  25.160 +		 * all APs synchronize but they loop on '== num_cpus'
  25.161 +		 */
  25.162 +		while (atomic_read(&tsc_count_start) != num_booting_cpus()-1) mb();
  25.163 +		atomic_set(&tsc_count_stop, 0);
  25.164 +		wmb();
  25.165 +		/*
  25.166 +		 * this lets the APs save their current TSC:
  25.167 +		 */
  25.168 +		atomic_inc(&tsc_count_start);
  25.169 +
  25.170 +		sync_core();
  25.171 +		rdtscll(tsc_values[smp_processor_id()]);
  25.172 +		/*
  25.173 +		 * We clear the TSC in the last loop:
  25.174 +		 */
  25.175 +		if (i == NR_LOOPS-1)
  25.176 +			write_tsc(0, 0);
  25.177 +
  25.178 +		/*
  25.179 +		 * Wait for all APs to leave the synchronization point:
  25.180 +		 */
  25.181 +		while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1) mb();
  25.182 +		atomic_set(&tsc_count_start, 0);
  25.183 +		wmb();
  25.184 +		atomic_inc(&tsc_count_stop);
  25.185 +	}
  25.186 +
  25.187 +	sum = 0;
  25.188 +	for (i = 0; i < NR_CPUS; i++) {
  25.189 +		if (cpu_isset(i, cpu_callout_map)) {
  25.190 +		t0 = tsc_values[i];
  25.191 +		sum += t0;
  25.192 +	}
  25.193 +	}
  25.194 +	avg = sum / num_booting_cpus();
  25.195 +
  25.196 +	sum = 0;
  25.197 +	for (i = 0; i < NR_CPUS; i++) {
  25.198 +		if (!cpu_isset(i, cpu_callout_map))
  25.199 +			continue;
  25.200 +
  25.201 +		delta = tsc_values[i] - avg;
  25.202 +		if (delta < 0)
  25.203 +			delta = -delta;
  25.204 +		/*
  25.205 +		 * We report bigger than 2 microseconds clock differences.
  25.206 +		 */
  25.207 +		if (delta > 2*one_usec) {
  25.208 +			long realdelta;
  25.209 +			if (!buggy) {
  25.210 +				buggy = 1;
  25.211 +				printk("\n");
  25.212 +			}
  25.213 +			realdelta = delta / one_usec;
  25.214 +			if (tsc_values[i] < avg)
  25.215 +				realdelta = -realdelta;
  25.216 +
  25.217 +			printk("BIOS BUG: CPU#%d improperly initialized, has %ld usecs TSC skew! FIXED.\n",
  25.218 +				i, realdelta);
  25.219 +		}
  25.220 +
  25.221 +		sum += delta;
  25.222 +	}
  25.223 +	if (!buggy)
  25.224 +		printk("passed.\n");
  25.225 +}
  25.226 +
  25.227 +static void __init synchronize_tsc_ap (void)
  25.228 +{
  25.229 +	int i;
  25.230 +
  25.231 +	/*
  25.232 +	 * Not every cpu is online at the time
  25.233 +	 * this gets called, so we first wait for the BP to
  25.234 +	 * finish SMP initialization:
  25.235 +	 */
  25.236 +	while (!atomic_read(&tsc_start_flag)) mb();
  25.237 +
  25.238 +	for (i = 0; i < NR_LOOPS; i++) {
  25.239 +		atomic_inc(&tsc_count_start);
  25.240 +		while (atomic_read(&tsc_count_start) != num_booting_cpus()) mb();
  25.241 +
  25.242 +		sync_core();
  25.243 +		rdtscll(tsc_values[smp_processor_id()]);
  25.244 +		if (i == NR_LOOPS-1)
  25.245 +			write_tsc(0, 0);
  25.246 +
  25.247 +		atomic_inc(&tsc_count_stop);
  25.248 +		while (atomic_read(&tsc_count_stop) != num_booting_cpus()) mb();
  25.249 +	}
  25.250 +}
  25.251 +#undef NR_LOOPS
  25.252 +
  25.253 +static atomic_t init_deasserted;
  25.254 +
  25.255 +void __init smp_callin(void)
  25.256 +{
  25.257 +	int cpuid, phys_id;
  25.258 +	unsigned long timeout;
  25.259 +
  25.260 +	/*
  25.261 +	 * If waken up by an INIT in an 82489DX configuration
  25.262 +	 * we may get here before an INIT-deassert IPI reaches
  25.263 +	 * our local APIC.  We have to wait for the IPI or we'll
  25.264 +	 * lock up on an APIC access.
  25.265 +	 */
  25.266 +	while (!atomic_read(&init_deasserted));
  25.267 +
  25.268 +	/*
  25.269 +	 * (This works even if the APIC is not enabled.)
  25.270 +	 */
  25.271 +	phys_id = GET_APIC_ID(apic_read(APIC_ID));
  25.272 +	cpuid = smp_processor_id();
  25.273 +	if (cpu_isset(cpuid, cpu_callin_map)) {
  25.274 +		panic("smp_callin: phys CPU#%d, CPU#%d already present??\n",
  25.275 +					phys_id, cpuid);
  25.276 +	}
  25.277 +	Dprintk("CPU#%d (phys ID: %d) waiting for CALLOUT\n", cpuid, phys_id);
  25.278 +
  25.279 +	/*
  25.280 +	 * STARTUP IPIs are fragile beasts as they might sometimes
  25.281 +	 * trigger some glue motherboard logic. Complete APIC bus
  25.282 +	 * silence for 1 second, this overestimates the time the
  25.283 +	 * boot CPU is spending to send the up to 2 STARTUP IPIs
  25.284 +	 * by a factor of two. This should be enough.
  25.285 +	 */
  25.286 +
  25.287 +	/*
  25.288 +	 * Waiting 2s total for startup (udelay is not yet working)
  25.289 +	 */
  25.290 +	timeout = jiffies + 2*HZ;
  25.291 +	while (time_before(jiffies, timeout)) {
  25.292 +		/*
  25.293 +		 * Has the boot CPU finished it's STARTUP sequence?
  25.294 +		 */
  25.295 +		if (cpu_isset(cpuid, cpu_callout_map))
  25.296 +			break;
  25.297 +		rep_nop();
  25.298 +	}
  25.299 +
  25.300 +	if (!time_before(jiffies, timeout)) {
  25.301 +		panic("smp_callin: CPU%d started up but did not get a callout!\n",
  25.302 +			cpuid);
  25.303 +	}
  25.304 +
  25.305 +	/*
  25.306 +	 * the boot CPU has finished the init stage and is spinning
  25.307 +	 * on callin_map until we finish. We are free to set up this
  25.308 +	 * CPU, first the APIC. (this is probably redundant on most
  25.309 +	 * boards)
  25.310 +	 */
  25.311 +
  25.312 +	Dprintk("CALLIN, before setup_local_APIC().\n");
  25.313 +	setup_local_APIC();
  25.314 +
  25.315 +	local_irq_enable();
  25.316 +
  25.317 +	/*
  25.318 +	 * Get our bogomips.
  25.319 +	 */
  25.320 +	calibrate_delay();
  25.321 +	Dprintk("Stack at about %p\n",&cpuid);
  25.322 +
  25.323 +	disable_APIC_timer();
  25.324 +
  25.325 +	/*
  25.326 +	 * Save our processor parameters
  25.327 +	 */
  25.328 + 	smp_store_cpu_info(cpuid);
  25.329 +
  25.330 +	local_irq_disable();
  25.331 +
  25.332 +	/*
  25.333 +	 * Allow the master to continue.
  25.334 +	 */
  25.335 +	cpu_set(cpuid, cpu_callin_map);
  25.336 +
  25.337 +	/*
  25.338 +	 *      Synchronize the TSC with the BP
  25.339 +	 */
  25.340 +	if (cpu_has_tsc)
  25.341 +		synchronize_tsc_ap();
  25.342 +}
  25.343 +
  25.344 +int cpucount;
  25.345 +
  25.346 +/*
  25.347 + * Activate a secondary processor.
  25.348 + */
  25.349 +void __init start_secondary(void)
  25.350 +{
  25.351 +	/*
  25.352 +	 * Dont put anything before smp_callin(), SMP
  25.353 +	 * booting is too fragile that we want to limit the
  25.354 +	 * things done here to the most necessary things.
  25.355 +	 */
  25.356 +	cpu_init();
  25.357 +	smp_callin();
  25.358 +
  25.359 +	/* otherwise gcc will move up the smp_processor_id before the cpu_init */
  25.360 +	barrier();
  25.361 +
  25.362 +	Dprintk("cpu %d: waiting for commence\n", smp_processor_id()); 
  25.363 +	while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
  25.364 +		rep_nop();
  25.365 +
  25.366 +	Dprintk("cpu %d: setting up apic clock\n", smp_processor_id()); 	
  25.367 +	setup_secondary_APIC_clock();
  25.368 +
  25.369 +	Dprintk("cpu %d: enabling apic timer\n", smp_processor_id()); 
  25.370 +
  25.371 +	if (nmi_watchdog == NMI_IO_APIC) {
  25.372 +		disable_8259A_irq(0);
  25.373 +		enable_NMI_through_LVT0(NULL);
  25.374 +		enable_8259A_irq(0);
  25.375 +	}
  25.376 +
  25.377 +
  25.378 +	enable_APIC_timer(); 
  25.379 +
  25.380 +	/*
  25.381 +	 * low-memory mappings have been cleared, flush them from
  25.382 +	 * the local TLBs too.
  25.383 +	 */
  25.384 +	local_flush_tlb();
  25.385 +
  25.386 +	Dprintk("cpu %d eSetting cpu_online_map\n", smp_proce