public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander van Heukelum <heukelum@mailshack.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Yinghai Lu <yinghai@kernel.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: [PATCH FIX] traps: x86: correct copy/paste bug: a trap is a GATE_TRAP
Date: Sat, 4 Oct 2008 12:06:08 +0200	[thread overview]
Message-ID: <20081004100608.GA7659@mailshack.com> (raw)
In-Reply-To: <1223114224.25951.1277482279@webmail.messagingengine.com>

Fix copy/paste/forgot-to-edit bug in desc.h.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>

---

> * Ingo Molnar <mingo@elte.hu> wrote:
> > * Alexander van Heukelum <heukelum@fastmail.fm> wrote:
> > > Hi Ingo,
> > > 
> > > This series unifies traps_32.c and traps_64.c.
> > 
> > wow, very nice! I've applied them to tip/x86/traps:
> > 
> > f58f3d5: traps: x86: finalize unification of traps.c
> > bf395d6: traps: x86: make traps_32.c and traps_64.c equal
> > f156f35: traps: x86: various noop-changes preparing for unification of traps_xx.c
> > 70cfe30: traps: x86_64: use task_pid_nr(tsk) instead of tsk->pid in do_general_protection
> > dc89ce0: traps: i386: expand clear_mem_error and remove from mach_traps.h
> > 6f8063f: traps: x86_64: make io_check_error equal to the one on i386
> > d025445: traps: i386: use preempt_conditional_sti/cli in do_int3
> > 2180afa: traps: x86_64: make math_state_restore more like i386
> > 686cc4a: traps: x86: converge trap_init functions
> 
> -tip testing found a spontaneus reboot bug on two 32-bit systems (one 
> Intel and one AMD testbox), and i've bisected it down to:
> 
> | 686cc4a0c1ca92bffbc22a897c3b433dadbbf444 is first bad commit
> | commit 686cc4a0c1ca92bffbc22a897c3b433dadbbf444
> | Author: Alexander van Heukelum <heukelum@fastmail.fm>
> | Date:   Fri Oct 3 22:00:32 2008 +0200
> |
> |     traps: x86: converge trap_init functions
> 
> config attached. The bisection log:
> 
>  # bad:  [a229a9da] Merge branch 'timers/urgent'
>  # good: [27de5e39] Merge branch 'out-of-tree'
>  # good: [8e9cb9db] Merge branch 'tracing/ring-buffer'
>  # bad:  [70cfe30f] traps: x86_64: use task_pid_nr(tsk) instead of tsk
>  # bad:  [d0254456] traps: i386: use preempt_conditional_sti/cli in do
>  # bad:  [2180afaf] traps: x86_64: make math_state_restore more like i
>  # bad:  [686cc4a0] traps: x86: converge trap_init functions
> 
> so i've excluded these commits from tip/master for now.
> 
> there's no serial log entry visible - the spontaneous reboot happens at 
> around when we hit user-space.
> 
> I suspect syscall entry setup might be borked - the stack frames of call 
> gates versus interrupt gates are different and it's easy to make a small 
> mistake there with such effects.
> 
> 	Ingo

*blush*

You were so right. I have no idea how this has slipped
through testing. Could you see if this on top of the
traps branch makes things go again? I'll get you some
replacement patches to make the whole thing bisectable
again.

Alexander

---

diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 168c5cc..f06adac 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -354,7 +354,7 @@ static inline void set_system_intr_gate(unsigned int n, void *addr)
 static inline void set_system_trap_gate(unsigned int n, void *addr)
 {
 	BUG_ON((unsigned)n > 0xFF);
-	_set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
+	_set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
 }
 
 static inline void set_trap_gate(unsigned int n, void *addr)

       reply	other threads:[~2008-10-04 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1223114224.25951.1277482279@webmail.messagingengine.com>
2008-10-04 10:06 ` Alexander van Heukelum [this message]
2008-10-04 10:30   ` [PATCH 1/9 v2] traps: x86: converge trap_init functions Alexander van Heukelum
2008-10-04 12:13   ` [PATCH FIX] traps: x86: correct copy/paste bug: a trap is a GATE_TRAP 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=20081004100608.GA7659@mailshack.com \
    --to=heukelum@mailshack.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox