Skip to contentSkip to conversation

x86/asm: fix gcc-5 enqcmds() build failure

PATCH NAK Arnd Bergmann 3 participants 3 messages Aug 2, 2021 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/asm: fix gcc-5 enqcmds() build failure

From: Arnd Bergmann <[email protected]>

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
---
 arch/x86/include/asm/special_insns.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/special_insns.h +1 -1
index f3fbb84ff8a7..33264839f99e 100644
@@ -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
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 7 lines

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

Thanks!

Quoted 17 lines
---
  arch/x86/include/asm/special_insns.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/special_insns.h +1 -1
index f3fbb84ff8a7..33264839f99e 100644
@@ -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
reviewer NAK
#2 lore raw
In reply to Arnd Bergmann

NAK.

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

Quoted 33 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

---
arch/x86/include/asm/special_insns.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/special_insns.h +1 -1
index f3fbb84ff8a7..33264839f99e 100644
@@ -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
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.