Thread (8 messages) 8 messages, 3 authors, 2020-10-07

Re: linux-next: build failure after merge of the vfs tree

From: Josh Poimboeuf <hidden>
Date: 2020-10-06 14:30:26
Also in: lkml

On Mon, Sep 28, 2020 at 11:10:56PM -0500, Josh Poimboeuf wrote:
quoted
Josh, any ideas?  We could, of course, make it "r"(size), but that would
be unpleasant in all existing callers...
Sorry, I've been traveling.  I'd just vote for making it "r".

array_index_nospec() is always called after a usercopy.  I don't think
anyone will notice the extra mov, for the cases where it would be
propagated as an immediate.  And the argument *is* an unsigned long
after all.

Stephen, can you confirm this fixes it?
Still traveling, I didn't see an update on this.  Any objections to the
below?  I assume it fixes Stephen's build issue.
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index d158ea1fa250..69045ac62f58 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 volatile ("cmp %1,%2; sbb %0,%0;"
 			:"=r" (mask)
-			:"g"(size),"r" (index)
+			:"r"(size), "r"(index)
 			:"cc");
 	return mask;
 }
-- 
Josh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help