linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME
@ 2020-04-13  2:05 Masahiro Yamada
  2020-04-13  5:38 ` Vineet Gupta
  2020-04-13 18:20 ` Nick Desaulniers
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-04-13  2:05 UTC (permalink / raw)
  To: Vineet Gupta, linux-snps-arc
  Cc: Masahiro Yamada, Nick Desaulniers, Allison Randal, Arnd Bergmann,
	Gustavo A. R. Silva, Kate Stewart, Kees Cook, Pankaj Bharadiya,
	Thomas Gleixner, linux-kernel

CONFIG_AS_CFI_SIGNAL_FRAME is never defined for ARC.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/arc/kernel/unwind.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index 27ea64b1fa33..f87758a6851b 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -1178,11 +1178,9 @@ int arc_unwind(struct unwind_frame_info *frame)
 #endif
 
 	/* update frame */
-#ifndef CONFIG_AS_CFI_SIGNAL_FRAME
 	if (frame->call_frame
 	    && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign))
 		frame->call_frame = 0;
-#endif
 	cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs;
 	startLoc = min_t(unsigned long, UNW_SP(frame), cfa);
 	endLoc = max_t(unsigned long, UNW_SP(frame), cfa);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME
  2020-04-13  2:05 [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME Masahiro Yamada
@ 2020-04-13  5:38 ` Vineet Gupta
  2020-04-13  6:01   ` Masahiro Yamada
  2020-04-13 18:20 ` Nick Desaulniers
  1 sibling, 1 reply; 4+ messages in thread
From: Vineet Gupta @ 2020-04-13  5:38 UTC (permalink / raw)
  To: Masahiro Yamada, linux-snps-arc
  Cc: Kate Stewart, Kees Cook, Arnd Bergmann, Gustavo A. R. Silva,
	Pankaj Bharadiya, Nick Desaulniers, linux-kernel,
	Thomas Gleixner, Allison Randal

On 4/12/20 7:05 PM, Masahiro Yamada wrote:
> CONFIG_AS_CFI_SIGNAL_FRAME is never defined for ARC.
> 
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>

Where, how ?

> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  arch/arc/kernel/unwind.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
> index 27ea64b1fa33..f87758a6851b 100644
> --- a/arch/arc/kernel/unwind.c
> +++ b/arch/arc/kernel/unwind.c
> @@ -1178,11 +1178,9 @@ int arc_unwind(struct unwind_frame_info *frame)
>  #endif
>  
>  	/* update frame */
> -#ifndef CONFIG_AS_CFI_SIGNAL_FRAME
>  	if (frame->call_frame
>  	    && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign))
>  		frame->call_frame = 0;
> -#endif
>  	cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs;
>  	startLoc = min_t(unsigned long, UNW_SP(frame), cfa);
>  	endLoc = max_t(unsigned long, UNW_SP(frame), cfa);

Actually there's more scope for cleanup here. The while signal frame stuff is not
relevant here at all as this is only kernel stack frames. So all of
frame->call_frame stuff is bogus at best.

I once had an branch with ~15 patches to clean this all up. Let me go find it.

Curious though about the CC list, is this patch part of a bigger series or some
such. So many people from all over suddenly interested in ARC ;-)

-Vineet

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME
  2020-04-13  5:38 ` Vineet Gupta
@ 2020-04-13  6:01   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-04-13  6:01 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: linux-snps-arc, Kate Stewart, Kees Cook, Arnd Bergmann,
	Gustavo A. R. Silva, Pankaj Bharadiya, Nick Desaulniers,
	linux-kernel, Thomas Gleixner, Allison Randal

On Mon, Apr 13, 2020 at 2:38 PM Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>
> On 4/12/20 7:05 PM, Masahiro Yamada wrote:
> > CONFIG_AS_CFI_SIGNAL_FRAME is never defined for ARC.
> >
> > Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Where, how ?


I was working on various cleanups of x86 CONFIG_AS_* macros.

https://lore.kernel.org/patchwork/patch/1214512/


I removed CONFIG_AS_CFI_SIGNAL_FRAME from x86.

Nick pointed out the same name macro used in ARC,
which is not defined anywhere.





> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  arch/arc/kernel/unwind.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
> > index 27ea64b1fa33..f87758a6851b 100644
> > --- a/arch/arc/kernel/unwind.c
> > +++ b/arch/arc/kernel/unwind.c
> > @@ -1178,11 +1178,9 @@ int arc_unwind(struct unwind_frame_info *frame)
> >  #endif
> >
> >       /* update frame */
> > -#ifndef CONFIG_AS_CFI_SIGNAL_FRAME
> >       if (frame->call_frame
> >           && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign))
> >               frame->call_frame = 0;
> > -#endif
> >       cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs;
> >       startLoc = min_t(unsigned long, UNW_SP(frame), cfa);
> >       endLoc = max_t(unsigned long, UNW_SP(frame), cfa);
>
> Actually there's more scope for cleanup here. The while signal frame stuff is not
> relevant here at all as this is only kernel stack frames. So all of
> frame->call_frame stuff is bogus at best.
>
> I once had an branch with ~15 patches to clean this all up. Let me go find it.


I am not familiar with ARC code.

So, I leave this up to you for further cleanups.

>
> Curious though about the CC list, is this patch part of a bigger series or some
> such. So many people from all over suddenly interested in ARC ;-)


Presumably, they touched this file in the past,
and scripts/get_maintainers.pl picked them up.


masahiro@oscar:~/ref/linux$ scripts/get_maintainer.pl  -f
arch/arc/kernel/unwind.c
Vineet Gupta <vgupta@synopsys.com> (supporter:SYNOPSYS ARC
ARCHITECTURE,commit_signer:2/5=40%)
Kees Cook <keescook@chromium.org> (commit_signer:2/5=40%)
"Gustavo A. R. Silva" <gustavo@embeddedor.com>
(commit_signer:2/5=40%,authored:2/5=40%,added_lines:3/11=27%,removed_lines:2/14=14%)
Enrico Weigelt <info@metux.net> (commit_signer:1/5=20%)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (commit_signer:1/5=20%)
Thomas Gleixner <tglx@linutronix.de>
(authored:1/5=20%,added_lines:1/11=9%,removed_lines:4/14=29%)
Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
(authored:1/5=20%,added_lines:3/11=27%,removed_lines:3/14=21%)
Arnd Bergmann <arnd@arndb.de>
(authored:1/5=20%,added_lines:4/11=36%,removed_lines:5/14=36%)
linux-snps-arc@lists.infradead.org (open list:SYNOPSYS ARC ARCHITECTURE)
linux-kernel@vger.kernel.org (open list)



> -Vineet



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME
  2020-04-13  2:05 [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME Masahiro Yamada
  2020-04-13  5:38 ` Vineet Gupta
@ 2020-04-13 18:20 ` Nick Desaulniers
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2020-04-13 18:20 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Vineet Gupta, linux-snps-arc, Allison Randal, Arnd Bergmann,
	Gustavo A. R. Silva, Kate Stewart, Kees Cook, Pankaj Bharadiya,
	Thomas Gleixner, LKML

On Sun, Apr 12, 2020 at 7:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> CONFIG_AS_CFI_SIGNAL_FRAME is never defined for ARC.
>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks for the patch.  I worry there may be many preprocessor checks
in the kernel that are always true/false.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>


> ---
>
>  arch/arc/kernel/unwind.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
> index 27ea64b1fa33..f87758a6851b 100644
> --- a/arch/arc/kernel/unwind.c
> +++ b/arch/arc/kernel/unwind.c
> @@ -1178,11 +1178,9 @@ int arc_unwind(struct unwind_frame_info *frame)
>  #endif
>
>         /* update frame */
> -#ifndef CONFIG_AS_CFI_SIGNAL_FRAME
>         if (frame->call_frame
>             && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign))
>                 frame->call_frame = 0;
> -#endif
>         cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs;
>         startLoc = min_t(unsigned long, UNW_SP(frame), cfa);
>         endLoc = max_t(unsigned long, UNW_SP(frame), cfa);
> --
> 2.25.1
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-13 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  2:05 [PATCH] arc: remove #ifndef CONFIG_AS_CFI_SIGNAL_FRAME Masahiro Yamada
2020-04-13  5:38 ` Vineet Gupta
2020-04-13  6:01   ` Masahiro Yamada
2020-04-13 18:20 ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).