lkml.org 
[lkml]   [2011]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 5/8] mips/jump_label: add arch_jump_label_transform_early()
Date
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

This allows jump-label entries to be modified early, in a pre-SMP
environment.

XXX TODO: make sure idling CPUs flush their icaches before continuing
in case this modifies something that's adjacent to their init-idle loops.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: David Daney <david.daney@cavium.com>
---
arch/mips/kernel/jump_label.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
index 6001610..ddc9a65 100644
--- a/arch/mips/kernel/jump_label.c
+++ b/arch/mips/kernel/jump_label.c
@@ -20,8 +20,8 @@

#define J_RANGE_MASK ((1ul << 28) - 1)

-void arch_jump_label_transform(struct jump_entry *e,
- enum jump_label_type type)
+static void __jump_label_transform(struct jump_entry *e,
+ enum jump_label_type type)
{
union mips_instruction insn;
union mips_instruction *insn_p =
@@ -40,15 +40,28 @@ void arch_jump_label_transform(struct jump_entry *e,
insn.word = 0; /* nop */
}

- get_online_cpus();
- mutex_lock(&text_mutex);
*insn_p = insn;

flush_icache_range((unsigned long)insn_p,
(unsigned long)insn_p + sizeof(*insn_p));
+}
+
+void arch_jump_label_transform(struct jump_entry *e,
+ enum jump_label_type type)
+{
+ get_online_cpus();
+ mutex_lock(&text_mutex);
+
+ __jump_label_tranform(e, type);

mutex_unlock(&text_mutex);
put_online_cpus();
}

+void __init arch_jump_label_transform_early(struct jump_entry *e,
+ enum jump_label_type type)
+{
+ __jump_label_tranform(e, type);
+}
+
#endif /* HAVE_JUMP_LABEL */
--
1.7.6.2


\
 
 \ /
  Last update: 2011-09-30 01:29    [W:0.622 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site