From: S.Çağlar Onur Date: Wed, 22 Dec 2010 17:23:12 +0000 (-0500) Subject: try (#1) to solve gcc 4.5 miscompilation related boot problems X-Git-Tag: linux-2.6-32-5~1 X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=commitdiff_plain;h=a10f49771d83503aff8a77cde3a54764f2510f57 try (#1) to solve gcc 4.5 miscompilation related boot problems --- diff --git a/kernel-2.6.spec b/kernel-2.6.spec index 25635e182..b1cc407a2 100644 --- a/kernel-2.6.spec +++ b/kernel-2.6.spec @@ -682,6 +682,7 @@ Patch18: linux-2.6-650-hangcheck-reboot.patch Patch19: linux-2.6-660-nmi-watchdog-default.patch Patch20: linux-2.6-680-htb-hysteresis-tso.patch +Patch10000: linux-2.6-10000-gcc-4.5.patch # empty final patch file to facilitate testing of kernel patches Patch999999: linux-kernel-test.patch @@ -977,6 +978,7 @@ ApplyPatch linux-2.6-640-netlink-audit-hack.patch ApplyPatch linux-2.6-650-hangcheck-reboot.patch ApplyPatch linux-2.6-660-nmi-watchdog-default.patch ApplyPatch linux-2.6-680-htb-hysteresis-tso.patch +ApplyPatch linux-2.6-10000-gcc-4.5.patch #### Planet-Lab #### ApplyOptionalPatch linux-kernel-test.patch diff --git a/linux-2.6-10000-gcc-4.5.patch b/linux-2.6-10000-gcc-4.5.patch new file mode 100644 index 000000000..18cb984c4 --- /dev/null +++ b/linux-2.6-10000-gcc-4.5.patch @@ -0,0 +1,65 @@ +diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h +index f08f973..e0fbf29 100644 +--- a/arch/x86/include/asm/system.h ++++ b/arch/x86/include/asm/system.h +@@ -449,7 +449,7 @@ void stop_this_cpu(void *dummy); + * + * (Could use an alternative three way for this if there was one.) + */ +-static inline void rdtsc_barrier(void) ++static __always_inline void rdtsc_barrier(void) + { + alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC); + alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); +diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h +index 71c9050..3e35002 100644 +--- a/include/linux/syscalls.h ++++ b/include/linux/syscalls.h +@@ -154,7 +154,8 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ + #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) + + #define SYSCALL_TRACE_ENTER_EVENT(sname) \ +- static struct ftrace_event_call event_enter_##sname; \ ++ static struct ftrace_event_call \ ++ __attribute__((__aligned__(4))) event_enter_##sname; \ + struct trace_event enter_syscall_print_##sname = { \ + .trace = print_syscall_enter, \ + }; \ +@@ -190,7 +191,8 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ + } + + #define SYSCALL_TRACE_EXIT_EVENT(sname) \ +- static struct ftrace_event_call event_exit_##sname; \ ++ static struct ftrace_event_call \ ++ __attribute__((__aligned__(4))) event_exit_##sname; \ + struct trace_event exit_syscall_print_##sname = { \ + .trace = print_syscall_exit, \ + }; \ +diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h +index bc309b2..f14d954 100644 +--- a/include/trace/ftrace.h ++++ b/include/trace/ftrace.h +@@ -65,7 +65,8 @@ + }; + #undef DEFINE_EVENT + #define DEFINE_EVENT(template, name, proto, args) \ +- static struct ftrace_event_call event_##name ++ static struct ftrace_event_call \ ++ __attribute__((__aligned__(4))) event_##name + + #undef DEFINE_EVENT_PRINT + #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 6167a38..1ad2d01 100644 +--- a/kernel/trace/trace.h ++++ b/kernel/trace/trace.h +@@ -760,7 +760,8 @@ extern const char *__stop___trace_bprintk_fmt[]; + + #undef FTRACE_ENTRY + #define FTRACE_ENTRY(call, struct_name, id, tstruct, print) \ +- extern struct ftrace_event_call event_##call; ++ extern struct ftrace_event_call \ ++ __attribute__((__aligned__(4))) event_##call; + #undef FTRACE_ENTRY_DUP + #define FTRACE_ENTRY_DUP(call, struct_name, id, tstruct, print) \ + FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print))