From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: entry: always restore x0 from the stack on syscall return
Date: Thu, 20 Aug 2015 11:51:27 +0100 [thread overview]
Message-ID: <20150820105127.GE19328@arm.com> (raw)
In-Reply-To: <55D592E4.50609@linaro.org>
On Thu, Aug 20, 2015 at 09:42:12AM +0100, Hanjun Guo wrote:
> On 08/20/2015 12:56 AM, Will Deacon wrote:
> > On Wed, Aug 19, 2015 at 05:35:05PM +0100, Catalin Marinas wrote:
> >> On Wed, Aug 19, 2015 at 05:23:59PM +0100, Will Deacon wrote:
> >>> On Wed, Aug 19, 2015 at 05:03:20PM +0100, Catalin Marinas wrote:
> >>>> There is another str x0 in __sys_trace_return which I think we could
> >>>> remove.
> >>>
> >>> Hmm, I don't think we can remove that. It's needed on the slowpath to
> >>> update the pt_regs with either -ENOSYS (for __ni_sys_trace) or the
> >>> syscall return value from the blr in __sys_trace.
> >>>
> >>> What we can do instead is change the branch above to branch to
> >>> __sys_trace_return_skipped. Patch below.
> >>>
> >>> Will
> >>>
> >>> --->8
> >>>
> >>> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> >>> index 2a5e64ccc991..088322ff1ba0 100644
> >>> --- a/arch/arm64/kernel/entry.S
> >>> +++ b/arch/arm64/kernel/entry.S
> >>> @@ -619,7 +619,7 @@ ret_fast_syscall:
> >>> kernel_exit 0
> >>> ret_fast_syscall_trace:
> >>> enable_irq // enable interrupts
> >>> - b __sys_trace_return
> >>> + b __sys_trace_return_skipped // we already saved x0
> >>
> >> That would do. With this added:
> >>
> >> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> >>
> >> (or I can take it for 4.2 but I'd like more testing like LTP)
> >
> > Yeah, I'll run some tests overnight and see how it holds up.
>
> How is the stress test going on? I didn't do some stress test but
> when I applied this patch (along with above additions), the problem
> I reported is gone,
>
> Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Thanks, Hanjun. LTP passed successfully, so I think the patch is ok but
there's no need to rush it in for 4.2.
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Catalin Marinas <Catalin.Marinas@arm.com>,
Larry Bassel <larry.bassel@linaro.org>,
Kevin Hilman <khilman@linaro.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: entry: always restore x0 from the stack on syscall return
Date: Thu, 20 Aug 2015 11:51:27 +0100 [thread overview]
Message-ID: <20150820105127.GE19328@arm.com> (raw)
In-Reply-To: <55D592E4.50609@linaro.org>
On Thu, Aug 20, 2015 at 09:42:12AM +0100, Hanjun Guo wrote:
> On 08/20/2015 12:56 AM, Will Deacon wrote:
> > On Wed, Aug 19, 2015 at 05:35:05PM +0100, Catalin Marinas wrote:
> >> On Wed, Aug 19, 2015 at 05:23:59PM +0100, Will Deacon wrote:
> >>> On Wed, Aug 19, 2015 at 05:03:20PM +0100, Catalin Marinas wrote:
> >>>> There is another str x0 in __sys_trace_return which I think we could
> >>>> remove.
> >>>
> >>> Hmm, I don't think we can remove that. It's needed on the slowpath to
> >>> update the pt_regs with either -ENOSYS (for __ni_sys_trace) or the
> >>> syscall return value from the blr in __sys_trace.
> >>>
> >>> What we can do instead is change the branch above to branch to
> >>> __sys_trace_return_skipped. Patch below.
> >>>
> >>> Will
> >>>
> >>> --->8
> >>>
> >>> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> >>> index 2a5e64ccc991..088322ff1ba0 100644
> >>> --- a/arch/arm64/kernel/entry.S
> >>> +++ b/arch/arm64/kernel/entry.S
> >>> @@ -619,7 +619,7 @@ ret_fast_syscall:
> >>> kernel_exit 0
> >>> ret_fast_syscall_trace:
> >>> enable_irq // enable interrupts
> >>> - b __sys_trace_return
> >>> + b __sys_trace_return_skipped // we already saved x0
> >>
> >> That would do. With this added:
> >>
> >> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> >>
> >> (or I can take it for 4.2 but I'd like more testing like LTP)
> >
> > Yeah, I'll run some tests overnight and see how it holds up.
>
> How is the stress test going on? I didn't do some stress test but
> when I applied this patch (along with above additions), the problem
> I reported is gone,
>
> Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Thanks, Hanjun. LTP passed successfully, so I think the patch is ok but
there's no need to rush it in for 4.2.
Will
next prev parent reply other threads:[~2015-08-20 10:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 15:09 [PATCH] arm64: entry: always restore x0 from the stack on syscall return Will Deacon
2015-08-19 15:09 ` Will Deacon
2015-08-19 16:03 ` Catalin Marinas
2015-08-19 16:03 ` Catalin Marinas
2015-08-19 16:23 ` Will Deacon
2015-08-19 16:23 ` Will Deacon
2015-08-19 16:35 ` Catalin Marinas
2015-08-19 16:35 ` Catalin Marinas
2015-08-19 16:56 ` Will Deacon
2015-08-19 16:56 ` Will Deacon
2015-08-20 8:42 ` Hanjun Guo
2015-08-20 8:42 ` Hanjun Guo
2015-08-20 10:51 ` Will Deacon [this message]
2015-08-20 10:51 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150820105127.GE19328@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.