Skip to contentSkip to conversation

noarch: fix ftrace code patching

GIT PULL Jan Kiszka 1 participant 1 message Dec 14, 2009

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

The following changes since commit 779cfc6a68bcc9c4acb1eec3922c25eb43b08a2f:
Jan Kiszka (1):
Set oops_in_progress on failing context check

are available in the git repository at:

git://git.kiszka.org/ipipe-2.6 queues/2.6.31-noarch

Jan Kiszka (1):
Disable both real and virtual interrupts during ftrace code changes

 kernel/trace/ftrace.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

------

Disable both real and virtual interrupts during ftrace code changes

This is required as the call stack contains some further local_irq_save/ restore which would otherwise reenable real interrupts spuriously.

---
 kernel/trace/ftrace.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
kernel/trace/ftrace.c +8 -4
index 5c007b6..9ca1e65 100644
@@ -2802,9 +2802,11 @@ static int ftrace_convert_nops(struct module *mod,
 	}
 
 	/* disable interrupts to prevent kstop machine */
-	local_irq_save_hw_notrace(flags);
+	local_irq_save(flags);
+	local_irq_disable_hw();
 	ftrace_update_code(mod);
-	local_irq_restore_hw_notrace(flags);
+	local_irq_enable_hw();
+	local_irq_restore(flags);
 	mutex_unlock(&ftrace_lock);
 
 	return 0;
@@ -2887,9 +2889,11 @@ void __init ftrace_init(void)
 	/* Keep the ftrace pointer to the stub */
 	addr = (unsigned long)ftrace_stub;
 
-	local_irq_save_hw_notrace(flags);
+	local_irq_save(flags);
+	local_irq_disable_hw();
 	ftrace_dyn_arch_init(&addr);
-	local_irq_restore_hw_notrace(flags);
+	local_irq_enable_hw();
+	local_irq_restore(flags);
 
 	/* ftrace_dyn_arch_init places the return code in addr */
 	if (addr)
Signature · 1 line
1.6.0.2