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

Re: [Xen-devel] [PATCH v9 16/27] x86, xsplice: Print payload's symbol name and payload name in backtraces



>>> On 26.04.16 at 14:48, <ross.lagerwall@xxxxxxxxxx> wrote:
> On 04/26/2016 01:41 PM, Jan Beulich wrote:
>>>>> On 26.04.16 at 13:06, <ross.lagerwall@xxxxxxxxxx> wrote:
>>> On 04/25/2016 04:35 PM, Konrad Rzeszutek Wilk wrote:
>>>> @@ -142,6 +145,55 @@ void *xsplice_symbols_lookup_by_name(const char 
> *symname)
>>>>        return 0;
>>>>    }
>>>>
>>>> +static const char *xsplice_symbols_lookup(unsigned long addr,
>>>> +                                          unsigned long *symbolsize,
>>>> +                                          unsigned long *offset,
>>>> +                                          char *namebuf)
>>>> +{
>>>> +    const struct payload *data;
>>>> +    unsigned int i, best;
>>>> +    const void *va = (const void *)addr;
>>>> +    const char *n = NULL;
>>>> +
>>>> +    /*
>>>> +     * Only RCU locking since this list is only ever changed during apply
>>>> +     * or revert context. And in case it dies there we need an safe list.
>>>> +     */
>>>> +    rcu_read_lock(&rcu_applied_lock);
>>>> +    list_for_each_entry_rcu ( data, &applied_list, applied_list )
>>>> +    {
>>>> +        if ( va < data->text_addr &&
>>>> +             va >= (data->text_addr + data->pages * PAGE_SIZE) )
>>>
>>> This calculation is wrong due to the use of void * and results in
>>> incorrect backtrace results.
>>
>> When text_addr is void *, how is this calculation wrong then?
> 
> I'm sorry, ignore that. I temporarily forgot how void* arithmetic is 
> defined for GCC.
> 
> The other two points are still valid and may result in incorrect 
> backtraces with > 1 payload loaded.

Of course.

Jan


_______________________________________________
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®.