All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: relax jump label ASM constraints
@ 2020-03-04  9:34 Rémi Denis-Courmont
  2020-03-04 12:39 ` Mark Rutland
  0 siblings, 1 reply; 3+ messages in thread
From: Rémi Denis-Courmont @ 2020-03-04  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

From: Remi Denis-Courmont <remi.denis.courmont@huawei.com>

The static key address is stored in the jump label table. It needs to
be a run-time constant. However, it does not need to be a constant
suitable for expansion as an immediate value, given that it is
expanded in a full 64-bits (.quad) statement.

Signed-off-by: Remi Denis-Courmont <remi.denis.courmont@huawei.com>
---
 arch/arm64/include/asm/jump_label.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h
index cea441b6aa5d..dcc0a32f073b 100644
--- a/arch/arm64/include/asm/jump_label.h
+++ b/arch/arm64/include/asm/jump_label.h
@@ -25,7 +25,7 @@ static __always_inline bool arch_static_branch(struct static_key *key,
 		 "	.long		1b - ., %l[l_yes] - .	\n\t"
 		 "	.quad		%c0 - .			\n\t"
 		 "	.popsection				\n\t"
-		 :  :  "i"(&((char *)key)[branch]) :  : l_yes);
+		 :  :  "S"(&((char *)key)[branch]) :  : l_yes);
 
 	return false;
 l_yes:
@@ -42,7 +42,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key,
 		 "	.long		1b - ., %l[l_yes] - .	\n\t"
 		 "	.quad		%c0 - .			\n\t"
 		 "	.popsection				\n\t"
-		 :  :  "i"(&((char *)key)[branch]) :  : l_yes);
+		 :  :  "S"(&((char *)key)[branch]) :  : l_yes);
 
 	return false;
 l_yes:
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-03-04 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  9:34 [PATCH] arm64: relax jump label ASM constraints Rémi Denis-Courmont
2020-03-04 12:39 ` Mark Rutland
2020-03-04 13:37   ` Rémi Denis-Courmont

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.