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

Re: [Xen-devel] [PATCH v7 25/24] symbols/xsplice: Implement fast symbol names -> virtual addresses lookup



On Tue, Apr 12, 2016 at 10:03:12PM -0400, Konrad Rzeszutek Wilk wrote:
> On Tue, Apr 12, 2016 at 04:59:02PM -0400, Konrad Rzeszutek Wilk wrote:
> > The current mechanism is geared towards fast virtual address ->
> > symbol names lookup. This is fine for the normal use cases
> > (BUG_ON, WARN_ON, etc), but for xSplice - where we need to find
> > hypervisor symbols - it is slow.
> .. snip..
> > NEW CODE:
> > Searching for symbols is simplified as we can do a binary search
> > on symbol_names_sorted (and using symbols_markers_sorted). Since the
> > symbols are sorted it takes on average 13 calls to symbols_expand_symbol.
> 
> And there is a bug somewhere. The virtual address that was tied to
> 'printk' actually ended up being tied to 'printed.21561'!
> 
> As such, when reviewing this code be aware there is something I must have 
> missed!

<blushes>

diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index cfea93e..3d7e5b2 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -261,7 +261,7 @@ unsigned long symbols_lookup_by_name(const char *symname)
         else if ( rc > 0 )
             low = mid + 1;
         else
-            return symbols_address(symbols_addresses_index_sorted[low]);
+            return symbols_address(symbols_addresses_index_sorted[mid]);
     }
     return 0;
 }

Fixes it.

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