2019-05-09 18:50:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 32/66] xtensa: fix initialization of pt_regs::syscall in start_thread

[ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ]

New pt_regs should indicate that there's no syscall, not that there's
syscall #0. While at it wrap macro body in do/while and parenthesize
macro arguments.

Signed-off-by: Max Filippov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/xtensa/include/asm/processor.h | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index 677bc76c1d707..6e709fb562831 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -194,15 +194,18 @@ struct thread_struct {

/* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \
- memset(regs, 0, sizeof(*regs)); \
- regs->pc = new_pc; \
- regs->ps = USER_PS_VALUE; \
- regs->areg[1] = new_sp; \
- regs->areg[0] = 0; \
- regs->wmask = 1; \
- regs->depc = 0; \
- regs->windowbase = 0; \
- regs->windowstart = 1;
+ do { \
+ memset((regs), 0, sizeof(*(regs))); \
+ (regs)->pc = (new_pc); \
+ (regs)->ps = USER_PS_VALUE; \
+ (regs)->areg[1] = (new_sp); \
+ (regs)->areg[0] = 0; \
+ (regs)->wmask = 1; \
+ (regs)->depc = 0; \
+ (regs)->windowbase = 0; \
+ (regs)->windowstart = 1; \
+ (regs)->syscall = NO_SYSCALL; \
+ } while (0)

/* Forward declaration */
struct task_struct;
--
2.20.1




2019-05-09 18:56:54

by Max Filippov

[permalink] [raw]
Subject: Re: [PATCH 4.19 32/66] xtensa: fix initialization of pt_regs::syscall in start_thread

Hello,

On Thu, May 9, 2019 at 11:48 AM Greg Kroah-Hartman
<[email protected]> wrote:
>
> [ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ]
>
> New pt_regs should indicate that there's no syscall, not that there's
> syscall #0. While at it wrap macro body in do/while and parenthesize
> macro arguments.
>
> Signed-off-by: Max Filippov <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>
> ---
> arch/xtensa/include/asm/processor.h | 21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)

This patch should not be taken to any of the stable trees, except maybe
5.0.y, because NO_SYSCALL was introduced to arch/xtensa in 5.0.

This patch doesn't have any cc:stable tags, I'm curious why was it chosen
for stable and what can I do to prevent that in the future?

--
Thanks.
-- Max

2019-05-10 06:25:34

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 4.19 32/66] xtensa: fix initialization of pt_regs::syscall in start_thread

On Thu, May 09, 2019 at 11:55:31AM -0700, Max Filippov wrote:
> Hello,
>
> On Thu, May 9, 2019 at 11:48 AM Greg Kroah-Hartman
> <[email protected]> wrote:
> >
> > [ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ]
> >
> > New pt_regs should indicate that there's no syscall, not that there's
> > syscall #0. While at it wrap macro body in do/while and parenthesize
> > macro arguments.
> >
> > Signed-off-by: Max Filippov <[email protected]>
> > Signed-off-by: Sasha Levin <[email protected]>
> > ---
> > arch/xtensa/include/asm/processor.h | 21 ++++++++++++---------
> > 1 file changed, 12 insertions(+), 9 deletions(-)
>
> This patch should not be taken to any of the stable trees, except maybe
> 5.0.y, because NO_SYSCALL was introduced to arch/xtensa in 5.0.

Now dropped from everywhere except 5.0.y, thanks.

> This patch doesn't have any cc:stable tags, I'm curious why was it chosen
> for stable and what can I do to prevent that in the future?

Sasha's tools picked this up and you should have been cc:ed on it when
it was selected a few weeks ago.

thanks,

greg k-h