Skip to content

Commit 5938930

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Benjamin Herrenschmidt: "So here are 3 fixes still for 3.10. Fixes are simple, bugs are nasty (though not recent regressions, nasty enough) and all targeted at stable" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: Fix missing/delayed calls to irq_work powerpc: Fix emulation of illegal instructions on PowerNV platform powerpc: Fix stack overflow crash in resume_kernel when ftracing
2 parents f21afc2 + 230b303 commit 5938930

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

arch/powerpc/include/asm/exception-64s.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ label##_common: \
513513
*/
514514
#define STD_EXCEPTION_COMMON_ASYNC(trap, label, hdlr) \
515515
EXCEPTION_COMMON(trap, label, hdlr, ret_from_except_lite, \
516-
FINISH_NAP;RUNLATCH_ON;DISABLE_INTS)
516+
FINISH_NAP;DISABLE_INTS;RUNLATCH_ON)
517517

518518
/*
519519
* When the idle code in power4_idle puts the CPU into NAP mode,

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ machine_check_common:
683683
STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
684684
STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
685685
STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
686-
STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception)
686+
STD_EXCEPTION_COMMON(0xe40, emulation_assist, .emulation_assist_interrupt)
687687
STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception)
688688
#ifdef CONFIG_PPC_DOORBELL
689689
STD_EXCEPTION_COMMON_ASYNC(0xe80, h_doorbell, .doorbell_exception)

arch/powerpc/kernel/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ notrace unsigned int __check_irq_replay(void)
162162
* in case we also had a rollover while hard disabled
163163
*/
164164
local_paca->irq_happened &= ~PACA_IRQ_DEC;
165-
if (decrementer_check_overflow())
165+
if ((happened & PACA_IRQ_DEC) || decrementer_check_overflow())
166166
return 0x900;
167167

168168
/* Finally check if an external interrupt happened */

arch/powerpc/kernel/process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
13691369

13701370
#ifdef CONFIG_PPC64
13711371
/* Called with hard IRQs off */
1372-
void __ppc64_runlatch_on(void)
1372+
void notrace __ppc64_runlatch_on(void)
13731373
{
13741374
struct thread_info *ti = current_thread_info();
13751375
unsigned long ctrl;
@@ -1382,7 +1382,7 @@ void __ppc64_runlatch_on(void)
13821382
}
13831383

13841384
/* Called with hard IRQs off */
1385-
void __ppc64_runlatch_off(void)
1385+
void notrace __ppc64_runlatch_off(void)
13861386
{
13871387
struct thread_info *ti = current_thread_info();
13881388
unsigned long ctrl;

arch/powerpc/kernel/traps.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,16 @@ void __kprobes program_check_exception(struct pt_regs *regs)
11651165
exception_exit(prev_state);
11661166
}
11671167

1168+
/*
1169+
* This occurs when running in hypervisor mode on POWER6 or later
1170+
* and an illegal instruction is encountered.
1171+
*/
1172+
void __kprobes emulation_assist_interrupt(struct pt_regs *regs)
1173+
{
1174+
regs->msr |= REASON_ILLEGAL;
1175+
program_check_exception(regs);
1176+
}
1177+
11681178
void alignment_exception(struct pt_regs *regs)
11691179
{
11701180
enum ctx_state prev_state = exception_enter();

0 commit comments

Comments
 (0)