Skip to content

Commit be7635e

Browse files
ramosian-glidertorvalds
authored andcommitted
arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections
KASAN needs to know whether the allocation happens in an IRQ handler. This lets us strip everything below the IRQ entry point to reduce the number of unique stack traces needed to be stored. Move the definition of __irq_entry to <linux/interrupt.h> so that the users don't need to pull in <linux/ftrace.h>. Also introduce the __softirq_entry macro which is similar to __irq_entry, but puts the corresponding functions to the .softirqentry.text section. Signed-off-by: Alexander Potapenko <glider@google.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Andrey Konovalov <adech.fo@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Konstantin Serebryany <kcc@google.com> Cc: Dmitry Chernenkov <dmitryc@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 505f5dc commit be7635e

File tree

23 files changed

+51
-15
lines changed

23 files changed

+51
-15
lines changed

arch/arm/include/asm/exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef __ASM_ARM_EXCEPTION_H
88
#define __ASM_ARM_EXCEPTION_H
99

10-
#include <linux/ftrace.h>
10+
#include <linux/interrupt.h>
1111

1212
#define __exception __attribute__((section(".exception.text")))
1313
#ifdef CONFIG_FUNCTION_GRAPH_TRACER

arch/arm/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ SECTIONS
108108
*(.exception.text)
109109
__exception_text_end = .;
110110
IRQENTRY_TEXT
111+
SOFTIRQENTRY_TEXT
111112
TEXT_TEXT
112113
SCHED_TEXT
113114
LOCK_TEXT

arch/arm64/include/asm/exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifndef __ASM_EXCEPTION_H
1919
#define __ASM_EXCEPTION_H
2020

21-
#include <linux/ftrace.h>
21+
#include <linux/interrupt.h>
2222

2323
#define __exception __attribute__((section(".exception.text")))
2424
#ifdef CONFIG_FUNCTION_GRAPH_TRACER

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ SECTIONS
103103
*(.exception.text)
104104
__exception_text_end = .;
105105
IRQENTRY_TEXT
106+
SOFTIRQENTRY_TEXT
106107
TEXT_TEXT
107108
SCHED_TEXT
108109
LOCK_TEXT

arch/blackfin/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ SECTIONS
3535
#endif
3636
LOCK_TEXT
3737
IRQENTRY_TEXT
38+
SOFTIRQENTRY_TEXT
3839
KPROBES_TEXT
3940
#ifdef CONFIG_ROMKERNEL
4041
__sinittext = .;

arch/c6x/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ SECTIONS
7272
SCHED_TEXT
7373
LOCK_TEXT
7474
IRQENTRY_TEXT
75+
SOFTIRQENTRY_TEXT
7576
KPROBES_TEXT
7677
*(.fixup)
7778
*(.gnu.warning)

arch/metag/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SECTIONS
2424
LOCK_TEXT
2525
KPROBES_TEXT
2626
IRQENTRY_TEXT
27+
SOFTIRQENTRY_TEXT
2728
*(.text.*)
2829
*(.gnu.warning)
2930
}

arch/microblaze/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ SECTIONS {
3636
LOCK_TEXT
3737
KPROBES_TEXT
3838
IRQENTRY_TEXT
39+
SOFTIRQENTRY_TEXT
3940
. = ALIGN (4) ;
4041
_etext = . ;
4142
}

arch/mips/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ SECTIONS
5858
LOCK_TEXT
5959
KPROBES_TEXT
6060
IRQENTRY_TEXT
61+
SOFTIRQENTRY_TEXT
6162
*(.text.*)
6263
*(.fixup)
6364
*(.gnu.warning)

arch/nios2/kernel/vmlinux.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SECTIONS
3939
SCHED_TEXT
4040
LOCK_TEXT
4141
IRQENTRY_TEXT
42+
SOFTIRQENTRY_TEXT
4243
KPROBES_TEXT
4344
} =0
4445
_etext = .;

0 commit comments

Comments
 (0)