aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-07 08:51:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-07 08:51:59 -0400
commit74da38631a874b5a3ffc4ace6f813a975c55130b (patch)
tree5570e7df2288333c4285a9e0f97df928a7da7353
parentbfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff)
parent3cf6b0151ba584714f6eafb99bc66d7326efeed7 (diff)
Merge tag 'tiny/for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux
Pull "tinification" patches from Josh Triplett. Work on making smaller kernels. * tag 'tiny/for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux: bloat-o-meter: Ignore syscall aliases SyS_ and compat_SyS_ mm: Support compiling out madvise and fadvise x86: Support compiling out human-friendly processor feature names x86: Drop support for /proc files when !CONFIG_PROC_FS x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK x86, boot: Don't compile aslr.c when !CONFIG_RANDOMIZE_BASE x86, boot: Use the usual -y -n mechanism for objects in vmlinux x86: Add "make tinyconfig" to configure the tiniest possible kernel x86, platform, kconfig: move kvmconfig functionality to a helper
-rw-r--r--arch/x86/Kconfig12
-rw-r--r--arch/x86/Makefile7
-rw-r--r--arch/x86/boot/Makefile7
-rw-r--r--arch/x86/boot/compressed/Makefile17
-rw-r--r--arch/x86/boot/compressed/aslr.c3
-rw-r--r--arch/x86/boot/compressed/early_serial_console.c4
-rw-r--r--arch/x86/boot/cpu.c68
-rw-r--r--arch/x86/configs/tiny.config1
-rw-r--r--arch/x86/include/asm/cpufeature.h7
-rw-r--r--arch/x86/kernel/cpu/Makefile7
-rw-r--r--arch/x86/kernel/cpu/common.c4
-rw-r--r--init/Kconfig10
-rw-r--r--kernel/configs/tiny.config4
-rw-r--r--kernel/sys_ni.c3
-rw-r--r--mm/Makefile7
-rwxr-xr-xscripts/bloat-o-meter2
-rw-r--r--scripts/kconfig/Makefile19
17 files changed, 126 insertions, 56 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 36327438caf0..e4b1f431c7ed 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -137,6 +137,7 @@ config X86
137 select HAVE_ACPI_APEI if ACPI 137 select HAVE_ACPI_APEI if ACPI
138 select HAVE_ACPI_APEI_NMI if ACPI 138 select HAVE_ACPI_APEI_NMI if ACPI
139 select ACPI_LEGACY_TABLES_LOOKUP if ACPI 139 select ACPI_LEGACY_TABLES_LOOKUP if ACPI
140 select X86_FEATURE_NAMES if PROC_FS
140 141
141config INSTRUCTION_DECODER 142config INSTRUCTION_DECODER
142 def_bool y 143 def_bool y
@@ -314,6 +315,17 @@ config SMP
314 315
315 If you don't know what to do here, say N. 316 If you don't know what to do here, say N.
316 317
318config X86_FEATURE_NAMES
319 bool "Processor feature human-readable names" if EMBEDDED
320 default y
321 ---help---
322 This option compiles in a table of x86 feature bits and corresponding
323 names. This is required to support /proc/cpuinfo and a few kernel
324 messages. You can disable this to save space, at the expense of
325 making those few kernel messages show numeric feature bits instead.
326
327 If in doubt, say Y.
328
317config X86_X2APIC 329config X86_X2APIC
318 bool "Support x2apic" 330 bool "Support x2apic"
319 depends on X86_LOCAL_APIC && X86_64 && IRQ_REMAP 331 depends on X86_LOCAL_APIC && X86_64 && IRQ_REMAP
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 60087ca37679..5692d6ac0f18 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -253,12 +253,6 @@ archclean:
253 $(Q)$(MAKE) $(clean)=arch/x86/tools 253 $(Q)$(MAKE) $(clean)=arch/x86/tools
254 $(Q)$(MAKE) $(clean)=arch/x86/purgatory 254 $(Q)$(MAKE) $(clean)=arch/x86/purgatory
255 255
256PHONY += kvmconfig
257kvmconfig:
258 $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
259 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
260 $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
261
262define archhelp 256define archhelp
263 echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' 257 echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
264 echo ' install - Install kernel using' 258 echo ' install - Install kernel using'
@@ -272,5 +266,4 @@ define archhelp
272 echo ' bzdisk/fdimage*/isoimage also accept:' 266 echo ' bzdisk/fdimage*/isoimage also accept:'
273 echo ' FDARGS="..." arguments for the booted kernel' 267 echo ' FDARGS="..." arguments for the booted kernel'
274 echo ' FDINITRD=file initrd for the booted kernel' 268 echo ' FDINITRD=file initrd for the booted kernel'
275 echo ' kvmconfig - Enable additional options for guest kernel support'
276endef 269endef
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index dbe8dd2fe247..5b016e2498f3 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -35,19 +35,22 @@ setup-y += video-vesa.o
35setup-y += video-bios.o 35setup-y += video-bios.o
36 36
37targets += $(setup-y) 37targets += $(setup-y)
38hostprogs-y := mkcpustr tools/build 38hostprogs-y := tools/build
39hostprogs-$(CONFIG_X86_FEATURE_NAMES) += mkcpustr
39 40
40HOST_EXTRACFLAGS += -I$(srctree)/tools/include \ 41HOST_EXTRACFLAGS += -I$(srctree)/tools/include \
41 -include include/generated/autoconf.h \ 42 -include include/generated/autoconf.h \
42 -D__EXPORTED_HEADERS__ 43 -D__EXPORTED_HEADERS__
43 44
45ifdef CONFIG_X86_FEATURE_NAMES
44$(obj)/cpu.o: $(obj)/cpustr.h 46$(obj)/cpu.o: $(obj)/cpustr.h
45 47
46quiet_cmd_cpustr = CPUSTR $@ 48quiet_cmd_cpustr = CPUSTR $@
47 cmd_cpustr = $(obj)/mkcpustr > $@ 49 cmd_cpustr = $(obj)/mkcpustr > $@
48targets += cpustr.h 50targets += cpustr.h
49$(obj)/cpustr.h: $(obj)/mkcpustr FORCE 51$(obj)/cpustr.h: $(obj)/mkcpustr FORCE
50 $(call if_changed,cpustr) 52 $(call if_changed,cpustr)
53endif
51 54
52# --------------------------------------------------------------------------- 55# ---------------------------------------------------------------------------
53 56
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 0fcd9133790c..704f58aa79cd 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -26,17 +26,18 @@ LDFLAGS_vmlinux := -T
26hostprogs-y := mkpiggy 26hostprogs-y := mkpiggy
27HOST_EXTRACFLAGS += -I$(srctree)/tools/include 27HOST_EXTRACFLAGS += -I$(srctree)/tools/include
28 28
29VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ 29vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \
30 $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \ 30 $(obj)/string.o $(obj)/cmdline.o \
31 $(obj)/piggy.o $(obj)/cpuflags.o $(obj)/aslr.o 31 $(obj)/piggy.o $(obj)/cpuflags.o
32
33vmlinux-objs-$(CONFIG_EARLY_PRINTK) += $(obj)/early_serial_console.o
34vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
32 35
33$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone 36$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
34 37
35ifeq ($(CONFIG_EFI_STUB), y) 38vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
36 VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
37endif
38 39
39$(obj)/vmlinux: $(VMLINUX_OBJS) FORCE 40$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
40 $(call if_changed,ld) 41 $(call if_changed,ld)
41 @: 42 @:
42 43
@@ -44,7 +45,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
44$(obj)/vmlinux.bin: vmlinux FORCE 45$(obj)/vmlinux.bin: vmlinux FORCE
45 $(call if_changed,objcopy) 46 $(call if_changed,objcopy)
46 47
47targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs 48targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs
48 49
49CMD_RELOCS = arch/x86/tools/relocs 50CMD_RELOCS = arch/x86/tools/relocs
50quiet_cmd_relocs = RELOCS $@ 51quiet_cmd_relocs = RELOCS $@
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c
index d39189ba7f8e..7c68808edeb7 100644
--- a/arch/x86/boot/compressed/aslr.c
+++ b/arch/x86/boot/compressed/aslr.c
@@ -1,6 +1,5 @@
1#include "misc.h" 1#include "misc.h"
2 2
3#ifdef CONFIG_RANDOMIZE_BASE
4#include <asm/msr.h> 3#include <asm/msr.h>
5#include <asm/archrandom.h> 4#include <asm/archrandom.h>
6#include <asm/e820.h> 5#include <asm/e820.h>
@@ -335,5 +334,3 @@ unsigned char *choose_kernel_location(unsigned char *input,
335out: 334out:
336 return (unsigned char *)choice; 335 return (unsigned char *)choice;
337} 336}
338
339#endif /* CONFIG_RANDOMIZE_BASE */
diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index d3d003cb5481..261e81fb9582 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -1,9 +1,5 @@
1#include "misc.h" 1#include "misc.h"
2 2
3#ifdef CONFIG_EARLY_PRINTK
4
5int early_serial_base; 3int early_serial_base;
6 4
7#include "../early_serial_console.c" 5#include "../early_serial_console.c"
8
9#endif
diff --git a/arch/x86/boot/cpu.c b/arch/x86/boot/cpu.c
index 6ec6bb6e9957..29207f69ae8c 100644
--- a/arch/x86/boot/cpu.c
+++ b/arch/x86/boot/cpu.c
@@ -16,7 +16,9 @@
16 */ 16 */
17 17
18#include "boot.h" 18#include "boot.h"
19#ifdef CONFIG_X86_FEATURE_NAMES
19#include "cpustr.h" 20#include "cpustr.h"
21#endif
20 22
21static char *cpu_name(int level) 23static char *cpu_name(int level)
22{ 24{
@@ -32,11 +34,48 @@ static char *cpu_name(int level)
32 } 34 }
33} 35}
34 36
37static void show_cap_strs(u32 *err_flags)
38{
39 int i, j;
40#ifdef CONFIG_X86_FEATURE_NAMES
41 const unsigned char *msg_strs = (const unsigned char *)x86_cap_strs;
42 for (i = 0; i < NCAPINTS; i++) {
43 u32 e = err_flags[i];
44 for (j = 0; j < 32; j++) {
45 if (msg_strs[0] < i ||
46 (msg_strs[0] == i && msg_strs[1] < j)) {
47 /* Skip to the next string */
48 msg_strs += 2;
49 while (*msg_strs++)
50 ;
51 }
52 if (e & 1) {
53 if (msg_strs[0] == i &&
54 msg_strs[1] == j &&
55 msg_strs[2])
56 printf("%s ", msg_strs+2);
57 else
58 printf("%d:%d ", i, j);
59 }
60 e >>= 1;
61 }
62 }
63#else
64 for (i = 0; i < NCAPINTS; i++) {
65 u32 e = err_flags[i];
66 for (j = 0; j < 32; j++) {
67 if (e & 1)
68 printf("%d:%d ", i, j);
69 e >>= 1;
70 }
71 }
72#endif
73}
74
35int validate_cpu(void) 75int validate_cpu(void)
36{ 76{
37 u32 *err_flags; 77 u32 *err_flags;
38 int cpu_level, req_level; 78 int cpu_level, req_level;
39 const unsigned char *msg_strs;
40 79
41 check_cpu(&cpu_level, &req_level, &err_flags); 80 check_cpu(&cpu_level, &req_level, &err_flags);
42 81
@@ -49,34 +88,9 @@ int validate_cpu(void)
49 } 88 }
50 89
51 if (err_flags) { 90 if (err_flags) {
52 int i, j;
53 puts("This kernel requires the following features " 91 puts("This kernel requires the following features "
54 "not present on the CPU:\n"); 92 "not present on the CPU:\n");
55 93 show_cap_strs(err_flags);
56 msg_strs = (const unsigned char *)x86_cap_strs;
57
58 for (i = 0; i < NCAPINTS; i++) {
59 u32 e = err_flags[i];
60
61 for (j = 0; j < 32; j++) {
62 if (msg_strs[0] < i ||
63 (msg_strs[0] == i && msg_strs[1] < j)) {
64 /* Skip to the next string */
65 msg_strs += 2;
66 while (*msg_strs++)
67 ;
68 }
69 if (e & 1) {
70 if (msg_strs[0] == i &&
71 msg_strs[1] == j &&
72 msg_strs[2])
73 printf("%s ", msg_strs+2);
74 else
75 printf("%d:%d ", i, j);
76 }
77 e >>= 1;
78 }
79 }
80 putchar('\n'); 94 putchar('\n');
81 return -1; 95 return -1;
82 } else { 96 } else {
diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config
new file mode 100644
index 000000000000..4e2ecfa23c15
--- /dev/null
+++ b/arch/x86/configs/tiny.config
@@ -0,0 +1 @@
CONFIG_NOHIGHMEM=y
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index bb9b258d60e7..516903b98e06 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -250,8 +250,15 @@
250#include <asm/asm.h> 250#include <asm/asm.h>
251#include <linux/bitops.h> 251#include <linux/bitops.h>
252 252
253#ifdef CONFIG_X86_FEATURE_NAMES
253extern const char * const x86_cap_flags[NCAPINTS*32]; 254extern const char * const x86_cap_flags[NCAPINTS*32];
254extern const char * const x86_power_flags[32]; 255extern const char * const x86_power_flags[32];
256#define X86_CAP_FMT "%s"
257#define x86_cap_flag(flag) x86_cap_flags[flag]
258#else
259#define X86_CAP_FMT "%d:%d"
260#define x86_cap_flag(flag) ((flag) >> 5), ((flag) & 31)
261#endif
255 262
256/* 263/*
257 * In order to save room, we index into this array by doing 264 * In order to save room, we index into this array by doing
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 7fd54f09b011..77dcab277710 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -13,10 +13,13 @@ nostackp := $(call cc-option, -fno-stack-protector)
13CFLAGS_common.o := $(nostackp) 13CFLAGS_common.o := $(nostackp)
14 14
15obj-y := intel_cacheinfo.o scattered.o topology.o 15obj-y := intel_cacheinfo.o scattered.o topology.o
16obj-y += proc.o capflags.o powerflags.o common.o 16obj-y += common.o
17obj-y += rdrand.o 17obj-y += rdrand.o
18obj-y += match.o 18obj-y += match.o
19 19
20obj-$(CONFIG_PROC_FS) += proc.o
21obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o
22
20obj-$(CONFIG_X86_32) += bugs.o 23obj-$(CONFIG_X86_32) += bugs.o
21obj-$(CONFIG_X86_64) += bugs_64.o 24obj-$(CONFIG_X86_64) += bugs_64.o
22 25
@@ -48,6 +51,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o perf_event_amd_ibs.o
48 51
49obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o 52obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
50 53
54ifdef CONFIG_X86_FEATURE_NAMES
51quiet_cmd_mkcapflags = MKCAP $@ 55quiet_cmd_mkcapflags = MKCAP $@
52 cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $< $@ 56 cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $< $@
53 57
@@ -56,3 +60,4 @@ cpufeature = $(src)/../../include/asm/cpufeature.h
56targets += capflags.c 60targets += capflags.c
57$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE 61$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
58 $(call if_changed,mkcapflags) 62 $(call if_changed,mkcapflags)
63endif
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index e4ab2b42bd6f..c649f236e288 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -346,8 +346,8 @@ static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
346 continue; 346 continue;
347 347
348 printk(KERN_WARNING 348 printk(KERN_WARNING
349 "CPU: CPU feature %s disabled, no CPUID level 0x%x\n", 349 "CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
350 x86_cap_flags[df->feature], df->level); 350 x86_cap_flag(df->feature), df->level);
351 } 351 }
352} 352}
353 353
diff --git a/init/Kconfig b/init/Kconfig
index 80a6907f91c5..b48917717bae 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1540,6 +1540,16 @@ config AIO
1540 by some high performance threaded applications. Disabling 1540 by some high performance threaded applications. Disabling
1541 this option saves about 7k. 1541 this option saves about 7k.
1542 1542
1543config ADVISE_SYSCALLS
1544 bool "Enable madvise/fadvise syscalls" if EXPERT
1545 default y
1546 help
1547 This option enables the madvise and fadvise syscalls, used by
1548 applications to advise the kernel about their future memory or file
1549 usage, improving performance. If building an embedded system where no
1550 applications use these syscalls, you can disable this option to save
1551 space.
1552
1543config PCI_QUIRKS 1553config PCI_QUIRKS
1544 default y 1554 default y
1545 bool "Enable PCI quirk workarounds" if EXPERT 1555 bool "Enable PCI quirk workarounds" if EXPERT
diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config
new file mode 100644
index 000000000000..c2de56ab0fce
--- /dev/null
+++ b/kernel/configs/tiny.config
@@ -0,0 +1,4 @@
1CONFIG_CC_OPTIMIZE_FOR_SIZE=y
2CONFIG_KERNEL_XZ=y
3CONFIG_OPTIMIZE_INLINING=y
4CONFIG_SLOB=y
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 391d4ddb6f4b..d4709d481053 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -156,6 +156,9 @@ cond_syscall(sys_process_vm_writev);
156cond_syscall(compat_sys_process_vm_readv); 156cond_syscall(compat_sys_process_vm_readv);
157cond_syscall(compat_sys_process_vm_writev); 157cond_syscall(compat_sys_process_vm_writev);
158cond_syscall(sys_uselib); 158cond_syscall(sys_uselib);
159cond_syscall(sys_fadvise64);
160cond_syscall(sys_fadvise64_64);
161cond_syscall(sys_madvise);
159 162
160/* arch-specific weak syscall entries */ 163/* arch-specific weak syscall entries */
161cond_syscall(sys_pciconfig_read); 164cond_syscall(sys_pciconfig_read);
diff --git a/mm/Makefile b/mm/Makefile
index 632ae77e6070..fe7a053c0f45 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5mmu-y := nommu.o 5mmu-y := nommu.o
6mmu-$(CONFIG_MMU) := fremap.o gup.o highmem.o madvise.o memory.o mincore.o \ 6mmu-$(CONFIG_MMU) := fremap.o gup.o highmem.o memory.o mincore.o \
7 mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \ 7 mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \
8 vmalloc.o pagewalk.o pgtable-generic.o 8 vmalloc.o pagewalk.o pgtable-generic.o
9 9
@@ -11,7 +11,7 @@ ifdef CONFIG_CROSS_MEMORY_ATTACH
11mmu-$(CONFIG_MMU) += process_vm_access.o 11mmu-$(CONFIG_MMU) += process_vm_access.o
12endif 12endif
13 13
14obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ 14obj-y := filemap.o mempool.o oom_kill.o \
15 maccess.o page_alloc.o page-writeback.o \ 15 maccess.o page_alloc.o page-writeback.o \
16 readahead.o swap.o truncate.o vmscan.o shmem.o \ 16 readahead.o swap.o truncate.o vmscan.o shmem.o \
17 util.o mmzone.o vmstat.o backing-dev.o \ 17 util.o mmzone.o vmstat.o backing-dev.o \
@@ -28,6 +28,9 @@ else
28 obj-y += bootmem.o 28 obj-y += bootmem.o
29endif 29endif
30 30
31ifdef CONFIG_MMU
32 obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o madvise.o
33endif
31obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o 34obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o
32 35
33obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o 36obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 549d0ab8c662..23e78dcd12bf 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -20,6 +20,8 @@ def getsizes(file):
20 if type in "tTdDbBrR": 20 if type in "tTdDbBrR":
21 # strip generated symbols 21 # strip generated symbols
22 if name.startswith("__mod_"): continue 22 if name.startswith("__mod_"): continue
23 if name.startswith("SyS_"): continue
24 if name.startswith("compat_SyS_"): continue
23 if name == "linux_banner": continue 25 if name == "linux_banner": continue
24 # statics and some other optimizations adds random .NUMBER 26 # statics and some other optimizations adds random .NUMBER
25 name = re.sub(r'\.[0-9]+', '', name) 27 name = re.sub(r'\.[0-9]+', '', name)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 9c4d2412fb72..ebf40f6edb4d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -104,6 +104,23 @@ endif
104%_defconfig: $(obj)/conf 104%_defconfig: $(obj)/conf
105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
106 106
107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
108
109define mergeconfig
110$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
111$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
112$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
113$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
114endef
115
116PHONY += kvmconfig
117kvmconfig:
118 $(call mergeconfig,kvm_guest)
119
120PHONY += tinyconfig
121tinyconfig: allnoconfig
122 $(call mergeconfig,tiny)
123
107# Help text used by make help 124# Help text used by make help
108help: 125help:
109 @echo ' config - Update current config utilising a line-oriented program' 126 @echo ' config - Update current config utilising a line-oriented program'
@@ -124,6 +141,8 @@ help:
124 @echo ' randconfig - New config with random answer to all options' 141 @echo ' randconfig - New config with random answer to all options'
125 @echo ' listnewconfig - List new options' 142 @echo ' listnewconfig - List new options'
126 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' 143 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
144 @echo ' kvmconfig - Enable additional options for guest kernel support'
145 @echo ' tinyconfig - Configure the tiniest possible kernel'
127 146
128# lxdialog stuff 147# lxdialog stuff
129check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh 148check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh