diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-07 08:51:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-07 08:51:59 -0400 |
commit | 74da38631a874b5a3ffc4ace6f813a975c55130b (patch) | |
tree | 5570e7df2288333c4285a9e0f97df928a7da7353 | |
parent | bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff) | |
parent | 3cf6b0151ba584714f6eafb99bc66d7326efeed7 (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/Kconfig | 12 | ||||
-rw-r--r-- | arch/x86/Makefile | 7 | ||||
-rw-r--r-- | arch/x86/boot/Makefile | 7 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 17 | ||||
-rw-r--r-- | arch/x86/boot/compressed/aslr.c | 3 | ||||
-rw-r--r-- | arch/x86/boot/compressed/early_serial_console.c | 4 | ||||
-rw-r--r-- | arch/x86/boot/cpu.c | 68 | ||||
-rw-r--r-- | arch/x86/configs/tiny.config | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 7 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/Makefile | 7 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 4 | ||||
-rw-r--r-- | init/Kconfig | 10 | ||||
-rw-r--r-- | kernel/configs/tiny.config | 4 | ||||
-rw-r--r-- | kernel/sys_ni.c | 3 | ||||
-rw-r--r-- | mm/Makefile | 7 | ||||
-rwxr-xr-x | scripts/bloat-o-meter | 2 | ||||
-rw-r--r-- | scripts/kconfig/Makefile | 19 |
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 | ||
141 | config INSTRUCTION_DECODER | 142 | config 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 | ||
318 | config 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 | |||
317 | config X86_X2APIC | 329 | config 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 | ||
256 | PHONY += kvmconfig | ||
257 | kvmconfig: | ||
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 | |||
262 | define archhelp | 256 | define 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' | ||
276 | endef | 269 | endef |
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 | |||
35 | setup-y += video-bios.o | 35 | setup-y += video-bios.o |
36 | 36 | ||
37 | targets += $(setup-y) | 37 | targets += $(setup-y) |
38 | hostprogs-y := mkcpustr tools/build | 38 | hostprogs-y := tools/build |
39 | hostprogs-$(CONFIG_X86_FEATURE_NAMES) += mkcpustr | ||
39 | 40 | ||
40 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include \ | 41 | HOST_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 | ||
45 | ifdef CONFIG_X86_FEATURE_NAMES | ||
44 | $(obj)/cpu.o: $(obj)/cpustr.h | 46 | $(obj)/cpu.o: $(obj)/cpustr.h |
45 | 47 | ||
46 | quiet_cmd_cpustr = CPUSTR $@ | 48 | quiet_cmd_cpustr = CPUSTR $@ |
47 | cmd_cpustr = $(obj)/mkcpustr > $@ | 49 | cmd_cpustr = $(obj)/mkcpustr > $@ |
48 | targets += cpustr.h | 50 | targets += 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) |
53 | endif | ||
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 | |||
26 | hostprogs-y := mkpiggy | 26 | hostprogs-y := mkpiggy |
27 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include | 27 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include |
28 | 28 | ||
29 | VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ | 29 | vmlinux-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 | |||
33 | vmlinux-objs-$(CONFIG_EARLY_PRINTK) += $(obj)/early_serial_console.o | ||
34 | vmlinux-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 | ||
35 | ifeq ($(CONFIG_EFI_STUB), y) | 38 | vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o |
36 | VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o | ||
37 | endif | ||
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 | ||
47 | targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs | 48 | targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs |
48 | 49 | ||
49 | CMD_RELOCS = arch/x86/tools/relocs | 50 | CMD_RELOCS = arch/x86/tools/relocs |
50 | quiet_cmd_relocs = RELOCS $@ | 51 | quiet_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, | |||
335 | out: | 334 | out: |
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 | |||
5 | int early_serial_base; | 3 | int 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 | ||
21 | static char *cpu_name(int level) | 23 | static char *cpu_name(int level) |
22 | { | 24 | { |
@@ -32,11 +34,48 @@ static char *cpu_name(int level) | |||
32 | } | 34 | } |
33 | } | 35 | } |
34 | 36 | ||
37 | static 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 | |||
35 | int validate_cpu(void) | 75 | int 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 | ||
253 | extern const char * const x86_cap_flags[NCAPINTS*32]; | 254 | extern const char * const x86_cap_flags[NCAPINTS*32]; |
254 | extern const char * const x86_power_flags[32]; | 255 | extern 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) | |||
13 | CFLAGS_common.o := $(nostackp) | 13 | CFLAGS_common.o := $(nostackp) |
14 | 14 | ||
15 | obj-y := intel_cacheinfo.o scattered.o topology.o | 15 | obj-y := intel_cacheinfo.o scattered.o topology.o |
16 | obj-y += proc.o capflags.o powerflags.o common.o | 16 | obj-y += common.o |
17 | obj-y += rdrand.o | 17 | obj-y += rdrand.o |
18 | obj-y += match.o | 18 | obj-y += match.o |
19 | 19 | ||
20 | obj-$(CONFIG_PROC_FS) += proc.o | ||
21 | obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o | ||
22 | |||
20 | obj-$(CONFIG_X86_32) += bugs.o | 23 | obj-$(CONFIG_X86_32) += bugs.o |
21 | obj-$(CONFIG_X86_64) += bugs_64.o | 24 | obj-$(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 | ||
49 | obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o | 52 | obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o |
50 | 53 | ||
54 | ifdef CONFIG_X86_FEATURE_NAMES | ||
51 | quiet_cmd_mkcapflags = MKCAP $@ | 55 | quiet_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 | |||
56 | targets += capflags.c | 60 | targets += 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) |
63 | endif | ||
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 | ||
1543 | config 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 | |||
1543 | config PCI_QUIRKS | 1553 | config 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 @@ | |||
1 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
2 | CONFIG_KERNEL_XZ=y | ||
3 | CONFIG_OPTIMIZE_INLINING=y | ||
4 | CONFIG_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); | |||
156 | cond_syscall(compat_sys_process_vm_readv); | 156 | cond_syscall(compat_sys_process_vm_readv); |
157 | cond_syscall(compat_sys_process_vm_writev); | 157 | cond_syscall(compat_sys_process_vm_writev); |
158 | cond_syscall(sys_uselib); | 158 | cond_syscall(sys_uselib); |
159 | cond_syscall(sys_fadvise64); | ||
160 | cond_syscall(sys_fadvise64_64); | ||
161 | cond_syscall(sys_madvise); | ||
159 | 162 | ||
160 | /* arch-specific weak syscall entries */ | 163 | /* arch-specific weak syscall entries */ |
161 | cond_syscall(sys_pciconfig_read); | 164 | cond_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 | ||
5 | mmu-y := nommu.o | 5 | mmu-y := nommu.o |
6 | mmu-$(CONFIG_MMU) := fremap.o gup.o highmem.o madvise.o memory.o mincore.o \ | 6 | mmu-$(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 | |||
11 | mmu-$(CONFIG_MMU) += process_vm_access.o | 11 | mmu-$(CONFIG_MMU) += process_vm_access.o |
12 | endif | 12 | endif |
13 | 13 | ||
14 | obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ | 14 | obj-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 |
29 | endif | 29 | endif |
30 | 30 | ||
31 | ifdef CONFIG_MMU | ||
32 | obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o madvise.o | ||
33 | endif | ||
31 | obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o | 34 | obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o |
32 | 35 | ||
33 | obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o | 36 | obj-$(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 | ||
107 | configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) | ||
108 | |||
109 | define 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 | ||
114 | endef | ||
115 | |||
116 | PHONY += kvmconfig | ||
117 | kvmconfig: | ||
118 | $(call mergeconfig,kvm_guest) | ||
119 | |||
120 | PHONY += tinyconfig | ||
121 | tinyconfig: allnoconfig | ||
122 | $(call mergeconfig,tiny) | ||
123 | |||
107 | # Help text used by make help | 124 | # Help text used by make help |
108 | help: | 125 | help: |
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 |
129 | check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh | 148 | check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh |