summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-02-06 18:22:40 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-22 15:43:54 +0100
commitbe1ea502e31a47e3afd1c82964f35c78c80d271e (patch)
treeded36885296e34a7dcf1286bc5cd3a83e46db919 /arch
parent191752d5d3d0a670842e6fb35291c98f8f818b66 (diff)
x86/speculation: Fix up array_index_nospec_mask() asm constraint
commit be3233fbfcb8f5acb6e3bcd0895c3ef9e100d470 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/barrier.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index 857590390397..78d1c6a3d221 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -39,7 +39,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;
}