mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
parisc: Reduce size of the bug_table on 64-bit kernel by half
[ Upstream commit 43266838515d30dc0c45d5c7e6e7edacee6cce92 ] Enable GENERIC_BUG_RELATIVE_POINTERS which will store 32-bit relative offsets to the bug address and the source file name instead of 64-bit absolute addresses. This effectively reduces the size of the bug_table[] array by half on 64-bit kernels. Signed-off-by: Helge Deller <deller@gmx.de> Stable-dep-of: 487635756198 ("parisc: Fix asm operand number out of range build error in bug table") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8479f5ca8b
commit
f9e9e156db
@@ -105,9 +105,12 @@ config ARCH_HAS_ILOG2_U64
|
|||||||
default n
|
default n
|
||||||
|
|
||||||
config GENERIC_BUG
|
config GENERIC_BUG
|
||||||
bool
|
def_bool y
|
||||||
default y
|
|
||||||
depends on BUG
|
depends on BUG
|
||||||
|
select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
|
||||||
|
|
||||||
|
config GENERIC_BUG_RELATIVE_POINTERS
|
||||||
|
bool
|
||||||
|
|
||||||
config GENERIC_HWEIGHT
|
config GENERIC_HWEIGHT
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -17,26 +17,27 @@
|
|||||||
#define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff"
|
#define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff"
|
||||||
#define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */
|
#define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */
|
||||||
|
|
||||||
#if defined(CONFIG_64BIT)
|
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||||
#define ASM_WORD_INSN ".dword\t"
|
# define __BUG_REL(val) ".word " __stringify(val) " - ."
|
||||||
#else
|
#else
|
||||||
#define ASM_WORD_INSN ".word\t"
|
# define __BUG_REL(val) ".word " __stringify(val)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||||
#define BUG() \
|
#define BUG() \
|
||||||
do { \
|
do { \
|
||||||
asm volatile("\n" \
|
asm volatile("\n" \
|
||||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||||
"\t.pushsection __bug_table,\"a\"\n" \
|
"\t.pushsection __bug_table,\"a\"\n" \
|
||||||
"\t.align %4\n" \
|
"\t.align 4\n" \
|
||||||
"2:\t" ASM_WORD_INSN "1b, %c0\n" \
|
"2:\t" __BUG_REL(1b) "\n" \
|
||||||
|
"\t" __BUG_REL(%c0) "\n" \
|
||||||
"\t.short %1, %2\n" \
|
"\t.short %1, %2\n" \
|
||||||
"\t.blockz %3-2*%4-2*2\n" \
|
"\t.blockz %3-2*4-2*2\n" \
|
||||||
"\t.popsection" \
|
"\t.popsection" \
|
||||||
: : "i" (__FILE__), "i" (__LINE__), \
|
: : "i" (__FILE__), "i" (__LINE__), \
|
||||||
"i" (0), "i" (sizeof(struct bug_entry)), \
|
"i" (0), "i" (sizeof(struct bug_entry)) ); \
|
||||||
"i" (sizeof(long)) ); \
|
|
||||||
unreachable(); \
|
unreachable(); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
@@ -54,15 +55,15 @@
|
|||||||
asm volatile("\n" \
|
asm volatile("\n" \
|
||||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||||
"\t.pushsection __bug_table,\"a\"\n" \
|
"\t.pushsection __bug_table,\"a\"\n" \
|
||||||
"\t.align %4\n" \
|
"\t.align 4\n" \
|
||||||
"2:\t" ASM_WORD_INSN "1b, %c0\n" \
|
"2:\t" __BUG_REL(1b) "\n" \
|
||||||
|
"\t" __BUG_REL(%c0) "\n" \
|
||||||
"\t.short %1, %2\n" \
|
"\t.short %1, %2\n" \
|
||||||
"\t.blockz %3-2*%4-2*2\n" \
|
"\t.blockz %3-2*4-2*2\n" \
|
||||||
"\t.popsection" \
|
"\t.popsection" \
|
||||||
: : "i" (__FILE__), "i" (__LINE__), \
|
: : "i" (__FILE__), "i" (__LINE__), \
|
||||||
"i" (BUGFLAG_WARNING|(flags)), \
|
"i" (BUGFLAG_WARNING|(flags)), \
|
||||||
"i" (sizeof(struct bug_entry)), \
|
"i" (sizeof(struct bug_entry)) ); \
|
||||||
"i" (sizeof(long)) ); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
#else
|
#else
|
||||||
#define __WARN_FLAGS(flags) \
|
#define __WARN_FLAGS(flags) \
|
||||||
@@ -71,13 +72,12 @@
|
|||||||
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
"1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
||||||
"\t.pushsection __bug_table,\"a\"\n" \
|
"\t.pushsection __bug_table,\"a\"\n" \
|
||||||
"\t.align %2\n" \
|
"\t.align %2\n" \
|
||||||
"2:\t" ASM_WORD_INSN "1b\n" \
|
"2:\t" __BUG_REL(1b) "\n" \
|
||||||
"\t.short %0\n" \
|
"\t.short %0\n" \
|
||||||
"\t.blockz %1-%2-2\n" \
|
"\t.blockz %1-4-2\n" \
|
||||||
"\t.popsection" \
|
"\t.popsection" \
|
||||||
: : "i" (BUGFLAG_WARNING|(flags)), \
|
: : "i" (BUGFLAG_WARNING|(flags)), \
|
||||||
"i" (sizeof(struct bug_entry)), \
|
"i" (sizeof(struct bug_entry)) ); \
|
||||||
"i" (sizeof(long)) ); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user