From 01d73e94964bb1bd924b81dc657515e36560fb73 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Mon, 17 Mar 2008 15:27:09 +1100 Subject: [PATCH] --- yaml --- r: 87523 b: refs/heads/master c: 44387e9ff25267c78a99229aca55ed750e9174c7 h: refs/heads/master i: 87521: 4f89ee8a64cbcaf9f76e43ed43d913dff3237838 87519: 22dcdb38f2fcce9a80133323b2403ac2f2671558 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/process.c | 6 ++++++ trunk/arch/powerpc/mm/slb.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 939c8d800f9c..5521ef9d2a0e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c2372eb9bcafdd149b26987a8c25bbed92fd2775 +refs/heads/master: 44387e9ff25267c78a99229aca55ed750e9174c7 diff --git a/trunk/arch/powerpc/kernel/process.c b/trunk/arch/powerpc/kernel/process.c index 4846bf543a8c..59311ec0d422 100644 --- a/trunk/arch/powerpc/kernel/process.c +++ b/trunk/arch/powerpc/kernel/process.c @@ -353,6 +353,12 @@ struct task_struct *__switch_to(struct task_struct *prev, account_process_vtime(current); calculate_steal_time(); + /* + * We can't take a PMU exception inside _switch() since there is a + * window where the kernel stack SLB and the kernel stack are out + * of sync. Hard disable here. + */ + hard_irq_disable(); last = _switch(old_thread, new_thread); local_irq_restore(flags); diff --git a/trunk/arch/powerpc/mm/slb.c b/trunk/arch/powerpc/mm/slb.c index 47b06bad24ad..906daeda59a8 100644 --- a/trunk/arch/powerpc/mm/slb.c +++ b/trunk/arch/powerpc/mm/slb.c @@ -124,6 +124,12 @@ void slb_flush_and_rebolt(void) ksp_vsid_data = get_slb_shadow()->save_area[2].vsid; } + /* + * We can't take a PMU exception in the following code, so hard + * disable interrupts. + */ + hard_irq_disable(); + /* We need to do this all in asm, so we're sure we don't touch * the stack between the slbia and rebolting it. */ asm volatile("isync\n"