ia64/xen-unstable

changeset 8860:1ca3d63e7008

Update to Linux 2.6.16-rc3.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Feb 15 22:06:12 2006 +0000 (2006-02-15)
parents 1346a69694be
children c62a5327e6a8
files buildconfigs/linux-defconfig_xen0_x86_32 buildconfigs/linux-defconfig_xen0_x86_64 buildconfigs/linux-defconfig_xenU_x86_32 buildconfigs/linux-defconfig_xenU_x86_64 buildconfigs/linux-defconfig_xen_x86_32 buildconfigs/linux-defconfig_xen_x86_64 buildconfigs/mk.linux-2.6-xen linux-2.6-xen-sparse/arch/i386/Kconfig linux-2.6-xen-sparse/arch/i386/Makefile linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile linux-2.6-xen-sparse/arch/i386/kernel/acpi/boot-xen.c linux-2.6-xen-sparse/arch/i386/kernel/apic-xen.c linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c linux-2.6-xen-sparse/arch/i386/kernel/mpparse-xen.c linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c linux-2.6-xen-sparse/arch/i386/kernel/smpboot.c linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c linux-2.6-xen-sparse/arch/i386/kernel/traps.c linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c linux-2.6-xen-sparse/arch/x86_64/Makefile linux-2.6-xen-sparse/arch/x86_64/ia32/ia32entry-xen.S linux-2.6-xen-sparse/arch/x86_64/kernel/apic-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S linux-2.6-xen-sparse/arch/x86_64/kernel/io_apic-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/irq-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/mpparse-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/x8664_ksyms-xen.c linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c linux-2.6-xen-sparse/drivers/Makefile linux-2.6-xen-sparse/drivers/char/tty_io.c linux-2.6-xen-sparse/drivers/serial/Kconfig linux-2.6-xen-sparse/fs/Kconfig linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/desc.h linux-2.6-xen-sparse/include/asm-i386/system.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/io.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/smp.h linux-2.6-xen-sparse/include/linux/mm.h linux-2.6-xen-sparse/mm/memory.c linux-2.6-xen-sparse/mm/page_alloc.c linux-2.6-xen-sparse/net/core/dev.c patches/linux-2.6.16-rc2/i386-mach-io-check-nmi.patch patches/linux-2.6.16-rc2/net-csum.patch patches/linux-2.6.16-rc2/pmd-shared.patch patches/linux-2.6.16-rc2/smp-alts.patch patches/linux-2.6.16-rc3/i386-mach-io-check-nmi.patch patches/linux-2.6.16-rc3/net-csum.patch patches/linux-2.6.16-rc3/pmd-shared.patch patches/linux-2.6.16-rc3/smp-alts.patch
line diff
     1.1 --- a/buildconfigs/linux-defconfig_xen0_x86_32	Wed Feb 15 15:20:32 2006 +0100
     1.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_32	Wed Feb 15 22:06:12 2006 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  #
     1.5  # Automatically generated make config: don't edit
     1.6 -# Linux kernel version: 2.6.16-rc2-xenU
     1.7 -# Mon Feb 13 15:10:22 2006
     1.8 +# Linux kernel version: 2.6.16-rc3-xen0
     1.9 +# Wed Feb 15 20:55:18 2006
    1.10  #
    1.11  CONFIG_X86_32=y
    1.12  CONFIG_SEMAPHORE_SLEEPERS=y
    1.13 @@ -16,8 +16,6 @@ CONFIG_DMI=y
    1.14  # Code maturity level options
    1.15  #
    1.16  CONFIG_EXPERIMENTAL=y
    1.17 -# CONFIG_CLEAN_COMPILE is not set
    1.18 -CONFIG_BROKEN=y
    1.19  CONFIG_BROKEN_ON_SMP=y
    1.20  CONFIG_INIT_ENV_ARG_LIMIT=32
    1.21  
    1.22 @@ -259,6 +257,7 @@ CONFIG_NET=y
    1.23  #
    1.24  # Networking options
    1.25  #
    1.26 +# CONFIG_NETDEBUG is not set
    1.27  CONFIG_PACKET=y
    1.28  # CONFIG_PACKET_MMAP is not set
    1.29  CONFIG_UNIX=y
    1.30 @@ -533,7 +532,6 @@ CONFIG_AIC79XX_DEBUG_ENABLE=y
    1.31  CONFIG_AIC79XX_DEBUG_MASK=0
    1.32  CONFIG_AIC79XX_REG_PRETTY_PRINT=y
    1.33  # CONFIG_SCSI_DPT_I2O is not set
    1.34 -# CONFIG_SCSI_ADVANSYS is not set
    1.35  CONFIG_MEGARAID_NEWGEN=y
    1.36  # CONFIG_MEGARAID_MM is not set
    1.37  # CONFIG_MEGARAID_LEGACY is not set
    1.38 @@ -558,7 +556,6 @@ CONFIG_SCSI_SATA_INTEL_COMBINED=y
    1.39  # CONFIG_SCSI_BUSLOGIC is not set
    1.40  # CONFIG_SCSI_DMX3191D is not set
    1.41  # CONFIG_SCSI_EATA is not set
    1.42 -# CONFIG_SCSI_EATA_PIO is not set
    1.43  # CONFIG_SCSI_FUTURE_DOMAIN is not set
    1.44  # CONFIG_SCSI_GDTH is not set
    1.45  # CONFIG_SCSI_IPS is not set
     2.1 --- a/buildconfigs/linux-defconfig_xen0_x86_64	Wed Feb 15 15:20:32 2006 +0100
     2.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_64	Wed Feb 15 22:06:12 2006 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  #
     2.5  # Automatically generated make config: don't edit
     2.6 -# Linux kernel version: 2.6.16-rc2-xen0
     2.7 -# Fri Feb  3 16:53:41 2006
     2.8 +# Linux kernel version: 2.6.16-rc3-xen0
     2.9 +# Wed Feb 15 20:49:13 2006
    2.10  #
    2.11  CONFIG_X86_64=y
    2.12  CONFIG_64BIT=y
    2.13 @@ -21,8 +21,6 @@ CONFIG_DMI=y
    2.14  # Code maturity level options
    2.15  #
    2.16  CONFIG_EXPERIMENTAL=y
    2.17 -# CONFIG_CLEAN_COMPILE is not set
    2.18 -CONFIG_BROKEN=y
    2.19  CONFIG_BROKEN_ON_SMP=y
    2.20  CONFIG_INIT_ENV_ARG_LIMIT=32
    2.21  
    2.22 @@ -189,6 +187,7 @@ CONFIG_NET=y
    2.23  #
    2.24  # Networking options
    2.25  #
    2.26 +# CONFIG_NETDEBUG is not set
    2.27  CONFIG_PACKET=y
    2.28  # CONFIG_PACKET_MMAP is not set
    2.29  CONFIG_UNIX=y
    2.30 @@ -463,7 +462,6 @@ CONFIG_AIC79XX_RESET_DELAY_MS=15000
    2.31  CONFIG_AIC79XX_DEBUG_ENABLE=y
    2.32  CONFIG_AIC79XX_DEBUG_MASK=0
    2.33  CONFIG_AIC79XX_REG_PRETTY_PRINT=y
    2.34 -# CONFIG_SCSI_ADVANSYS is not set
    2.35  CONFIG_MEGARAID_NEWGEN=y
    2.36  # CONFIG_MEGARAID_MM is not set
    2.37  # CONFIG_MEGARAID_LEGACY is not set
    2.38 @@ -489,7 +487,6 @@ CONFIG_SCSI_BUSLOGIC=y
    2.39  # CONFIG_SCSI_OMIT_FLASHPOINT is not set
    2.40  # CONFIG_SCSI_DMX3191D is not set
    2.41  # CONFIG_SCSI_EATA is not set
    2.42 -# CONFIG_SCSI_EATA_PIO is not set
    2.43  # CONFIG_SCSI_FUTURE_DOMAIN is not set
    2.44  # CONFIG_SCSI_GDTH is not set
    2.45  # CONFIG_SCSI_IPS is not set
    2.46 @@ -1183,7 +1180,6 @@ CONFIG_DETECT_SOFTLOCKUP=y
    2.47  CONFIG_FRAME_POINTER=y
    2.48  CONFIG_FORCED_INLINING=y
    2.49  # CONFIG_RCU_TORTURE_TEST is not set
    2.50 -# CONFIG_INIT_DEBUG is not set
    2.51  # CONFIG_DEBUG_RODATA is not set
    2.52  
    2.53  #
     3.1 --- a/buildconfigs/linux-defconfig_xenU_x86_32	Wed Feb 15 15:20:32 2006 +0100
     3.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_32	Wed Feb 15 22:06:12 2006 +0000
     3.3 @@ -1,7 +1,7 @@
     3.4  #
     3.5  # Automatically generated make config: don't edit
     3.6 -# Linux kernel version: 2.6.16-rc2-xenU
     3.7 -# Mon Feb  6 23:16:07 2006
     3.8 +# Linux kernel version: 2.6.16-rc3-xenU
     3.9 +# Wed Feb 15 20:56:26 2006
    3.10  #
    3.11  CONFIG_X86_32=y
    3.12  CONFIG_SEMAPHORE_SLEEPERS=y
    3.13 @@ -16,7 +16,6 @@ CONFIG_DMI=y
    3.14  # Code maturity level options
    3.15  #
    3.16  CONFIG_EXPERIMENTAL=y
    3.17 -CONFIG_CLEAN_COMPILE=y
    3.18  CONFIG_LOCK_KERNEL=y
    3.19  CONFIG_INIT_ENV_ARG_LIMIT=32
    3.20  
    3.21 @@ -214,6 +213,7 @@ CONFIG_NET=y
    3.22  #
    3.23  # Networking options
    3.24  #
    3.25 +# CONFIG_NETDEBUG is not set
    3.26  CONFIG_PACKET=y
    3.27  # CONFIG_PACKET_MMAP is not set
    3.28  CONFIG_UNIX=y
     4.1 --- a/buildconfigs/linux-defconfig_xenU_x86_64	Wed Feb 15 15:20:32 2006 +0100
     4.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_64	Wed Feb 15 22:06:12 2006 +0000
     4.3 @@ -1,7 +1,7 @@
     4.4  #
     4.5  # Automatically generated make config: don't edit
     4.6 -# Linux kernel version: 2.6.16-rc2-xenU
     4.7 -# Mon Feb  6 23:49:06 2006
     4.8 +# Linux kernel version: 2.6.16-rc3-xenU
     4.9 +# Wed Feb 15 20:49:39 2006
    4.10  #
    4.11  CONFIG_X86_64=y
    4.12  CONFIG_64BIT=y
    4.13 @@ -21,7 +21,6 @@ CONFIG_DMI=y
    4.14  # Code maturity level options
    4.15  #
    4.16  CONFIG_EXPERIMENTAL=y
    4.17 -CONFIG_CLEAN_COMPILE=y
    4.18  CONFIG_LOCK_KERNEL=y
    4.19  CONFIG_INIT_ENV_ARG_LIMIT=32
    4.20  
    4.21 @@ -165,6 +164,7 @@ CONFIG_NET=y
    4.22  #
    4.23  # Networking options
    4.24  #
    4.25 +# CONFIG_NETDEBUG is not set
    4.26  CONFIG_PACKET=y
    4.27  CONFIG_PACKET_MMAP=y
    4.28  CONFIG_UNIX=y
    4.29 @@ -1085,7 +1085,6 @@ CONFIG_DETECT_SOFTLOCKUP=y
    4.30  CONFIG_FRAME_POINTER=y
    4.31  CONFIG_FORCED_INLINING=y
    4.32  # CONFIG_RCU_TORTURE_TEST is not set
    4.33 -# CONFIG_INIT_DEBUG is not set
    4.34  # CONFIG_DEBUG_RODATA is not set
    4.35  
    4.36  #
     5.1 --- a/buildconfigs/linux-defconfig_xen_x86_32	Wed Feb 15 15:20:32 2006 +0100
     5.2 +++ b/buildconfigs/linux-defconfig_xen_x86_32	Wed Feb 15 22:06:12 2006 +0000
     5.3 @@ -1,7 +1,7 @@
     5.4  #
     5.5  # Automatically generated make config: don't edit
     5.6 -# Linux kernel version: 2.6.16-rc2-xenU
     5.7 -# Mon Feb 13 15:12:00 2006
     5.8 +# Linux kernel version: 2.6.16-rc3-xen
     5.9 +# Wed Feb 15 20:57:16 2006
    5.10  #
    5.11  CONFIG_X86_32=y
    5.12  CONFIG_SEMAPHORE_SLEEPERS=y
    5.13 @@ -16,9 +16,6 @@ CONFIG_DMI=y
    5.14  # Code maturity level options
    5.15  #
    5.16  CONFIG_EXPERIMENTAL=y
    5.17 -# CONFIG_CLEAN_COMPILE is not set
    5.18 -CONFIG_BROKEN=y
    5.19 -CONFIG_BROKEN_ON_SMP=y
    5.20  CONFIG_LOCK_KERNEL=y
    5.21  CONFIG_INIT_ENV_ARG_LIMIT=32
    5.22  
    5.23 @@ -291,6 +288,7 @@ CONFIG_NET=y
    5.24  #
    5.25  # Networking options
    5.26  #
    5.27 +# CONFIG_NETDEBUG is not set
    5.28  CONFIG_PACKET=m
    5.29  CONFIG_PACKET_MMAP=y
    5.30  CONFIG_UNIX=m
    5.31 @@ -706,12 +704,10 @@ CONFIG_ACT200L_DONGLE=m
    5.32  #
    5.33  # Old SIR device drivers
    5.34  #
    5.35 -CONFIG_IRPORT_SIR=m
    5.36  
    5.37  #
    5.38  # Old Serial dongle support
    5.39  #
    5.40 -# CONFIG_DONGLE_OLD is not set
    5.41  
    5.42  #
    5.43  # FIR device drivers
    5.44 @@ -849,8 +845,6 @@ CONFIG_MTD_DILNETPC=m
    5.45  CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000
    5.46  # CONFIG_MTD_L440GX is not set
    5.47  CONFIG_MTD_PCI=m
    5.48 -CONFIG_MTD_PCMCIA=m
    5.49 -# CONFIG_MTD_PCMCIA_ANONYMOUS is not set
    5.50  CONFIG_MTD_PLATRAM=m
    5.51  
    5.52  #
    5.53 @@ -1035,7 +1029,6 @@ CONFIG_BLK_DEV_NS87415=m
    5.54  CONFIG_BLK_DEV_PDC202XX_OLD=y
    5.55  CONFIG_PDC202XX_BURST=y
    5.56  CONFIG_BLK_DEV_PDC202XX_NEW=y
    5.57 -CONFIG_PDC202XX_FORCE=y
    5.58  CONFIG_BLK_DEV_SVWKS=y
    5.59  CONFIG_BLK_DEV_SIIMAGE=y
    5.60  CONFIG_BLK_DEV_SIS5513=y
    5.61 @@ -1104,7 +1097,6 @@ CONFIG_AIC79XX_DEBUG_ENABLE=y
    5.62  CONFIG_AIC79XX_DEBUG_MASK=0
    5.63  CONFIG_AIC79XX_REG_PRETTY_PRINT=y
    5.64  CONFIG_SCSI_DPT_I2O=m
    5.65 -CONFIG_SCSI_ADVANSYS=m
    5.66  CONFIG_MEGARAID_NEWGEN=y
    5.67  CONFIG_MEGARAID_MM=m
    5.68  CONFIG_MEGARAID_MAILBOX=m
    5.69 @@ -1130,7 +1122,6 @@ CONFIG_SCSI_SATA_INTEL_COMBINED=y
    5.70  # CONFIG_SCSI_BUSLOGIC is not set
    5.71  CONFIG_SCSI_DMX3191D=m
    5.72  # CONFIG_SCSI_EATA is not set
    5.73 -CONFIG_SCSI_EATA_PIO=m
    5.74  CONFIG_SCSI_FUTURE_DOMAIN=m
    5.75  # CONFIG_SCSI_GDTH is not set
    5.76  CONFIG_SCSI_IPS=m
    5.77 @@ -1236,6 +1227,7 @@ CONFIG_IEEE1394_RAWIO=m
    5.78  CONFIG_I2O=m
    5.79  CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
    5.80  CONFIG_I2O_EXT_ADAPTEC=y
    5.81 +CONFIG_I2O_EXT_ADAPTEC_DMA64=y
    5.82  CONFIG_I2O_CONFIG=m
    5.83  CONFIG_I2O_CONFIG_OLD_IOCTL=y
    5.84  CONFIG_I2O_BUS=m
    5.85 @@ -1307,7 +1299,6 @@ CONFIG_WINBOND_840=m
    5.86  CONFIG_DM9102=m
    5.87  CONFIG_ULI526X=m
    5.88  CONFIG_PCMCIA_XIRCOM=m
    5.89 -# CONFIG_PCMCIA_XIRTULIP is not set
    5.90  CONFIG_HP100=m
    5.91  CONFIG_NET_PCI=y
    5.92  CONFIG_PCNET32=m
    5.93 @@ -1474,7 +1465,6 @@ CONFIG_DLCI=m
    5.94  CONFIG_DLCI_COUNT=24
    5.95  CONFIG_DLCI_MAX=8
    5.96  CONFIG_WAN_ROUTER_DRIVERS=y
    5.97 -# CONFIG_VENDOR_SANGOMA is not set
    5.98  CONFIG_CYCLADES_SYNC=m
    5.99  CONFIG_CYCLOMX_X25=y
   5.100  CONFIG_LAPBETHER=m
   5.101 @@ -1566,7 +1556,6 @@ CONFIG_ISDN_X25=y
   5.102  #
   5.103  # ISDN feature submodules
   5.104  #
   5.105 -# CONFIG_ISDN_DRV_LOOP is not set
   5.106  # CONFIG_ISDN_DIVERSION is not set
   5.107  
   5.108  #
   5.109 @@ -1633,7 +1622,6 @@ CONFIG_HISAX_HDLC=y
   5.110  #
   5.111  # Active cards
   5.112  #
   5.113 -# CONFIG_HYSDN is not set
   5.114  
   5.115  #
   5.116  # CAPI subsystem
   5.117 @@ -1860,7 +1848,6 @@ CONFIG_SONYPI=m
   5.118  #
   5.119  # Ftape, the floppy tape device driver
   5.120  #
   5.121 -# CONFIG_FTAPE is not set
   5.122  CONFIG_AGP=m
   5.123  CONFIG_AGP_ALI=m
   5.124  CONFIG_AGP_ATI=m
   5.125 @@ -2007,6 +1994,7 @@ CONFIG_SENSORS_ADM9240=m
   5.126  CONFIG_SENSORS_ASB100=m
   5.127  CONFIG_SENSORS_ATXP1=m
   5.128  CONFIG_SENSORS_DS1621=m
   5.129 +CONFIG_SENSORS_F71805F=m
   5.130  CONFIG_SENSORS_FSCHER=m
   5.131  CONFIG_SENSORS_FSCPOS=m
   5.132  CONFIG_SENSORS_GL518SM=m
   5.133 @@ -2078,7 +2066,6 @@ CONFIG_VIDEO_ZORAN_DC10=m
   5.134  CONFIG_VIDEO_ZORAN_DC30=m
   5.135  CONFIG_VIDEO_ZORAN_LML33=m
   5.136  CONFIG_VIDEO_ZORAN_LML33R10=m
   5.137 -# CONFIG_VIDEO_ZR36120 is not set
   5.138  CONFIG_VIDEO_MEYE=m
   5.139  # CONFIG_VIDEO_SAA7134 is not set
   5.140  CONFIG_VIDEO_MXB=m
   5.141 @@ -2088,6 +2075,7 @@ CONFIG_VIDEO_HEXIUM_GEMINI=m
   5.142  CONFIG_VIDEO_CX88=m
   5.143  # CONFIG_VIDEO_CX88_DVB is not set
   5.144  CONFIG_VIDEO_CX88_ALSA=m
   5.145 +CONFIG_VIDEO_CX88_VP3054=m
   5.146  CONFIG_VIDEO_EM28XX=m
   5.147  CONFIG_VIDEO_OVCAMCHIP=m
   5.148  CONFIG_VIDEO_AUDIO_DECODER=m
   5.149 @@ -2170,7 +2158,6 @@ CONFIG_DVB_STV0299=m
   5.150  CONFIG_DVB_CX24110=m
   5.151  CONFIG_DVB_CX24123=m
   5.152  CONFIG_DVB_TDA8083=m
   5.153 -CONFIG_DVB_TDA80XX=m
   5.154  CONFIG_DVB_MT312=m
   5.155  CONFIG_DVB_VES1X93=m
   5.156  CONFIG_DVB_S5H1420=m
   5.157 @@ -2192,7 +2179,6 @@ CONFIG_DVB_DIB3000MC=m
   5.158  #
   5.159  # DVB-C (cable) frontends
   5.160  #
   5.161 -CONFIG_DVB_ATMEL_AT76C651=m
   5.162  CONFIG_DVB_VES1820=m
   5.163  CONFIG_DVB_TDA10021=m
   5.164  CONFIG_DVB_STV0297=m
   5.165 @@ -2200,7 +2186,6 @@ CONFIG_DVB_STV0297=m
   5.166  #
   5.167  # ATSC (North American/Korean Terresterial DTV) frontends
   5.168  #
   5.169 -CONFIG_DVB_NXT2002=m
   5.170  CONFIG_DVB_NXT200X=m
   5.171  CONFIG_DVB_OR51211=m
   5.172  CONFIG_DVB_OR51132=m
   5.173 @@ -2276,7 +2261,6 @@ CONFIG_FB_VOODOO1=m
   5.174  CONFIG_FB_CYBLA=m
   5.175  CONFIG_FB_TRIDENT=m
   5.176  # CONFIG_FB_TRIDENT_ACCEL is not set
   5.177 -# CONFIG_FB_PM3 is not set
   5.178  CONFIG_FB_GEODE=y
   5.179  CONFIG_FB_GEODE_GX1=m
   5.180  CONFIG_FB_VIRTUAL=m
   5.181 @@ -2786,10 +2770,8 @@ CONFIG_CRAMFS=y
   5.182  CONFIG_VXFS_FS=m
   5.183  CONFIG_HPFS_FS=m
   5.184  CONFIG_QNX4FS_FS=m
   5.185 -# CONFIG_QNX4FS_RW is not set
   5.186  CONFIG_SYSV_FS=m
   5.187  CONFIG_UFS_FS=m
   5.188 -# CONFIG_UFS_FS_WRITE is not set
   5.189  
   5.190  #
   5.191  # Network File Systems
   5.192 @@ -2951,13 +2933,6 @@ CONFIG_SECURITY=y
   5.193  CONFIG_SECURITY_CAPABILITIES=y
   5.194  CONFIG_SECURITY_ROOTPLUG=m
   5.195  CONFIG_SECURITY_SECLVL=m
   5.196 -CONFIG_SECURITY_SELINUX=y
   5.197 -CONFIG_SECURITY_SELINUX_BOOTPARAM=y
   5.198 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
   5.199 -CONFIG_SECURITY_SELINUX_DISABLE=y
   5.200 -CONFIG_SECURITY_SELINUX_DEVELOP=y
   5.201 -CONFIG_SECURITY_SELINUX_AVC_STATS=y
   5.202 -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
   5.203  
   5.204  #
   5.205  # Cryptographic options
     6.1 --- a/buildconfigs/linux-defconfig_xen_x86_64	Wed Feb 15 15:20:32 2006 +0100
     6.2 +++ b/buildconfigs/linux-defconfig_xen_x86_64	Wed Feb 15 22:06:12 2006 +0000
     6.3 @@ -1,7 +1,7 @@
     6.4  #
     6.5  # Automatically generated make config: don't edit
     6.6 -# Linux kernel version: 2.6.16-rc2-xen
     6.7 -# Fri Feb  3 16:30:34 2006
     6.8 +# Linux kernel version: 2.6.16-rc3-xen
     6.9 +# Wed Feb 15 20:50:05 2006
    6.10  #
    6.11  CONFIG_X86_64=y
    6.12  CONFIG_64BIT=y
    6.13 @@ -21,9 +21,6 @@ CONFIG_DMI=y
    6.14  # Code maturity level options
    6.15  #
    6.16  CONFIG_EXPERIMENTAL=y
    6.17 -# CONFIG_CLEAN_COMPILE is not set
    6.18 -CONFIG_BROKEN=y
    6.19 -CONFIG_BROKEN_ON_SMP=y
    6.20  CONFIG_LOCK_KERNEL=y
    6.21  CONFIG_INIT_ENV_ARG_LIMIT=32
    6.22  
    6.23 @@ -160,6 +157,7 @@ CONFIG_ACPI_VIDEO=m
    6.24  CONFIG_ACPI_HOTKEY=m
    6.25  CONFIG_ACPI_FAN=m
    6.26  CONFIG_ACPI_PROCESSOR=m
    6.27 +CONFIG_ACPI_HOTPLUG_CPU=y
    6.28  CONFIG_ACPI_THERMAL=m
    6.29  CONFIG_ACPI_ASUS=m
    6.30  CONFIG_ACPI_IBM=m
    6.31 @@ -197,6 +195,7 @@ CONFIG_NET=y
    6.32  #
    6.33  # Networking options
    6.34  #
    6.35 +# CONFIG_NETDEBUG is not set
    6.36  CONFIG_PACKET=y
    6.37  CONFIG_PACKET_MMAP=y
    6.38  CONFIG_UNIX=y
    6.39 @@ -578,12 +577,10 @@ CONFIG_ACT200L_DONGLE=m
    6.40  #
    6.41  # Old SIR device drivers
    6.42  #
    6.43 -CONFIG_IRPORT_SIR=m
    6.44  
    6.45  #
    6.46  # Old Serial dongle support
    6.47  #
    6.48 -# CONFIG_DONGLE_OLD is not set
    6.49  
    6.50  #
    6.51  # FIR device drivers
    6.52 @@ -880,7 +877,6 @@ CONFIG_BLK_DEV_IT821X=m
    6.53  CONFIG_BLK_DEV_PDC202XX_OLD=y
    6.54  # CONFIG_PDC202XX_BURST is not set
    6.55  CONFIG_BLK_DEV_PDC202XX_NEW=y
    6.56 -CONFIG_PDC202XX_FORCE=y
    6.57  CONFIG_BLK_DEV_SVWKS=y
    6.58  CONFIG_BLK_DEV_SIIMAGE=y
    6.59  CONFIG_BLK_DEV_SIS5513=y
    6.60 @@ -948,7 +944,6 @@ CONFIG_AIC79XX_RESET_DELAY_MS=15000
    6.61  # CONFIG_AIC79XX_DEBUG_ENABLE is not set
    6.62  CONFIG_AIC79XX_DEBUG_MASK=0
    6.63  # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
    6.64 -# CONFIG_SCSI_ADVANSYS is not set
    6.65  CONFIG_MEGARAID_NEWGEN=y
    6.66  CONFIG_MEGARAID_MM=m
    6.67  CONFIG_MEGARAID_MAILBOX=m
    6.68 @@ -975,7 +970,6 @@ CONFIG_SCSI_BUSLOGIC=m
    6.69  # CONFIG_SCSI_OMIT_FLASHPOINT is not set
    6.70  # CONFIG_SCSI_DMX3191D is not set
    6.71  # CONFIG_SCSI_EATA is not set
    6.72 -# CONFIG_SCSI_EATA_PIO is not set
    6.73  # CONFIG_SCSI_FUTURE_DOMAIN is not set
    6.74  CONFIG_SCSI_GDTH=m
    6.75  CONFIG_SCSI_IPS=m
    6.76 @@ -1315,7 +1309,6 @@ CONFIG_ISDN_TTY_FAX=y
    6.77  #
    6.78  # ISDN feature submodules
    6.79  #
    6.80 -CONFIG_ISDN_DRV_LOOP=m
    6.81  CONFIG_ISDN_DIVERSION=m
    6.82  
    6.83  #
    6.84 @@ -1378,8 +1371,6 @@ CONFIG_HISAX_HDLC=y
    6.85  #
    6.86  # Active cards
    6.87  #
    6.88 -CONFIG_HYSDN=m
    6.89 -CONFIG_HYSDN_CAPI=y
    6.90  
    6.91  #
    6.92  # CAPI subsystem
    6.93 @@ -1583,7 +1574,6 @@ CONFIG_R3964=m
    6.94  #
    6.95  # Ftape, the floppy tape device driver
    6.96  #
    6.97 -# CONFIG_FTAPE is not set
    6.98  # CONFIG_AGP is not set
    6.99  CONFIG_DRM=m
   6.100  CONFIG_DRM_TDFX=m
   6.101 @@ -1703,6 +1693,7 @@ CONFIG_SENSORS_ADM9240=m
   6.102  CONFIG_SENSORS_ASB100=m
   6.103  CONFIG_SENSORS_ATXP1=m
   6.104  CONFIG_SENSORS_DS1621=m
   6.105 +CONFIG_SENSORS_F71805F=m
   6.106  CONFIG_SENSORS_FSCHER=m
   6.107  CONFIG_SENSORS_FSCPOS=m
   6.108  CONFIG_SENSORS_GL518SM=m
   6.109 @@ -1774,7 +1765,6 @@ CONFIG_VIDEO_ZORAN_DC10=m
   6.110  CONFIG_VIDEO_ZORAN_DC30=m
   6.111  CONFIG_VIDEO_ZORAN_LML33=m
   6.112  CONFIG_VIDEO_ZORAN_LML33R10=m
   6.113 -# CONFIG_VIDEO_ZR36120 is not set
   6.114  CONFIG_VIDEO_SAA7134=m
   6.115  CONFIG_VIDEO_SAA7134_ALSA=m
   6.116  CONFIG_VIDEO_SAA7134_DVB=m
   6.117 @@ -1787,6 +1777,7 @@ CONFIG_VIDEO_CX88=m
   6.118  CONFIG_VIDEO_CX88_DVB=m
   6.119  CONFIG_VIDEO_CX88_ALSA=m
   6.120  CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=y
   6.121 +CONFIG_VIDEO_CX88_VP3054=m
   6.122  CONFIG_VIDEO_EM28XX=m
   6.123  CONFIG_VIDEO_OVCAMCHIP=m
   6.124  CONFIG_VIDEO_AUDIO_DECODER=m
   6.125 @@ -1874,7 +1865,6 @@ CONFIG_DVB_STV0299=m
   6.126  CONFIG_DVB_CX24110=m
   6.127  CONFIG_DVB_CX24123=m
   6.128  CONFIG_DVB_TDA8083=m
   6.129 -CONFIG_DVB_TDA80XX=m
   6.130  CONFIG_DVB_MT312=m
   6.131  CONFIG_DVB_VES1X93=m
   6.132  CONFIG_DVB_S5H1420=m
   6.133 @@ -1896,7 +1886,6 @@ CONFIG_DVB_DIB3000MC=m
   6.134  #
   6.135  # DVB-C (cable) frontends
   6.136  #
   6.137 -CONFIG_DVB_ATMEL_AT76C651=m
   6.138  CONFIG_DVB_VES1820=m
   6.139  CONFIG_DVB_TDA10021=m
   6.140  CONFIG_DVB_STV0297=m
   6.141 @@ -1904,7 +1893,6 @@ CONFIG_DVB_STV0297=m
   6.142  #
   6.143  # ATSC (North American/Korean Terresterial DTV) frontends
   6.144  #
   6.145 -CONFIG_DVB_NXT2002=m
   6.146  CONFIG_DVB_NXT200X=m
   6.147  CONFIG_DVB_OR51211=m
   6.148  CONFIG_DVB_OR51132=m
   6.149 @@ -1972,7 +1960,6 @@ CONFIG_FB_3DFX_ACCEL=y
   6.150  CONFIG_FB_VOODOO1=m
   6.151  CONFIG_FB_TRIDENT=m
   6.152  CONFIG_FB_TRIDENT_ACCEL=y
   6.153 -# CONFIG_FB_PM3 is not set
   6.154  # CONFIG_FB_GEODE is not set
   6.155  # CONFIG_FB_VIRTUAL is not set
   6.156  
   6.157 @@ -2349,7 +2336,6 @@ CONFIG_EDAC=m
   6.158  #
   6.159  # CONFIG_EDAC_DEBUG is not set
   6.160  CONFIG_EDAC_MM_EDAC=m
   6.161 -CONFIG_EDAC_AMD76X=m
   6.162  CONFIG_EDAC_E7XXX=m
   6.163  CONFIG_EDAC_E752X=m
   6.164  CONFIG_EDAC_I82875P=m
   6.165 @@ -2466,10 +2452,8 @@ CONFIG_CRAMFS=y
   6.166  CONFIG_VXFS_FS=m
   6.167  # CONFIG_HPFS_FS is not set
   6.168  CONFIG_QNX4FS_FS=m
   6.169 -# CONFIG_QNX4FS_RW is not set
   6.170  CONFIG_SYSV_FS=m
   6.171  CONFIG_UFS_FS=m
   6.172 -# CONFIG_UFS_FS_WRITE is not set
   6.173  
   6.174  #
   6.175  # Network File Systems
   6.176 @@ -2602,7 +2586,6 @@ CONFIG_DETECT_SOFTLOCKUP=y
   6.177  # CONFIG_FRAME_POINTER is not set
   6.178  CONFIG_FORCED_INLINING=y
   6.179  # CONFIG_RCU_TORTURE_TEST is not set
   6.180 -# CONFIG_INIT_DEBUG is not set
   6.181  # CONFIG_DEBUG_RODATA is not set
   6.182  
   6.183  #
   6.184 @@ -2616,13 +2599,6 @@ CONFIG_SECURITY_NETWORK_XFRM=y
   6.185  CONFIG_SECURITY_CAPABILITIES=y
   6.186  # CONFIG_SECURITY_ROOTPLUG is not set
   6.187  # CONFIG_SECURITY_SECLVL is not set
   6.188 -CONFIG_SECURITY_SELINUX=y
   6.189 -CONFIG_SECURITY_SELINUX_BOOTPARAM=y
   6.190 -CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
   6.191 -CONFIG_SECURITY_SELINUX_DISABLE=y
   6.192 -CONFIG_SECURITY_SELINUX_DEVELOP=y
   6.193 -CONFIG_SECURITY_SELINUX_AVC_STATS=y
   6.194 -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
   6.195  
   6.196  #
   6.197  # Cryptographic options
     7.1 --- a/buildconfigs/mk.linux-2.6-xen	Wed Feb 15 15:20:32 2006 +0100
     7.2 +++ b/buildconfigs/mk.linux-2.6-xen	Wed Feb 15 22:06:12 2006 +0000
     7.3 @@ -2,8 +2,8 @@
     7.4  OS           = linux
     7.5  
     7.6  LINUX_SERIES = 2.6
     7.7 -LINUX_VER    = 2.6.16-rc2
     7.8 -LINUX_SRCS = linux-2.6.15.tar.bz2 patch-2.6.16-rc2.bz2
     7.9 +LINUX_VER    = 2.6.16-rc3
    7.10 +LINUX_SRCS = linux-2.6.15.tar.bz2 patch-2.6.16-rc3.bz2
    7.11  LINUX_PDIR = linux-$(LINUX_VER)
    7.12  
    7.13  EXTRAVERSION ?= xen
    7.14 @@ -20,6 +20,7 @@ build: $(LINUX_DIR)/include/linux/autoco
    7.15  	    $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
    7.16  	    $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
    7.17  	fi
    7.18 +	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) vmlinuz
    7.19  	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) install
    7.20  
    7.21  pristine-$(LINUX_PDIR)/.valid-srcs: $(LINUX_SRCS)
    7.22 @@ -33,7 +34,7 @@ pristine-$(LINUX_PDIR)/.valid-srcs: $(LI
    7.23  	touch $(@D)/.hgskip
    7.24  	touch $@
    7.25  
    7.26 -pristine-linux-%.16-rc2/.valid-pristine: pristine-$(LINUX_PDIR)/.valid-srcs
    7.27 +pristine-linux-%.16-rc3/.valid-pristine: pristine-$(LINUX_PDIR)/.valid-srcs
    7.28  	touch $@ # update timestamp to avoid rebuild
    7.29  
    7.30  $(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
     8.1 --- a/linux-2.6-xen-sparse/arch/i386/Kconfig	Wed Feb 15 15:20:32 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/arch/i386/Kconfig	Wed Feb 15 22:06:12 2006 +0000
     8.3 @@ -476,6 +476,7 @@ config HIGHMEM4G
     8.4  
     8.5  config HIGHMEM64G
     8.6  	bool "64GB"
     8.7 +	depends on X86_CMPXCHG64
     8.8  	help
     8.9  	  Select this if you have a 32-bit processor and more than 4
    8.10  	  gigabytes of physical RAM.
     9.1 --- a/linux-2.6-xen-sparse/arch/i386/Makefile	Wed Feb 15 15:20:32 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/arch/i386/Makefile	Wed Feb 15 22:06:12 2006 +0000
     9.3 @@ -116,7 +116,7 @@ all: vmlinuz
     9.4  vmlinuz: vmlinux
     9.5  	$(Q)$(MAKE) $(build)=$(boot) $@
     9.6  
     9.7 -install: vmlinux
     9.8 +install:
     9.9  	$(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
    9.10  else
    9.11  all: bzImage
    10.1 --- a/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile	Wed Feb 15 15:20:32 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile	Wed Feb 15 22:06:12 2006 +0000
    10.3 @@ -10,7 +10,7 @@ vmlinux-stripped: vmlinux FORCE
    10.4  INSTALL_ROOT := $(patsubst %/boot,%,$(INSTALL_PATH))
    10.5  
    10.6  XINSTALL_NAME ?= $(KERNELRELEASE)
    10.7 -install: vmlinuz
    10.8 +install:
    10.9  	mkdir -p $(INSTALL_ROOT)/boot
   10.10  	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
   10.11  	rm -f $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
    11.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/acpi/boot-xen.c	Wed Feb 15 15:20:32 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/acpi/boot-xen.c	Wed Feb 15 22:06:12 2006 +0000
    11.3 @@ -250,10 +250,17 @@ acpi_parse_lapic(acpi_table_entry_header
    11.4  
    11.5  	acpi_table_print_madt_entry(header);
    11.6  
    11.7 -	/* Register even disabled CPUs for cpu hotplug */
    11.8 +	/* Record local apic id only when enabled */
    11.9 +	if (processor->flags.enabled)
   11.10 +		x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
   11.11  
   11.12 -	x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
   11.13 -
   11.14 +	/*
   11.15 +	 * We need to register disabled CPU as well to permit
   11.16 +	 * counting disabled CPUs. This allows us to size
   11.17 +	 * cpus_possible_map more accurately, to permit
   11.18 +	 * to not preallocating memory for all NR_CPUS
   11.19 +	 * when we use CPU hotplug.
   11.20 +	 */
   11.21  	mp_register_lapic(processor->id,	/* APIC ID */
   11.22  			  processor->flags.enabled);	/* Enabled? */
   11.23  
    12.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/apic-xen.c	Wed Feb 15 15:20:32 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/apic-xen.c	Wed Feb 15 22:06:12 2006 +0000
    12.3 @@ -74,8 +74,10 @@ void ack_bad_irq(unsigned int irq)
    12.4  	 * holds up an irq slot - in excessive cases (when multiple
    12.5  	 * unexpected vectors occur) that might lock up the APIC
    12.6  	 * completely.
    12.7 +	 * But only ack when the APIC is enabled -AK
    12.8  	 */
    12.9 -	ack_APIC_irq();
   12.10 +	if (cpu_has_apic)
   12.11 +		ack_APIC_irq();
   12.12  }
   12.13  
   12.14  int get_physical_broadcast(void)
    13.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c	Wed Feb 15 15:20:32 2006 +0100
    13.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c	Wed Feb 15 22:06:12 2006 +0000
    13.3 @@ -49,6 +49,7 @@ static void default_init(struct cpuinfo_
    13.4  
    13.5  static struct cpu_dev default_cpu = {
    13.6  	.c_init	= default_init,
    13.7 +	.c_vendor = "Unknown",
    13.8  };
    13.9  static struct cpu_dev * this_cpu = &default_cpu;
   13.10  
   13.11 @@ -155,6 +156,7 @@ static void __devinit get_cpu_vendor(str
   13.12  {
   13.13  	char *v = c->x86_vendor_id;
   13.14  	int i;
   13.15 +	static int printed;
   13.16  
   13.17  	for (i = 0; i < X86_VENDOR_NUM; i++) {
   13.18  		if (cpu_devs[i]) {
   13.19 @@ -164,10 +166,17 @@ static void __devinit get_cpu_vendor(str
   13.20  				c->x86_vendor = i;
   13.21  				if (!early)
   13.22  					this_cpu = cpu_devs[i];
   13.23 -				break;
   13.24 +				return;
   13.25  			}
   13.26  		}
   13.27  	}
   13.28 +	if (!printed) {
   13.29 +		printed++;
   13.30 +		printk(KERN_ERR "CPU: Vendor unknown, using generic init.\n");
   13.31 +		printk(KERN_ERR "CPU: Your system may be unstable.\n");
   13.32 +	}
   13.33 +	c->x86_vendor = X86_VENDOR_UNKNOWN;
   13.34 +	this_cpu = &default_cpu;
   13.35  }
   13.36  
   13.37  
    14.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c	Wed Feb 15 15:20:32 2006 +0100
    14.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c	Wed Feb 15 22:06:12 2006 +0000
    14.3 @@ -786,8 +786,6 @@ static int find_irq_entry(int apic, int 
    14.4  	return -1;
    14.5  }
    14.6  
    14.7 -#ifndef CONFIG_XEN
    14.8 -#endif
    14.9  /*
   14.10   * Find the pin to which IRQ[irq] (ISA) is connected
   14.11   */
   14.12 @@ -1530,6 +1528,8 @@ void __init print_IO_APIC(void)
   14.13  	return;
   14.14  }
   14.15  
   14.16 +#if 0
   14.17 +
   14.18  static void print_APIC_bitfield (int base)
   14.19  {
   14.20  	unsigned int v;
   14.21 @@ -1670,6 +1670,9 @@ void /*__init*/ print_PIC(void)
   14.22  	v = inb(0x4d1) << 8 | inb(0x4d0);
   14.23  	printk(KERN_DEBUG "... PIC ELCR: %04x\n", v);
   14.24  }
   14.25 +
   14.26 +#endif  /*  0  */
   14.27 +
   14.28  #else
   14.29  void __init print_IO_APIC(void) { }
   14.30  #endif /* !CONFIG_XEN */
    15.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/mpparse-xen.c	Wed Feb 15 15:20:32 2006 +0100
    15.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/mpparse-xen.c	Wed Feb 15 22:06:12 2006 +0000
    15.3 @@ -856,6 +856,8 @@ void __init mp_register_lapic_address (
    15.4  #ifndef CONFIG_XEN
    15.5  	mp_lapic_addr = (unsigned long) address;
    15.6  
    15.7 +	set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
    15.8 +
    15.9  	if (boot_cpu_physical_apicid == -1U)
   15.10  		boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
   15.11  
   15.12 @@ -951,6 +953,9 @@ void __init mp_register_ioapic (
   15.13  	mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
   15.14  	mp_ioapics[idx].mpc_apicaddr = address;
   15.15  
   15.16 +#ifndef CONFIG_XEN
   15.17 +	set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
   15.18 +#endif
   15.19  	if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 < 15))
   15.20  		mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id);
   15.21  	else
    16.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Wed Feb 15 15:20:32 2006 +0100
    16.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Wed Feb 15 22:06:12 2006 +0000
    16.3 @@ -221,8 +221,10 @@ void show_regs(struct pt_regs * regs)
    16.4  
    16.5  	if (user_mode(regs))
    16.6  		printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
    16.7 -	printk(" EFLAGS: %08lx    %s  (%s)\n",
    16.8 -	       regs->eflags, print_tainted(), system_utsname.release);
    16.9 +	printk(" EFLAGS: %08lx    %s  (%s %.*s)\n",
   16.10 +	       regs->eflags, print_tainted(), system_utsname.release,
   16.11 +	       (int)strcspn(system_utsname.version, " "),
   16.12 +	       system_utsname.version);
   16.13  	printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
   16.14  		regs->eax,regs->ebx,regs->ecx,regs->edx);
   16.15  	printk("ESI: %08lx EDI: %08lx EBP: %08lx",
    17.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/smpboot.c	Wed Feb 15 15:20:32 2006 +0100
    17.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/smpboot.c	Wed Feb 15 22:06:12 2006 +0000
    17.3 @@ -87,11 +87,7 @@ EXPORT_SYMBOL(cpu_online_map);
    17.4  cpumask_t cpu_callin_map;
    17.5  cpumask_t cpu_callout_map;
    17.6  EXPORT_SYMBOL(cpu_callout_map);
    17.7 -#ifdef CONFIG_HOTPLUG_CPU
    17.8 -cpumask_t cpu_possible_map = CPU_MASK_ALL;
    17.9 -#else
   17.10  cpumask_t cpu_possible_map;
   17.11 -#endif
   17.12  EXPORT_SYMBOL(cpu_possible_map);
   17.13  static cpumask_t smp_commenced_mask;
   17.14  
    18.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c	Wed Feb 15 15:20:32 2006 +0100
    18.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/traps-xen.c	Wed Feb 15 22:06:12 2006 +0000
    18.3 @@ -85,7 +85,11 @@ asmlinkage void page_fault(void);
    18.4  asmlinkage void coprocessor_error(void);
    18.5  asmlinkage void simd_coprocessor_error(void);
    18.6  asmlinkage void alignment_check(void);
    18.7 +#ifndef CONFIG_XEN
    18.8 +asmlinkage void spurious_interrupt_bug(void);
    18.9 +#else
   18.10  asmlinkage void fixup_4gb_segment(void);
   18.11 +#endif
   18.12  asmlinkage void machine_check(void);
   18.13  
   18.14  static int kstack_depth_to_print = 24;
   18.15 @@ -163,7 +167,8 @@ static void show_trace_log_lvl(struct ta
   18.16  		stack = (unsigned long*)context->previous_esp;
   18.17  		if (!stack)
   18.18  			break;
   18.19 -		printk(KERN_EMERG " =======================\n");
   18.20 +		printk(log_lvl);
   18.21 +		printk(" =======================\n");
   18.22  	}
   18.23  }
   18.24  
   18.25 @@ -236,9 +241,11 @@ void show_registers(struct pt_regs *regs
   18.26  	}
   18.27  	print_modules();
   18.28  	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
   18.29 -			"EFLAGS: %08lx   (%s) \n",
   18.30 +			"EFLAGS: %08lx   (%s %.*s) \n",
   18.31  		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
   18.32 -		print_tainted(), regs->eflags, system_utsname.release);
   18.33 +		print_tainted(), regs->eflags, system_utsname.release,
   18.34 +		(int)strcspn(system_utsname.version, " "),
   18.35 +		system_utsname.version);
   18.36  	print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip);
   18.37  	printk(KERN_EMERG "eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
   18.38  		regs->eax, regs->ebx, regs->ecx, regs->edx);
   18.39 @@ -384,7 +391,7 @@ void die(const char * str, struct pt_reg
   18.40  
   18.41  static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
   18.42  {
   18.43 -  if (!user_mode_vm(regs))
   18.44 +	if (!user_mode_vm(regs))
   18.45  		die(str, regs, err);
   18.46  }
   18.47  
   18.48 @@ -479,15 +486,11 @@ DO_VM86_ERROR( 3, SIGTRAP, "int3", int3)
   18.49  DO_VM86_ERROR( 4, SIGSEGV, "overflow", overflow)
   18.50  DO_VM86_ERROR( 5, SIGSEGV, "bounds", bounds)
   18.51  DO_ERROR_INFO( 6, SIGILL,  "invalid opcode", invalid_op, ILL_ILLOPN, regs->eip)
   18.52 -DO_VM86_ERROR( 7, SIGSEGV, "device not available", device_not_available)
   18.53  DO_ERROR( 9, SIGFPE,  "coprocessor segment overrun", coprocessor_segment_overrun)
   18.54  DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
   18.55  DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
   18.56  DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
   18.57  DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
   18.58 -#ifdef CONFIG_X86_MCE
   18.59 -DO_ERROR(18, SIGBUS, "machine check", machine_check)
   18.60 -#endif
   18.61  DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
   18.62  
   18.63  fastcall void __kprobes do_general_protection(struct pt_regs * regs,
   18.64 @@ -749,7 +752,7 @@ fastcall void __kprobes do_debug(struct 
   18.65  		 * check for kernel mode by just checking the CPL
   18.66  		 * of CS.
   18.67  		 */
   18.68 -	  if (!user_mode(regs))
   18.69 +		if (!user_mode(regs))
   18.70  			goto clear_TF_reenable;
   18.71  	}
   18.72  
   18.73 @@ -916,6 +919,15 @@ fastcall void do_simd_coprocessor_error(
   18.74  }
   18.75  
   18.76  #ifndef CONFIG_XEN
   18.77 +fastcall void do_spurious_interrupt_bug(struct pt_regs * regs,
   18.78 +					  long error_code)
   18.79 +{
   18.80 +#if 0
   18.81 +	/* No need to warn about this any longer. */
   18.82 +	printk("Ignoring P6 Local APIC Spurious Interrupt Bug...\n");
   18.83 +#endif
   18.84 +}
   18.85 +
   18.86  fastcall void setup_x86_bogus_stack(unsigned char * stk)
   18.87  {
   18.88  	unsigned long *switch16_ptr, *switch32_ptr;
    19.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/traps.c	Wed Feb 15 15:20:32 2006 +0100
    19.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/traps.c	Wed Feb 15 22:06:12 2006 +0000
    19.3 @@ -166,7 +166,8 @@ static void show_trace_log_lvl(struct ta
    19.4  		stack = (unsigned long*)context->previous_esp;
    19.5  		if (!stack)
    19.6  			break;
    19.7 -		printk(KERN_EMERG " =======================\n");
    19.8 +		printk(log_lvl);
    19.9 +		printk(" =======================\n");
   19.10  	}
   19.11  }
   19.12  
   19.13 @@ -239,9 +240,11 @@ void show_registers(struct pt_regs *regs
   19.14  	}
   19.15  	print_modules();
   19.16  	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
   19.17 -			"EFLAGS: %08lx   (%s) \n",
   19.18 +			"EFLAGS: %08lx   (%s %.*s) \n",
   19.19  		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
   19.20 -		print_tainted(), regs->eflags, system_utsname.release);
   19.21 +		print_tainted(), regs->eflags, system_utsname.release,
   19.22 +		(int)strcspn(system_utsname.version, " "),
   19.23 +		system_utsname.version);
   19.24  	print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip);
   19.25  	printk(KERN_EMERG "eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
   19.26  		regs->eax, regs->ebx, regs->ecx, regs->edx);
    20.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Wed Feb 15 15:20:32 2006 +0100
    20.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Wed Feb 15 22:06:12 2006 +0000
    20.3 @@ -227,7 +227,6 @@ struct page *pte_alloc_one(struct mm_str
    20.4  		set_page_count(pte, 1);
    20.5  	}
    20.6  #endif
    20.7 -
    20.8  	return pte;
    20.9  }
   20.10  
    21.1 --- a/linux-2.6-xen-sparse/arch/x86_64/Makefile	Wed Feb 15 15:20:32 2006 +0100
    21.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/Makefile	Wed Feb 15 22:06:12 2006 +0000
    21.3 @@ -82,7 +82,7 @@ all: vmlinuz
    21.4  vmlinuz: vmlinux
    21.5  	$(Q)$(MAKE) $(build)=$(boot) $@
    21.6  
    21.7 -install: vmlinux
    21.8 +install:
    21.9  	$(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
   21.10  else
   21.11  #Default target when executing "make"
    22.1 --- a/linux-2.6-xen-sparse/arch/x86_64/ia32/ia32entry-xen.S	Wed Feb 15 15:20:32 2006 +0100
    22.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/ia32/ia32entry-xen.S	Wed Feb 15 22:06:12 2006 +0000
    22.3 @@ -704,7 +704,7 @@ ia32_sys_call_table:
    22.4  	.quad sys_mknodat
    22.5  	.quad sys_fchownat
    22.6  	.quad compat_sys_futimesat
    22.7 -	.quad compat_sys_newfstatat	/* 300 */
    22.8 +	.quad sys32_fstatat		/* 300 */
    22.9  	.quad sys_unlinkat
   22.10  	.quad sys_renameat
   22.11  	.quad sys_linkat
   22.12 @@ -712,6 +712,9 @@ ia32_sys_call_table:
   22.13  	.quad sys_readlinkat		/* 305 */
   22.14  	.quad sys_fchmodat
   22.15  	.quad sys_faccessat
   22.16 +	.quad sys_ni_syscall		/* pselect6 for now */
   22.17 +	.quad sys_ni_syscall		/* ppoll for now */
   22.18 +	.quad sys_unshare		/* 310 */
   22.19  ia32_syscall_end:		
   22.20  	.rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
   22.21  		.quad ni_syscall
    23.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/apic-xen.c	Wed Feb 15 15:20:32 2006 +0100
    23.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/apic-xen.c	Wed Feb 15 22:06:12 2006 +0000
    23.3 @@ -38,6 +38,26 @@
    23.4  
    23.5  int apic_verbosity;
    23.6  
    23.7 +/*
    23.8 + * 'what should we do if we get a hw irq event on an illegal vector'.
    23.9 + * each architecture has to answer this themselves.
   23.10 + */
   23.11 +void ack_bad_irq(unsigned int irq)
   23.12 +{
   23.13 +	printk("unexpected IRQ trap at vector %02x\n", irq);
   23.14 +	/*
   23.15 +	 * Currently unexpected vectors happen only on SMP and APIC.
   23.16 +	 * We _must_ ack these because every local APIC has only N
   23.17 +	 * irq slots per priority level, and a 'hanging, unacked' IRQ
   23.18 +	 * holds up an irq slot - in excessive cases (when multiple
   23.19 +	 * unexpected vectors occur) that might lock up the APIC
   23.20 +	 * completely.
   23.21 +  	 * But don't ack when the APIC is disabled. -AK
   23.22 +	 */
   23.23 +	if (!disable_apic)
   23.24 +		ack_APIC_irq();
   23.25 +}
   23.26 +
   23.27  #ifdef CONFIG_XEN
   23.28  void switch_APIC_timer_to_ipi(void *cpumask) { }
   23.29  EXPORT_SYMBOL(switch_APIC_timer_to_ipi);
    24.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Wed Feb 15 15:20:32 2006 +0100
    24.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Wed Feb 15 22:06:12 2006 +0000
    24.3 @@ -996,7 +996,7 @@ KPROBE_ENTRY(debug)
    24.4  
    24.5  #if 0
    24.6  	/* runs on exception stack */	
    24.7 -ENTRY(nmi)
    24.8 +KPROBE_ENTRY(nmi)
    24.9  	INTR_FRAME
   24.10  	pushq $-1
   24.11  	CFI_ADJUST_CFA_OFFSET 8
   24.12 @@ -1043,6 +1043,7 @@ paranoid_schedule:
   24.13  	cli
   24.14  	jmp paranoid_userspace
   24.15  	CFI_ENDPROC
   24.16 +	.previous .text
   24.17  #endif        
   24.18  
   24.19  KPROBE_ENTRY(int3)
    25.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/io_apic-xen.c	Wed Feb 15 15:20:32 2006 +0100
    25.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/io_apic-xen.c	Wed Feb 15 22:06:12 2006 +0000
    25.3 @@ -354,6 +354,16 @@ void __init check_ioapic(void)
    25.4  #endif
    25.5  					/* RED-PEN skip them on mptables too? */
    25.6  					return;
    25.7 +				case PCI_VENDOR_ID_ATI:
    25.8 +#ifndef CONFIG_XEN
    25.9 +					if (apic_runs_main_timer != 0)
   25.10 +						break;
   25.11 +					printk(KERN_INFO
   25.12 +	     "ATI board detected. Using APIC/PM timer.\n");
   25.13 +					apic_runs_main_timer = 1;
   25.14 +					nohpet = 1;
   25.15 +#endif
   25.16 +					return;
   25.17  				} 
   25.18  
   25.19  				/* No multi-function device? */
   25.20 @@ -2105,7 +2115,7 @@ int __init io_apic_get_redir_entries (in
   25.21  }
   25.22  
   25.23  
   25.24 -int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
   25.25 +int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
   25.26  {
   25.27  	struct IO_APIC_route_entry entry;
   25.28  	unsigned long flags;
   25.29 @@ -2127,8 +2137,8 @@ int io_apic_set_pci_routing (int ioapic,
   25.30  	entry.delivery_mode = INT_DELIVERY_MODE;
   25.31  	entry.dest_mode = INT_DEST_MODE;
   25.32  	entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
   25.33 -	entry.trigger = triggering;
   25.34 -	entry.polarity = polarity;
   25.35 +	entry.trigger = edge_level;
   25.36 +	entry.polarity = active_high_low;
   25.37  	entry.mask = 1;					 /* Disabled (masked) */
   25.38  
   25.39  	irq = gsi_irq_sharing(irq);
   25.40 @@ -2143,9 +2153,9 @@ int io_apic_set_pci_routing (int ioapic,
   25.41  	apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
   25.42  		"IRQ %d Mode:%i Active:%i)\n", ioapic, 
   25.43  	       mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
   25.44 -	       triggering, polarity);
   25.45 +	       edge_level, active_high_low);
   25.46  
   25.47 -	ioapic_register_intr(irq, entry.vector, triggering);
   25.48 +	ioapic_register_intr(irq, entry.vector, edge_level);
   25.49  
   25.50  	if (!ioapic && (irq < 16))
   25.51  		disable_8259A_irq(irq);
    26.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/irq-xen.c	Wed Feb 15 15:20:32 2006 +0100
    26.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/irq-xen.c	Wed Feb 15 22:06:12 2006 +0000
    26.3 @@ -155,3 +155,14 @@ asmlinkage void do_softirq(void)
    26.4   	local_irq_restore(flags);
    26.5  }
    26.6  EXPORT_SYMBOL(do_softirq);
    26.7 +
    26.8 +#ifndef CONFIG_X86_LOCAL_APIC
    26.9 +/*
   26.10 + * 'what should we do if we get a hw irq event on an illegal vector'.
   26.11 + * each architecture has to answer this themselves.
   26.12 + */
   26.13 +void ack_bad_irq(unsigned int irq)
   26.14 +{
   26.15 +        printk("unexpected IRQ trap at vector %02x\n", irq);
   26.16 +}
   26.17 +#endif
    27.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/mpparse-xen.c	Wed Feb 15 15:20:32 2006 +0100
    27.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/mpparse-xen.c	Wed Feb 15 22:06:12 2006 +0000
    27.3 @@ -687,6 +687,8 @@ void __init mp_register_lapic_address (
    27.4  #ifndef CONFIG_XEN
    27.5  	mp_lapic_addr = (unsigned long) address;
    27.6  
    27.7 +	set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
    27.8 +
    27.9  	if (boot_cpu_id == -1U)
   27.10  		boot_cpu_id = GET_APIC_ID(apic_read(APIC_ID));
   27.11  
   27.12 @@ -782,6 +784,9 @@ void __init mp_register_ioapic (
   27.13  	mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
   27.14  	mp_ioapics[idx].mpc_apicaddr = address;
   27.15  
   27.16 +#ifndef CONFIG_XEN
   27.17 +	set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
   27.18 +#endif
   27.19  	mp_ioapics[idx].mpc_apicid = id;
   27.20  	mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
   27.21  	
    28.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Wed Feb 15 15:20:32 2006 +0100
    28.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Wed Feb 15 22:06:12 2006 +0000
    28.3 @@ -454,8 +454,10 @@ static inline void __save_init_fpu( stru
    28.4   * This could still be optimized: 
    28.5   * - fold all the options into a flag word and test it with a single test.
    28.6   * - could test fs/gs bitsliced
    28.7 + *
    28.8 + * Kprobes not supported here. Set the probe on schedule instead.
    28.9   */
   28.10 -struct task_struct *
   28.11 +__kprobes struct task_struct *
   28.12  __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
   28.13  {
   28.14  	struct thread_struct *prev = &prev_p->thread,
   28.15 @@ -494,7 +496,7 @@ struct task_struct *
   28.16  	if (unlikely(next->tls_array[i] != prev->tls_array[i])) {	\
   28.17  		mcl->op      = __HYPERVISOR_update_descriptor;		\
   28.18  		mcl->args[0] = virt_to_machine(				\
   28.19 -			&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]);\
   28.20 +			&cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + i]);		\
   28.21  		mcl->args[1] = next->tls_array[i];			\
   28.22  		mcl++;							\
   28.23  	}								\
    29.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Feb 15 15:20:32 2006 +0100
    29.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Feb 15 22:06:12 2006 +0000
    29.3 @@ -130,7 +130,6 @@ unsigned long saved_video_mode;
    29.4  /*
    29.5   * Setup options
    29.6   */
    29.7 -struct drive_info_struct { char dummy[32]; } drive_info;
    29.8  struct screen_info screen_info;
    29.9  struct sys_desc_table_struct {
   29.10  	unsigned short length;
   29.11 @@ -628,7 +627,6 @@ void __init setup_arch(char **cmdline_p)
   29.12  
   29.13  #ifdef CONFIG_XEN
   29.14   	ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); 
   29.15 - 	drive_info = DRIVE_INFO;
   29.16  	kernel_end = 0;		/* dummy */
   29.17   	screen_info = SCREEN_INFO;
   29.18  
   29.19 @@ -664,7 +662,6 @@ void __init setup_arch(char **cmdline_p)
   29.20  	ARCH_SETUP
   29.21  #else
   29.22   	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
   29.23 - 	drive_info = DRIVE_INFO;
   29.24   	screen_info = SCREEN_INFO;
   29.25  	edid_info = EDID_INFO;
   29.26  	saved_video_mode = SAVED_VIDEO_MODE;
   29.27 @@ -936,7 +933,7 @@ void __init setup_arch(char **cmdline_p)
   29.28  	e820_setup_gap();
   29.29  
   29.30  #ifdef CONFIG_GART_IOMMU
   29.31 -       iommu_hole_init();
   29.32 +	iommu_hole_init();
   29.33  #endif
   29.34  
   29.35  #ifdef CONFIG_XEN
   29.36 @@ -1101,6 +1098,7 @@ static void __init amd_detect_cmp(struct
   29.37  static int __init init_amd(struct cpuinfo_x86 *c)
   29.38  {
   29.39  	int r;
   29.40 +	unsigned level;
   29.41  
   29.42  #ifdef CONFIG_SMP
   29.43  	unsigned long value;
   29.44 @@ -1123,6 +1121,11 @@ static int __init init_amd(struct cpuinf
   29.45  	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
   29.46  	clear_bit(0*32+31, &c->x86_capability);
   29.47  	
   29.48 +	/* On C+ stepping K8 rep microcode works well for copy/memset */
   29.49 +	level = cpuid_eax(1);
   29.50 +	if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58))
   29.51 +		set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
   29.52 +
   29.53  	r = get_model_name(c);
   29.54  	if (!r) { 
   29.55  		switch (c->x86) { 
    30.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c	Wed Feb 15 15:20:32 2006 +0100
    30.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c	Wed Feb 15 22:06:12 2006 +0000
    30.3 @@ -90,6 +90,20 @@ static inline void conditional_sti(struc
    30.4  		local_irq_enable();
    30.5  }
    30.6  
    30.7 +static inline void preempt_conditional_sti(struct pt_regs *regs)
    30.8 +{
    30.9 +	preempt_disable();
   30.10 +	if (regs->eflags & X86_EFLAGS_IF)
   30.11 +		local_irq_enable();
   30.12 +}
   30.13 +
   30.14 +static inline void preempt_conditional_cli(struct pt_regs *regs)
   30.15 +{
   30.16 +	if (regs->eflags & X86_EFLAGS_IF)
   30.17 +		local_irq_disable();
   30.18 +	preempt_enable_no_resched();
   30.19 +}
   30.20 +
   30.21  static int kstack_depth_to_print = 10;
   30.22  
   30.23  #ifdef CONFIG_KALLSYMS
   30.24 @@ -372,7 +386,7 @@ void out_of_line_bug(void)
   30.25  static DEFINE_SPINLOCK(die_lock);
   30.26  static int die_owner = -1;
   30.27  
   30.28 -unsigned long oops_begin(void)
   30.29 +unsigned __kprobes long oops_begin(void)
   30.30  {
   30.31  	int cpu = safe_smp_processor_id();
   30.32  	unsigned long flags;
   30.33 @@ -391,7 +405,7 @@ unsigned long oops_begin(void)
   30.34  	return flags;
   30.35  }
   30.36  
   30.37 -void oops_end(unsigned long flags)
   30.38 +void __kprobes oops_end(unsigned long flags)
   30.39  { 
   30.40  	die_owner = -1;
   30.41  	bust_spinlocks(0);
   30.42 @@ -400,7 +414,7 @@ void oops_end(unsigned long flags)
   30.43  		panic("Oops");
   30.44  }
   30.45  
   30.46 -void __die(const char * str, struct pt_regs * regs, long err)
   30.47 +void __kprobes __die(const char * str, struct pt_regs * regs, long err)
   30.48  {
   30.49  	static int die_counter;
   30.50  	printk(KERN_EMERG "%s: %04lx [%u] ", str, err & 0xffff,++die_counter);
   30.51 @@ -433,7 +447,7 @@ void die(const char * str, struct pt_reg
   30.52  }
   30.53  
   30.54  #ifdef CONFIG_X86_LOCAL_APIC
   30.55 -void die_nmi(char *str, struct pt_regs *regs)
   30.56 +void __kprobes die_nmi(char *str, struct pt_regs *regs)
   30.57  {
   30.58  	unsigned long flags = oops_begin();
   30.59  
   30.60 @@ -577,7 +591,8 @@ asmlinkage void __kprobes do_general_pro
   30.61  	}
   30.62  }
   30.63  
   30.64 -static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
   30.65 +static __kprobes void
   30.66 +mem_parity_error(unsigned char reason, struct pt_regs * regs)
   30.67  {
   30.68  	printk("Uhhuh. NMI received. Dazed and confused, but trying to continue\n");
   30.69  	printk("You probably have a hardware problem with your RAM chips\n");
   30.70 @@ -589,7 +604,8 @@ static void mem_parity_error(unsigned ch
   30.71  #endif /* XEN */
   30.72  }
   30.73  
   30.74 -static void io_check_error(unsigned char reason, struct pt_regs * regs)
   30.75 +static __kprobes void
   30.76 +io_check_error(unsigned char reason, struct pt_regs * regs)
   30.77  {
   30.78  	printk("NMI: IOCK error (debug interrupt?)\n");
   30.79  	show_registers(regs);
   30.80 @@ -604,7 +620,8 @@ static void io_check_error(unsigned char
   30.81  #endif /* XEN */
   30.82  }
   30.83  
   30.84 -static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
   30.85 +static __kprobes void
   30.86 +unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
   30.87  {	printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
   30.88  	printk("Dazed and confused, but trying to continue\n");
   30.89  	printk("Do you have a strange power saving mode enabled?\n");
   30.90 @@ -612,7 +629,7 @@ static void unknown_nmi_error(unsigned c
   30.91  
   30.92  /* Runs on IST stack. This code must keep interrupts off all the time.
   30.93     Nested NMIs are prevented by the CPU. */
   30.94 -asmlinkage void default_do_nmi(struct pt_regs *regs)
   30.95 +asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
   30.96  {
   30.97  	unsigned char reason = 0;
   30.98  	int cpu;
   30.99 @@ -664,7 +681,7 @@ asmlinkage void __kprobes do_int3(struct
  30.100  /* Help handler running on IST stack to switch back to user stack
  30.101     for scheduling or signal handling. The actual stack switch is done in
  30.102     entry.S */
  30.103 -asmlinkage struct pt_regs *sync_regs(struct pt_regs *eregs)
  30.104 +asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
  30.105  {
  30.106  	struct pt_regs *regs = eregs;
  30.107  	/* Did already sync */
  30.108 @@ -696,7 +713,7 @@ asmlinkage void __kprobes do_debug(struc
  30.109  						SIGTRAP) == NOTIFY_STOP)
  30.110  		return;
  30.111  
  30.112 -	conditional_sti(regs);
  30.113 +	preempt_conditional_sti(regs);
  30.114  
  30.115  	/* Mask out spurious debug traps due to lazy DR7 setting */
  30.116  	if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
  30.117 @@ -741,11 +758,13 @@ asmlinkage void __kprobes do_debug(struc
  30.118  
  30.119  clear_dr7:
  30.120  	set_debugreg(0UL, 7);
  30.121 +	preempt_conditional_cli(regs);
  30.122  	return;
  30.123  
  30.124  clear_TF_reenable:
  30.125  	set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
  30.126  	regs->eflags &= ~TF_MASK;
  30.127 +	preempt_conditional_cli(regs);
  30.128  }
  30.129  
  30.130  static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
    31.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/x8664_ksyms-xen.c	Wed Feb 15 15:20:32 2006 +0100
    31.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/x8664_ksyms-xen.c	Wed Feb 15 22:06:12 2006 +0000
    31.3 @@ -39,11 +39,6 @@ extern void __write_lock_failed(rwlock_t
    31.4  extern void __read_lock_failed(rwlock_t *rw);
    31.5  #endif
    31.6  
    31.7 -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
    31.8 -extern struct drive_info_struct drive_info;
    31.9 -EXPORT_SYMBOL(drive_info);
   31.10 -#endif
   31.11 -
   31.12  /* platform dependent support */
   31.13  EXPORT_SYMBOL(boot_cpu_data);
   31.14  //EXPORT_SYMBOL(dump_fpu);
    32.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c	Wed Feb 15 15:20:32 2006 +0100
    32.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c	Wed Feb 15 22:06:12 2006 +0000
    32.3 @@ -33,7 +33,6 @@
    32.4  #include <asm/proto.h>
    32.5  #include <asm/kdebug.h>
    32.6  #include <asm-generic/sections.h>
    32.7 -#include <asm/kdebug.h>
    32.8  
    32.9  /* Page fault error code bits */
   32.10  #define PF_PROT	(1<<0)		/* or no page found */
   32.11 @@ -158,8 +157,8 @@ void dump_pagetable(unsigned long addres
   32.12  
   32.13  	pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); 
   32.14  	pgd += pgd_index(address);
   32.15 +	if (bad_address(pgd)) goto bad;
   32.16  	printk("PGD %lx ", pgd_val(*pgd));
   32.17 -	if (bad_address(pgd)) goto bad;
   32.18  	if (!pgd_present(*pgd)) goto ret; 
   32.19  
   32.20  	pud = __pud_offset_k((pud_t *)pgd_page(*pgd), address);
   32.21 @@ -331,7 +330,7 @@ asmlinkage void __kprobes do_page_fault(
   32.22  	siginfo_t info;
   32.23  
   32.24  	if (!user_mode(regs))
   32.25 -		error_code &= ~4; /* means kernel */
   32.26 +		error_code &= ~PF_USER; /* means kernel */
   32.27  
   32.28  	/* get the address */
   32.29  	address = HYPERVISOR_shared_info->vcpu_info[
    33.1 --- a/linux-2.6-xen-sparse/drivers/Makefile	Wed Feb 15 15:20:32 2006 +0100
    33.2 +++ b/linux-2.6-xen-sparse/drivers/Makefile	Wed Feb 15 22:06:12 2006 +0000
    33.3 @@ -70,7 +70,7 @@ obj-$(CONFIG_EISA)		+= eisa/
    33.4  obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
    33.5  obj-$(CONFIG_MMC)		+= mmc/
    33.6  obj-$(CONFIG_INFINIBAND)	+= infiniband/
    33.7 -obj-$(CONFIG_SGI_IOC4)		+= sn/
    33.8 +obj-$(CONFIG_SGI_SN)		+= sn/
    33.9  obj-y				+= firmware/
   33.10  obj-$(CONFIG_CRYPTO)		+= crypto/
   33.11  obj-$(CONFIG_SUPERH)		+= sh/
    34.1 --- a/linux-2.6-xen-sparse/drivers/char/tty_io.c	Wed Feb 15 15:20:32 2006 +0100
    34.2 +++ b/linux-2.6-xen-sparse/drivers/char/tty_io.c	Wed Feb 15 22:06:12 2006 +0000
    34.3 @@ -255,6 +255,7 @@ static void tty_buffer_free_all(struct t
    34.4  
    34.5  static void tty_buffer_init(struct tty_struct *tty)
    34.6  {
    34.7 +	spin_lock_init(&tty->buf.lock);
    34.8  	tty->buf.head = NULL;
    34.9  	tty->buf.tail = NULL;
   34.10  	tty->buf.free = NULL;
   34.11 @@ -268,6 +269,9 @@ static struct tty_buffer *tty_buffer_all
   34.12  	p->used = 0;
   34.13  	p->size = size;
   34.14  	p->next = NULL;
   34.15 +	p->active = 0;
   34.16 +	p->commit = 0;
   34.17 +	p->read = 0;
   34.18  	p->char_buf_ptr = (char *)(p->data);
   34.19  	p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size;
   34.20  /* 	printk("Flip create %p\n", p); */
   34.21 @@ -298,6 +302,8 @@ static struct tty_buffer *tty_buffer_fin
   34.22  			*tbh = t->next;
   34.23  			t->next = NULL;
   34.24  			t->used = 0;
   34.25 +			t->commit = 0;
   34.26 +			t->read = 0;
   34.27  			/* DEBUG ONLY */
   34.28  			memset(t->data, '*', size);
   34.29  /* 			printk("Flip recycle %p\n", t); */
   34.30 @@ -314,25 +320,37 @@ static struct tty_buffer *tty_buffer_fin
   34.31  
   34.32  int tty_buffer_request_room(struct tty_struct *tty, size_t size)
   34.33  {
   34.34 -	struct tty_buffer *b = tty->buf.tail, *n;
   34.35 -	int left = 0;
   34.36 +	struct tty_buffer *b, *n;
   34.37 +	int left;
   34.38 +	unsigned long flags;
   34.39 +
   34.40 +	spin_lock_irqsave(&tty->buf.lock, flags);
   34.41  
   34.42  	/* OPTIMISATION: We could keep a per tty "zero" sized buffer to
   34.43  	   remove this conditional if its worth it. This would be invisible
   34.44  	   to the callers */
   34.45 -	if(b != NULL)
   34.46 +	if ((b = tty->buf.tail) != NULL) {
   34.47  		left = b->size - b->used;
   34.48 -	if(left >= size)
   34.49 -		return size;
   34.50 -	/* This is the slow path - looking for new buffers to use */
   34.51 -	n = tty_buffer_find(tty, size);
   34.52 -	if(n == NULL)
   34.53 -		return left;
   34.54 -	if(b != NULL)
   34.55 -		b->next = n;
   34.56 -	else
   34.57 -		tty->buf.head = n;
   34.58 -	tty->buf.tail = n;
   34.59 +		b->active = 1;
   34.60 +	} else
   34.61 +		left = 0;
   34.62 +
   34.63 +	if (left < size) {
   34.64 +		/* This is the slow path - looking for new buffers to use */
   34.65 +		if ((n = tty_buffer_find(tty, size)) != NULL) {
   34.66 +			if (b != NULL) {
   34.67 +				b->next = n;
   34.68 +				b->active = 0;
   34.69 +				b->commit = b->used;
   34.70 +			} else
   34.71 +				tty->buf.head = n;
   34.72 +			tty->buf.tail = n;
   34.73 +			n->active = 1;
   34.74 +		} else
   34.75 +			size = left;
   34.76 +	}
   34.77 +
   34.78 +	spin_unlock_irqrestore(&tty->buf.lock, flags);
   34.79  	return size;
   34.80  }
   34.81  
   34.82 @@ -398,10 +416,12 @@ EXPORT_SYMBOL_GPL(tty_insert_flip_string
   34.83  int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size)
   34.84  {
   34.85  	int space = tty_buffer_request_room(tty, size);
   34.86 -	struct tty_buffer *tb = tty->buf.tail;
   34.87 -	*chars = tb->char_buf_ptr + tb->used;
   34.88 -	memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
   34.89 -	tb->used += space;
   34.90 +	if (likely(space)) {
   34.91 +		struct tty_buffer *tb = tty->buf.tail;
   34.92 +		*chars = tb->char_buf_ptr + tb->used;
   34.93 +		memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
   34.94 +		tb->used += space;
   34.95 +	}
   34.96  	return space;
   34.97  }
   34.98  
   34.99 @@ -418,10 +438,12 @@ EXPORT_SYMBOL_GPL(tty_prepare_flip_strin
  34.100  int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size)
  34.101  {
  34.102  	int space = tty_buffer_request_room(tty, size);
  34.103 -	struct tty_buffer *tb = tty->buf.tail;
  34.104 -	*chars = tb->char_buf_ptr + tb->used;
  34.105 -	*flags = tb->flag_buf_ptr + tb->used;
  34.106 -	tb->used += space;
  34.107 +	if (likely(space)) {
  34.108 +		struct tty_buffer *tb = tty->buf.tail;
  34.109 +		*chars = tb->char_buf_ptr + tb->used;
  34.110 +		*flags = tb->flag_buf_ptr + tb->used;
  34.111 +		tb->used += space;
  34.112 +	}
  34.113  	return space;
  34.114  }
  34.115  
  34.116 @@ -2737,6 +2759,9 @@ static void flush_to_ldisc(void *private
  34.117  	unsigned long 	flags;
  34.118  	struct tty_ldisc *disc;
  34.119  	struct tty_buffer *tbuf;
  34.120 +	int count;
  34.121 +	char *char_buf;
  34.122 +	unsigned char *flag_buf;
  34.123  
  34.124  	disc = tty_ldisc_ref(tty);
  34.125  	if (disc == NULL)	/*  !TTY_LDISC */
  34.126 @@ -2749,20 +2774,24 @@ static void flush_to_ldisc(void *private
  34.127  		schedule_delayed_work(&tty->buf.work, 1);
  34.128  		goto out;
  34.129  	}
  34.130 -	spin_lock_irqsave(&tty->read_lock, flags);
  34.131 +	spin_lock_irqsave(&tty->buf.lock, flags);
  34.132  	while((tbuf = tty->buf.head) != NULL) {
  34.133 +		while ((count = tbuf->commit - tbuf->read) != 0) {
  34.134 +			char_buf = tbuf->char_buf_ptr + tbuf->read;
  34.135 +			flag_buf = tbuf->flag_buf_ptr + tbuf->read;
  34.136 +			tbuf->read += count;
  34.137 +			spin_unlock_irqrestore(&tty->buf.lock, flags);
  34.138 +			disc->receive_buf(tty, char_buf, flag_buf, count);
  34.139 +			spin_lock_irqsave(&tty->buf.lock, flags);
  34.140 +		}
  34.141 +		if (tbuf->active)
  34.142 +			break;
  34.143  		tty->buf.head = tbuf->next;
  34.144  		if (tty->buf.head == NULL)
  34.145  			tty->buf.tail = NULL;
  34.146 -		spin_unlock_irqrestore(&tty->read_lock, flags);
  34.147 -		/* printk("Process buffer %p for %d\n", tbuf, tbuf->used); */
  34.148 -		disc->receive_buf(tty, tbuf->char_buf_ptr,
  34.149 -				       tbuf->flag_buf_ptr,
  34.150 -				       tbuf->used);
  34.151 -		spin_lock_irqsave(&tty->read_lock, flags);
  34.152  		tty_buffer_free(tty, tbuf);
  34.153  	}
  34.154 -	spin_unlock_irqrestore(&tty->read_lock, flags);
  34.155 +	spin_unlock_irqrestore(&tty->buf.lock, flags);
  34.156  out:
  34.157  	tty_ldisc_deref(disc);
  34.158  }
  34.159 @@ -2854,6 +2883,14 @@ EXPORT_SYMBOL(tty_get_baud_rate);
  34.160  
  34.161  void tty_flip_buffer_push(struct tty_struct *tty)
  34.162  {
  34.163 +	unsigned long flags;
  34.164 +	spin_lock_irqsave(&tty->buf.lock, flags);
  34.165 +	if (tty->buf.tail != NULL) {
  34.166 +		tty->buf.tail->active = 0;
  34.167 +		tty->buf.tail->commit = tty->buf.tail->used;
  34.168 +	}
  34.169 +	spin_unlock_irqrestore(&tty->buf.lock, flags);
  34.170 +
  34.171  	if (tty->low_latency)
  34.172  		flush_to_ldisc((void *) tty);
  34.173  	else
    35.1 --- a/linux-2.6-xen-sparse/drivers/serial/Kconfig	Wed Feb 15 15:20:32 2006 +0100
    35.2 +++ b/linux-2.6-xen-sparse/drivers/serial/Kconfig	Wed Feb 15 22:06:12 2006 +0000
    35.3 @@ -99,6 +99,7 @@ config SERIAL_8250_NR_UARTS
    35.4  config SERIAL_8250_RUNTIME_UARTS
    35.5  	int "Number of 8250/16550 serial ports to register at runtime"
    35.6  	depends on SERIAL_8250
    35.7 +	range 0 SERIAL_8250_NR_UARTS
    35.8  	default "4"
    35.9  	help
   35.10  	  Set this to the maximum number of serial ports you want
   35.11 @@ -893,20 +894,20 @@ config SERIAL_VR41XX_CONSOLE
   35.12  	  a console on a serial port, say Y.  Otherwise, say N.
   35.13  
   35.14  config SERIAL_JSM
   35.15 -        tristate "Digi International NEO PCI Support"
   35.16 -	depends on PCI && BROKEN
   35.17 -        select SERIAL_CORE
   35.18 -        help
   35.19 -          This is a driver for Digi International's Neo series
   35.20 -          of cards which provide multiple serial ports. You would need
   35.21 -          something like this to connect more than two modems to your Linux
   35.22 -          box, for instance in order to become a dial-in server. This driver
   35.23 -          supports PCI boards only.
   35.24 -          If you have a card like this, say Y here and read the file
   35.25 -          <file:Documentation/jsm.txt>.
   35.26 +	tristate "Digi International NEO PCI Support"
   35.27 +	depends on PCI
   35.28 +	select SERIAL_CORE
   35.29 +	help
   35.30 +	  This is a driver for Digi International's Neo series
   35.31 +	  of cards which provide multiple serial ports. You would need
   35.32 +	  something like this to connect more than two modems to your Linux
   35.33 +	  box, for instance in order to become a dial-in server. This driver
   35.34 +	  supports PCI boards only.
   35.35 +	  If you have a card like this, say Y here and read the file
   35.36 +	  <file:Documentation/jsm.txt>.
   35.37  
   35.38 -          To compile this driver as a module, choose M here: the
   35.39 -          module will be called jsm.
   35.40 +	  To compile this driver as a module, choose M here: the
   35.41 +	  module will be called jsm.
   35.42  
   35.43  config SERIAL_SGI_IOC4
   35.44  	tristate "SGI IOC4 controller serial support"
    36.1 --- a/linux-2.6-xen-sparse/fs/Kconfig	Wed Feb 15 15:20:32 2006 +0100
    36.2 +++ b/linux-2.6-xen-sparse/fs/Kconfig	Wed Feb 15 22:06:12 2006 +0000
    36.3 @@ -884,8 +884,6 @@ config CONFIGFS_FS
    36.4  	  Both sysfs and configfs can and should exist together on the
    36.5  	  same system. One is not a replacement for the other.
    36.6  
    36.7 -	  If unsure, say N.
    36.8 -
    36.9  endmenu
   36.10  
   36.11  menu "Miscellaneous filesystems"
    37.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/desc.h	Wed Feb 15 15:20:32 2006 +0100
    37.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/desc.h	Wed Feb 15 22:06:12 2006 +0000
    37.3 @@ -13,7 +13,7 @@
    37.4  
    37.5  #include <asm/mmu.h>
    37.6  
    37.7 -extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
    37.8 +extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
    37.9  
   37.10  DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
   37.11  
    38.1 --- a/linux-2.6-xen-sparse/include/asm-i386/system.h	Wed Feb 15 15:20:32 2006 +0100
    38.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/system.h	Wed Feb 15 22:06:12 2006 +0000
    38.3 @@ -503,7 +503,6 @@ struct alt_instr {
    38.4  #endif
    38.5  
    38.6  #ifdef CONFIG_SMP
    38.7 -#define smp_wmb()	wmb()
    38.8  #if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
    38.9  #define smp_alt_mb(instr)                                           \
   38.10  __asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
   38.11 @@ -524,8 +523,8 @@ struct alt_instr {
   38.12  		     :                                              \
   38.13  		     : "i" (X86_FEATURE_XMM2)                       \
   38.14  		     : "memory")
   38.15 +#define smp_mb()  smp_alt_mb("mfence")
   38.16  #define smp_rmb() smp_alt_mb("lfence")
   38.17 -#define smp_mb()  smp_alt_mb("mfence")
   38.18  #define set_mb(var, value) do {                                     \
   38.19  unsigned long __set_mb_temp;                                        \
   38.20  __asm__ __volatile__("6667:movl %1, %0\n6668:\n"                    \
   38.21 @@ -547,10 +546,11 @@ unsigned long __set_mb_temp;            
   38.22  		     : "1" (value)                                  \
   38.23  		     : "memory"); } while (0)
   38.24  #else
   38.25 -#define smp_rmb()	rmb()
   38.26  #define smp_mb()	mb()
   38.27 -#define set_mb(var, value) do { xchg(&var, value); } while (0)
   38.28 +#define smp_rmb()	rmb()
   38.29 +#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
   38.30  #endif
   38.31 +#define smp_wmb()	wmb()
   38.32  #define smp_read_barrier_depends()	read_barrier_depends()
   38.33  #else
   38.34  #define smp_mb()	barrier()
    39.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h	Wed Feb 15 15:20:32 2006 +0100
    39.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h	Wed Feb 15 22:06:12 2006 +0000
    39.3 @@ -69,8 +69,6 @@ extern struct desc_ptr idt_descr, cpu_gd
    39.4  
    39.5  extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
    39.6  
    39.7 -#define get_cpu_gdt_table(_cpu) ((struct desc_struct *)(cpu_gdt_descr[(_cpu)].address))
    39.8 -
    39.9  #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
   39.10  #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))
   39.11  
   39.12 @@ -163,7 +161,7 @@ static inline void set_tss_desc(unsigned
   39.13  	 * -1? seg base+limit should be pointing to the address of the
   39.14  	 * last valid byte
   39.15  	 */
   39.16 -        set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_TSS], 
   39.17 +	set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_TSS], 
   39.18  		(unsigned long)addr, DESC_TSS,
   39.19  		IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1);
   39.20  } 
   39.21 @@ -225,7 +223,7 @@ static inline void load_TLS(struct threa
   39.22  	gdt[2] = t->tls_array[2];
   39.23  #endif
   39.24  #define C(i) \
   39.25 -	HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), t->tls_array[i])
   39.26 +	HYPERVISOR_update_descriptor(virt_to_machine(&cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + i]), t->tls_array[i])
   39.27  
   39.28  	C(0); C(1); C(2);
   39.29  #undef C
   39.30 @@ -236,13 +234,13 @@ static inline void load_TLS(struct threa
   39.31   */
   39.32  static inline void load_LDT_nolock (mm_context_t *pc, int cpu)
   39.33  {
   39.34 -        void *segments = pc->ldt;
   39.35 -        int count = pc->size;
   39.36 +	void *segments = pc->ldt;
   39.37 +	int count = pc->size;
   39.38  
   39.39 -        if (likely(!count))
   39.40 -                segments = NULL;
   39.41 +	if (likely(!count))
   39.42 +		segments = NULL;
   39.43  
   39.44 -        xen_set_ldt((unsigned long)segments, count);
   39.45 +	xen_set_ldt((unsigned long)segments, count);
   39.46  }
   39.47  
   39.48  static inline void load_LDT(mm_context_t *pc)
    40.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/io.h	Wed Feb 15 15:20:32 2006 +0100
    40.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/io.h	Wed Feb 15 22:06:12 2006 +0000
    40.3 @@ -3,6 +3,7 @@
    40.4  
    40.5  #include <linux/config.h>
    40.6  #include <asm/fixmap.h>
    40.7 +
    40.8  /*
    40.9   * This file contains the definitions for the x86 IO instructions
   40.10   * inb/inw/inl/outb/outw/outl and the "string versions" of the same
   40.11 @@ -120,7 +121,6 @@ static inline void * phys_to_virt(unsign
   40.12  	return __va(address);
   40.13  }
   40.14  
   40.15 -
   40.16  #define virt_to_bus(_x) phys_to_machine(__pa(_x))
   40.17  #define bus_to_virt(_x) __va(machine_to_phys(_x))
   40.18  #endif
    41.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h	Wed Feb 15 15:20:32 2006 +0100
    41.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h	Wed Feb 15 22:06:12 2006 +0000
    41.3 @@ -156,7 +156,6 @@ static inline void set_in_cr4 (unsigned 
    41.4  	}
    41.5  }
    41.6  
    41.7 -
    41.8  static inline void clear_in_cr4 (unsigned long mask)
    41.9  {
   41.10  #ifndef CONFIG_XEN
   41.11 @@ -176,7 +175,6 @@ static inline void clear_in_cr4 (unsigne
   41.12  #define MCA_bus 0
   41.13  #define MCA_bus__is_a_macro
   41.14  
   41.15 -
   41.16  /*
   41.17   * User space process size. 47bits minus one guard page.
   41.18   */
   41.19 @@ -278,7 +276,7 @@ struct thread_struct {
   41.20  	unsigned io_bitmap_max;
   41.21  /* cached TLS descriptors. */
   41.22  	u64 tls_array[GDT_ENTRY_TLS_ENTRIES];
   41.23 -       	unsigned int	iopl;
   41.24 +	unsigned int	iopl;
   41.25  } __attribute__((aligned(16)));
   41.26  
   41.27  #define INIT_THREAD  { \
    42.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/smp.h	Wed Feb 15 15:20:32 2006 +0100
    42.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/smp.h	Wed Feb 15 22:06:12 2006 +0000
    42.3 @@ -100,6 +100,7 @@ extern unsigned disabled_cpus;
    42.4  extern u8 x86_cpu_to_apicid[NR_CPUS];	/* physical ID */
    42.5  extern u8 x86_cpu_to_log_apicid[NR_CPUS];
    42.6  extern u8 bios_cpu_apicid[];
    42.7 +
    42.8  #ifdef CONFIG_X86_LOCAL_APIC
    42.9  static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
   42.10  {
    43.1 --- a/linux-2.6-xen-sparse/include/linux/mm.h	Wed Feb 15 15:20:32 2006 +0100
    43.2 +++ b/linux-2.6-xen-sparse/include/linux/mm.h	Wed Feb 15 22:06:12 2006 +0000
    43.3 @@ -309,7 +309,7 @@ struct page {
    43.4   */
    43.5  #define put_page_testzero(p)				\
    43.6  	({						\
    43.7 -		BUG_ON(page_count(p) == 0);		\
    43.8 +		BUG_ON(atomic_read(&(p)->_count) == -1);\
    43.9  		atomic_add_negative(-1, &(p)->_count);	\
   43.10  	})
   43.11  
    44.1 --- a/linux-2.6-xen-sparse/mm/memory.c	Wed Feb 15 15:20:32 2006 +0100
    44.2 +++ b/linux-2.6-xen-sparse/mm/memory.c	Wed Feb 15 22:06:12 2006 +0000
    44.3 @@ -1011,7 +1011,7 @@ int get_user_pages(struct task_struct *t
    44.4  		}
    44.5  
    44.6  #ifdef CONFIG_XEN
    44.7 -                if (vma && (vma->vm_flags & VM_FOREIGN)) {
    44.8 +		if (vma && (vma->vm_flags & VM_FOREIGN)) {
    44.9  			struct page **map = vma->vm_private_data;
   44.10  			int offset = (start - vma->vm_start) >> PAGE_SHIFT;
   44.11  
   44.12 @@ -1025,7 +1025,7 @@ int get_user_pages(struct task_struct *t
   44.13  				len--;
   44.14  				continue;
   44.15  			}
   44.16 -                }
   44.17 +		}
   44.18  #endif
   44.19  		if (!vma || (vma->vm_flags & (VM_IO | VM_PFNMAP))
   44.20  				|| !(vm_flags & vma->vm_flags))
   44.21 @@ -1367,66 +1367,60 @@ int remap_pfn_range(struct vm_area_struc
   44.22  EXPORT_SYMBOL(remap_pfn_range);
   44.23  
   44.24  #ifdef CONFIG_XEN
   44.25 -static inline int generic_pte_range(struct mm_struct *mm,
   44.26 -                                    pmd_t *pmd,
   44.27 -                                    unsigned long addr,
   44.28 -                                    unsigned long end,
   44.29 -                                    pte_fn_t fn, void *data)
   44.30 +static inline int generic_pte_range(struct mm_struct *mm, pmd_t *pmd,
   44.31 +				    unsigned long addr, unsigned long end,
   44.32 +				    pte_fn_t fn, void *data)
   44.33  {
   44.34  	pte_t *pte;
   44.35 -        int err;
   44.36 -        struct page *pte_page;
   44.37 -
   44.38 -        pte = (mm == &init_mm) ?
   44.39 -                pte_alloc_kernel(pmd, addr) :
   44.40 -                pte_alloc_map(mm, pmd, addr);
   44.41 -        if (!pte)
   44.42 -                return -ENOMEM;
   44.43 +	int err;
   44.44 +	struct page *pte_page;
   44.45  
   44.46 -        pte_page = pmd_page(*pmd);
   44.47 +	pte = (mm == &init_mm) ?
   44.48 +		pte_alloc_kernel(pmd, addr) :
   44.49 +		pte_alloc_map(mm, pmd, addr);
   44.50 +	if (!pte)
   44.51 +		return -ENOMEM;
   44.52  
   44.53 -        do {
   44.54 -                err = fn(pte, pte_page, addr, data);
   44.55 +	pte_page = pmd_page(*pmd);
   44.56 +
   44.57 +	do {
   44.58 +		err = fn(pte, pte_page, addr, data);
   44.59  		if (err)
   44.60 -                        break;
   44.61 -        } while (pte++, addr += PAGE_SIZE, addr != end);
   44.62 +			break;
   44.63 +	} while (pte++, addr += PAGE_SIZE, addr != end);
   44.64  
   44.65 -        if (mm != &init_mm)
   44.66 -                pte_unmap(pte-1);
   44.67 -        return err;
   44.68 -
   44.69 +	if (mm != &init_mm)
   44.70 +		pte_unmap(pte-1);
   44.71 +	return err;
   44.72  }
   44.73  
   44.74 -static inline int generic_pmd_range(struct mm_struct *mm,
   44.75 -                                    pud_t *pud,
   44.76 -                                    unsigned long addr,
   44.77 -                                    unsigned long end,
   44.78 -                                    pte_fn_t fn, void *data)
   44.79 +static inline int generic_pmd_range(struct mm_struct *mm, pud_t *pud,
   44.80 +				    unsigned long addr, unsigned long end,
   44.81 +				    pte_fn_t fn, void *data)
   44.82  {
   44.83  	pmd_t *pmd;
   44.84  	unsigned long next;
   44.85 -        int err;
   44.86 +	int err;
   44.87  
   44.88  	pmd = pmd_alloc(mm, pud, addr);
   44.89  	if (!pmd)
   44.90  		return -ENOMEM;
   44.91  	do {
   44.92  		next = pmd_addr_end(addr, end);
   44.93 -                err = generic_pte_range(mm, pmd, addr, next, fn, data);
   44.94 -                if (err)
   44.95 -                    break;
   44.96 +		err = generic_pte_range(mm, pmd, addr, next, fn, data);
   44.97 +		if (err)
   44.98 +			break;
   44.99  	} while (pmd++, addr = next, addr != end);
  44.100  	return err;
  44.101  }
  44.102  
  44.103  static inline int generic_pud_range(struct mm_struct *mm, pgd_t *pgd,
  44.104 -                                    unsigned long addr,
  44.105 -                                    unsigned long end,
  44.106 -                                    pte_fn_t fn, void *data)
  44.107 +				    unsigned long addr, unsigned long end,
  44.108 +				    pte_fn_t fn, void *data)
  44.109  {
  44.110  	pud_t *pud;
  44.111  	unsigned long next;
  44.112 -        int err;
  44.113 +	int err;
  44.114  
  44.115  	pud = pud_alloc(mm, pgd, addr);
  44.116  	if (!pud)
  44.117 @@ -1434,7 +1428,7 @@ static inline int generic_pud_range(stru
  44.118  	do {
  44.119  		next = pud_addr_end(addr, end);
  44.120  		err = generic_pmd_range(mm, pud, addr, next, fn, data);
  44.121 -                if (err)
  44.122 +		if (err)
  44.123  			break;
  44.124  	} while (pud++, addr = next, addr != end);
  44.125  	return err;
  44.126 @@ -1445,7 +1439,7 @@ static inline int generic_pud_range(stru
  44.127   * and calling a provided function on each leaf page table.
  44.128   */
  44.129  int generic_page_range(struct mm_struct *mm, unsigned long addr,
  44.130 -                  unsigned long size, pte_fn_t fn, void *data)
  44.131 +		       unsigned long size, pte_fn_t fn, void *data)
  44.132  {
  44.133  	pgd_t *pgd;
  44.134  	unsigned long next;
    45.1 --- a/linux-2.6-xen-sparse/mm/page_alloc.c	Wed Feb 15 15:20:32 2006 +0100
    45.2 +++ b/linux-2.6-xen-sparse/mm/page_alloc.c	Wed Feb 15 22:06:12 2006 +0000
    45.3 @@ -1215,18 +1215,21 @@ static void __get_page_state(struct page
    45.4  {
    45.5  	int cpu = 0;
    45.6  
    45.7 -	memset(ret, 0, sizeof(*ret));
    45.8 +	memset(ret, 0, nr * sizeof(unsigned long));
    45.9  	cpus_and(*cpumask, *cpumask, cpu_online_map);
   45.10  
   45.11  	cpu = first_cpu(*cpumask);
   45.12  	while (cpu < NR_CPUS) {
   45.13  		unsigned long *in, *out, off;
   45.14  
   45.15 +		if (!cpu_isset(cpu, *cpumask))
   45.16 +			continue;
   45.17 +
   45.18  		in = (unsigned long *)&per_cpu(page_states, cpu);
   45.19  
   45.20  		cpu = next_cpu(cpu, *cpumask);
   45.21  
   45.22 -		if (cpu < NR_CPUS)
   45.23 +		if (likely(cpu < NR_CPUS))
   45.24  			prefetch(&per_cpu(page_states, cpu));
   45.25  
   45.26  		out = (unsigned long *)ret;
   45.27 @@ -1888,8 +1891,7 @@ static void setup_pagelist_highmark(stru
   45.28   * not check if the processor is online before following the pageset pointer.
   45.29   * Other parts of the kernel may not check if the zone is available.
   45.30   */
   45.31 -static struct per_cpu_pageset
   45.32 -	boot_pageset[NR_CPUS];
   45.33 +static struct per_cpu_pageset boot_pageset[NR_CPUS];
   45.34  
   45.35  /*
   45.36   * Dynamically allocate memory for the
    46.1 --- a/linux-2.6-xen-sparse/net/core/dev.c	Wed Feb 15 15:20:32 2006 +0100
    46.2 +++ b/linux-2.6-xen-sparse/net/core/dev.c	Wed Feb 15 22:06:12 2006 +0000
    46.3 @@ -3287,7 +3287,7 @@ static int __init net_dev_init(void)
    46.4  	 *	Initialise the packet receive queues.
    46.5  	 */
    46.6  
    46.7 -	for (i = 0; i < NR_CPUS; i++) {
    46.8 +	for_each_cpu(i) {
    46.9  		struct softnet_data *queue;
   46.10  
   46.11  		queue = &per_cpu(softnet_data, i);
    47.1 --- a/patches/linux-2.6.16-rc2/i386-mach-io-check-nmi.patch	Wed Feb 15 15:20:32 2006 +0100
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,45 +0,0 @@
    47.4 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/kernel/traps.c ./arch/i386/kernel/traps.c
    47.5 ---- ../pristine-linux-2.6.16-rc1-git4/arch/i386/kernel/traps.c	2006-02-02 17:39:29.000000000 +0000
    47.6 -+++ ./arch/i386/kernel/traps.c	2006-02-02 17:43:01.000000000 +0000
    47.7 -@@ -564,18 +564,11 @@ static void mem_parity_error(unsigned ch
    47.8 - 
    47.9 - static void io_check_error(unsigned char reason, struct pt_regs * regs)
   47.10 - {
   47.11 --	unsigned long i;
   47.12 --
   47.13 - 	printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
   47.14 - 	show_registers(regs);
   47.15 - 
   47.16 - 	/* Re-enable the IOCK line, wait for a few seconds */
   47.17 --	reason = (reason & 0xf) | 8;
   47.18 --	outb(reason, 0x61);
   47.19 --	i = 2000;
   47.20 --	while (--i) udelay(1000);
   47.21 --	reason &= ~8;
   47.22 --	outb(reason, 0x61);
   47.23 -+	clear_io_check_error(reason);
   47.24 - }
   47.25 - 
   47.26 - static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
   47.27 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/mach-default/mach_traps.h ./include/asm-i386/mach-default/mach_traps.h
   47.28 ---- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/mach-default/mach_traps.h	2006-01-03 03:21:10.000000000 +0000
   47.29 -+++ ./include/asm-i386/mach-default/mach_traps.h	2006-02-02 17:41:55.000000000 +0000
   47.30 -@@ -15,6 +15,18 @@ static inline void clear_mem_error(unsig
   47.31 - 	outb(reason, 0x61);
   47.32 - }
   47.33 - 
   47.34 -+static inline void clear_io_check_error(unsigned char reason)
   47.35 -+{
   47.36 -+	unsigned long i;
   47.37 -+
   47.38 -+	reason = (reason & 0xf) | 8;
   47.39 -+	outb(reason, 0x61);
   47.40 -+	i = 2000;
   47.41 -+	while (--i) udelay(1000);
   47.42 -+	reason &= ~8;
   47.43 -+	outb(reason, 0x61);
   47.44 -+}
   47.45 -+
   47.46 - static inline unsigned char get_nmi_reason(void)
   47.47 - {
   47.48 - 	return inb(0x61);
    48.1 --- a/patches/linux-2.6.16-rc2/net-csum.patch	Wed Feb 15 15:20:32 2006 +0100
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,41 +0,0 @@
    48.4 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
    48.5 ---- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:39:51.000000000 +0000
    48.6 -+++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:44:18.000000000 +0000
    48.7 -@@ -129,10 +129,14 @@ tcp_manip_pkt(struct sk_buff **pskb,
    48.8 - 	if (hdrsize < sizeof(*hdr))
    48.9 - 		return 1;
   48.10 - 
   48.11 --	hdr->check = ip_nat_cheat_check(~oldip, newip,
   48.12 -+	if ((*pskb)->proto_csum_blank) {
   48.13 -+		hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
   48.14 -+	} else {
   48.15 -+		hdr->check = ip_nat_cheat_check(~oldip, newip,
   48.16 - 					ip_nat_cheat_check(oldport ^ 0xFFFF,
   48.17 - 							   newport,
   48.18 - 							   hdr->check));
   48.19 -+	}
   48.20 - 	return 1;
   48.21 - }
   48.22 -
   48.23 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
   48.24 ---- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:39:51.000000000 +0000
   48.25 -+++ ./net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:44:18.000000000 +0000
   48.26 -@@ -113,11 +113,16 @@ udp_manip_pkt(struct sk_buff **pskb,
   48.27 - 		newport = tuple->dst.u.udp.port;
   48.28 - 		portptr = &hdr->dest;
   48.29 - 	}
   48.30 --	if (hdr->check) /* 0 is a special case meaning no checksum */
   48.31 --		hdr->check = ip_nat_cheat_check(~oldip, newip,
   48.32 -+	if (hdr->check) { /* 0 is a special case meaning no checksum */
   48.33 -+		if ((*pskb)->proto_csum_blank) {
   48.34 -+			hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
   48.35 -+		} else {
   48.36 -+			hdr->check = ip_nat_cheat_check(~oldip, newip,
   48.37 - 					ip_nat_cheat_check(*portptr ^ 0xFFFF,
   48.38 - 							   newport,
   48.39 - 							   hdr->check));
   48.40 -+		}
   48.41 -+	}
   48.42 - 	*portptr = newport;
   48.43 - 	return 1;
   48.44 - }
    49.1 --- a/patches/linux-2.6.16-rc2/pmd-shared.patch	Wed Feb 15 15:20:32 2006 +0100
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,111 +0,0 @@
    49.4 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c ./arch/i386/mm/pageattr.c
    49.5 ---- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c	2006-02-02 17:39:29.000000000 +0000
    49.6 -+++ ./arch/i386/mm/pageattr.c	2006-02-02 17:45:14.000000000 +0000
    49.7 -@@ -78,7 +78,7 @@ static void set_pmd_pte(pte_t *kpte, uns
    49.8 - 	unsigned long flags;
    49.9 - 
   49.10 - 	set_pte_atomic(kpte, pte); 	/* change init_mm */
   49.11 --	if (PTRS_PER_PMD > 1)
   49.12 -+	if (HAVE_SHARED_KERNEL_PMD)
   49.13 - 		return;
   49.14 - 
   49.15 - 	spin_lock_irqsave(&pgd_lock, flags);
   49.16 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c ./arch/i386/mm/pgtable.c
   49.17 ---- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c	2006-01-03 03:21:10.000000000 +0000
   49.18 -+++ ./arch/i386/mm/pgtable.c	2006-02-02 17:45:14.000000000 +0000
   49.19 -@@ -215,9 +215,10 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
   49.20 - 		spin_lock_irqsave(&pgd_lock, flags);
   49.21 - 	}
   49.22 - 
   49.23 --	clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
   49.24 --			swapper_pg_dir + USER_PTRS_PER_PGD,
   49.25 --			KERNEL_PGD_PTRS);
   49.26 -+	if (PTRS_PER_PMD == 1 || HAVE_SHARED_KERNEL_PMD)
   49.27 -+		clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
   49.28 -+				swapper_pg_dir + USER_PTRS_PER_PGD,
   49.29 -+				KERNEL_PGD_PTRS);
   49.30 - 	if (PTRS_PER_PMD > 1)
   49.31 - 		return;
   49.32 - 
   49.33 -@@ -249,6 +250,30 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
   49.34 - 			goto out_oom;
   49.35 - 		set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
   49.36 - 	}
   49.37 -+
   49.38 -+	if (!HAVE_SHARED_KERNEL_PMD) {
   49.39 -+		unsigned long flags;
   49.40 -+
   49.41 -+		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   49.42 -+			pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
   49.43 -+			if (!pmd)
   49.44 -+				goto out_oom;
   49.45 -+			set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
   49.46 -+		}
   49.47 -+
   49.48 -+		spin_lock_irqsave(&pgd_lock, flags);
   49.49 -+		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   49.50 -+			unsigned long v = (unsigned long)i << PGDIR_SHIFT;
   49.51 -+			pgd_t *kpgd = pgd_offset_k(v);
   49.52 -+			pud_t *kpud = pud_offset(kpgd, v);
   49.53 -+			pmd_t *kpmd = pmd_offset(kpud, v);
   49.54 -+			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   49.55 -+			memcpy(pmd, kpmd, PAGE_SIZE);
   49.56 -+		}
   49.57 -+		pgd_list_add(pgd);
   49.58 -+		spin_unlock_irqrestore(&pgd_lock, flags);
   49.59 -+	}
   49.60 -+
   49.61 - 	return pgd;
   49.62 - 
   49.63 - out_oom:
   49.64 -@@ -263,9 +288,23 @@ void pgd_free(pgd_t *pgd)
   49.65 - 	int i;
   49.66 - 
   49.67 - 	/* in the PAE case user pgd entries are overwritten before usage */
   49.68 --	if (PTRS_PER_PMD > 1)
   49.69 --		for (i = 0; i < USER_PTRS_PER_PGD; ++i)
   49.70 --			kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
   49.71 -+	if (PTRS_PER_PMD > 1) {
   49.72 -+		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
   49.73 -+			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   49.74 -+			kmem_cache_free(pmd_cache, pmd);
   49.75 -+		}
   49.76 -+		if (!HAVE_SHARED_KERNEL_PMD) {
   49.77 -+			unsigned long flags;
   49.78 -+			spin_lock_irqsave(&pgd_lock, flags);
   49.79 -+			pgd_list_del(pgd);
   49.80 -+			spin_unlock_irqrestore(&pgd_lock, flags);
   49.81 -+			for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   49.82 -+				pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   49.83 -+				memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t));
   49.84 -+				kmem_cache_free(pmd_cache, pmd);
   49.85 -+			}
   49.86 -+		}
   49.87 -+	}
   49.88 - 	/* in the non-PAE case, free_pgtables() clears user pgd entries */
   49.89 - 	kmem_cache_free(pgd_cache, pgd);
   49.90 - }
   49.91 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h ./include/asm-i386/pgtable-2level-defs.h
   49.92 ---- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h	2006-01-03 03:21:10.000000000 +0000
   49.93 -+++ ./include/asm-i386/pgtable-2level-defs.h	2006-02-02 17:45:14.000000000 +0000
   49.94 -@@ -1,6 +1,8 @@
   49.95 - #ifndef _I386_PGTABLE_2LEVEL_DEFS_H
   49.96 - #define _I386_PGTABLE_2LEVEL_DEFS_H
   49.97 - 
   49.98 -+#define HAVE_SHARED_KERNEL_PMD 0
   49.99 -+
  49.100 - /*
  49.101 -  * traditional i386 two-level paging structure:
  49.102 -  */
  49.103 -diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h ./include/asm-i386/pgtable-3level-defs.h
  49.104 ---- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h	2006-01-03 03:21:10.000000000 +0000
  49.105 -+++ ./include/asm-i386/pgtable-3level-defs.h	2006-02-02 17:45:14.000000000 +0000
  49.106 -@@ -1,6 +1,8 @@
  49.107 - #ifndef _I386_PGTABLE_3LEVEL_DEFS_H
  49.108 - #define _I386_PGTABLE_3LEVEL_DEFS_H
  49.109 - 
  49.110 -+#define HAVE_SHARED_KERNEL_PMD 1
  49.111 -+
  49.112 - /*
  49.113 -  * PGDIR_SHIFT determines what a top-level page table entry can map
  49.114 -  */
    50.1 --- a/patches/linux-2.6.16-rc2/smp-alts.patch	Wed Feb 15 15:20:32 2006 +0100
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,593 +0,0 @@
    50.4 -diff -pruN ../pristine-linux-2.6.16-rc2/arch/i386/Kconfig ./arch/i386/Kconfig
    50.5 ---- ../pristine-linux-2.6.16-rc2/arch/i386/Kconfig	2006-02-03 16:11:47.000000000 +0000
    50.6 -+++ ./arch/i386/Kconfig	2006-02-03 18:20:37.000000000 +0000
    50.7 -@@ -202,6 +202,19 @@ config SMP
    50.8 - 
    50.9 - 	  If you don't know what to do here, say N.
   50.10 - 
   50.11 -+config SMP_ALTERNATIVES
   50.12 -+	bool "SMP alternatives support (EXPERIMENTAL)"
   50.13 -+	depends on SMP && EXPERIMENTAL
   50.14 -+	help
   50.15 -+	  Try to reduce the overhead of running an SMP kernel on a uniprocessor
   50.16 -+	  host slightly by replacing certain key instruction sequences
   50.17 -+	  according to whether we currently have more than one CPU available.
   50.18 -+	  This should provide a noticeable boost to performance when
   50.19 -+	  running SMP kernels on UP machines, and have negligible impact
   50.20 -+	  when running on an true SMP host.
   50.21 -+
   50.22 -+          If unsure, say N.
   50.23 -+	  
   50.24 - config NR_CPUS
   50.25 - 	int "Maximum number of CPUs (2-255)"
   50.26 - 	range 2 255
   50.27 -diff -pruN ../pristine-linux-2.6.16-rc2/arch/i386/kernel/Makefile ./arch/i386/kernel/Makefile
   50.28 ---- ../pristine-linux-2.6.16-rc2/arch/i386/kernel/Makefile	2006-02-03 16:11:47.000000000 +0000
   50.29 -+++ ./arch/i386/kernel/Makefile	2006-02-03 18:20:37.000000000 +0000
   50.30 -@@ -37,6 +37,7 @@ obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
   50.31 - obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
   50.32 - obj-$(CONFIG_VM86)		+= vm86.o
   50.33 - obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
   50.34 -+obj-$(CONFIG_SMP_ALTERNATIVES)  += smpalts.o
   50.35 - 
   50.36 - EXTRA_AFLAGS   := -traditional
   50.37 - 
   50.38 -diff -pruN ../pristine-linux-2.6.16-rc2/arch/i386/kernel/smpalts.c ./arch/i386/kernel/smpalts.c
   50.39 ---- ../pristine-linux-2.6.16-rc2/arch/i386/kernel/smpalts.c	1970-01-01 01:00:00.000000000 +0100
   50.40 -+++ ./arch/i386/kernel/smpalts.c	2006-02-03 18:20:37.000000000 +0000
   50.41 -@@ -0,0 +1,85 @@
   50.42 -+#include <linux/kernel.h>
   50.43 -+#include <asm/system.h>
   50.44 -+#include <asm/smp_alt.h>
   50.45 -+#include <asm/processor.h>
   50.46 -+#include <asm/string.h>
   50.47 -+
   50.48 -+struct smp_replacement_record {
   50.49 -+	unsigned char targ_size;
   50.50 -+	unsigned char smp1_size;
   50.51 -+	unsigned char smp2_size;
   50.52 -+	unsigned char up_size;
   50.53 -+	unsigned char feature;
   50.54 -+	unsigned char data[0];
   50.55 -+};
   50.56 -+
   50.57 -+struct smp_alternative_record {
   50.58 -+	void *targ_start;
   50.59 -+	struct smp_replacement_record *repl;
   50.60 -+};
   50.61 -+
   50.62 -+extern struct smp_alternative_record __start_smp_alternatives_table,
   50.63 -+  __stop_smp_alternatives_table;
   50.64 -+extern unsigned long __init_begin, __init_end;
   50.65 -+
   50.66 -+void prepare_for_smp(void)
   50.67 -+{
   50.68 -+	struct smp_alternative_record *r;
   50.69 -+	printk(KERN_INFO "Enabling SMP...\n");
   50.70 -+	for (r = &__start_smp_alternatives_table;
   50.71 -+	     r != &__stop_smp_alternatives_table;
   50.72 -+	     r++) {
   50.73 -+		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
   50.74 -+		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
   50.75 -+		BUG_ON(r->repl->targ_size < r->repl->up_size);
   50.76 -+               if (system_state == SYSTEM_RUNNING &&
   50.77 -+                   r->targ_start >= (void *)&__init_begin &&
   50.78 -+                   r->targ_start < (void *)&__init_end)
   50.79 -+                       continue;
   50.80 -+		if (r->repl->feature != (unsigned char)-1 &&
   50.81 -+		    boot_cpu_has(r->repl->feature)) {
   50.82 -+			memcpy(r->targ_start,
   50.83 -+			       r->repl->data + r->repl->smp1_size,
   50.84 -+			       r->repl->smp2_size);
   50.85 -+			memset(r->targ_start + r->repl->smp2_size,
   50.86 -+			       0x90,
   50.87 -+			       r->repl->targ_size - r->repl->smp2_size);
   50.88 -+		} else {
   50.89 -+			memcpy(r->targ_start,
   50.90 -+			       r->repl->data,
   50.91 -+			       r->repl->smp1_size);
   50.92 -+			memset(r->targ_start + r->repl->smp1_size,
   50.93 -+			       0x90,
   50.94 -+			       r->repl->targ_size - r->repl->smp1_size);
   50.95 -+		}
   50.96 -+	}
   50.97 -+	/* Paranoia */
   50.98 -+	asm volatile ("jmp 1f\n1:");
   50.99 -+	mb();
  50.100 -+}
  50.101 -+
  50.102 -+void unprepare_for_smp(void)
  50.103 -+{
  50.104 -+	struct smp_alternative_record *r;
  50.105 -+	printk(KERN_INFO "Disabling SMP...\n");
  50.106 -+	for (r = &__start_smp_alternatives_table;
  50.107 -+	     r != &__stop_smp_alternatives_table;
  50.108 -+	     r++) {
  50.109 -+		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
  50.110 -+		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
  50.111 -+		BUG_ON(r->repl->targ_size < r->repl->up_size);
  50.112 -+               if (system_state == SYSTEM_RUNNING &&
  50.113 -+                   r->targ_start >= (void *)&__init_begin &&
  50.114 -+                   r->targ_start < (void *)&__init_end)
  50.115 -+                       continue;
  50.116 -+		memcpy(r->targ_start,
  50.117 -+		       r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
  50.118 -+		       r->repl->up_size);
  50.119 -+		memset(r->targ_start + r->repl->up_size,
  50.120 -+		       0x90,
  50.121 -+		       r->repl->targ_size - r->repl->up_size);
  50.122 -+	}
  50.123 -+	/* Paranoia */
  50.124 -+	asm volatile ("jmp 1f\n1:");
  50.125 -+	mb();
  50.126 -+}
  50.127 -diff -pruN ../pristine-linux-2.6.16-rc2/arch/i386/kernel/smpboot.c ./arch/i386/kernel/smpboot.c
  50.128 ---- ../pristine-linux-2.6.16-rc2/arch/i386/kernel/smpboot.c	2006-02-03 16:11:47.000000000 +0000
  50.129 -+++ ./arch/i386/kernel/smpboot.c	2006-02-03 18:20:37.000000000 +0000
  50.130 -@@ -1218,6 +1218,11 @@ static void __init smp_boot_cpus(unsigne
  50.131 - 		if (max_cpus <= cpucount+1)
  50.132 - 			continue;
  50.133 - 
  50.134 -+#ifdef CONFIG_SMP_ALTERNATIVES
  50.135 -+		if (kicked == 1)
  50.136 -+			prepare_for_smp();
  50.137 -+#endif
  50.138 -+
  50.139 - 		if (((cpu = alloc_cpu_id()) <= 0) || do_boot_cpu(apicid, cpu))
  50.140 - 			printk("CPU #%d not responding - cannot use it.\n",
  50.141 - 								apicid);
  50.142 -@@ -1396,6 +1401,11 @@ int __devinit __cpu_up(unsigned int cpu)
  50.143 - 		return -EIO;
  50.144 - 	}
  50.145 - 
  50.146 -+#ifdef CONFIG_SMP_ALTERNATIVES
  50.147 -+	if (num_online_cpus() == 1)
  50.148 -+		prepare_for_smp();
  50.149 -+#endif
  50.150 -+
  50.151 - 	local_irq_enable();
  50.152 - 	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
  50.153 - 	/* Unleash the CPU! */
  50.154 -diff -pruN ../pristine-linux-2.6.16-rc2/arch/i386/kernel/vmlinux.lds.S ./arch/i386/kernel/vmlinux.lds.S
  50.155 ---- ../pristine-linux-2.6.16-rc2/arch/i386/kernel/vmlinux.lds.S	2006-01-03 03:21:10.000000000 +0000
  50.156 -+++ ./arch/i386/kernel/vmlinux.lds.S	2006-02-03 18:20:37.000000000 +0000
  50.157 -@@ -34,6 +34,13 @@ SECTIONS
  50.158 -   __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
  50.159 -   __stop___ex_table = .;
  50.160 - 
  50.161 -+  . = ALIGN(16);
  50.162 -+  __start_smp_alternatives_table = .;
  50.163 -+  __smp_alternatives : { *(__smp_alternatives) }
  50.164 -+  __stop_smp_alternatives_table = .;
  50.165 -+
  50.166 -+  __smp_replacements : { *(__smp_replacements) }
  50.167 -+
  50.168 -   RODATA
  50.169 - 
  50.170 -   /* writeable */
  50.171 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/atomic.h ./include/asm-i386/atomic.h
  50.172 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/atomic.h	2006-02-03 16:11:50.000000000 +0000
  50.173 -+++ ./include/asm-i386/atomic.h	2006-02-03 18:20:37.000000000 +0000
  50.174 -@@ -4,18 +4,13 @@
  50.175 - #include <linux/config.h>
  50.176 - #include <linux/compiler.h>
  50.177 - #include <asm/processor.h>
  50.178 -+#include <asm/smp_alt.h>
  50.179 - 
  50.180 - /*
  50.181 -  * Atomic operations that C can't guarantee us.  Useful for
  50.182 -  * resource counting etc..
  50.183 -  */
  50.184 - 
  50.185 --#ifdef CONFIG_SMP
  50.186 --#define LOCK "lock ; "
  50.187 --#else
  50.188 --#define LOCK ""
  50.189 --#endif
  50.190 --
  50.191 - /*
  50.192 -  * Make sure gcc doesn't try to be clever and move things around
  50.193 -  * on us. We need to use _exactly_ the address the user gave us,
  50.194 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/bitops.h ./include/asm-i386/bitops.h
  50.195 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/bitops.h	2006-02-03 16:11:50.000000000 +0000
  50.196 -+++ ./include/asm-i386/bitops.h	2006-02-03 18:20:37.000000000 +0000
  50.197 -@@ -7,6 +7,7 @@
  50.198 - 
  50.199 - #include <linux/config.h>
  50.200 - #include <linux/compiler.h>
  50.201 -+#include <asm/smp_alt.h>
  50.202 - 
  50.203 - /*
  50.204 -  * These have to be done with inline assembly: that way the bit-setting
  50.205 -@@ -16,12 +17,6 @@
  50.206 -  * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
  50.207 -  */
  50.208 - 
  50.209 --#ifdef CONFIG_SMP
  50.210 --#define LOCK_PREFIX "lock ; "
  50.211 --#else
  50.212 --#define LOCK_PREFIX ""
  50.213 --#endif
  50.214 --
  50.215 - #define ADDR (*(volatile long *) addr)
  50.216 - 
  50.217 - /**
  50.218 -@@ -41,7 +36,7 @@
  50.219 -  */
  50.220 - static inline void set_bit(int nr, volatile unsigned long * addr)
  50.221 - {
  50.222 --	__asm__ __volatile__( LOCK_PREFIX
  50.223 -+	__asm__ __volatile__( LOCK
  50.224 - 		"btsl %1,%0"
  50.225 - 		:"+m" (ADDR)
  50.226 - 		:"Ir" (nr));
  50.227 -@@ -76,7 +71,7 @@ static inline void __set_bit(int nr, vol
  50.228 -  */
  50.229 - static inline void clear_bit(int nr, volatile unsigned long * addr)
  50.230 - {
  50.231 --	__asm__ __volatile__( LOCK_PREFIX
  50.232 -+	__asm__ __volatile__( LOCK
  50.233 - 		"btrl %1,%0"
  50.234 - 		:"+m" (ADDR)
  50.235 - 		:"Ir" (nr));
  50.236 -@@ -121,7 +116,7 @@ static inline void __change_bit(int nr, 
  50.237 -  */
  50.238 - static inline void change_bit(int nr, volatile unsigned long * addr)
  50.239 - {
  50.240 --	__asm__ __volatile__( LOCK_PREFIX
  50.241 -+	__asm__ __volatile__( LOCK
  50.242 - 		"btcl %1,%0"
  50.243 - 		:"+m" (ADDR)
  50.244 - 		:"Ir" (nr));
  50.245 -@@ -140,7 +135,7 @@ static inline int test_and_set_bit(int n
  50.246 - {
  50.247 - 	int oldbit;
  50.248 - 
  50.249 --	__asm__ __volatile__( LOCK_PREFIX
  50.250 -+	__asm__ __volatile__( LOCK
  50.251 - 		"btsl %2,%1\n\tsbbl %0,%0"
  50.252 - 		:"=r" (oldbit),"+m" (ADDR)
  50.253 - 		:"Ir" (nr) : "memory");
  50.254 -@@ -180,7 +175,7 @@ static inline int test_and_clear_bit(int
  50.255 - {
  50.256 - 	int oldbit;
  50.257 - 
  50.258 --	__asm__ __volatile__( LOCK_PREFIX
  50.259 -+	__asm__ __volatile__( LOCK
  50.260 - 		"btrl %2,%1\n\tsbbl %0,%0"
  50.261 - 		:"=r" (oldbit),"+m" (ADDR)
  50.262 - 		:"Ir" (nr) : "memory");
  50.263 -@@ -231,7 +226,7 @@ static inline int test_and_change_bit(in
  50.264 - {
  50.265 - 	int oldbit;
  50.266 - 
  50.267 --	__asm__ __volatile__( LOCK_PREFIX
  50.268 -+	__asm__ __volatile__( LOCK
  50.269 - 		"btcl %2,%1\n\tsbbl %0,%0"
  50.270 - 		:"=r" (oldbit),"+m" (ADDR)
  50.271 - 		:"Ir" (nr) : "memory");
  50.272 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/futex.h ./include/asm-i386/futex.h
  50.273 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/futex.h	2006-02-03 16:11:50.000000000 +0000
  50.274 -+++ ./include/asm-i386/futex.h	2006-02-03 18:20:37.000000000 +0000
  50.275 -@@ -28,7 +28,7 @@
  50.276 - "1:	movl	%2, %0\n\
  50.277 - 	movl	%0, %3\n"					\
  50.278 - 	insn "\n"						\
  50.279 --"2:	" LOCK_PREFIX "cmpxchgl %3, %2\n\
  50.280 -+"2:	" LOCK "cmpxchgl %3, %2\n\
  50.281 - 	jnz	1b\n\
  50.282 - 3:	.section .fixup,\"ax\"\n\
  50.283 - 4:	mov	%5, %1\n\
  50.284 -@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, 
  50.285 - #endif
  50.286 - 		switch (op) {
  50.287 - 		case FUTEX_OP_ADD:
  50.288 --			__futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
  50.289 -+			__futex_atomic_op1(LOCK "xaddl %0, %2", ret,
  50.290 - 					   oldval, uaddr, oparg);
  50.291 - 			break;
  50.292 - 		case FUTEX_OP_OR:
  50.293 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/rwsem.h ./include/asm-i386/rwsem.h
  50.294 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/rwsem.h	2006-01-03 03:21:10.000000000 +0000
  50.295 -+++ ./include/asm-i386/rwsem.h	2006-02-03 18:20:37.000000000 +0000
  50.296 -@@ -40,6 +40,7 @@
  50.297 - 
  50.298 - #include <linux/list.h>
  50.299 - #include <linux/spinlock.h>
  50.300 -+#include <asm/smp_alt.h>
  50.301 - 
  50.302 - struct rwsem_waiter;
  50.303 - 
  50.304 -@@ -99,7 +100,7 @@ static inline void __down_read(struct rw
  50.305 - {
  50.306 - 	__asm__ __volatile__(
  50.307 - 		"# beginning down_read\n\t"
  50.308 --LOCK_PREFIX	"  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
  50.309 -+LOCK	        "  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
  50.310 - 		"  js        2f\n\t" /* jump if we weren't granted the lock */
  50.311 - 		"1:\n\t"
  50.312 - 		LOCK_SECTION_START("")
  50.313 -@@ -130,7 +131,7 @@ static inline int __down_read_trylock(st
  50.314 - 		"  movl	     %1,%2\n\t"
  50.315 - 		"  addl      %3,%2\n\t"
  50.316 - 		"  jle	     2f\n\t"
  50.317 --LOCK_PREFIX	"  cmpxchgl  %2,%0\n\t"
  50.318 -+LOCK	        "  cmpxchgl  %2,%0\n\t"
  50.319 - 		"  jnz	     1b\n\t"
  50.320 - 		"2:\n\t"
  50.321 - 		"# ending __down_read_trylock\n\t"
  50.322 -@@ -150,7 +151,7 @@ static inline void __down_write(struct r
  50.323 - 	tmp = RWSEM_ACTIVE_WRITE_BIAS;
  50.324 - 	__asm__ __volatile__(
  50.325 - 		"# beginning down_write\n\t"
  50.326 --LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
  50.327 -+LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
  50.328 - 		"  testl     %%edx,%%edx\n\t" /* was the count 0 before? */
  50.329 - 		"  jnz       2f\n\t" /* jump if we weren't granted the lock */
  50.330 - 		"1:\n\t"
  50.331 -@@ -188,7 +189,7 @@ static inline void __up_read(struct rw_s
  50.332 - 	__s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
  50.333 - 	__asm__ __volatile__(
  50.334 - 		"# beginning __up_read\n\t"
  50.335 --LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
  50.336 -+LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
  50.337 - 		"  js        2f\n\t" /* jump if the lock is being waited upon */
  50.338 - 		"1:\n\t"
  50.339 - 		LOCK_SECTION_START("")
  50.340 -@@ -214,7 +215,7 @@ static inline void __up_write(struct rw_
  50.341 - 	__asm__ __volatile__(
  50.342 - 		"# beginning __up_write\n\t"
  50.343 - 		"  movl      %2,%%edx\n\t"
  50.344 --LOCK_PREFIX	"  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
  50.345 -+LOCK	        "  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
  50.346 - 		"  jnz       2f\n\t" /* jump if the lock is being waited upon */
  50.347 - 		"1:\n\t"
  50.348 - 		LOCK_SECTION_START("")
  50.349 -@@ -239,7 +240,7 @@ static inline void __downgrade_write(str
  50.350 - {
  50.351 - 	__asm__ __volatile__(
  50.352 - 		"# beginning __downgrade_write\n\t"
  50.353 --LOCK_PREFIX	"  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
  50.354 -+LOCK	        "  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
  50.355 - 		"  js        2f\n\t" /* jump if the lock is being waited upon */
  50.356 - 		"1:\n\t"
  50.357 - 		LOCK_SECTION_START("")
  50.358 -@@ -263,7 +264,7 @@ LOCK_PREFIX	"  addl      %2,(%%eax)\n\t"
  50.359 - static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
  50.360 - {
  50.361 - 	__asm__ __volatile__(
  50.362 --LOCK_PREFIX	"addl %1,%0"
  50.363 -+LOCK	          "addl %1,%0"
  50.364 - 		: "=m"(sem->count)
  50.365 - 		: "ir"(delta), "m"(sem->count));
  50.366 - }
  50.367 -@@ -276,7 +277,7 @@ static inline int rwsem_atomic_update(in
  50.368 - 	int tmp = delta;
  50.369 - 
  50.370 - 	__asm__ __volatile__(
  50.371 --LOCK_PREFIX	"xadd %0,(%2)"
  50.372 -+LOCK  	          "xadd %0,(%2)"
  50.373 - 		: "+r"(tmp), "=m"(sem->count)
  50.374 - 		: "r"(sem), "m"(sem->count)
  50.375 - 		: "memory");
  50.376 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/smp_alt.h ./include/asm-i386/smp_alt.h
  50.377 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/smp_alt.h	1970-01-01 01:00:00.000000000 +0100
  50.378 -+++ ./include/asm-i386/smp_alt.h	2006-02-03 18:20:37.000000000 +0000
  50.379 -@@ -0,0 +1,32 @@
  50.380 -+#ifndef __ASM_SMP_ALT_H__
  50.381 -+#define __ASM_SMP_ALT_H__
  50.382 -+
  50.383 -+#include <linux/config.h>
  50.384 -+
  50.385 -+#ifdef CONFIG_SMP
  50.386 -+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
  50.387 -+#define LOCK \
  50.388 -+        "6677: nop\n" \
  50.389 -+	".section __smp_alternatives,\"a\"\n" \
  50.390 -+	".long 6677b\n" \
  50.391 -+	".long 6678f\n" \
  50.392 -+	".previous\n" \
  50.393 -+	".section __smp_replacements,\"a\"\n" \
  50.394 -+	"6678: .byte 1\n" \
  50.395 -+	".byte 1\n" \
  50.396 -+	".byte 0\n" \
  50.397 -+        ".byte 1\n" \
  50.398 -+	".byte -1\n" \
  50.399 -+	"lock\n" \
  50.400 -+	"nop\n" \
  50.401 -+	".previous\n"
  50.402 -+void prepare_for_smp(void);
  50.403 -+void unprepare_for_smp(void);
  50.404 -+#else
  50.405 -+#define LOCK "lock ; "
  50.406 -+#endif
  50.407 -+#else
  50.408 -+#define LOCK ""
  50.409 -+#endif
  50.410 -+
  50.411 -+#endif /* __ASM_SMP_ALT_H__ */
  50.412 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/spinlock.h ./include/asm-i386/spinlock.h
  50.413 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/spinlock.h	2006-01-03 03:21:10.000000000 +0000
  50.414 -+++ ./include/asm-i386/spinlock.h	2006-02-03 18:20:37.000000000 +0000
  50.415 -@@ -6,6 +6,7 @@
  50.416 - #include <asm/page.h>
  50.417 - #include <linux/config.h>
  50.418 - #include <linux/compiler.h>
  50.419 -+#include <asm/smp_alt.h>
  50.420 - 
  50.421 - /*
  50.422 -  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  50.423 -@@ -23,7 +24,8 @@
  50.424 - 
  50.425 - #define __raw_spin_lock_string \
  50.426 - 	"\n1:\t" \
  50.427 --	"lock ; decb %0\n\t" \
  50.428 -+	LOCK \
  50.429 -+	"decb %0\n\t" \
  50.430 - 	"jns 3f\n" \
  50.431 - 	"2:\t" \
  50.432 - 	"rep;nop\n\t" \
  50.433 -@@ -34,7 +36,8 @@
  50.434 - 
  50.435 - #define __raw_spin_lock_string_flags \
  50.436 - 	"\n1:\t" \
  50.437 --	"lock ; decb %0\n\t" \
  50.438 -+	LOCK \
  50.439 -+	"decb %0\n\t" \
  50.440 - 	"jns 4f\n\t" \
  50.441 - 	"2:\t" \
  50.442 - 	"testl $0x200, %1\n\t" \
  50.443 -@@ -65,10 +68,34 @@ static inline void __raw_spin_lock_flags
  50.444 - static inline int __raw_spin_trylock(raw_spinlock_t *lock)
  50.445 - {
  50.446 - 	char oldval;
  50.447 -+#ifdef CONFIG_SMP_ALTERNATIVES
  50.448 - 	__asm__ __volatile__(
  50.449 --		"xchgb %b0,%1"
  50.450 -+		"1:movb %1,%b0\n"
  50.451 -+		"movb $0,%1\n"
  50.452 -+		"2:"
  50.453 -+		".section __smp_alternatives,\"a\"\n"
  50.454 -+		".long 1b\n"
  50.455 -+		".long 3f\n"
  50.456 -+		".previous\n"
  50.457 -+		".section __smp_replacements,\"a\"\n"
  50.458 -+		"3: .byte 2b - 1b\n"
  50.459 -+		".byte 5f-4f\n"
  50.460 -+		".byte 0\n"
  50.461 -+		".byte 6f-5f\n"
  50.462 -+		".byte -1\n"
  50.463 -+		"4: xchgb %b0,%1\n"
  50.464 -+		"5: movb %1,%b0\n"
  50.465 -+		"movb $0,%1\n"
  50.466 -+		"6:\n"
  50.467 -+		".previous\n"
  50.468 - 		:"=q" (oldval), "=m" (lock->slock)
  50.469 - 		:"0" (0) : "memory");
  50.470 -+#else
  50.471 -+	__asm__ __volatile__(
  50.472 -+		"xchgb %b0,%1\n"
  50.473 -+		:"=q" (oldval), "=m" (lock->slock)
  50.474 -+		:"0" (0) : "memory");
  50.475 -+#endif
  50.476 - 	return oldval > 0;
  50.477 - }
  50.478 - 
  50.479 -@@ -178,12 +205,12 @@ static inline int __raw_write_trylock(ra
  50.480 - 
  50.481 - static inline void __raw_read_unlock(raw_rwlock_t *rw)
  50.482 - {
  50.483 --	asm volatile("lock ; incl %0" :"=m" (rw->lock) : : "memory");
  50.484 -+	asm volatile(LOCK "incl %0" :"=m" (rw->lock) : : "memory");
  50.485 - }
  50.486 - 
  50.487 - static inline void __raw_write_unlock(raw_rwlock_t *rw)
  50.488 - {
  50.489 --	asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ", %0"
  50.490 -+	asm volatile(LOCK "addl $" RW_LOCK_BIAS_STR ", %0"
  50.491 - 				 : "=m" (rw->lock) : : "memory");
  50.492 - }
  50.493 - 
  50.494 -diff -pruN ../pristine-linux-2.6.16-rc2/include/asm-i386/system.h ./include/asm-i386/system.h
  50.495 ---- ../pristine-linux-2.6.16-rc2/include/asm-i386/system.h	2006-02-03 16:11:50.000000000 +0000
  50.496 -+++ ./include/asm-i386/system.h	2006-02-03 18:20:37.000000000 +0000
  50.497 -@@ -5,7 +5,7 @@
  50.498 - #include <linux/kernel.h>
  50.499 - #include <asm/segment.h>
  50.500 - #include <asm/cpufeature.h>
  50.501 --#include <linux/bitops.h> /* for LOCK_PREFIX */
  50.502 -+#include <asm/smp_alt.h>
  50.503 - 
  50.504 - #ifdef __KERNEL__
  50.505 - 
  50.506 -@@ -271,19 +271,19 @@ static inline unsigned long __cmpxchg(vo
  50.507 - 	unsigned long prev;
  50.508 - 	switch (size) {
  50.509 - 	case 1:
  50.510 --		__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
  50.511 -+		__asm__ __volatile__(LOCK "cmpxchgb %b1,%2"
  50.512 - 				     : "=a"(prev)
  50.513 - 				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
  50.514 - 				     : "memory");
  50.515 - 		return prev;
  50.516 - 	case 2:
  50.517 --		__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
  50.518 -+		__asm__ __volatile__(LOCK "cmpxchgw %w1,%2"
  50.519 - 				     : "=a"(prev)
  50.520 - 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
  50.521 - 				     : "memory");
  50.522 - 		return prev;
  50.523 - 	case 4:
  50.524 --		__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
  50.525 -+		__asm__ __volatile__(LOCK "cmpxchgl %1,%2"
  50.526 - 				     : "=a"(prev)
  50.527 - 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
  50.528 - 				     : "memory");
  50.529 -@@ -336,7 +336,7 @@ static inline unsigned long long __cmpxc
  50.530 - 				      unsigned long long new)
  50.531 - {
  50.532 - 	unsigned long long prev;
  50.533 --	__asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
  50.534 -+	__asm__ __volatile__(LOCK "cmpxchg8b %3"
  50.535 - 			     : "=A"(prev)
  50.536 - 			     : "b"((unsigned long)new),
  50.537 - 			       "c"((unsigned long)(new >> 32)),
  50.538 -@@ -503,11 +503,55 @@ struct alt_instr { 
  50.539 - #endif
  50.540 - 
  50.541 - #ifdef CONFIG_SMP
  50.542 --#define smp_mb()	mb()
  50.543 --#define smp_rmb()	rmb()
  50.544 - #define smp_wmb()	wmb()
  50.545 --#define smp_read_barrier_depends()	read_barrier_depends()
  50.546 -+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
  50.547 -+#define smp_alt_mb(instr)                                           \
  50.548 -+__asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
  50.549 -+		     ".section __smp_alternatives,\"a\"\n"          \
  50.550 -+		     ".long 6667b\n"                                \
  50.551 -+                     ".long 6673f\n"                                \
  50.552 -+		     ".previous\n"                                  \
  50.553 -+		     ".section __smp_replacements,\"a\"\n"          \
  50.554 -+		     "6673:.byte 6668b-6667b\n"                     \
  50.555 -+		     ".byte 6670f-6669f\n"                          \
  50.556 -+		     ".byte 6671f-6670f\n"                          \
  50.557 -+                     ".byte 0\n"                                    \
  50.558 -+		     ".byte %c0\n"                                  \
  50.559 -+		     "6669:lock;addl $0,0(%%esp)\n"                 \
  50.560 -+		     "6670:" instr "\n"                             \
  50.561 -+		     "6671:\n"                                      \
  50.562 -+		     ".previous\n"                                  \
  50.563 -+		     :                                              \
  50.564 -+		     : "i" (X86_FEATURE_XMM2)                       \
  50.565 -+		     : "memory")
  50.566 -+#define smp_rmb() smp_alt_mb("lfence")
  50.567 -+#define smp_mb()  smp_alt_mb("mfence")
  50.568 -+#define set_mb(var, value) do {                                     \
  50.569 -+unsigned long __set_mb_temp;                                        \
  50.570 -+__asm__ __volatile__("6667:movl %1, %0\n6668:\n"                    \
  50.571 -+		     ".section __smp_alternatives,\"a\"\n"          \
  50.572 -+		     ".long 6667b\n"                                \
  50.573 -+		     ".long 6673f\n"                                \
  50.574 -+		     ".previous\n"                                  \
  50.575 -+		     ".section __smp_replacements,\"a\"\n"          \
  50.576 -+		     "6673: .byte 6668b-6667b\n"                    \
  50.577 -+		     ".byte 6670f-6669f\n"                          \
  50.578 -+		     ".byte 0\n"                                    \
  50.579 -+		     ".byte 6671f-6670f\n"                          \
  50.580 -+		     ".byte -1\n"                                   \
  50.581 -+		     "6669: xchg %1, %0\n"                          \
  50.582 -+		     "6670:movl %1, %0\n"                           \
  50.583 -+		     "6671:\n"                                      \
  50.584 -+		     ".previous\n"                                  \
  50.585 -+		     : "=m" (var), "=r" (__set_mb_temp)             \
  50.586 -+		     : "1" (value)                                  \
  50.587 -+		     : "memory"); } while (0)
  50.588 -+#else
  50.589 -+#define smp_rmb()	rmb()
  50.590 -+#define smp_mb()	mb()
  50.591 - #define set_mb(var, value) do { xchg(&var, value); } while (0)
  50.592 -+#endif
  50.593 -+#define smp_read_barrier_depends()	read_barrier_depends()
  50.594 - #else
  50.595 - #define smp_mb()	barrier()
  50.596 - #define smp_rmb()	barrier()
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/patches/linux-2.6.16-rc3/i386-mach-io-check-nmi.patch	Wed Feb 15 22:06:12 2006 +0000
    51.3 @@ -0,0 +1,45 @@
    51.4 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/traps.c ./arch/i386/kernel/traps.c
    51.5 +--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/traps.c	2006-02-15 20:38:51.000000000 +0000
    51.6 ++++ ./arch/i386/kernel/traps.c	2006-02-15 20:40:43.000000000 +0000
    51.7 +@@ -567,18 +567,11 @@ static void mem_parity_error(unsigned ch
    51.8 + 
    51.9 + static void io_check_error(unsigned char reason, struct pt_regs * regs)
   51.10 + {
   51.11 +-	unsigned long i;
   51.12 +-
   51.13 + 	printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
   51.14 + 	show_registers(regs);
   51.15 + 
   51.16 + 	/* Re-enable the IOCK line, wait for a few seconds */
   51.17 +-	reason = (reason & 0xf) | 8;
   51.18 +-	outb(reason, 0x61);
   51.19 +-	i = 2000;
   51.20 +-	while (--i) udelay(1000);
   51.21 +-	reason &= ~8;
   51.22 +-	outb(reason, 0x61);
   51.23 ++	clear_io_check_error(reason);
   51.24 + }
   51.25 + 
   51.26 + static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
   51.27 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/mach-default/mach_traps.h ./include/asm-i386/mach-default/mach_traps.h
   51.28 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/mach-default/mach_traps.h	2006-01-03 03:21:10.000000000 +0000
   51.29 ++++ ./include/asm-i386/mach-default/mach_traps.h	2006-02-15 20:40:43.000000000 +0000
   51.30 +@@ -15,6 +15,18 @@ static inline void clear_mem_error(unsig
   51.31 + 	outb(reason, 0x61);
   51.32 + }
   51.33 + 
   51.34 ++static inline void clear_io_check_error(unsigned char reason)
   51.35 ++{
   51.36 ++	unsigned long i;
   51.37 ++
   51.38 ++	reason = (reason & 0xf) | 8;
   51.39 ++	outb(reason, 0x61);
   51.40 ++	i = 2000;
   51.41 ++	while (--i) udelay(1000);
   51.42 ++	reason &= ~8;
   51.43 ++	outb(reason, 0x61);
   51.44 ++}
   51.45 ++
   51.46 + static inline unsigned char get_nmi_reason(void)
   51.47 + {
   51.48 + 	return inb(0x61);
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/patches/linux-2.6.16-rc3/net-csum.patch	Wed Feb 15 22:06:12 2006 +0000
    52.3 @@ -0,0 +1,41 @@
    52.4 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
    52.5 +--- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:39:51.000000000 +0000
    52.6 ++++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c	2006-02-02 17:44:18.000000000 +0000
    52.7 +@@ -129,10 +129,14 @@ tcp_manip_pkt(struct sk_buff **pskb,
    52.8 + 	if (hdrsize < sizeof(*hdr))
    52.9 + 		return 1;
   52.10 + 
   52.11 +-	hdr->check = ip_nat_cheat_check(~oldip, newip,
   52.12 ++	if ((*pskb)->proto_csum_blank) {
   52.13 ++		hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
   52.14 ++	} else {
   52.15 ++		hdr->check = ip_nat_cheat_check(~oldip, newip,
   52.16 + 					ip_nat_cheat_check(oldport ^ 0xFFFF,
   52.17 + 							   newport,
   52.18 + 							   hdr->check));
   52.19 ++	}
   52.20 + 	return 1;
   52.21 + }
   52.22 +
   52.23 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
   52.24 +--- ../pristine-linux-2.6.16-rc1-git4/net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:39:51.000000000 +0000
   52.25 ++++ ./net/ipv4/netfilter/ip_nat_proto_udp.c	2006-02-02 17:44:18.000000000 +0000
   52.26 +@@ -113,11 +113,16 @@ udp_manip_pkt(struct sk_buff **pskb,
   52.27 + 		newport = tuple->dst.u.udp.port;
   52.28 + 		portptr = &hdr->dest;
   52.29 + 	}
   52.30 +-	if (hdr->check) /* 0 is a special case meaning no checksum */
   52.31 +-		hdr->check = ip_nat_cheat_check(~oldip, newip,
   52.32 ++	if (hdr->check) { /* 0 is a special case meaning no checksum */
   52.33 ++		if ((*pskb)->proto_csum_blank) {
   52.34 ++			hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
   52.35 ++		} else {
   52.36 ++			hdr->check = ip_nat_cheat_check(~oldip, newip,
   52.37 + 					ip_nat_cheat_check(*portptr ^ 0xFFFF,
   52.38 + 							   newport,
   52.39 + 							   hdr->check));
   52.40 ++		}
   52.41 ++	}
   52.42 + 	*portptr = newport;
   52.43 + 	return 1;
   52.44 + }
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/patches/linux-2.6.16-rc3/pmd-shared.patch	Wed Feb 15 22:06:12 2006 +0000
    53.3 @@ -0,0 +1,111 @@
    53.4 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c ./arch/i386/mm/pageattr.c
    53.5 +--- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pageattr.c	2006-02-02 17:39:29.000000000 +0000
    53.6 ++++ ./arch/i386/mm/pageattr.c	2006-02-02 17:45:14.000000000 +0000
    53.7 +@@ -78,7 +78,7 @@ static void set_pmd_pte(pte_t *kpte, uns
    53.8 + 	unsigned long flags;
    53.9 + 
   53.10 + 	set_pte_atomic(kpte, pte); 	/* change init_mm */
   53.11 +-	if (PTRS_PER_PMD > 1)
   53.12 ++	if (HAVE_SHARED_KERNEL_PMD)
   53.13 + 		return;
   53.14 + 
   53.15 + 	spin_lock_irqsave(&pgd_lock, flags);
   53.16 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c ./arch/i386/mm/pgtable.c
   53.17 +--- ../pristine-linux-2.6.16-rc1-git4/arch/i386/mm/pgtable.c	2006-01-03 03:21:10.000000000 +0000
   53.18 ++++ ./arch/i386/mm/pgtable.c	2006-02-02 17:45:14.000000000 +0000
   53.19 +@@ -215,9 +215,10 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
   53.20 + 		spin_lock_irqsave(&pgd_lock, flags);
   53.21 + 	}
   53.22 + 
   53.23 +-	clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
   53.24 +-			swapper_pg_dir + USER_PTRS_PER_PGD,
   53.25 +-			KERNEL_PGD_PTRS);
   53.26 ++	if (PTRS_PER_PMD == 1 || HAVE_SHARED_KERNEL_PMD)
   53.27 ++		clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
   53.28 ++				swapper_pg_dir + USER_PTRS_PER_PGD,
   53.29 ++				KERNEL_PGD_PTRS);
   53.30 + 	if (PTRS_PER_PMD > 1)
   53.31 + 		return;
   53.32 + 
   53.33 +@@ -249,6 +250,30 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
   53.34 + 			goto out_oom;
   53.35 + 		set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
   53.36 + 	}
   53.37 ++
   53.38 ++	if (!HAVE_SHARED_KERNEL_PMD) {
   53.39 ++		unsigned long flags;
   53.40 ++
   53.41 ++		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   53.42 ++			pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
   53.43 ++			if (!pmd)
   53.44 ++				goto out_oom;
   53.45 ++			set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
   53.46 ++		}
   53.47 ++
   53.48 ++		spin_lock_irqsave(&pgd_lock, flags);
   53.49 ++		for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   53.50 ++			unsigned long v = (unsigned long)i << PGDIR_SHIFT;
   53.51 ++			pgd_t *kpgd = pgd_offset_k(v);
   53.52 ++			pud_t *kpud = pud_offset(kpgd, v);
   53.53 ++			pmd_t *kpmd = pmd_offset(kpud, v);
   53.54 ++			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   53.55 ++			memcpy(pmd, kpmd, PAGE_SIZE);
   53.56 ++		}
   53.57 ++		pgd_list_add(pgd);
   53.58 ++		spin_unlock_irqrestore(&pgd_lock, flags);
   53.59 ++	}
   53.60 ++
   53.61 + 	return pgd;
   53.62 + 
   53.63 + out_oom:
   53.64 +@@ -263,9 +288,23 @@ void pgd_free(pgd_t *pgd)
   53.65 + 	int i;
   53.66 + 
   53.67 + 	/* in the PAE case user pgd entries are overwritten before usage */
   53.68 +-	if (PTRS_PER_PMD > 1)
   53.69 +-		for (i = 0; i < USER_PTRS_PER_PGD; ++i)
   53.70 +-			kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
   53.71 ++	if (PTRS_PER_PMD > 1) {
   53.72 ++		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
   53.73 ++			pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   53.74 ++			kmem_cache_free(pmd_cache, pmd);
   53.75 ++		}
   53.76 ++		if (!HAVE_SHARED_KERNEL_PMD) {
   53.77 ++			unsigned long flags;
   53.78 ++			spin_lock_irqsave(&pgd_lock, flags);
   53.79 ++			pgd_list_del(pgd);
   53.80 ++			spin_unlock_irqrestore(&pgd_lock, flags);
   53.81 ++			for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) {
   53.82 ++				pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
   53.83 ++				memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t));
   53.84 ++				kmem_cache_free(pmd_cache, pmd);
   53.85 ++			}
   53.86 ++		}
   53.87 ++	}
   53.88 + 	/* in the non-PAE case, free_pgtables() clears user pgd entries */
   53.89 + 	kmem_cache_free(pgd_cache, pgd);
   53.90 + }
   53.91 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h ./include/asm-i386/pgtable-2level-defs.h
   53.92 +--- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-2level-defs.h	2006-01-03 03:21:10.000000000 +0000
   53.93 ++++ ./include/asm-i386/pgtable-2level-defs.h	2006-02-02 17:45:14.000000000 +0000
   53.94 +@@ -1,6 +1,8 @@
   53.95 + #ifndef _I386_PGTABLE_2LEVEL_DEFS_H
   53.96 + #define _I386_PGTABLE_2LEVEL_DEFS_H
   53.97 + 
   53.98 ++#define HAVE_SHARED_KERNEL_PMD 0
   53.99 ++
  53.100 + /*
  53.101 +  * traditional i386 two-level paging structure:
  53.102 +  */
  53.103 +diff -pruN ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h ./include/asm-i386/pgtable-3level-defs.h
  53.104 +--- ../pristine-linux-2.6.16-rc1-git4/include/asm-i386/pgtable-3level-defs.h	2006-01-03 03:21:10.000000000 +0000
  53.105 ++++ ./include/asm-i386/pgtable-3level-defs.h	2006-02-02 17:45:14.000000000 +0000
  53.106 +@@ -1,6 +1,8 @@
  53.107 + #ifndef _I386_PGTABLE_3LEVEL_DEFS_H
  53.108 + #define _I386_PGTABLE_3LEVEL_DEFS_H
  53.109 + 
  53.110 ++#define HAVE_SHARED_KERNEL_PMD 1
  53.111 ++
  53.112 + /*
  53.113 +  * PGDIR_SHIFT determines what a top-level page table entry can map
  53.114 +  */
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/patches/linux-2.6.16-rc3/smp-alts.patch	Wed Feb 15 22:06:12 2006 +0000
    54.3 @@ -0,0 +1,591 @@
    54.4 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/Kconfig ./arch/i386/Kconfig
    54.5 +--- ../pristine-linux-2.6.16-rc3/arch/i386/Kconfig	2006-02-15 20:38:51.000000000 +0000
    54.6 ++++ ./arch/i386/Kconfig	2006-02-15 20:45:57.000000000 +0000
    54.7 +@@ -202,6 +202,19 @@ config SMP
    54.8 + 
    54.9 + 	  If you don't know what to do here, say N.
   54.10 + 
   54.11 ++config SMP_ALTERNATIVES
   54.12 ++	bool "SMP alternatives support (EXPERIMENTAL)"
   54.13 ++	depends on SMP && EXPERIMENTAL
   54.14 ++	help
   54.15 ++	  Try to reduce the overhead of running an SMP kernel on a uniprocessor
   54.16 ++	  host slightly by replacing certain key instruction sequences
   54.17 ++	  according to whether we currently have more than one CPU available.
   54.18 ++	  This should provide a noticeable boost to performance when
   54.19 ++	  running SMP kernels on UP machines, and have negligible impact
   54.20 ++	  when running on an true SMP host.
   54.21 ++
   54.22 ++          If unsure, say N.
   54.23 ++	  
   54.24 + config NR_CPUS
   54.25 + 	int "Maximum number of CPUs (2-255)"
   54.26 + 	range 2 255
   54.27 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/Makefile ./arch/i386/kernel/Makefile
   54.28 +--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/Makefile	2006-02-15 20:38:51.000000000 +0000
   54.29 ++++ ./arch/i386/kernel/Makefile	2006-02-15 20:45:57.000000000 +0000
   54.30 +@@ -37,6 +37,7 @@ obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
   54.31 + obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
   54.32 + obj-$(CONFIG_VM86)		+= vm86.o
   54.33 + obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
   54.34 ++obj-$(CONFIG_SMP_ALTERNATIVES)  += smpalts.o
   54.35 + 
   54.36 + EXTRA_AFLAGS   := -traditional
   54.37 + 
   54.38 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpalts.c ./arch/i386/kernel/smpalts.c
   54.39 +--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpalts.c	1970-01-01 01:00:00.000000000 +0100
   54.40 ++++ ./arch/i386/kernel/smpalts.c	2006-02-15 20:45:57.000000000 +0000
   54.41 +@@ -0,0 +1,85 @@
   54.42 ++#include <linux/kernel.h>
   54.43 ++#include <asm/system.h>
   54.44 ++#include <asm/smp_alt.h>
   54.45 ++#include <asm/processor.h>
   54.46 ++#include <asm/string.h>
   54.47 ++
   54.48 ++struct smp_replacement_record {
   54.49 ++	unsigned char targ_size;
   54.50 ++	unsigned char smp1_size;
   54.51 ++	unsigned char smp2_size;
   54.52 ++	unsigned char up_size;
   54.53 ++	unsigned char feature;
   54.54 ++	unsigned char data[0];
   54.55 ++};
   54.56 ++
   54.57 ++struct smp_alternative_record {
   54.58 ++	void *targ_start;
   54.59 ++	struct smp_replacement_record *repl;
   54.60 ++};
   54.61 ++
   54.62 ++extern struct smp_alternative_record __start_smp_alternatives_table,
   54.63 ++  __stop_smp_alternatives_table;
   54.64 ++extern unsigned long __init_begin, __init_end;
   54.65 ++
   54.66 ++void prepare_for_smp(void)
   54.67 ++{
   54.68 ++	struct smp_alternative_record *r;
   54.69 ++	printk(KERN_INFO "Enabling SMP...\n");
   54.70 ++	for (r = &__start_smp_alternatives_table;
   54.71 ++	     r != &__stop_smp_alternatives_table;
   54.72 ++	     r++) {
   54.73 ++		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
   54.74 ++		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
   54.75 ++		BUG_ON(r->repl->targ_size < r->repl->up_size);
   54.76 ++               if (system_state == SYSTEM_RUNNING &&
   54.77 ++                   r->targ_start >= (void *)&__init_begin &&
   54.78 ++                   r->targ_start < (void *)&__init_end)
   54.79 ++                       continue;
   54.80 ++		if (r->repl->feature != (unsigned char)-1 &&
   54.81 ++		    boot_cpu_has(r->repl->feature)) {
   54.82 ++			memcpy(r->targ_start,
   54.83 ++			       r->repl->data + r->repl->smp1_size,
   54.84 ++			       r->repl->smp2_size);
   54.85 ++			memset(r->targ_start + r->repl->smp2_size,
   54.86 ++			       0x90,
   54.87 ++			       r->repl->targ_size - r->repl->smp2_size);
   54.88 ++		} else {
   54.89 ++			memcpy(r->targ_start,
   54.90 ++			       r->repl->data,
   54.91 ++			       r->repl->smp1_size);
   54.92 ++			memset(r->targ_start + r->repl->smp1_size,
   54.93 ++			       0x90,
   54.94 ++			       r->repl->targ_size - r->repl->smp1_size);
   54.95 ++		}
   54.96 ++	}
   54.97 ++	/* Paranoia */
   54.98 ++	asm volatile ("jmp 1f\n1:");
   54.99 ++	mb();
  54.100 ++}
  54.101 ++
  54.102 ++void unprepare_for_smp(void)
  54.103 ++{
  54.104 ++	struct smp_alternative_record *r;
  54.105 ++	printk(KERN_INFO "Disabling SMP...\n");
  54.106 ++	for (r = &__start_smp_alternatives_table;
  54.107 ++	     r != &__stop_smp_alternatives_table;
  54.108 ++	     r++) {
  54.109 ++		BUG_ON(r->repl->targ_size < r->repl->smp1_size);
  54.110 ++		BUG_ON(r->repl->targ_size < r->repl->smp2_size);
  54.111 ++		BUG_ON(r->repl->targ_size < r->repl->up_size);
  54.112 ++               if (system_state == SYSTEM_RUNNING &&
  54.113 ++                   r->targ_start >= (void *)&__init_begin &&
  54.114 ++                   r->targ_start < (void *)&__init_end)
  54.115 ++                       continue;
  54.116 ++		memcpy(r->targ_start,
  54.117 ++		       r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
  54.118 ++		       r->repl->up_size);
  54.119 ++		memset(r->targ_start + r->repl->up_size,
  54.120 ++		       0x90,
  54.121 ++		       r->repl->targ_size - r->repl->up_size);
  54.122 ++	}
  54.123 ++	/* Paranoia */
  54.124 ++	asm volatile ("jmp 1f\n1:");
  54.125 ++	mb();
  54.126 ++}
  54.127 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpboot.c ./arch/i386/kernel/smpboot.c
  54.128 +--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/smpboot.c	2006-02-15 20:38:51.000000000 +0000
  54.129 ++++ ./arch/i386/kernel/smpboot.c	2006-02-15 20:45:57.000000000 +0000
  54.130 +@@ -1214,6 +1214,11 @@ static void __init smp_boot_cpus(unsigne
  54.131 + 		if (max_cpus <= cpucount+1)
  54.132 + 			continue;
  54.133 + 
  54.134 ++#ifdef CONFIG_SMP_ALTERNATIVES
  54.135 ++		if (kicked == 1)
  54.136 ++			prepare_for_smp();
  54.137 ++#endif
  54.138 ++
  54.139 + 		if (((cpu = alloc_cpu_id()) <= 0) || do_boot_cpu(apicid, cpu))
  54.140 + 			printk("CPU #%d not responding - cannot use it.\n",
  54.141 + 								apicid);
  54.142 +@@ -1392,6 +1397,11 @@ int __devinit __cpu_up(unsigned int cpu)
  54.143 + 		return -EIO;
  54.144 + 	}
  54.145 + 
  54.146 ++#ifdef CONFIG_SMP_ALTERNATIVES
  54.147 ++	if (num_online_cpus() == 1)
  54.148 ++		prepare_for_smp();
  54.149 ++#endif
  54.150 ++
  54.151 + 	local_irq_enable();
  54.152 + 	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
  54.153 + 	/* Unleash the CPU! */
  54.154 +diff -pruN ../pristine-linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S ./arch/i386/kernel/vmlinux.lds.S
  54.155 +--- ../pristine-linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S	2006-01-03 03:21:10.000000000 +0000
  54.156 ++++ ./arch/i386/kernel/vmlinux.lds.S	2006-02-15 20:45:57.000000000 +0000
  54.157 +@@ -34,6 +34,13 @@ SECTIONS
  54.158 +   __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
  54.159 +   __stop___ex_table = .;
  54.160 + 
  54.161 ++  . = ALIGN(16);
  54.162 ++  __start_smp_alternatives_table = .;
  54.163 ++  __smp_alternatives : { *(__smp_alternatives) }
  54.164 ++  __stop_smp_alternatives_table = .;
  54.165 ++
  54.166 ++  __smp_replacements : { *(__smp_replacements) }
  54.167 ++
  54.168 +   RODATA
  54.169 + 
  54.170 +   /* writeable */
  54.171 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/atomic.h ./include/asm-i386/atomic.h
  54.172 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/atomic.h	2006-02-15 20:38:57.000000000 +0000
  54.173 ++++ ./include/asm-i386/atomic.h	2006-02-15 20:45:57.000000000 +0000
  54.174 +@@ -4,18 +4,13 @@
  54.175 + #include <linux/config.h>
  54.176 + #include <linux/compiler.h>
  54.177 + #include <asm/processor.h>
  54.178 ++#include <asm/smp_alt.h>
  54.179 + 
  54.180 + /*
  54.181 +  * Atomic operations that C can't guarantee us.  Useful for
  54.182 +  * resource counting etc..
  54.183 +  */
  54.184 + 
  54.185 +-#ifdef CONFIG_SMP
  54.186 +-#define LOCK "lock ; "
  54.187 +-#else
  54.188 +-#define LOCK ""
  54.189 +-#endif
  54.190 +-
  54.191 + /*
  54.192 +  * Make sure gcc doesn't try to be clever and move things around
  54.193 +  * on us. We need to use _exactly_ the address the user gave us,
  54.194 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/bitops.h ./include/asm-i386/bitops.h
  54.195 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/bitops.h	2006-02-15 20:38:57.000000000 +0000
  54.196 ++++ ./include/asm-i386/bitops.h	2006-02-15 20:45:57.000000000 +0000
  54.197 +@@ -7,6 +7,7 @@
  54.198 + 
  54.199 + #include <linux/config.h>
  54.200 + #include <linux/compiler.h>
  54.201 ++#include <asm/smp_alt.h>
  54.202 + 
  54.203 + /*
  54.204 +  * These have to be done with inline assembly: that way the bit-setting
  54.205 +@@ -16,12 +17,6 @@
  54.206 +  * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
  54.207 +  */
  54.208 + 
  54.209 +-#ifdef CONFIG_SMP
  54.210 +-#define LOCK_PREFIX "lock ; "
  54.211 +-#else
  54.212 +-#define LOCK_PREFIX ""
  54.213 +-#endif
  54.214 +-
  54.215 + #define ADDR (*(volatile long *) addr)
  54.216 + 
  54.217 + /**
  54.218 +@@ -41,7 +36,7 @@
  54.219 +  */
  54.220 + static inline void set_bit(int nr, volatile unsigned long * addr)
  54.221 + {
  54.222 +-	__asm__ __volatile__( LOCK_PREFIX
  54.223 ++	__asm__ __volatile__( LOCK
  54.224 + 		"btsl %1,%0"
  54.225 + 		:"+m" (ADDR)
  54.226 + 		:"Ir" (nr));
  54.227 +@@ -76,7 +71,7 @@ static inline void __set_bit(int nr, vol
  54.228 +  */
  54.229 + static inline void clear_bit(int nr, volatile unsigned long * addr)
  54.230 + {
  54.231 +-	__asm__ __volatile__( LOCK_PREFIX
  54.232 ++	__asm__ __volatile__( LOCK
  54.233 + 		"btrl %1,%0"
  54.234 + 		:"+m" (ADDR)
  54.235 + 		:"Ir" (nr));
  54.236 +@@ -121,7 +116,7 @@ static inline void __change_bit(int nr, 
  54.237 +  */
  54.238 + static inline void change_bit(int nr, volatile unsigned long * addr)
  54.239 + {
  54.240 +-	__asm__ __volatile__( LOCK_PREFIX
  54.241 ++	__asm__ __volatile__( LOCK
  54.242 + 		"btcl %1,%0"
  54.243 + 		:"+m" (ADDR)
  54.244 + 		:"Ir" (nr));
  54.245 +@@ -140,7 +135,7 @@ static inline int test_and_set_bit(int n
  54.246 + {
  54.247 + 	int oldbit;
  54.248 + 
  54.249 +-	__asm__ __volatile__( LOCK_PREFIX
  54.250 ++	__asm__ __volatile__( LOCK
  54.251 + 		"btsl %2,%1\n\tsbbl %0,%0"
  54.252 + 		:"=r" (oldbit),"+m" (ADDR)
  54.253 + 		:"Ir" (nr) : "memory");
  54.254 +@@ -180,7 +175,7 @@ static inline int test_and_clear_bit(int
  54.255 + {
  54.256 + 	int oldbit;
  54.257 + 
  54.258 +-	__asm__ __volatile__( LOCK_PREFIX
  54.259 ++	__asm__ __volatile__( LOCK
  54.260 + 		"btrl %2,%1\n\tsbbl %0,%0"
  54.261 + 		:"=r" (oldbit),"+m" (ADDR)
  54.262 + 		:"Ir" (nr) : "memory");
  54.263 +@@ -231,7 +226,7 @@ static inline int test_and_change_bit(in
  54.264 + {
  54.265 + 	int oldbit;
  54.266 + 
  54.267 +-	__asm__ __volatile__( LOCK_PREFIX
  54.268 ++	__asm__ __volatile__( LOCK
  54.269 + 		"btcl %2,%1\n\tsbbl %0,%0"
  54.270 + 		:"=r" (oldbit),"+m" (ADDR)
  54.271 + 		:"Ir" (nr) : "memory");
  54.272 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/futex.h ./include/asm-i386/futex.h
  54.273 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/futex.h	2006-02-15 20:38:57.000000000 +0000
  54.274 ++++ ./include/asm-i386/futex.h	2006-02-15 20:45:57.000000000 +0000
  54.275 +@@ -28,7 +28,7 @@
  54.276 + "1:	movl	%2, %0\n\
  54.277 + 	movl	%0, %3\n"					\
  54.278 + 	insn "\n"						\
  54.279 +-"2:	" LOCK_PREFIX "cmpxchgl %3, %2\n\
  54.280 ++"2:	" LOCK "cmpxchgl %3, %2\n\
  54.281 + 	jnz	1b\n\
  54.282 + 3:	.section .fixup,\"ax\"\n\
  54.283 + 4:	mov	%5, %1\n\
  54.284 +@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, 
  54.285 + #endif
  54.286 + 		switch (op) {
  54.287 + 		case FUTEX_OP_ADD:
  54.288 +-			__futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
  54.289 ++			__futex_atomic_op1(LOCK "xaddl %0, %2", ret,
  54.290 + 					   oldval, uaddr, oparg);
  54.291 + 			break;
  54.292 + 		case FUTEX_OP_OR:
  54.293 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/rwsem.h ./include/asm-i386/rwsem.h
  54.294 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/rwsem.h	2006-01-03 03:21:10.000000000 +0000
  54.295 ++++ ./include/asm-i386/rwsem.h	2006-02-15 20:45:57.000000000 +0000
  54.296 +@@ -40,6 +40,7 @@
  54.297 + 
  54.298 + #include <linux/list.h>
  54.299 + #include <linux/spinlock.h>
  54.300 ++#include <asm/smp_alt.h>
  54.301 + 
  54.302 + struct rwsem_waiter;
  54.303 + 
  54.304 +@@ -99,7 +100,7 @@ static inline void __down_read(struct rw
  54.305 + {
  54.306 + 	__asm__ __volatile__(
  54.307 + 		"# beginning down_read\n\t"
  54.308 +-LOCK_PREFIX	"  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
  54.309 ++LOCK	        "  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
  54.310 + 		"  js        2f\n\t" /* jump if we weren't granted the lock */
  54.311 + 		"1:\n\t"
  54.312 + 		LOCK_SECTION_START("")
  54.313 +@@ -130,7 +131,7 @@ static inline int __down_read_trylock(st
  54.314 + 		"  movl	     %1,%2\n\t"
  54.315 + 		"  addl      %3,%2\n\t"
  54.316 + 		"  jle	     2f\n\t"
  54.317 +-LOCK_PREFIX	"  cmpxchgl  %2,%0\n\t"
  54.318 ++LOCK	        "  cmpxchgl  %2,%0\n\t"
  54.319 + 		"  jnz	     1b\n\t"
  54.320 + 		"2:\n\t"
  54.321 + 		"# ending __down_read_trylock\n\t"
  54.322 +@@ -150,7 +151,7 @@ static inline void __down_write(struct r
  54.323 + 	tmp = RWSEM_ACTIVE_WRITE_BIAS;
  54.324 + 	__asm__ __volatile__(
  54.325 + 		"# beginning down_write\n\t"
  54.326 +-LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
  54.327 ++LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
  54.328 + 		"  testl     %%edx,%%edx\n\t" /* was the count 0 before? */
  54.329 + 		"  jnz       2f\n\t" /* jump if we weren't granted the lock */
  54.330 + 		"1:\n\t"
  54.331 +@@ -188,7 +189,7 @@ static inline void __up_read(struct rw_s
  54.332 + 	__s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
  54.333 + 	__asm__ __volatile__(
  54.334 + 		"# beginning __up_read\n\t"
  54.335 +-LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
  54.336 ++LOCK	        "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
  54.337 + 		"  js        2f\n\t" /* jump if the lock is being waited upon */
  54.338 + 		"1:\n\t"
  54.339 + 		LOCK_SECTION_START("")
  54.340 +@@ -214,7 +215,7 @@ static inline void __up_write(struct rw_
  54.341 + 	__asm__ __volatile__(
  54.342 + 		"# beginning __up_write\n\t"
  54.343 + 		"  movl      %2,%%edx\n\t"
  54.344 +-LOCK_PREFIX	"  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
  54.345 ++LOCK	        "  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
  54.346 + 		"  jnz       2f\n\t" /* jump if the lock is being waited upon */
  54.347 + 		"1:\n\t"
  54.348 + 		LOCK_SECTION_START("")
  54.349 +@@ -239,7 +240,7 @@ static inline void __downgrade_write(str
  54.350 + {
  54.351 + 	__asm__ __volatile__(
  54.352 + 		"# beginning __downgrade_write\n\t"
  54.353 +-LOCK_PREFIX	"  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
  54.354 ++LOCK	        "  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
  54.355 + 		"  js        2f\n\t" /* jump if the lock is being waited upon */
  54.356 + 		"1:\n\t"
  54.357 + 		LOCK_SECTION_START("")
  54.358 +@@ -263,7 +264,7 @@ LOCK_PREFIX	"  addl      %2,(%%eax)\n\t"
  54.359 + static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
  54.360 + {
  54.361 + 	__asm__ __volatile__(
  54.362 +-LOCK_PREFIX	"addl %1,%0"
  54.363 ++LOCK	          "addl %1,%0"
  54.364 + 		: "=m"(sem->count)
  54.365 + 		: "ir"(delta), "m"(sem->count));
  54.366 + }
  54.367 +@@ -276,7 +277,7 @@ static inline int rwsem_atomic_update(in
  54.368 + 	int tmp = delta;
  54.369 + 
  54.370 + 	__asm__ __volatile__(
  54.371 +-LOCK_PREFIX	"xadd %0,(%2)"
  54.372 ++LOCK  	          "xadd %0,(%2)"
  54.373 + 		: "+r"(tmp), "=m"(sem->count)
  54.374 + 		: "r"(sem), "m"(sem->count)
  54.375 + 		: "memory");
  54.376 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/smp_alt.h ./include/asm-i386/smp_alt.h
  54.377 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/smp_alt.h	1970-01-01 01:00:00.000000000 +0100
  54.378 ++++ ./include/asm-i386/smp_alt.h	2006-02-15 20:45:57.000000000 +0000
  54.379 +@@ -0,0 +1,32 @@
  54.380 ++#ifndef __ASM_SMP_ALT_H__
  54.381 ++#define __ASM_SMP_ALT_H__
  54.382 ++
  54.383 ++#include <linux/config.h>
  54.384 ++
  54.385 ++#ifdef CONFIG_SMP
  54.386 ++#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
  54.387 ++#define LOCK \
  54.388 ++        "6677: nop\n" \
  54.389 ++	".section __smp_alternatives,\"a\"\n" \
  54.390 ++	".long 6677b\n" \
  54.391 ++	".long 6678f\n" \
  54.392 ++	".previous\n" \
  54.393 ++	".section __smp_replacements,\"a\"\n" \
  54.394 ++	"6678: .byte 1\n" \
  54.395 ++	".byte 1\n" \
  54.396 ++	".byte 0\n" \
  54.397 ++        ".byte 1\n" \
  54.398 ++	".byte -1\n" \
  54.399 ++	"lock\n" \
  54.400 ++	"nop\n" \
  54.401 ++	".previous\n"
  54.402 ++void prepare_for_smp(void);
  54.403 ++void unprepare_for_smp(void);
  54.404 ++#else
  54.405 ++#define LOCK "lock ; "
  54.406 ++#endif
  54.407 ++#else
  54.408 ++#define LOCK ""
  54.409 ++#endif
  54.410 ++
  54.411 ++#endif /* __ASM_SMP_ALT_H__ */
  54.412 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/spinlock.h ./include/asm-i386/spinlock.h
  54.413 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/spinlock.h	2006-01-03 03:21:10.000000000 +0000
  54.414 ++++ ./include/asm-i386/spinlock.h	2006-02-15 20:45:57.000000000 +0000
  54.415 +@@ -6,6 +6,7 @@
  54.416 + #include <asm/page.h>
  54.417 + #include <linux/config.h>
  54.418 + #include <linux/compiler.h>
  54.419 ++#include <asm/smp_alt.h>
  54.420 + 
  54.421 + /*
  54.422 +  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  54.423 +@@ -23,7 +24,8 @@
  54.424 + 
  54.425 + #define __raw_spin_lock_string \
  54.426 + 	"\n1:\t" \
  54.427 +-	"lock ; decb %0\n\t" \
  54.428 ++	LOCK \
  54.429 ++	"decb %0\n\t" \
  54.430 + 	"jns 3f\n" \
  54.431 + 	"2:\t" \
  54.432 + 	"rep;nop\n\t" \
  54.433 +@@ -34,7 +36,8 @@
  54.434 + 
  54.435 + #define __raw_spin_lock_string_flags \
  54.436 + 	"\n1:\t" \
  54.437 +-	"lock ; decb %0\n\t" \
  54.438 ++	LOCK \
  54.439 ++	"decb %0\n\t" \
  54.440 + 	"jns 4f\n\t" \
  54.441 + 	"2:\t" \
  54.442 + 	"testl $0x200, %1\n\t" \
  54.443 +@@ -65,10 +68,34 @@ static inline void __raw_spin_lock_flags
  54.444 + static inline int __raw_spin_trylock(raw_spinlock_t *lock)
  54.445 + {
  54.446 + 	char oldval;
  54.447 ++#ifdef CONFIG_SMP_ALTERNATIVES
  54.448 + 	__asm__ __volatile__(
  54.449 +-		"xchgb %b0,%1"
  54.450 ++		"1:movb %1,%b0\n"
  54.451 ++		"movb $0,%1\n"
  54.452 ++		"2:"
  54.453 ++		".section __smp_alternatives,\"a\"\n"
  54.454 ++		".long 1b\n"
  54.455 ++		".long 3f\n"
  54.456 ++		".previous\n"
  54.457 ++		".section __smp_replacements,\"a\"\n"
  54.458 ++		"3: .byte 2b - 1b\n"
  54.459 ++		".byte 5f-4f\n"
  54.460 ++		".byte 0\n"
  54.461 ++		".byte 6f-5f\n"
  54.462 ++		".byte -1\n"
  54.463 ++		"4: xchgb %b0,%1\n"
  54.464 ++		"5: movb %1,%b0\n"
  54.465 ++		"movb $0,%1\n"
  54.466 ++		"6:\n"
  54.467 ++		".previous\n"
  54.468 + 		:"=q" (oldval), "=m" (lock->slock)
  54.469 + 		:"0" (0) : "memory");
  54.470 ++#else
  54.471 ++	__asm__ __volatile__(
  54.472 ++		"xchgb %b0,%1\n"
  54.473 ++		:"=q" (oldval), "=m" (lock->slock)
  54.474 ++		:"0" (0) : "memory");
  54.475 ++#endif
  54.476 + 	return oldval > 0;
  54.477 + }
  54.478 + 
  54.479 +@@ -178,12 +205,12 @@ static inline int __raw_write_trylock(ra
  54.480 + 
  54.481 + static inline void __raw_read_unlock(raw_rwlock_t *rw)
  54.482 + {
  54.483 +-	asm volatile("lock ; incl %0" :"=m" (rw->lock) : : "memory");
  54.484 ++	asm volatile(LOCK "incl %0" :"=m" (rw->lock) : : "memory");
  54.485 + }
  54.486 + 
  54.487 + static inline void __raw_write_unlock(raw_rwlock_t *rw)
  54.488 + {
  54.489 +-	asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ", %0"
  54.490 ++	asm volatile(LOCK "addl $" RW_LOCK_BIAS_STR ", %0"
  54.491 + 				 : "=m" (rw->lock) : : "memory");
  54.492 + }
  54.493 + 
  54.494 +diff -pruN ../pristine-linux-2.6.16-rc3/include/asm-i386/system.h ./include/asm-i386/system.h
  54.495 +--- ../pristine-linux-2.6.16-rc3/include/asm-i386/system.h	2006-02-15 20:38:57.000000000 +0000
  54.496 ++++ ./include/asm-i386/system.h	2006-02-15 20:45:57.000000000 +0000
  54.497 +@@ -5,7 +5,7 @@
  54.498 + #include <linux/kernel.h>
  54.499 + #include <asm/segment.h>
  54.500 + #include <asm/cpufeature.h>
  54.501 +-#include <linux/bitops.h> /* for LOCK_PREFIX */
  54.502 ++#include <asm/smp_alt.h>
  54.503 + 
  54.504 + #ifdef __KERNEL__
  54.505 + 
  54.506 +@@ -271,19 +271,19 @@ static inline unsigned long __cmpxchg(vo
  54.507 + 	unsigned long prev;
  54.508 + 	switch (size) {
  54.509 + 	case 1:
  54.510 +-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
  54.511 ++		__asm__ __volatile__(LOCK "cmpxchgb %b1,%2"
  54.512 + 				     : "=a"(prev)
  54.513 + 				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
  54.514 + 				     : "memory");
  54.515 + 		return prev;
  54.516 + 	case 2:
  54.517 +-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
  54.518 ++		__asm__ __volatile__(LOCK "cmpxchgw %w1,%2"
  54.519 + 				     : "=a"(prev)
  54.520 + 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
  54.521 + 				     : "memory");
  54.522 + 		return prev;
  54.523 + 	case 4:
  54.524 +-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
  54.525 ++		__asm__ __volatile__(LOCK "cmpxchgl %1,%2"
  54.526 + 				     : "=a"(prev)
  54.527 + 				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
  54.528 + 				     : "memory");
  54.529 +@@ -336,7 +336,7 @@ static inline unsigned long long __cmpxc
  54.530 + 				      unsigned long long new)
  54.531 + {
  54.532 + 	unsigned long long prev;
  54.533 +-	__asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
  54.534 ++	__asm__ __volatile__(LOCK "cmpxchg8b %3"
  54.535 + 			     : "=A"(prev)
  54.536 + 			     : "b"((unsigned long)new),
  54.537 + 			       "c"((unsigned long)(new >> 32)),
  54.538 +@@ -503,11 +503,55 @@ struct alt_instr { 
  54.539 + #endif
  54.540 + 
  54.541 + #ifdef CONFIG_SMP
  54.542 ++#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
  54.543 ++#define smp_alt_mb(instr)                                           \
  54.544 ++__asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
  54.545 ++		     ".section __smp_alternatives,\"a\"\n"          \
  54.546 ++		     ".long 6667b\n"                                \
  54.547 ++                     ".long 6673f\n"                                \
  54.548 ++		     ".previous\n"                                  \
  54.549 ++		     ".section __smp_replacements,\"a\"\n"          \
  54.550 ++		     "6673:.byte 6668b-6667b\n"                     \
  54.551 ++		     ".byte 6670f-6669f\n"                          \
  54.552 ++		     ".byte 6671f-6670f\n"                          \
  54.553 ++                     ".byte 0\n"                                    \
  54.554 ++		     ".byte %c0\n"                                  \
  54.555 ++		     "6669:lock;addl $0,0(%%esp)\n"                 \
  54.556 ++		     "6670:" instr "\n"                             \
  54.557 ++		     "6671:\n"                                      \
  54.558 ++		     ".previous\n"                                  \
  54.559 ++		     :                                              \
  54.560 ++		     : "i" (X86_FEATURE_XMM2)                       \
  54.561 ++		     : "memory")
  54.562 ++#define smp_rmb() smp_alt_mb("lfence")
  54.563 ++#define smp_mb()  smp_alt_mb("mfence")
  54.564 ++#define set_mb(var, value) do {                                     \
  54.565 ++unsigned long __set_mb_temp;                                        \
  54.566 ++__asm__ __volatile__("6667:movl %1, %0\n6668:\n"                    \
  54.567 ++		     ".section __smp_alternatives,\"a\"\n"          \
  54.568 ++		     ".long 6667b\n"                                \
  54.569 ++		     ".long 6673f\n"                                \
  54.570 ++		     ".previous\n"                                  \
  54.571 ++		     ".section __smp_replacements,\"a\"\n"          \
  54.572 ++		     "6673: .byte 6668b-6667b\n"                    \
  54.573 ++		     ".byte 6670f-6669f\n"                          \
  54.574 ++		     ".byte 0\n"                                    \
  54.575 ++		     ".byte 6671f-6670f\n"                          \
  54.576 ++		     ".byte -1\n"                                   \
  54.577 ++		     "6669: xchg %1, %0\n"                          \
  54.578 ++		     "6670:movl %1, %0\n"                           \
  54.579 ++		     "6671:\n"                                      \
  54.580 ++		     ".previous\n"                                  \
  54.581 ++		     : "=m" (var), "=r" (__set_mb_temp)             \
  54.582 ++		     : "1" (value)                                  \
  54.583 ++		     : "memory"); } while (0)
  54.584 ++#else
  54.585 + #define smp_mb()	mb()
  54.586 + #define smp_rmb()	rmb()
  54.587 ++#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
  54.588 ++#endif
  54.589 + #define smp_wmb()	wmb()
  54.590 + #define smp_read_barrier_depends()	read_barrier_depends()
  54.591 +-#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
  54.592 + #else
  54.593 + #define smp_mb()	barrier()
  54.594 + #define smp_rmb()	barrier()