File tree Expand file tree Collapse file tree 3 files changed +4
-41
lines changed Expand file tree Collapse file tree 3 files changed +4
-41
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void);
120
120
121
121
extern void ist_enter (struct pt_regs * regs );
122
122
extern void ist_exit (struct pt_regs * regs );
123
- extern void ist_begin_non_atomic (struct pt_regs * regs );
124
- extern void ist_end_non_atomic (void );
125
123
126
124
#ifdef CONFIG_VMAP_STACK
127
125
void __noreturn handle_stack_overflow (const char * message ,
Original file line number Diff line number Diff line change @@ -1352,13 +1352,15 @@ void notrace do_machine_check(struct pt_regs *regs, long error_code)
1352
1352
1353
1353
/* Fault was in user mode and we need to take some action */
1354
1354
if ((m .cs & 3 ) == 3 ) {
1355
- ist_begin_non_atomic (regs );
1355
+ /* If this triggers there is no way to recover. Die hard. */
1356
+ BUG_ON (!on_thread_stack () || !user_mode (regs ));
1356
1357
local_irq_enable ();
1358
+ preempt_enable ();
1357
1359
1358
1360
if (kill_it || do_memory_failure (& m ))
1359
1361
force_sig (SIGBUS );
1362
+ preempt_disable ();
1360
1363
local_irq_disable ();
1361
- ist_end_non_atomic ();
1362
1364
} else {
1363
1365
if (!fixup_exception (regs , X86_TRAP_MC , error_code , 0 ))
1364
1366
mce_panic ("Failed kernel mode recovery" , & m , msg );
Original file line number Diff line number Diff line change @@ -117,43 +117,6 @@ void ist_exit(struct pt_regs *regs)
117
117
rcu_nmi_exit ();
118
118
}
119
119
120
- /**
121
- * ist_begin_non_atomic() - begin a non-atomic section in an IST exception
122
- * @regs: regs passed to the IST exception handler
123
- *
124
- * IST exception handlers normally cannot schedule. As a special
125
- * exception, if the exception interrupted userspace code (i.e.
126
- * user_mode(regs) would return true) and the exception was not
127
- * a double fault, it can be safe to schedule. ist_begin_non_atomic()
128
- * begins a non-atomic section within an ist_enter()/ist_exit() region.
129
- * Callers are responsible for enabling interrupts themselves inside
130
- * the non-atomic section, and callers must call ist_end_non_atomic()
131
- * before ist_exit().
132
- */
133
- void ist_begin_non_atomic (struct pt_regs * regs )
134
- {
135
- BUG_ON (!user_mode (regs ));
136
-
137
- /*
138
- * Sanity check: we need to be on the normal thread stack. This
139
- * will catch asm bugs and any attempt to use ist_preempt_enable
140
- * from double_fault.
141
- */
142
- BUG_ON (!on_thread_stack ());
143
-
144
- preempt_enable_no_resched ();
145
- }
146
-
147
- /**
148
- * ist_end_non_atomic() - begin a non-atomic section in an IST exception
149
- *
150
- * Ends a non-atomic section started with ist_begin_non_atomic().
151
- */
152
- void ist_end_non_atomic (void )
153
- {
154
- preempt_disable ();
155
- }
156
-
157
120
int is_valid_bugaddr (unsigned long addr )
158
121
{
159
122
unsigned short ud ;
You can’t perform that action at this time.
0 commit comments