All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>
Subject: Re: [xen-devel] [Patch v2 2/4] x86/stack: Adjust boundary conditions for printed stacks.
Date: Mon, 12 Aug 2013 14:53:11 +0100	[thread overview]
Message-ID: <5208E8C7.6090808@citrix.com> (raw)
In-Reply-To: <520902EF02000078000EB37E@nat28.tlf.novell.com>

On 12/08/13 14:44, Jan Beulich wrote:
>>>> On 12.08.13 at 14:15, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> +/*
>> + * Get the bottom-of-stack, as useful for printing stack traces.  This is
>> + * similar position as is returned by get_cpu_info(), but works on arbitrary
>> + * stack pointer, rather than just the current.
>> + *
>> + * In the non-frame pointer case, the boundary is exactly at the cpu_info
>> + * structure, which prevents the stack trace walker from mis-interpreting
>> + * guest register as Xen return addresses.
>> + *
>> + * For the frame pointer case, the boundary is further adjusted by two words,
>> + * as the call out of assembly does not contain a traditional C stack with
>> + * frame pointers.
>> + */
>> +#ifdef CONFIG_FRAME_POINTER
>> +#define get_printable_stack_bottom(sp)          \
>> +    ((sp & (~(STACK_SIZE-1))) +                 \
>> +     (STACK_SIZE - sizeof(struct cpu_info) - 2*sizeof(unsigned long)))
>> +#else
>> +#define get_printable_stack_bottom(sp)          \
>> +    ((sp & (~(STACK_SIZE-1))) + (STACK_SIZE - sizeof(struct cpu_info)))
>> +#endif
> Hmm, the delta being 2 slots makes no sense to me: The only
> difference ought to be the saved frame pointer, i.e. one slot.
> With what you propose here I'd suspect that the return address
> pointing into assembly code might be lost now with frame pointers.
>
> Jan
>

It was never available, and I cant find a way of getting at it without
special casing the frame-pointer code, or faking up a frame pointer in
the assembly.

~Andrew

  reply	other threads:[~2013-08-12 13:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 19:55 [xen-devel] [Patch 0/4] Xen stack trace printing improvements Andrew Cooper
2013-08-09 19:55 ` [xen-devel] [Patch 1/4] x86/stack: Refactor show_trace() Andrew Cooper
2013-08-09 19:55 ` [xen-devel] [Patch 2/4] x86/stack: Adjust boundary conditions for printed stacks Andrew Cooper
2013-08-12  8:46   ` Jan Beulich
2013-08-12  9:43     ` Andrew Cooper
2013-08-12  9:49       ` Jan Beulich
2013-08-12 12:15         ` [xen-devel] [Patch v2 " Andrew Cooper
2013-08-12 13:44           ` Jan Beulich
2013-08-12 13:53             ` Andrew Cooper [this message]
2013-08-09 19:55 ` [xen-devel] [Patch 3/4] x86/stack: Change show_stack_overflow() to use frame pointers if available Andrew Cooper
2013-08-09 19:55 ` [xen-devel] [Patch 4/4] DO NOT APPLY: Test code for interesting stack overflows Andrew Cooper
2013-09-09 11:09 ` [xen-devel] [Patch 0/4] Xen stack trace printing improvements Keir Fraser
2013-09-09 12:28   ` Andrew Cooper
2013-09-09 12:44     ` Jan Beulich
2013-09-09 12:50       ` Andrew Cooper

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=5208E8C7.6090808@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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.