aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 22:23:34 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 22:23:34 -0400
commit56d61a0e26c5a61c66d1ac259a59960295939da9 (patch)
treea23a30a966fe4220060682179294087cba1f9c57 /arch
parent5f48b338cd28f4095697a174d7e3e72084aca893 (diff)
parent190a1d722a59725706daf832bc8a511ed62f249d (diff)
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] 4level-fixup cleanup [S390] Cleanup page table definitions. [S390] Introduce follow_table in uaccess_pt.c [S390] Remove unused user_seg from thread structure. [S390] tlb flush fix. [S390] kernel: Fix dump on panic for DASDs under LPAR. [S390] struct class_device -> struct device conversion. [S390] cio: Fix incomplete commit for uevent suppression. [S390] cio: Use to_channelpath() for device to channel path conversion. [S390] Add per-cpu idle time / idle count sysfs attributes. [S390] Update default configuration.
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/defconfig131
-rw-r--r--arch/s390/kernel/ipl.c2
-rw-r--r--arch/s390/kernel/process.c18
-rw-r--r--arch/s390/kernel/smp.c65
-rw-r--r--arch/s390/lib/uaccess_pt.c90
-rw-r--r--arch/s390/mm/Makefile2
-rw-r--r--arch/s390/mm/init.c32
-rw-r--r--arch/s390/mm/pgtable.c94
-rw-r--r--arch/s390/mm/vmem.c53
9 files changed, 336 insertions, 151 deletions
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 2aae23dba4bb..ece7b99da895 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.22 3# Linux kernel version: 2.6.23
4# Tue Jul 17 12:50:23 2007 4# Mon Oct 22 12:10:44 2007
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_ZONE_DMA=y 7CONFIG_ZONE_DMA=y
@@ -19,15 +19,11 @@ CONFIG_S390=y
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 20
21# 21#
22# Code maturity level options 22# General setup
23# 23#
24CONFIG_EXPERIMENTAL=y 24CONFIG_EXPERIMENTAL=y
25CONFIG_LOCK_KERNEL=y 25CONFIG_LOCK_KERNEL=y
26CONFIG_INIT_ENV_ARG_LIMIT=32 26CONFIG_INIT_ENV_ARG_LIMIT=32
27
28#
29# General setup
30#
31CONFIG_LOCALVERSION="" 27CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y 28CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y 29CONFIG_SWAP=y
@@ -42,7 +38,14 @@ CONFIG_AUDIT=y
42CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
44CONFIG_LOG_BUF_SHIFT=17 40CONFIG_LOG_BUF_SHIFT=17
41CONFIG_CGROUPS=y
42# CONFIG_CGROUP_DEBUG is not set
43CONFIG_CGROUP_NS=y
44CONFIG_CGROUP_CPUACCT=y
45# CONFIG_CPUSETS is not set 45# CONFIG_CPUSETS is not set
46CONFIG_FAIR_GROUP_SCHED=y
47CONFIG_FAIR_USER_SCHED=y
48# CONFIG_FAIR_CGROUP_SCHED is not set
46CONFIG_SYSFS_DEPRECATED=y 49CONFIG_SYSFS_DEPRECATED=y
47# CONFIG_RELAY is not set 50# CONFIG_RELAY is not set
48CONFIG_BLK_DEV_INITRD=y 51CONFIG_BLK_DEV_INITRD=y
@@ -63,7 +66,6 @@ CONFIG_FUTEX=y
63CONFIG_ANON_INODES=y 66CONFIG_ANON_INODES=y
64CONFIG_EPOLL=y 67CONFIG_EPOLL=y
65CONFIG_SIGNALFD=y 68CONFIG_SIGNALFD=y
66CONFIG_TIMERFD=y
67CONFIG_EVENTFD=y 69CONFIG_EVENTFD=y
68CONFIG_SHMEM=y 70CONFIG_SHMEM=y
69CONFIG_VM_EVENT_COUNTERS=y 71CONFIG_VM_EVENT_COUNTERS=y
@@ -83,6 +85,7 @@ CONFIG_STOP_MACHINE=y
83CONFIG_BLOCK=y 85CONFIG_BLOCK=y
84# CONFIG_BLK_DEV_IO_TRACE is not set 86# CONFIG_BLK_DEV_IO_TRACE is not set
85CONFIG_BLK_DEV_BSG=y 87CONFIG_BLK_DEV_BSG=y
88CONFIG_BLOCK_COMPAT=y
86 89
87# 90#
88# IO Schedulers 91# IO Schedulers
@@ -108,7 +111,6 @@ CONFIG_64BIT=y
108CONFIG_SMP=y 111CONFIG_SMP=y
109CONFIG_NR_CPUS=32 112CONFIG_NR_CPUS=32
110CONFIG_HOTPLUG_CPU=y 113CONFIG_HOTPLUG_CPU=y
111CONFIG_DEFAULT_MIGRATION_COST=1000000
112CONFIG_COMPAT=y 114CONFIG_COMPAT=y
113CONFIG_SYSVIPC_COMPAT=y 115CONFIG_SYSVIPC_COMPAT=y
114CONFIG_AUDIT_ARCH=y 116CONFIG_AUDIT_ARCH=y
@@ -143,9 +145,11 @@ CONFIG_FLATMEM_MANUAL=y
143CONFIG_FLATMEM=y 145CONFIG_FLATMEM=y
144CONFIG_FLAT_NODE_MEM_MAP=y 146CONFIG_FLAT_NODE_MEM_MAP=y
145# CONFIG_SPARSEMEM_STATIC is not set 147# CONFIG_SPARSEMEM_STATIC is not set
148# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
146CONFIG_SPLIT_PTLOCK_CPUS=4 149CONFIG_SPLIT_PTLOCK_CPUS=4
147CONFIG_RESOURCES_64BIT=y 150CONFIG_RESOURCES_64BIT=y
148CONFIG_ZONE_DMA_FLAG=1 151CONFIG_ZONE_DMA_FLAG=1
152CONFIG_BOUNCE=y
149CONFIG_VIRT_TO_BUS=y 153CONFIG_VIRT_TO_BUS=y
150CONFIG_HOLES_IN_ZONE=y 154CONFIG_HOLES_IN_ZONE=y
151 155
@@ -219,12 +223,14 @@ CONFIG_INET_TUNNEL=y
219CONFIG_INET_XFRM_MODE_TRANSPORT=y 223CONFIG_INET_XFRM_MODE_TRANSPORT=y
220CONFIG_INET_XFRM_MODE_TUNNEL=y 224CONFIG_INET_XFRM_MODE_TUNNEL=y
221CONFIG_INET_XFRM_MODE_BEET=y 225CONFIG_INET_XFRM_MODE_BEET=y
226CONFIG_INET_LRO=y
222CONFIG_INET_DIAG=y 227CONFIG_INET_DIAG=y
223CONFIG_INET_TCP_DIAG=y 228CONFIG_INET_TCP_DIAG=y
224# CONFIG_TCP_CONG_ADVANCED is not set 229# CONFIG_TCP_CONG_ADVANCED is not set
225CONFIG_TCP_CONG_CUBIC=y 230CONFIG_TCP_CONG_CUBIC=y
226CONFIG_DEFAULT_TCP_CONG="cubic" 231CONFIG_DEFAULT_TCP_CONG="cubic"
227# CONFIG_TCP_MD5SIG is not set 232# CONFIG_TCP_MD5SIG is not set
233# CONFIG_IP_VS is not set
228CONFIG_IPV6=y 234CONFIG_IPV6=y
229# CONFIG_IPV6_PRIVACY is not set 235# CONFIG_IPV6_PRIVACY is not set
230# CONFIG_IPV6_ROUTER_PREF is not set 236# CONFIG_IPV6_ROUTER_PREF is not set
@@ -243,7 +249,48 @@ CONFIG_IPV6_SIT=y
243# CONFIG_IPV6_TUNNEL is not set 249# CONFIG_IPV6_TUNNEL is not set
244# CONFIG_IPV6_MULTIPLE_TABLES is not set 250# CONFIG_IPV6_MULTIPLE_TABLES is not set
245# CONFIG_NETWORK_SECMARK is not set 251# CONFIG_NETWORK_SECMARK is not set
246# CONFIG_NETFILTER is not set 252CONFIG_NETFILTER=y
253# CONFIG_NETFILTER_DEBUG is not set
254
255#
256# Core Netfilter Configuration
257#
258CONFIG_NETFILTER_NETLINK=m
259CONFIG_NETFILTER_NETLINK_QUEUE=m
260CONFIG_NETFILTER_NETLINK_LOG=m
261CONFIG_NF_CONNTRACK_ENABLED=m
262CONFIG_NF_CONNTRACK=m
263# CONFIG_NF_CT_ACCT is not set
264# CONFIG_NF_CONNTRACK_MARK is not set
265# CONFIG_NF_CONNTRACK_EVENTS is not set
266# CONFIG_NF_CT_PROTO_SCTP is not set
267# CONFIG_NF_CT_PROTO_UDPLITE is not set
268# CONFIG_NF_CONNTRACK_AMANDA is not set
269# CONFIG_NF_CONNTRACK_FTP is not set
270# CONFIG_NF_CONNTRACK_H323 is not set
271# CONFIG_NF_CONNTRACK_IRC is not set
272# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
273# CONFIG_NF_CONNTRACK_PPTP is not set
274# CONFIG_NF_CONNTRACK_SANE is not set
275# CONFIG_NF_CONNTRACK_SIP is not set
276# CONFIG_NF_CONNTRACK_TFTP is not set
277# CONFIG_NF_CT_NETLINK is not set
278# CONFIG_NETFILTER_XTABLES is not set
279
280#
281# IP: Netfilter Configuration
282#
283# CONFIG_NF_CONNTRACK_IPV4 is not set
284# CONFIG_IP_NF_QUEUE is not set
285# CONFIG_IP_NF_IPTABLES is not set
286# CONFIG_IP_NF_ARPTABLES is not set
287
288#
289# IPv6: Netfilter Configuration (EXPERIMENTAL)
290#
291# CONFIG_NF_CONNTRACK_IPV6 is not set
292# CONFIG_IP6_NF_QUEUE is not set
293# CONFIG_IP6_NF_IPTABLES is not set
247# CONFIG_IP_DCCP is not set 294# CONFIG_IP_DCCP is not set
248CONFIG_IP_SCTP=m 295CONFIG_IP_SCTP=m
249# CONFIG_SCTP_DBG_MSG is not set 296# CONFIG_SCTP_DBG_MSG is not set
@@ -263,12 +310,7 @@ CONFIG_SCTP_HMAC_MD5=y
263# CONFIG_LAPB is not set 310# CONFIG_LAPB is not set
264# CONFIG_ECONET is not set 311# CONFIG_ECONET is not set
265# CONFIG_WAN_ROUTER is not set 312# CONFIG_WAN_ROUTER is not set
266
267#
268# QoS and/or fair queueing
269#
270CONFIG_NET_SCHED=y 313CONFIG_NET_SCHED=y
271CONFIG_NET_SCH_FIFO=y
272 314
273# 315#
274# Queueing/Scheduling 316# Queueing/Scheduling
@@ -306,10 +348,12 @@ CONFIG_NET_CLS_ACT=y
306CONFIG_NET_ACT_POLICE=y 348CONFIG_NET_ACT_POLICE=y
307# CONFIG_NET_ACT_GACT is not set 349# CONFIG_NET_ACT_GACT is not set
308# CONFIG_NET_ACT_MIRRED is not set 350# CONFIG_NET_ACT_MIRRED is not set
351CONFIG_NET_ACT_NAT=m
309# CONFIG_NET_ACT_PEDIT is not set 352# CONFIG_NET_ACT_PEDIT is not set
310# CONFIG_NET_ACT_SIMP is not set 353# CONFIG_NET_ACT_SIMP is not set
311CONFIG_NET_CLS_POLICE=y 354CONFIG_NET_CLS_POLICE=y
312# CONFIG_NET_CLS_IND is not set 355# CONFIG_NET_CLS_IND is not set
356CONFIG_NET_SCH_FIFO=y
313 357
314# 358#
315# Network testing 359# Network testing
@@ -329,6 +373,7 @@ CONFIG_CCW=y
329# 373#
330# Generic Driver Options 374# Generic Driver Options
331# 375#
376CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
332CONFIG_STANDALONE=y 377CONFIG_STANDALONE=y
333CONFIG_PREVENT_FIRMWARE_BUILD=y 378CONFIG_PREVENT_FIRMWARE_BUILD=y
334# CONFIG_FW_LOADER is not set 379# CONFIG_FW_LOADER is not set
@@ -400,17 +445,11 @@ CONFIG_SCSI_FC_ATTRS=y
400# CONFIG_SCSI_ISCSI_ATTRS is not set 445# CONFIG_SCSI_ISCSI_ATTRS is not set
401# CONFIG_SCSI_SAS_ATTRS is not set 446# CONFIG_SCSI_SAS_ATTRS is not set
402# CONFIG_SCSI_SAS_LIBSAS is not set 447# CONFIG_SCSI_SAS_LIBSAS is not set
403 448# CONFIG_SCSI_SRP_ATTRS is not set
404# 449CONFIG_SCSI_LOWLEVEL=y
405# SCSI low-level drivers
406#
407# CONFIG_ISCSI_TCP is not set 450# CONFIG_ISCSI_TCP is not set
408# CONFIG_SCSI_DEBUG is not set 451# CONFIG_SCSI_DEBUG is not set
409CONFIG_ZFCP=y 452CONFIG_ZFCP=y
410
411#
412# Multi-device support (RAID and LVM)
413#
414CONFIG_MD=y 453CONFIG_MD=y
415CONFIG_BLK_DEV_MD=y 454CONFIG_BLK_DEV_MD=y
416CONFIG_MD_LINEAR=m 455CONFIG_MD_LINEAR=m
@@ -429,7 +468,9 @@ CONFIG_DM_ZERO=y
429CONFIG_DM_MULTIPATH=y 468CONFIG_DM_MULTIPATH=y
430# CONFIG_DM_MULTIPATH_EMC is not set 469# CONFIG_DM_MULTIPATH_EMC is not set
431# CONFIG_DM_MULTIPATH_RDAC is not set 470# CONFIG_DM_MULTIPATH_RDAC is not set
471# CONFIG_DM_MULTIPATH_HP is not set
432# CONFIG_DM_DELAY is not set 472# CONFIG_DM_DELAY is not set
473# CONFIG_DM_UEVENT is not set
433CONFIG_NETDEVICES=y 474CONFIG_NETDEVICES=y
434# CONFIG_NETDEVICES_MULTIQUEUE is not set 475# CONFIG_NETDEVICES_MULTIQUEUE is not set
435# CONFIG_IFB is not set 476# CONFIG_IFB is not set
@@ -438,8 +479,13 @@ CONFIG_BONDING=m
438# CONFIG_MACVLAN is not set 479# CONFIG_MACVLAN is not set
439CONFIG_EQUALIZER=m 480CONFIG_EQUALIZER=m
440CONFIG_TUN=m 481CONFIG_TUN=m
482CONFIG_VETH=m
441CONFIG_NET_ETHERNET=y 483CONFIG_NET_ETHERNET=y
442# CONFIG_MII is not set 484# CONFIG_MII is not set
485# CONFIG_IBM_NEW_EMAC_ZMII is not set
486# CONFIG_IBM_NEW_EMAC_RGMII is not set
487# CONFIG_IBM_NEW_EMAC_TAH is not set
488# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
443CONFIG_NETDEV_1000=y 489CONFIG_NETDEV_1000=y
444CONFIG_NETDEV_10000=y 490CONFIG_NETDEV_10000=y
445# CONFIG_TR is not set 491# CONFIG_TR is not set
@@ -473,7 +519,6 @@ CONFIG_CCWGROUP=y
473CONFIG_UNIX98_PTYS=y 519CONFIG_UNIX98_PTYS=y
474CONFIG_LEGACY_PTYS=y 520CONFIG_LEGACY_PTYS=y
475CONFIG_LEGACY_PTY_COUNT=256 521CONFIG_LEGACY_PTY_COUNT=256
476# CONFIG_WATCHDOG is not set
477CONFIG_HW_RANDOM=m 522CONFIG_HW_RANDOM=m
478# CONFIG_R3964 is not set 523# CONFIG_R3964 is not set
479CONFIG_RAW_DRIVER=m 524CONFIG_RAW_DRIVER=m
@@ -490,7 +535,6 @@ CONFIG_TN3270_CONSOLE=y
490CONFIG_TN3215=y 535CONFIG_TN3215=y
491CONFIG_TN3215_CONSOLE=y 536CONFIG_TN3215_CONSOLE=y
492CONFIG_CCW_CONSOLE=y 537CONFIG_CCW_CONSOLE=y
493CONFIG_SCLP=y
494CONFIG_SCLP_TTY=y 538CONFIG_SCLP_TTY=y
495CONFIG_SCLP_CONSOLE=y 539CONFIG_SCLP_CONSOLE=y
496CONFIG_SCLP_VT220_TTY=y 540CONFIG_SCLP_VT220_TTY=y
@@ -514,6 +558,11 @@ CONFIG_S390_TAPE_34XX=m
514CONFIG_MONWRITER=m 558CONFIG_MONWRITER=m
515CONFIG_S390_VMUR=m 559CONFIG_S390_VMUR=m
516# CONFIG_POWER_SUPPLY is not set 560# CONFIG_POWER_SUPPLY is not set
561# CONFIG_WATCHDOG is not set
562
563#
564# Sonics Silicon Backplane
565#
517 566
518# 567#
519# File systems 568# File systems
@@ -569,7 +618,6 @@ CONFIG_SYSFS=y
569CONFIG_TMPFS=y 618CONFIG_TMPFS=y
570CONFIG_TMPFS_POSIX_ACL=y 619CONFIG_TMPFS_POSIX_ACL=y
571# CONFIG_HUGETLB_PAGE is not set 620# CONFIG_HUGETLB_PAGE is not set
572CONFIG_RAMFS=y
573CONFIG_CONFIGFS_FS=m 621CONFIG_CONFIGFS_FS=m
574 622
575# 623#
@@ -588,10 +636,7 @@ CONFIG_CONFIGFS_FS=m
588# CONFIG_QNX4FS_FS is not set 636# CONFIG_QNX4FS_FS is not set
589# CONFIG_SYSV_FS is not set 637# CONFIG_SYSV_FS is not set
590# CONFIG_UFS_FS is not set 638# CONFIG_UFS_FS is not set
591 639CONFIG_NETWORK_FILESYSTEMS=y
592#
593# Network File Systems
594#
595CONFIG_NFS_FS=y 640CONFIG_NFS_FS=y
596CONFIG_NFS_V3=y 641CONFIG_NFS_V3=y
597# CONFIG_NFS_V3_ACL is not set 642# CONFIG_NFS_V3_ACL is not set
@@ -638,27 +683,13 @@ CONFIG_MSDOS_PARTITION=y
638# CONFIG_KARMA_PARTITION is not set 683# CONFIG_KARMA_PARTITION is not set
639# CONFIG_EFI_PARTITION is not set 684# CONFIG_EFI_PARTITION is not set
640# CONFIG_SYSV68_PARTITION is not set 685# CONFIG_SYSV68_PARTITION is not set
641
642#
643# Native Language Support
644#
645# CONFIG_NLS is not set 686# CONFIG_NLS is not set
646
647#
648# Distributed Lock Manager
649#
650CONFIG_DLM=m 687CONFIG_DLM=m
651# CONFIG_DLM_DEBUG is not set 688# CONFIG_DLM_DEBUG is not set
652 689CONFIG_INSTRUMENTATION=y
653#
654# Instrumentation Support
655#
656
657#
658# Profiling support
659#
660# CONFIG_PROFILING is not set 690# CONFIG_PROFILING is not set
661CONFIG_KPROBES=y 691CONFIG_KPROBES=y
692# CONFIG_MARKERS is not set
662 693
663# 694#
664# Kernel hacking 695# Kernel hacking
@@ -682,6 +713,7 @@ CONFIG_DEBUG_SPINLOCK=y
682CONFIG_DEBUG_MUTEXES=y 713CONFIG_DEBUG_MUTEXES=y
683# CONFIG_DEBUG_LOCK_ALLOC is not set 714# CONFIG_DEBUG_LOCK_ALLOC is not set
684# CONFIG_PROVE_LOCKING is not set 715# CONFIG_PROVE_LOCKING is not set
716# CONFIG_LOCK_STAT is not set
685CONFIG_DEBUG_SPINLOCK_SLEEP=y 717CONFIG_DEBUG_SPINLOCK_SLEEP=y
686# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 718# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
687# CONFIG_DEBUG_KOBJECT is not set 719# CONFIG_DEBUG_KOBJECT is not set
@@ -694,14 +726,17 @@ CONFIG_FORCED_INLINING=y
694# CONFIG_RCU_TORTURE_TEST is not set 726# CONFIG_RCU_TORTURE_TEST is not set
695# CONFIG_LKDTM is not set 727# CONFIG_LKDTM is not set
696# CONFIG_FAULT_INJECTION is not set 728# CONFIG_FAULT_INJECTION is not set
729CONFIG_SAMPLES=y
697 730
698# 731#
699# Security options 732# Security options
700# 733#
701# CONFIG_KEYS is not set 734# CONFIG_KEYS is not set
702# CONFIG_SECURITY is not set 735# CONFIG_SECURITY is not set
736# CONFIG_SECURITY_FILE_CAPABILITIES is not set
703CONFIG_CRYPTO=y 737CONFIG_CRYPTO=y
704CONFIG_CRYPTO_ALGAPI=y 738CONFIG_CRYPTO_ALGAPI=y
739CONFIG_CRYPTO_AEAD=m
705CONFIG_CRYPTO_BLKCIPHER=y 740CONFIG_CRYPTO_BLKCIPHER=y
706CONFIG_CRYPTO_HASH=m 741CONFIG_CRYPTO_HASH=m
707CONFIG_CRYPTO_MANAGER=y 742CONFIG_CRYPTO_MANAGER=y
@@ -720,6 +755,7 @@ CONFIG_CRYPTO_ECB=m
720CONFIG_CRYPTO_CBC=y 755CONFIG_CRYPTO_CBC=y
721CONFIG_CRYPTO_PCBC=m 756CONFIG_CRYPTO_PCBC=m
722# CONFIG_CRYPTO_LRW is not set 757# CONFIG_CRYPTO_LRW is not set
758# CONFIG_CRYPTO_XTS is not set
723# CONFIG_CRYPTO_CRYPTD is not set 759# CONFIG_CRYPTO_CRYPTD is not set
724# CONFIG_CRYPTO_DES is not set 760# CONFIG_CRYPTO_DES is not set
725CONFIG_CRYPTO_FCRYPT=m 761CONFIG_CRYPTO_FCRYPT=m
@@ -733,11 +769,13 @@ CONFIG_CRYPTO_FCRYPT=m
733# CONFIG_CRYPTO_ARC4 is not set 769# CONFIG_CRYPTO_ARC4 is not set
734# CONFIG_CRYPTO_KHAZAD is not set 770# CONFIG_CRYPTO_KHAZAD is not set
735# CONFIG_CRYPTO_ANUBIS is not set 771# CONFIG_CRYPTO_ANUBIS is not set
772CONFIG_CRYPTO_SEED=m
736# CONFIG_CRYPTO_DEFLATE is not set 773# CONFIG_CRYPTO_DEFLATE is not set
737# CONFIG_CRYPTO_MICHAEL_MIC is not set 774# CONFIG_CRYPTO_MICHAEL_MIC is not set
738# CONFIG_CRYPTO_CRC32C is not set 775# CONFIG_CRYPTO_CRC32C is not set
739CONFIG_CRYPTO_CAMELLIA=m 776CONFIG_CRYPTO_CAMELLIA=m
740# CONFIG_CRYPTO_TEST is not set 777# CONFIG_CRYPTO_TEST is not set
778CONFIG_CRYPTO_AUTHENC=m
741CONFIG_CRYPTO_HW=y 779CONFIG_CRYPTO_HW=y
742# CONFIG_CRYPTO_SHA1_S390 is not set 780# CONFIG_CRYPTO_SHA1_S390 is not set
743# CONFIG_CRYPTO_SHA256_S390 is not set 781# CONFIG_CRYPTO_SHA256_S390 is not set
@@ -755,5 +793,6 @@ CONFIG_BITREVERSE=m
755# CONFIG_CRC16 is not set 793# CONFIG_CRC16 is not set
756# CONFIG_CRC_ITU_T is not set 794# CONFIG_CRC_ITU_T is not set
757CONFIG_CRC32=m 795CONFIG_CRC32=m
796CONFIG_CRC7=m
758# CONFIG_LIBCRC32C is not set 797# CONFIG_LIBCRC32C is not set
759CONFIG_PLIST=y 798CONFIG_PLIST=y
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 66b51901c87d..ce0856d32500 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -648,6 +648,8 @@ static int dump_set_type(enum dump_type type)
648 case DUMP_TYPE_CCW: 648 case DUMP_TYPE_CCW:
649 if (MACHINE_IS_VM) 649 if (MACHINE_IS_VM)
650 dump_method = DUMP_METHOD_CCW_VM; 650 dump_method = DUMP_METHOD_CCW_VM;
651 else if (diag308_set_works)
652 dump_method = DUMP_METHOD_CCW_DIAG;
651 else 653 else
652 dump_method = DUMP_METHOD_CCW_CIO; 654 dump_method = DUMP_METHOD_CCW_CIO;
653 break; 655 break;
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 70c57378f426..96492cf2d491 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -44,6 +44,7 @@
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/timer.h> 46#include <asm/timer.h>
47#include <asm/cpu.h>
47 48
48asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 49asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
49 50
@@ -91,6 +92,14 @@ EXPORT_SYMBOL(unregister_idle_notifier);
91 92
92void do_monitor_call(struct pt_regs *regs, long interruption_code) 93void do_monitor_call(struct pt_regs *regs, long interruption_code)
93{ 94{
95 struct s390_idle_data *idle;
96
97 idle = &__get_cpu_var(s390_idle);
98 spin_lock(&idle->lock);
99 idle->idle_time += get_clock() - idle->idle_enter;
100 idle->in_idle = 0;
101 spin_unlock(&idle->lock);
102
94 /* disable monitor call class 0 */ 103 /* disable monitor call class 0 */
95 __ctl_clear_bit(8, 15); 104 __ctl_clear_bit(8, 15);
96 105
@@ -105,6 +114,7 @@ extern void s390_handle_mcck(void);
105static void default_idle(void) 114static void default_idle(void)
106{ 115{
107 int cpu, rc; 116 int cpu, rc;
117 struct s390_idle_data *idle;
108 118
109 /* CPU is going idle. */ 119 /* CPU is going idle. */
110 cpu = smp_processor_id(); 120 cpu = smp_processor_id();
@@ -142,6 +152,12 @@ static void default_idle(void)
142 return; 152 return;
143 } 153 }
144 154
155 idle = &__get_cpu_var(s390_idle);
156 spin_lock(&idle->lock);
157 idle->idle_count++;
158 idle->in_idle = 1;
159 idle->idle_enter = get_clock();
160 spin_unlock(&idle->lock);
145 trace_hardirqs_on(); 161 trace_hardirqs_on();
146 /* Wait for external, I/O or machine check interrupt. */ 162 /* Wait for external, I/O or machine check interrupt. */
147 __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | 163 __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
@@ -254,14 +270,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
254 save_fp_regs(&current->thread.fp_regs); 270 save_fp_regs(&current->thread.fp_regs);
255 memcpy(&p->thread.fp_regs, &current->thread.fp_regs, 271 memcpy(&p->thread.fp_regs, &current->thread.fp_regs,
256 sizeof(s390_fp_regs)); 272 sizeof(s390_fp_regs));
257 p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _SEGMENT_TABLE;
258 /* Set a new TLS ? */ 273 /* Set a new TLS ? */
259 if (clone_flags & CLONE_SETTLS) 274 if (clone_flags & CLONE_SETTLS)
260 p->thread.acrs[0] = regs->gprs[6]; 275 p->thread.acrs[0] = regs->gprs[6];
261#else /* CONFIG_64BIT */ 276#else /* CONFIG_64BIT */
262 /* Save the fpu registers to new thread structure. */ 277 /* Save the fpu registers to new thread structure. */
263 save_fp_regs(&p->thread.fp_regs); 278 save_fp_regs(&p->thread.fp_regs);
264 p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _REGION_TABLE;
265 /* Set a new TLS ? */ 279 /* Set a new TLS ? */
266 if (clone_flags & CLONE_SETTLS) { 280 if (clone_flags & CLONE_SETTLS) {
267 if (test_thread_flag(TIF_31BIT)) { 281 if (test_thread_flag(TIF_31BIT)) {
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 35edbef1d222..1d97fe1c0e53 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -42,6 +42,7 @@
42#include <asm/tlbflush.h> 42#include <asm/tlbflush.h>
43#include <asm/timer.h> 43#include <asm/timer.h>
44#include <asm/lowcore.h> 44#include <asm/lowcore.h>
45#include <asm/cpu.h>
45 46
46/* 47/*
47 * An array with a pointer the lowcore of every CPU. 48 * An array with a pointer the lowcore of every CPU.
@@ -325,7 +326,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
325 */ 326 */
326void smp_ptlb_callback(void *info) 327void smp_ptlb_callback(void *info)
327{ 328{
328 local_flush_tlb(); 329 __tlb_flush_local();
329} 330}
330 331
331void smp_ptlb_all(void) 332void smp_ptlb_all(void)
@@ -494,6 +495,8 @@ int __cpuinit start_secondary(void *cpuvoid)
494 return 0; 495 return 0;
495} 496}
496 497
498DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
499
497static void __init smp_create_idle(unsigned int cpu) 500static void __init smp_create_idle(unsigned int cpu)
498{ 501{
499 struct task_struct *p; 502 struct task_struct *p;
@@ -506,6 +509,7 @@ static void __init smp_create_idle(unsigned int cpu)
506 if (IS_ERR(p)) 509 if (IS_ERR(p))
507 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); 510 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
508 current_set[cpu] = p; 511 current_set[cpu] = p;
512 spin_lock_init(&(&per_cpu(s390_idle, cpu))->lock);
509} 513}
510 514
511static int cpu_stopped(int cpu) 515static int cpu_stopped(int cpu)
@@ -724,6 +728,7 @@ void __init smp_prepare_boot_cpu(void)
724 cpu_set(0, cpu_online_map); 728 cpu_set(0, cpu_online_map);
725 S390_lowcore.percpu_offset = __per_cpu_offset[0]; 729 S390_lowcore.percpu_offset = __per_cpu_offset[0];
726 current_set[0] = current; 730 current_set[0] = current;
731 spin_lock_init(&(&__get_cpu_var(s390_idle))->lock);
727} 732}
728 733
729void __init smp_cpus_done(unsigned int max_cpus) 734void __init smp_cpus_done(unsigned int max_cpus)
@@ -756,22 +761,71 @@ static ssize_t show_capability(struct sys_device *dev, char *buf)
756} 761}
757static SYSDEV_ATTR(capability, 0444, show_capability, NULL); 762static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
758 763
764static ssize_t show_idle_count(struct sys_device *dev, char *buf)
765{
766 struct s390_idle_data *idle;
767 unsigned long long idle_count;
768
769 idle = &per_cpu(s390_idle, dev->id);
770 spin_lock_irq(&idle->lock);
771 idle_count = idle->idle_count;
772 spin_unlock_irq(&idle->lock);
773 return sprintf(buf, "%llu\n", idle_count);
774}
775static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
776
777static ssize_t show_idle_time(struct sys_device *dev, char *buf)
778{
779 struct s390_idle_data *idle;
780 unsigned long long new_time;
781
782 idle = &per_cpu(s390_idle, dev->id);
783 spin_lock_irq(&idle->lock);
784 if (idle->in_idle) {
785 new_time = get_clock();
786 idle->idle_time += new_time - idle->idle_enter;
787 idle->idle_enter = new_time;
788 }
789 new_time = idle->idle_time;
790 spin_unlock_irq(&idle->lock);
791 return sprintf(buf, "%llu us\n", new_time >> 12);
792}
793static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL);
794
795static struct attribute *cpu_attrs[] = {
796 &attr_capability.attr,
797 &attr_idle_count.attr,
798 &attr_idle_time.attr,
799 NULL,
800};
801
802static struct attribute_group cpu_attr_group = {
803 .attrs = cpu_attrs,
804};
805
759static int __cpuinit smp_cpu_notify(struct notifier_block *self, 806static int __cpuinit smp_cpu_notify(struct notifier_block *self,
760 unsigned long action, void *hcpu) 807 unsigned long action, void *hcpu)
761{ 808{
762 unsigned int cpu = (unsigned int)(long)hcpu; 809 unsigned int cpu = (unsigned int)(long)hcpu;
763 struct cpu *c = &per_cpu(cpu_devices, cpu); 810 struct cpu *c = &per_cpu(cpu_devices, cpu);
764 struct sys_device *s = &c->sysdev; 811 struct sys_device *s = &c->sysdev;
812 struct s390_idle_data *idle;
765 813
766 switch (action) { 814 switch (action) {
767 case CPU_ONLINE: 815 case CPU_ONLINE:
768 case CPU_ONLINE_FROZEN: 816 case CPU_ONLINE_FROZEN:
769 if (sysdev_create_file(s, &attr_capability)) 817 idle = &per_cpu(s390_idle, cpu);
818 spin_lock_irq(&idle->lock);
819 idle->idle_enter = 0;
820 idle->idle_time = 0;
821 idle->idle_count = 0;
822 spin_unlock_irq(&idle->lock);
823 if (sysfs_create_group(&s->kobj, &cpu_attr_group))
770 return NOTIFY_BAD; 824 return NOTIFY_BAD;
771 break; 825 break;
772 case CPU_DEAD: 826 case CPU_DEAD:
773 case CPU_DEAD_FROZEN: 827 case CPU_DEAD_FROZEN:
774 sysdev_remove_file(s, &attr_capability); 828 sysfs_remove_group(&s->kobj, &cpu_attr_group);
775 break; 829 break;
776 } 830 }
777 return NOTIFY_OK; 831 return NOTIFY_OK;
@@ -784,6 +838,7 @@ static struct notifier_block __cpuinitdata smp_cpu_nb = {
784static int __init topology_init(void) 838static int __init topology_init(void)
785{ 839{
786 int cpu; 840 int cpu;
841 int rc;
787 842
788 register_cpu_notifier(&smp_cpu_nb); 843 register_cpu_notifier(&smp_cpu_nb);
789 844
@@ -796,7 +851,9 @@ static int __init topology_init(void)
796 if (!cpu_online(cpu)) 851 if (!cpu_online(cpu))
797 continue; 852 continue;
798 s = &c->sysdev; 853 s = &c->sysdev;
799 sysdev_create_file(s, &attr_capability); 854 rc = sysfs_create_group(&s->kobj, &cpu_attr_group);
855 if (rc)
856 return rc;
800 } 857 }
801 return 0; 858 return 0;
802} 859}
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index b159a9d65680..7e8efaade2ea 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -15,6 +15,27 @@
15#include <asm/futex.h> 15#include <asm/futex.h>
16#include "uaccess.h" 16#include "uaccess.h"
17 17
18static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr)
19{
20 pgd_t *pgd;
21 pud_t *pud;
22 pmd_t *pmd;
23
24 pgd = pgd_offset(mm, addr);
25 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
26 return NULL;
27
28 pud = pud_offset(pgd, addr);
29 if (pud_none(*pud) || unlikely(pud_bad(*pud)))
30 return NULL;
31
32 pmd = pmd_offset(pud, addr);
33 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
34 return NULL;
35
36 return pte_offset_map(pmd, addr);
37}
38
18static int __handle_fault(struct mm_struct *mm, unsigned long address, 39static int __handle_fault(struct mm_struct *mm, unsigned long address,
19 int write_access) 40 int write_access)
20{ 41{
@@ -85,8 +106,6 @@ static size_t __user_copy_pt(unsigned long uaddr, void *kptr,
85{ 106{
86 struct mm_struct *mm = current->mm; 107 struct mm_struct *mm = current->mm;
87 unsigned long offset, pfn, done, size; 108 unsigned long offset, pfn, done, size;
88 pgd_t *pgd;
89 pmd_t *pmd;
90 pte_t *pte; 109 pte_t *pte;
91 void *from, *to; 110 void *from, *to;
92 111
@@ -94,15 +113,7 @@ static size_t __user_copy_pt(unsigned long uaddr, void *kptr,
94retry: 113retry:
95 spin_lock(&mm->page_table_lock); 114 spin_lock(&mm->page_table_lock);
96 do { 115 do {
97 pgd = pgd_offset(mm, uaddr); 116 pte = follow_table(mm, uaddr);
98 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
99 goto fault;
100
101 pmd = pmd_offset(pgd, uaddr);
102 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
103 goto fault;
104
105 pte = pte_offset_map(pmd, uaddr);
106 if (!pte || !pte_present(*pte) || 117 if (!pte || !pte_present(*pte) ||
107 (write_user && !pte_write(*pte))) 118 (write_user && !pte_write(*pte)))
108 goto fault; 119 goto fault;
@@ -142,22 +153,12 @@ static unsigned long __dat_user_addr(unsigned long uaddr)
142{ 153{
143 struct mm_struct *mm = current->mm; 154 struct mm_struct *mm = current->mm;
144 unsigned long pfn, ret; 155 unsigned long pfn, ret;
145 pgd_t *pgd;
146 pmd_t *pmd;
147 pte_t *pte; 156 pte_t *pte;
148 int rc; 157 int rc;
149 158
150 ret = 0; 159 ret = 0;
151retry: 160retry:
152 pgd = pgd_offset(mm, uaddr); 161 pte = follow_table(mm, uaddr);
153 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
154 goto fault;
155
156 pmd = pmd_offset(pgd, uaddr);
157 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
158 goto fault;
159
160 pte = pte_offset_map(pmd, uaddr);
161 if (!pte || !pte_present(*pte)) 162 if (!pte || !pte_present(*pte))
162 goto fault; 163 goto fault;
163 164
@@ -229,8 +230,6 @@ static size_t strnlen_user_pt(size_t count, const char __user *src)
229 unsigned long uaddr = (unsigned long) src; 230 unsigned long uaddr = (unsigned long) src;
230 struct mm_struct *mm = current->mm; 231 struct mm_struct *mm = current->mm;
231 unsigned long offset, pfn, done, len; 232 unsigned long offset, pfn, done, len;
232 pgd_t *pgd;
233 pmd_t *pmd;
234 pte_t *pte; 233 pte_t *pte;
235 size_t len_str; 234 size_t len_str;
236 235
@@ -240,15 +239,7 @@ static size_t strnlen_user_pt(size_t count, const char __user *src)
240retry: 239retry:
241 spin_lock(&mm->page_table_lock); 240 spin_lock(&mm->page_table_lock);
242 do { 241 do {
243 pgd = pgd_offset(mm, uaddr); 242 pte = follow_table(mm, uaddr);
244 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
245 goto fault;
246
247 pmd = pmd_offset(pgd, uaddr);
248 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
249 goto fault;
250
251 pte = pte_offset_map(pmd, uaddr);
252 if (!pte || !pte_present(*pte)) 243 if (!pte || !pte_present(*pte))
253 goto fault; 244 goto fault;
254 245
@@ -308,8 +299,6 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
308 uaddr, done, size; 299 uaddr, done, size;
309 unsigned long uaddr_from = (unsigned long) from; 300 unsigned long uaddr_from = (unsigned long) from;
310 unsigned long uaddr_to = (unsigned long) to; 301 unsigned long uaddr_to = (unsigned long) to;
311 pgd_t *pgd_from, *pgd_to;
312 pmd_t *pmd_from, *pmd_to;
313 pte_t *pte_from, *pte_to; 302 pte_t *pte_from, *pte_to;
314 int write_user; 303 int write_user;
315 304
@@ -317,39 +306,14 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
317retry: 306retry:
318 spin_lock(&mm->page_table_lock); 307 spin_lock(&mm->page_table_lock);
319 do { 308 do {
320 pgd_from = pgd_offset(mm, uaddr_from); 309 pte_from = follow_table(mm, uaddr_from);
321 if (pgd_none(*pgd_from) || unlikely(pgd_bad(*pgd_from))) {
322 uaddr = uaddr_from;
323 write_user = 0;
324 goto fault;
325 }
326 pgd_to = pgd_offset(mm, uaddr_to);
327 if (pgd_none(*pgd_to) || unlikely(pgd_bad(*pgd_to))) {
328 uaddr = uaddr_to;
329 write_user = 1;
330 goto fault;
331 }
332
333 pmd_from = pmd_offset(pgd_from, uaddr_from);
334 if (pmd_none(*pmd_from) || unlikely(pmd_bad(*pmd_from))) {
335 uaddr = uaddr_from;
336 write_user = 0;
337 goto fault;
338 }
339 pmd_to = pmd_offset(pgd_to, uaddr_to);
340 if (pmd_none(*pmd_to) || unlikely(pmd_bad(*pmd_to))) {
341 uaddr = uaddr_to;
342 write_user = 1;
343 goto fault;
344 }
345
346 pte_from = pte_offset_map(pmd_from, uaddr_from);
347 if (!pte_from || !pte_present(*pte_from)) { 310 if (!pte_from || !pte_present(*pte_from)) {
348 uaddr = uaddr_from; 311 uaddr = uaddr_from;
349 write_user = 0; 312 write_user = 0;
350 goto fault; 313 goto fault;
351 } 314 }
352 pte_to = pte_offset_map(pmd_to, uaddr_to); 315
316 pte_to = follow_table(mm, uaddr_to);
353 if (!pte_to || !pte_present(*pte_to) || !pte_write(*pte_to)) { 317 if (!pte_to || !pte_present(*pte_to) || !pte_write(*pte_to)) {
354 uaddr = uaddr_to; 318 uaddr = uaddr_to;
355 write_user = 1; 319 write_user = 1;
diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
index f95449b29fa5..66401930f83e 100644
--- a/arch/s390/mm/Makefile
+++ b/arch/s390/mm/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the linux s390-specific parts of the memory manager. 2# Makefile for the linux s390-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o fault.o extmem.o mmap.o vmem.o 5obj-y := init.o fault.o extmem.o mmap.o vmem.o pgtable.o
6obj-$(CONFIG_CMM) += cmm.o 6obj-$(CONFIG_CMM) += cmm.o
7 7
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 3a25bbf2eb0a..b234bb4a6da7 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -81,6 +81,7 @@ void show_mem(void)
81static void __init setup_ro_region(void) 81static void __init setup_ro_region(void)
82{ 82{
83 pgd_t *pgd; 83 pgd_t *pgd;
84 pud_t *pud;
84 pmd_t *pmd; 85 pmd_t *pmd;
85 pte_t *pte; 86 pte_t *pte;
86 pte_t new_pte; 87 pte_t new_pte;
@@ -91,7 +92,8 @@ static void __init setup_ro_region(void)
91 92
92 for (; address < end; address += PAGE_SIZE) { 93 for (; address < end; address += PAGE_SIZE) {
93 pgd = pgd_offset_k(address); 94 pgd = pgd_offset_k(address);
94 pmd = pmd_offset(pgd, address); 95 pud = pud_offset(pgd, address);
96 pmd = pmd_offset(pud, address);
95 pte = pte_offset_kernel(pmd, address); 97 pte = pte_offset_kernel(pmd, address);
96 new_pte = mk_pte_phys(address, __pgprot(_PAGE_RO)); 98 new_pte = mk_pte_phys(address, __pgprot(_PAGE_RO));
97 *pte = new_pte; 99 *pte = new_pte;
@@ -103,32 +105,28 @@ static void __init setup_ro_region(void)
103 */ 105 */
104void __init paging_init(void) 106void __init paging_init(void)
105{ 107{
106 pgd_t *pg_dir;
107 int i;
108 unsigned long pgdir_k;
109 static const int ssm_mask = 0x04000000L; 108 static const int ssm_mask = 0x04000000L;
110 unsigned long max_zone_pfns[MAX_NR_ZONES]; 109 unsigned long max_zone_pfns[MAX_NR_ZONES];
110 unsigned long pgd_type;
111 111
112 pg_dir = swapper_pg_dir; 112 init_mm.pgd = swapper_pg_dir;
113 113 S390_lowcore.kernel_asce = __pa(init_mm.pgd) & PAGE_MASK;
114#ifdef CONFIG_64BIT 114#ifdef CONFIG_64BIT
115 pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERN_REGION_TABLE; 115 S390_lowcore.kernel_asce |= _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH;
116 for (i = 0; i < PTRS_PER_PGD; i++) 116 pgd_type = _REGION3_ENTRY_EMPTY;
117 pgd_clear_kernel(pg_dir + i);
118#else 117#else
119 pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE; 118 S390_lowcore.kernel_asce |= _ASCE_TABLE_LENGTH;
120 for (i = 0; i < PTRS_PER_PGD; i++) 119 pgd_type = _SEGMENT_ENTRY_EMPTY;
121 pmd_clear_kernel((pmd_t *)(pg_dir + i));
122#endif 120#endif
121 clear_table((unsigned long *) init_mm.pgd, pgd_type,
122 sizeof(unsigned long)*2048);
123 vmem_map_init(); 123 vmem_map_init();
124 setup_ro_region(); 124 setup_ro_region();
125 125
126 S390_lowcore.kernel_asce = pgdir_k;
127
128 /* enable virtual mapping in kernel mode */ 126 /* enable virtual mapping in kernel mode */
129 __ctl_load(pgdir_k, 1, 1); 127 __ctl_load(S390_lowcore.kernel_asce, 1, 1);
130 __ctl_load(pgdir_k, 7, 7); 128 __ctl_load(S390_lowcore.kernel_asce, 7, 7);
131 __ctl_load(pgdir_k, 13, 13); 129 __ctl_load(S390_lowcore.kernel_asce, 13, 13);
132 __raw_local_irq_ssm(ssm_mask); 130 __raw_local_irq_ssm(ssm_mask);
133 131
134 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 132 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
new file mode 100644
index 000000000000..e60e0ae13402
--- /dev/null
+++ b/arch/s390/mm/pgtable.c
@@ -0,0 +1,94 @@
1/*
2 * arch/s390/mm/pgtable.c
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
6 */
7
8#include <linux/sched.h>
9#include <linux/kernel.h>
10#include <linux/errno.h>
11#include <linux/mm.h>
12#include <linux/swap.h>
13#include <linux/smp.h>
14#include <linux/highmem.h>
15#include <linux/slab.h>
16#include <linux/pagemap.h>
17#include <linux/spinlock.h>
18#include <linux/module.h>
19#include <linux/quicklist.h>
20
21#include <asm/system.h>
22#include <asm/pgtable.h>
23#include <asm/pgalloc.h>
24#include <asm/tlb.h>
25#include <asm/tlbflush.h>
26
27#ifndef CONFIG_64BIT
28#define ALLOC_ORDER 1
29#else
30#define ALLOC_ORDER 2
31#endif
32
33unsigned long *crst_table_alloc(struct mm_struct *mm, int noexec)
34{
35 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
36
37 if (!page)
38 return NULL;
39 page->index = 0;
40 if (noexec) {
41 struct page *shadow = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
42 if (!shadow) {
43 __free_pages(page, ALLOC_ORDER);
44 return NULL;
45 }
46 page->index = page_to_phys(shadow);
47 }
48 return (unsigned long *) page_to_phys(page);
49}
50
51void crst_table_free(unsigned long *table)
52{
53 unsigned long *shadow = get_shadow_table(table);
54
55 if (shadow)
56 free_pages((unsigned long) shadow, ALLOC_ORDER);
57 free_pages((unsigned long) table, ALLOC_ORDER);
58}
59
60/*
61 * page table entry allocation/free routines.
62 */
63unsigned long *page_table_alloc(int noexec)
64{
65 struct page *page = alloc_page(GFP_KERNEL);
66 unsigned long *table;
67
68 if (!page)
69 return NULL;
70 page->index = 0;
71 if (noexec) {
72 struct page *shadow = alloc_page(GFP_KERNEL);
73 if (!shadow) {
74 __free_page(page);
75 return NULL;
76 }
77 table = (unsigned long *) page_to_phys(shadow);
78 clear_table(table, _PAGE_TYPE_EMPTY, PAGE_SIZE);
79 page->index = (addr_t) table;
80 }
81 table = (unsigned long *) page_to_phys(page);
82 clear_table(table, _PAGE_TYPE_EMPTY, PAGE_SIZE);
83 return table;
84}
85
86void page_table_free(unsigned long *table)
87{
88 unsigned long *shadow = get_shadow_pte(table);
89
90 if (shadow)
91 free_page((unsigned long) shadow);
92 free_page((unsigned long) table);
93
94}
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index fd594d5fe142..fb9c5a85aa56 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -73,31 +73,28 @@ static void __init_refok *vmem_alloc_pages(unsigned int order)
73 return alloc_bootmem_pages((1 << order) * PAGE_SIZE); 73 return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
74} 74}
75 75
76#define vmem_pud_alloc() ({ BUG(); ((pud_t *) NULL); })
77
76static inline pmd_t *vmem_pmd_alloc(void) 78static inline pmd_t *vmem_pmd_alloc(void)
77{ 79{
78 pmd_t *pmd; 80 pmd_t *pmd = NULL;
79 int i;
80 81
81 pmd = vmem_alloc_pages(PMD_ALLOC_ORDER); 82#ifdef CONFIG_64BIT
83 pmd = vmem_alloc_pages(2);
82 if (!pmd) 84 if (!pmd)
83 return NULL; 85 return NULL;
84 for (i = 0; i < PTRS_PER_PMD; i++) 86 clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE*4);
85 pmd_clear_kernel(pmd + i); 87#endif
86 return pmd; 88 return pmd;
87} 89}
88 90
89static inline pte_t *vmem_pte_alloc(void) 91static inline pte_t *vmem_pte_alloc(void)
90{ 92{
91 pte_t *pte; 93 pte_t *pte = vmem_alloc_pages(0);
92 pte_t empty_pte;
93 int i;
94 94
95 pte = vmem_alloc_pages(PTE_ALLOC_ORDER);
96 if (!pte) 95 if (!pte)
97 return NULL; 96 return NULL;
98 pte_val(empty_pte) = _PAGE_TYPE_EMPTY; 97 clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY, PAGE_SIZE);
99 for (i = 0; i < PTRS_PER_PTE; i++)
100 pte[i] = empty_pte;
101 return pte; 98 return pte;
102} 99}
103 100
@@ -108,6 +105,7 @@ static int vmem_add_range(unsigned long start, unsigned long size)
108{ 105{
109 unsigned long address; 106 unsigned long address;
110 pgd_t *pg_dir; 107 pgd_t *pg_dir;
108 pud_t *pu_dir;
111 pmd_t *pm_dir; 109 pmd_t *pm_dir;
112 pte_t *pt_dir; 110 pte_t *pt_dir;
113 pte_t pte; 111 pte_t pte;
@@ -116,13 +114,21 @@ static int vmem_add_range(unsigned long start, unsigned long size)
116 for (address = start; address < start + size; address += PAGE_SIZE) { 114 for (address = start; address < start + size; address += PAGE_SIZE) {
117 pg_dir = pgd_offset_k(address); 115 pg_dir = pgd_offset_k(address);
118 if (pgd_none(*pg_dir)) { 116 if (pgd_none(*pg_dir)) {
117 pu_dir = vmem_pud_alloc();
118 if (!pu_dir)
119 goto out;
120 pgd_populate_kernel(&init_mm, pg_dir, pu_dir);
121 }
122
123 pu_dir = pud_offset(pg_dir, address);
124 if (pud_none(*pu_dir)) {
119 pm_dir = vmem_pmd_alloc(); 125 pm_dir = vmem_pmd_alloc();
120 if (!pm_dir) 126 if (!pm_dir)
121 goto out; 127 goto out;
122 pgd_populate_kernel(&init_mm, pg_dir, pm_dir); 128 pud_populate_kernel(&init_mm, pu_dir, pm_dir);
123 } 129 }
124 130
125 pm_dir = pmd_offset(pg_dir, address); 131 pm_dir = pmd_offset(pu_dir, address);
126 if (pmd_none(*pm_dir)) { 132 if (pmd_none(*pm_dir)) {
127 pt_dir = vmem_pte_alloc(); 133 pt_dir = vmem_pte_alloc();
128 if (!pt_dir) 134 if (!pt_dir)
@@ -148,6 +154,7 @@ static void vmem_remove_range(unsigned long start, unsigned long size)
148{ 154{
149 unsigned long address; 155 unsigned long address;
150 pgd_t *pg_dir; 156 pgd_t *pg_dir;
157 pud_t *pu_dir;
151 pmd_t *pm_dir; 158 pmd_t *pm_dir;
152 pte_t *pt_dir; 159 pte_t *pt_dir;
153 pte_t pte; 160 pte_t pte;
@@ -155,9 +162,10 @@ static void vmem_remove_range(unsigned long start, unsigned long size)
155 pte_val(pte) = _PAGE_TYPE_EMPTY; 162 pte_val(pte) = _PAGE_TYPE_EMPTY;
156 for (address = start; address < start + size; address += PAGE_SIZE) { 163 for (address = start; address < start + size; address += PAGE_SIZE) {
157 pg_dir = pgd_offset_k(address); 164 pg_dir = pgd_offset_k(address);
158 if (pgd_none(*pg_dir)) 165 pu_dir = pud_offset(pg_dir, address);
166 if (pud_none(*pu_dir))
159 continue; 167 continue;
160 pm_dir = pmd_offset(pg_dir, address); 168 pm_dir = pmd_offset(pu_dir, address);
161 if (pmd_none(*pm_dir)) 169 if (pmd_none(*pm_dir))
162 continue; 170 continue;
163 pt_dir = pte_offset_kernel(pm_dir, address); 171 pt_dir = pte_offset_kernel(pm_dir, address);
@@ -174,6 +182,7 @@ static int vmem_add_mem_map(unsigned long start, unsigned long size)
174 unsigned long address, start_addr, end_addr; 182 unsigned long address, start_addr, end_addr;
175 struct page *map_start, *map_end; 183 struct page *map_start, *map_end;
176 pgd_t *pg_dir; 184 pgd_t *pg_dir;
185 pud_t *pu_dir;
177 pmd_t *pm_dir; 186 pmd_t *pm_dir;
178 pte_t *pt_dir; 187 pte_t *pt_dir;
179 pte_t pte; 188 pte_t pte;
@@ -188,13 +197,21 @@ static int vmem_add_mem_map(unsigned long start, unsigned long size)
188 for (address = start_addr; address < end_addr; address += PAGE_SIZE) { 197 for (address = start_addr; address < end_addr; address += PAGE_SIZE) {
189 pg_dir = pgd_offset_k(address); 198 pg_dir = pgd_offset_k(address);
190 if (pgd_none(*pg_dir)) { 199 if (pgd_none(*pg_dir)) {
200 pu_dir = vmem_pud_alloc();
201 if (!pu_dir)
202 goto out;
203 pgd_populate_kernel(&init_mm, pg_dir, pu_dir);
204 }
205
206 pu_dir = pud_offset(pg_dir, address);
207 if (pud_none(*pu_dir)) {
191 pm_dir = vmem_pmd_alloc(); 208 pm_dir = vmem_pmd_alloc();
192 if (!pm_dir) 209 if (!pm_dir)
193 goto out; 210 goto out;
194 pgd_populate_kernel(&init_mm, pg_dir, pm_dir); 211 pud_populate_kernel(&init_mm, pu_dir, pm_dir);
195 } 212 }
196 213
197 pm_dir = pmd_offset(pg_dir, address); 214 pm_dir = pmd_offset(pu_dir, address);
198 if (pmd_none(*pm_dir)) { 215 if (pmd_none(*pm_dir)) {
199 pt_dir = vmem_pte_alloc(); 216 pt_dir = vmem_pte_alloc();
200 if (!pt_dir) 217 if (!pt_dir)