Skip to content

Instantly share code, notes, and snippets.

@hiromu
Created June 30, 2011 22:35
Show Gist options
  • Save hiromu/1057460 to your computer and use it in GitHub Desktop.
Save hiromu/1057460 to your computer and use it in GitHub Desktop.
[PATCH] This is a patch for using Intel C++ Compiler to build kernel.
From 1129c1019e4850f9232c312caef3f643a0cd9c74 Mon Sep 17 00:00:00 2001
From: Hiromu Yakura <hiromu1996@gmail.com>
Date: Fri, 1 Jul 2011 07:00:14 +0900
Subject: [PATCH] This is a patch for using Intel C++ Compiler to build kernel.
---
Makefile | 46 +++++++++----
arch/x86/Kconfig.cpu | 55 ++++++++++++---
arch/x86/Makefile | 14 ++--
arch/x86/Makefile_32.cpu | 8 ++-
arch/x86/boot/Makefile | 6 +--
arch/x86/boot/compressed/Makefile | 3 +-
arch/x86/boot/compressed/misc.c | 1 +
arch/x86/include/asm/current.h | 2 +-
arch/x86/include/asm/delay.h | 8 +--
arch/x86/include/asm/module.h | 6 ++
arch/x86/include/asm/percpu.h | 29 ++++----
arch/x86/include/asm/thread_info.h | 2 +-
arch/x86/kernel/acpi/realmode/Makefile | 8 +-
arch/x86/kernel/apic/Makefile | 2 +
arch/x86/kernel/cpu/common.c | 36 ++++++-----
arch/x86/kernel/cpu/mtrr/Makefile | 4 +-
arch/x86/mm/Makefile | 1 +
arch/x86/vdso/Makefile | 13 +++-
drivers/acpi/acpica/Makefile | 2 +
drivers/char/Makefile | 2 +
drivers/char/agp/Makefile | 2 +
drivers/video/console/Makefile | 4 +
fs/cifs/Makefile | 5 ++
fs/compat_ioctl.c | 2 +-
fs/ext4/Makefile | 2 +
fs/fuse/Makefile | 3 +
init/Kconfig | 86 ++++++++++++++++++++++--
kernel/Makefile | 6 ++
lib/Makefile | 2 +
lib/zlib_inflate/Makefile | 2 +
lib/zlib_inflate/inflate.c | 115 ++++++++++++++++++++++++++++++++
mm/Makefile | 2 +
mm/vmalloc.c | 4 +
net/ipv6/Makefile | 2 +
net/xfrm/Makefile | 2 +
scripts/Makefile.build | 2 +-
scripts/Makefile.modpost | 2 +-
sound/core/Makefile | 2 +
38 files changed, 400 insertions(+), 93 deletions(-)
diff --git a/Makefile b/Makefile
index dc67046..ab3e87b 100644
--- a/Makefile
+++ b/Makefile
@@ -243,9 +243,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
-HOSTCC = gcc
-HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCC = icc
+HOSTCXX = icpc
+HOSTCFLAGS = -w -O3 -fomit-frame-pointer
HOSTCXXFLAGS = -O2
# Decide whether to build built-in, modular, or both.
@@ -329,10 +329,10 @@ include $(srctree)/scripts/Kbuild.include
# Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as
-LD = $(CROSS_COMPILE)ld
-CC = $(CROSS_COMPILE)gcc
+LD = $(CROSS_COMPILE)xild
+CC = $(CROSS_COMPILE)icc
CPP = $(CC) -E
-AR = $(CROSS_COMPILE)ar
+AR = $(CROSS_COMPILE)xiar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
@@ -558,12 +558,32 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux
-ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS += -Os
-else
-KBUILD_CFLAGS += -O2
+ifdef CONFIG_CC_IP
+KBUILD_CFLAGS += -ip
+endif
+
+ifdef CONFIG_CC_IPO
+KBUILD_CFLAGS += -ipo1
endif
+olevel-$(CONFIG_CC_OPTIMIZE_WITH_O1) += $(call cc-option,-O1)
+olevel-$(CONFIG_CC_OPTIMIZE_WITH_Os) += $(call cc-option,-Os)
+olevel-$(CONFIG_CC_OPTIMIZE_WITH_O2) += $(call cc-option,-O2) $(call cc-option,-fp-model fast=2) \
+ $(call cc-option,-unroll-aggressive),$(call cc-option,-vec-guard-write)
+olevel-$(CONFIG_CC_OPTIMIZE_WITH_O3) += $(call cc-option,-O3) $(call cc-option,-fp-model fast=2) \
+ $(call cc-option,-unroll-aggressive),$(call cc-option,-vec-guard-write)
+KBUILD_CFLAGS += $(olevel-y)
+
+vr-$(CONFIG_CC_VEC_REPORT_0) += $(call cc-option,-vec-report0)
+vr-$(CONFIG_CC_VEC_REPORT_1) += $(call cc-option,-vec-report1)
+vr-$(CONFIG_CC_VEC_REPORT_2) += $(call cc-option,-vec-report2)
+vr-$(CONFIG_CC_VEC_REPORT_3) += $(call cc-option,-vec-report3)
+vr-$(CONFIG_CC_VEC_REPORT_4) += $(call cc-option,-vec-report4)
+vr-$(CONFIG_CC_VEC_REPORT_5) += $(call cc-option,-vec-report5)
+KBUILD_CFLAGS += $(vr-y)
+
+KBUILD_CFLAGS += -w
+
include $(srctree)/arch/$(SRCARCH)/Makefile
ifneq ($(CONFIG_FRAME_WARN),0)
@@ -763,9 +783,9 @@ export KBUILD_VMLINUX_OBJS := $(vmlinux-all)
# Rule to link vmlinux - also used during CONFIG_KALLSYMS
# May be overridden by arch/$(ARCH)/Makefile
quiet_cmd_vmlinux__ ?= LD $@
- cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
- -T $(vmlinux-lds) $(vmlinux-init) \
- --start-group $(vmlinux-main) --end-group \
+ cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
+ -T $(vmlinux-lds) $(vmlinux-init) \
+ --start-group $(vmlinux-main) /usr/lib/libirc_s.a --end-group \
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
# Generate new vmlinux version
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 6a7cfdf..40629bf 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -260,13 +260,24 @@ config MPSC
in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
config MCORE2
- bool "Core 2/newer Xeon"
+ bool "Intel Core 2 65nm"
---help---
- Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
- 53xx) CPUs. You can distinguish newer from older Xeons by the CPU
- family in /proc/cpuinfo. Newer ones have 6 and older ones 15
- (not a typo)
+ Select this for Intel 65nm Core 2 and Xeons (Xeon 51xx and 53xx) CPUs.
+ The 65nm line includes the mobible Merom, desktop Allendale, Conroe,
+ Wolfdale, and Kentsfield, and server Woodcrest, and Clovertown processors.
+
+ Enables -xSSSE3
+
+config M45CORE2
+ bool "Intel Core 2 45nm"
+ ---help---
+
+ Select this for Intel Core 2 45nm processors. The 45nm line includes
+ the mobile Penryn, desktop Wolfdale and Yorkfield, and server
+ Wolfdale-DP, Harpertown and Dunnington processors.
+
+ Enables -xSSE4.1
config MATOM
bool "Intel Atom"
@@ -277,6 +288,26 @@ config MATOM
accordingly optimized code. Use a recent GCC with specific Atom
support in order to fully benefit from selecting this option.
+ Enables -xSSE3_ATOM
+
+config MNEHALEM
+ bool "Intel Nehalem/Westmere"
+ ---help---
+
+ Select this for the Intel Nehalem platform. Intel Nehalem proecessors
+ include Core i3, i5, i7, Xeon: 34xx, 35xx, 55xx, 56xx, 75xx processors.
+
+ Enables -xSSE4.2
+
+config MSANDYBRIDGE
+ bool "Intel Sandy Bridge"
+ ---help---
+
+ Select this for the Intel Sandy Bridge platform.
+
+ Enables -xAVX
+
+
config GENERIC_CPU
bool "Generic-x86-64"
depends on X86_64
@@ -315,7 +346,7 @@ config CMPXCHG_LOCAL
config X86_L1_CACHE_SHIFT
int
default "7" if MPENTIUM4 || MPSC
- default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
+ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || M45CORE2 || MATOM || MVIAC7 || X86_GENERIC || MNEHALEM || MSANDYBRIDGE || GENERIC_CPU
default "4" if MELAN || M486 || M386 || MGEODEGX1
default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
@@ -366,11 +397,11 @@ config X86_ALIGNMENT_16
config X86_INTEL_USERCOPY
def_bool y
- depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || M45CORE2 || MNEHALEM || MSANDYBRIDGE
config X86_USE_PPRO_CHECKSUM
def_bool y
- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON || MGEODE_LX || MCORE2 || M45CORE2 || MATOM || MNEHALEM || MSANDYBRIDGE
config X86_USE_3DNOW
def_bool y
@@ -394,21 +425,21 @@ config X86_OOSTORE
config X86_P6_NOP
def_bool y
depends on X86_64
- depends on (MCORE2 || MPENTIUM4 || MPSC)
+ depends on (MCORE2 || M45CORE2 || MNEHALEM || MSANDYBRIDGE || MPENTIUM4 || MPSC)
config X86_TSC
def_bool y
- depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) && !X86_NUMAQ) || X86_64
+ depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || M45CORE2 || MATOM || MNEHALEM || MSANDYBRIDGE) && !X86_NUMAQ) || X86_64
config X86_CMPXCHG64
def_bool y
- depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
+ depends on X86_PAE || X86_64 || MCORE2 || M45CORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM || MNEHALEM || MSANDYBRIDGE
# this should be set for all -march=.. options where the compiler
# generates cmov.
config X86_CMOV
def_bool y
- depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
+ depends on (MK8 || MK7 || MCORE2 || M45CORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX || MNEHALEM || MSANDYBRIDGE)
config X86_MINIMUM_CPU_FAMILY
int
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index b02e509..c9f5948 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -48,16 +48,18 @@ else
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
+ KBUILD_CFLAGS += -ffreestanding
# FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
- cflags-$(CONFIG_MCORE2) += \
- $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
- cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
- cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
+ cflags-$(CONFIG_MCORE2) += $(call cc-option,-xSSSE3)
+ cflags-$(CONFIG_M45CORE2) += $(call cc-option,-xSSE4.1)
+ cflags-$(CONFIG_MATOM) += $(call cc-option,-xSSE3_ATOM)
+ cflags-$(CONFIG_MNEHALEM) += $(call cc-option,-xSSE4.2)
+ cflags-$(CONFIG_MSANDYBRIDGE) += $(call cc-option,-xAVX)
+ cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-xSSE3)
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += -mno-red-zone
@@ -112,7 +114,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
#
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# prevent gcc from generating any FP code by mistake
-KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+#KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)
diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index 86cee7b..bf50ecf 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -32,9 +32,11 @@ cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
cflags-$(CONFIG_MVIAC7) += -march=i686
-cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
-cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686)) \
- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
+cflags-$(CONFIG_MCORE2) += $(call cc-option,-xSSSE3)
+cflags-$(CONFIG_M45CORE2) += $(call cc-option,-xSSE4.1)
+cflags-$(CONFIG_MATOM) += $(call cc-option,-xSSE3_ATOM)
+cflags-$(CONFIG_MNEHALEM) += $(call cc-option,-xSSE4.2)
+cflags-$(CONFIG_MSANDYBRIDGE) += $(call cc-option,-xAVX)
# AMD Elan support
cflags-$(CONFIG_MELAN) += -march=i486
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index f7cb086..401bd1f 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -59,16 +59,12 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
# that way we can complain to the user if the CPU is insufficient.
KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
-DDISABLE_BRANCH_PROFILING \
- -Wall -Wstrict-prototypes \
- -march=i386 -mregparm=3 \
+ -m32 -no-multibyte-chars -march=i386 -mregparm=3 \
-include $(srctree)/$(src)/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer \
$(call cc-option, -ffreestanding) \
- $(call cc-option, -fno-toplevel-reorder,\
- $(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)
-KBUILD_CFLAGS += $(call cc-option, -m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 09664ef..3159455 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -1,3 +1,4 @@
+CC=icc
#
# linux/arch/x86/boot/compressed/Makefile
#
@@ -6,7 +7,7 @@
targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o
-KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
+KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O3 -no-vec
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
cflags-$(CONFIG_X86_32) := -march=i386
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3a19d04..fc09949 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -96,6 +96,7 @@
* gzip declarations
*/
#define STATIC static
+#define HANDLE_ICC
#undef memset
#undef memcpy
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h
index 4d447b7..c68c361 100644
--- a/arch/x86/include/asm/current.h
+++ b/arch/x86/include/asm/current.h
@@ -11,7 +11,7 @@ DECLARE_PER_CPU(struct task_struct *, current_task);
static __always_inline struct task_struct *get_current(void)
{
- return percpu_read_stable(current_task);
+ return percpu_read(current_task);
}
#define current get_current()
diff --git a/arch/x86/include/asm/delay.h b/arch/x86/include/asm/delay.h
index 409a649..e9c5995 100644
--- a/arch/x86/include/asm/delay.h
+++ b/arch/x86/include/asm/delay.h
@@ -7,10 +7,6 @@
* Delay routines calling functions in arch/x86/lib/delay.c
*/
-/* Undefined functions to get compile-time errors */
-extern void __bad_udelay(void);
-extern void __bad_ndelay(void);
-
extern void __udelay(unsigned long usecs);
extern void __ndelay(unsigned long nsecs);
extern void __const_udelay(unsigned long xloops);
@@ -18,12 +14,12 @@ extern void __delay(unsigned long loops);
/* 0x10c7 is 2**32 / 1000000 (rounded up) */
#define udelay(n) (__builtin_constant_p(n) ? \
- ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
+ ( __const_udelay((n) * 0x10c7ul)) : \
__udelay(n))
/* 0x5 is 2**32 / 1000000000 (rounded up) */
#define ndelay(n) (__builtin_constant_p(n) ? \
- ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
+ ( __const_udelay((n) * 5ul)) : \
__ndelay(n))
void use_tsc_delay(void);
diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
index 9eae775..518c0a4 100644
--- a/arch/x86/include/asm/module.h
+++ b/arch/x86/include/asm/module.h
@@ -17,8 +17,14 @@
#define MODULE_PROC_FAMILY "586MMX "
#elif defined CONFIG_MCORE2
#define MODULE_PROC_FAMILY "CORE2 "
+#elif defined CONFIG_M45CORE2
+#define MODULE_PROC_FAMILY "45CORE2 "
#elif defined CONFIG_MATOM
#define MODULE_PROC_FAMILY "ATOM "
+#elif defined CONFIG_MNEHALEM
+#define MODULE_PROC_FAMILY "NEHALEM "
+#elif defined CONFIG_MSANDYBRIDGE
+#define MODULE_PROC_FAMILY "SANDYBRIDGE "
#elif defined CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif defined CONFIG_MPENTIUMII
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index a0a9779..3c1e21a 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -65,7 +65,7 @@
#define __percpu_prefix ""
#endif
-#define __percpu_arg(x) __percpu_prefix "%P" #x
+#define __percpu_arg(x) __percpu_prefix "%" #x
/*
* Initialized pointers to per-cpu variables needed for the boot
@@ -186,22 +186,22 @@ do { \
case 1: \
asm(op "b "__percpu_arg(1)",%0" \
: "=q" (pfo_ret__) \
- : constraint); \
+ : "m" (var)); \
break; \
case 2: \
asm(op "w "__percpu_arg(1)",%0" \
: "=r" (pfo_ret__) \
- : constraint); \
+ : "m" (var)); \
break; \
case 4: \
asm(op "l "__percpu_arg(1)",%0" \
: "=r" (pfo_ret__) \
- : constraint); \
+ : "m" (var)); \
break; \
case 8: \
asm(op "q "__percpu_arg(1)",%0" \
: "=r" (pfo_ret__) \
- : constraint); \
+ : "m" (var)); \
break; \
default: __bad_percpu_size(); \
} \
@@ -350,6 +350,7 @@ do { \
pco_ret__; \
})
+#define percpu_read(var) percpu_from_op("mov", var)
/*
* percpu_read() makes gcc load the percpu variable every time it is
* accessed while percpu_read_stable() allows the value to be cached.
@@ -359,8 +360,6 @@ do { \
* per-thread variables implemented as per-cpu variables and thus
* stable for the duration of the respective task.
*/
-#define percpu_read(var) percpu_from_op("mov", var, "m" (var))
-#define percpu_read_stable(var) percpu_from_op("mov", var, "p" (&(var)))
#define percpu_write(var, val) percpu_to_op("mov", var, val)
#define percpu_add(var, val) percpu_add_op(var, val)
#define percpu_sub(var, val) percpu_add_op(var, -(val))
@@ -369,9 +368,9 @@ do { \
#define percpu_xor(var, val) percpu_to_op("xor", var, val)
#define percpu_inc(var) percpu_unary_op("inc", var)
-#define __this_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
-#define __this_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
-#define __this_cpu_read_4(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
+#define __this_cpu_read_1(pcp) percpu_from_op("mov", (pcp))
+#define __this_cpu_read_2(pcp) percpu_from_op("mov", (pcp))
+#define __this_cpu_read_4(pcp) percpu_from_op("mov", (pcp))
#define __this_cpu_write_1(pcp, val) percpu_to_op("mov", (pcp), val)
#define __this_cpu_write_2(pcp, val) percpu_to_op("mov", (pcp), val)
@@ -395,9 +394,9 @@ do { \
#define __this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval)
#define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
-#define this_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
-#define this_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
-#define this_cpu_read_4(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
+#define this_cpu_read_1(pcp) percpu_from_op("mov", (pcp))
+#define this_cpu_read_2(pcp) percpu_from_op("mov", (pcp))
+#define this_cpu_read_4(pcp) percpu_from_op("mov", (pcp))
#define this_cpu_write_1(pcp, val) percpu_to_op("mov", (pcp), val)
#define this_cpu_write_2(pcp, val) percpu_to_op("mov", (pcp), val)
#define this_cpu_write_4(pcp, val) percpu_to_op("mov", (pcp), val)
@@ -478,7 +477,7 @@ do { \
* 32 bit must fall back to generic operations.
*/
#ifdef CONFIG_X86_64
-#define __this_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
+#define __this_cpu_read_8(pcp) percpu_from_op("mov", (pcp))
#define __this_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val)
#define __this_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
#define __this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
@@ -486,7 +485,7 @@ do { \
#define __this_cpu_xor_8(pcp, val) percpu_to_op("xor", (pcp), val)
#define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
-#define this_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
+#define this_cpu_read_8(pcp) percpu_from_op("mov", (pcp))
#define this_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val)
#define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
#define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 1f2e61e..bfcfff8 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -219,7 +219,7 @@ DECLARE_PER_CPU(unsigned long, kernel_stack);
static inline struct thread_info *current_thread_info(void)
{
struct thread_info *ti;
- ti = (void *)(percpu_read_stable(kernel_stack) +
+ ti = (void *)(percpu_read(kernel_stack) +
KERNEL_STACK_OFFSET - THREAD_SIZE);
return ti;
}
diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile
index 6a564ac..7bbc169 100644
--- a/arch/x86/kernel/acpi/realmode/Makefile
+++ b/arch/x86/kernel/acpi/realmode/Makefile
@@ -1,3 +1,4 @@
+CC=icc
#
# arch/x86/kernel/acpi/realmode/Makefile
#
@@ -28,11 +29,11 @@ bootsrc := $(src)/../../../boot
# How to compile the 16-bit code. Note we always compile for -march=i386,
# that way we can complain to the user if the CPU is insufficient.
# Compile with _SETUP since this is similar to the boot-time setup code.
-KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \
+KBUILD_CFLAGS := $(LINUXINCLUDE) -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \
-I$(srctree)/$(bootsrc) \
$(cflags-y) \
- -Wall -Wstrict-prototypes \
- -march=i386 -mregparm=3 \
+ -w \
+ -march=i386 -m32 -mregparm=3 \
-include $(srctree)/$(bootsrc)/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer \
$(call cc-option, -ffreestanding) \
@@ -40,7 +41,6 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \
$(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)
-KBUILD_CFLAGS += $(call cc-option, -m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
index 767fd04..2d28bea 100644
--- a/arch/x86/kernel/apic/Makefile
+++ b/arch/x86/kernel/apic/Makefile
@@ -19,6 +19,8 @@ endif
# APIC probe will depend on the listing order here
obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
obj-$(CONFIG_X86_SUMMIT) += summit_32.o
+CFLAGS_apic.o=-O1
+CFLAGS_io_apic.o=-O1
obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o
obj-$(CONFIG_X86_ES7000) += es7000_32.o
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 22a073d..562027c 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -93,45 +93,49 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
* TLS descriptors are currently at a different place compared to i386.
* Hopefully nobody expects them at a fixed place (Wine?)
*/
- [GDT_ENTRY_KERNEL32_CS] = GDT_ENTRY_INIT(0xc09b, 0, 0xfffff),
- [GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xa09b, 0, 0xfffff),
- [GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc093, 0, 0xfffff),
- [GDT_ENTRY_DEFAULT_USER32_CS] = GDT_ENTRY_INIT(0xc0fb, 0, 0xfffff),
- [GDT_ENTRY_DEFAULT_USER_DS] = GDT_ENTRY_INIT(0xc0f3, 0, 0xfffff),
- [GDT_ENTRY_DEFAULT_USER_CS] = GDT_ENTRY_INIT(0xa0fb, 0, 0xfffff),
+ [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } },
+ [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } },
+ [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } },
+ [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } },
+ [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } },
+ [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } },
#else
[GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xc09a, 0, 0xfffff),
[GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc092, 0, 0xfffff),
[GDT_ENTRY_DEFAULT_USER_CS] = GDT_ENTRY_INIT(0xc0fa, 0, 0xfffff),
[GDT_ENTRY_DEFAULT_USER_DS] = GDT_ENTRY_INIT(0xc0f2, 0, 0xfffff),
+ [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } },
+ [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } },
+ [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } },
+ [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff200 } } },
/*
* Segments used for calling PnP BIOS have byte granularity.
* They code segments and data segments have fixed 64k limits,
* the transfer segment sizes are set at run time.
*/
/* 32-bit code */
- [GDT_ENTRY_PNPBIOS_CS32] = GDT_ENTRY_INIT(0x409a, 0, 0xffff),
+ [GDT_ENTRY_PNPBIOS_CS32] = { { { 0x0000ffff, 0x00409a00 } } },
/* 16-bit code */
- [GDT_ENTRY_PNPBIOS_CS16] = GDT_ENTRY_INIT(0x009a, 0, 0xffff),
+ [GDT_ENTRY_PNPBIOS_CS16] = { { { 0x0000ffff, 0x00009a00 } } },
/* 16-bit data */
- [GDT_ENTRY_PNPBIOS_DS] = GDT_ENTRY_INIT(0x0092, 0, 0xffff),
+ [GDT_ENTRY_PNPBIOS_DS] = { { { 0x0000ffff, 0x00009200 } } },
/* 16-bit data */
- [GDT_ENTRY_PNPBIOS_TS1] = GDT_ENTRY_INIT(0x0092, 0, 0),
+ [GDT_ENTRY_PNPBIOS_TS1] = { { { 0x00000000, 0x00009200 } } },
/* 16-bit data */
- [GDT_ENTRY_PNPBIOS_TS2] = GDT_ENTRY_INIT(0x0092, 0, 0),
+ [GDT_ENTRY_PNPBIOS_TS2] = { { { 0x00000000, 0x00009200 } } },
/*
* The APM segments have byte granularity and their bases
* are set at run time. All have 64k limits.
*/
/* 32-bit code */
- [GDT_ENTRY_APMBIOS_BASE] = GDT_ENTRY_INIT(0x409a, 0, 0xffff),
+ [GDT_ENTRY_APMBIOS_BASE] = { { { 0x0000ffff, 0x00409a00 } } },
/* 16-bit code */
- [GDT_ENTRY_APMBIOS_BASE+1] = GDT_ENTRY_INIT(0x009a, 0, 0xffff),
+ [GDT_ENTRY_APMBIOS_BASE+1] = { { { 0x0000ffff, 0x00009a00 } } },
/* data */
- [GDT_ENTRY_APMBIOS_BASE+2] = GDT_ENTRY_INIT(0x4092, 0, 0xffff),
+ [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } },
- [GDT_ENTRY_ESPFIX_SS] = GDT_ENTRY_INIT(0xc092, 0, 0xfffff),
- [GDT_ENTRY_PERCPU] = GDT_ENTRY_INIT(0xc092, 0, 0xfffff),
+ [GDT_ENTRY_ESPFIX_SS] = { { { 0x0000ffff, 0x00cf9200 } } },
+ [GDT_ENTRY_PERCPU] = { { { 0x0000ffff, 0x00cf9200 } } },
GDT_STACK_CANARY_INIT
#endif
} };
diff --git a/arch/x86/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index ad9e5ed..93aa009 100644
--- a/arch/x86/kernel/cpu/mtrr/Makefile
+++ b/arch/x86/kernel/cpu/mtrr/Makefile
@@ -1,3 +1,5 @@
obj-y := main.o if.o generic.o cleanup.o
obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
-
+CFLAGS_main.o=-O1
+CFLAGS_cleanup.o=-O1
+CFLAGS_if.o=-O1
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 3d11327..967292f 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -30,3 +30,4 @@ obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o
obj-$(CONFIG_MEMTEST) += memtest.o
+CFLAGS_ioremap.o=-O1
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index bef0bc9..6d0e2bf 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -2,6 +2,17 @@
# Building vDSO images for x86.
#
+KBUILD_CFLAGS = -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
+ -fno-strict-aliasing -fno-common \
+ -Werror-implicit-function-declaration -Wno-format-security \
+ -fno-delete-null-pointer-checks -O2 -mno-red-zone \
+ -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args \
+ -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe \
+ -Wno-sign-compare -fno-asynchronous-unwind-tables \
+ -fno-stack-protector -fomit-frame-pointer \
+ -Wdeclaration-after-statement -Wno-pointer-sign \
+ -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack
+
VDSO64-$(CONFIG_X86_64) := y
VDSO32-$(CONFIG_X86_32) := y
VDSO32-$(CONFIG_COMPAT) := y
@@ -131,7 +142,7 @@ $(obj)/vdso32-syms.lds: $(vdso32.so-y:%=$(obj)/vdso32-%-syms.lds) FORCE
# The DSO images are built using a special linker script.
#
quiet_cmd_vdso = VDSO $@
- cmd_vdso = $(CC) -nostdlib -o $@ \
+ cmd_vdso = gcc -nostdlib -o $@ \
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index 301bd2d..99777c2 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -46,3 +46,5 @@ acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
utstate.o utmutex.o utobject.o utresrc.o utlock.o utids.o \
utosi.o utxferror.o utdecode.o
+
+CFLAGS_tbutils.o=-no-ip
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 7a00672..e82d181 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -63,3 +63,5 @@ obj-$(CONFIG_RAMOOPS) += ramoops.o
obj-$(CONFIG_JS_RTC) += js-rtc.o
js-rtc-y = rtc.o
+
+CFLAGS_vt.o=-O1
diff --git a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile
index 8eb56e2..7f1318e 100644
--- a/drivers/char/agp/Makefile
+++ b/drivers/char/agp/Makefile
@@ -20,3 +20,5 @@ obj-$(CONFIG_AGP_SIS) += sis-agp.o
obj-$(CONFIG_AGP_SWORKS) += sworks-agp.o
obj-$(CONFIG_AGP_UNINORTH) += uninorth-agp.o
obj-$(CONFIG_AGP_VIA) += via-agp.o
+
+CFLAGS_isoch.o=-O1
diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
index a862e91..5b31262 100644
--- a/drivers/video/console/Makefile
+++ b/drivers/video/console/Makefile
@@ -39,3 +39,7 @@ obj-$(CONFIG_FB_STI) += sticore.o font.o
ifeq ($(CONFIG_USB_SISUSBVGA_CON),y)
obj-$(CONFIG_USB_SISUSBVGA) += font.o
endif
+
+CFLAGS_fbcon.o=-O1
+CFLAGS_bitblit.o=-O1
+CFLAGS_softcursor.o=-O1
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index 005d524..63478be 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -15,3 +15,8 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o
cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o
+
+CFLAGS_cifs_unicode.o=-no-vec
+CFLAGS_inode.o=-no-vec
+CFLAGS_md4.o=-no-vec
+CFLAGS_smbdes.o=-no-vec
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 61abb63..0ff0d82 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1534,7 +1534,7 @@ static int compat_ioctl_check_table(unsigned int xcmd)
int i;
const int max = ARRAY_SIZE(ioctl_pointer) - 1;
- BUILD_BUG_ON(max >= (1 << 16));
+ MAYBE_BUILD_BUG_ON(max >= (1 << 16));
/* guess initial offset into table, assuming a
normalized distribution */
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index 0410946..885ac23 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -12,3 +12,5 @@ ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \
ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o
ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o
+
+CFLAGS_hash.o=-O1
diff --git a/fs/fuse/Makefile b/fs/fuse/Makefile
index e95eeb4..2f783f4 100644
--- a/fs/fuse/Makefile
+++ b/fs/fuse/Makefile
@@ -6,3 +6,6 @@ obj-$(CONFIG_FUSE_FS) += fuse.o
obj-$(CONFIG_CUSE) += cuse.o
fuse-objs := dev.o dir.o file.o inode.o control.o
+
+CFLAGS_dev.o=-O1
+CFLAGS_file.o=-O1
diff --git a/init/Kconfig b/init/Kconfig
index 412c21b..1741774 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -901,13 +901,89 @@ source "usr/Kconfig"
endif
-config CC_OPTIMIZE_FOR_SIZE
- bool "Optimize for size"
+config CC_IP
+ bool "Enable -ip for icc compiler"
help
- Enabling this option will pass "-Os" instead of "-O2" to gcc
- resulting in a smaller kernel.
+ Enabling this option will pass "-ip" to icc.
- If unsure, say Y.
+ If unsure, say N.
+
+config CC_IPO
+ bool "Enable -ipo for icc compiler"
+ default n
+ help
+ Enabling this option will pass "-ipo1" to icc.
+
+ If unsure, say N.
+
+choice
+ prompt "Select compiler optimization level"
+ default CC_OPTIMIZE_WITH_O1
+ help
+ Choose from several optimization levels supported by the Intel
+ compiler including -O1, -Os, -O2, and -O3.
+
+config CC_OPTIMIZE_WITH_O1
+ bool "-O1"
+ help
+ Enable -O1 optimization.
+
+config CC_OPTIMIZE_WITH_Os
+ bool "-Os"
+ help
+ Enable -Os optimization.
+
+config CC_OPTIMIZE_WITH_O2
+ bool "-O2"
+ help
+ Enable -O2 optimization.
+
+config CC_OPTIMIZE_WITH_O3
+ bool "-O3"
+ help
+ Enable -O3 optimization.
+
+endchoice
+
+choice
+ prompt "Select Vectorization Diagnostic Information"
+ default CC_VEC_REPORT_1
+ help
+ Print vectorizer diagnostic information
+
+config CC_VEC_REPORT_0
+ bool "0"
+ help
+ Print no diagnostic information
+
+config CC_VEC_REPORT_1
+ bool "1"
+ help
+ Print vectorized loops
+
+config CC_VEC_REPORT_2
+ bool "2"
+ help
+ Print vectorized/non-vectorized loops
+
+config CC_VEC_REPORT_3
+ bool "3"
+ help
+ Print vectorized/non-vectorized loops and prohibiting
+ data dependence information
+
+config CC_VEC_REPORT_4
+ bool "4"
+ help
+ Print non-vectorized loops
+
+config CC_VEC_REPORT_5
+ bool "5"
+ help
+ Print non-vectorized loops and prohibiting data
+ dependence information
+
+endchoice
config SYSCTL
bool
diff --git a/kernel/Makefile b/kernel/Makefile
index 2d64cfc..093f437 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -138,3 +138,9 @@ quiet_cmd_timeconst = TIMEC $@
targets += timeconst.h
$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
$(call if_changed,timeconst)
+
+CFLAGS_pid.o=-O1
+CFLAGS_groups.o=-O1
+CFLAGS_cgroup.o=-O1
+CFLAGS_range.o=-O1
+CFLAGS_user.o=-O1
diff --git a/lib/Makefile b/lib/Makefile
index 6b597fd..fb300cf 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -122,3 +122,5 @@ quiet_cmd_crc32 = GEN $@
$(obj)/crc32table.h: $(obj)/gen_crc32table
$(call cmd,crc32)
+
+CFLAGS_swiotlb.o=-no-vec
diff --git a/lib/zlib_inflate/Makefile b/lib/zlib_inflate/Makefile
index 49f8ce5..24cfe82 100644
--- a/lib/zlib_inflate/Makefile
+++ b/lib/zlib_inflate/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate.o
zlib_inflate-objs := inffast.o inflate.o infutil.o \
inftrees.o inflate_syms.o
+
+CFLAGS_inftrees.o=-O1
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index f5ce87b..8175469 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -363,6 +363,120 @@ int zlib_inflate(z_streamp strm, int flush)
ret = Z_OK;
for (;;)
switch (state->mode) {
+#ifdef HANDLE_ICC
+ case HEAD:
+ if (state->wrap == 0) {
+ state->mode = TYPEDO;
+ break;
+ }
+ case TYPE:
+ if (flush == Z_BLOCK) goto inf_leave;
+ case TYPEDO:
+ if (state->last) {
+ BYTEBITS();
+ state->mode = CHECK;
+ break;
+ }
+ NEEDBITS(3);
+ state->last = BITS(1);
+ DROPBITS(1);
+ state->mode = TABLE;
+ DROPBITS(2);
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+ state->have = 0;
+ state->mode = LENLENS;
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ state->lencode = (code const *)(state->next);
+ state->lenbits = 7;
+ ret = zlib_inflate_table(CODES, state->lens, 19, &(state->next),
+ &(state->lenbits), state->work);
+ state->have = 0;
+ state->mode = CODELENS;
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ this = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(this.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (this.val < 16) {
+ NEEDBITS(this.bits);
+ DROPBITS(this.bits);
+ state->lens[state->have++] = this.val;
+ }
+ else {
+ if (this.val == 16) {
+ NEEDBITS(this.bits + 2);
+ DROPBITS(this.bits);
+ len = state->lens[state->have - 1];
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (this.val == 17) {
+ NEEDBITS(this.bits + 3);
+ DROPBITS(this.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(this.bits + 7);
+ DROPBITS(this.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* build code tables */
+ state->next = state->codes;
+ state->lencode = (code const *)(state->next);
+ state->lenbits = 9;
+ ret = zlib_inflate_table(LENS, state->lens, state->nlen, &(state->next),
+ &(state->lenbits), state->work);
+ state->distcode = (code const *)(state->next);
+ state->distbits = 6;
+ ret = zlib_inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+ &(state->next), &(state->distbits), state->work);
+ state->mode = LEN;
+ RESTORE();
+ inflate_fast(strm, out);
+ LOAD();
+ break;
+ case CHECK:
+ if (state->wrap) {
+ NEEDBITS(32);
+ out -= left;
+ strm->total_out += out;
+ state->total += out;
+ if (out)
+ strm->adler = state->check =
+ UPDATE(state->check, put - out, out);
+ out = left;
+ INITBITS();
+ }
+ state->mode = DONE;
+ ret = Z_STREAM_END;
+ goto inf_leave;
+ default:
+ return Z_STREAM_ERROR;
+ }
+#else
case HEAD:
if (state->wrap == 0) {
state->mode = TYPEDO;
@@ -720,6 +834,7 @@ int zlib_inflate(z_streamp strm, int flush)
case SYNC:
default:
return Z_STREAM_ERROR;
+#endif
}
/*
diff --git a/mm/Makefile b/mm/Makefile
index 836e416..152137a 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -50,3 +50,5 @@ obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o
obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o
obj-$(CONFIG_CLEANCACHE) += cleancache.o
+
+CFLAGS_slab.o=-O1
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1d34d75..d5fc20a 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -743,6 +743,8 @@ static bool vmap_initialized __read_mostly = false;
struct vmap_block_queue {
spinlock_t lock;
struct list_head free;
+ struct list_head dirty;
+ unsigned int nr_dirty;
};
struct vmap_block {
@@ -1168,6 +1170,8 @@ void __init vmalloc_init(void)
vbq = &per_cpu(vmap_block_queue, i);
spin_lock_init(&vbq->lock);
INIT_LIST_HEAD(&vbq->free);
+ INIT_LIST_HEAD(&vbq->dirty);
+ vbq->nr_dirty = 0;
}
/* Import existing vmlist entries. */
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 686934a..c6c14bb 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -40,3 +40,5 @@ obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
obj-y += addrconf_core.o exthdrs_core.o
obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
+
+CFLAGS_addrconf.o=-O1
diff --git a/net/xfrm/Makefile b/net/xfrm/Makefile
index aa429ee..1d88cc2 100644
--- a/net/xfrm/Makefile
+++ b/net/xfrm/Makefile
@@ -8,3 +8,5 @@ obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_hash.o \
obj-$(CONFIG_XFRM_STATISTICS) += xfrm_proc.o
obj-$(CONFIG_XFRM_USER) += xfrm_user.o
obj-$(CONFIG_XFRM_IPCOMP) += xfrm_ipcomp.o
+
+CFLAGS_xfrm_policy.o=-O1
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a0fd502..f9d81d3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -417,7 +417,7 @@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
quiet_cmd_link_multi-m = LD [M] $@
-cmd_link_multi-m = $(cmd_link_multi-y)
+cmd_link_multi-m = $(cmd_link_multi-y) /usr/lib/libirc_s.a
# We would rather have a list of rules like
# foo.o: $(foo-objs)
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 56dfafc..a4f2b10 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -119,7 +119,7 @@ targets += $(modules:.ko=.mod.o)
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
- -o $@ $(filter-out FORCE,$^)
+ -o $@ $(filter-out FORCE,$^) /usr/lib/libirc_s.a
$(modules): %.ko :%.o %.mod.o FORCE
$(call if_changed,ld_ko_o)
diff --git a/sound/core/Makefile b/sound/core/Makefile
index 350a08d..ffc4e31 100644
--- a/sound/core/Makefile
+++ b/sound/core/Makefile
@@ -31,3 +31,5 @@ obj-$(CONFIG_SND_RAWMIDI) += snd-rawmidi.o
obj-$(CONFIG_SND_OSSEMUL) += oss/
obj-$(CONFIG_SND_SEQUENCER) += seq/
+
+CFLAGS_pcm_native.o=-O1
--
1.7.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment