From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240Ab1I2X05 (ORCPT ); Thu, 29 Sep 2011 19:26:57 -0400 Received: from claw.goop.org ([74.207.240.146]:43183 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932171Ab1I2X0v (ORCPT ); Thu, 29 Sep 2011 19:26:51 -0400 From: Jeremy Fitzhardinge To: Steven Rostedt Cc: "David S. Miller" , David Daney , Michael Ellerman , Jan Glauber , Jason Baron , the arch/x86 maintainers , Xen Devel , Linux Kernel Mailing List , Jeremy Fitzhardinge Subject: [PATCH RFC 5/8] mips/jump_label: add arch_jump_label_transform_early() Date: Thu, 29 Sep 2011 16:26:35 -0700 Message-Id: <9f95a611c3b317f412f77ae06753752951afd38b.1317338254.git.jeremy.fitzhardinge@citrix.com> X-Mailer: git-send-email 1.7.6.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Fitzhardinge 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 Cc: David Daney --- 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