aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /init
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig557
-rw-r--r--init/Makefile4
-rw-r--r--init/calibrate.c15
-rw-r--r--init/do_mounts.c122
-rw-r--r--init/do_mounts_initrd.c52
-rw-r--r--init/do_mounts_md.c12
-rw-r--r--init/do_mounts_rd.c40
-rw-r--r--init/init_task.c24
-rw-r--r--init/initramfs.c24
-rw-r--r--init/main.c169
-rw-r--r--init/version.c2
11 files changed, 241 insertions, 780 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 7d30240e5bf..6aad581f18e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -27,9 +27,6 @@ config IRQ_WORK
27 bool 27 bool
28 depends on HAVE_IRQ_WORK 28 depends on HAVE_IRQ_WORK
29 29
30config BUILDTIME_EXTABLE_SORT
31 bool
32
33menu "General setup" 30menu "General setup"
34 31
35config EXPERIMENTAL 32config EXPERIMENTAL
@@ -167,7 +164,7 @@ config KERNEL_BZIP2
167 depends on HAVE_KERNEL_BZIP2 164 depends on HAVE_KERNEL_BZIP2
168 help 165 help
169 Its compression ratio and speed is intermediate. 166 Its compression ratio and speed is intermediate.
170 Decompression speed is slowest among the choices. The kernel 167 Decompression speed is slowest among the three. The kernel
171 size is about 10% smaller with bzip2, in comparison to gzip. 168 size is about 10% smaller with bzip2, in comparison to gzip.
172 Bzip2 uses a large amount of memory. For modern kernels you 169 Bzip2 uses a large amount of memory. For modern kernels you
173 will need at least 8MB RAM or more for booting. 170 will need at least 8MB RAM or more for booting.
@@ -176,9 +173,10 @@ config KERNEL_LZMA
176 bool "LZMA" 173 bool "LZMA"
177 depends on HAVE_KERNEL_LZMA 174 depends on HAVE_KERNEL_LZMA
178 help 175 help
179 This compression algorithm's ratio is best. Decompression speed 176 The most recent compression algorithm.
180 is between gzip and bzip2. Compression is slowest. 177 Its ratio is best, decompression speed is between the other
181 The kernel size is about 33% smaller with LZMA in comparison to gzip. 178 two. Compression is slowest. The kernel size is about 33%
179 smaller with LZMA in comparison to gzip.
182 180
183config KERNEL_XZ 181config KERNEL_XZ
184 bool "XZ" 182 bool "XZ"
@@ -199,7 +197,7 @@ config KERNEL_LZO
199 bool "LZO" 197 bool "LZO"
200 depends on HAVE_KERNEL_LZO 198 depends on HAVE_KERNEL_LZO
201 help 199 help
202 Its compression ratio is the poorest among the choices. The kernel 200 Its compression ratio is the poorest among the 4. The kernel
203 size is about 10% bigger than gzip; however its speed 201 size is about 10% bigger than gzip; however its speed
204 (both compression and decompression) is the fastest. 202 (both compression and decompression) is the fastest.
205 203
@@ -267,106 +265,6 @@ config POSIX_MQUEUE_SYSCTL
267 depends on SYSCTL 265 depends on SYSCTL
268 default y 266 default y
269 267
270config FHANDLE
271 bool "open by fhandle syscalls"
272 select EXPORTFS
273 help
274 If you say Y here, a user level program will be able to map
275 file names to handle and then later use the handle for
276 different file system operations. This is useful in implementing
277 userspace file servers, which now track files using handles instead
278 of names. The handle would remain the same even if file names
279 get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
280 syscalls.
281
282config AUDIT
283 bool "Auditing support"
284 depends on NET
285 help
286 Enable auditing infrastructure that can be used with another
287 kernel subsystem, such as SELinux (which requires this for
288 logging of avc messages output). Does not do system-call
289 auditing without CONFIG_AUDITSYSCALL.
290
291config AUDITSYSCALL
292 bool "Enable system-call auditing support"
293 depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
294 default y if SECURITY_SELINUX
295 help
296 Enable low-overhead system-call auditing infrastructure that
297 can be used independently or with another kernel subsystem,
298 such as SELinux.
299
300config AUDIT_WATCH
301 def_bool y
302 depends on AUDITSYSCALL
303 select FSNOTIFY
304
305config AUDIT_TREE
306 def_bool y
307 depends on AUDITSYSCALL
308 select FSNOTIFY
309
310config AUDIT_LOGINUID_IMMUTABLE
311 bool "Make audit loginuid immutable"
312 depends on AUDIT
313 help
314 The config option toggles if a task setting its loginuid requires
315 CAP_SYS_AUDITCONTROL or if that task should require no special permissions
316 but should instead only allow setting its loginuid if it was never
317 previously set. On systems which use systemd or a similar central
318 process to restart login services this should be set to true. On older
319 systems in which an admin would typically have to directly stop and
320 start processes this should be set to false. Setting this to true allows
321 one to drop potentially dangerous capabilites from the login tasks,
322 but may not be backwards compatible with older init systems.
323
324source "kernel/irq/Kconfig"
325source "kernel/time/Kconfig"
326
327menu "CPU/Task time and stats accounting"
328
329choice
330 prompt "Cputime accounting"
331 default TICK_CPU_ACCOUNTING if !PPC64
332 default VIRT_CPU_ACCOUNTING if PPC64
333
334# Kind of a stub config for the pure tick based cputime accounting
335config TICK_CPU_ACCOUNTING
336 bool "Simple tick based cputime accounting"
337 depends on !S390
338 help
339 This is the basic tick based cputime accounting that maintains
340 statistics about user, system and idle time spent on per jiffies
341 granularity.
342
343 If unsure, say Y.
344
345config VIRT_CPU_ACCOUNTING
346 bool "Deterministic task and CPU time accounting"
347 depends on HAVE_VIRT_CPU_ACCOUNTING
348 help
349 Select this option to enable more accurate task and CPU time
350 accounting. This is done by reading a CPU counter on each
351 kernel entry and exit and on transitions within the kernel
352 between system, softirq and hardirq state, so there is a
353 small performance impact. In the case of s390 or IBM POWER > 5,
354 this also enables accounting of stolen time on logically-partitioned
355 systems.
356
357config IRQ_TIME_ACCOUNTING
358 bool "Fine granularity task level IRQ time accounting"
359 depends on HAVE_IRQ_TIME_ACCOUNTING
360 help
361 Select this option to enable fine granularity task irq time
362 accounting. This is done by reading a timestamp on each
363 transitions between softirq and hardirq state, so there can be a
364 small performance impact.
365
366 If in doubt, say N here.
367
368endchoice
369
370config BSD_PROCESS_ACCT 268config BSD_PROCESS_ACCT
371 bool "BSD Process Accounting" 269 bool "BSD Process Accounting"
372 help 270 help
@@ -392,6 +290,18 @@ config BSD_PROCESS_ACCT_V3
392 for processing it. A preliminary version of these tools is available 290 for processing it. A preliminary version of these tools is available
393 at <http://www.gnu.org/software/acct/>. 291 at <http://www.gnu.org/software/acct/>.
394 292
293config FHANDLE
294 bool "open by fhandle syscalls"
295 select EXPORTFS
296 help
297 If you say Y here, a user level program will be able to map
298 file names to handle and then later use the handle for
299 different file system operations. This is useful in implementing
300 userspace file servers, which now track files using handles instead
301 of names. The handle would remain the same even if file names
302 get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
303 syscalls.
304
395config TASKSTATS 305config TASKSTATS
396 bool "Export task/process statistics through netlink (EXPERIMENTAL)" 306 bool "Export task/process statistics through netlink (EXPERIMENTAL)"
397 depends on NET 307 depends on NET
@@ -434,7 +344,35 @@ config TASK_IO_ACCOUNTING
434 344
435 Say N if unsure. 345 Say N if unsure.
436 346
437endmenu # "CPU/Task time and stats accounting" 347config AUDIT
348 bool "Auditing support"
349 depends on NET
350 help
351 Enable auditing infrastructure that can be used with another
352 kernel subsystem, such as SELinux (which requires this for
353 logging of avc messages output). Does not do system-call
354 auditing without CONFIG_AUDITSYSCALL.
355
356config AUDITSYSCALL
357 bool "Enable system-call auditing support"
358 depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH)
359 default y if SECURITY_SELINUX
360 help
361 Enable low-overhead system-call auditing infrastructure that
362 can be used independently or with another kernel subsystem,
363 such as SELinux.
364
365config AUDIT_WATCH
366 def_bool y
367 depends on AUDITSYSCALL
368 select FSNOTIFY
369
370config AUDIT_TREE
371 def_bool y
372 depends on AUDITSYSCALL
373 select FSNOTIFY
374
375source "kernel/irq/Kconfig"
438 376
439menu "RCU Subsystem" 377menu "RCU Subsystem"
440 378
@@ -453,7 +391,7 @@ config TREE_RCU
453 391
454config TREE_PREEMPT_RCU 392config TREE_PREEMPT_RCU
455 bool "Preemptible tree-based hierarchical RCU" 393 bool "Preemptible tree-based hierarchical RCU"
456 depends on PREEMPT && SMP 394 depends on PREEMPT
457 help 395 help
458 This option selects the RCU implementation that is 396 This option selects the RCU implementation that is
459 designed for very large SMP systems with hundreds or 397 designed for very large SMP systems with hundreds or
@@ -463,7 +401,7 @@ config TREE_PREEMPT_RCU
463 401
464config TINY_RCU 402config TINY_RCU
465 bool "UP-only small-memory-footprint RCU" 403 bool "UP-only small-memory-footprint RCU"
466 depends on !PREEMPT && !SMP 404 depends on !SMP
467 help 405 help
468 This option selects the RCU implementation that is 406 This option selects the RCU implementation that is
469 designed for UP systems from which real-time response 407 designed for UP systems from which real-time response
@@ -472,7 +410,7 @@ config TINY_RCU
472 410
473config TINY_PREEMPT_RCU 411config TINY_PREEMPT_RCU
474 bool "Preemptible UP-only small-memory-footprint RCU" 412 bool "Preemptible UP-only small-memory-footprint RCU"
475 depends on PREEMPT && !SMP 413 depends on !SMP && PREEMPT
476 help 414 help
477 This option selects the RCU implementation that is designed 415 This option selects the RCU implementation that is designed
478 for real-time UP systems. This option greatly reduces the 416 for real-time UP systems. This option greatly reduces the
@@ -486,35 +424,14 @@ config PREEMPT_RCU
486 This option enables preemptible-RCU code that is common between 424 This option enables preemptible-RCU code that is common between
487 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. 425 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
488 426
489config CONTEXT_TRACKING 427config RCU_TRACE
490 bool 428 bool "Enable tracing for RCU"
491
492config RCU_USER_QS
493 bool "Consider userspace as in RCU extended quiescent state"
494 depends on HAVE_CONTEXT_TRACKING && SMP
495 select CONTEXT_TRACKING
496 help 429 help
497 This option sets hooks on kernel / userspace boundaries and 430 This option provides tracing in RCU which presents stats
498 puts RCU in extended quiescent state when the CPU runs in 431 in debugfs for debugging RCU implementation.
499 userspace. It means that when a CPU runs in userspace, it is
500 excluded from the global RCU state machine and thus doesn't
501 try to keep the timer tick on for RCU.
502
503 Unless you want to hack and help the development of the full
504 dynticks mode, you shouldn't enable this option. It also
505 adds unnecessary overhead.
506
507 If unsure say N
508 432
509config CONTEXT_TRACKING_FORCE 433 Say Y here if you want to enable RCU tracing
510 bool "Force context tracking" 434 Say N if you are unsure.
511 depends on CONTEXT_TRACKING
512 help
513 Probe on user/kernel boundaries by default in order to
514 test the features that rely on it such as userspace RCU extended
515 quiescent states.
516 This test is there for debugging until we have a real user like the
517 full dynticks mode.
518 435
519config RCU_FANOUT 436config RCU_FANOUT
520 int "Tree-based hierarchical RCU fanout value" 437 int "Tree-based hierarchical RCU fanout value"
@@ -536,33 +453,6 @@ config RCU_FANOUT
536 Select a specific number if testing RCU itself. 453 Select a specific number if testing RCU itself.
537 Take the default if unsure. 454 Take the default if unsure.
538 455
539config RCU_FANOUT_LEAF
540 int "Tree-based hierarchical RCU leaf-level fanout value"
541 range 2 RCU_FANOUT if 64BIT
542 range 2 RCU_FANOUT if !64BIT
543 depends on TREE_RCU || TREE_PREEMPT_RCU
544 default 16
545 help
546 This option controls the leaf-level fanout of hierarchical
547 implementations of RCU, and allows trading off cache misses
548 against lock contention. Systems that synchronize their
549 scheduling-clock interrupts for energy-efficiency reasons will
550 want the default because the smaller leaf-level fanout keeps
551 lock contention levels acceptably low. Very large systems
552 (hundreds or thousands of CPUs) will instead want to set this
553 value to the maximum value possible in order to reduce the
554 number of cache misses incurred during RCU's grace-period
555 initialization. These systems tend to run CPU-bound, and thus
556 are not helped by synchronized interrupts, and thus tend to
557 skew them, which reduces lock contention enough that large
558 leaf-level fanouts work well.
559
560 Select a specific number if testing RCU itself.
561
562 Select the maximum permissible value for large systems.
563
564 Take the default if unsure.
565
566config RCU_FANOUT_EXACT 456config RCU_FANOUT_EXACT
567 bool "Disable tree-based hierarchical RCU auto-balancing" 457 bool "Disable tree-based hierarchical RCU auto-balancing"
568 depends on TREE_RCU || TREE_PREEMPT_RCU 458 depends on TREE_RCU || TREE_PREEMPT_RCU
@@ -579,16 +469,17 @@ config RCU_FANOUT_EXACT
579 469
580config RCU_FAST_NO_HZ 470config RCU_FAST_NO_HZ
581 bool "Accelerate last non-dyntick-idle CPU's grace periods" 471 bool "Accelerate last non-dyntick-idle CPU's grace periods"
582 depends on NO_HZ && SMP 472 depends on TREE_RCU && NO_HZ && SMP
583 default n 473 default n
584 help 474 help
585 This option causes RCU to attempt to accelerate grace periods in 475 This option causes RCU to attempt to accelerate grace periods
586 order to allow CPUs to enter dynticks-idle state more quickly. 476 in order to allow the final CPU to enter dynticks-idle state
587 On the other hand, this option increases the overhead of the 477 more quickly. On the other hand, this option increases the
588 dynticks-idle checking, thus degrading scheduling latency. 478 overhead of the dynticks-idle checking, particularly on systems
479 with large numbers of CPUs.
589 480
590 Say Y if energy efficiency is critically important, and you don't 481 Say Y if energy efficiency is critically important, particularly
591 care about real-time response. 482 if you have relatively few CPUs.
592 483
593 Say N if you are unsure. 484 Say N if you are unsure.
594 485
@@ -619,25 +510,10 @@ config RCU_BOOST_PRIO
619 depends on RCU_BOOST 510 depends on RCU_BOOST
620 default 1 511 default 1
621 help 512 help
622 This option specifies the real-time priority to which long-term 513 This option specifies the real-time priority to which preempted
623 preempted RCU readers are to be boosted. If you are working 514 RCU readers are to be boosted. If you are working with CPU-bound
624 with a real-time application that has one or more CPU-bound 515 real-time applications, you should specify a priority higher then
625 threads running at a real-time priority level, you should set 516 the highest-priority CPU-bound application.
626 RCU_BOOST_PRIO to a priority higher then the highest-priority
627 real-time CPU-bound thread. The default RCU_BOOST_PRIO value
628 of 1 is appropriate in the common case, which is real-time
629 applications that do not have any CPU-bound threads.
630
631 Some real-time applications might not have a single real-time
632 thread that saturates a given CPU, but instead might have
633 multiple real-time threads that, taken together, fully utilize
634 that CPU. In this case, you should set RCU_BOOST_PRIO to
635 a priority higher than the lowest-priority thread that is
636 conspiring to prevent the CPU from running any non-real-time
637 tasks. For example, if one thread at priority 10 and another
638 thread at priority 5 are between themselves fully consuming
639 the CPU time on a given CPU, then RCU_BOOST_PRIO should be
640 set to priority 6 or higher.
641 517
642 Specify the real-time priority, or take the default if unsure. 518 Specify the real-time priority, or take the default if unsure.
643 519
@@ -654,28 +530,6 @@ config RCU_BOOST_DELAY
654 530
655 Accept the default if unsure. 531 Accept the default if unsure.
656 532
657config RCU_NOCB_CPU
658 bool "Offload RCU callback processing from boot-selected CPUs"
659 depends on TREE_RCU || TREE_PREEMPT_RCU
660 default n
661 help
662 Use this option to reduce OS jitter for aggressive HPC or
663 real-time workloads. It can also be used to offload RCU
664 callback invocation to energy-efficient CPUs in battery-powered
665 asymmetric multiprocessors.
666
667 This option offloads callback invocation from the set of
668 CPUs specified at boot time by the rcu_nocbs parameter.
669 For each such CPU, a kthread ("rcuoN") will be created to
670 invoke callbacks, where the "N" is the CPU being offloaded.
671 Nothing prevents this kthread from running on the specified
672 CPUs, but (1) the kthreads may be preempted between each
673 callback, and (2) affinity or cgroups can be used to force
674 the kthreads to run on whatever set of CPUs is desired.
675
676 Say Y here if you want reduced OS jitter on selected CPUs.
677 Say N here if you are unsure.
678
679endmenu # "RCU Subsystem" 533endmenu # "RCU Subsystem"
680 534
681config IKCONFIG 535config IKCONFIG
@@ -717,50 +571,6 @@ config LOG_BUF_SHIFT
717config HAVE_UNSTABLE_SCHED_CLOCK 571config HAVE_UNSTABLE_SCHED_CLOCK
718 bool 572 bool
719 573
720#
721# For architectures that want to enable the support for NUMA-affine scheduler
722# balancing logic:
723#
724config ARCH_SUPPORTS_NUMA_BALANCING
725 bool
726
727# For architectures that (ab)use NUMA to represent different memory regions
728# all cpu-local but of different latencies, such as SuperH.
729#
730config ARCH_WANT_NUMA_VARIABLE_LOCALITY
731 bool
732
733#
734# For architectures that are willing to define _PAGE_NUMA as _PAGE_PROTNONE
735config ARCH_WANTS_PROT_NUMA_PROT_NONE
736 bool
737
738config ARCH_USES_NUMA_PROT_NONE
739 bool
740 default y
741 depends on ARCH_WANTS_PROT_NUMA_PROT_NONE
742 depends on NUMA_BALANCING
743
744config NUMA_BALANCING_DEFAULT_ENABLED
745 bool "Automatically enable NUMA aware memory/task placement"
746 default y
747 depends on NUMA_BALANCING
748 help
749 If set, autonumic NUMA balancing will be enabled if running on a NUMA
750 machine.
751
752config NUMA_BALANCING
753 bool "Memory placement aware NUMA scheduler"
754 depends on ARCH_SUPPORTS_NUMA_BALANCING
755 depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
756 depends on SMP && NUMA && MIGRATION
757 help
758 This option adds support for automatic NUMA aware memory/task placement.
759 The mechanism is quite primitive and is based on migrating memory when
760 it is references to the node the task is running on.
761
762 This system will be inactive on UMA systems.
763
764menuconfig CGROUPS 574menuconfig CGROUPS
765 boolean "Control Group support" 575 boolean "Control Group support"
766 depends on EVENTFD 576 depends on EVENTFD
@@ -826,7 +636,7 @@ config RESOURCE_COUNTERS
826 This option enables controller independent resource accounting 636 This option enables controller independent resource accounting
827 infrastructure that works with cgroups. 637 infrastructure that works with cgroups.
828 638
829config MEMCG 639config CGROUP_MEM_RES_CTLR
830 bool "Memory Resource Controller for Control Groups" 640 bool "Memory Resource Controller for Control Groups"
831 depends on RESOURCE_COUNTERS 641 depends on RESOURCE_COUNTERS
832 select MM_OWNER 642 select MM_OWNER
@@ -849,9 +659,9 @@ config MEMCG
849 This config option also selects MM_OWNER config option, which 659 This config option also selects MM_OWNER config option, which
850 could in turn add some fork/exit overhead. 660 could in turn add some fork/exit overhead.
851 661
852config MEMCG_SWAP 662config CGROUP_MEM_RES_CTLR_SWAP
853 bool "Memory Resource Controller Swap Extension" 663 bool "Memory Resource Controller Swap Extension"
854 depends on MEMCG && SWAP 664 depends on CGROUP_MEM_RES_CTLR && SWAP
855 help 665 help
856 Add swap management feature to memory resource controller. When you 666 Add swap management feature to memory resource controller. When you
857 enable this, you can limit mem+swap usage per cgroup. In other words, 667 enable this, you can limit mem+swap usage per cgroup. In other words,
@@ -866,9 +676,9 @@ config MEMCG_SWAP
866 if boot option "swapaccount=0" is set, swap will not be accounted. 676 if boot option "swapaccount=0" is set, swap will not be accounted.
867 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page 677 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
868 size is 4096bytes, 512k per 1Gbytes of swap. 678 size is 4096bytes, 512k per 1Gbytes of swap.
869config MEMCG_SWAP_ENABLED 679config CGROUP_MEM_RES_CTLR_SWAP_ENABLED
870 bool "Memory Resource Controller Swap Extension enabled by default" 680 bool "Memory Resource Controller Swap Extension enabled by default"
871 depends on MEMCG_SWAP 681 depends on CGROUP_MEM_RES_CTLR_SWAP
872 default y 682 default y
873 help 683 help
874 Memory Resource Controller Swap Extension comes with its price in 684 Memory Resource Controller Swap Extension comes with its price in
@@ -879,32 +689,6 @@ config MEMCG_SWAP_ENABLED
879 For those who want to have the feature enabled by default should 689 For those who want to have the feature enabled by default should
880 select this option (if, for some reason, they need to disable it 690 select this option (if, for some reason, they need to disable it
881 then swapaccount=0 does the trick). 691 then swapaccount=0 does the trick).
882config MEMCG_KMEM
883 bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
884 depends on MEMCG && EXPERIMENTAL
885 depends on SLUB || SLAB
886 help
887 The Kernel Memory extension for Memory Resource Controller can limit
888 the amount of memory used by kernel objects in the system. Those are
889 fundamentally different from the entities handled by the standard
890 Memory Controller, which are page-based, and can be swapped. Users of
891 the kmem extension can use it to guarantee that no group of processes
892 will ever exhaust kernel resources alone.
893
894config CGROUP_HUGETLB
895 bool "HugeTLB Resource Controller for Control Groups"
896 depends on RESOURCE_COUNTERS && HUGETLB_PAGE && EXPERIMENTAL
897 default n
898 help
899 Provides a cgroup Resource Controller for HugeTLB pages.
900 When you enable this, you can put a per cgroup limit on HugeTLB usage.
901 The limit is enforced during page fault. Since HugeTLB doesn't
902 support page reclaim, enforcing the limit at page fault time implies
903 that, the application will get SIGBUS signal if it tries to access
904 HugeTLB pages beyond its limit. This requires the application to know
905 beforehand how much HugeTLB pages it would require for its use. The
906 control group is tracked in the third page lru pointer. This means
907 that we cannot use the controller with huge page less than 3 pages.
908 692
909config CGROUP_PERF 693config CGROUP_PERF
910 bool "Enable perf_event per-cpu per-container group (cgroup) monitoring" 694 bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
@@ -918,6 +702,7 @@ config CGROUP_PERF
918 702
919menuconfig CGROUP_SCHED 703menuconfig CGROUP_SCHED
920 bool "Group CPU scheduler" 704 bool "Group CPU scheduler"
705 depends on EXPERIMENTAL
921 default n 706 default n
922 help 707 help
923 This feature lets CPU scheduler recognize task groups and control CPU 708 This feature lets CPU scheduler recognize task groups and control CPU
@@ -930,18 +715,6 @@ config FAIR_GROUP_SCHED
930 depends on CGROUP_SCHED 715 depends on CGROUP_SCHED
931 default CGROUP_SCHED 716 default CGROUP_SCHED
932 717
933config CFS_BANDWIDTH
934 bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
935 depends on EXPERIMENTAL
936 depends on FAIR_GROUP_SCHED
937 default n
938 help
939 This option allows users to define CPU bandwidth rates (limits) for
940 tasks running within the fair group scheduler. Groups with no limit
941 set are considered to be unconstrained and will run with no
942 restriction.
943 See tip/Documentation/scheduler/sched-bwc.txt for more information.
944
945config RT_GROUP_SCHED 718config RT_GROUP_SCHED
946 bool "Group scheduling for SCHED_RR/FIFO" 719 bool "Group scheduling for SCHED_RR/FIFO"
947 depends on EXPERIMENTAL 720 depends on EXPERIMENTAL
@@ -957,7 +730,7 @@ config RT_GROUP_SCHED
957endif #CGROUP_SCHED 730endif #CGROUP_SCHED
958 731
959config BLK_CGROUP 732config BLK_CGROUP
960 bool "Block IO controller" 733 tristate "Block IO controller"
961 depends on BLOCK 734 depends on BLOCK
962 default n 735 default n
963 ---help--- 736 ---help---
@@ -988,17 +761,6 @@ config DEBUG_BLK_CGROUP
988 761
989endif # CGROUPS 762endif # CGROUPS
990 763
991config CHECKPOINT_RESTORE
992 bool "Checkpoint/restore support" if EXPERT
993 default n
994 help
995 Enables additional kernel features in a sake of checkpoint/restore.
996 In particular it adds auxiliary prctl codes to setup process text,
997 data and heap segment sizes, and a few additional /proc filesystem
998 entries.
999
1000 If unsure, say N here.
1001
1002menuconfig NAMESPACES 764menuconfig NAMESPACES
1003 bool "Namespaces support" if EXPERT 765 bool "Namespaces support" if EXPERT
1004 default !EXPERT 766 default !EXPERT
@@ -1028,10 +790,7 @@ config IPC_NS
1028config USER_NS 790config USER_NS
1029 bool "User namespace (EXPERIMENTAL)" 791 bool "User namespace (EXPERIMENTAL)"
1030 depends on EXPERIMENTAL 792 depends on EXPERIMENTAL
1031 depends on UIDGID_CONVERTED 793 default y
1032 select UIDGID_STRICT_TYPE_CHECKS
1033
1034 default n
1035 help 794 help
1036 This allows containers, i.e. vservers, to use user namespaces 795 This allows containers, i.e. vservers, to use user namespaces
1037 to provide different user info for different servers. 796 to provide different user info for different servers.
@@ -1055,40 +814,6 @@ config NET_NS
1055 814
1056endif # NAMESPACES 815endif # NAMESPACES
1057 816
1058config UIDGID_CONVERTED
1059 # True if all of the selected software conmponents are known
1060 # to have uid_t and gid_t converted to kuid_t and kgid_t
1061 # where appropriate and are otherwise safe to use with
1062 # the user namespace.
1063 bool
1064 default y
1065
1066 # Networking
1067 depends on NET_9P = n
1068
1069 # Filesystems
1070 depends on 9P_FS = n
1071 depends on AFS_FS = n
1072 depends on CEPH_FS = n
1073 depends on CIFS = n
1074 depends on CODA_FS = n
1075 depends on GFS2_FS = n
1076 depends on NCP_FS = n
1077 depends on NFSD = n
1078 depends on NFS_FS = n
1079 depends on OCFS2_FS = n
1080 depends on XFS_FS = n
1081
1082config UIDGID_STRICT_TYPE_CHECKS
1083 bool "Require conversions between uid/gids and their internal representation"
1084 depends on UIDGID_CONVERTED
1085 default n
1086 help
1087 While the nececessary conversions are being added to all subsystems this option allows
1088 the code to continue to build for unconverted subsystems.
1089
1090 Say Y here if you want the strict type checking enabled
1091
1092config SCHED_AUTOGROUP 817config SCHED_AUTOGROUP
1093 bool "Automatic process group scheduling" 818 bool "Automatic process group scheduling"
1094 select EVENTFD 819 select EVENTFD
@@ -1190,6 +915,12 @@ config SYSCTL
1190config ANON_INODES 915config ANON_INODES
1191 bool 916 bool
1192 917
918config PANIC_TIMEOUT
919 int "Default panic timeout"
920 default 0
921 help
922 Set default panic timeout.
923
1193menuconfig EXPERT 924menuconfig EXPERT
1194 bool "Configure standard kernel features (expert users)" 925 bool "Configure standard kernel features (expert users)"
1195 # Unhide debug options, to make the on-by-default options visible 926 # Unhide debug options, to make the on-by-default options visible
@@ -1200,12 +931,9 @@ menuconfig EXPERT
1200 environments which can tolerate a "non-standard" kernel. 931 environments which can tolerate a "non-standard" kernel.
1201 Only use this if you really know what you are doing. 932 Only use this if you really know what you are doing.
1202 933
1203config HAVE_UID16
1204 bool
1205
1206config UID16 934config UID16
1207 bool "Enable 16-bit UID system calls" if EXPERT 935 bool "Enable 16-bit UID system calls" if EXPERT
1208 depends on HAVE_UID16 936 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)
1209 default y 937 default y
1210 help 938 help
1211 This enables the legacy 16-bit UID syscall wrappers. 939 This enables the legacy 16-bit UID syscall wrappers.
@@ -1213,7 +941,7 @@ config UID16
1213config SYSCTL_SYSCALL 941config SYSCTL_SYSCALL
1214 bool "Sysctl syscall support" if EXPERT 942 bool "Sysctl syscall support" if EXPERT
1215 depends on PROC_SYSCTL 943 depends on PROC_SYSCTL
1216 default n 944 default y
1217 select SYSCTL 945 select SYSCTL
1218 ---help--- 946 ---help---
1219 sys_sysctl uses binary paths that have been found challenging 947 sys_sysctl uses binary paths that have been found challenging
@@ -1225,12 +953,7 @@ config SYSCTL_SYSCALL
1225 trying to save some space it is probably safe to disable this, 953 trying to save some space it is probably safe to disable this,
1226 making your kernel marginally smaller. 954 making your kernel marginally smaller.
1227 955
1228 If unsure say N here. 956 If unsure say Y here.
1229
1230config SYSCTL_EXCEPTION_TRACE
1231 bool
1232 help
1233 Enable support for /proc/sys/debug/exception-trace.
1234 957
1235config KALLSYMS 958config KALLSYMS
1236 bool "Load all symbols for debugging/ksymoops" if EXPERT 959 bool "Load all symbols for debugging/ksymoops" if EXPERT
@@ -1258,7 +981,13 @@ config KALLSYMS_ALL
1258 Say N unless you really need all symbols. 981 Say N unless you really need all symbols.
1259 982
1260config HOTPLUG 983config HOTPLUG
1261 def_bool y 984 bool "Support for hot-pluggable devices" if EXPERT
985 default y
986 help
987 This option is provided for the case where no hotplug or uevent
988 capabilities is wanted by the kernel. You should only consider
989 disabling this option for embedded systems that do not use modules, a
990 dynamic /dev tree, or dynamic device discovery. Just say Y.
1262 991
1263config PRINTK 992config PRINTK
1264 default y 993 default y
@@ -1281,7 +1010,6 @@ config BUG
1281 Just say Y. 1010 Just say Y.
1282 1011
1283config ELF_CORE 1012config ELF_CORE
1284 depends on COREDUMP
1285 default y 1013 default y
1286 bool "Enable ELF core dumps" if EXPERT 1014 bool "Enable ELF core dumps" if EXPERT
1287 help 1015 help
@@ -1366,6 +1094,15 @@ config SHMEM
1366 option replaces shmem and tmpfs with the much simpler ramfs code, 1094 option replaces shmem and tmpfs with the much simpler ramfs code,
1367 which may be appropriate on small systems without swap. 1095 which may be appropriate on small systems without swap.
1368 1096
1097config ASHMEM
1098 bool "Enable the Anonymous Shared Memory Subsystem"
1099 default n
1100 depends on SHMEM || TINY_SHMEM
1101 help
1102 The ashmem subsystem is a new shared memory allocator, similar to
1103 POSIX SHM but with different behavior and sporting a simpler
1104 file-based API.
1105
1369config AIO 1106config AIO
1370 bool "Enable AIO support" if EXPERT 1107 bool "Enable AIO support" if EXPERT
1371 default y 1108 default y
@@ -1396,7 +1133,7 @@ menu "Kernel Performance Events And Counters"
1396 1133
1397config PERF_EVENTS 1134config PERF_EVENTS
1398 bool "Kernel performance events and counters" 1135 bool "Kernel performance events and counters"
1399 default y if PROFILING 1136 default y if (PROFILING || PERF_COUNTERS)
1400 depends on HAVE_PERF_EVENTS 1137 depends on HAVE_PERF_EVENTS
1401 select ANON_INODES 1138 select ANON_INODES
1402 select IRQ_WORK 1139 select IRQ_WORK
@@ -1423,6 +1160,18 @@ config PERF_EVENTS
1423 1160
1424 Say Y if unsure. 1161 Say Y if unsure.
1425 1162
1163config PERF_COUNTERS
1164 bool "Kernel performance counters (old config option)"
1165 depends on HAVE_PERF_EVENTS
1166 help
1167 This config has been obsoleted by the PERF_EVENTS
1168 config option - please see that one for details.
1169
1170 It has no effect on the kernel whether you enable
1171 it or not, it is a compatibility placeholder.
1172
1173 Say N if unsure.
1174
1426config DEBUG_PERF_USE_VMALLOC 1175config DEBUG_PERF_USE_VMALLOC
1427 default n 1176 default n
1428 bool "Debug: use vmalloc to back perf mmap() buffers" 1177 bool "Debug: use vmalloc to back perf mmap() buffers"
@@ -1637,73 +1386,13 @@ config MODULE_SRCVERSION_ALL
1637 the version). With this option, such a "srcversion" field 1386 the version). With this option, such a "srcversion" field
1638 will be created for all modules. If unsure, say N. 1387 will be created for all modules. If unsure, say N.
1639 1388
1640config MODULE_SIG
1641 bool "Module signature verification"
1642 depends on MODULES
1643 select KEYS
1644 select CRYPTO
1645 select ASYMMETRIC_KEY_TYPE
1646 select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
1647 select PUBLIC_KEY_ALGO_RSA
1648 select ASN1
1649 select OID_REGISTRY
1650 select X509_CERTIFICATE_PARSER
1651 help
1652 Check modules for valid signatures upon load: the signature
1653 is simply appended to the module. For more information see
1654 Documentation/module-signing.txt.
1655
1656 !!!WARNING!!! If you enable this option, you MUST make sure that the
1657 module DOES NOT get stripped after being signed. This includes the
1658 debuginfo strip done by some packagers (such as rpmbuild) and
1659 inclusion into an initramfs that wants the module size reduced.
1660
1661config MODULE_SIG_FORCE
1662 bool "Require modules to be validly signed"
1663 depends on MODULE_SIG
1664 help
1665 Reject unsigned modules or signed modules for which we don't have a
1666 key. Without this, such modules will simply taint the kernel.
1667
1668choice
1669 prompt "Which hash algorithm should modules be signed with?"
1670 depends on MODULE_SIG
1671 help
1672 This determines which sort of hashing algorithm will be used during
1673 signature generation. This algorithm _must_ be built into the kernel
1674 directly so that signature verification can take place. It is not
1675 possible to load a signed module containing the algorithm to check
1676 the signature on that module.
1677
1678config MODULE_SIG_SHA1
1679 bool "Sign modules with SHA-1"
1680 select CRYPTO_SHA1
1681
1682config MODULE_SIG_SHA224
1683 bool "Sign modules with SHA-224"
1684 select CRYPTO_SHA256
1685
1686config MODULE_SIG_SHA256
1687 bool "Sign modules with SHA-256"
1688 select CRYPTO_SHA256
1689
1690config MODULE_SIG_SHA384
1691 bool "Sign modules with SHA-384"
1692 select CRYPTO_SHA512
1693
1694config MODULE_SIG_SHA512
1695 bool "Sign modules with SHA-512"
1696 select CRYPTO_SHA512
1697
1698endchoice
1699
1700endif # MODULES 1389endif # MODULES
1701 1390
1702config INIT_ALL_POSSIBLE 1391config INIT_ALL_POSSIBLE
1703 bool 1392 bool
1704 help 1393 help
1705 Back when each arch used to define their own cpu_online_mask and 1394 Back when each arch used to define their own cpu_online_map and
1706 cpu_possible_mask, some of them chose to initialize cpu_possible_mask 1395 cpu_possible_map, some of them chose to initialize cpu_possible_map
1707 with all 1s, and others with all 0s. When they were centralised, 1396 with all 1s, and others with all 0s. When they were centralised,
1708 it was better to provide this option than to break all the archs 1397 it was better to provide this option than to break all the archs
1709 and have several arch maintainers pursuing me down dark alleys. 1398 and have several arch maintainers pursuing me down dark alleys.
@@ -1724,18 +1413,4 @@ config PADATA
1724 depends on SMP 1413 depends on SMP
1725 bool 1414 bool
1726 1415
1727# Can be selected by architectures with broken toolchains
1728# that get confused by correct const<->read_only section
1729# mappings
1730config BROKEN_RODATA
1731 bool
1732
1733config ASN1
1734 tristate
1735 help
1736 Build a simple ASN.1 grammar compiler that produces a bytecode output
1737 that can be interpreted by the ASN.1 stream decoder and used to
1738 inform it as to what tags are to be expected in a stream and what
1739 functions to call on what tags.
1740
1741source "kernel/Kconfig.locks" 1416source "kernel/Kconfig.locks"
diff --git a/init/Makefile b/init/Makefile
index 7bc47ee31c3..0bf677aa087 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -10,10 +10,6 @@ obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o
10endif 10endif
11obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o 11obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
12 12
13ifneq ($(CONFIG_ARCH_INIT_TASK),y)
14obj-y += init_task.o
15endif
16
17mounts-y := do_mounts.o 13mounts-y := do_mounts.o
18mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o 14mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
19mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o 15mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
diff --git a/init/calibrate.c b/init/calibrate.c
index fda0a7b0f06..6816bf2fced 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -246,19 +246,6 @@ recalibrate:
246 246
247static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 }; 247static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 };
248 248
249/*
250 * Check if cpu calibration delay is already known. For example,
251 * some processors with multi-core sockets may have all cores
252 * with the same calibration delay.
253 *
254 * Architectures should override this function if a faster calibration
255 * method is available.
256 */
257unsigned long __attribute__((weak)) __cpuinit calibrate_delay_is_known(void)
258{
259 return 0;
260}
261
262void __cpuinit calibrate_delay(void) 249void __cpuinit calibrate_delay(void)
263{ 250{
264 unsigned long lpj; 251 unsigned long lpj;
@@ -279,8 +266,6 @@ void __cpuinit calibrate_delay(void)
279 lpj = lpj_fine; 266 lpj = lpj_fine;
280 pr_info("Calibrating delay loop (skipped), " 267 pr_info("Calibrating delay loop (skipped), "
281 "value calculated using timer frequency.. "); 268 "value calculated using timer frequency.. ");
282 } else if ((lpj = calibrate_delay_is_known())) {
283 ;
284 } else if ((lpj = calibrate_delay_direct()) != 0) { 269 } else if ((lpj = calibrate_delay_direct()) != 0) {
285 if (!printed) 270 if (!printed)
286 pr_info("Calibrating delay using timer " 271 pr_info("Calibrating delay using timer "
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 1d1b6348f90..ef6478fbb54 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -1,13 +1,3 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10
11#include <linux/module.h> 1#include <linux/module.h>
12#include <linux/sched.h> 2#include <linux/sched.h>
13#include <linux/ctype.h> 3#include <linux/ctype.h>
@@ -38,7 +28,7 @@ int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */
38int root_mountflags = MS_RDONLY | MS_SILENT; 28int root_mountflags = MS_RDONLY | MS_SILENT;
39static char * __initdata root_device_name; 29static char * __initdata root_device_name;
40static char __initdata saved_root_name[64]; 30static char __initdata saved_root_name[64];
41static int root_wait; 31static int __initdata root_wait;
42 32
43dev_t ROOT_DEV; 33dev_t ROOT_DEV;
44 34
@@ -69,28 +59,23 @@ __setup("ro", readonly);
69__setup("rw", readwrite); 59__setup("rw", readwrite);
70 60
71#ifdef CONFIG_BLOCK 61#ifdef CONFIG_BLOCK
72struct uuidcmp {
73 const char *uuid;
74 int len;
75};
76
77/** 62/**
78 * match_dev_by_uuid - callback for finding a partition using its uuid 63 * match_dev_by_uuid - callback for finding a partition using its uuid
79 * @dev: device passed in by the caller 64 * @dev: device passed in by the caller
80 * @data: opaque pointer to the desired struct uuidcmp to match 65 * @data: opaque pointer to a 36 byte char array with a UUID
81 * 66 *
82 * Returns 1 if the device matches, and 0 otherwise. 67 * Returns 1 if the device matches, and 0 otherwise.
83 */ 68 */
84static int match_dev_by_uuid(struct device *dev, void *data) 69static int match_dev_by_uuid(struct device *dev, void *data)
85{ 70{
86 struct uuidcmp *cmp = data; 71 u8 *uuid = data;
87 struct hd_struct *part = dev_to_part(dev); 72 struct hd_struct *part = dev_to_part(dev);
88 73
89 if (!part->info) 74 if (!part->info)
90 goto no_match; 75 goto no_match;
91 76
92 if (strncasecmp(cmp->uuid, part->info->uuid, cmp->len)) 77 if (memcmp(uuid, part->info->uuid, sizeof(part->info->uuid)))
93 goto no_match; 78 goto no_match;
94 79
95 return 1; 80 return 1;
96no_match: 81no_match:
@@ -100,79 +85,31 @@ no_match:
100 85
101/** 86/**
102 * devt_from_partuuid - looks up the dev_t of a partition by its UUID 87 * devt_from_partuuid - looks up the dev_t of a partition by its UUID
103 * @uuid: char array containing ascii UUID 88 * @uuid: 36 byte char array containing a hex ascii UUID
104 * 89 *
105 * The function will return the first partition which contains a matching 90 * The function will return the first partition which contains a matching
106 * UUID value in its partition_meta_info struct. This does not search 91 * UUID value in its partition_meta_info struct. This does not search
107 * by filesystem UUIDs. 92 * by filesystem UUIDs.
108 * 93 *
109 * If @uuid is followed by a "/PARTNROFF=%d", then the number will be
110 * extracted and used as an offset from the partition identified by the UUID.
111 *
112 * Returns the matching dev_t on success or 0 on failure. 94 * Returns the matching dev_t on success or 0 on failure.
113 */ 95 */
114static dev_t devt_from_partuuid(const char *uuid_str) 96static dev_t devt_from_partuuid(char *uuid_str)
115{ 97{
116 dev_t res = 0; 98 dev_t res = 0;
117 struct uuidcmp cmp;
118 struct device *dev = NULL; 99 struct device *dev = NULL;
119 struct gendisk *disk; 100 u8 uuid[16];
120 struct hd_struct *part;
121 int offset = 0;
122 bool clear_root_wait = false;
123 char *slash;
124
125 cmp.uuid = uuid_str;
126
127 slash = strchr(uuid_str, '/');
128 /* Check for optional partition number offset attributes. */
129 if (slash) {
130 char c = 0;
131 /* Explicitly fail on poor PARTUUID syntax. */
132 if (sscanf(slash + 1,
133 "PARTNROFF=%d%c", &offset, &c) != 1) {
134 clear_root_wait = true;
135 goto done;
136 }
137 cmp.len = slash - uuid_str;
138 } else {
139 cmp.len = strlen(uuid_str);
140 }
141 101
142 if (!cmp.len) { 102 /* Pack the requested UUID in the expected format. */
143 clear_root_wait = true; 103 part_pack_uuid(uuid_str, uuid);
144 goto done;
145 }
146 104
147 dev = class_find_device(&block_class, NULL, &cmp, 105 dev = class_find_device(&block_class, NULL, uuid, &match_dev_by_uuid);
148 &match_dev_by_uuid);
149 if (!dev) 106 if (!dev)
150 goto done; 107 goto done;
151 108
152 res = dev->devt; 109 res = dev->devt;
153
154 /* Attempt to find the partition by offset. */
155 if (!offset)
156 goto no_offset;
157
158 res = 0;
159 disk = part_to_disk(dev_to_part(dev));
160 part = disk_get_part(disk, dev_to_part(dev)->partno + offset);
161 if (part) {
162 res = part_devt(part);
163 put_device(part_to_dev(part));
164 }
165
166no_offset:
167 put_device(dev); 110 put_device(dev);
111
168done: 112done:
169 if (clear_root_wait) {
170 pr_err("VFS: PARTUUID= is invalid.\n"
171 "Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n");
172 if (root_wait)
173 pr_err("Disabling rootwait; root= is invalid.\n");
174 root_wait = 0;
175 }
176 return res; 113 return res;
177} 114}
178#endif 115#endif
@@ -189,12 +126,6 @@ done:
189 * used when disk name of partitioned disk ends on a digit. 126 * used when disk name of partitioned disk ends on a digit.
190 * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the 127 * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
191 * unique id of a partition if the partition table provides it. 128 * unique id of a partition if the partition table provides it.
192 * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
193 * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
194 * filled hex representation of the 32-bit "NT disk signature", and PP
195 * is a zero-filled hex representation of the 1-based partition number.
196 * 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
197 * a partition with a known unique id.
198 * 129 *
199 * If name doesn't have fall into the categories above, we return (0,0). 130 * If name doesn't have fall into the categories above, we return (0,0).
200 * block_class is used to check if something is a disk name. If the disk 131 * block_class is used to check if something is a disk name. If the disk
@@ -212,6 +143,8 @@ dev_t name_to_dev_t(char *name)
212#ifdef CONFIG_BLOCK 143#ifdef CONFIG_BLOCK
213 if (strncmp(name, "PARTUUID=", 9) == 0) { 144 if (strncmp(name, "PARTUUID=", 9) == 0) {
214 name += 9; 145 name += 9;
146 if (strlen(name) != 36)
147 goto fail;
215 res = devt_from_partuuid(name); 148 res = devt_from_partuuid(name);
216 if (!res) 149 if (!res)
217 goto fail; 150 goto fail;
@@ -354,27 +287,24 @@ static void __init get_fs_names(char *page)
354 287
355static int __init do_mount_root(char *name, char *fs, int flags, void *data) 288static int __init do_mount_root(char *name, char *fs, int flags, void *data)
356{ 289{
357 struct super_block *s;
358 int err = sys_mount(name, "/root", fs, flags, data); 290 int err = sys_mount(name, "/root", fs, flags, data);
359 if (err) 291 if (err)
360 return err; 292 return err;
361 293
362 sys_chdir("/root"); 294 sys_chdir((const char __user __force *)"/root");
363 s = current->fs->pwd.dentry->d_sb; 295 ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev;
364 ROOT_DEV = s->s_dev;
365 printk(KERN_INFO 296 printk(KERN_INFO
366 "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", 297 "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n",
367 s->s_type->name, 298 current->fs->pwd.mnt->mnt_sb->s_type->name,
368 s->s_flags & MS_RDONLY ? " readonly" : "", 299 current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ?
369 MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); 300 " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
370 return 0; 301 return 0;
371} 302}
372 303
373void __init mount_block_root(char *name, int flags) 304void __init mount_block_root(char *name, int flags)
374{ 305{
375 struct page *page = alloc_page(GFP_KERNEL | 306 char *fs_names = __getname_gfp(GFP_KERNEL
376 __GFP_NOTRACK_FALSE_POSITIVE); 307 | __GFP_NOTRACK_FALSE_POSITIVE);
377 char *fs_names = page_address(page);
378 char *p; 308 char *p;
379#ifdef CONFIG_BLOCK 309#ifdef CONFIG_BLOCK
380 char b[BDEVNAME_SIZE]; 310 char b[BDEVNAME_SIZE];
@@ -403,8 +333,8 @@ retry:
403#ifdef CONFIG_BLOCK 333#ifdef CONFIG_BLOCK
404 __bdevname(ROOT_DEV, b); 334 __bdevname(ROOT_DEV, b);
405#endif 335#endif
406 printk("VFS: Cannot open root device \"%s\" or %s: error %d\n", 336 printk("VFS: Cannot open root device \"%s\" or %s\n",
407 root_device_name, b, err); 337 root_device_name, b);
408 printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); 338 printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
409 339
410 printk_all_partitions(); 340 printk_all_partitions();
@@ -426,7 +356,7 @@ retry:
426#endif 356#endif
427 panic("VFS: Unable to mount root fs on %s", b); 357 panic("VFS: Unable to mount root fs on %s", b);
428out: 358out:
429 put_page(page); 359 putname(fs_names);
430} 360}
431 361
432#ifdef CONFIG_ROOT_NFS 362#ifdef CONFIG_ROOT_NFS
@@ -502,7 +432,7 @@ void __init change_floppy(char *fmt, ...)
502void __init mount_root(void) 432void __init mount_root(void)
503{ 433{
504#ifdef CONFIG_ROOT_NFS 434#ifdef CONFIG_ROOT_NFS
505 if (ROOT_DEV == Root_NFS) { 435 if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
506 if (mount_nfs_root()) 436 if (mount_nfs_root())
507 return; 437 return;
508 438
@@ -586,5 +516,5 @@ void __init prepare_namespace(void)
586out: 516out:
587 devtmpfs_mount("dev"); 517 devtmpfs_mount("dev");
588 sys_mount(".", "/", NULL, MS_MOVE, NULL); 518 sys_mount(".", "/", NULL, MS_MOVE, NULL);
589 sys_chroot("."); 519 sys_chroot((const char __user __force *)".");
590} 520}
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 5e4ded51788..3098a38f3ae 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -1,28 +1,19 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10
11#include <linux/unistd.h> 1#include <linux/unistd.h>
12#include <linux/kernel.h> 2#include <linux/kernel.h>
13#include <linux/fs.h> 3#include <linux/fs.h>
14#include <linux/minix_fs.h> 4#include <linux/minix_fs.h>
5#include <linux/ext2_fs.h>
15#include <linux/romfs_fs.h> 6#include <linux/romfs_fs.h>
16#include <linux/initrd.h> 7#include <linux/initrd.h>
17#include <linux/sched.h> 8#include <linux/sched.h>
18#include <linux/freezer.h> 9#include <linux/freezer.h>
19#include <linux/kmod.h>
20 10
21#include "do_mounts.h" 11#include "do_mounts.h"
22 12
23unsigned long initrd_start, initrd_end; 13unsigned long initrd_start, initrd_end;
24int initrd_below_start_ok; 14int initrd_below_start_ok;
25unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ 15unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */
16static int __initdata old_fd, root_fd;
26static int __initdata mount_initrd = 1; 17static int __initdata mount_initrd = 1;
27 18
28static int __init no_initrd(char *str) 19static int __init no_initrd(char *str)
@@ -33,29 +24,33 @@ static int __init no_initrd(char *str)
33 24
34__setup("noinitrd", no_initrd); 25__setup("noinitrd", no_initrd);
35 26
36static int init_linuxrc(struct subprocess_info *info, struct cred *new) 27static int __init do_linuxrc(void *_shell)
37{ 28{
38 sys_unshare(CLONE_FS | CLONE_FILES); 29 static const char *argv[] = { "linuxrc", NULL, };
39 /* move initrd over / and chdir/chroot in initrd root */ 30 extern const char *envp_init[];
40 sys_chdir("/root"); 31 const char *shell = _shell;
41 sys_mount(".", "/", NULL, MS_MOVE, NULL); 32
42 sys_chroot("."); 33 sys_close(old_fd);sys_close(root_fd);
43 sys_setsid(); 34 sys_setsid();
44 return 0; 35 return kernel_execve(shell, argv, envp_init);
45} 36}
46 37
47static void __init handle_initrd(void) 38static void __init handle_initrd(void)
48{ 39{
49 static char *argv[] = { "linuxrc", NULL, };
50 extern char *envp_init[];
51 int error; 40 int error;
41 int pid;
52 42
53 real_root_dev = new_encode_dev(ROOT_DEV); 43 real_root_dev = new_encode_dev(ROOT_DEV);
54 create_dev("/dev/root.old", Root_RAM0); 44 create_dev("/dev/root.old", Root_RAM0);
55 /* mount initrd on rootfs' /root */ 45 /* mount initrd on rootfs' /root */
56 mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY); 46 mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY);
57 sys_mkdir("/old", 0700); 47 sys_mkdir("/old", 0700);
58 sys_chdir("/old"); 48 root_fd = sys_open("/", 0, 0);
49 old_fd = sys_open("/old", 0, 0);
50 /* move initrd over / and chdir/chroot in initrd root */
51 sys_chdir("/root");
52 sys_mount(".", "/", NULL, MS_MOVE, NULL);
53 sys_chroot(".");
59 54
60 /* 55 /*
61 * In case that a resume from disk is carried out by linuxrc or one of 56 * In case that a resume from disk is carried out by linuxrc or one of
@@ -63,22 +58,27 @@ static void __init handle_initrd(void)
63 */ 58 */
64 current->flags |= PF_FREEZER_SKIP; 59 current->flags |= PF_FREEZER_SKIP;
65 60
66 call_usermodehelper_fns("/linuxrc", argv, envp_init, UMH_WAIT_PROC, 61 pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
67 init_linuxrc, NULL, NULL); 62 if (pid > 0)
63 while (pid != sys_wait4(-1, NULL, 0, NULL))
64 yield();
68 65
69 current->flags &= ~PF_FREEZER_SKIP; 66 current->flags &= ~PF_FREEZER_SKIP;
70 67
71 /* move initrd to rootfs' /old */ 68 /* move initrd to rootfs' /old */
72 sys_mount("..", ".", NULL, MS_MOVE, NULL); 69 sys_fchdir(old_fd);
70 sys_mount("/", ".", NULL, MS_MOVE, NULL);
73 /* switch root and cwd back to / of rootfs */ 71 /* switch root and cwd back to / of rootfs */
74 sys_chroot(".."); 72 sys_fchdir(root_fd);
73 sys_chroot(".");
74 sys_close(old_fd);
75 sys_close(root_fd);
75 76
76 if (new_decode_dev(real_root_dev) == Root_RAM0) { 77 if (new_decode_dev(real_root_dev) == Root_RAM0) {
77 sys_chdir("/old"); 78 sys_chdir("/old");
78 return; 79 return;
79 } 80 }
80 81
81 sys_chdir("/");
82 ROOT_DEV = new_decode_dev(real_root_dev); 82 ROOT_DEV = new_decode_dev(real_root_dev);
83 mount_root(); 83 mount_root();
84 84
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 8cb6db54285..32c4799b8c9 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -1,13 +1,3 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10
11#include <linux/delay.h> 1#include <linux/delay.h>
12#include <linux/raid/md_u.h> 2#include <linux/raid/md_u.h>
13#include <linux/raid/md_p.h> 3#include <linux/raid/md_p.h>
@@ -293,7 +283,7 @@ static void __init autodetect_raid(void)
293 283
294 wait_for_device_probe(); 284 wait_for_device_probe();
295 285
296 fd = sys_open("/dev/md0", 0, 0); 286 fd = sys_open((const char __user __force *) "/dev/md0", 0, 0);
297 if (fd >= 0) { 287 if (fd >= 0) {
298 sys_ioctl(fd, RAID_AUTORUN, raid_autopart); 288 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
299 sys_close(fd); 289 sys_close(fd);
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index 6be2879cca6..fe9acb0ae48 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -1,12 +1,3 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10 1
11#include <linux/kernel.h> 2#include <linux/kernel.h>
12#include <linux/fs.h> 3#include <linux/fs.h>
@@ -63,19 +54,20 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
63{ 54{
64 const int size = 512; 55 const int size = 512;
65 struct minix_super_block *minixsb; 56 struct minix_super_block *minixsb;
57 struct ext2_super_block *ext2sb;
66 struct romfs_super_block *romfsb; 58 struct romfs_super_block *romfsb;
67 struct cramfs_super *cramfsb; 59 struct cramfs_super *cramfsb;
68 struct squashfs_super_block *squashfsb; 60 struct squashfs_super_block *squashfsb;
69 int nblocks = -1; 61 int nblocks = -1;
70 unsigned char *buf; 62 unsigned char *buf;
71 const char *compress_name; 63 const char *compress_name;
72 unsigned long n;
73 64
74 buf = kmalloc(size, GFP_KERNEL); 65 buf = kmalloc(size, GFP_KERNEL);
75 if (!buf) 66 if (!buf)
76 return -ENOMEM; 67 return -ENOMEM;
77 68
78 minixsb = (struct minix_super_block *) buf; 69 minixsb = (struct minix_super_block *) buf;
70 ext2sb = (struct ext2_super_block *) buf;
79 romfsb = (struct romfs_super_block *) buf; 71 romfsb = (struct romfs_super_block *) buf;
80 cramfsb = (struct cramfs_super *) buf; 72 cramfsb = (struct cramfs_super *) buf;
81 squashfsb = (struct squashfs_super_block *) buf; 73 squashfsb = (struct squashfs_super_block *) buf;
@@ -128,20 +120,6 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
128 } 120 }
129 121
130 /* 122 /*
131 * Read 512 bytes further to check if cramfs is padded
132 */
133 sys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0);
134 sys_read(fd, buf, size);
135
136 if (cramfsb->magic == CRAMFS_MAGIC) {
137 printk(KERN_NOTICE
138 "RAMDISK: cramfs filesystem found at block %d\n",
139 start_block);
140 nblocks = (cramfsb->size + BLOCK_SIZE - 1) >> BLOCK_SIZE_BITS;
141 goto done;
142 }
143
144 /*
145 * Read block 1 to test for minix and ext2 superblock 123 * Read block 1 to test for minix and ext2 superblock
146 */ 124 */
147 sys_lseek(fd, (start_block+1) * BLOCK_SIZE, 0); 125 sys_lseek(fd, (start_block+1) * BLOCK_SIZE, 0);
@@ -158,12 +136,12 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
158 } 136 }
159 137
160 /* Try ext2 */ 138 /* Try ext2 */
161 n = ext2_image_size(buf); 139 if (ext2sb->s_magic == cpu_to_le16(EXT2_SUPER_MAGIC)) {
162 if (n) {
163 printk(KERN_NOTICE 140 printk(KERN_NOTICE
164 "RAMDISK: ext2 filesystem found at block %d\n", 141 "RAMDISK: ext2 filesystem found at block %d\n",
165 start_block); 142 start_block);
166 nblocks = n; 143 nblocks = le32_to_cpu(ext2sb->s_blocks_count) <<
144 le32_to_cpu(ext2sb->s_log_block_size);
167 goto done; 145 goto done;
168 } 146 }
169 147
@@ -186,11 +164,11 @@ int __init rd_load_image(char *from)
186 char *buf = NULL; 164 char *buf = NULL;
187 unsigned short rotate = 0; 165 unsigned short rotate = 0;
188 decompress_fn decompressor = NULL; 166 decompress_fn decompressor = NULL;
189#if !defined(CONFIG_S390) 167#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES)
190 char rotator[4] = { '|' , '/' , '-' , '\\' }; 168 char rotator[4] = { '|' , '/' , '-' , '\\' };
191#endif 169#endif
192 170
193 out_fd = sys_open("/dev/ram", O_RDWR, 0); 171 out_fd = sys_open((const char __user __force *) "/dev/ram", O_RDWR, 0);
194 if (out_fd < 0) 172 if (out_fd < 0)
195 goto out; 173 goto out;
196 174
@@ -272,7 +250,7 @@ int __init rd_load_image(char *from)
272 } 250 }
273 sys_read(in_fd, buf, BLOCK_SIZE); 251 sys_read(in_fd, buf, BLOCK_SIZE);
274 sys_write(out_fd, buf, BLOCK_SIZE); 252 sys_write(out_fd, buf, BLOCK_SIZE);
275#if !defined(CONFIG_S390) 253#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES)
276 if (!(i % 16)) { 254 if (!(i % 16)) {
277 printk("%c\b", rotator[rotate & 0x3]); 255 printk("%c\b", rotator[rotate & 0x3]);
278 rotate++; 256 rotate++;
@@ -289,7 +267,7 @@ noclose_input:
289 sys_close(out_fd); 267 sys_close(out_fd);
290out: 268out:
291 kfree(buf); 269 kfree(buf);
292 sys_unlink("/dev/ram"); 270 sys_unlink((const char __user __force *) "/dev/ram");
293 return res; 271 return res;
294} 272}
295 273
diff --git a/init/init_task.c b/init/init_task.c
deleted file mode 100644
index 8b2f3996b03..00000000000
--- a/init/init_task.c
+++ /dev/null
@@ -1,24 +0,0 @@
1#include <linux/init_task.h>
2#include <linux/export.h>
3#include <linux/mqueue.h>
4#include <linux/sched.h>
5#include <linux/init.h>
6#include <linux/fs.h>
7#include <linux/mm.h>
8
9#include <asm/pgtable.h>
10#include <asm/uaccess.h>
11
12static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
13static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
14
15/* Initial task structure */
16struct task_struct init_task = INIT_TASK(init_task);
17EXPORT_SYMBOL(init_task);
18
19/*
20 * Initial thread structure. Alignment of this is handled by a special
21 * linker map entry.
22 */
23union thread_union init_thread_union __init_task_data =
24 { INIT_THREAD_INFO(init_task) };
diff --git a/init/initramfs.c b/init/initramfs.c
index 84c6bf11130..2531811d42c 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -1,13 +1,3 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10
11#include <linux/init.h> 1#include <linux/init.h>
12#include <linux/fs.h> 2#include <linux/fs.h>
13#include <linux/slab.h> 3#include <linux/slab.h>
@@ -32,7 +22,7 @@ static void __init error(char *x)
32 22
33static __initdata struct hash { 23static __initdata struct hash {
34 int ino, minor, major; 24 int ino, minor, major;
35 umode_t mode; 25 mode_t mode;
36 struct hash *next; 26 struct hash *next;
37 char name[N_ALIGN(PATH_MAX)]; 27 char name[N_ALIGN(PATH_MAX)];
38} *head[32]; 28} *head[32];
@@ -45,7 +35,7 @@ static inline int hash(int major, int minor, int ino)
45} 35}
46 36
47static char __init *find_link(int major, int minor, int ino, 37static char __init *find_link(int major, int minor, int ino,
48 umode_t mode, char *name) 38 mode_t mode, char *name)
49{ 39{
50 struct hash **p, *q; 40 struct hash **p, *q;
51 for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) { 41 for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) {
@@ -84,7 +74,7 @@ static void __init free_hash(void)
84 } 74 }
85} 75}
86 76
87static long __init do_utime(char *filename, time_t mtime) 77static long __init do_utime(char __user *filename, time_t mtime)
88{ 78{
89 struct timespec t[2]; 79 struct timespec t[2];
90 80
@@ -130,7 +120,7 @@ static __initdata time_t mtime;
130/* cpio header parsing */ 120/* cpio header parsing */
131 121
132static __initdata unsigned long ino, major, minor, nlink; 122static __initdata unsigned long ino, major, minor, nlink;
133static __initdata umode_t mode; 123static __initdata mode_t mode;
134static __initdata unsigned long body_len, name_len; 124static __initdata unsigned long body_len, name_len;
135static __initdata uid_t uid; 125static __initdata uid_t uid;
136static __initdata gid_t gid; 126static __initdata gid_t gid;
@@ -286,7 +276,7 @@ static int __init maybe_link(void)
286 return 0; 276 return 0;
287} 277}
288 278
289static void __init clean_path(char *path, umode_t mode) 279static void __init clean_path(char *path, mode_t mode)
290{ 280{
291 struct stat st; 281 struct stat st;
292 282
@@ -539,7 +529,7 @@ static void __init clean_rootfs(void)
539 struct linux_dirent64 *dirp; 529 struct linux_dirent64 *dirp;
540 int num; 530 int num;
541 531
542 fd = sys_open("/", O_RDONLY, 0); 532 fd = sys_open((const char __user __force *) "/", O_RDONLY, 0);
543 WARN_ON(fd < 0); 533 WARN_ON(fd < 0);
544 if (fd < 0) 534 if (fd < 0)
545 return; 535 return;
@@ -599,7 +589,7 @@ static int __init populate_rootfs(void)
599 } 589 }
600 printk(KERN_INFO "rootfs image is not initramfs (%s)" 590 printk(KERN_INFO "rootfs image is not initramfs (%s)"
601 "; looks like an initrd\n", err); 591 "; looks like an initrd\n", err);
602 fd = sys_open("/initrd.image", 592 fd = sys_open((const char __user __force *) "/initrd.image",
603 O_WRONLY|O_CREAT, 0700); 593 O_WRONLY|O_CREAT, 0700);
604 if (fd >= 0) { 594 if (fd >= 0) {
605 sys_write(fd, (char *)initrd_start, 595 sys_write(fd, (char *)initrd_start,
diff --git a/init/main.c b/init/main.c
index 85d69dffe86..03b408dff82 100644
--- a/init/main.c
+++ b/init/main.c
@@ -68,8 +68,6 @@
68#include <linux/shmem_fs.h> 68#include <linux/shmem_fs.h>
69#include <linux/slab.h> 69#include <linux/slab.h>
70#include <linux/perf_event.h> 70#include <linux/perf_event.h>
71#include <linux/file.h>
72#include <linux/ptrace.h>
73 71
74#include <asm/io.h> 72#include <asm/io.h>
75#include <asm/bugs.h> 73#include <asm/bugs.h>
@@ -87,7 +85,9 @@ extern void init_IRQ(void);
87extern void fork_init(unsigned long); 85extern void fork_init(unsigned long);
88extern void mca_init(void); 86extern void mca_init(void);
89extern void sbus_init(void); 87extern void sbus_init(void);
88extern void prio_tree_init(void);
90extern void radix_tree_init(void); 89extern void radix_tree_init(void);
90extern void free_initmem(void);
91#ifndef CONFIG_DEBUG_RODATA 91#ifndef CONFIG_DEBUG_RODATA
92static inline void mark_rodata_ro(void) { } 92static inline void mark_rodata_ro(void) { }
93#endif 93#endif
@@ -163,7 +163,7 @@ static int __init obsolete_checksetup(char *line)
163 p = __setup_start; 163 p = __setup_start;
164 do { 164 do {
165 int n = strlen(p->str); 165 int n = strlen(p->str);
166 if (parameqn(line, p->str, n)) { 166 if (!strncmp(line, p->str, n)) {
167 if (p->early) { 167 if (p->early) {
168 /* Already done in parse_early_param? 168 /* Already done in parse_early_param?
169 * (Needs exact match on param part). 169 * (Needs exact match on param part).
@@ -226,9 +226,13 @@ static int __init loglevel(char *str)
226 226
227early_param("loglevel", loglevel); 227early_param("loglevel", loglevel);
228 228
229/* Change NUL term back to "=", to make "param" the whole string. */ 229/*
230static int __init repair_env_string(char *param, char *val, const char *unused) 230 * Unknown boot options get handed to init, unless they look like
231 * unused parameters (modprobe will find them in /proc/cmdline).
232 */
233static int __init unknown_bootoption(char *param, char *val)
231{ 234{
235 /* Change NUL term back to "=", to make "param" the whole string. */
232 if (val) { 236 if (val) {
233 /* param=val or param="val"? */ 237 /* param=val or param="val"? */
234 if (val == param+strlen(param)+1) 238 if (val == param+strlen(param)+1)
@@ -240,16 +244,6 @@ static int __init repair_env_string(char *param, char *val, const char *unused)
240 } else 244 } else
241 BUG(); 245 BUG();
242 } 246 }
243 return 0;
244}
245
246/*
247 * Unknown boot options get handed to init, unless they look like
248 * unused parameters (modprobe will find them in /proc/cmdline).
249 */
250static int __init unknown_bootoption(char *param, char *val, const char *unused)
251{
252 repair_env_string(param, val, unused);
253 247
254 /* Handle obsolete-style parameters */ 248 /* Handle obsolete-style parameters */
255 if (obsolete_checksetup(param)) 249 if (obsolete_checksetup(param))
@@ -288,6 +282,10 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused)
288 return 0; 282 return 0;
289} 283}
290 284
285#ifdef CONFIG_DEBUG_PAGEALLOC
286int __read_mostly debug_pagealloc_enabled = 0;
287#endif
288
291static int __init init_setup(char *str) 289static int __init init_setup(char *str)
292{ 290{
293 unsigned int i; 291 unsigned int i;
@@ -380,18 +378,21 @@ static noinline void __init_refok rest_init(void)
380 * at least once to get things moving: 378 * at least once to get things moving:
381 */ 379 */
382 init_idle_bootup_task(current); 380 init_idle_bootup_task(current);
383 schedule_preempt_disabled(); 381 preempt_enable_no_resched();
382 schedule();
383
384 /* Call into cpu_idle with preempt disabled */ 384 /* Call into cpu_idle with preempt disabled */
385 preempt_disable();
385 cpu_idle(); 386 cpu_idle();
386} 387}
387 388
388/* Check for early params. */ 389/* Check for early params. */
389static int __init do_early_param(char *param, char *val, const char *unused) 390static int __init do_early_param(char *param, char *val)
390{ 391{
391 const struct obs_kernel_param *p; 392 const struct obs_kernel_param *p;
392 393
393 for (p = __setup_start; p < __setup_end; p++) { 394 for (p = __setup_start; p < __setup_end; p++) {
394 if ((p->early && parameq(param, p->str)) || 395 if ((p->early && strcmp(param, p->str) == 0) ||
395 (strcmp(param, "console") == 0 && 396 (strcmp(param, "console") == 0 &&
396 strcmp(p->str, "earlycon") == 0) 397 strcmp(p->str, "earlycon") == 0)
397 ) { 398 ) {
@@ -406,7 +407,7 @@ static int __init do_early_param(char *param, char *val, const char *unused)
406 407
407void __init parse_early_options(char *cmdline) 408void __init parse_early_options(char *cmdline)
408{ 409{
409 parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param); 410 parse_args("early options", cmdline, NULL, 0, do_early_param);
410} 411}
411 412
412/* Arch code calls this early on, or if not, just before other parsing. */ 413/* Arch code calls this early on, or if not, just before other parsing. */
@@ -442,11 +443,9 @@ void __init __weak smp_setup_processor_id(void)
442{ 443{
443} 444}
444 445
445# if THREAD_SIZE >= PAGE_SIZE
446void __init __weak thread_info_cache_init(void) 446void __init __weak thread_info_cache_init(void)
447{ 447{
448} 448}
449#endif
450 449
451/* 450/*
452 * Set up kernel memory allocators 451 * Set up kernel memory allocators
@@ -454,8 +453,8 @@ void __init __weak thread_info_cache_init(void)
454static void __init mm_init(void) 453static void __init mm_init(void)
455{ 454{
456 /* 455 /*
457 * page_cgroup requires contiguous pages, 456 * page_cgroup requires countinous pages as memmap
458 * bigger than MAX_ORDER unless SPARSEMEM. 457 * and it's bigger than MAX_ORDER unless SPARSEMEM.
459 */ 458 */
460 page_cgroup_init_flatmem(); 459 page_cgroup_init_flatmem();
461 mem_init(); 460 mem_init();
@@ -470,12 +469,13 @@ asmlinkage void __init start_kernel(void)
470 char * command_line; 469 char * command_line;
471 extern const struct kernel_param __start___param[], __stop___param[]; 470 extern const struct kernel_param __start___param[], __stop___param[];
472 471
472 smp_setup_processor_id();
473
473 /* 474 /*
474 * Need to run as early as possible, to initialize the 475 * Need to run as early as possible, to initialize the
475 * lockdep hash: 476 * lockdep hash:
476 */ 477 */
477 lockdep_init(); 478 lockdep_init();
478 smp_setup_processor_id();
479 debug_objects_early_init(); 479 debug_objects_early_init();
480 480
481 /* 481 /*
@@ -504,17 +504,14 @@ asmlinkage void __init start_kernel(void)
504 setup_per_cpu_areas(); 504 setup_per_cpu_areas();
505 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 505 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
506 506
507 build_all_zonelists(NULL, NULL); 507 build_all_zonelists(NULL);
508 page_alloc_init(); 508 page_alloc_init();
509 509
510 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); 510 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
511 parse_early_param(); 511 parse_early_param();
512 parse_args("Booting kernel", static_command_line, __start___param, 512 parse_args("Booting kernel", static_command_line, __start___param,
513 __stop___param - __start___param, 513 __stop___param - __start___param,
514 -1, -1, &unknown_bootoption); 514 &unknown_bootoption);
515
516 jump_label_init();
517
518 /* 515 /*
519 * These use large bootmem allocations and must precede 516 * These use large bootmem allocations and must precede
520 * kmem_cache_init() 517 * kmem_cache_init()
@@ -549,6 +546,7 @@ asmlinkage void __init start_kernel(void)
549 /* init some links before init_ISA_irqs() */ 546 /* init some links before init_ISA_irqs() */
550 early_irq_init(); 547 early_irq_init();
551 init_IRQ(); 548 init_IRQ();
549 prio_tree_init();
552 init_timers(); 550 init_timers();
553 hrtimers_init(); 551 hrtimers_init();
554 softirq_init(); 552 softirq_init();
@@ -562,6 +560,9 @@ asmlinkage void __init start_kernel(void)
562 early_boot_irqs_disabled = false; 560 early_boot_irqs_disabled = false;
563 local_irq_enable(); 561 local_irq_enable();
564 562
563 /* Interrupts are enabled now so all GFP allocations are safe. */
564 gfp_allowed_mask = __GFP_BITS_MASK;
565
565 kmem_cache_init_late(); 566 kmem_cache_init_late();
566 567
567 /* 568 /*
@@ -593,6 +594,7 @@ asmlinkage void __init start_kernel(void)
593 } 594 }
594#endif 595#endif
595 page_cgroup_init(); 596 page_cgroup_init();
597 enable_debug_pagealloc();
596 debug_objects_mem_init(); 598 debug_objects_mem_init();
597 kmemleak_init(); 599 kmemleak_init();
598 setup_per_cpu_pageset(); 600 setup_per_cpu_pageset();
@@ -632,11 +634,6 @@ asmlinkage void __init start_kernel(void)
632 acpi_early_init(); /* before LAPIC and SMP init */ 634 acpi_early_init(); /* before LAPIC and SMP init */
633 sfi_init_late(); 635 sfi_init_late();
634 636
635 if (efi_enabled) {
636 efi_late_init();
637 efi_free_boot_services();
638 }
639
640 ftrace_init(); 637 ftrace_init();
641 638
642 /* Do the rest non-__init'ed, we're now alive */ 639 /* Do the rest non-__init'ed, we're now alive */
@@ -654,7 +651,7 @@ static void __init do_ctors(void)
654#endif 651#endif
655} 652}
656 653
657bool initcall_debug; 654int initcall_debug;
658core_param(initcall_debug, initcall_debug, bool, 0644); 655core_param(initcall_debug, initcall_debug, bool, 0644);
659 656
660static char msgbuf[64]; 657static char msgbuf[64];
@@ -708,63 +705,14 @@ int __init_or_module do_one_initcall(initcall_t fn)
708} 705}
709 706
710 707
711extern initcall_t __initcall_start[]; 708extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
712extern initcall_t __initcall0_start[];
713extern initcall_t __initcall1_start[];
714extern initcall_t __initcall2_start[];
715extern initcall_t __initcall3_start[];
716extern initcall_t __initcall4_start[];
717extern initcall_t __initcall5_start[];
718extern initcall_t __initcall6_start[];
719extern initcall_t __initcall7_start[];
720extern initcall_t __initcall_end[];
721
722static initcall_t *initcall_levels[] __initdata = {
723 __initcall0_start,
724 __initcall1_start,
725 __initcall2_start,
726 __initcall3_start,
727 __initcall4_start,
728 __initcall5_start,
729 __initcall6_start,
730 __initcall7_start,
731 __initcall_end,
732};
733
734/* Keep these in sync with initcalls in include/linux/init.h */
735static char *initcall_level_names[] __initdata = {
736 "early",
737 "core",
738 "postcore",
739 "arch",
740 "subsys",
741 "fs",
742 "device",
743 "late",
744};
745
746static void __init do_initcall_level(int level)
747{
748 extern const struct kernel_param __start___param[], __stop___param[];
749 initcall_t *fn;
750
751 strcpy(static_command_line, saved_command_line);
752 parse_args(initcall_level_names[level],
753 static_command_line, __start___param,
754 __stop___param - __start___param,
755 level, level,
756 &repair_env_string);
757
758 for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)
759 do_one_initcall(*fn);
760}
761 709
762static void __init do_initcalls(void) 710static void __init do_initcalls(void)
763{ 711{
764 int level; 712 initcall_t *fn;
765 713
766 for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++) 714 for (fn = __early_initcall_end; fn < __initcall_end; fn++)
767 do_initcall_level(level); 715 do_one_initcall(*fn);
768} 716}
769 717
770/* 718/*
@@ -790,23 +738,21 @@ static void __init do_pre_smp_initcalls(void)
790{ 738{
791 initcall_t *fn; 739 initcall_t *fn;
792 740
793 for (fn = __initcall_start; fn < __initcall0_start; fn++) 741 for (fn = __initcall_start; fn < __early_initcall_end; fn++)
794 do_one_initcall(*fn); 742 do_one_initcall(*fn);
795} 743}
796 744
797static int run_init_process(const char *init_filename) 745static void run_init_process(const char *init_filename)
798{ 746{
799 argv_init[0] = init_filename; 747 argv_init[0] = init_filename;
800 return do_execve(init_filename, 748 kernel_execve(init_filename, argv_init, envp_init);
801 (const char __user *const __user *)argv_init,
802 (const char __user *const __user *)envp_init);
803} 749}
804 750
805static void __init kernel_init_freeable(void); 751/* This is a non __init function. Force it to be noinline otherwise gcc
806 752 * makes it inline to init() and it becomes part of init.text section
807static int __ref kernel_init(void *unused) 753 */
754static noinline int init_post(void)
808{ 755{
809 kernel_init_freeable();
810 /* need to finish all async __init code before freeing the memory */ 756 /* need to finish all async __init code before freeing the memory */
811 async_synchronize_full(); 757 async_synchronize_full();
812 free_initmem(); 758 free_initmem();
@@ -814,11 +760,11 @@ static int __ref kernel_init(void *unused)
814 system_state = SYSTEM_RUNNING; 760 system_state = SYSTEM_RUNNING;
815 numa_default_policy(); 761 numa_default_policy();
816 762
817 flush_delayed_fput(); 763
764 current->signal->flags |= SIGNAL_UNKILLABLE;
818 765
819 if (ramdisk_execute_command) { 766 if (ramdisk_execute_command) {
820 if (!run_init_process(ramdisk_execute_command)) 767 run_init_process(ramdisk_execute_command);
821 return 0;
822 printk(KERN_WARNING "Failed to execute %s\n", 768 printk(KERN_WARNING "Failed to execute %s\n",
823 ramdisk_execute_command); 769 ramdisk_execute_command);
824 } 770 }
@@ -830,35 +776,29 @@ static int __ref kernel_init(void *unused)
830 * trying to recover a really broken machine. 776 * trying to recover a really broken machine.
831 */ 777 */
832 if (execute_command) { 778 if (execute_command) {
833 if (!run_init_process(execute_command)) 779 run_init_process(execute_command);
834 return 0;
835 printk(KERN_WARNING "Failed to execute %s. Attempting " 780 printk(KERN_WARNING "Failed to execute %s. Attempting "
836 "defaults...\n", execute_command); 781 "defaults...\n", execute_command);
837 } 782 }
838 if (!run_init_process("/sbin/init") || 783 run_init_process("/sbin/init");
839 !run_init_process("/etc/init") || 784 run_init_process("/etc/init");
840 !run_init_process("/bin/init") || 785 run_init_process("/bin/init");
841 !run_init_process("/bin/sh")) 786 run_init_process("/bin/sh");
842 return 0;
843 787
844 panic("No init found. Try passing init= option to kernel. " 788 panic("No init found. Try passing init= option to kernel. "
845 "See Linux Documentation/init.txt for guidance."); 789 "See Linux Documentation/init.txt for guidance.");
846} 790}
847 791
848static void __init kernel_init_freeable(void) 792static int __init kernel_init(void * unused)
849{ 793{
850 /* 794 /*
851 * Wait until kthreadd is all set-up. 795 * Wait until kthreadd is all set-up.
852 */ 796 */
853 wait_for_completion(&kthreadd_done); 797 wait_for_completion(&kthreadd_done);
854
855 /* Now the scheduler is fully set up and can do blocking allocations */
856 gfp_allowed_mask = __GFP_BITS_MASK;
857
858 /* 798 /*
859 * init can allocate pages on any node 799 * init can allocate pages on any node
860 */ 800 */
861 set_mems_allowed(node_states[N_MEMORY]); 801 set_mems_allowed(node_states[N_HIGH_MEMORY]);
862 /* 802 /*
863 * init can run on any cpu. 803 * init can run on any cpu.
864 */ 804 */
@@ -900,4 +840,7 @@ static void __init kernel_init_freeable(void)
900 * we're essentially up and running. Get rid of the 840 * we're essentially up and running. Get rid of the
901 * initmem segments and start the user-mode stuff.. 841 * initmem segments and start the user-mode stuff..
902 */ 842 */
843
844 init_post();
845 return 0;
903} 846}
diff --git a/init/version.c b/init/version.c
index 58170f18912..86fe0ccb997 100644
--- a/init/version.c
+++ b/init/version.c
@@ -12,7 +12,6 @@
12#include <linux/utsname.h> 12#include <linux/utsname.h>
13#include <generated/utsrelease.h> 13#include <generated/utsrelease.h>
14#include <linux/version.h> 14#include <linux/version.h>
15#include <linux/proc_fs.h>
16 15
17#ifndef CONFIG_KALLSYMS 16#ifndef CONFIG_KALLSYMS
18#define version(a) Version_ ## a 17#define version(a) Version_ ## a
@@ -35,7 +34,6 @@ struct uts_namespace init_uts_ns = {
35 .domainname = UTS_DOMAINNAME, 34 .domainname = UTS_DOMAINNAME,
36 }, 35 },
37 .user_ns = &init_user_ns, 36 .user_ns = &init_user_ns,
38 .proc_inum = PROC_UTS_INIT_INO,
39}; 37};
40EXPORT_SYMBOL_GPL(init_uts_ns); 38EXPORT_SYMBOL_GPL(init_uts_ns);
41 39