File tree Expand file tree Collapse file tree 9 files changed +36
-25
lines changed Expand file tree Collapse file tree 9 files changed +36
-25
lines changed Original file line number Diff line number Diff line change @@ -743,10 +743,19 @@ SYM_CODE_END(asm_\cfunc)
743
743
744
744
/*
745
745
* Include the defines which emit the idt entries which are shared
746
- * shared between 32 and 64 bit.
746
+ * shared between 32 and 64 bit and emit the __irqentry_text_* markers
747
+ * so the stacktrace boundary checks work.
747
748
*/
749
+ .align 16
750
+ .globl __irqentry_text_start
751
+ __irqentry_text_start:
752
+
748
753
#include <asm/idtentry.h>
749
754
755
+ .align 16
756
+ .globl __irqentry_text_end
757
+ __irqentry_text_end:
758
+
750
759
/*
751
760
* %eax: prev task
752
761
* %edx: next task
Original file line number Diff line number Diff line change @@ -478,10 +478,19 @@ SYM_CODE_END(\asmsym)
478
478
479
479
/*
480
480
* Include the defines which emit the idt entries which are shared
481
- * shared between 32 and 64 bit.
481
+ * shared between 32 and 64 bit and emit the __irqentry_text_* markers
482
+ * so the stacktrace boundary checks work.
482
483
*/
484
+ .align 16
485
+ .globl __irqentry_text_start
486
+ __irqentry_text_start:
487
+
483
488
#include <asm/idtentry.h>
484
489
490
+ .align 16
491
+ .globl __irqentry_text_end
492
+ __irqentry_text_end:
493
+
485
494
SYM_CODE_START_LOCAL (common_interrupt_return)
486
495
SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
487
496
#ifdef CONFIG_DEBUG_ENTRY
Original file line number Diff line number Diff line change 11
11
#include <asm/apicdef.h>
12
12
#include <asm/irq_vectors.h>
13
13
14
+ /*
15
+ * The irq entry code is in the noinstr section and the start/end of
16
+ * __irqentry_text is emitted via labels. Make the build fail if
17
+ * something moves a C function into the __irq_entry section.
18
+ */
19
+ #define __irq_entry __invalid_section
20
+
14
21
static inline int irq_canonicalize (int irq )
15
22
{
16
23
return ((irq == 2 ) ? 9 : irq );
Original file line number Diff line number Diff line change @@ -1073,13 +1073,6 @@ NOKPROBE_SYMBOL(kprobe_fault_handler);
1073
1073
1074
1074
int __init arch_populate_kprobe_blacklist (void )
1075
1075
{
1076
- int ret ;
1077
-
1078
- ret = kprobe_add_area_blacklist ((unsigned long )__irqentry_text_start ,
1079
- (unsigned long )__irqentry_text_end );
1080
- if (ret )
1081
- return ret ;
1082
-
1083
1076
return kprobe_add_area_blacklist ((unsigned long )__entry_text_start ,
1084
1077
(unsigned long )__entry_text_end );
1085
1078
}
Original file line number Diff line number Diff line change @@ -286,9 +286,7 @@ static int can_optimize(unsigned long paddr)
286
286
* stack handling and registers setup.
287
287
*/
288
288
if (((paddr >= (unsigned long )__entry_text_start ) &&
289
- (paddr < (unsigned long )__entry_text_end )) ||
290
- ((paddr >= (unsigned long )__irqentry_text_start ) &&
291
- (paddr < (unsigned long )__irqentry_text_end )))
289
+ (paddr < (unsigned long )__entry_text_end )))
292
290
return 0 ;
293
291
294
292
/* Check there is enough space for a relative jump. */
Original file line number Diff line number Diff line change @@ -74,13 +74,7 @@ static bool in_entry_code(unsigned long ip)
74
74
{
75
75
char * addr = (char * )ip ;
76
76
77
- if (addr >= __entry_text_start && addr < __entry_text_end )
78
- return true;
79
-
80
- if (addr >= __irqentry_text_start && addr < __irqentry_text_end )
81
- return true;
82
-
83
- return false;
77
+ return addr >= __entry_text_start && addr < __entry_text_end ;
84
78
}
85
79
86
80
static inline unsigned long * last_frame (struct unwind_state * state )
Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ SECTIONS
134
134
KPROBES_TEXT
135
135
ALIGN_ENTRY_TEXT_BEGIN
136
136
ENTRY_TEXT
137
- IRQENTRY_TEXT
138
137
ALIGN_ENTRY_TEXT_END
139
138
SOFTIRQENTRY_TEXT
140
139
*(.fixup)
Original file line number Diff line number Diff line change @@ -492,12 +492,12 @@ static void __init pti_setup_espfix64(void)
492
492
}
493
493
494
494
/*
495
- * Clone the populated PMDs of the entry and irqentry text and force it RO.
495
+ * Clone the populated PMDs of the entry text and force it RO.
496
496
*/
497
497
static void pti_clone_entry_text (void )
498
498
{
499
499
pti_clone_pgtable ((unsigned long ) __entry_text_start ,
500
- (unsigned long ) __irqentry_text_end ,
500
+ (unsigned long ) __entry_text_end ,
501
501
PTI_CLONE_PMD );
502
502
}
503
503
Original file line number Diff line number Diff line change @@ -760,8 +760,10 @@ extern int arch_early_irq_init(void);
760
760
/*
761
761
* We want to know which function is an entrypoint of a hardirq or a softirq.
762
762
*/
763
- #define __irq_entry __attribute__((__section__(".irqentry.text")))
764
- #define __softirq_entry \
765
- __attribute__((__section__(".softirqentry.text")))
763
+ #ifndef __irq_entry
764
+ # define __irq_entry __attribute__((__section__(".irqentry.text")))
765
+ #endif
766
+
767
+ #define __softirq_entry __attribute__((__section__(".softirqentry.text")))
766
768
767
769
#endif
You can’t perform that action at this time.
0 commit comments