All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/asm: fix gcc-5 enqcmds() build failure
@ 2021-08-02 14:53 Arnd Bergmann
  2021-08-02 15:22 ` Dave Jiang
  2021-08-02 16:15 ` H. Peter Anvin
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-08-02 14:53 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Arnd Bergmann, H. Peter Anvin, Dave Jiang, Tony Luck,
	Dan Williams, Ben Widawsky, Ricardo Neri, Arvind Sankar,
	Peter Zijlstra, Vinod Koul, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building drivers/dma/idxd/submit.o with gcc-5.5 results in a cryptic
error messages:

arch/x86/include/asm/special_insns.h: Assembler messages:
arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz'
make[5]: *** [scripts/Makefile.build:272: drivers/dma/idxd/submit.o] Error 1

It seems that this happens for 32-bit arguments when the instruction
expects an 8-bit argument. Change the type of the local variable
accordingly to get a clean build.

Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction")
Fixes: 8e50d392652f ("dmaengine: idxd: Add shared workqueue support") # guessed
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/include/asm/special_insns.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index f3fbb84ff8a7..33264839f99e 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -275,7 +275,7 @@ static inline int enqcmds(void __iomem *dst, const void *src)
 {
 	const struct { char _[64]; } *__src = src;
 	struct { char _[64]; } __iomem *__dst = dst;
-	int zf;
+	u8 zf;
 
 	/*
 	 * ENQCMDS %(rdx), rax
-- 
2.29.2


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

* Re: [PATCH] x86/asm: fix gcc-5 enqcmds() build failure
  2021-08-02 14:53 [PATCH] x86/asm: fix gcc-5 enqcmds() build failure Arnd Bergmann
@ 2021-08-02 15:22 ` Dave Jiang
  2021-08-02 16:15 ` H. Peter Anvin
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2021-08-02 15:22 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Arnd Bergmann, H. Peter Anvin, Tony Luck, Dan Williams,
	Ben Widawsky, Ricardo Neri, Arvind Sankar, Peter Zijlstra,
	Vinod Koul, linux-kernel


On 8/2/2021 7:53 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building drivers/dma/idxd/submit.o with gcc-5.5 results in a cryptic
> error messages:
>
> arch/x86/include/asm/special_insns.h: Assembler messages:
> arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz'
> make[5]: *** [scripts/Makefile.build:272: drivers/dma/idxd/submit.o] Error 1
>
> It seems that this happens for 32-bit arguments when the instruction
> expects an 8-bit argument. Change the type of the local variable
> accordingly to get a clean build.
>
> Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction")
> Fixes: 8e50d392652f ("dmaengine: idxd: Add shared workqueue support") # guessed
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Dave Jiang <dave.jiang@intel.com>

Thanks!

> ---
>   arch/x86/include/asm/special_insns.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
> index f3fbb84ff8a7..33264839f99e 100644
> --- a/arch/x86/include/asm/special_insns.h
> +++ b/arch/x86/include/asm/special_insns.h
> @@ -275,7 +275,7 @@ static inline int enqcmds(void __iomem *dst, const void *src)
>   {
>   	const struct { char _[64]; } *__src = src;
>   	struct { char _[64]; } __iomem *__dst = dst;
> -	int zf;
> +	u8 zf;
>   
>   	/*
>   	 * ENQCMDS %(rdx), rax

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

* Re: [PATCH] x86/asm: fix gcc-5 enqcmds() build failure
  2021-08-02 14:53 [PATCH] x86/asm: fix gcc-5 enqcmds() build failure Arnd Bergmann
  2021-08-02 15:22 ` Dave Jiang
@ 2021-08-02 16:15 ` H. Peter Anvin
  1 sibling, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2021-08-02 16:15 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Arnd Bergmann, Dave Jiang, Tony Luck, Dan Williams, Ben Widawsky,
	Ricardo Neri, Arvind Sankar, Peter Zijlstra, Vinod Koul,
	linux-kernel

NAK.

The type of arguments to condition code arguments should be bool.

On August 2, 2021 4:53:42 PM GMT+02:00, Arnd Bergmann <arnd@kernel.org> wrote:
>From: Arnd Bergmann <arnd@arndb.de>
>
>Building drivers/dma/idxd/submit.o with gcc-5.5 results in a cryptic
>error messages:
>
>arch/x86/include/asm/special_insns.h: Assembler messages:
>arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz'
>make[5]: *** [scripts/Makefile.build:272: drivers/dma/idxd/submit.o] Error 1
>
>It seems that this happens for 32-bit arguments when the instruction
>expects an 8-bit argument. Change the type of the local variable
>accordingly to get a clean build.
>
>Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction")
>Fixes: 8e50d392652f ("dmaengine: idxd: Add shared workqueue support") # guessed
>Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>---
> arch/x86/include/asm/special_insns.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
>index f3fbb84ff8a7..33264839f99e 100644
>--- a/arch/x86/include/asm/special_insns.h
>+++ b/arch/x86/include/asm/special_insns.h
>@@ -275,7 +275,7 @@ static inline int enqcmds(void __iomem *dst, const void *src)
> {
> 	const struct { char _[64]; } *__src = src;
> 	struct { char _[64]; } __iomem *__dst = dst;
>-	int zf;
>+	u8 zf;
> 
> 	/*
> 	 * ENQCMDS %(rdx), rax

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

end of thread, other threads:[~2021-08-02 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 14:53 [PATCH] x86/asm: fix gcc-5 enqcmds() build failure Arnd Bergmann
2021-08-02 15:22 ` Dave Jiang
2021-08-02 16:15 ` H. Peter Anvin

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.