From: Arjan van de Ven <arjan@linux.intel.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>,
Pekka Enberg <penberg@cs.helsinki.fi>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] x86: don't destroy %rbp on kernel-mode faults
Date: Mon, 19 May 2008 13:22:37 -0700 [thread overview]
Message-ID: <4831E18D.6040100@linux.intel.com> (raw)
In-Reply-To: <20080519200230.GA12210@damson.getinternet.no>
Vegard Nossum wrote:
> Hi,
>
> The RFC part of this patch is: Does anybody see why touching %rcx would
> be bad? It certainly looks like %ecx is free. This fixes the stacktrace
> problem I was seeing, and Pekka tested a bootup to userspace. (Pekka also
> did half of the debugging. When will git allow multiple authors for a
> patch? :-))
>
>
> Vegard
>
>
> From b1cbf24fcd05aa5ed2e610c80c06bc519d3188f7 Mon Sep 17 00:00:00 2001
> From: Vegard Nossum <vegard.nossum@gmail.com>
> Date: Mon, 19 May 2008 21:39:44 +0200
> Subject: [PATCH] x86: don't destroy %rbp on kernel-mode faults
>
> From the code:
>
> B stepping K8s sometimes report an truncated RIP for IRET exceptions
> returning to compat mode. Check for these here too.
>
> The code then proceeds to truncate the upper 32 bits of %rbp. This means
> that when do_page_fault() is finally called, its prologue,
>
> do_page_fault:
> push %rbp
> movl %rsp, %rbp
>
> will put the truncated base pointer on the stack. This means that the
> stack tracer will not be able to follow the base-pointer changes and
> will see all subsequent stack frames as unreliable.
>
> This patch changes the code to use a different register (%rcx) for the
> checking and leaves %rbp untouched.
>
> Cc: Andi Kleen <andi@firstfloor.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arjan van de Ven <arjan@linux.intel.com>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
looks good to me; good debugging!
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
next prev parent reply other threads:[~2008-05-19 20:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 20:02 [RFC][PATCH] x86: don't destroy %rbp on kernel-mode faults Vegard Nossum
2008-05-19 20:22 ` Arjan van de Ven [this message]
2008-05-19 21:16 ` Andi Kleen
2008-05-22 12:07 ` Vegard Nossum
2008-05-22 13:07 ` Andi Kleen
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=4831E18D.6040100@linux.intel.com \
--to=arjan@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=vegard.nossum@gmail.com \
/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