All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/nospec: Fixup array_index_nospec_mask() asm constraint
@ 2018-02-07  2:22 Dan Williams
  2018-02-13 13:06 ` [tip:x86/pti] x86/speculation: Fix up " tip-bot for Dan Williams
  2018-02-15  0:27 ` tip-bot for Dan Williams
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Williams @ 2018-02-07  2:22 UTC (permalink / raw)
  To: mingo
  Cc: x86, linux-kernel, Andy Lutomirski, H. Peter Anvin,
	Thomas Gleixner, Linus Torvalds

Allow the compiler to handle @size as an immediate value or memory
directly rather than allocating a register.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
v2: use the 'g' constraint since CMP handles memory targets (Linus)

 arch/x86/include/asm/barrier.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index 30d406146016..e1259f043ae9 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -40,7 +40,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
 
 	asm ("cmp %1,%2; sbb %0,%0;"
 			:"=r" (mask)
-			:"r"(size),"r" (index)
+			:"g"(size),"r" (index)
 			:"cc");
 	return mask;
 }

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

* [tip:x86/pti] x86/speculation: Fix up array_index_nospec_mask() asm constraint
  2018-02-07  2:22 [PATCH v2] x86/nospec: Fixup array_index_nospec_mask() asm constraint Dan Williams
@ 2018-02-13 13:06 ` tip-bot for Dan Williams
  2018-02-15  0:27 ` tip-bot for Dan Williams
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Dan Williams @ 2018-02-13 13:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, hpa, mingo, torvalds, luto, dan.j.williams, linux-kernel, peterz

Commit-ID:  87360f969eb214fb22b7e03acb2475a809e040c5
Gitweb:     https://git.kernel.org/tip/87360f969eb214fb22b7e03acb2475a809e040c5
Author:     Dan Williams <dan.j.williams@intel.com>
AuthorDate: Tue, 6 Feb 2018 18:22:40 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 13 Feb 2018 14:01:25 +0100

x86/speculation: Fix up array_index_nospec_mask() asm constraint

Allow the compiler to handle @size as an immediate value or memory
directly rather than allocating a register.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/151797010204.1289.1510000292250184993.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/barrier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index 30d4061..e1259f0 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -40,7 +40,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
 
 	asm ("cmp %1,%2; sbb %0,%0;"
 			:"=r" (mask)
-			:"r"(size),"r" (index)
+			:"g"(size),"r" (index)
 			:"cc");
 	return mask;
 }

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

* [tip:x86/pti] x86/speculation: Fix up array_index_nospec_mask() asm constraint
  2018-02-07  2:22 [PATCH v2] x86/nospec: Fixup array_index_nospec_mask() asm constraint Dan Williams
  2018-02-13 13:06 ` [tip:x86/pti] x86/speculation: Fix up " tip-bot for Dan Williams
@ 2018-02-15  0:27 ` tip-bot for Dan Williams
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Dan Williams @ 2018-02-15  0:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, peterz, torvalds, dan.j.williams, tglx, mingo, luto, linux-kernel

Commit-ID:  be3233fbfcb8f5acb6e3bcd0895c3ef9e100d470
Gitweb:     https://git.kernel.org/tip/be3233fbfcb8f5acb6e3bcd0895c3ef9e100d470
Author:     Dan Williams <dan.j.williams@intel.com>
AuthorDate: Tue, 6 Feb 2018 18:22:40 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 15 Feb 2018 01:15:50 +0100

x86/speculation: Fix up array_index_nospec_mask() asm constraint

Allow the compiler to handle @size as an immediate value or memory
directly rather than allocating a register.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/151797010204.1289.1510000292250184993.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/barrier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index 30d4061..e1259f0 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -40,7 +40,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
 
 	asm ("cmp %1,%2; sbb %0,%0;"
 			:"=r" (mask)
-			:"r"(size),"r" (index)
+			:"g"(size),"r" (index)
 			:"cc");
 	return mask;
 }

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

end of thread, other threads:[~2018-02-15  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07  2:22 [PATCH v2] x86/nospec: Fixup array_index_nospec_mask() asm constraint Dan Williams
2018-02-13 13:06 ` [tip:x86/pti] x86/speculation: Fix up " tip-bot for Dan Williams
2018-02-15  0:27 ` tip-bot for Dan Williams

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.