All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/asm: Fix setz size enqcmds() build failure
@ 2021-09-10 22:33 Kees Cook
  2021-09-23  9:57 ` [tip: x86/urgent] x86/asm: Fix SETZ " tip-bot2 for Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2021-09-10 22:33 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Kees Cook, Arnd Bergmann, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Dave Jiang, Dan Williams, kernel test robot,
	Ben Widawsky, Arvind Sankar, Tony Luck, Peter Zijlstra,
	linux-kernel, linux-hardening

When building under GCC 4.9 and 5.5:

arch/x86/include/asm/special_insns.h: Assembler messages:
arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz'

Fix the type to "bool" for condition code arguments, as documented.

Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction")
Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Ben Widawsky <ben.widawsky@intel.com>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
I tripped over this myself, but I found Arnd's version, so this is
basically a v2 of:
https://lore.kernel.org/lkml/20210802145356.1154321-1-arnd@kernel.org/
---
 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..68c257a3de0d 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;
+	bool zf;
 
 	/*
 	 * ENQCMDS %(rdx), rax
-- 
2.30.2


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

* [tip: x86/urgent] x86/asm: Fix SETZ size enqcmds() build failure
  2021-09-10 22:33 [PATCH] x86/asm: Fix setz size enqcmds() build failure Kees Cook
@ 2021-09-23  9:57 ` tip-bot2 for Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Kees Cook @ 2021-09-23  9:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Arnd Bergmann, Kees Cook, Borislav Petkov, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     d81ff5fe14a950f53e2833cfa196e7bb3fd5d4e3
Gitweb:        https://git.kernel.org/tip/d81ff5fe14a950f53e2833cfa196e7bb3fd5d4e3
Author:        Kees Cook <keescook@chromium.org>
AuthorDate:    Fri, 10 Sep 2021 15:33:32 -07:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 22 Sep 2021 19:45:48 +02:00

x86/asm: Fix SETZ size enqcmds() build failure

When building under GCC 4.9 and 5.5:

  arch/x86/include/asm/special_insns.h: Assembler messages:
  arch/x86/include/asm/special_insns.h:286: Error: operand size mismatch for `setz'

Change the type to "bool" for condition code arguments, as documented.

Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction")
Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210910223332.3224851-1-keescook@chromium.org
---
 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 f3fbb84..68c257a 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;
+	bool zf;
 
 	/*
 	 * ENQCMDS %(rdx), rax

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

end of thread, other threads:[~2021-09-23  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 22:33 [PATCH] x86/asm: Fix setz size enqcmds() build failure Kees Cook
2021-09-23  9:57 ` [tip: x86/urgent] x86/asm: Fix SETZ " tip-bot2 for Kees Cook

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.