All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Pekka Paalanen <pq@iki.fi>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] Check for breakpoint in text_poke to eliminate bug_on
Date: Sun, 20 Apr 2008 16:25:33 -0400	[thread overview]
Message-ID: <20080420202533.GA16538@Krystal> (raw)
In-Reply-To: <20080420231838.21eaf426@daedalus.pq.iki.fi>

* Pekka Paalanen (pq@iki.fi) wrote:
> On Sun, 20 Apr 2008 15:44:40 -0400
> Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> 
> > Can you test this new version ? The check was buggy when it fell on a
> > code boundary : the addr - 1 wan't always a valid address.
> > 
> 
> 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.
> 

Yup. I was able to successfully cycle cpu hotplug with 2.6.25 mainline
with the equivalent of the text_poke patches I sent to you, therefore I
guess it rules out text_poke as a cause of your crash. A bisection of
sched-devel/latest seems appropriate.

Mathieu

> 
> Thanks.
> 
> -- 
> Pekka Paalanen
> http://www.iki.fi/pq/

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2008-04-20 20:25 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080413224207.4430a09c@daedalus.pq.iki.fi>
2008-04-13 19:48 ` [PATCH] mmiotrace: add user documentation Pekka Paalanen
2008-04-14 15:49   ` Steven Rostedt
2008-04-14 18:20     ` Pekka Paalanen
2008-04-13 20:05 ` [BUG/PATCH] x86 mmiotrace: dynamically disable non-boot CPUs Pekka Paalanen
2008-04-14  6:57   ` Ingo Molnar
2008-04-14 18:02     ` Pekka Paalanen
2008-04-16 11:46       ` Ingo Molnar
     [not found]         ` <20080416114609.GA20054-X9Un+BFzKDI@public.gmane.org>
2008-04-16 17:59           ` Pekka Paalanen
2008-04-16 17:59             ` Pekka Paalanen
2008-04-16 18:32             ` Ingo Molnar
2008-04-16 19:07               ` Steven Rostedt
     [not found]               ` <20080416183258.GA30490-X9Un+BFzKDI@public.gmane.org>
2008-04-16 20:42                 ` Pekka Paalanen
2008-04-16 20:42                   ` Pekka Paalanen
     [not found]                   ` <20080416234209.221b7fae-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org>
2008-04-16 20:47                     ` Ingo Molnar
2008-04-16 20:47                       ` Ingo Molnar
     [not found]             ` <20080416205902.6186d349-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org>
2008-07-24 15:34               ` Stephane Marchesin
2008-07-24 15:34                 ` [Nouveau] " Stephane Marchesin
2008-04-19 15:41     ` [BUG] kmalloc_node(GFP_KERNEL) while smp_alt spinlocked Pekka Paalanen
2008-04-19 16:19       ` [PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable Mathieu Desnoyers
2008-04-19 21:06         ` Pekka Paalanen
2008-04-19 21:52           ` [BUG] CPU hotplug reboots machine (Re: [PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable) Pekka Paalanen
2008-04-19 21:58             ` [PATCH] Check for breakpoint in text_poke to eliminate bug_on Mathieu Desnoyers
2008-04-19 22:42               ` Pekka Paalanen
2008-04-20  0:05                 ` Mathieu Desnoyers
2008-04-20  7:14                   ` Pekka Paalanen
2008-04-20 19:44                     ` Mathieu Desnoyers
2008-04-20 20:18                       ` Pekka Paalanen
2008-04-20 20:25                         ` Mathieu Desnoyers [this message]
2008-04-21 18:48                           ` [PATCH] x86_64: fix kernel rodata NX setting Pekka Paalanen
2008-04-21 18:57                             ` Steven Rostedt
2008-04-21 19:03                             ` Ingo Molnar
2008-04-22 18:42         ` [repost PATCH] Fix SMP alternatives : use mutex instead of spinlock, text_poke is sleepable Pekka Paalanen
2008-04-22 19:09           ` Ingo Molnar
2008-04-22 20:22             ` Mathieu Desnoyers
2008-04-24 19:39   ` [PATCH v2] x86 mmiotrace: dynamically disable non-boot CPUs Pekka Paalanen
2008-04-26 11:13     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080420202533.GA16538@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pq@iki.fi \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.