All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline
@ 2019-05-17  6:54 Masahiro Yamada
  2019-05-17  7:07 ` Martin Schwidefsky
  2019-05-20 20:52 ` Justin Forbes
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-05-17  6:54 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens, linux-s390
  Cc: Arnd Bergmann, Laura Abbott, Masahiro Yamada, linux-kernel,
	Andrew Morton

Commit e60fb8bf68d4 ("s390/cpacf: mark scpacf_query() as __always_inline")
was not enough to make sure to meet the 'i' (immediate) constraint for the
asm operands.

With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error
with gcc 9.1.1:

  In file included from arch/s390/crypto/prng.c:29:
  ./arch/s390/include/asm/cpacf.h: In function 'cpacf_query_func':
  ./arch/s390/include/asm/cpacf.h:170:2: warning: asm operand 3 probably doesn't match constraints
    170 |  asm volatile(
        |  ^~~
  ./arch/s390/include/asm/cpacf.h:170:2: error: impossible constraint in 'asm'

Add more __always_inline to force inlining.

Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/s390/include/asm/cpacf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h
index f316de40e51b..19459dfb4295 100644
--- a/arch/s390/include/asm/cpacf.h
+++ b/arch/s390/include/asm/cpacf.h
@@ -177,7 +177,7 @@ static inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask)
 		: "cc");
 }
 
-static inline int __cpacf_check_opcode(unsigned int opcode)
+static __always_inline int __cpacf_check_opcode(unsigned int opcode)
 {
 	switch (opcode) {
 	case CPACF_KMAC:
@@ -217,7 +217,7 @@ static inline int cpacf_test_func(cpacf_mask_t *mask, unsigned int func)
 	return (mask->bytes[func >> 3] & (0x80 >> (func & 7))) != 0;
 }
 
-static inline int cpacf_query_func(unsigned int opcode, unsigned int func)
+static __always_inline int cpacf_query_func(unsigned int opcode, unsigned int func)
 {
 	cpacf_mask_t mask;
 
-- 
2.17.1


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

* Re: [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline
  2019-05-17  6:54 [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline Masahiro Yamada
@ 2019-05-17  7:07 ` Martin Schwidefsky
  2019-05-17  8:47   ` Masahiro Yamada
  2019-05-20 20:52 ` Justin Forbes
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Schwidefsky @ 2019-05-17  7:07 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Heiko Carstens, linux-s390, Arnd Bergmann, Laura Abbott,
	linux-kernel, Andrew Morton

On Fri, 17 May 2019 15:54:24 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Commit e60fb8bf68d4 ("s390/cpacf: mark scpacf_query() as __always_inline")
> was not enough to make sure to meet the 'i' (immediate) constraint for the
> asm operands.
> 
> With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error
> with gcc 9.1.1:
> 
>   In file included from arch/s390/crypto/prng.c:29:
>   ./arch/s390/include/asm/cpacf.h: In function 'cpacf_query_func':
>   ./arch/s390/include/asm/cpacf.h:170:2: warning: asm operand 3 probably doesn't match constraints
>     170 |  asm volatile(
>         |  ^~~
>   ./arch/s390/include/asm/cpacf.h:170:2: error: impossible constraint in 'asm'
> 
> Add more __always_inline to force inlining.
> 
> Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
> Reported-by: Laura Abbott <labbott@redhat.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Added to our internal tree and I will add it to s390/linux soon. Thanks.

Do you have a Kconfig patch in the works to enable OPTIMIZE_INLINING?
Otherwise we could just add it.

> ---
> 
>  arch/s390/include/asm/cpacf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h
> index f316de40e51b..19459dfb4295 100644
> --- a/arch/s390/include/asm/cpacf.h
> +++ b/arch/s390/include/asm/cpacf.h
> @@ -177,7 +177,7 @@ static inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask)
>  		: "cc");
>  }
> 
> -static inline int __cpacf_check_opcode(unsigned int opcode)
> +static __always_inline int __cpacf_check_opcode(unsigned int opcode)
>  {
>  	switch (opcode) {
>  	case CPACF_KMAC:
> @@ -217,7 +217,7 @@ static inline int cpacf_test_func(cpacf_mask_t *mask, unsigned int func)
>  	return (mask->bytes[func >> 3] & (0x80 >> (func & 7))) != 0;
>  }
> 
> -static inline int cpacf_query_func(unsigned int opcode, unsigned int func)
> +static __always_inline int cpacf_query_func(unsigned int opcode, unsigned int func)
>  {
>  	cpacf_mask_t mask;
> 


-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


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

* Re: [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline
  2019-05-17  7:07 ` Martin Schwidefsky
@ 2019-05-17  8:47   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-05-17  8:47 UTC (permalink / raw)
  To: Martin Schwidefsky
  Cc: Heiko Carstens, linux-s390, Arnd Bergmann, Laura Abbott,
	Linux Kernel Mailing List, Andrew Morton

On Fri, May 17, 2019 at 5:09 PM Martin Schwidefsky
<schwidefsky@de.ibm.com> wrote:
>
> On Fri, 17 May 2019 15:54:24 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> > Commit e60fb8bf68d4 ("s390/cpacf: mark scpacf_query() as __always_inline")
> > was not enough to make sure to meet the 'i' (immediate) constraint for the
> > asm operands.
> >
> > With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error
> > with gcc 9.1.1:
> >
> >   In file included from arch/s390/crypto/prng.c:29:
> >   ./arch/s390/include/asm/cpacf.h: In function 'cpacf_query_func':
> >   ./arch/s390/include/asm/cpacf.h:170:2: warning: asm operand 3 probably doesn't match constraints
> >     170 |  asm volatile(
> >         |  ^~~
> >   ./arch/s390/include/asm/cpacf.h:170:2: error: impossible constraint in 'asm'
> >
> > Add more __always_inline to force inlining.
> >
> > Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
> > Reported-by: Laura Abbott <labbott@redhat.com>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Added to our internal tree and I will add it to s390/linux soon. Thanks.
>
> Do you have a Kconfig patch in the works to enable OPTIMIZE_INLINING?
> Otherwise we could just add it.

No.
It is up to you.


Thanks.


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline
  2019-05-17  6:54 [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline Masahiro Yamada
  2019-05-17  7:07 ` Martin Schwidefsky
@ 2019-05-20 20:52 ` Justin Forbes
  1 sibling, 0 replies; 4+ messages in thread
From: Justin Forbes @ 2019-05-20 20:52 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, Arnd Bergmann,
	Laura Abbott, LKML, Andrew Morton

On Fri, May 17, 2019 at 1:55 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Commit e60fb8bf68d4 ("s390/cpacf: mark scpacf_query() as __always_inline")
> was not enough to make sure to meet the 'i' (immediate) constraint for the
> asm operands.
>
> With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error
> with gcc 9.1.1:
>
>   In file included from arch/s390/crypto/prng.c:29:
>   ./arch/s390/include/asm/cpacf.h: In function 'cpacf_query_func':
>   ./arch/s390/include/asm/cpacf.h:170:2: warning: asm operand 3 probably doesn't match constraints
>     170 |  asm volatile(
>         |  ^~~
>   ./arch/s390/include/asm/cpacf.h:170:2: error: impossible constraint in 'asm'
>
> Add more __always_inline to force inlining.
>
> Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
> Reported-by: Laura Abbott <labbott@redhat.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
Thanks for the fix, this does indeed fix the build issues for us.

Justin

Tested-by: Justin Forbes <jforbes@fedoraproject.org>

>  arch/s390/include/asm/cpacf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h
> index f316de40e51b..19459dfb4295 100644
> --- a/arch/s390/include/asm/cpacf.h
> +++ b/arch/s390/include/asm/cpacf.h
> @@ -177,7 +177,7 @@ static inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask)
>                 : "cc");
>  }
>
> -static inline int __cpacf_check_opcode(unsigned int opcode)
> +static __always_inline int __cpacf_check_opcode(unsigned int opcode)
>  {
>         switch (opcode) {
>         case CPACF_KMAC:
> @@ -217,7 +217,7 @@ static inline int cpacf_test_func(cpacf_mask_t *mask, unsigned int func)
>         return (mask->bytes[func >> 3] & (0x80 >> (func & 7))) != 0;
>  }
>
> -static inline int cpacf_query_func(unsigned int opcode, unsigned int func)
> +static __always_inline int cpacf_query_func(unsigned int opcode, unsigned int func)
>  {
>         cpacf_mask_t mask;
>
> --
> 2.17.1
>

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

end of thread, other threads:[~2019-05-20 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17  6:54 [PATCH] s390: mark __cpacf_check_opcode() and cpacf_query_func() as __always_inline Masahiro Yamada
2019-05-17  7:07 ` Martin Schwidefsky
2019-05-17  8:47   ` Masahiro Yamada
2019-05-20 20:52 ` Justin Forbes

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.