[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [xen-devel] [Patch v2 2/4] x86/stack: Adjust boundary conditions for printed stacks.



On 12/08/13 14:44, Jan Beulich wrote:
>>>> On 12.08.13 at 14:15, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.