Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+[ removed cris changes - gregkh]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- arch/arc/include/asm/bug.h | 3 ++-
- arch/cris/include/arch-v10/arch/bug.h | 11 +++++++++--
- arch/ia64/include/asm/bug.h | 6 +++++-
- arch/m68k/include/asm/bug.h | 3 +++
- arch/sparc/include/asm/bug.h | 6 +++++-
- include/asm-generic/bug.h | 1 +
- include/linux/compiler-gcc.h | 15 ++++++++++++++-
- include/linux/compiler.h | 5 +++++
- 8 files changed, 44 insertions(+), 6 deletions(-)
+ arch/arc/include/asm/bug.h | 3 ++-
+ arch/ia64/include/asm/bug.h | 6 +++++-
+ arch/m68k/include/asm/bug.h | 3 +++
+ arch/sparc/include/asm/bug.h | 6 +++++-
+ include/asm-generic/bug.h | 1 +
+ include/linux/compiler-gcc.h | 15 ++++++++++++++-
+ include/linux/compiler.h | 5 +++++
+ 7 files changed, 35 insertions(+), 4 deletions(-)
-diff --git a/arch/arc/include/asm/bug.h b/arch/arc/include/asm/bug.h
-index ea022d47896c..21ec82466d62 100644
--- a/arch/arc/include/asm/bug.h
+++ b/arch/arc/include/asm/bug.h
-@@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs *regs, unsigned long address);
+@@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs
#define BUG() do { \
pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
} while (0)
#define HAVE_ARCH_BUG
-diff --git a/arch/cris/include/arch-v10/arch/bug.h b/arch/cris/include/arch-v10/arch/bug.h
-index 3485d6b34bb0..06701ac0596f 100644
---- a/arch/cris/include/arch-v10/arch/bug.h
-+++ b/arch/cris/include/arch-v10/arch/bug.h
-@@ -43,18 +43,25 @@ struct bug_frame {
- * not be used like this with newer versions of gcc.
- */
- #define BUG() \
-+do { \
- __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
- "movu.w " __stringify(__LINE__) ",$r0\n\t"\
- "jump 0f\n\t" \
- ".section .rodata\n" \
- "0:\t.string \"" __FILE__ "\"\n\t" \
-- ".previous")
-+ ".previous"); \
-+ unreachable(); \
-+} while (0)
- #endif
-
- #else
-
- /* This just causes an oops. */
--#define BUG() (*(int *)0 = 0)
-+#define BUG() \
-+do { \
-+ barrier_before_unreachable(); \
-+ __builtin_trap(); \
-+} while (0)
-
- #endif
-
-diff --git a/arch/ia64/include/asm/bug.h b/arch/ia64/include/asm/bug.h
-index 823616b5020b..19067821249f 100644
--- a/arch/ia64/include/asm/bug.h
+++ b/arch/ia64/include/asm/bug.h
@@ -3,7 +3,11 @@
/* should this BUG be made generic? */
#define HAVE_ARCH_BUG
-diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h
-index ef9a2e47352f..21ddbf925e22 100644
--- a/arch/m68k/include/asm/bug.h
+++ b/arch/m68k/include/asm/bug.h
@@ -7,16 +7,19 @@
__builtin_trap(); \
} while (0)
#endif
-diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h
-index eaa8f8d38125..fa85cac0285c 100644
--- a/arch/sparc/include/asm/bug.h
+++ b/arch/sparc/include/asm/bug.h
@@ -8,10 +8,14 @@
#endif
#define HAVE_ARCH_BUG
-diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
-index 630dd2372238..09aa521a0085 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -47,6 +47,7 @@ struct bug_entry {
panic("BUG!"); \
} while (0)
#endif
-diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
-index 143d40e8a1ea..af8b4a879934 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
-@@ -206,6 +206,15 @@
- #endif /* GCC_VERSION >= 40300 */
+@@ -207,6 +207,15 @@
#if GCC_VERSION >= 40500
-+/*
+ /*
+ * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
+ * confuse the stack allocation in gcc, leading to overly large stack
+ * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
+ */
+#define barrier_before_unreachable() asm volatile("")
+
- /*
++/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
@@ -215,7 +224,11 @@
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
-diff --git a/include/linux/compiler.h b/include/linux/compiler.h
-index 0db1fa621d8a..ed772311ec1f 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
-@@ -175,6 +175,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
+@@ -175,6 +175,11 @@ void ftrace_likely_update(struct ftrace_
# define barrier_data(ptr) barrier()
#endif
/* Unreachable code */
#ifndef unreachable
# define unreachable() do { } while (1)
---
-2.20.1
-
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- include/linux/swiotlb.h | 3 +++
+ include/linux/swiotlb.h | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
-index e7a018eaf3a2..017fced60242 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -1,10 +1,13 @@
struct scatterlist;
extern int swiotlb_force;
---
-2.20.1
-
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+[removed cris chunks - gregkh]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- arch/arc/include/asm/bug.h | 3 ++-
- arch/cris/include/arch-v10/arch/bug.h | 11 +++++++++--
- arch/ia64/include/asm/bug.h | 6 +++++-
- arch/m68k/include/asm/bug.h | 3 +++
- arch/sparc/include/asm/bug.h | 6 +++++-
- include/asm-generic/bug.h | 1 +
- include/linux/compiler-gcc.h | 15 ++++++++++++++-
- include/linux/compiler.h | 5 +++++
- 8 files changed, 44 insertions(+), 6 deletions(-)
+ arch/arc/include/asm/bug.h | 3 ++-
+ arch/ia64/include/asm/bug.h | 6 +++++-
+ arch/m68k/include/asm/bug.h | 3 +++
+ arch/sparc/include/asm/bug.h | 6 +++++-
+ include/asm-generic/bug.h | 1 +
+ include/linux/compiler-gcc.h | 15 ++++++++++++++-
+ include/linux/compiler.h | 5 +++++
+ 7 files changed, 35 insertions(+), 4 deletions(-)
-diff --git a/arch/arc/include/asm/bug.h b/arch/arc/include/asm/bug.h
-index ea022d47896c..21ec82466d62 100644
--- a/arch/arc/include/asm/bug.h
+++ b/arch/arc/include/asm/bug.h
-@@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs *regs, unsigned long address);
+@@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs
#define BUG() do { \
pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
} while (0)
#define HAVE_ARCH_BUG
-diff --git a/arch/cris/include/arch-v10/arch/bug.h b/arch/cris/include/arch-v10/arch/bug.h
-index 3485d6b34bb0..06701ac0596f 100644
---- a/arch/cris/include/arch-v10/arch/bug.h
-+++ b/arch/cris/include/arch-v10/arch/bug.h
-@@ -43,18 +43,25 @@ struct bug_frame {
- * not be used like this with newer versions of gcc.
- */
- #define BUG() \
-+do { \
- __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
- "movu.w " __stringify(__LINE__) ",$r0\n\t"\
- "jump 0f\n\t" \
- ".section .rodata\n" \
- "0:\t.string \"" __FILE__ "\"\n\t" \
-- ".previous")
-+ ".previous"); \
-+ unreachable(); \
-+} while (0)
- #endif
-
- #else
-
- /* This just causes an oops. */
--#define BUG() (*(int *)0 = 0)
-+#define BUG() \
-+do { \
-+ barrier_before_unreachable(); \
-+ __builtin_trap(); \
-+} while (0)
-
- #endif
-
-diff --git a/arch/ia64/include/asm/bug.h b/arch/ia64/include/asm/bug.h
-index 823616b5020b..19067821249f 100644
--- a/arch/ia64/include/asm/bug.h
+++ b/arch/ia64/include/asm/bug.h
@@ -3,7 +3,11 @@
/* should this BUG be made generic? */
#define HAVE_ARCH_BUG
-diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h
-index ef9a2e47352f..21ddbf925e22 100644
--- a/arch/m68k/include/asm/bug.h
+++ b/arch/m68k/include/asm/bug.h
@@ -7,16 +7,19 @@
__builtin_trap(); \
} while (0)
#endif
-diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h
-index eaa8f8d38125..fa85cac0285c 100644
--- a/arch/sparc/include/asm/bug.h
+++ b/arch/sparc/include/asm/bug.h
@@ -8,10 +8,14 @@
#endif
#define HAVE_ARCH_BUG
-diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
-index 6f96247226a4..89f079d6b41b 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -47,6 +47,7 @@ struct bug_entry {
panic("BUG!"); \
} while (0)
#endif
-diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
-index 8e9b0cb8db41..61650c1830d4 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
-@@ -233,6 +233,15 @@
- #define annotate_unreachable()
+@@ -234,6 +234,15 @@
#endif
-+/*
+ /*
+ * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
+ * confuse the stack allocation in gcc, leading to overly large stack
+ * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
+ */
+#define barrier_before_unreachable() asm volatile("")
+
- /*
++/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
@@ -243,7 +252,11 @@
* unreleased. Really, we need to have autoconf for the kernel.
*/
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
-diff --git a/include/linux/compiler.h b/include/linux/compiler.h
-index 4f3dfabb680f..80a5bc623c47 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
-@@ -177,6 +177,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
+@@ -177,6 +177,11 @@ void ftrace_likely_update(struct ftrace_
# define barrier_data(ptr) barrier()
#endif
/* Unreachable code */
#ifndef unreachable
# define unreachable() do { } while (1)
---
-2.20.1
-