Re: [PATCH] Check for breakpoint in text_poke to eliminate bug_on

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pekka Paalanen
Date: Sunday, April 20, 2008 - 1:18 pm

On Sun, 20 Apr 2008 15:44:40 -0400
Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:


Sorry, still the same. Btw. I had to apply your patch by hand on top of
your previous patch, and it ended up as just

--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -520,11 +520,6 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
        struct page *pages[2];
        int i;
 
-       if (*((uint8_t *)addr - 1) != BREAKPOINT_INSTRUCTION) {
-               BUG_ON(len > sizeof(long));
-               BUG_ON((((long)addr + len - 1) & ~(sizeof(long) - 1))
-                       - ((long)addr & ~(sizeof(long) - 1)));
-       }
        if (!core_kernel_text((unsigned long)addr)) {

Now I took a log of echo 0, echo 1 cycle with 2.6.24-gentoo-r1-trace
kernel:
[  203.448534] CPU 1 is now offline
[  203.448975] SMP alternatives: switching to UP code
[  217.888298] SMP alternatives: switching to SMP code
[  217.889285] Booting processor 1/2 APIC 0x1
[  217.901404] Initializing CPU#1
[  217.982081] Calibrating delay using timer specific routine.. 3991.35 BogoMIPS (lpj=6650167)
[  217.982088] CPU: L1 I cache: 32K, L1 D cache: 32K
[  217.982089] CPU: L2 cache: 4096K
[  217.982091] CPU: Physical Processor ID: 0
[  217.982092] CPU: Processor Core ID: 1
[  217.982593] Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz stepping 0a
[  217.982644] Switched to high resolution mode on CPU 1

And the failing log from the latest try is:

[   87.064970] CPU 1 is now offline
[   87.065311] lockdep: fixing up alternatives.
[   87.065694] SMP alternatives: switching to UP code
[   97.192213] lockdep: fixing up alternatives.
[   97.192532] SMP alternatives: switching to SMP code
[   97.203495] Booting processor 1/1 ip 6000
and it hangs and reboots.

Does it make sense to bisect on sched-devel/latest?
I think I could try that after a sleep&work cycle.
Luckily this bug is easy to reproduce.


Thanks.

-- 
Pekka Paalanen
http://www.iki.fi/pq/
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG] kmalloc_node(GFP_KERNEL) while smp_alt spinlocked, Pekka Paalanen, (Sat Apr 19, 8:41 am)
[PATCH] Fix SMP alternatives : use mutex instead of spinlo ..., Mathieu Desnoyers, (Sat Apr 19, 9:19 am)
[PATCH] Check for breakpoint in text_poke to eliminate bug_on, Mathieu Desnoyers, (Sat Apr 19, 2:58 pm)
Re: [PATCH] Check for breakpoint in text_poke to eliminate ..., Mathieu Desnoyers, (Sat Apr 19, 5:05 pm)
Re: [PATCH] Check for breakpoint in text_poke to eliminate ..., Mathieu Desnoyers, (Sun Apr 20, 12:44 pm)
Re: [PATCH] Check for breakpoint in text_poke to eliminate ..., Pekka Paalanen, (Sun Apr 20, 1:18 pm)
Re: [PATCH] Check for breakpoint in text_poke to eliminate ..., Mathieu Desnoyers, (Sun Apr 20, 1:25 pm)
[PATCH] x86_64: fix kernel rodata NX setting, Pekka Paalanen, (Mon Apr 21, 11:48 am)
Re: [PATCH] x86_64: fix kernel rodata NX setting, Steven Rostedt, (Mon Apr 21, 11:57 am)
Re: [PATCH] x86_64: fix kernel rodata NX setting, Ingo Molnar, (Mon Apr 21, 12:03 pm)
Re: [repost PATCH] Fix SMP alternatives : use mutex instea ..., Mathieu Desnoyers, (Tue Apr 22, 1:22 pm)
[PATCH v2] x86 mmiotrace: dynamically disable non-boot CPUs, Pekka Paalanen, (Thu Apr 24, 12:39 pm)
Re: [Nouveau] [BUG/PATCH] x86 mmiotrace: dynamically disab ..., Stephane Marchesin, (Thu Jul 24, 8:34 am)