WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH RFC 5/8] mips/jump_label: add arch_jump_label_transfo

To: Steven Rostedt <rostedt@xxxxxxxxxxx>
Subject: [Xen-devel] [PATCH RFC 5/8] mips/jump_label: add arch_jump_label_transform_early()
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 29 Sep 2011 16:26:35 -0700
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jan Glauber <jang@xxxxxxxxxxxxxxxxxx>, Jason Baron <jbaron@xxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, David Daney <david.daney@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Michael Ellerman <michael@xxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>
Delivery-date: Thu, 29 Sep 2011 16:31:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <cover.1317338254.git.jeremy.fitzhardinge@xxxxxxxxxx>
In-reply-to: <cover.1317338254.git.jeremy.fitzhardinge@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1317338254.git.jeremy.fitzhardinge@xxxxxxxxxx>
References: <cover.1317338254.git.jeremy.fitzhardinge@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

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@xxxxxxxxxx>
Cc: David Daney <david.daney@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>