aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/shark_defconfig85
-rw-r--r--arch/arm/kernel/smp.c7
-rw-r--r--arch/arm/kernel/traps.c12
-rw-r--r--arch/arm/lib/bitops.h31
-rw-r--r--arch/arm/lib/io-shark.c70
-rw-r--r--arch/arm/mach-integrator/platsmp.c8
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c1
-rw-r--r--arch/arm/mach-shark/core.c4
-rw-r--r--arch/arm/nwfpe/fpmodule.c1
-rw-r--r--arch/arm/plat-omap/ocpi.c1
-rw-r--r--arch/i386/mach-visws/reboot.c1
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c1
-rw-r--r--arch/i386/mach-voyager/voyager_smp.c6
-rw-r--r--arch/ia64/Kconfig7
-rw-r--r--arch/ia64/configs/sn2_defconfig1
-rw-r--r--arch/ia64/kernel/setup.c37
-rw-r--r--arch/ia64/kernel/topology.c2
-rw-r--r--arch/ia64/lib/flush.S46
-rw-r--r--arch/ia64/pci/pci.c12
-rw-r--r--arch/ia64/sn/kernel/io_init.c20
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c8
-rw-r--r--arch/ia64/sn/pci/pci_dma.c16
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c10
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c4
-rw-r--r--arch/ppc/boot/images/Makefile7
-rw-r--r--arch/ppc64/kernel/cpu_setup_power4.S38
-rw-r--r--arch/ppc64/kernel/cputable.c15
-rw-r--r--arch/ppc64/kernel/iSeries_htab.c51
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c18
-rw-r--r--arch/ppc64/kernel/pSeries_lpar.c47
-rw-r--r--arch/ppc64/mm/hash_low.S8
-rw-r--r--arch/ppc64/mm/hash_native.c129
-rw-r--r--arch/ppc64/mm/hash_utils.c16
-rw-r--r--arch/ppc64/mm/hugetlbpage.c16
-rw-r--r--arch/ppc64/mm/init.c7
-rw-r--r--arch/s390/kernel/compat_linux.c38
-rw-r--r--arch/s390/kernel/compat_wrapper.S4
-rw-r--r--arch/um/Kconfig_net2
-rw-r--r--arch/um/Makefile30
-rw-r--r--arch/um/Makefile-i38631
-rw-r--r--arch/um/Makefile-x86_646
-rw-r--r--arch/um/drivers/Makefile17
-rw-r--r--arch/um/kernel/uml.lds.S4
-rw-r--r--arch/um/scripts/Makefile.unmap4
-rw-r--r--arch/um/sys-i386/ldt.c114
-rw-r--r--arch/um/sys-i386/unmap.c2
-rw-r--r--arch/um/sys-x86_64/signal.c2
-rw-r--r--arch/um/sys-x86_64/unmap.c2
-rw-r--r--arch/v850/kernel/vmlinux.lds.S5
-rw-r--r--arch/x86_64/ia32/syscall32.c7
50 files changed, 583 insertions, 428 deletions
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index 1d9bcbbc8dfc..271823f0d708 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -1,22 +1,21 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-git3
4# Sun Mar 27 23:59:14 2005 4# Sat Jul 16 15:21:47 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y 8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12 11
13# 12#
14# Code maturity level options 13# Code maturity level options
15# 14#
16CONFIG_EXPERIMENTAL=y 15CONFIG_EXPERIMENTAL=y
17# CONFIG_CLEAN_COMPILE is not set 16CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN=y
19CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
20 19
21# 20#
22# General setup 21# General setup
@@ -33,7 +32,10 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set 33# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
37CONFIG_BASE_FULL=y 39CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 40CONFIG_FUTEX=y
39CONFIG_EPOLL=y 41CONFIG_EPOLL=y
@@ -81,6 +83,7 @@ CONFIG_ARCH_SHARK=y
81# CONFIG_ARCH_VERSATILE is not set 83# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set 84# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set 85# CONFIG_ARCH_H720X is not set
86# CONFIG_ARCH_AAEC2000 is not set
84 87
85# 88#
86# Processor Type 89# Processor Type
@@ -103,10 +106,12 @@ CONFIG_CPU_TLB_V4WB=y
103# 106#
104CONFIG_ISA=y 107CONFIG_ISA=y
105CONFIG_ISA_DMA=y 108CONFIG_ISA_DMA=y
109CONFIG_ISA_DMA_API=y
106CONFIG_PCI=y 110CONFIG_PCI=y
107CONFIG_PCI_HOST_VIA82C505=y 111CONFIG_PCI_HOST_VIA82C505=y
108CONFIG_PCI_LEGACY_PROC=y 112CONFIG_PCI_LEGACY_PROC=y
109# CONFIG_PCI_NAMES is not set 113# CONFIG_PCI_NAMES is not set
114# CONFIG_PCI_DEBUG is not set
110 115
111# 116#
112# PCCARD (PCMCIA/CardBus) support 117# PCCARD (PCMCIA/CardBus) support
@@ -116,7 +121,9 @@ CONFIG_PCI_LEGACY_PROC=y
116# 121#
117# Kernel Features 122# Kernel Features
118# 123#
124# CONFIG_SMP is not set
119# CONFIG_PREEMPT is not set 125# CONFIG_PREEMPT is not set
126# CONFIG_DISCONTIGMEM is not set
120CONFIG_LEDS=y 127CONFIG_LEDS=y
121CONFIG_LEDS_TIMER=y 128CONFIG_LEDS_TIMER=y
122# CONFIG_LEDS_CPU is not set 129# CONFIG_LEDS_CPU is not set
@@ -163,6 +170,7 @@ CONFIG_BINFMT_ELF=y
163# CONFIG_STANDALONE is not set 170# CONFIG_STANDALONE is not set
164CONFIG_PREVENT_FIRMWARE_BUILD=y 171CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set 172# CONFIG_FW_LOADER is not set
173# CONFIG_DEBUG_DRIVER is not set
166 174
167# 175#
168# Memory Technology Devices (MTD) 176# Memory Technology Devices (MTD)
@@ -172,8 +180,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
172# 180#
173# Parallel port support 181# Parallel port support
174# 182#
175CONFIG_PARPORT=y 183CONFIG_PARPORT=m
176CONFIG_PARPORT_PC=y 184CONFIG_PARPORT_PC=m
177# CONFIG_PARPORT_SERIAL is not set 185# CONFIG_PARPORT_SERIAL is not set
178# CONFIG_PARPORT_PC_FIFO is not set 186# CONFIG_PARPORT_PC_FIFO is not set
179# CONFIG_PARPORT_PC_SUPERIO is not set 187# CONFIG_PARPORT_PC_SUPERIO is not set
@@ -189,7 +197,6 @@ CONFIG_PARPORT_PC=y
189# 197#
190# Block devices 198# Block devices
191# 199#
192# CONFIG_BLK_DEV_FD is not set
193# CONFIG_BLK_DEV_XD is not set 200# CONFIG_BLK_DEV_XD is not set
194# CONFIG_PARIDE is not set 201# CONFIG_PARIDE is not set
195# CONFIG_BLK_CPQ_DA is not set 202# CONFIG_BLK_CPQ_DA is not set
@@ -229,7 +236,7 @@ CONFIG_BLK_DEV_IDE=y
229# CONFIG_BLK_DEV_IDE_SATA is not set 236# CONFIG_BLK_DEV_IDE_SATA is not set
230CONFIG_BLK_DEV_IDEDISK=y 237CONFIG_BLK_DEV_IDEDISK=y
231# CONFIG_IDEDISK_MULTI_MODE is not set 238# CONFIG_IDEDISK_MULTI_MODE is not set
232CONFIG_BLK_DEV_IDECD=y 239CONFIG_BLK_DEV_IDECD=m
233# CONFIG_BLK_DEV_IDETAPE is not set 240# CONFIG_BLK_DEV_IDETAPE is not set
234CONFIG_BLK_DEV_IDEFLOPPY=y 241CONFIG_BLK_DEV_IDEFLOPPY=y
235# CONFIG_BLK_DEV_IDESCSI is not set 242# CONFIG_BLK_DEV_IDESCSI is not set
@@ -261,6 +268,7 @@ CONFIG_CHR_DEV_ST=m
261CONFIG_BLK_DEV_SR=m 268CONFIG_BLK_DEV_SR=m
262# CONFIG_BLK_DEV_SR_VENDOR is not set 269# CONFIG_BLK_DEV_SR_VENDOR is not set
263CONFIG_CHR_DEV_SG=m 270CONFIG_CHR_DEV_SG=m
271# CONFIG_CHR_DEV_SCH is not set
264 272
265# 273#
266# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 274# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -290,17 +298,14 @@ CONFIG_CHR_DEV_SG=m
290# CONFIG_SCSI_AIC7XXX_OLD is not set 298# CONFIG_SCSI_AIC7XXX_OLD is not set
291# CONFIG_SCSI_AIC79XX is not set 299# CONFIG_SCSI_AIC79XX is not set
292# CONFIG_SCSI_DPT_I2O is not set 300# CONFIG_SCSI_DPT_I2O is not set
293# CONFIG_SCSI_ADVANSYS is not set
294# CONFIG_SCSI_IN2000 is not set 301# CONFIG_SCSI_IN2000 is not set
295# CONFIG_MEGARAID_NEWGEN is not set 302# CONFIG_MEGARAID_NEWGEN is not set
296# CONFIG_MEGARAID_LEGACY is not set 303# CONFIG_MEGARAID_LEGACY is not set
297# CONFIG_SCSI_SATA is not set 304# CONFIG_SCSI_SATA is not set
298# CONFIG_SCSI_BUSLOGIC is not set 305# CONFIG_SCSI_BUSLOGIC is not set
299# CONFIG_SCSI_CPQFCTS is not set
300# CONFIG_SCSI_DMX3191D is not set 306# CONFIG_SCSI_DMX3191D is not set
301# CONFIG_SCSI_DTC3280 is not set 307# CONFIG_SCSI_DTC3280 is not set
302# CONFIG_SCSI_EATA is not set 308# CONFIG_SCSI_EATA is not set
303# CONFIG_SCSI_EATA_PIO is not set
304# CONFIG_SCSI_FUTURE_DOMAIN is not set 309# CONFIG_SCSI_FUTURE_DOMAIN is not set
305# CONFIG_SCSI_GDTH is not set 310# CONFIG_SCSI_GDTH is not set
306# CONFIG_SCSI_GENERIC_NCR5380 is not set 311# CONFIG_SCSI_GENERIC_NCR5380 is not set
@@ -314,11 +319,8 @@ CONFIG_CHR_DEV_SG=m
314# CONFIG_SCSI_SYM53C8XX_2 is not set 319# CONFIG_SCSI_SYM53C8XX_2 is not set
315# CONFIG_SCSI_IPR is not set 320# CONFIG_SCSI_IPR is not set
316# CONFIG_SCSI_PAS16 is not set 321# CONFIG_SCSI_PAS16 is not set
317# CONFIG_SCSI_PCI2000 is not set
318# CONFIG_SCSI_PCI2220I is not set
319# CONFIG_SCSI_PSI240I is not set 322# CONFIG_SCSI_PSI240I is not set
320# CONFIG_SCSI_QLOGIC_FAS is not set 323# CONFIG_SCSI_QLOGIC_FAS is not set
321# CONFIG_SCSI_QLOGIC_ISP is not set
322# CONFIG_SCSI_QLOGIC_FC is not set 324# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set 325# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=m 326CONFIG_SCSI_QLA2XXX=m
@@ -327,6 +329,7 @@ CONFIG_SCSI_QLA2XXX=m
327# CONFIG_SCSI_QLA2300 is not set 329# CONFIG_SCSI_QLA2300 is not set
328# CONFIG_SCSI_QLA2322 is not set 330# CONFIG_SCSI_QLA2322 is not set
329# CONFIG_SCSI_QLA6312 is not set 331# CONFIG_SCSI_QLA6312 is not set
332# CONFIG_SCSI_LPFC is not set
330# CONFIG_SCSI_SYM53C416 is not set 333# CONFIG_SCSI_SYM53C416 is not set
331# CONFIG_SCSI_DC395x is not set 334# CONFIG_SCSI_DC395x is not set
332# CONFIG_SCSI_DC390T is not set 335# CONFIG_SCSI_DC390T is not set
@@ -344,6 +347,8 @@ CONFIG_SCSI_QLA2XXX=m
344# Fusion MPT device support 347# Fusion MPT device support
345# 348#
346# CONFIG_FUSION is not set 349# CONFIG_FUSION is not set
350# CONFIG_FUSION_SPI is not set
351# CONFIG_FUSION_FC is not set
347 352
348# 353#
349# IEEE 1394 (FireWire) support 354# IEEE 1394 (FireWire) support
@@ -365,7 +370,6 @@ CONFIG_NET=y
365# 370#
366CONFIG_PACKET=y 371CONFIG_PACKET=y
367# CONFIG_PACKET_MMAP is not set 372# CONFIG_PACKET_MMAP is not set
368# CONFIG_NETLINK_DEV is not set
369CONFIG_UNIX=y 373CONFIG_UNIX=y
370# CONFIG_NET_KEY is not set 374# CONFIG_NET_KEY is not set
371CONFIG_INET=y 375CONFIG_INET=y
@@ -380,7 +384,7 @@ CONFIG_INET=y
380# CONFIG_INET_ESP is not set 384# CONFIG_INET_ESP is not set
381# CONFIG_INET_IPCOMP is not set 385# CONFIG_INET_IPCOMP is not set
382# CONFIG_INET_TUNNEL is not set 386# CONFIG_INET_TUNNEL is not set
383# CONFIG_IP_TCPDIAG is not set 387CONFIG_IP_TCPDIAG=y
384# CONFIG_IP_TCPDIAG_IPV6 is not set 388# CONFIG_IP_TCPDIAG_IPV6 is not set
385# CONFIG_IPV6 is not set 389# CONFIG_IPV6 is not set
386# CONFIG_NETFILTER is not set 390# CONFIG_NETFILTER is not set
@@ -439,6 +443,7 @@ CONFIG_NET_ETHERNET=y
439# CONFIG_LANCE is not set 443# CONFIG_LANCE is not set
440# CONFIG_NET_VENDOR_SMC is not set 444# CONFIG_NET_VENDOR_SMC is not set
441# CONFIG_SMC91X is not set 445# CONFIG_SMC91X is not set
446# CONFIG_DM9000 is not set
442# CONFIG_NET_VENDOR_RACAL is not set 447# CONFIG_NET_VENDOR_RACAL is not set
443 448
444# 449#
@@ -483,9 +488,11 @@ CONFIG_CS89x0=y
483# CONFIG_HAMACHI is not set 488# CONFIG_HAMACHI is not set
484# CONFIG_YELLOWFIN is not set 489# CONFIG_YELLOWFIN is not set
485# CONFIG_R8169 is not set 490# CONFIG_R8169 is not set
491# CONFIG_SKGE is not set
486# CONFIG_SK98LIN is not set 492# CONFIG_SK98LIN is not set
487# CONFIG_VIA_VELOCITY is not set 493# CONFIG_VIA_VELOCITY is not set
488# CONFIG_TIGON3 is not set 494# CONFIG_TIGON3 is not set
495# CONFIG_BNX2 is not set
489 496
490# 497#
491# Ethernet (10000 Mbit) 498# Ethernet (10000 Mbit)
@@ -569,7 +576,6 @@ CONFIG_SERIO_I8042=y
569CONFIG_SERIO_LIBPS2=y 576CONFIG_SERIO_LIBPS2=y
570# CONFIG_SERIO_RAW is not set 577# CONFIG_SERIO_RAW is not set
571# CONFIG_GAMEPORT is not set 578# CONFIG_GAMEPORT is not set
572CONFIG_SOUND_GAMEPORT=y
573 579
574# 580#
575# Character devices 581# Character devices
@@ -592,6 +598,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
592# 598#
593CONFIG_SERIAL_CORE=y 599CONFIG_SERIAL_CORE=y
594CONFIG_SERIAL_CORE_CONSOLE=y 600CONFIG_SERIAL_CORE_CONSOLE=y
601# CONFIG_SERIAL_JSM is not set
595CONFIG_UNIX98_PTYS=y 602CONFIG_UNIX98_PTYS=y
596CONFIG_LEGACY_PTYS=y 603CONFIG_LEGACY_PTYS=y
597CONFIG_LEGACY_PTY_COUNT=256 604CONFIG_LEGACY_PTY_COUNT=256
@@ -653,6 +660,7 @@ CONFIG_FB_CFB_FILLRECT=y
653CONFIG_FB_CFB_COPYAREA=y 660CONFIG_FB_CFB_COPYAREA=y
654CONFIG_FB_CFB_IMAGEBLIT=y 661CONFIG_FB_CFB_IMAGEBLIT=y
655CONFIG_FB_SOFT_CURSOR=y 662CONFIG_FB_SOFT_CURSOR=y
663# CONFIG_FB_MACMODES is not set
656# CONFIG_FB_MODE_HELPERS is not set 664# CONFIG_FB_MODE_HELPERS is not set
657# CONFIG_FB_TILEBLITTING is not set 665# CONFIG_FB_TILEBLITTING is not set
658# CONFIG_FB_CIRRUS is not set 666# CONFIG_FB_CIRRUS is not set
@@ -674,7 +682,7 @@ CONFIG_FB_CYBER2000=y
674# CONFIG_FB_3DFX is not set 682# CONFIG_FB_3DFX is not set
675# CONFIG_FB_VOODOO1 is not set 683# CONFIG_FB_VOODOO1 is not set
676# CONFIG_FB_TRIDENT is not set 684# CONFIG_FB_TRIDENT is not set
677# CONFIG_FB_PM3 is not set 685# CONFIG_FB_S1D13XXX is not set
678# CONFIG_FB_VIRTUAL is not set 686# CONFIG_FB_VIRTUAL is not set
679 687
680# 688#
@@ -808,7 +816,7 @@ CONFIG_DNOTIFY=y
808# 816#
809# CD-ROM/DVD Filesystems 817# CD-ROM/DVD Filesystems
810# 818#
811CONFIG_ISO9660_FS=y 819CONFIG_ISO9660_FS=m
812CONFIG_JOLIET=y 820CONFIG_JOLIET=y
813# CONFIG_ZISOFS is not set 821# CONFIG_ZISOFS is not set
814# CONFIG_UDF_FS is not set 822# CONFIG_UDF_FS is not set
@@ -816,9 +824,9 @@ CONFIG_JOLIET=y
816# 824#
817# DOS/FAT/NT Filesystems 825# DOS/FAT/NT Filesystems
818# 826#
819CONFIG_FAT_FS=y 827CONFIG_FAT_FS=m
820CONFIG_MSDOS_FS=y 828CONFIG_MSDOS_FS=m
821CONFIG_VFAT_FS=y 829CONFIG_VFAT_FS=m
822CONFIG_FAT_DEFAULT_CODEPAGE=437 830CONFIG_FAT_DEFAULT_CODEPAGE=437
823CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 831CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
824# CONFIG_NTFS_FS is not set 832# CONFIG_NTFS_FS is not set
@@ -833,7 +841,6 @@ CONFIG_DEVFS_MOUNT=y
833# CONFIG_DEVFS_DEBUG is not set 841# CONFIG_DEVFS_DEBUG is not set
834# CONFIG_DEVPTS_FS_XATTR is not set 842# CONFIG_DEVPTS_FS_XATTR is not set
835# CONFIG_TMPFS is not set 843# CONFIG_TMPFS is not set
836# CONFIG_HUGETLBFS is not set
837# CONFIG_HUGETLB_PAGE is not set 844# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y 845CONFIG_RAMFS=y
839 846
@@ -857,13 +864,14 @@ CONFIG_RAMFS=y
857# 864#
858# Network File Systems 865# Network File Systems
859# 866#
860CONFIG_NFS_FS=y 867CONFIG_NFS_FS=m
861# CONFIG_NFS_V3 is not set 868CONFIG_NFS_V3=y
862# CONFIG_NFS_V4 is not set 869# CONFIG_NFS_V4 is not set
863# CONFIG_NFS_DIRECTIO is not set 870# CONFIG_NFS_DIRECTIO is not set
864# CONFIG_NFSD is not set 871# CONFIG_NFSD is not set
865CONFIG_LOCKD=y 872CONFIG_LOCKD=m
866CONFIG_SUNRPC=y 873CONFIG_LOCKD_V4=y
874CONFIG_SUNRPC=m
867# CONFIG_RPCSEC_GSS_KRB5 is not set 875# CONFIG_RPCSEC_GSS_KRB5 is not set
868# CONFIG_RPCSEC_GSS_SPKM3 is not set 876# CONFIG_RPCSEC_GSS_SPKM3 is not set
869# CONFIG_SMB_FS is not set 877# CONFIG_SMB_FS is not set
@@ -895,12 +903,12 @@ CONFIG_MSDOS_PARTITION=y
895# 903#
896# Native Language Support 904# Native Language Support
897# 905#
898CONFIG_NLS=y 906CONFIG_NLS=m
899CONFIG_NLS_DEFAULT="iso8859-1" 907CONFIG_NLS_DEFAULT="iso8859-1"
900CONFIG_NLS_CODEPAGE_437=y 908CONFIG_NLS_CODEPAGE_437=m
901# CONFIG_NLS_CODEPAGE_737 is not set 909# CONFIG_NLS_CODEPAGE_737 is not set
902# CONFIG_NLS_CODEPAGE_775 is not set 910# CONFIG_NLS_CODEPAGE_775 is not set
903CONFIG_NLS_CODEPAGE_850=y 911CONFIG_NLS_CODEPAGE_850=m
904# CONFIG_NLS_CODEPAGE_852 is not set 912# CONFIG_NLS_CODEPAGE_852 is not set
905# CONFIG_NLS_CODEPAGE_855 is not set 913# CONFIG_NLS_CODEPAGE_855 is not set
906# CONFIG_NLS_CODEPAGE_857 is not set 914# CONFIG_NLS_CODEPAGE_857 is not set
@@ -921,7 +929,7 @@ CONFIG_NLS_CODEPAGE_850=y
921# CONFIG_NLS_CODEPAGE_1250 is not set 929# CONFIG_NLS_CODEPAGE_1250 is not set
922# CONFIG_NLS_CODEPAGE_1251 is not set 930# CONFIG_NLS_CODEPAGE_1251 is not set
923# CONFIG_NLS_ASCII is not set 931# CONFIG_NLS_ASCII is not set
924CONFIG_NLS_ISO8859_1=y 932CONFIG_NLS_ISO8859_1=m
925# CONFIG_NLS_ISO8859_2 is not set 933# CONFIG_NLS_ISO8859_2 is not set
926# CONFIG_NLS_ISO8859_3 is not set 934# CONFIG_NLS_ISO8859_3 is not set
927# CONFIG_NLS_ISO8859_4 is not set 935# CONFIG_NLS_ISO8859_4 is not set
@@ -945,11 +953,22 @@ CONFIG_NLS_ISO8859_1=y
945# Kernel hacking 953# Kernel hacking
946# 954#
947# CONFIG_PRINTK_TIME is not set 955# CONFIG_PRINTK_TIME is not set
948# CONFIG_DEBUG_KERNEL is not set 956CONFIG_DEBUG_KERNEL=y
957# CONFIG_MAGIC_SYSRQ is not set
949CONFIG_LOG_BUF_SHIFT=14 958CONFIG_LOG_BUF_SHIFT=14
959# CONFIG_SCHEDSTATS is not set
960# CONFIG_DEBUG_SLAB is not set
961# CONFIG_DEBUG_SPINLOCK is not set
962# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
963# CONFIG_DEBUG_KOBJECT is not set
950CONFIG_DEBUG_BUGVERBOSE=y 964CONFIG_DEBUG_BUGVERBOSE=y
965# CONFIG_DEBUG_INFO is not set
966# CONFIG_DEBUG_FS is not set
951CONFIG_FRAME_POINTER=y 967CONFIG_FRAME_POINTER=y
952CONFIG_DEBUG_USER=y 968CONFIG_DEBUG_USER=y
969# CONFIG_DEBUG_WAITQ is not set
970# CONFIG_DEBUG_ERRORS is not set
971# CONFIG_DEBUG_LL is not set
953 972
954# 973#
955# Security options 974# Security options
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a931409c8fe4..7ae45c3fc834 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -36,7 +36,7 @@
36 * The present bitmask indicates that the CPU is physically present. 36 * The present bitmask indicates that the CPU is physically present.
37 * The online bitmask indicates that the CPU is up and running. 37 * The online bitmask indicates that the CPU is up and running.
38 */ 38 */
39cpumask_t cpu_present_mask; 39cpumask_t cpu_possible_map;
40cpumask_t cpu_online_map; 40cpumask_t cpu_online_map;
41 41
42/* 42/*
@@ -235,7 +235,8 @@ void __init smp_prepare_boot_cpu(void)
235{ 235{
236 unsigned int cpu = smp_processor_id(); 236 unsigned int cpu = smp_processor_id();
237 237
238 cpu_set(cpu, cpu_present_mask); 238 cpu_set(cpu, cpu_possible_map);
239 cpu_set(cpu, cpu_present_map);
239 cpu_set(cpu, cpu_online_map); 240 cpu_set(cpu, cpu_online_map);
240} 241}
241 242
@@ -355,7 +356,7 @@ void show_ipi_list(struct seq_file *p)
355 356
356 seq_puts(p, "IPI:"); 357 seq_puts(p, "IPI:");
357 358
358 for_each_online_cpu(cpu) 359 for_each_present_cpu(cpu)
359 seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count); 360 seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
360 361
361 seq_putc(p, '\n'); 362 seq_putc(p, '\n');
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index df2cb06ce424..d571c37ac30c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -248,16 +248,20 @@ static DEFINE_SPINLOCK(undef_lock);
248 248
249void register_undef_hook(struct undef_hook *hook) 249void register_undef_hook(struct undef_hook *hook)
250{ 250{
251 spin_lock_irq(&undef_lock); 251 unsigned long flags;
252
253 spin_lock_irqsave(&undef_lock, flags);
252 list_add(&hook->node, &undef_hook); 254 list_add(&hook->node, &undef_hook);
253 spin_unlock_irq(&undef_lock); 255 spin_unlock_irqrestore(&undef_lock, flags);
254} 256}
255 257
256void unregister_undef_hook(struct undef_hook *hook) 258void unregister_undef_hook(struct undef_hook *hook)
257{ 259{
258 spin_lock_irq(&undef_lock); 260 unsigned long flags;
261
262 spin_lock_irqsave(&undef_lock, flags);
259 list_del(&hook->node); 263 list_del(&hook->node);
260 spin_unlock_irq(&undef_lock); 264 spin_unlock_irqrestore(&undef_lock, flags);
261} 265}
262 266
263asmlinkage void do_undefinstr(struct pt_regs *regs) 267asmlinkage void do_undefinstr(struct pt_regs *regs)
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 4a83ab6cd565..6976e60e47cb 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,3 +1,33 @@
1#if __LINUX_ARM_ARCH__ >= 6
2 .macro bitop, instr
3 mov r2, #1
4 and r3, r0, #7 @ Get bit offset
5 add r1, r1, r0, lsr #3 @ Get byte offset
6 mov r3, r2, lsl r3
71: ldrexb r2, [r1]
8 \instr r2, r2, r3
9 strexb r0, r2, [r1]
10 cmpne r0, #0
11 bne 1b
12 mov pc, lr
13 .endm
14
15 .macro testop, instr, store
16 and r3, r0, #7 @ Get bit offset
17 mov r2, #1
18 add r1, r1, r0, lsr #3 @ Get byte offset
19 mov r3, r2, lsl r3 @ create mask
201: ldrexb r2, [r1]
21 ands r0, r2, r3 @ save old value of bit
22 \instr ip, r2, r3 @ toggle bit
23 strexb r2, ip, [r1]
24 cmp r2, #0
25 bne 1b
26 cmp r0, #0
27 movne r0, #1
282: mov pc, lr
29 .endm
30#else
1 .macro bitop, instr 31 .macro bitop, instr
2 and r2, r0, #7 32 and r2, r0, #7
3 mov r3, #1 33 mov r3, #1
@@ -31,3 +61,4 @@
31 moveq r0, #0 61 moveq r0, #0
32 mov pc, lr 62 mov pc, lr
33 .endm 63 .endm
64#endif
diff --git a/arch/arm/lib/io-shark.c b/arch/arm/lib/io-shark.c
index 108d4573e970..824253948f51 100644
--- a/arch/arm/lib/io-shark.c
+++ b/arch/arm/lib/io-shark.c
@@ -11,73 +11,3 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/kernel.h>
15
16#include <asm/io.h>
17
18void print_warning(void)
19{
20 printk(KERN_WARNING "ins?/outs? not implemented on this architecture\n");
21}
22
23void insl(unsigned int port, void *to, int len)
24{
25 print_warning();
26}
27
28void insb(unsigned int port, void *to, int len)
29{
30 print_warning();
31}
32
33void outsl(unsigned int port, const void *from, int len)
34{
35 print_warning();
36}
37
38void outsb(unsigned int port, const void *from, int len)
39{
40 print_warning();
41}
42
43/* these should be in assembler again */
44
45/*
46 * Purpose: read a block of data from a hardware register to memory.
47 * Proto : insw(int from_port, void *to, int len_in_words);
48 * Proto : inswb(int from_port, void *to, int len_in_bytes);
49 * Notes : increment to
50 */
51
52void insw(unsigned int port, void *to, int len)
53{
54 int i;
55
56 for (i = 0; i < len; i++)
57 ((unsigned short *) to)[i] = inw(port);
58}
59
60void inswb(unsigned int port, void *to, int len)
61{
62 insw(port, to, len >> 2);
63}
64
65/*
66 * Purpose: write a block of data from memory to a hardware register.
67 * Proto : outsw(int to_reg, void *from, int len_in_words);
68 * Proto : outswb(int to_reg, void *from, int len_in_bytes);
69 * Notes : increments from
70 */
71
72void outsw(unsigned int port, const void *from, int len)
73{
74 int i;
75
76 for (i = 0; i < len; i++)
77 outw(((unsigned short *) from)[i], port);
78}
79
80void outswb(unsigned int port, const void *from, int len)
81{
82 outsw(port, from, len >> 2);
83}
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
index ead15dfcb53d..2ba025777098 100644
--- a/arch/arm/mach-integrator/platsmp.c
+++ b/arch/arm/mach-integrator/platsmp.c
@@ -174,11 +174,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
174 max_cpus = ncores; 174 max_cpus = ncores;
175 175
176 /* 176 /*
177 * Initialise the present mask - this tells us which CPUs should 177 * Initialise the possible/present maps.
178 * be present. 178 * cpu_possible_map describes the set of CPUs which may be present
179 * cpu_present_map describes the set of CPUs populated
179 */ 180 */
180 for (i = 0; i < max_cpus; i++) { 181 for (i = 0; i < max_cpus; i++) {
181 cpu_set(i, cpu_present_mask); 182 cpu_set(i, cpu_possible_map);
183 cpu_set(i, cpu_present_map);
182 } 184 }
183 185
184 /* 186 /*
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index 6e98290cca5c..ec0d8285f243 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/version.h>
17 16
18#include <asm/io.h> 17#include <asm/io.h>
19#include <asm/hardware.h> 18#include <asm/hardware.h>
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index 726445895b5c..e737eae4521f 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -24,7 +24,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
24 .iobase = 0x3f8, 24 .iobase = 0x3f8,
25 .irq = 4, 25 .irq = 4,
26 .uartclk = 1843200, 26 .uartclk = 1843200,
27 .regshift = 2, 27 .regshift = 0,
28 .iotype = UPIO_PORT, 28 .iotype = UPIO_PORT,
29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
30 }, 30 },
@@ -32,7 +32,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
32 .iobase = 0x2f8, 32 .iobase = 0x2f8,
33 .irq = 3, 33 .irq = 3,
34 .uartclk = 1843200, 34 .uartclk = 1843200,
35 .regshift = 2, 35 .regshift = 0,
36 .iotype = UPIO_PORT, 36 .iotype = UPIO_PORT,
37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
38 }, 38 },
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
index a806fea5c3ed..a8efcf34888e 100644
--- a/arch/arm/nwfpe/fpmodule.c
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -24,7 +24,6 @@
24#include "fpa11.h" 24#include "fpa11.h"
25 25
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/version.h>
28#include <linux/config.h> 27#include <linux/config.h>
29 28
30/* XXX */ 29/* XXX */
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/plat-omap/ocpi.c
index 1fb16f9edfd5..2ede2ee8cae4 100644
--- a/arch/arm/plat-omap/ocpi.c
+++ b/arch/arm/plat-omap/ocpi.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/config.h> 26#include <linux/config.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/version.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 3a81e904a7b8..95e4676594e1 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -7,6 +7,7 @@
7#include "piix4.h" 7#include "piix4.h"
8 8
9void (*pm_power_off)(void); 9void (*pm_power_off)(void);
10EXPORT_SYMBOL(pm_power_off);
10 11
11void machine_restart(char * __unused) 12void machine_restart(char * __unused)
12{ 13{
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 3e439ce5e1b2..8680080a6a89 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -36,6 +36,7 @@
36 * Power off function, if any 36 * Power off function, if any
37 */ 37 */
38void (*pm_power_off)(void); 38void (*pm_power_off)(void);
39EXPORT_SYMBOL(pm_power_off);
39 40
40int voyager_level = 0; 41int voyager_level = 0;
41 42
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index 8c8527593da0..0e1f4208b07c 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -10,6 +10,7 @@
10 * the voyager hal to provide the functionality 10 * the voyager hal to provide the functionality
11 */ 11 */
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/module.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14#include <linux/kernel_stat.h> 15#include <linux/kernel_stat.h>
15#include <linux/delay.h> 16#include <linux/delay.h>
@@ -40,6 +41,7 @@ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR
40/* per CPU data structure (for /proc/cpuinfo et al), visible externally 41/* per CPU data structure (for /proc/cpuinfo et al), visible externally
41 * indexed physically */ 42 * indexed physically */
42struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; 43struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
44EXPORT_SYMBOL(cpu_data);
43 45
44/* physical ID of the CPU used to boot the system */ 46/* physical ID of the CPU used to boot the system */
45unsigned char boot_cpu_id; 47unsigned char boot_cpu_id;
@@ -72,6 +74,7 @@ static volatile unsigned long smp_invalidate_needed;
72/* Bitmask of currently online CPUs - used by setup.c for 74/* Bitmask of currently online CPUs - used by setup.c for
73 /proc/cpuinfo, visible externally but still physical */ 75 /proc/cpuinfo, visible externally but still physical */
74cpumask_t cpu_online_map = CPU_MASK_NONE; 76cpumask_t cpu_online_map = CPU_MASK_NONE;
77EXPORT_SYMBOL(cpu_online_map);
75 78
76/* Bitmask of CPUs present in the system - exported by i386_syms.c, used 79/* Bitmask of CPUs present in the system - exported by i386_syms.c, used
77 * by scheduler but indexed physically */ 80 * by scheduler but indexed physically */
@@ -238,6 +241,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
238/* This is for the new dynamic CPU boot code */ 241/* This is for the new dynamic CPU boot code */
239cpumask_t cpu_callin_map = CPU_MASK_NONE; 242cpumask_t cpu_callin_map = CPU_MASK_NONE;
240cpumask_t cpu_callout_map = CPU_MASK_NONE; 243cpumask_t cpu_callout_map = CPU_MASK_NONE;
244EXPORT_SYMBOL(cpu_callout_map);
241 245
242/* The per processor IRQ masks (these are usually kept in sync) */ 246/* The per processor IRQ masks (these are usually kept in sync) */
243static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; 247static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
@@ -978,6 +982,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned long va)
978 982
979 preempt_enable(); 983 preempt_enable();
980} 984}
985EXPORT_SYMBOL(flush_tlb_page);
981 986
982/* enable the requested IRQs */ 987/* enable the requested IRQs */
983static void 988static void
@@ -1109,6 +1114,7 @@ smp_call_function (void (*func) (void *info), void *info, int retry,
1109 1114
1110 return 0; 1115 return 0;
1111} 1116}
1117EXPORT_SYMBOL(smp_call_function);
1112 1118
1113/* Sorry about the name. In an APIC based system, the APICs 1119/* Sorry about the name. In an APIC based system, the APICs
1114 * themselves are programmed to send a timer interrupt. This is used 1120 * themselves are programmed to send a timer interrupt. This is used
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 2e08942339ad..cbb3e0cef93a 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -220,13 +220,6 @@ config IOSAPIC
220 depends on !IA64_HP_SIM 220 depends on !IA64_HP_SIM
221 default y 221 default y
222 222
223config IA64_SGI_SN_SIM
224 bool "SGI Medusa Simulator Support"
225 depends on IA64_SGI_SN2 || IA64_GENERIC
226 help
227 If you are compiling a kernel that will run under SGI's IA-64
228 simulator (Medusa) then say Y, otherwise say N.
229
230config IA64_SGI_SN_XP 223config IA64_SGI_SN_XP
231 tristate "Support communication between SGI SSIs" 224 tristate "Support communication between SGI SSIs"
232 select IA64_UNCACHED_ALLOCATOR 225 select IA64_UNCACHED_ALLOCATOR
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index c05613980300..04d0b00a2b8c 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -81,7 +81,6 @@ CONFIG_HOLES_IN_ZONE=y
81CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 81CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
82# CONFIG_IA64_CYCLONE is not set 82# CONFIG_IA64_CYCLONE is not set
83CONFIG_IOSAPIC=y 83CONFIG_IOSAPIC=y
84CONFIG_IA64_SGI_SN_SIM=y
85CONFIG_FORCE_MAX_ZONEORDER=18 84CONFIG_FORCE_MAX_ZONEORDER=18
86CONFIG_SMP=y 85CONFIG_SMP=y
87CONFIG_NR_CPUS=512 86CONFIG_NR_CPUS=512
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5c7c95737bbf..84f89da7c640 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -20,6 +20,7 @@
20 * 02/01/00 R.Seth fixed get_cpuinfo for SMP 20 * 02/01/00 R.Seth fixed get_cpuinfo for SMP
21 * 01/07/99 S.Eranian added the support for command line argument 21 * 01/07/99 S.Eranian added the support for command line argument
22 * 06/24/99 W.Drummond added boot_cpu_data. 22 * 06/24/99 W.Drummond added boot_cpu_data.
23 * 05/28/05 Z. Menyhart Dynamic stride size for "flush_icache_range()"
23 */ 24 */
24#include <linux/config.h> 25#include <linux/config.h>
25#include <linux/module.h> 26#include <linux/module.h>
@@ -85,6 +86,13 @@ EXPORT_SYMBOL(io_space);
85unsigned int num_io_spaces; 86unsigned int num_io_spaces;
86 87
87/* 88/*
89 * "flush_icache_range()" needs to know what processor dependent stride size to use
90 * when it makes i-cache(s) coherent with d-caches.
91 */
92#define I_CACHE_STRIDE_SHIFT 5 /* Safest way to go: 32 bytes by 32 bytes */
93unsigned long ia64_i_cache_stride_shift = ~0;
94
95/*
88 * The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This 96 * The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This
89 * mask specifies a mask of address bits that must be 0 in order for two buffers to be 97 * mask specifies a mask of address bits that must be 0 in order for two buffers to be
90 * mergeable by the I/O MMU (i.e., the end address of the first buffer and the start 98 * mergeable by the I/O MMU (i.e., the end address of the first buffer and the start
@@ -628,6 +636,12 @@ setup_per_cpu_areas (void)
628 /* start_kernel() requires this... */ 636 /* start_kernel() requires this... */
629} 637}
630 638
639/*
640 * Calculate the max. cache line size.
641 *
642 * In addition, the minimum of the i-cache stride sizes is calculated for
643 * "flush_icache_range()".
644 */
631static void 645static void
632get_max_cacheline_size (void) 646get_max_cacheline_size (void)
633{ 647{
@@ -641,6 +655,8 @@ get_max_cacheline_size (void)
641 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n", 655 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n",
642 __FUNCTION__, status); 656 __FUNCTION__, status);
643 max = SMP_CACHE_BYTES; 657 max = SMP_CACHE_BYTES;
658 /* Safest setup for "flush_icache_range()" */
659 ia64_i_cache_stride_shift = I_CACHE_STRIDE_SHIFT;
644 goto out; 660 goto out;
645 } 661 }
646 662
@@ -649,14 +665,31 @@ get_max_cacheline_size (void)
649 &cci); 665 &cci);
650 if (status != 0) { 666 if (status != 0) {
651 printk(KERN_ERR 667 printk(KERN_ERR
652 "%s: ia64_pal_cache_config_info(l=%lu) failed (status=%ld)\n", 668 "%s: ia64_pal_cache_config_info(l=%lu, 2) failed (status=%ld)\n",
653 __FUNCTION__, l, status); 669 __FUNCTION__, l, status);
654 max = SMP_CACHE_BYTES; 670 max = SMP_CACHE_BYTES;
671 /* The safest setup for "flush_icache_range()" */
672 cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
673 cci.pcci_unified = 1;
655 } 674 }
656 line_size = 1 << cci.pcci_line_size; 675 line_size = 1 << cci.pcci_line_size;
657 if (line_size > max) 676 if (line_size > max)
658 max = line_size; 677 max = line_size;
659 } 678 if (!cci.pcci_unified) {
679 status = ia64_pal_cache_config_info(l,
680 /* cache_type (instruction)= */ 1,
681 &cci);
682 if (status != 0) {
683 printk(KERN_ERR
684 "%s: ia64_pal_cache_config_info(l=%lu, 1) failed (status=%ld)\n",
685 __FUNCTION__, l, status);
686 /* The safest setup for "flush_icache_range()" */
687 cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
688 }
689 }
690 if (cci.pcci_stride < ia64_i_cache_stride_shift)
691 ia64_i_cache_stride_shift = cci.pcci_stride;
692 }
660 out: 693 out:
661 if (max > ia64_max_cacheline_size) 694 if (max > ia64_max_cacheline_size)
662 ia64_max_cacheline_size = max; 695 ia64_max_cacheline_size = max;
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index d8030f3bd865..92ff46ad21e2 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -36,12 +36,14 @@ int arch_register_cpu(int num)
36 parent = &sysfs_nodes[cpu_to_node(num)]; 36 parent = &sysfs_nodes[cpu_to_node(num)];
37#endif /* CONFIG_NUMA */ 37#endif /* CONFIG_NUMA */
38 38
39#ifdef CONFIG_ACPI_BOOT
39 /* 40 /*
40 * If CPEI cannot be re-targetted, and this is 41 * If CPEI cannot be re-targetted, and this is
41 * CPEI target, then dont create the control file 42 * CPEI target, then dont create the control file
42 */ 43 */
43 if (!can_cpei_retarget() && is_cpu_cpei_target(num)) 44 if (!can_cpei_retarget() && is_cpu_cpei_target(num))
44 sysfs_cpus[num].cpu.no_control = 1; 45 sysfs_cpus[num].cpu.no_control = 1;
46#endif
45 47
46 return register_cpu(&sysfs_cpus[num].cpu, num, parent); 48 return register_cpu(&sysfs_cpus[num].cpu, num, parent);
47} 49}
diff --git a/arch/ia64/lib/flush.S b/arch/ia64/lib/flush.S
index a1af9146cfdb..3e2cfa2c6d39 100644
--- a/arch/ia64/lib/flush.S
+++ b/arch/ia64/lib/flush.S
@@ -3,37 +3,59 @@
3 * 3 *
4 * Copyright (C) 1999-2001, 2005 Hewlett-Packard Co 4 * Copyright (C) 1999-2001, 2005 Hewlett-Packard Co
5 * David Mosberger-Tang <davidm@hpl.hp.com> 5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 *
7 * 05/28/05 Zoltan Menyhart Dynamic stride size
6 */ 8 */
9
7#include <asm/asmmacro.h> 10#include <asm/asmmacro.h>
8#include <asm/page.h> 11
9 12
10 /* 13 /*
11 * flush_icache_range(start,end) 14 * flush_icache_range(start,end)
12 * Must flush range from start to end-1 but nothing else (need to 15 *
16 * Make i-cache(s) coherent with d-caches.
17 *
18 * Must deal with range from start to end-1 but nothing else (need to
13 * be careful not to touch addresses that may be unmapped). 19 * be careful not to touch addresses that may be unmapped).
20 *
21 * Note: "in0" and "in1" are preserved for debugging purposes.
14 */ 22 */
15GLOBAL_ENTRY(flush_icache_range) 23GLOBAL_ENTRY(flush_icache_range)
24
16 .prologue 25 .prologue
17 alloc r2=ar.pfs,2,0,0,0 26 alloc r2=ar.pfs,2,0,0,0
18 sub r8=in1,in0,1 27 movl r3=ia64_i_cache_stride_shift
28 mov r21=1
29 ;;
30 ld8 r20=[r3] // r20: stride shift
31 sub r22=in1,r0,1 // last byte address
19 ;; 32 ;;
20 shr.u r8=r8,5 // we flush 32 bytes per iteration 33 shr.u r23=in0,r20 // start / (stride size)
21 .save ar.lc, r3 34 shr.u r22=r22,r20 // (last byte address) / (stride size)
22 mov r3=ar.lc // save ar.lc 35 shl r21=r21,r20 // r21: stride size of the i-cache(s)
36 ;;
37 sub r8=r22,r23 // number of strides - 1
38 shl r24=r23,r20 // r24: addresses for "fc.i" =
39 // "start" rounded down to stride boundary
40 .save ar.lc,r3
41 mov r3=ar.lc // save ar.lc
23 ;; 42 ;;
24 43
25 .body 44 .body
26 45 mov ar.lc=r8
27 mov ar.lc=r8
28 ;; 46 ;;
29.Loop: fc.i in0 // issuable on M2 only 47 /*
30 add in0=32,in0 48 * 32 byte aligned loop, even number of (actually 2) bundles
49 */
50.Loop: fc.i r24 // issuable on M0 only
51 add r24=r21,r24 // we flush "stride size" bytes per iteration
52 nop.i 0
31 br.cloop.sptk.few .Loop 53 br.cloop.sptk.few .Loop
32 ;; 54 ;;
33 sync.i 55 sync.i
34 ;; 56 ;;
35 srlz.i 57 srlz.i
36 ;; 58 ;;
37 mov ar.lc=r3 // restore ar.lc 59 mov ar.lc=r3 // restore ar.lc
38 br.ret.sptk.many rp 60 br.ret.sptk.many rp
39END(flush_icache_range) 61END(flush_icache_range)
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 720a861f88be..54d9ed444e4a 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -157,6 +157,7 @@ alloc_pci_controller (int seg)
157 157
158 memset(controller, 0, sizeof(*controller)); 158 memset(controller, 0, sizeof(*controller));
159 controller->segment = seg; 159 controller->segment = seg;
160 controller->node = -1;
160 return controller; 161 return controller;
161} 162}
162 163
@@ -288,6 +289,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
288 unsigned int windows = 0; 289 unsigned int windows = 0;
289 struct pci_bus *pbus; 290 struct pci_bus *pbus;
290 char *name; 291 char *name;
292 int pxm;
291 293
292 controller = alloc_pci_controller(domain); 294 controller = alloc_pci_controller(domain);
293 if (!controller) 295 if (!controller)
@@ -295,10 +297,16 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
295 297
296 controller->acpi_handle = device->handle; 298 controller->acpi_handle = device->handle;
297 299
300 pxm = acpi_get_pxm(controller->acpi_handle);
301#ifdef CONFIG_NUMA
302 if (pxm >= 0)
303 controller->node = pxm_to_nid_map[pxm];
304#endif
305
298 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, 306 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
299 &windows); 307 &windows);
300 controller->window = kmalloc(sizeof(*controller->window) * windows, 308 controller->window = kmalloc_node(sizeof(*controller->window) * windows,
301 GFP_KERNEL); 309 GFP_KERNEL, controller->node);
302 if (!controller->window) 310 if (!controller->window)
303 goto out2; 311 goto out2;
304 312
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index a67f39e448cb..a6649baf629a 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -61,7 +61,7 @@ sn_default_pci_unmap(struct pci_dev *pdev, dma_addr_t addr, int direction)
61} 61}
62 62
63static void * 63static void *
64sn_default_pci_bus_fixup(struct pcibus_bussoft *soft) 64sn_default_pci_bus_fixup(struct pcibus_bussoft *soft, struct pci_controller *controller)
65{ 65{
66 return NULL; 66 return NULL;
67} 67}
@@ -362,7 +362,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
362 362
363 provider_soft = NULL; 363 provider_soft = NULL;
364 if (provider->bus_fixup) 364 if (provider->bus_fixup)
365 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr); 365 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller);
366 366
367 if (provider_soft == NULL) 367 if (provider_soft == NULL)
368 return; /* fixup failed or not applicable */ 368 return; /* fixup failed or not applicable */
@@ -380,6 +380,22 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
380 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info = 380 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info =
381 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]); 381 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]);
382 382
383 /*
384 * If the node information we obtained during the fixup phase is invalid
385 * then set controller->node to -1 (undetermined)
386 */
387 if (controller->node >= num_online_nodes()) {
388 struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus);
389
390 printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%lu"
391 "L_IO=%lx L_MEM=%lx BASE=%lx\n",
392 b->bs_asic_type, b->bs_xid, b->bs_persist_busnum,
393 b->bs_legacy_io, b->bs_legacy_mem, b->bs_base);
394 printk(KERN_WARNING "on node %d but only %d nodes online."
395 "Association set to undetermined.\n",
396 controller->node, num_online_nodes());
397 controller->node = -1;
398 }
383 return; 399 return;
384 400
385error_return: 401error_return:
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index 6d02dac8056f..94698bea7be0 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -72,7 +72,7 @@ xpc_initialize_channels(struct xpc_partition *part, partid_t partid)
72enum xpc_retval 72enum xpc_retval
73xpc_setup_infrastructure(struct xpc_partition *part) 73xpc_setup_infrastructure(struct xpc_partition *part)
74{ 74{
75 int ret; 75 int ret, cpuid;
76 struct timer_list *timer; 76 struct timer_list *timer;
77 partid_t partid = XPC_PARTID(part); 77 partid_t partid = XPC_PARTID(part);
78 78
@@ -223,9 +223,9 @@ xpc_setup_infrastructure(struct xpc_partition *part)
223 xpc_vars_part[partid].openclose_args_pa = 223 xpc_vars_part[partid].openclose_args_pa =
224 __pa(part->local_openclose_args); 224 __pa(part->local_openclose_args);
225 xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va); 225 xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va);
226 xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(smp_processor_id()); 226 cpuid = raw_smp_processor_id(); /* any CPU in this partition will do */
227 xpc_vars_part[partid].IPI_phys_cpuid = 227 xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(cpuid);
228 cpu_physical_id(smp_processor_id()); 228 xpc_vars_part[partid].IPI_phys_cpuid = cpu_physical_id(cpuid);
229 xpc_vars_part[partid].nchannels = part->nchannels; 229 xpc_vars_part[partid].nchannels = part->nchannels;
230 xpc_vars_part[partid].magic = XPC_VP_MAGIC1; 230 xpc_vars_part[partid].magic = XPC_VP_MAGIC1;
231 231
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index a2f7a88aefbb..0e4b9ad9ef02 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -79,6 +79,7 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
79{ 79{
80 void *cpuaddr; 80 void *cpuaddr;
81 unsigned long phys_addr; 81 unsigned long phys_addr;
82 int node;
82 struct pci_dev *pdev = to_pci_dev(dev); 83 struct pci_dev *pdev = to_pci_dev(dev);
83 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 84 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
84 85
@@ -86,10 +87,19 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
86 87
87 /* 88 /*
88 * Allocate the memory. 89 * Allocate the memory.
89 * FIXME: We should be doing alloc_pages_node for the node closest
90 * to the PCI device.
91 */ 90 */
92 if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)))) 91 node = pcibus_to_node(pdev->bus);
92 if (likely(node >=0)) {
93 struct page *p = alloc_pages_node(node, GFP_ATOMIC, get_order(size));
94
95 if (likely(p))
96 cpuaddr = page_address(p);
97 else
98 return NULL;
99 } else
100 cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size));
101
102 if (unlikely(!cpuaddr))
93 return NULL; 103 return NULL;
94 104
95 memset(cpuaddr, 0x0, size); 105 memset(cpuaddr, 0x0, size);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 9813da56d311..b95e928636a1 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -85,7 +85,7 @@ pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *regs)
85} 85}
86 86
87void * 87void *
88pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft) 88pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
89{ 89{
90 int nasid, cnode, j; 90 int nasid, cnode, j;
91 struct hubdev_info *hubdev_info; 91 struct hubdev_info *hubdev_info;
@@ -158,6 +158,14 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
158 memset(soft->pbi_int_ate_resource.ate, 0, 158 memset(soft->pbi_int_ate_resource.ate, 0,
159 (soft->pbi_int_ate_size * sizeof(uint64_t))); 159 (soft->pbi_int_ate_size * sizeof(uint64_t)));
160 160
161 if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP)
162 /*
163 * TIO PCI Bridge with no closest node information.
164 * FIXME: Find another way to determine the closest node
165 */
166 controller->node = -1;
167 else
168 controller->node = cnode;
161 return soft; 169 return soft;
162} 170}
163 171
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 51cc4e63092c..5d76a7581465 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -581,7 +581,7 @@ tioca_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
581 * the caller. 581 * the caller.
582 */ 582 */
583static void * 583static void *
584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft) 584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
585{ 585{
586 struct tioca_common *tioca_common; 586 struct tioca_common *tioca_common;
587 struct tioca_kernel *tioca_kern; 587 struct tioca_kernel *tioca_kern;
@@ -646,6 +646,8 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
646 __FUNCTION__, SGI_TIOCA_ERROR, 646 __FUNCTION__, SGI_TIOCA_ERROR,
647 (int)tioca_common->ca_common.bs_persist_busnum); 647 (int)tioca_common->ca_common.bs_persist_busnum);
648 648
649 /* Setup locality information */
650 controller->node = tioca_kern->ca_closest_node;
649 return tioca_common; 651 return tioca_common;
650} 652}
651 653
diff --git a/arch/ppc/boot/images/Makefile b/arch/ppc/boot/images/Makefile
index c9ac5f5fa9e4..532e7ef1edb6 100644
--- a/arch/ppc/boot/images/Makefile
+++ b/arch/ppc/boot/images/Makefile
@@ -6,12 +6,17 @@ MKIMAGE := $(srctree)/scripts/mkuboot.sh
6 6
7extra-y := vmlinux.bin vmlinux.gz 7extra-y := vmlinux.bin vmlinux.gz
8 8
9# two make processes may write to vmlinux.gz at the same time with make -j
10quiet_cmd_mygzip = GZIP $@
11cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
12
13
9OBJCOPYFLAGS_vmlinux.bin := -O binary 14OBJCOPYFLAGS_vmlinux.bin := -O binary
10$(obj)/vmlinux.bin: vmlinux FORCE 15$(obj)/vmlinux.bin: vmlinux FORCE
11 $(call if_changed,objcopy) 16 $(call if_changed,objcopy)
12 17
13$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE 18$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
14 $(call if_changed,gzip) 19 $(call if_changed,mygzip)
15 20
16quiet_cmd_uimage = UIMAGE $@ 21quiet_cmd_uimage = UIMAGE $@
17 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \ 22 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
diff --git a/arch/ppc64/kernel/cpu_setup_power4.S b/arch/ppc64/kernel/cpu_setup_power4.S
index 42fc08cf87a0..0482c063c26e 100644
--- a/arch/ppc64/kernel/cpu_setup_power4.S
+++ b/arch/ppc64/kernel/cpu_setup_power4.S
@@ -31,10 +31,13 @@ _GLOBAL(__970_cpu_preinit)
31 */ 31 */
32 mfspr r0,SPRN_PVR 32 mfspr r0,SPRN_PVR
33 srwi r0,r0,16 33 srwi r0,r0,16
34 cmpwi cr0,r0,0x39 34 cmpwi r0,0x39
35 cmpwi cr1,r0,0x3c 35 beq 1f
36 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 36 cmpwi r0,0x3c
37 beq 1f
38 cmpwi r0,0x44
37 bnelr 39 bnelr
401:
38 41
39 /* Make sure HID4:rm_ci is off before MMU is turned off, that large 42 /* Make sure HID4:rm_ci is off before MMU is turned off, that large
40 * pages are enabled with HID4:61 and clear HID5:DCBZ_size and 43 * pages are enabled with HID4:61 and clear HID5:DCBZ_size and
@@ -133,12 +136,14 @@ _GLOBAL(__save_cpu_setup)
133 /* We only deal with 970 for now */ 136 /* We only deal with 970 for now */
134 mfspr r0,SPRN_PVR 137 mfspr r0,SPRN_PVR
135 srwi r0,r0,16 138 srwi r0,r0,16
136 cmpwi cr0,r0,0x39 139 cmpwi r0,0x39
137 cmpwi cr1,r0,0x3c 140 beq 1f
138 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 141 cmpwi r0,0x3c
139 bne 1f 142 beq 1f
140 143 cmpwi r0,0x44
141 /* Save HID0,1,4 and 5 */ 144 bne 2f
145
1461: /* Save HID0,1,4 and 5 */
142 mfspr r3,SPRN_HID0 147 mfspr r3,SPRN_HID0
143 std r3,CS_HID0(r5) 148 std r3,CS_HID0(r5)
144 mfspr r3,SPRN_HID1 149 mfspr r3,SPRN_HID1
@@ -148,7 +153,7 @@ _GLOBAL(__save_cpu_setup)
148 mfspr r3,SPRN_HID5 153 mfspr r3,SPRN_HID5
149 std r3,CS_HID5(r5) 154 std r3,CS_HID5(r5)
150 155
1511: 1562:
152 mtcr r7 157 mtcr r7
153 blr 158 blr
154 159
@@ -165,12 +170,14 @@ _GLOBAL(__restore_cpu_setup)
165 /* We only deal with 970 for now */ 170 /* We only deal with 970 for now */
166 mfspr r0,SPRN_PVR 171 mfspr r0,SPRN_PVR
167 srwi r0,r0,16 172 srwi r0,r0,16
168 cmpwi cr0,r0,0x39 173 cmpwi r0,0x39
169 cmpwi cr1,r0,0x3c 174 beq 1f
170 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 175 cmpwi r0,0x3c
171 bne 1f 176 beq 1f
177 cmpwi r0,0x44
178 bnelr
172 179
173 /* Before accessing memory, we make sure rm_ci is clear */ 1801: /* Before accessing memory, we make sure rm_ci is clear */
174 li r0,0 181 li r0,0
175 mfspr r3,SPRN_HID4 182 mfspr r3,SPRN_HID4
176 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */ 183 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
@@ -223,6 +230,5 @@ _GLOBAL(__restore_cpu_setup)
223 mtspr SPRN_HID5,r3 230 mtspr SPRN_HID5,r3
224 sync 231 sync
225 isync 232 isync
2261:
227 blr 233 blr
228 234
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
index 8d4c46f6f0b6..77cec42f9525 100644
--- a/arch/ppc64/kernel/cputable.c
+++ b/arch/ppc64/kernel/cputable.c
@@ -183,6 +183,21 @@ struct cpu_spec cpu_specs[] = {
183 .cpu_setup = __setup_cpu_ppc970, 183 .cpu_setup = __setup_cpu_ppc970,
184 .firmware_features = COMMON_PPC64_FW, 184 .firmware_features = COMMON_PPC64_FW,
185 }, 185 },
186 { /* PPC970MP */
187 .pvr_mask = 0xffff0000,
188 .pvr_value = 0x00440000,
189 .cpu_name = "PPC970MP",
190 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
191 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
192 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
193 CPU_FTR_CAN_NAP | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
194 .cpu_user_features = COMMON_USER_PPC64 |
195 PPC_FEATURE_HAS_ALTIVEC_COMP,
196 .icache_bsize = 128,
197 .dcache_bsize = 128,
198 .cpu_setup = __setup_cpu_ppc970,
199 .firmware_features = COMMON_PPC64_FW,
200 },
186 { /* Power5 */ 201 { /* Power5 */
187 .pvr_mask = 0xffff0000, 202 .pvr_mask = 0xffff0000,
188 .pvr_value = 0x003a0000, 203 .pvr_value = 0x003a0000,
diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
index aa9e8fdd1a4f..b0250ae4a72a 100644
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/ppc64/kernel/iSeries_htab.c
@@ -38,11 +38,12 @@ static inline void iSeries_hunlock(unsigned long slot)
38} 38}
39 39
40static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va, 40static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
41 unsigned long prpn, int secondary, 41 unsigned long prpn, unsigned long vflags,
42 unsigned long hpteflags, int bolted, int large) 42 unsigned long rflags)
43{ 43{
44 long slot; 44 long slot;
45 HPTE lhpte; 45 hpte_t lhpte;
46 int secondary = 0;
46 47
47 /* 48 /*
48 * The hypervisor tries both primary and secondary. 49 * The hypervisor tries both primary and secondary.
@@ -50,13 +51,13 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
50 * it means we have already tried both primary and secondary, 51 * it means we have already tried both primary and secondary,
51 * so we return failure immediately. 52 * so we return failure immediately.
52 */ 53 */
53 if (secondary) 54 if (vflags & HPTE_V_SECONDARY)
54 return -1; 55 return -1;
55 56
56 iSeries_hlock(hpte_group); 57 iSeries_hlock(hpte_group);
57 58
58 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT); 59 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
59 BUG_ON(lhpte.dw0.dw0.v); 60 BUG_ON(lhpte.v & HPTE_V_VALID);
60 61
61 if (slot == -1) { /* No available entry found in either group */ 62 if (slot == -1) { /* No available entry found in either group */
62 iSeries_hunlock(hpte_group); 63 iSeries_hunlock(hpte_group);
@@ -64,19 +65,13 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
64 } 65 }
65 66
66 if (slot < 0) { /* MSB set means secondary group */ 67 if (slot < 0) { /* MSB set means secondary group */
68 vflags |= HPTE_V_VALID;
67 secondary = 1; 69 secondary = 1;
68 slot &= 0x7fffffffffffffff; 70 slot &= 0x7fffffffffffffff;
69 } 71 }
70 72
71 lhpte.dw1.dword1 = 0; 73 lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
72 lhpte.dw1.dw1.rpn = physRpn_to_absRpn(prpn); 74 lhpte.r = (physRpn_to_absRpn(prpn) << HPTE_R_RPN_SHIFT) | rflags;
73 lhpte.dw1.flags.flags = hpteflags;
74
75 lhpte.dw0.dword0 = 0;
76 lhpte.dw0.dw0.avpn = va >> 23;
77 lhpte.dw0.dw0.h = secondary;
78 lhpte.dw0.dw0.bolted = bolted;
79 lhpte.dw0.dw0.v = 1;
80 75
81 /* Now fill in the actual HPTE */ 76 /* Now fill in the actual HPTE */
82 HvCallHpt_addValidate(slot, secondary, &lhpte); 77 HvCallHpt_addValidate(slot, secondary, &lhpte);
@@ -88,20 +83,17 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
88 83
89static unsigned long iSeries_hpte_getword0(unsigned long slot) 84static unsigned long iSeries_hpte_getword0(unsigned long slot)
90{ 85{
91 unsigned long dword0; 86 hpte_t hpte;
92 HPTE hpte;
93 87
94 HvCallHpt_get(&hpte, slot); 88 HvCallHpt_get(&hpte, slot);
95 dword0 = hpte.dw0.dword0; 89 return hpte.v;
96
97 return dword0;
98} 90}
99 91
100static long iSeries_hpte_remove(unsigned long hpte_group) 92static long iSeries_hpte_remove(unsigned long hpte_group)
101{ 93{
102 unsigned long slot_offset; 94 unsigned long slot_offset;
103 int i; 95 int i;
104 HPTE lhpte; 96 unsigned long hpte_v;
105 97
106 /* Pick a random slot to start at */ 98 /* Pick a random slot to start at */
107 slot_offset = mftb() & 0x7; 99 slot_offset = mftb() & 0x7;
@@ -109,10 +101,9 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
109 iSeries_hlock(hpte_group); 101 iSeries_hlock(hpte_group);
110 102
111 for (i = 0; i < HPTES_PER_GROUP; i++) { 103 for (i = 0; i < HPTES_PER_GROUP; i++) {
112 lhpte.dw0.dword0 = 104 hpte_v = iSeries_hpte_getword0(hpte_group + slot_offset);
113 iSeries_hpte_getword0(hpte_group + slot_offset);
114 105
115 if (!lhpte.dw0.dw0.bolted) { 106 if (! (hpte_v & HPTE_V_BOLTED)) {
116 HvCallHpt_invalidateSetSwBitsGet(hpte_group + 107 HvCallHpt_invalidateSetSwBitsGet(hpte_group +
117 slot_offset, 0, 0); 108 slot_offset, 0, 0);
118 iSeries_hunlock(hpte_group); 109 iSeries_hunlock(hpte_group);
@@ -137,13 +128,13 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
137static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 128static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
138 unsigned long va, int large, int local) 129 unsigned long va, int large, int local)
139{ 130{
140 HPTE hpte; 131 hpte_t hpte;
141 unsigned long avpn = va >> 23; 132 unsigned long avpn = va >> 23;
142 133
143 iSeries_hlock(slot); 134 iSeries_hlock(slot);
144 135
145 HvCallHpt_get(&hpte, slot); 136 HvCallHpt_get(&hpte, slot);
146 if ((hpte.dw0.dw0.avpn == avpn) && (hpte.dw0.dw0.v)) { 137 if ((HPTE_V_AVPN_VAL(hpte.v) == avpn) && (hpte.v & HPTE_V_VALID)) {
147 /* 138 /*
148 * Hypervisor expects bits as NPPP, which is 139 * Hypervisor expects bits as NPPP, which is
149 * different from how they are mapped in our PP. 140 * different from how they are mapped in our PP.
@@ -167,7 +158,7 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
167 */ 158 */
168static long iSeries_hpte_find(unsigned long vpn) 159static long iSeries_hpte_find(unsigned long vpn)
169{ 160{
170 HPTE hpte; 161 hpte_t hpte;
171 long slot; 162 long slot;
172 163
173 /* 164 /*
@@ -177,7 +168,7 @@ static long iSeries_hpte_find(unsigned long vpn)
177 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x 168 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x
178 */ 169 */
179 slot = HvCallHpt_findValid(&hpte, vpn); 170 slot = HvCallHpt_findValid(&hpte, vpn);
180 if (hpte.dw0.dw0.v) { 171 if (hpte.v & HPTE_V_VALID) {
181 if (slot < 0) { 172 if (slot < 0) {
182 slot &= 0x7fffffffffffffff; 173 slot &= 0x7fffffffffffffff;
183 slot = -slot; 174 slot = -slot;
@@ -212,7 +203,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
212static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va, 203static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
213 int large, int local) 204 int large, int local)
214{ 205{
215 HPTE lhpte; 206 unsigned long hpte_v;
216 unsigned long avpn = va >> 23; 207 unsigned long avpn = va >> 23;
217 unsigned long flags; 208 unsigned long flags;
218 209
@@ -220,9 +211,9 @@ static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
220 211
221 iSeries_hlock(slot); 212 iSeries_hlock(slot);
222 213
223 lhpte.dw0.dword0 = iSeries_hpte_getword0(slot); 214 hpte_v = iSeries_hpte_getword0(slot);
224 215
225 if ((lhpte.dw0.dw0.avpn == avpn) && lhpte.dw0.dw0.v) 216 if ((HPTE_V_AVPN_VAL(hpte_v) == avpn) && (hpte_v & HPTE_V_VALID))
226 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0); 217 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);
227 218
228 iSeries_hunlock(slot); 219 iSeries_hunlock(slot);
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 077c82fc9f3a..a649edbb23b6 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -503,7 +503,7 @@ static void __init build_iSeries_Memory_Map(void)
503 503
504 /* Fill in the hashed page table hash mask */ 504 /* Fill in the hashed page table hash mask */
505 num_ptegs = hptSizePages * 505 num_ptegs = hptSizePages *
506 (PAGE_SIZE / (sizeof(HPTE) * HPTES_PER_GROUP)); 506 (PAGE_SIZE / (sizeof(hpte_t) * HPTES_PER_GROUP));
507 htab_hash_mask = num_ptegs - 1; 507 htab_hash_mask = num_ptegs - 1;
508 508
509 /* 509 /*
@@ -618,25 +618,23 @@ static void __init setup_iSeries_cache_sizes(void)
618static void iSeries_make_pte(unsigned long va, unsigned long pa, 618static void iSeries_make_pte(unsigned long va, unsigned long pa,
619 int mode) 619 int mode)
620{ 620{
621 HPTE local_hpte, rhpte; 621 hpte_t local_hpte, rhpte;
622 unsigned long hash, vpn; 622 unsigned long hash, vpn;
623 long slot; 623 long slot;
624 624
625 vpn = va >> PAGE_SHIFT; 625 vpn = va >> PAGE_SHIFT;
626 hash = hpt_hash(vpn, 0); 626 hash = hpt_hash(vpn, 0);
627 627
628 local_hpte.dw1.dword1 = pa | mode; 628 local_hpte.r = pa | mode;
629 local_hpte.dw0.dword0 = 0; 629 local_hpte.v = ((va >> 23) << HPTE_V_AVPN_SHIFT)
630 local_hpte.dw0.dw0.avpn = va >> 23; 630 | HPTE_V_BOLTED | HPTE_V_VALID;
631 local_hpte.dw0.dw0.bolted = 1; /* bolted */
632 local_hpte.dw0.dw0.v = 1;
633 631
634 slot = HvCallHpt_findValid(&rhpte, vpn); 632 slot = HvCallHpt_findValid(&rhpte, vpn);
635 if (slot < 0) { 633 if (slot < 0) {
636 /* Must find space in primary group */ 634 /* Must find space in primary group */
637 panic("hash_page: hpte already exists\n"); 635 panic("hash_page: hpte already exists\n");
638 } 636 }
639 HvCallHpt_addValidate(slot, 0, (HPTE *)&local_hpte ); 637 HvCallHpt_addValidate(slot, 0, &local_hpte);
640} 638}
641 639
642/* 640/*
@@ -646,7 +644,7 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
646{ 644{
647 unsigned long pa; 645 unsigned long pa;
648 unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX; 646 unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
649 HPTE hpte; 647 hpte_t hpte;
650 648
651 for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) { 649 for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) {
652 unsigned long ea = (unsigned long)__va(pa); 650 unsigned long ea = (unsigned long)__va(pa);
@@ -659,7 +657,7 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
659 if (!in_kernel_text(ea)) 657 if (!in_kernel_text(ea))
660 mode_rw |= HW_NO_EXEC; 658 mode_rw |= HW_NO_EXEC;
661 659
662 if (hpte.dw0.dw0.v) { 660 if (hpte.v & HPTE_V_VALID) {
663 /* HPTE exists, so just bolt it */ 661 /* HPTE exists, so just bolt it */
664 HvCallHpt_setSwBits(slot, 0x10, 0); 662 HvCallHpt_setSwBits(slot, 0x10, 0);
665 /* And make sure the pp bits are correct */ 663 /* And make sure the pp bits are correct */
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
index 6534812db437..74dd144dcce8 100644
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/ppc64/kernel/pSeries_lpar.c
@@ -277,31 +277,20 @@ void vpa_init(int cpu)
277 277
278long pSeries_lpar_hpte_insert(unsigned long hpte_group, 278long pSeries_lpar_hpte_insert(unsigned long hpte_group,
279 unsigned long va, unsigned long prpn, 279 unsigned long va, unsigned long prpn,
280 int secondary, unsigned long hpteflags, 280 unsigned long vflags, unsigned long rflags)
281 int bolted, int large)
282{ 281{
283 unsigned long arpn = physRpn_to_absRpn(prpn); 282 unsigned long arpn = physRpn_to_absRpn(prpn);
284 unsigned long lpar_rc; 283 unsigned long lpar_rc;
285 unsigned long flags; 284 unsigned long flags;
286 unsigned long slot; 285 unsigned long slot;
287 HPTE lhpte; 286 unsigned long hpte_v, hpte_r;
288 unsigned long dummy0, dummy1; 287 unsigned long dummy0, dummy1;
289 288
290 /* Fill in the local HPTE with absolute rpn, avpn and flags */ 289 hpte_v = ((va >> 23) << HPTE_V_AVPN_SHIFT) | vflags | HPTE_V_VALID;
291 lhpte.dw1.dword1 = 0; 290 if (vflags & HPTE_V_LARGE)
292 lhpte.dw1.dw1.rpn = arpn; 291 hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT);
293 lhpte.dw1.flags.flags = hpteflags;
294 292
295 lhpte.dw0.dword0 = 0; 293 hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
296 lhpte.dw0.dw0.avpn = va >> 23;
297 lhpte.dw0.dw0.h = secondary;
298 lhpte.dw0.dw0.bolted = bolted;
299 lhpte.dw0.dw0.v = 1;
300
301 if (large) {
302 lhpte.dw0.dw0.l = 1;
303 lhpte.dw0.dw0.avpn &= ~0x1UL;
304 }
305 294
306 /* Now fill in the actual HPTE */ 295 /* Now fill in the actual HPTE */
307 /* Set CEC cookie to 0 */ 296 /* Set CEC cookie to 0 */
@@ -312,11 +301,11 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
312 flags = 0; 301 flags = 0;
313 302
314 /* XXX why is this here? - Anton */ 303 /* XXX why is this here? - Anton */
315 if (hpteflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) 304 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
316 lhpte.dw1.flags.flags &= ~_PAGE_COHERENT; 305 hpte_r &= ~_PAGE_COHERENT;
317 306
318 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, lhpte.dw0.dword0, 307 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
319 lhpte.dw1.dword1, &slot, &dummy0, &dummy1); 308 hpte_r, &slot, &dummy0, &dummy1);
320 309
321 if (unlikely(lpar_rc == H_PTEG_Full)) 310 if (unlikely(lpar_rc == H_PTEG_Full))
322 return -1; 311 return -1;
@@ -332,7 +321,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
332 /* Because of iSeries, we have to pass down the secondary 321 /* Because of iSeries, we have to pass down the secondary
333 * bucket bit here as well 322 * bucket bit here as well
334 */ 323 */
335 return (slot & 7) | (secondary << 3); 324 return (slot & 7) | (!!(vflags & HPTE_V_SECONDARY) << 3);
336} 325}
337 326
338static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock); 327static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock);
@@ -427,22 +416,18 @@ static long pSeries_lpar_hpte_find(unsigned long vpn)
427 unsigned long hash; 416 unsigned long hash;
428 unsigned long i, j; 417 unsigned long i, j;
429 long slot; 418 long slot;
430 union { 419 unsigned long hpte_v;
431 unsigned long dword0;
432 Hpte_dword0 dw0;
433 } hpte_dw0;
434 Hpte_dword0 dw0;
435 420
436 hash = hpt_hash(vpn, 0); 421 hash = hpt_hash(vpn, 0);
437 422
438 for (j = 0; j < 2; j++) { 423 for (j = 0; j < 2; j++) {
439 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 424 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
440 for (i = 0; i < HPTES_PER_GROUP; i++) { 425 for (i = 0; i < HPTES_PER_GROUP; i++) {
441 hpte_dw0.dword0 = pSeries_lpar_hpte_getword0(slot); 426 hpte_v = pSeries_lpar_hpte_getword0(slot);
442 dw0 = hpte_dw0.dw0;
443 427
444 if ((dw0.avpn == (vpn >> 11)) && dw0.v && 428 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11))
445 (dw0.h == j)) { 429 && (hpte_v & HPTE_V_VALID)
430 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) {
446 /* HPTE matches */ 431 /* HPTE matches */
447 if (j) 432 if (j)
448 slot = -slot; 433 slot = -slot;
diff --git a/arch/ppc64/mm/hash_low.S b/arch/ppc64/mm/hash_low.S
index c23d46956dd9..fbff24827ae7 100644
--- a/arch/ppc64/mm/hash_low.S
+++ b/arch/ppc64/mm/hash_low.S
@@ -170,9 +170,7 @@ htab_insert_pte:
170 /* Call ppc_md.hpte_insert */ 170 /* Call ppc_md.hpte_insert */
171 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 171 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */
172 mr r4,r29 /* Retreive va */ 172 mr r4,r29 /* Retreive va */
173 li r6,0 /* primary slot */ 173 li r6,0 /* no vflags */
174 li r8,0 /* not bolted and not large */
175 li r9,0
176_GLOBAL(htab_call_hpte_insert1) 174_GLOBAL(htab_call_hpte_insert1)
177 bl . /* Will be patched by htab_finish_init() */ 175 bl . /* Will be patched by htab_finish_init() */
178 cmpdi 0,r3,0 176 cmpdi 0,r3,0
@@ -192,9 +190,7 @@ _GLOBAL(htab_call_hpte_insert1)
192 /* Call ppc_md.hpte_insert */ 190 /* Call ppc_md.hpte_insert */
193 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 191 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */
194 mr r4,r29 /* Retreive va */ 192 mr r4,r29 /* Retreive va */
195 li r6,1 /* secondary slot */ 193 li r6,HPTE_V_SECONDARY@l /* secondary slot */
196 li r8,0 /* not bolted and not large */
197 li r9,0
198_GLOBAL(htab_call_hpte_insert2) 194_GLOBAL(htab_call_hpte_insert2)
199 bl . /* Will be patched by htab_finish_init() */ 195 bl . /* Will be patched by htab_finish_init() */
200 cmpdi 0,r3,0 196 cmpdi 0,r3,0
diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c
index 4fec05817d66..a6abd3a979bf 100644
--- a/arch/ppc64/mm/hash_native.c
+++ b/arch/ppc64/mm/hash_native.c
@@ -27,9 +27,9 @@
27 27
28static DEFINE_SPINLOCK(native_tlbie_lock); 28static DEFINE_SPINLOCK(native_tlbie_lock);
29 29
30static inline void native_lock_hpte(HPTE *hptep) 30static inline void native_lock_hpte(hpte_t *hptep)
31{ 31{
32 unsigned long *word = &hptep->dw0.dword0; 32 unsigned long *word = &hptep->v;
33 33
34 while (1) { 34 while (1) {
35 if (!test_and_set_bit(HPTE_LOCK_BIT, word)) 35 if (!test_and_set_bit(HPTE_LOCK_BIT, word))
@@ -39,32 +39,28 @@ static inline void native_lock_hpte(HPTE *hptep)
39 } 39 }
40} 40}
41 41
42static inline void native_unlock_hpte(HPTE *hptep) 42static inline void native_unlock_hpte(hpte_t *hptep)
43{ 43{
44 unsigned long *word = &hptep->dw0.dword0; 44 unsigned long *word = &hptep->v;
45 45
46 asm volatile("lwsync":::"memory"); 46 asm volatile("lwsync":::"memory");
47 clear_bit(HPTE_LOCK_BIT, word); 47 clear_bit(HPTE_LOCK_BIT, word);
48} 48}
49 49
50long native_hpte_insert(unsigned long hpte_group, unsigned long va, 50long native_hpte_insert(unsigned long hpte_group, unsigned long va,
51 unsigned long prpn, int secondary, 51 unsigned long prpn, unsigned long vflags,
52 unsigned long hpteflags, int bolted, int large) 52 unsigned long rflags)
53{ 53{
54 unsigned long arpn = physRpn_to_absRpn(prpn); 54 unsigned long arpn = physRpn_to_absRpn(prpn);
55 HPTE *hptep = htab_address + hpte_group; 55 hpte_t *hptep = htab_address + hpte_group;
56 Hpte_dword0 dw0; 56 unsigned long hpte_v, hpte_r;
57 HPTE lhpte;
58 int i; 57 int i;
59 58
60 for (i = 0; i < HPTES_PER_GROUP; i++) { 59 for (i = 0; i < HPTES_PER_GROUP; i++) {
61 dw0 = hptep->dw0.dw0; 60 if (! (hptep->v & HPTE_V_VALID)) {
62
63 if (!dw0.v) {
64 /* retry with lock held */ 61 /* retry with lock held */
65 native_lock_hpte(hptep); 62 native_lock_hpte(hptep);
66 dw0 = hptep->dw0.dw0; 63 if (! (hptep->v & HPTE_V_VALID))
67 if (!dw0.v)
68 break; 64 break;
69 native_unlock_hpte(hptep); 65 native_unlock_hpte(hptep);
70 } 66 }
@@ -75,56 +71,45 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va,
75 if (i == HPTES_PER_GROUP) 71 if (i == HPTES_PER_GROUP)
76 return -1; 72 return -1;
77 73
78 lhpte.dw1.dword1 = 0; 74 hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
79 lhpte.dw1.dw1.rpn = arpn; 75 if (vflags & HPTE_V_LARGE)
80 lhpte.dw1.flags.flags = hpteflags; 76 va &= ~(1UL << HPTE_V_AVPN_SHIFT);
81 77 hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
82 lhpte.dw0.dword0 = 0;
83 lhpte.dw0.dw0.avpn = va >> 23;
84 lhpte.dw0.dw0.h = secondary;
85 lhpte.dw0.dw0.bolted = bolted;
86 lhpte.dw0.dw0.v = 1;
87
88 if (large) {
89 lhpte.dw0.dw0.l = 1;
90 lhpte.dw0.dw0.avpn &= ~0x1UL;
91 }
92
93 hptep->dw1.dword1 = lhpte.dw1.dword1;
94 78
79 hptep->r = hpte_r;
95 /* Guarantee the second dword is visible before the valid bit */ 80 /* Guarantee the second dword is visible before the valid bit */
96 __asm__ __volatile__ ("eieio" : : : "memory"); 81 __asm__ __volatile__ ("eieio" : : : "memory");
97
98 /* 82 /*
99 * Now set the first dword including the valid bit 83 * Now set the first dword including the valid bit
100 * NOTE: this also unlocks the hpte 84 * NOTE: this also unlocks the hpte
101 */ 85 */
102 hptep->dw0.dword0 = lhpte.dw0.dword0; 86 hptep->v = hpte_v;
103 87
104 __asm__ __volatile__ ("ptesync" : : : "memory"); 88 __asm__ __volatile__ ("ptesync" : : : "memory");
105 89
106 return i | (secondary << 3); 90 return i | (!!(vflags & HPTE_V_SECONDARY) << 3);
107} 91}
108 92
109static long native_hpte_remove(unsigned long hpte_group) 93static long native_hpte_remove(unsigned long hpte_group)
110{ 94{
111 HPTE *hptep; 95 hpte_t *hptep;
112 Hpte_dword0 dw0;
113 int i; 96 int i;
114 int slot_offset; 97 int slot_offset;
98 unsigned long hpte_v;
115 99
116 /* pick a random entry to start at */ 100 /* pick a random entry to start at */
117 slot_offset = mftb() & 0x7; 101 slot_offset = mftb() & 0x7;
118 102
119 for (i = 0; i < HPTES_PER_GROUP; i++) { 103 for (i = 0; i < HPTES_PER_GROUP; i++) {
120 hptep = htab_address + hpte_group + slot_offset; 104 hptep = htab_address + hpte_group + slot_offset;
121 dw0 = hptep->dw0.dw0; 105 hpte_v = hptep->v;
122 106
123 if (dw0.v && !dw0.bolted) { 107 if ((hpte_v & HPTE_V_VALID) && !(hpte_v & HPTE_V_BOLTED)) {
124 /* retry with lock held */ 108 /* retry with lock held */
125 native_lock_hpte(hptep); 109 native_lock_hpte(hptep);
126 dw0 = hptep->dw0.dw0; 110 hpte_v = hptep->v;
127 if (dw0.v && !dw0.bolted) 111 if ((hpte_v & HPTE_V_VALID)
112 && !(hpte_v & HPTE_V_BOLTED))
128 break; 113 break;
129 native_unlock_hpte(hptep); 114 native_unlock_hpte(hptep);
130 } 115 }
@@ -137,15 +122,15 @@ static long native_hpte_remove(unsigned long hpte_group)
137 return -1; 122 return -1;
138 123
139 /* Invalidate the hpte. NOTE: this also unlocks it */ 124 /* Invalidate the hpte. NOTE: this also unlocks it */
140 hptep->dw0.dword0 = 0; 125 hptep->v = 0;
141 126
142 return i; 127 return i;
143} 128}
144 129
145static inline void set_pp_bit(unsigned long pp, HPTE *addr) 130static inline void set_pp_bit(unsigned long pp, hpte_t *addr)
146{ 131{
147 unsigned long old; 132 unsigned long old;
148 unsigned long *p = &addr->dw1.dword1; 133 unsigned long *p = &addr->r;
149 134
150 __asm__ __volatile__( 135 __asm__ __volatile__(
151 "1: ldarx %0,0,%3\n\ 136 "1: ldarx %0,0,%3\n\
@@ -163,11 +148,11 @@ static inline void set_pp_bit(unsigned long pp, HPTE *addr)
163 */ 148 */
164static long native_hpte_find(unsigned long vpn) 149static long native_hpte_find(unsigned long vpn)
165{ 150{
166 HPTE *hptep; 151 hpte_t *hptep;
167 unsigned long hash; 152 unsigned long hash;
168 unsigned long i, j; 153 unsigned long i, j;
169 long slot; 154 long slot;
170 Hpte_dword0 dw0; 155 unsigned long hpte_v;
171 156
172 hash = hpt_hash(vpn, 0); 157 hash = hpt_hash(vpn, 0);
173 158
@@ -175,10 +160,11 @@ static long native_hpte_find(unsigned long vpn)
175 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 160 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
176 for (i = 0; i < HPTES_PER_GROUP; i++) { 161 for (i = 0; i < HPTES_PER_GROUP; i++) {
177 hptep = htab_address + slot; 162 hptep = htab_address + slot;
178 dw0 = hptep->dw0.dw0; 163 hpte_v = hptep->v;
179 164
180 if ((dw0.avpn == (vpn >> 11)) && dw0.v && 165 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11))
181 (dw0.h == j)) { 166 && (hpte_v & HPTE_V_VALID)
167 && ( !!(hpte_v & HPTE_V_SECONDARY) == j)) {
182 /* HPTE matches */ 168 /* HPTE matches */
183 if (j) 169 if (j)
184 slot = -slot; 170 slot = -slot;
@@ -195,20 +181,21 @@ static long native_hpte_find(unsigned long vpn)
195static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, 181static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
196 unsigned long va, int large, int local) 182 unsigned long va, int large, int local)
197{ 183{
198 HPTE *hptep = htab_address + slot; 184 hpte_t *hptep = htab_address + slot;
199 Hpte_dword0 dw0; 185 unsigned long hpte_v;
200 unsigned long avpn = va >> 23; 186 unsigned long avpn = va >> 23;
201 int ret = 0; 187 int ret = 0;
202 188
203 if (large) 189 if (large)
204 avpn &= ~0x1UL; 190 avpn &= ~1;
205 191
206 native_lock_hpte(hptep); 192 native_lock_hpte(hptep);
207 193
208 dw0 = hptep->dw0.dw0; 194 hpte_v = hptep->v;
209 195
210 /* Even if we miss, we need to invalidate the TLB */ 196 /* Even if we miss, we need to invalidate the TLB */
211 if ((dw0.avpn != avpn) || !dw0.v) { 197 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
198 || !(hpte_v & HPTE_V_VALID)) {
212 native_unlock_hpte(hptep); 199 native_unlock_hpte(hptep);
213 ret = -1; 200 ret = -1;
214 } else { 201 } else {
@@ -244,7 +231,7 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
244{ 231{
245 unsigned long vsid, va, vpn, flags = 0; 232 unsigned long vsid, va, vpn, flags = 0;
246 long slot; 233 long slot;
247 HPTE *hptep; 234 hpte_t *hptep;
248 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 235 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
249 236
250 vsid = get_kernel_vsid(ea); 237 vsid = get_kernel_vsid(ea);
@@ -269,26 +256,27 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
269static void native_hpte_invalidate(unsigned long slot, unsigned long va, 256static void native_hpte_invalidate(unsigned long slot, unsigned long va,
270 int large, int local) 257 int large, int local)
271{ 258{
272 HPTE *hptep = htab_address + slot; 259 hpte_t *hptep = htab_address + slot;
273 Hpte_dword0 dw0; 260 unsigned long hpte_v;
274 unsigned long avpn = va >> 23; 261 unsigned long avpn = va >> 23;
275 unsigned long flags; 262 unsigned long flags;
276 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 263 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
277 264
278 if (large) 265 if (large)
279 avpn &= ~0x1UL; 266 avpn &= ~1;
280 267
281 local_irq_save(flags); 268 local_irq_save(flags);
282 native_lock_hpte(hptep); 269 native_lock_hpte(hptep);
283 270
284 dw0 = hptep->dw0.dw0; 271 hpte_v = hptep->v;
285 272
286 /* Even if we miss, we need to invalidate the TLB */ 273 /* Even if we miss, we need to invalidate the TLB */
287 if ((dw0.avpn != avpn) || !dw0.v) { 274 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
275 || !(hpte_v & HPTE_V_VALID)) {
288 native_unlock_hpte(hptep); 276 native_unlock_hpte(hptep);
289 } else { 277 } else {
290 /* Invalidate the hpte. NOTE: this also unlocks it */ 278 /* Invalidate the hpte. NOTE: this also unlocks it */
291 hptep->dw0.dword0 = 0; 279 hptep->v = 0;
292 } 280 }
293 281
294 /* Invalidate the tlb */ 282 /* Invalidate the tlb */
@@ -315,8 +303,8 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
315static void native_hpte_clear(void) 303static void native_hpte_clear(void)
316{ 304{
317 unsigned long slot, slots, flags; 305 unsigned long slot, slots, flags;
318 HPTE *hptep = htab_address; 306 hpte_t *hptep = htab_address;
319 Hpte_dword0 dw0; 307 unsigned long hpte_v;
320 unsigned long pteg_count; 308 unsigned long pteg_count;
321 309
322 pteg_count = htab_hash_mask + 1; 310 pteg_count = htab_hash_mask + 1;
@@ -336,11 +324,11 @@ static void native_hpte_clear(void)
336 * running, right? and for crash dump, we probably 324 * running, right? and for crash dump, we probably
337 * don't want to wait for a maybe bad cpu. 325 * don't want to wait for a maybe bad cpu.
338 */ 326 */
339 dw0 = hptep->dw0.dw0; 327 hpte_v = hptep->v;
340 328
341 if (dw0.v) { 329 if (hpte_v & HPTE_V_VALID) {
342 hptep->dw0.dword0 = 0; 330 hptep->v = 0;
343 tlbie(slot2va(dw0.avpn, dw0.l, dw0.h, slot), dw0.l); 331 tlbie(slot2va(hpte_v, slot), hpte_v & HPTE_V_LARGE);
344 } 332 }
345 } 333 }
346 334
@@ -353,8 +341,8 @@ static void native_flush_hash_range(unsigned long context,
353{ 341{
354 unsigned long vsid, vpn, va, hash, secondary, slot, flags, avpn; 342 unsigned long vsid, vpn, va, hash, secondary, slot, flags, avpn;
355 int i, j; 343 int i, j;
356 HPTE *hptep; 344 hpte_t *hptep;
357 Hpte_dword0 dw0; 345 unsigned long hpte_v;
358 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 346 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
359 347
360 /* XXX fix for large ptes */ 348 /* XXX fix for large ptes */
@@ -390,14 +378,15 @@ static void native_flush_hash_range(unsigned long context,
390 378
391 native_lock_hpte(hptep); 379 native_lock_hpte(hptep);
392 380
393 dw0 = hptep->dw0.dw0; 381 hpte_v = hptep->v;
394 382
395 /* Even if we miss, we need to invalidate the TLB */ 383 /* Even if we miss, we need to invalidate the TLB */
396 if ((dw0.avpn != avpn) || !dw0.v) { 384 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
385 || !(hpte_v & HPTE_V_VALID)) {
397 native_unlock_hpte(hptep); 386 native_unlock_hpte(hptep);
398 } else { 387 } else {
399 /* Invalidate the hpte. NOTE: this also unlocks it */ 388 /* Invalidate the hpte. NOTE: this also unlocks it */
400 hptep->dw0.dword0 = 0; 389 hptep->v = 0;
401 } 390 }
402 391
403 j++; 392 j++;
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c
index 1647b1c6f28e..623b5d130c31 100644
--- a/arch/ppc64/mm/hash_utils.c
+++ b/arch/ppc64/mm/hash_utils.c
@@ -75,8 +75,8 @@
75extern unsigned long dart_tablebase; 75extern unsigned long dart_tablebase;
76#endif /* CONFIG_U3_DART */ 76#endif /* CONFIG_U3_DART */
77 77
78HPTE *htab_address; 78hpte_t *htab_address;
79unsigned long htab_hash_mask; 79unsigned long htab_hash_mask;
80 80
81extern unsigned long _SDR1; 81extern unsigned long _SDR1;
82 82
@@ -97,11 +97,15 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
97 unsigned long addr; 97 unsigned long addr;
98 unsigned int step; 98 unsigned int step;
99 unsigned long tmp_mode; 99 unsigned long tmp_mode;
100 unsigned long vflags;
100 101
101 if (large) 102 if (large) {
102 step = 16*MB; 103 step = 16*MB;
103 else 104 vflags = HPTE_V_BOLTED | HPTE_V_LARGE;
105 } else {
104 step = 4*KB; 106 step = 4*KB;
107 vflags = HPTE_V_BOLTED;
108 }
105 109
106 for (addr = start; addr < end; addr += step) { 110 for (addr = start; addr < end; addr += step) {
107 unsigned long vpn, hash, hpteg; 111 unsigned long vpn, hash, hpteg;
@@ -129,12 +133,12 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
129 if (systemcfg->platform & PLATFORM_LPAR) 133 if (systemcfg->platform & PLATFORM_LPAR)
130 ret = pSeries_lpar_hpte_insert(hpteg, va, 134 ret = pSeries_lpar_hpte_insert(hpteg, va,
131 virt_to_abs(addr) >> PAGE_SHIFT, 135 virt_to_abs(addr) >> PAGE_SHIFT,
132 0, tmp_mode, 1, large); 136 vflags, tmp_mode);
133 else 137 else
134#endif /* CONFIG_PPC_PSERIES */ 138#endif /* CONFIG_PPC_PSERIES */
135 ret = native_hpte_insert(hpteg, va, 139 ret = native_hpte_insert(hpteg, va,
136 virt_to_abs(addr) >> PAGE_SHIFT, 140 virt_to_abs(addr) >> PAGE_SHIFT,
137 0, tmp_mode, 1, large); 141 vflags, tmp_mode);
138 142
139 if (ret == -1) { 143 if (ret == -1) {
140 ppc64_terminate_msg(0x20, "create_pte_mapping"); 144 ppc64_terminate_msg(0x20, "create_pte_mapping");
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index fdcfe97c75c1..f9524602818d 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -583,7 +583,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
583 pte_t *ptep; 583 pte_t *ptep;
584 unsigned long va, vpn; 584 unsigned long va, vpn;
585 pte_t old_pte, new_pte; 585 pte_t old_pte, new_pte;
586 unsigned long hpteflags, prpn; 586 unsigned long rflags, prpn;
587 long slot; 587 long slot;
588 int err = 1; 588 int err = 1;
589 589
@@ -626,9 +626,9 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
626 old_pte = *ptep; 626 old_pte = *ptep;
627 new_pte = old_pte; 627 new_pte = old_pte;
628 628
629 hpteflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW)); 629 rflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW));
630 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */ 630 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */
631 hpteflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC); 631 rflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC);
632 632
633 /* Check if pte already has an hpte (case 2) */ 633 /* Check if pte already has an hpte (case 2) */
634 if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) { 634 if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) {
@@ -641,7 +641,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
641 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 641 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
642 slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12; 642 slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12;
643 643
644 if (ppc_md.hpte_updatepp(slot, hpteflags, va, 1, local) == -1) 644 if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)
645 pte_val(old_pte) &= ~_PAGE_HPTEFLAGS; 645 pte_val(old_pte) &= ~_PAGE_HPTEFLAGS;
646 } 646 }
647 647
@@ -661,10 +661,10 @@ repeat:
661 661
662 /* Add in WIMG bits */ 662 /* Add in WIMG bits */
663 /* XXX We should store these in the pte */ 663 /* XXX We should store these in the pte */
664 hpteflags |= _PAGE_COHERENT; 664 rflags |= _PAGE_COHERENT;
665 665
666 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 0, 666 slot = ppc_md.hpte_insert(hpte_group, va, prpn,
667 hpteflags, 0, 1); 667 HPTE_V_LARGE, rflags);
668 668
669 /* Primary is full, try the secondary */ 669 /* Primary is full, try the secondary */
670 if (unlikely(slot == -1)) { 670 if (unlikely(slot == -1)) {
@@ -672,7 +672,7 @@ repeat:
672 hpte_group = ((~hash & htab_hash_mask) * 672 hpte_group = ((~hash & htab_hash_mask) *
673 HPTES_PER_GROUP) & ~0x7UL; 673 HPTES_PER_GROUP) & ~0x7UL;
674 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 674 slot = ppc_md.hpte_insert(hpte_group, va, prpn,
675 1, hpteflags, 0, 1); 675 HPTE_V_LARGE, rflags);
676 if (slot == -1) { 676 if (slot == -1) {
677 if (mftb() & 0x1) 677 if (mftb() & 0x1)
678 hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; 678 hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index b50b3a446dbe..e58a24d42879 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -180,9 +180,10 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
180 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 180 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
181 181
182 /* Panic if a pte grpup is full */ 182 /* Panic if a pte grpup is full */
183 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0, 183 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
184 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX, 184 HPTE_V_BOLTED,
185 1, 0) == -1) { 185 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
186 == -1) {
186 panic("map_io_page: could not insert mapping"); 187 panic("map_io_page: could not insert mapping");
187 } 188 }
188 } 189 }
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 614056222875..18610cea03a2 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -58,6 +58,7 @@
58#include <linux/compat.h> 58#include <linux/compat.h>
59#include <linux/vfs.h> 59#include <linux/vfs.h>
60#include <linux/ptrace.h> 60#include <linux/ptrace.h>
61#include <linux/fadvise.h>
61 62
62#include <asm/types.h> 63#include <asm/types.h>
63#include <asm/ipc.h> 64#include <asm/ipc.h>
@@ -1043,3 +1044,40 @@ sys32_timer_create(clockid_t which_clock, struct compat_sigevent *se32,
1043 1044
1044 return ret; 1045 return ret;
1045} 1046}
1047
1048/*
1049 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
1050 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
1051 * because the 31 bit values differ from the 64 bit values.
1052 */
1053
1054asmlinkage long
1055sys32_fadvise64(int fd, loff_t offset, size_t len, int advise)
1056{
1057 if (advise == 4)
1058 advise = POSIX_FADV_DONTNEED;
1059 else if (advise == 5)
1060 advise = POSIX_FADV_NOREUSE;
1061 return sys_fadvise64(fd, offset, len, advise);
1062}
1063
1064struct fadvise64_64_args {
1065 int fd;
1066 long long offset;
1067 long long len;
1068 int advice;
1069};
1070
1071asmlinkage long
1072sys32_fadvise64_64(struct fadvise64_64_args __user *args)
1073{
1074 struct fadvise64_64_args a;
1075
1076 if ( copy_from_user(&a, args, sizeof(a)) )
1077 return -EFAULT;
1078 if (a.advice == 4)
1079 a.advice = POSIX_FADV_DONTNEED;
1080 else if (a.advice == 5)
1081 a.advice = POSIX_FADV_NOREUSE;
1082 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
1083}
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index bf529739c8ab..799a98eac92d 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1251,12 +1251,12 @@ sys32_fadvise64_wrapper:
1251 or %r3,%r4 # get low word of 64bit loff_t 1251 or %r3,%r4 # get low word of 64bit loff_t
1252 llgfr %r4,%r5 # size_t (unsigned long) 1252 llgfr %r4,%r5 # size_t (unsigned long)
1253 lgfr %r5,%r6 # int 1253 lgfr %r5,%r6 # int
1254 jg sys_fadvise64 1254 jg sys32_fadvise64
1255 1255
1256 .globl sys32_fadvise64_64_wrapper 1256 .globl sys32_fadvise64_64_wrapper
1257sys32_fadvise64_64_wrapper: 1257sys32_fadvise64_64_wrapper:
1258 llgtr %r2,%r2 # struct fadvise64_64_args * 1258 llgtr %r2,%r2 # struct fadvise64_64_args *
1259 jg s390_fadvise64_64 1259 jg sys32_fadvise64_64
1260 1260
1261 .globl sys32_clock_settime_wrapper 1261 .globl sys32_clock_settime_wrapper
1262sys32_clock_settime_wrapper: 1262sys32_clock_settime_wrapper:
diff --git a/arch/um/Kconfig_net b/arch/um/Kconfig_net
index 1c2f9a70d91d..fa2ab2dd78b7 100644
--- a/arch/um/Kconfig_net
+++ b/arch/um/Kconfig_net
@@ -135,7 +135,7 @@ config UML_NET_MCAST
135 135
136config UML_NET_PCAP 136config UML_NET_PCAP
137 bool "pcap transport" 137 bool "pcap transport"
138 depends on UML_NET && BROKEN 138 depends on UML_NET && EXPERIMENTAL
139 help 139 help
140 The pcap transport makes a pcap packet stream on the host look 140 The pcap transport makes a pcap packet stream on the host look
141 like an ethernet device inside UML. This is useful for making 141 like an ethernet device inside UML. This is useful for making
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 4a375bbac109..eb4ac403bd93 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -51,25 +51,26 @@ MRPROPER_DIRS += $(ARCH_DIR)/include2
51endif 51endif
52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) 52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 53
54include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named.
56
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap
55 59
56core-y += $(SUBARCH_CORE) 60USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
57libs-y += $(SUBARCH_LIBS) 61USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
62 $(MODE_INCLUDE)
58 63
59# -Derrno=kernel_errno - This turns all kernel references to errno into 64# -Derrno=kernel_errno - This turns all kernel references to errno into
60# kernel_errno to separate them from the libc errno. This allows -fno-common 65# kernel_errno to separate them from the libc errno. This allows -fno-common
61# in CFLAGS. Otherwise, it would cause ld to complain about the two different 66# in CFLAGS. Otherwise, it would cause ld to complain about the two different
62# errnos. 67# errnos.
63 68
64CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
65 $(ARCH_INCLUDE) $(MODE_INCLUDE)
66
67USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
68USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
69 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
70CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask 69CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
71CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 70CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
72 71
72include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
73
73#This will adjust *FLAGS accordingly to the platform. 74#This will adjust *FLAGS accordingly to the platform.
74include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 75include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
75 76
@@ -116,18 +117,19 @@ CONFIG_KERNEL_STACK_ORDER ?= 2
116STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 117STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
117 118
118ifndef START 119ifndef START
119 START = $$(($(TOP_ADDR) - $(SIZE))) 120 START = $(shell echo $$[ $(TOP_ADDR) - $(SIZE) ] )
120endif 121endif
121 122
122CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ 123CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \
123 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 124 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
124 -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \ 125 -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \
125 -DKERNEL_STACK_SIZE=$(STACK_SIZE) -DSUBARCH=$(SUBARCH)) 126 -DKERNEL_STACK_SIZE=$(STACK_SIZE) \
127 -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap_fin.o
126 128
127#The wrappers will select whether using "malloc" or the kernel allocator. 129#The wrappers will select whether using "malloc" or the kernel allocator.
128LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 130LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
129 131
130CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) 132CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS)
131define cmd_vmlinux__ 133define cmd_vmlinux__
132 $(CC) $(CFLAGS_vmlinux) -o $@ \ 134 $(CC) $(CFLAGS_vmlinux) -o $@ \
133 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ 135 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 301059062a3e..93d0818fa816 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -1,4 +1,4 @@
1SUBARCH_CORE := arch/um/sys-i386/ arch/i386/crypto/ 1core-y += arch/um/sys-i386/ arch/i386/crypto/
2 2
3TOP_ADDR := $(CONFIG_TOP_ADDR) 3TOP_ADDR := $(CONFIG_TOP_ADDR)
4 4
@@ -8,21 +8,32 @@ ifeq ($(CONFIG_MODE_SKAS),y)
8 endif 8 endif
9endif 9endif
10 10
11LDFLAGS += -m elf_i386
12ELF_ARCH := $(SUBARCH)
13ELF_FORMAT := elf32-$(SUBARCH)
14OBJCOPYFLAGS := -O binary -R .note -R .comment -S
15
16ifeq ("$(origin SUBARCH)", "command line")
17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
18CFLAGS += $(call cc-option,-m32)
19USER_CFLAGS += $(call cc-option,-m32)
20HOSTCFLAGS += $(call cc-option,-m32)
21HOSTLDFLAGS += $(call cc-option,-m32)
22AFLAGS += $(call cc-option,-m32)
23LINK-y += $(call cc-option,-m32)
24UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
25
26export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
27endif
28endif
29
11CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) $(STUB_CFLAGS) 30CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) $(STUB_CFLAGS)
12ARCH_USER_CFLAGS :=
13 31
14ifneq ($(CONFIG_GPROF),y) 32ifneq ($(CONFIG_GPROF),y)
15ARCH_CFLAGS += -DUM_FASTCALL 33ARCH_CFLAGS += -DUM_FASTCALL
16endif 34endif
17 35
18ELF_ARCH := $(SUBARCH) 36SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
19ELF_FORMAT := elf32-$(SUBARCH)
20
21OBJCOPYFLAGS := -O binary -R .note -R .comment -S
22
23SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util
24
25SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
26 37
27prepare: $(SYS_HEADERS) 38prepare: $(SYS_HEADERS)
28 39
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index d80bd0052e6b..aa2f7174ebca 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -1,11 +1,13 @@
1# Copyright 2003 - 2004 Pathscale, Inc 1# Copyright 2003 - 2004 Pathscale, Inc
2# Released under the GPL 2# Released under the GPL
3 3
4SUBARCH_LIBS := arch/um/sys-x86_64/ 4libs-y += arch/um/sys-x86_64/
5START := 0x60000000 5START := 0x60000000
6 6
7#We #undef __x86_64__ for kernelspace, not for userspace where
8#it's needed for headers to work!
7CFLAGS += -U__$(SUBARCH)__ -fno-builtin $(STUB_CFLAGS) 9CFLAGS += -U__$(SUBARCH)__ -fno-builtin $(STUB_CFLAGS)
8ARCH_USER_CFLAGS := -D__x86_64__ 10USER_CFLAGS += -fno-builtin
9 11
10ELF_ARCH := i386:x86-64 12ELF_ARCH := i386:x86-64
11ELF_FORMAT := elf64-x86-64 13ELF_FORMAT := elf64-x86-64
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index b2de9916c32c..d6c31a95b887 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -10,7 +10,6 @@ slip-objs := slip_kern.o slip_user.o
10slirp-objs := slirp_kern.o slirp_user.o 10slirp-objs := slirp_kern.o slirp_user.o
11daemon-objs := daemon_kern.o daemon_user.o 11daemon-objs := daemon_kern.o daemon_user.o
12mcast-objs := mcast_kern.o mcast_user.o 12mcast-objs := mcast_kern.o mcast_user.o
13#pcap-objs := pcap_kern.o pcap_user.o $(PCAP)
14net-objs := net_kern.o net_user.o 13net-objs := net_kern.o net_user.o
15mconsole-objs := mconsole_kern.o mconsole_user.o 14mconsole-objs := mconsole_kern.o mconsole_user.o
16hostaudio-objs := hostaudio_kern.o 15hostaudio-objs := hostaudio_kern.o
@@ -18,6 +17,17 @@ ubd-objs := ubd_kern.o ubd_user.o
18port-objs := port_kern.o port_user.o 17port-objs := port_kern.o port_user.o
19harddog-objs := harddog_kern.o harddog_user.o 18harddog-objs := harddog_kern.o harddog_user.o
20 19
20LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
21
22$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
23 $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
24#XXX: The call below does not work because the flags are added before the
25# object name, so nothing from the library gets linked.
26#$(call if_changed,ld)
27
28# When the above is fixed, don't forget to add this too!
29#targets := $(obj)/pcap.o
30
21obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o 31obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
22obj-$(CONFIG_SSL) += ssl.o 32obj-$(CONFIG_SSL) += ssl.o
23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o 33obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
@@ -26,7 +36,7 @@ obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o 36obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o 37obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
28obj-$(CONFIG_UML_NET_MCAST) += mcast.o 38obj-$(CONFIG_UML_NET_MCAST) += mcast.o
29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP) 39obj-$(CONFIG_UML_NET_PCAP) += pcap.o
30obj-$(CONFIG_UML_NET) += net.o 40obj-$(CONFIG_UML_NET) += net.o
31obj-$(CONFIG_MCONSOLE) += mconsole.o 41obj-$(CONFIG_MCONSOLE) += mconsole.o
32obj-$(CONFIG_MMAPPER) += mmapper_kern.o 42obj-$(CONFIG_MMAPPER) += mmapper_kern.o
@@ -41,6 +51,7 @@ obj-$(CONFIG_UML_WATCHDOG) += harddog.o
41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 51obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
42obj-$(CONFIG_UML_RANDOM) += random.o 52obj-$(CONFIG_UML_RANDOM) += random.o
43 53
44USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o 54# pcap_user.o must be added explicitly.
55USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o
45 56
46include arch/um/scripts/Makefile.rules 57include arch/um/scripts/Makefile.rules
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 163476a8cb1b..b03326d391c9 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -16,8 +16,8 @@ SECTIONS
16 __binary_start = .; 16 __binary_start = .;
17 17
18#ifdef MODE_TT 18#ifdef MODE_TT
19 .remap_data : { arch/um/sys-SUBARCH/unmap_fin.o (.data .bss) } 19 .remap_data : { UNMAP_PATH (.data .bss) }
20 .remap : { arch/um/sys-SUBARCH/unmap_fin.o (.text) } 20 .remap : { UNMAP_PATH (.text) }
21 21
22 . = ALIGN(4096); /* Init code and data */ 22 . = ALIGN(4096); /* Init code and data */
23#endif 23#endif
diff --git a/arch/um/scripts/Makefile.unmap b/arch/um/scripts/Makefile.unmap
index 37a8f9765295..802d027a1e13 100644
--- a/arch/um/scripts/Makefile.unmap
+++ b/arch/um/scripts/Makefile.unmap
@@ -12,8 +12,8 @@ $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS))
12 12
13quiet_cmd_wrapld = LD $@ 13quiet_cmd_wrapld = LD $@
14define cmd_wrapld 14define cmd_wrapld
15 $(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a); \ 15 $(LD) $(LDFLAGS) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) $(CFLAGS) -print-file-name=libc.a); \
16 $(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo 16 $(OBJCOPY) $(UML_OBJCOPYFLAGS) $(obj)/unmap_tmp.o $@ -G switcheroo
17endef 17endef
18 18
19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE 19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index dc755b0b9db8..bd3c34aa52e5 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -4,96 +4,106 @@
4 */ 4 */
5 5
6#include "linux/config.h" 6#include "linux/config.h"
7#include "linux/sched.h"
7#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/types.h"
8#include "asm/uaccess.h" 10#include "asm/uaccess.h"
9#include "asm/ptrace.h" 11#include "asm/ptrace.h"
12#include "asm/smp.h"
13#include "asm/ldt.h"
10#include "choose-mode.h" 14#include "choose-mode.h"
11#include "kern.h" 15#include "kern.h"
16#include "mode_kern.h"
12 17
13#ifdef CONFIG_MODE_TT 18#ifdef CONFIG_MODE_TT
14extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
15 19
16/* XXX this needs copy_to_user and copy_from_user */ 20extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
17 21
18int sys_modify_ldt_tt(int func, void __user *ptr, unsigned long bytecount) 22static int do_modify_ldt_tt(int func, void *ptr, unsigned long bytecount)
19{ 23{
20 if (!access_ok(VERIFY_READ, ptr, bytecount))
21 return -EFAULT;
22
23 return modify_ldt(func, ptr, bytecount); 24 return modify_ldt(func, ptr, bytecount);
24} 25}
26
25#endif 27#endif
26 28
27#ifdef CONFIG_MODE_SKAS 29#ifdef CONFIG_MODE_SKAS
28extern int userspace_pid[];
29 30
31#include "skas.h"
30#include "skas_ptrace.h" 32#include "skas_ptrace.h"
31 33
32int sys_modify_ldt_skas(int func, void __user *ptr, unsigned long bytecount) 34static int do_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
33{ 35{
34 struct ptrace_ldt ldt; 36 struct ptrace_ldt ldt;
35 void *buf; 37 u32 cpu;
36 int res, n; 38 int res;
37 39
38 buf = kmalloc(bytecount, GFP_KERNEL); 40 ldt = ((struct ptrace_ldt) { .func = func,
39 if(buf == NULL) 41 .ptr = ptr,
40 return(-ENOMEM); 42 .bytecount = bytecount });
41 43
42 res = 0; 44 cpu = get_cpu();
45 res = ptrace(PTRACE_LDT, userspace_pid[cpu], 0, (unsigned long) &ldt);
46 put_cpu();
47
48 return res;
49}
50#endif
51
52int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
53{
54 struct user_desc info;
55 int res = 0;
56 void *buf = NULL;
57 void *p = NULL; /* What we pass to host. */
43 58
44 switch(func){ 59 switch(func){
45 case 1: 60 case 1:
46 case 0x11: 61 case 0x11: /* write_ldt */
47 res = copy_from_user(buf, ptr, bytecount); 62 /* Do this check now to avoid overflows. */
48 break; 63 if (bytecount != sizeof(struct user_desc)) {
49 } 64 res = -EINVAL;
65 goto out;
66 }
67
68 if(copy_from_user(&info, ptr, sizeof(info))) {
69 res = -EFAULT;
70 goto out;
71 }
50 72
51 if(res != 0){ 73 p = &info;
52 res = -EFAULT; 74 break;
75 case 0:
76 case 2: /* read_ldt */
77
78 /* The use of info avoids kmalloc on the write case, not on the
79 * read one. */
80 buf = kmalloc(bytecount, GFP_KERNEL);
81 if (!buf) {
82 res = -ENOMEM;
83 goto out;
84 }
85 p = buf;
86 default:
87 res = -ENOSYS;
53 goto out; 88 goto out;
54 } 89 }
55 90
56 ldt = ((struct ptrace_ldt) { .func = func, 91 res = CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func,
57 .ptr = buf, 92 p, bytecount);
58 .bytecount = bytecount });
59#warning Need to look up userspace_pid by cpu
60 res = ptrace(PTRACE_LDT, userspace_pid[0], 0, (unsigned long) &ldt);
61 if(res < 0) 93 if(res < 0)
62 goto out; 94 goto out;
63 95
64 switch(func){ 96 switch(func){
65 case 0: 97 case 0:
66 case 2: 98 case 2:
67 n = res; 99 /* Modify_ldt was for reading and returned the number of read
68 res = copy_to_user(ptr, buf, n); 100 * bytes.*/
69 if(res != 0) 101 if(copy_to_user(ptr, p, res))
70 res = -EFAULT; 102 res = -EFAULT;
71 else
72 res = n;
73 break; 103 break;
74 } 104 }
75 105
76 out: 106out:
77 kfree(buf); 107 kfree(buf);
78 return(res); 108 return res;
79}
80#endif
81
82int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
83{
84 return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func,
85 ptr, bytecount));
86} 109}
87
88
89
90/*
91 * Overrides for Emacs so that we follow Linus's tabbing style.
92 * Emacs will notice this stuff at the end of the file and automatically
93 * adjust the settings for this buffer only. This must remain at the end
94 * of the file.
95 * ---------------------------------------------------------------------------
96 * Local variables:
97 * c-file-style: "linux"
98 * End:
99 */
diff --git a/arch/um/sys-i386/unmap.c b/arch/um/sys-i386/unmap.c
index 136875263d27..1b0ad0e4adcd 100644
--- a/arch/um/sys-i386/unmap.c
+++ b/arch/um/sys-i386/unmap.c
@@ -15,7 +15,7 @@ int switcheroo(int fd, int prot, void *from, void *to, int size)
15 if(munmap(to, size) < 0){ 15 if(munmap(to, size) < 0){
16 return(-1); 16 return(-1);
17 } 17 }
18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ 18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){
19 return(-1); 19 return(-1);
20 } 20 }
21 if(munmap(from, size) < 0){ 21 if(munmap(from, size) < 0){
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 73a7926f7370..8fdaed06c10d 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -168,7 +168,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
168 168
169 frame = (struct rt_sigframe __user *) 169 frame = (struct rt_sigframe __user *)
170 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 170 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
171 ((unsigned char *) frame) -= 128; 171 frame = (struct rt_sigframe *) ((unsigned long) frame - 128);
172 172
173 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 173 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
174 goto out; 174 goto out;
diff --git a/arch/um/sys-x86_64/unmap.c b/arch/um/sys-x86_64/unmap.c
index bc7094cce47e..f4a4bffd8a18 100644
--- a/arch/um/sys-x86_64/unmap.c
+++ b/arch/um/sys-x86_64/unmap.c
@@ -15,7 +15,7 @@ int switcheroo(int fd, int prot, void *from, void *to, int size)
15 if(munmap(to, size) < 0){ 15 if(munmap(to, size) < 0){
16 return(-1); 16 return(-1);
17 } 17 }
18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ 18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
19 return(-1); 19 return(-1);
20 } 20 }
21 if(munmap(from, size) < 0){ 21 if(munmap(from, size) < 0){
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index bbd3429bcffc..c366a8b326ee 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms 2 * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
3 * 3 *
4 * Copyright (C) 2002,03,04 NEC Electronics Corporation 4 * Copyright (C) 2002,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2002,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2002,03,04,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -61,6 +61,7 @@
61 *(__kcrctab_gpl) \ 61 *(__kcrctab_gpl) \
62 ___stop___kcrctab_gpl = .; \ 62 ___stop___kcrctab_gpl = .; \
63 /* Built-in module parameters */ \ 63 /* Built-in module parameters */ \
64 . = ALIGN (4) ; \
64 ___start___param = .; \ 65 ___start___param = .; \
65 *(__param) \ 66 *(__param) \
66 ___stop___param = .; 67 ___stop___param = .;
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index 01d8db1a1c09..816a3b89f13d 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -57,6 +57,7 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
57 int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT; 57 int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT;
58 struct vm_area_struct *vma; 58 struct vm_area_struct *vma;
59 struct mm_struct *mm = current->mm; 59 struct mm_struct *mm = current->mm;
60 int ret;
60 61
61 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); 62 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
62 if (!vma) 63 if (!vma)
@@ -78,7 +79,11 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
78 vma->vm_mm = mm; 79 vma->vm_mm = mm;
79 80
80 down_write(&mm->mmap_sem); 81 down_write(&mm->mmap_sem);
81 insert_vm_struct(mm, vma); 82 if ((ret = insert_vm_struct(mm, vma))) {
83 up_write(&mm->mmap_sem);
84 kmem_cache_free(vm_area_cachep, vma);
85 return ret;
86 }
82 mm->total_vm += npages; 87 mm->total_vm += npages;
83 up_write(&mm->mmap_sem); 88 up_write(&mm->mmap_sem);
84 return 0; 89 return 0;