From 8dea78da5cee153b8af9c07a2745f6c55057fe12 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 17 Jan 2013 16:15:55 -0500 Subject: Patched in Tegra support. --- init/Kconfig | 557 ++++++++++-------------------------------------- init/Makefile | 4 - init/calibrate.c | 15 -- init/do_mounts.c | 122 +++-------- init/do_mounts_initrd.c | 52 ++--- init/do_mounts_md.c | 12 +- init/do_mounts_rd.c | 40 +--- init/init_task.c | 24 --- init/initramfs.c | 24 +-- init/main.c | 169 +++++---------- init/version.c | 2 - 11 files changed, 241 insertions(+), 780 deletions(-) delete mode 100644 init/init_task.c (limited to 'init') 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 bool depends on HAVE_IRQ_WORK -config BUILDTIME_EXTABLE_SORT - bool - menu "General setup" config EXPERIMENTAL @@ -167,7 +164,7 @@ config KERNEL_BZIP2 depends on HAVE_KERNEL_BZIP2 help Its compression ratio and speed is intermediate. - Decompression speed is slowest among the choices. The kernel + Decompression speed is slowest among the three. The kernel size is about 10% smaller with bzip2, in comparison to gzip. Bzip2 uses a large amount of memory. For modern kernels you will need at least 8MB RAM or more for booting. @@ -176,9 +173,10 @@ config KERNEL_LZMA bool "LZMA" depends on HAVE_KERNEL_LZMA help - This compression algorithm's ratio is best. Decompression speed - is between gzip and bzip2. Compression is slowest. - The kernel size is about 33% smaller with LZMA in comparison to gzip. + The most recent compression algorithm. + Its ratio is best, decompression speed is between the other + two. Compression is slowest. The kernel size is about 33% + smaller with LZMA in comparison to gzip. config KERNEL_XZ bool "XZ" @@ -199,7 +197,7 @@ config KERNEL_LZO bool "LZO" depends on HAVE_KERNEL_LZO help - Its compression ratio is the poorest among the choices. The kernel + Its compression ratio is the poorest among the 4. The kernel size is about 10% bigger than gzip; however its speed (both compression and decompression) is the fastest. @@ -267,106 +265,6 @@ config POSIX_MQUEUE_SYSCTL depends on SYSCTL default y -config FHANDLE - bool "open by fhandle syscalls" - select EXPORTFS - help - If you say Y here, a user level program will be able to map - file names to handle and then later use the handle for - different file system operations. This is useful in implementing - userspace file servers, which now track files using handles instead - of names. The handle would remain the same even if file names - get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2) - syscalls. - -config AUDIT - bool "Auditing support" - depends on NET - help - Enable auditing infrastructure that can be used with another - kernel subsystem, such as SELinux (which requires this for - logging of avc messages output). Does not do system-call - auditing without CONFIG_AUDITSYSCALL. - -config AUDITSYSCALL - bool "Enable system-call auditing support" - depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT)) - default y if SECURITY_SELINUX - help - Enable low-overhead system-call auditing infrastructure that - can be used independently or with another kernel subsystem, - such as SELinux. - -config AUDIT_WATCH - def_bool y - depends on AUDITSYSCALL - select FSNOTIFY - -config AUDIT_TREE - def_bool y - depends on AUDITSYSCALL - select FSNOTIFY - -config AUDIT_LOGINUID_IMMUTABLE - bool "Make audit loginuid immutable" - depends on AUDIT - help - The config option toggles if a task setting its loginuid requires - CAP_SYS_AUDITCONTROL or if that task should require no special permissions - but should instead only allow setting its loginuid if it was never - previously set. On systems which use systemd or a similar central - process to restart login services this should be set to true. On older - systems in which an admin would typically have to directly stop and - start processes this should be set to false. Setting this to true allows - one to drop potentially dangerous capabilites from the login tasks, - but may not be backwards compatible with older init systems. - -source "kernel/irq/Kconfig" -source "kernel/time/Kconfig" - -menu "CPU/Task time and stats accounting" - -choice - prompt "Cputime accounting" - default TICK_CPU_ACCOUNTING if !PPC64 - default VIRT_CPU_ACCOUNTING if PPC64 - -# Kind of a stub config for the pure tick based cputime accounting -config TICK_CPU_ACCOUNTING - bool "Simple tick based cputime accounting" - depends on !S390 - help - This is the basic tick based cputime accounting that maintains - statistics about user, system and idle time spent on per jiffies - granularity. - - If unsure, say Y. - -config VIRT_CPU_ACCOUNTING - bool "Deterministic task and CPU time accounting" - depends on HAVE_VIRT_CPU_ACCOUNTING - help - Select this option to enable more accurate task and CPU time - accounting. This is done by reading a CPU counter on each - kernel entry and exit and on transitions within the kernel - between system, softirq and hardirq state, so there is a - small performance impact. In the case of s390 or IBM POWER > 5, - this also enables accounting of stolen time on logically-partitioned - systems. - -config IRQ_TIME_ACCOUNTING - bool "Fine granularity task level IRQ time accounting" - depends on HAVE_IRQ_TIME_ACCOUNTING - help - Select this option to enable fine granularity task irq time - accounting. This is done by reading a timestamp on each - transitions between softirq and hardirq state, so there can be a - small performance impact. - - If in doubt, say N here. - -endchoice - config BSD_PROCESS_ACCT bool "BSD Process Accounting" help @@ -392,6 +290,18 @@ config BSD_PROCESS_ACCT_V3 for processing it. A preliminary version of these tools is available at . +config FHANDLE + bool "open by fhandle syscalls" + select EXPORTFS + help + If you say Y here, a user level program will be able to map + file names to handle and then later use the handle for + different file system operations. This is useful in implementing + userspace file servers, which now track files using handles instead + of names. The handle would remain the same even if file names + get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2) + syscalls. + config TASKSTATS bool "Export task/process statistics through netlink (EXPERIMENTAL)" depends on NET @@ -434,7 +344,35 @@ config TASK_IO_ACCOUNTING Say N if unsure. -endmenu # "CPU/Task time and stats accounting" +config AUDIT + bool "Auditing support" + depends on NET + help + Enable auditing infrastructure that can be used with another + kernel subsystem, such as SELinux (which requires this for + logging of avc messages output). Does not do system-call + auditing without CONFIG_AUDITSYSCALL. + +config AUDITSYSCALL + bool "Enable system-call auditing support" + depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH) + default y if SECURITY_SELINUX + help + Enable low-overhead system-call auditing infrastructure that + can be used independently or with another kernel subsystem, + such as SELinux. + +config AUDIT_WATCH + def_bool y + depends on AUDITSYSCALL + select FSNOTIFY + +config AUDIT_TREE + def_bool y + depends on AUDITSYSCALL + select FSNOTIFY + +source "kernel/irq/Kconfig" menu "RCU Subsystem" @@ -453,7 +391,7 @@ config TREE_RCU config TREE_PREEMPT_RCU bool "Preemptible tree-based hierarchical RCU" - depends on PREEMPT && SMP + depends on PREEMPT help This option selects the RCU implementation that is designed for very large SMP systems with hundreds or @@ -463,7 +401,7 @@ config TREE_PREEMPT_RCU config TINY_RCU bool "UP-only small-memory-footprint RCU" - depends on !PREEMPT && !SMP + depends on !SMP help This option selects the RCU implementation that is designed for UP systems from which real-time response @@ -472,7 +410,7 @@ config TINY_RCU config TINY_PREEMPT_RCU bool "Preemptible UP-only small-memory-footprint RCU" - depends on PREEMPT && !SMP + depends on !SMP && PREEMPT help This option selects the RCU implementation that is designed for real-time UP systems. This option greatly reduces the @@ -486,35 +424,14 @@ config PREEMPT_RCU This option enables preemptible-RCU code that is common between the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. -config CONTEXT_TRACKING - bool - -config RCU_USER_QS - bool "Consider userspace as in RCU extended quiescent state" - depends on HAVE_CONTEXT_TRACKING && SMP - select CONTEXT_TRACKING +config RCU_TRACE + bool "Enable tracing for RCU" help - This option sets hooks on kernel / userspace boundaries and - puts RCU in extended quiescent state when the CPU runs in - userspace. It means that when a CPU runs in userspace, it is - excluded from the global RCU state machine and thus doesn't - try to keep the timer tick on for RCU. - - Unless you want to hack and help the development of the full - dynticks mode, you shouldn't enable this option. It also - adds unnecessary overhead. - - If unsure say N + This option provides tracing in RCU which presents stats + in debugfs for debugging RCU implementation. -config CONTEXT_TRACKING_FORCE - bool "Force context tracking" - depends on CONTEXT_TRACKING - help - Probe on user/kernel boundaries by default in order to - test the features that rely on it such as userspace RCU extended - quiescent states. - This test is there for debugging until we have a real user like the - full dynticks mode. + Say Y here if you want to enable RCU tracing + Say N if you are unsure. config RCU_FANOUT int "Tree-based hierarchical RCU fanout value" @@ -536,33 +453,6 @@ config RCU_FANOUT Select a specific number if testing RCU itself. Take the default if unsure. -config RCU_FANOUT_LEAF - int "Tree-based hierarchical RCU leaf-level fanout value" - range 2 RCU_FANOUT if 64BIT - range 2 RCU_FANOUT if !64BIT - depends on TREE_RCU || TREE_PREEMPT_RCU - default 16 - help - This option controls the leaf-level fanout of hierarchical - implementations of RCU, and allows trading off cache misses - against lock contention. Systems that synchronize their - scheduling-clock interrupts for energy-efficiency reasons will - want the default because the smaller leaf-level fanout keeps - lock contention levels acceptably low. Very large systems - (hundreds or thousands of CPUs) will instead want to set this - value to the maximum value possible in order to reduce the - number of cache misses incurred during RCU's grace-period - initialization. These systems tend to run CPU-bound, and thus - are not helped by synchronized interrupts, and thus tend to - skew them, which reduces lock contention enough that large - leaf-level fanouts work well. - - Select a specific number if testing RCU itself. - - Select the maximum permissible value for large systems. - - Take the default if unsure. - config RCU_FANOUT_EXACT bool "Disable tree-based hierarchical RCU auto-balancing" depends on TREE_RCU || TREE_PREEMPT_RCU @@ -579,16 +469,17 @@ config RCU_FANOUT_EXACT config RCU_FAST_NO_HZ bool "Accelerate last non-dyntick-idle CPU's grace periods" - depends on NO_HZ && SMP + depends on TREE_RCU && NO_HZ && SMP default n help - This option causes RCU to attempt to accelerate grace periods in - order to allow CPUs to enter dynticks-idle state more quickly. - On the other hand, this option increases the overhead of the - dynticks-idle checking, thus degrading scheduling latency. + This option causes RCU to attempt to accelerate grace periods + in order to allow the final CPU to enter dynticks-idle state + more quickly. On the other hand, this option increases the + overhead of the dynticks-idle checking, particularly on systems + with large numbers of CPUs. - Say Y if energy efficiency is critically important, and you don't - care about real-time response. + Say Y if energy efficiency is critically important, particularly + if you have relatively few CPUs. Say N if you are unsure. @@ -619,25 +510,10 @@ config RCU_BOOST_PRIO depends on RCU_BOOST default 1 help - This option specifies the real-time priority to which long-term - preempted RCU readers are to be boosted. If you are working - with a real-time application that has one or more CPU-bound - threads running at a real-time priority level, you should set - RCU_BOOST_PRIO to a priority higher then the highest-priority - real-time CPU-bound thread. The default RCU_BOOST_PRIO value - of 1 is appropriate in the common case, which is real-time - applications that do not have any CPU-bound threads. - - Some real-time applications might not have a single real-time - thread that saturates a given CPU, but instead might have - multiple real-time threads that, taken together, fully utilize - that CPU. In this case, you should set RCU_BOOST_PRIO to - a priority higher than the lowest-priority thread that is - conspiring to prevent the CPU from running any non-real-time - tasks. For example, if one thread at priority 10 and another - thread at priority 5 are between themselves fully consuming - the CPU time on a given CPU, then RCU_BOOST_PRIO should be - set to priority 6 or higher. + This option specifies the real-time priority to which preempted + RCU readers are to be boosted. If you are working with CPU-bound + real-time applications, you should specify a priority higher then + the highest-priority CPU-bound application. Specify the real-time priority, or take the default if unsure. @@ -654,28 +530,6 @@ config RCU_BOOST_DELAY Accept the default if unsure. -config RCU_NOCB_CPU - bool "Offload RCU callback processing from boot-selected CPUs" - depends on TREE_RCU || TREE_PREEMPT_RCU - default n - help - Use this option to reduce OS jitter for aggressive HPC or - real-time workloads. It can also be used to offload RCU - callback invocation to energy-efficient CPUs in battery-powered - asymmetric multiprocessors. - - This option offloads callback invocation from the set of - CPUs specified at boot time by the rcu_nocbs parameter. - For each such CPU, a kthread ("rcuoN") will be created to - invoke callbacks, where the "N" is the CPU being offloaded. - Nothing prevents this kthread from running on the specified - CPUs, but (1) the kthreads may be preempted between each - callback, and (2) affinity or cgroups can be used to force - the kthreads to run on whatever set of CPUs is desired. - - Say Y here if you want reduced OS jitter on selected CPUs. - Say N here if you are unsure. - endmenu # "RCU Subsystem" config IKCONFIG @@ -717,50 +571,6 @@ config LOG_BUF_SHIFT config HAVE_UNSTABLE_SCHED_CLOCK bool -# -# For architectures that want to enable the support for NUMA-affine scheduler -# balancing logic: -# -config ARCH_SUPPORTS_NUMA_BALANCING - bool - -# For architectures that (ab)use NUMA to represent different memory regions -# all cpu-local but of different latencies, such as SuperH. -# -config ARCH_WANT_NUMA_VARIABLE_LOCALITY - bool - -# -# For architectures that are willing to define _PAGE_NUMA as _PAGE_PROTNONE -config ARCH_WANTS_PROT_NUMA_PROT_NONE - bool - -config ARCH_USES_NUMA_PROT_NONE - bool - default y - depends on ARCH_WANTS_PROT_NUMA_PROT_NONE - depends on NUMA_BALANCING - -config NUMA_BALANCING_DEFAULT_ENABLED - bool "Automatically enable NUMA aware memory/task placement" - default y - depends on NUMA_BALANCING - help - If set, autonumic NUMA balancing will be enabled if running on a NUMA - machine. - -config NUMA_BALANCING - bool "Memory placement aware NUMA scheduler" - depends on ARCH_SUPPORTS_NUMA_BALANCING - depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY - depends on SMP && NUMA && MIGRATION - help - This option adds support for automatic NUMA aware memory/task placement. - The mechanism is quite primitive and is based on migrating memory when - it is references to the node the task is running on. - - This system will be inactive on UMA systems. - menuconfig CGROUPS boolean "Control Group support" depends on EVENTFD @@ -826,7 +636,7 @@ config RESOURCE_COUNTERS This option enables controller independent resource accounting infrastructure that works with cgroups. -config MEMCG +config CGROUP_MEM_RES_CTLR bool "Memory Resource Controller for Control Groups" depends on RESOURCE_COUNTERS select MM_OWNER @@ -849,9 +659,9 @@ config MEMCG This config option also selects MM_OWNER config option, which could in turn add some fork/exit overhead. -config MEMCG_SWAP +config CGROUP_MEM_RES_CTLR_SWAP bool "Memory Resource Controller Swap Extension" - depends on MEMCG && SWAP + depends on CGROUP_MEM_RES_CTLR && SWAP help Add swap management feature to memory resource controller. When you enable this, you can limit mem+swap usage per cgroup. In other words, @@ -866,9 +676,9 @@ config MEMCG_SWAP if boot option "swapaccount=0" is set, swap will not be accounted. Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page size is 4096bytes, 512k per 1Gbytes of swap. -config MEMCG_SWAP_ENABLED +config CGROUP_MEM_RES_CTLR_SWAP_ENABLED bool "Memory Resource Controller Swap Extension enabled by default" - depends on MEMCG_SWAP + depends on CGROUP_MEM_RES_CTLR_SWAP default y help Memory Resource Controller Swap Extension comes with its price in @@ -879,32 +689,6 @@ config MEMCG_SWAP_ENABLED For those who want to have the feature enabled by default should select this option (if, for some reason, they need to disable it then swapaccount=0 does the trick). -config MEMCG_KMEM - bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)" - depends on MEMCG && EXPERIMENTAL - depends on SLUB || SLAB - help - The Kernel Memory extension for Memory Resource Controller can limit - the amount of memory used by kernel objects in the system. Those are - fundamentally different from the entities handled by the standard - Memory Controller, which are page-based, and can be swapped. Users of - the kmem extension can use it to guarantee that no group of processes - will ever exhaust kernel resources alone. - -config CGROUP_HUGETLB - bool "HugeTLB Resource Controller for Control Groups" - depends on RESOURCE_COUNTERS && HUGETLB_PAGE && EXPERIMENTAL - default n - help - Provides a cgroup Resource Controller for HugeTLB pages. - When you enable this, you can put a per cgroup limit on HugeTLB usage. - The limit is enforced during page fault. Since HugeTLB doesn't - support page reclaim, enforcing the limit at page fault time implies - that, the application will get SIGBUS signal if it tries to access - HugeTLB pages beyond its limit. This requires the application to know - beforehand how much HugeTLB pages it would require for its use. The - control group is tracked in the third page lru pointer. This means - that we cannot use the controller with huge page less than 3 pages. config CGROUP_PERF bool "Enable perf_event per-cpu per-container group (cgroup) monitoring" @@ -918,6 +702,7 @@ config CGROUP_PERF menuconfig CGROUP_SCHED bool "Group CPU scheduler" + depends on EXPERIMENTAL default n help This feature lets CPU scheduler recognize task groups and control CPU @@ -930,18 +715,6 @@ config FAIR_GROUP_SCHED depends on CGROUP_SCHED default CGROUP_SCHED -config CFS_BANDWIDTH - bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED" - depends on EXPERIMENTAL - depends on FAIR_GROUP_SCHED - default n - help - This option allows users to define CPU bandwidth rates (limits) for - tasks running within the fair group scheduler. Groups with no limit - set are considered to be unconstrained and will run with no - restriction. - See tip/Documentation/scheduler/sched-bwc.txt for more information. - config RT_GROUP_SCHED bool "Group scheduling for SCHED_RR/FIFO" depends on EXPERIMENTAL @@ -957,7 +730,7 @@ config RT_GROUP_SCHED endif #CGROUP_SCHED config BLK_CGROUP - bool "Block IO controller" + tristate "Block IO controller" depends on BLOCK default n ---help--- @@ -988,17 +761,6 @@ config DEBUG_BLK_CGROUP endif # CGROUPS -config CHECKPOINT_RESTORE - bool "Checkpoint/restore support" if EXPERT - default n - help - Enables additional kernel features in a sake of checkpoint/restore. - In particular it adds auxiliary prctl codes to setup process text, - data and heap segment sizes, and a few additional /proc filesystem - entries. - - If unsure, say N here. - menuconfig NAMESPACES bool "Namespaces support" if EXPERT default !EXPERT @@ -1028,10 +790,7 @@ config IPC_NS config USER_NS bool "User namespace (EXPERIMENTAL)" depends on EXPERIMENTAL - depends on UIDGID_CONVERTED - select UIDGID_STRICT_TYPE_CHECKS - - default n + default y help This allows containers, i.e. vservers, to use user namespaces to provide different user info for different servers. @@ -1055,40 +814,6 @@ config NET_NS endif # NAMESPACES -config UIDGID_CONVERTED - # True if all of the selected software conmponents are known - # to have uid_t and gid_t converted to kuid_t and kgid_t - # where appropriate and are otherwise safe to use with - # the user namespace. - bool - default y - - # Networking - depends on NET_9P = n - - # Filesystems - depends on 9P_FS = n - depends on AFS_FS = n - depends on CEPH_FS = n - depends on CIFS = n - depends on CODA_FS = n - depends on GFS2_FS = n - depends on NCP_FS = n - depends on NFSD = n - depends on NFS_FS = n - depends on OCFS2_FS = n - depends on XFS_FS = n - -config UIDGID_STRICT_TYPE_CHECKS - bool "Require conversions between uid/gids and their internal representation" - depends on UIDGID_CONVERTED - default n - help - While the nececessary conversions are being added to all subsystems this option allows - the code to continue to build for unconverted subsystems. - - Say Y here if you want the strict type checking enabled - config SCHED_AUTOGROUP bool "Automatic process group scheduling" select EVENTFD @@ -1190,6 +915,12 @@ config SYSCTL config ANON_INODES bool +config PANIC_TIMEOUT + int "Default panic timeout" + default 0 + help + Set default panic timeout. + menuconfig EXPERT bool "Configure standard kernel features (expert users)" # Unhide debug options, to make the on-by-default options visible @@ -1200,12 +931,9 @@ menuconfig EXPERT environments which can tolerate a "non-standard" kernel. Only use this if you really know what you are doing. -config HAVE_UID16 - bool - config UID16 bool "Enable 16-bit UID system calls" if EXPERT - depends on HAVE_UID16 + depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION) default y help This enables the legacy 16-bit UID syscall wrappers. @@ -1213,7 +941,7 @@ config UID16 config SYSCTL_SYSCALL bool "Sysctl syscall support" if EXPERT depends on PROC_SYSCTL - default n + default y select SYSCTL ---help--- sys_sysctl uses binary paths that have been found challenging @@ -1225,12 +953,7 @@ config SYSCTL_SYSCALL trying to save some space it is probably safe to disable this, making your kernel marginally smaller. - If unsure say N here. - -config SYSCTL_EXCEPTION_TRACE - bool - help - Enable support for /proc/sys/debug/exception-trace. + If unsure say Y here. config KALLSYMS bool "Load all symbols for debugging/ksymoops" if EXPERT @@ -1258,7 +981,13 @@ config KALLSYMS_ALL Say N unless you really need all symbols. config HOTPLUG - def_bool y + bool "Support for hot-pluggable devices" if EXPERT + default y + help + This option is provided for the case where no hotplug or uevent + capabilities is wanted by the kernel. You should only consider + disabling this option for embedded systems that do not use modules, a + dynamic /dev tree, or dynamic device discovery. Just say Y. config PRINTK default y @@ -1281,7 +1010,6 @@ config BUG Just say Y. config ELF_CORE - depends on COREDUMP default y bool "Enable ELF core dumps" if EXPERT help @@ -1366,6 +1094,15 @@ config SHMEM option replaces shmem and tmpfs with the much simpler ramfs code, which may be appropriate on small systems without swap. +config ASHMEM + bool "Enable the Anonymous Shared Memory Subsystem" + default n + depends on SHMEM || TINY_SHMEM + help + The ashmem subsystem is a new shared memory allocator, similar to + POSIX SHM but with different behavior and sporting a simpler + file-based API. + config AIO bool "Enable AIO support" if EXPERT default y @@ -1396,7 +1133,7 @@ menu "Kernel Performance Events And Counters" config PERF_EVENTS bool "Kernel performance events and counters" - default y if PROFILING + default y if (PROFILING || PERF_COUNTERS) depends on HAVE_PERF_EVENTS select ANON_INODES select IRQ_WORK @@ -1423,6 +1160,18 @@ config PERF_EVENTS Say Y if unsure. +config PERF_COUNTERS + bool "Kernel performance counters (old config option)" + depends on HAVE_PERF_EVENTS + help + This config has been obsoleted by the PERF_EVENTS + config option - please see that one for details. + + It has no effect on the kernel whether you enable + it or not, it is a compatibility placeholder. + + Say N if unsure. + config DEBUG_PERF_USE_VMALLOC default n bool "Debug: use vmalloc to back perf mmap() buffers" @@ -1637,73 +1386,13 @@ config MODULE_SRCVERSION_ALL the version). With this option, such a "srcversion" field will be created for all modules. If unsure, say N. -config MODULE_SIG - bool "Module signature verification" - depends on MODULES - select KEYS - select CRYPTO - select ASYMMETRIC_KEY_TYPE - select ASYMMETRIC_PUBLIC_KEY_SUBTYPE - select PUBLIC_KEY_ALGO_RSA - select ASN1 - select OID_REGISTRY - select X509_CERTIFICATE_PARSER - help - Check modules for valid signatures upon load: the signature - is simply appended to the module. For more information see - Documentation/module-signing.txt. - - !!!WARNING!!! If you enable this option, you MUST make sure that the - module DOES NOT get stripped after being signed. This includes the - debuginfo strip done by some packagers (such as rpmbuild) and - inclusion into an initramfs that wants the module size reduced. - -config MODULE_SIG_FORCE - bool "Require modules to be validly signed" - depends on MODULE_SIG - help - Reject unsigned modules or signed modules for which we don't have a - key. Without this, such modules will simply taint the kernel. - -choice - prompt "Which hash algorithm should modules be signed with?" - depends on MODULE_SIG - help - This determines which sort of hashing algorithm will be used during - signature generation. This algorithm _must_ be built into the kernel - directly so that signature verification can take place. It is not - possible to load a signed module containing the algorithm to check - the signature on that module. - -config MODULE_SIG_SHA1 - bool "Sign modules with SHA-1" - select CRYPTO_SHA1 - -config MODULE_SIG_SHA224 - bool "Sign modules with SHA-224" - select CRYPTO_SHA256 - -config MODULE_SIG_SHA256 - bool "Sign modules with SHA-256" - select CRYPTO_SHA256 - -config MODULE_SIG_SHA384 - bool "Sign modules with SHA-384" - select CRYPTO_SHA512 - -config MODULE_SIG_SHA512 - bool "Sign modules with SHA-512" - select CRYPTO_SHA512 - -endchoice - endif # MODULES config INIT_ALL_POSSIBLE bool help - Back when each arch used to define their own cpu_online_mask and - cpu_possible_mask, some of them chose to initialize cpu_possible_mask + Back when each arch used to define their own cpu_online_map and + cpu_possible_map, some of them chose to initialize cpu_possible_map with all 1s, and others with all 0s. When they were centralised, it was better to provide this option than to break all the archs and have several arch maintainers pursuing me down dark alleys. @@ -1724,18 +1413,4 @@ config PADATA depends on SMP bool -# Can be selected by architectures with broken toolchains -# that get confused by correct const<->read_only section -# mappings -config BROKEN_RODATA - bool - -config ASN1 - tristate - help - Build a simple ASN.1 grammar compiler that produces a bytecode output - that can be interpreted by the ASN.1 stream decoder and used to - inform it as to what tags are to be expected in a stream and what - functions to call on what tags. - source "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 endif obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o -ifneq ($(CONFIG_ARCH_INIT_TASK),y) -obj-y += init_task.o -endif - mounts-y := do_mounts.o mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o mounts-$(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: static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 }; -/* - * Check if cpu calibration delay is already known. For example, - * some processors with multi-core sockets may have all cores - * with the same calibration delay. - * - * Architectures should override this function if a faster calibration - * method is available. - */ -unsigned long __attribute__((weak)) __cpuinit calibrate_delay_is_known(void) -{ - return 0; -} - void __cpuinit calibrate_delay(void) { unsigned long lpj; @@ -279,8 +266,6 @@ void __cpuinit calibrate_delay(void) lpj = lpj_fine; pr_info("Calibrating delay loop (skipped), " "value calculated using timer frequency.. "); - } else if ((lpj = calibrate_delay_is_known())) { - ; } else if ((lpj = calibrate_delay_direct()) != 0) { if (!printed) 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 @@ -/* - * Many of the syscalls used in this file expect some of the arguments - * to be __user pointers not __kernel pointers. To limit the sparse - * noise, turn off sparse checking for this file. - */ -#ifdef __CHECKER__ -#undef __CHECKER__ -#warning "Sparse checking disabled for this file" -#endif - #include #include #include @@ -38,7 +28,7 @@ int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */ int root_mountflags = MS_RDONLY | MS_SILENT; static char * __initdata root_device_name; static char __initdata saved_root_name[64]; -static int root_wait; +static int __initdata root_wait; dev_t ROOT_DEV; @@ -69,28 +59,23 @@ __setup("ro", readonly); __setup("rw", readwrite); #ifdef CONFIG_BLOCK -struct uuidcmp { - const char *uuid; - int len; -}; - /** * match_dev_by_uuid - callback for finding a partition using its uuid * @dev: device passed in by the caller - * @data: opaque pointer to the desired struct uuidcmp to match + * @data: opaque pointer to a 36 byte char array with a UUID * * Returns 1 if the device matches, and 0 otherwise. */ static int match_dev_by_uuid(struct device *dev, void *data) { - struct uuidcmp *cmp = data; + u8 *uuid = data; struct hd_struct *part = dev_to_part(dev); if (!part->info) goto no_match; - if (strncasecmp(cmp->uuid, part->info->uuid, cmp->len)) - goto no_match; + if (memcmp(uuid, part->info->uuid, sizeof(part->info->uuid))) + goto no_match; return 1; no_match: @@ -100,79 +85,31 @@ no_match: /** * devt_from_partuuid - looks up the dev_t of a partition by its UUID - * @uuid: char array containing ascii UUID + * @uuid: 36 byte char array containing a hex ascii UUID * * The function will return the first partition which contains a matching * UUID value in its partition_meta_info struct. This does not search * by filesystem UUIDs. * - * If @uuid is followed by a "/PARTNROFF=%d", then the number will be - * extracted and used as an offset from the partition identified by the UUID. - * * Returns the matching dev_t on success or 0 on failure. */ -static dev_t devt_from_partuuid(const char *uuid_str) +static dev_t devt_from_partuuid(char *uuid_str) { dev_t res = 0; - struct uuidcmp cmp; struct device *dev = NULL; - struct gendisk *disk; - struct hd_struct *part; - int offset = 0; - bool clear_root_wait = false; - char *slash; - - cmp.uuid = uuid_str; - - slash = strchr(uuid_str, '/'); - /* Check for optional partition number offset attributes. */ - if (slash) { - char c = 0; - /* Explicitly fail on poor PARTUUID syntax. */ - if (sscanf(slash + 1, - "PARTNROFF=%d%c", &offset, &c) != 1) { - clear_root_wait = true; - goto done; - } - cmp.len = slash - uuid_str; - } else { - cmp.len = strlen(uuid_str); - } + u8 uuid[16]; - if (!cmp.len) { - clear_root_wait = true; - goto done; - } + /* Pack the requested UUID in the expected format. */ + part_pack_uuid(uuid_str, uuid); - dev = class_find_device(&block_class, NULL, &cmp, - &match_dev_by_uuid); + dev = class_find_device(&block_class, NULL, uuid, &match_dev_by_uuid); if (!dev) goto done; res = dev->devt; - - /* Attempt to find the partition by offset. */ - if (!offset) - goto no_offset; - - res = 0; - disk = part_to_disk(dev_to_part(dev)); - part = disk_get_part(disk, dev_to_part(dev)->partno + offset); - if (part) { - res = part_devt(part); - put_device(part_to_dev(part)); - } - -no_offset: put_device(dev); + done: - if (clear_root_wait) { - pr_err("VFS: PARTUUID= is invalid.\n" - "Expected PARTUUID=[/PARTNROFF=%%d]\n"); - if (root_wait) - pr_err("Disabling rootwait; root= is invalid.\n"); - root_wait = 0; - } return res; } #endif @@ -189,12 +126,6 @@ done: * used when disk name of partitioned disk ends on a digit. * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the * unique id of a partition if the partition table provides it. - * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS - * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero- - * filled hex representation of the 32-bit "NT disk signature", and PP - * is a zero-filled hex representation of the 1-based partition number. - * 7) PARTUUID=/PARTNROFF= to select a partition in relation to - * a partition with a known unique id. * * If name doesn't have fall into the categories above, we return (0,0). * 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) #ifdef CONFIG_BLOCK if (strncmp(name, "PARTUUID=", 9) == 0) { name += 9; + if (strlen(name) != 36) + goto fail; res = devt_from_partuuid(name); if (!res) goto fail; @@ -354,27 +287,24 @@ static void __init get_fs_names(char *page) static int __init do_mount_root(char *name, char *fs, int flags, void *data) { - struct super_block *s; int err = sys_mount(name, "/root", fs, flags, data); if (err) return err; - sys_chdir("/root"); - s = current->fs->pwd.dentry->d_sb; - ROOT_DEV = s->s_dev; + sys_chdir((const char __user __force *)"/root"); + ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; printk(KERN_INFO "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", - s->s_type->name, - s->s_flags & MS_RDONLY ? " readonly" : "", - MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); + current->fs->pwd.mnt->mnt_sb->s_type->name, + current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ? + " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); return 0; } void __init mount_block_root(char *name, int flags) { - struct page *page = alloc_page(GFP_KERNEL | - __GFP_NOTRACK_FALSE_POSITIVE); - char *fs_names = page_address(page); + char *fs_names = __getname_gfp(GFP_KERNEL + | __GFP_NOTRACK_FALSE_POSITIVE); char *p; #ifdef CONFIG_BLOCK char b[BDEVNAME_SIZE]; @@ -403,8 +333,8 @@ retry: #ifdef CONFIG_BLOCK __bdevname(ROOT_DEV, b); #endif - printk("VFS: Cannot open root device \"%s\" or %s: error %d\n", - root_device_name, b, err); + printk("VFS: Cannot open root device \"%s\" or %s\n", + root_device_name, b); printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); printk_all_partitions(); @@ -426,7 +356,7 @@ retry: #endif panic("VFS: Unable to mount root fs on %s", b); out: - put_page(page); + putname(fs_names); } #ifdef CONFIG_ROOT_NFS @@ -502,7 +432,7 @@ void __init change_floppy(char *fmt, ...) void __init mount_root(void) { #ifdef CONFIG_ROOT_NFS - if (ROOT_DEV == Root_NFS) { + if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { if (mount_nfs_root()) return; @@ -586,5 +516,5 @@ void __init prepare_namespace(void) out: devtmpfs_mount("dev"); sys_mount(".", "/", NULL, MS_MOVE, NULL); - sys_chroot("."); + sys_chroot((const char __user __force *)"."); } 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 @@ -/* - * Many of the syscalls used in this file expect some of the arguments - * to be __user pointers not __kernel pointers. To limit the sparse - * noise, turn off sparse checking for this file. - */ -#ifdef __CHECKER__ -#undef __CHECKER__ -#warning "Sparse checking disabled for this file" -#endif - #include #include #include #include +#include #include #include #include #include -#include #include "do_mounts.h" unsigned long initrd_start, initrd_end; int initrd_below_start_ok; unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ +static int __initdata old_fd, root_fd; static int __initdata mount_initrd = 1; static int __init no_initrd(char *str) @@ -33,29 +24,33 @@ static int __init no_initrd(char *str) __setup("noinitrd", no_initrd); -static int init_linuxrc(struct subprocess_info *info, struct cred *new) +static int __init do_linuxrc(void *_shell) { - sys_unshare(CLONE_FS | CLONE_FILES); - /* move initrd over / and chdir/chroot in initrd root */ - sys_chdir("/root"); - sys_mount(".", "/", NULL, MS_MOVE, NULL); - sys_chroot("."); + static const char *argv[] = { "linuxrc", NULL, }; + extern const char *envp_init[]; + const char *shell = _shell; + + sys_close(old_fd);sys_close(root_fd); sys_setsid(); - return 0; + return kernel_execve(shell, argv, envp_init); } static void __init handle_initrd(void) { - static char *argv[] = { "linuxrc", NULL, }; - extern char *envp_init[]; int error; + int pid; real_root_dev = new_encode_dev(ROOT_DEV); create_dev("/dev/root.old", Root_RAM0); /* mount initrd on rootfs' /root */ mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY); sys_mkdir("/old", 0700); - sys_chdir("/old"); + root_fd = sys_open("/", 0, 0); + old_fd = sys_open("/old", 0, 0); + /* move initrd over / and chdir/chroot in initrd root */ + sys_chdir("/root"); + sys_mount(".", "/", NULL, MS_MOVE, NULL); + sys_chroot("."); /* * 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) */ current->flags |= PF_FREEZER_SKIP; - call_usermodehelper_fns("/linuxrc", argv, envp_init, UMH_WAIT_PROC, - init_linuxrc, NULL, NULL); + pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD); + if (pid > 0) + while (pid != sys_wait4(-1, NULL, 0, NULL)) + yield(); current->flags &= ~PF_FREEZER_SKIP; /* move initrd to rootfs' /old */ - sys_mount("..", ".", NULL, MS_MOVE, NULL); + sys_fchdir(old_fd); + sys_mount("/", ".", NULL, MS_MOVE, NULL); /* switch root and cwd back to / of rootfs */ - sys_chroot(".."); + sys_fchdir(root_fd); + sys_chroot("."); + sys_close(old_fd); + sys_close(root_fd); if (new_decode_dev(real_root_dev) == Root_RAM0) { sys_chdir("/old"); return; } - sys_chdir("/"); ROOT_DEV = new_decode_dev(real_root_dev); mount_root(); 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 @@ -/* - * Many of the syscalls used in this file expect some of the arguments - * to be __user pointers not __kernel pointers. To limit the sparse - * noise, turn off sparse checking for this file. - */ -#ifdef __CHECKER__ -#undef __CHECKER__ -#warning "Sparse checking disabled for this file" -#endif - #include #include #include @@ -293,7 +283,7 @@ static void __init autodetect_raid(void) wait_for_device_probe(); - fd = sys_open("/dev/md0", 0, 0); + fd = sys_open((const char __user __force *) "/dev/md0", 0, 0); if (fd >= 0) { sys_ioctl(fd, RAID_AUTORUN, raid_autopart); 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 @@ -/* - * Many of the syscalls used in this file expect some of the arguments - * to be __user pointers not __kernel pointers. To limit the sparse - * noise, turn off sparse checking for this file. - */ -#ifdef __CHECKER__ -#undef __CHECKER__ -#warning "Sparse checking disabled for this file" -#endif #include #include @@ -63,19 +54,20 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) { const int size = 512; struct minix_super_block *minixsb; + struct ext2_super_block *ext2sb; struct romfs_super_block *romfsb; struct cramfs_super *cramfsb; struct squashfs_super_block *squashfsb; int nblocks = -1; unsigned char *buf; const char *compress_name; - unsigned long n; buf = kmalloc(size, GFP_KERNEL); if (!buf) return -ENOMEM; minixsb = (struct minix_super_block *) buf; + ext2sb = (struct ext2_super_block *) buf; romfsb = (struct romfs_super_block *) buf; cramfsb = (struct cramfs_super *) buf; squashfsb = (struct squashfs_super_block *) buf; @@ -127,20 +119,6 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) goto done; } - /* - * Read 512 bytes further to check if cramfs is padded - */ - sys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0); - sys_read(fd, buf, size); - - if (cramfsb->magic == CRAMFS_MAGIC) { - printk(KERN_NOTICE - "RAMDISK: cramfs filesystem found at block %d\n", - start_block); - nblocks = (cramfsb->size + BLOCK_SIZE - 1) >> BLOCK_SIZE_BITS; - goto done; - } - /* * Read block 1 to test for minix and ext2 superblock */ @@ -158,12 +136,12 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) } /* Try ext2 */ - n = ext2_image_size(buf); - if (n) { + if (ext2sb->s_magic == cpu_to_le16(EXT2_SUPER_MAGIC)) { printk(KERN_NOTICE "RAMDISK: ext2 filesystem found at block %d\n", start_block); - nblocks = n; + nblocks = le32_to_cpu(ext2sb->s_blocks_count) << + le32_to_cpu(ext2sb->s_log_block_size); goto done; } @@ -186,11 +164,11 @@ int __init rd_load_image(char *from) char *buf = NULL; unsigned short rotate = 0; decompress_fn decompressor = NULL; -#if !defined(CONFIG_S390) +#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) char rotator[4] = { '|' , '/' , '-' , '\\' }; #endif - out_fd = sys_open("/dev/ram", O_RDWR, 0); + out_fd = sys_open((const char __user __force *) "/dev/ram", O_RDWR, 0); if (out_fd < 0) goto out; @@ -272,7 +250,7 @@ int __init rd_load_image(char *from) } sys_read(in_fd, buf, BLOCK_SIZE); sys_write(out_fd, buf, BLOCK_SIZE); -#if !defined(CONFIG_S390) +#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) if (!(i % 16)) { printk("%c\b", rotator[rotate & 0x3]); rotate++; @@ -289,7 +267,7 @@ noclose_input: sys_close(out_fd); out: kfree(buf); - sys_unlink("/dev/ram"); + sys_unlink((const char __user __force *) "/dev/ram"); return res; } 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 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static struct signal_struct init_signals = INIT_SIGNALS(init_signals); -static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); - -/* Initial task structure */ -struct task_struct init_task = INIT_TASK(init_task); -EXPORT_SYMBOL(init_task); - -/* - * Initial thread structure. Alignment of this is handled by a special - * linker map entry. - */ -union thread_union init_thread_union __init_task_data = - { 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 @@ -/* - * Many of the syscalls used in this file expect some of the arguments - * to be __user pointers not __kernel pointers. To limit the sparse - * noise, turn off sparse checking for this file. - */ -#ifdef __CHECKER__ -#undef __CHECKER__ -#warning "Sparse checking disabled for this file" -#endif - #include #include #include @@ -32,7 +22,7 @@ static void __init error(char *x) static __initdata struct hash { int ino, minor, major; - umode_t mode; + mode_t mode; struct hash *next; char name[N_ALIGN(PATH_MAX)]; } *head[32]; @@ -45,7 +35,7 @@ static inline int hash(int major, int minor, int ino) } static char __init *find_link(int major, int minor, int ino, - umode_t mode, char *name) + mode_t mode, char *name) { struct hash **p, *q; for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) { @@ -84,7 +74,7 @@ static void __init free_hash(void) } } -static long __init do_utime(char *filename, time_t mtime) +static long __init do_utime(char __user *filename, time_t mtime) { struct timespec t[2]; @@ -130,7 +120,7 @@ static __initdata time_t mtime; /* cpio header parsing */ static __initdata unsigned long ino, major, minor, nlink; -static __initdata umode_t mode; +static __initdata mode_t mode; static __initdata unsigned long body_len, name_len; static __initdata uid_t uid; static __initdata gid_t gid; @@ -286,7 +276,7 @@ static int __init maybe_link(void) return 0; } -static void __init clean_path(char *path, umode_t mode) +static void __init clean_path(char *path, mode_t mode) { struct stat st; @@ -539,7 +529,7 @@ static void __init clean_rootfs(void) struct linux_dirent64 *dirp; int num; - fd = sys_open("/", O_RDONLY, 0); + fd = sys_open((const char __user __force *) "/", O_RDONLY, 0); WARN_ON(fd < 0); if (fd < 0) return; @@ -599,7 +589,7 @@ static int __init populate_rootfs(void) } printk(KERN_INFO "rootfs image is not initramfs (%s)" "; looks like an initrd\n", err); - fd = sys_open("/initrd.image", + fd = sys_open((const char __user __force *) "/initrd.image", O_WRONLY|O_CREAT, 0700); if (fd >= 0) { 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 @@ #include #include #include -#include -#include #include #include @@ -87,7 +85,9 @@ extern void init_IRQ(void); extern void fork_init(unsigned long); extern void mca_init(void); extern void sbus_init(void); +extern void prio_tree_init(void); extern void radix_tree_init(void); +extern void free_initmem(void); #ifndef CONFIG_DEBUG_RODATA static inline void mark_rodata_ro(void) { } #endif @@ -163,7 +163,7 @@ static int __init obsolete_checksetup(char *line) p = __setup_start; do { int n = strlen(p->str); - if (parameqn(line, p->str, n)) { + if (!strncmp(line, p->str, n)) { if (p->early) { /* Already done in parse_early_param? * (Needs exact match on param part). @@ -226,9 +226,13 @@ static int __init loglevel(char *str) early_param("loglevel", loglevel); -/* Change NUL term back to "=", to make "param" the whole string. */ -static int __init repair_env_string(char *param, char *val, const char *unused) +/* + * Unknown boot options get handed to init, unless they look like + * unused parameters (modprobe will find them in /proc/cmdline). + */ +static int __init unknown_bootoption(char *param, char *val) { + /* Change NUL term back to "=", to make "param" the whole string. */ if (val) { /* param=val or param="val"? */ if (val == param+strlen(param)+1) @@ -240,16 +244,6 @@ static int __init repair_env_string(char *param, char *val, const char *unused) } else BUG(); } - return 0; -} - -/* - * Unknown boot options get handed to init, unless they look like - * unused parameters (modprobe will find them in /proc/cmdline). - */ -static int __init unknown_bootoption(char *param, char *val, const char *unused) -{ - repair_env_string(param, val, unused); /* Handle obsolete-style parameters */ if (obsolete_checksetup(param)) @@ -288,6 +282,10 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused) return 0; } +#ifdef CONFIG_DEBUG_PAGEALLOC +int __read_mostly debug_pagealloc_enabled = 0; +#endif + static int __init init_setup(char *str) { unsigned int i; @@ -380,18 +378,21 @@ static noinline void __init_refok rest_init(void) * at least once to get things moving: */ init_idle_bootup_task(current); - schedule_preempt_disabled(); + preempt_enable_no_resched(); + schedule(); + /* Call into cpu_idle with preempt disabled */ + preempt_disable(); cpu_idle(); } /* Check for early params. */ -static int __init do_early_param(char *param, char *val, const char *unused) +static int __init do_early_param(char *param, char *val) { const struct obs_kernel_param *p; for (p = __setup_start; p < __setup_end; p++) { - if ((p->early && parameq(param, p->str)) || + if ((p->early && strcmp(param, p->str) == 0) || (strcmp(param, "console") == 0 && strcmp(p->str, "earlycon") == 0) ) { @@ -406,7 +407,7 @@ static int __init do_early_param(char *param, char *val, const char *unused) void __init parse_early_options(char *cmdline) { - parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param); + parse_args("early options", cmdline, NULL, 0, do_early_param); } /* 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) { } -# if THREAD_SIZE >= PAGE_SIZE void __init __weak thread_info_cache_init(void) { } -#endif /* * Set up kernel memory allocators @@ -454,8 +453,8 @@ void __init __weak thread_info_cache_init(void) static void __init mm_init(void) { /* - * page_cgroup requires contiguous pages, - * bigger than MAX_ORDER unless SPARSEMEM. + * page_cgroup requires countinous pages as memmap + * and it's bigger than MAX_ORDER unless SPARSEMEM. */ page_cgroup_init_flatmem(); mem_init(); @@ -470,12 +469,13 @@ asmlinkage void __init start_kernel(void) char * command_line; extern const struct kernel_param __start___param[], __stop___param[]; + smp_setup_processor_id(); + /* * Need to run as early as possible, to initialize the * lockdep hash: */ lockdep_init(); - smp_setup_processor_id(); debug_objects_early_init(); /* @@ -504,17 +504,14 @@ asmlinkage void __init start_kernel(void) setup_per_cpu_areas(); smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ - build_all_zonelists(NULL, NULL); + build_all_zonelists(NULL); page_alloc_init(); printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); parse_early_param(); parse_args("Booting kernel", static_command_line, __start___param, __stop___param - __start___param, - -1, -1, &unknown_bootoption); - - jump_label_init(); - + &unknown_bootoption); /* * These use large bootmem allocations and must precede * kmem_cache_init() @@ -549,6 +546,7 @@ asmlinkage void __init start_kernel(void) /* init some links before init_ISA_irqs() */ early_irq_init(); init_IRQ(); + prio_tree_init(); init_timers(); hrtimers_init(); softirq_init(); @@ -562,6 +560,9 @@ asmlinkage void __init start_kernel(void) early_boot_irqs_disabled = false; local_irq_enable(); + /* Interrupts are enabled now so all GFP allocations are safe. */ + gfp_allowed_mask = __GFP_BITS_MASK; + kmem_cache_init_late(); /* @@ -593,6 +594,7 @@ asmlinkage void __init start_kernel(void) } #endif page_cgroup_init(); + enable_debug_pagealloc(); debug_objects_mem_init(); kmemleak_init(); setup_per_cpu_pageset(); @@ -632,11 +634,6 @@ asmlinkage void __init start_kernel(void) acpi_early_init(); /* before LAPIC and SMP init */ sfi_init_late(); - if (efi_enabled) { - efi_late_init(); - efi_free_boot_services(); - } - ftrace_init(); /* Do the rest non-__init'ed, we're now alive */ @@ -654,7 +651,7 @@ static void __init do_ctors(void) #endif } -bool initcall_debug; +int initcall_debug; core_param(initcall_debug, initcall_debug, bool, 0644); static char msgbuf[64]; @@ -708,63 +705,14 @@ int __init_or_module do_one_initcall(initcall_t fn) } -extern initcall_t __initcall_start[]; -extern initcall_t __initcall0_start[]; -extern initcall_t __initcall1_start[]; -extern initcall_t __initcall2_start[]; -extern initcall_t __initcall3_start[]; -extern initcall_t __initcall4_start[]; -extern initcall_t __initcall5_start[]; -extern initcall_t __initcall6_start[]; -extern initcall_t __initcall7_start[]; -extern initcall_t __initcall_end[]; - -static initcall_t *initcall_levels[] __initdata = { - __initcall0_start, - __initcall1_start, - __initcall2_start, - __initcall3_start, - __initcall4_start, - __initcall5_start, - __initcall6_start, - __initcall7_start, - __initcall_end, -}; - -/* Keep these in sync with initcalls in include/linux/init.h */ -static char *initcall_level_names[] __initdata = { - "early", - "core", - "postcore", - "arch", - "subsys", - "fs", - "device", - "late", -}; - -static void __init do_initcall_level(int level) -{ - extern const struct kernel_param __start___param[], __stop___param[]; - initcall_t *fn; - - strcpy(static_command_line, saved_command_line); - parse_args(initcall_level_names[level], - static_command_line, __start___param, - __stop___param - __start___param, - level, level, - &repair_env_string); - - for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) - do_one_initcall(*fn); -} +extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[]; static void __init do_initcalls(void) { - int level; + initcall_t *fn; - for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++) - do_initcall_level(level); + for (fn = __early_initcall_end; fn < __initcall_end; fn++) + do_one_initcall(*fn); } /* @@ -790,23 +738,21 @@ static void __init do_pre_smp_initcalls(void) { initcall_t *fn; - for (fn = __initcall_start; fn < __initcall0_start; fn++) + for (fn = __initcall_start; fn < __early_initcall_end; fn++) do_one_initcall(*fn); } -static int run_init_process(const char *init_filename) +static void run_init_process(const char *init_filename) { argv_init[0] = init_filename; - return do_execve(init_filename, - (const char __user *const __user *)argv_init, - (const char __user *const __user *)envp_init); + kernel_execve(init_filename, argv_init, envp_init); } -static void __init kernel_init_freeable(void); - -static int __ref kernel_init(void *unused) +/* This is a non __init function. Force it to be noinline otherwise gcc + * makes it inline to init() and it becomes part of init.text section + */ +static noinline int init_post(void) { - kernel_init_freeable(); /* need to finish all async __init code before freeing the memory */ async_synchronize_full(); free_initmem(); @@ -814,11 +760,11 @@ static int __ref kernel_init(void *unused) system_state = SYSTEM_RUNNING; numa_default_policy(); - flush_delayed_fput(); + + current->signal->flags |= SIGNAL_UNKILLABLE; if (ramdisk_execute_command) { - if (!run_init_process(ramdisk_execute_command)) - return 0; + run_init_process(ramdisk_execute_command); printk(KERN_WARNING "Failed to execute %s\n", ramdisk_execute_command); } @@ -830,35 +776,29 @@ static int __ref kernel_init(void *unused) * trying to recover a really broken machine. */ if (execute_command) { - if (!run_init_process(execute_command)) - return 0; + run_init_process(execute_command); printk(KERN_WARNING "Failed to execute %s. Attempting " "defaults...\n", execute_command); } - if (!run_init_process("/sbin/init") || - !run_init_process("/etc/init") || - !run_init_process("/bin/init") || - !run_init_process("/bin/sh")) - return 0; + run_init_process("/sbin/init"); + run_init_process("/etc/init"); + run_init_process("/bin/init"); + run_init_process("/bin/sh"); panic("No init found. Try passing init= option to kernel. " "See Linux Documentation/init.txt for guidance."); } -static void __init kernel_init_freeable(void) +static int __init kernel_init(void * unused) { /* * Wait until kthreadd is all set-up. */ wait_for_completion(&kthreadd_done); - - /* Now the scheduler is fully set up and can do blocking allocations */ - gfp_allowed_mask = __GFP_BITS_MASK; - /* * init can allocate pages on any node */ - set_mems_allowed(node_states[N_MEMORY]); + set_mems_allowed(node_states[N_HIGH_MEMORY]); /* * init can run on any cpu. */ @@ -900,4 +840,7 @@ static void __init kernel_init_freeable(void) * we're essentially up and running. Get rid of the * initmem segments and start the user-mode stuff.. */ + + init_post(); + return 0; } 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 @@ #include #include #include -#include #ifndef CONFIG_KALLSYMS #define version(a) Version_ ## a @@ -35,7 +34,6 @@ struct uts_namespace init_uts_ns = { .domainname = UTS_DOMAINNAME, }, .user_ns = &init_user_ns, - .proc_inum = PROC_UTS_INIT_INO, }; EXPORT_SYMBOL_GPL(init_uts_ns); -- cgit v1.2.2