[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C2D7FE5348E1B147BCA15975FBA230751A6AC711@IN01WEMBXA.internal.synopsys.com>
Date: Mon, 12 May 2014 04:54:56 +0000
From: Vineet Gupta <Vineet.Gupta1@...opsys.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "stable@...r.kernel.org" <stable@...r.kernel.org>,
Anton Kolesov <Anton.Kolesov@...opsys.com>,
Francois Bedard <Francois.Bedard@...opsys.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 3.14 27/83] ARC: !PREEMPT: Ensure Return to kernel mode
is IRQ safe
On Monday 12 May 2014 12:51 AM, Greg Kroah-Hartman wrote:
> 3.14-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Vineet Gupta <Vineet.Gupta1@...opsys.com>
>
> commit 8aa9e85adac609588eeec356e5a85059b3b819ba upstream.
Hi Greg,
This one was also marked for stable 3.10 however because the 2 pre-req patches
were not in yet, applying it would have failed and AFAIKR I did describe the state
of things in that failure report. Anyhow can you please queue this one up for the
next 3.10 stable.
Thx,
-Vineet
>
> There was a very small race window where resume to kernel mode from a
> Exception Path (or pure kernel mode which is true for most of ARC
> exceptions anyways), was not disabling interrupts in restore_regs,
> clobbering the exception regs
>
> Anton found the culprit call flow (after many sleepless nights)
>
> | 1. we got a Trap from user land
> | 2. started to service it.
> | 3. While doing some stuff on user-land memory (I think it is padzero()),
> | we got a DataTlbMiss
> | 4. On return from it we are taking "resume_kernel_mode" path
> | 5. NEED_RESHED is not set, so we go to "return from exception" path in
> | restore regs.
> | 6. there seems to be IRQ happening
>
> Signed-off-by: Vineet Gupta <vgupta@...opsys.com>
> Cc: Anton Kolesov <Anton.Kolesov@...opsys.com>
> Cc: Francois Bedard <Francois.Bedard@...opsys.com>
> Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>
> ---
> arch/arc/kernel/entry.S | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> --- a/arch/arc/kernel/entry.S
> +++ b/arch/arc/kernel/entry.S
> @@ -614,11 +614,13 @@ resume_user_mode_begin:
>
> resume_kernel_mode:
>
> -#ifdef CONFIG_PREEMPT
> -
> - ; This is a must for preempt_schedule_irq()
> + ; Disable Interrupts from this point on
> + ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq()
> + ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe
> IRQ_DISABLE r9
>
> +#ifdef CONFIG_PREEMPT
> +
> ; Can't preempt if preemption disabled
> GET_CURR_THR_INFO_FROM_SP r10
> ld r8, [r10, THREAD_INFO_PREEMPT_COUNT]
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists