qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Improve symbol lookup


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] Improve symbol lookup
Date: Thu, 16 Oct 2008 22:32:22 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

Stefan Weil schrieb:
> Blue Swirl schrieb:
>   
>> On 10/2/08, Stefan Weil <address@hidden> wrote:
>>     
>>> For 64 bit targets, lookup_symbol() compares a 64-bit target address
>>> with a 32 bit symbol address. This only works for addresses less than
>>> 2^32.
>>>
>>> MIPS64 kernels use addresses larger than 0xffffffff80000000,
>>> so qemu.log never shows symbolic names.
>>>
>>> My patch is a workaround which works with Qemu's 32 bit address hack.
>>> Please apply it to Qemu trunk.
>>>       
>> This applies to all architectures, not just MIPS64, so it need not be
>> conditional to TARGET_MIPS64.
>>
>>     
>>> Maybe a better solution would use symbol addresses without shortening
>>> them to 32 bits.
>>>       
> Here is the better solution (at least I hope so).
>   
>> Yes. That would mean using elf_sym instead of Elf32_sym in places
>> where symbols are used and removing the SZ==64 hacks in elf_ops.h.
>>
>>     
> So I did. Here is a short summary of my new patch:
>
> * Use function pointers for symbol lookup (currently for elf32 and
> elf64, could be expanded).
>   This also fixes the bug with mips elf64 symbols in current Qemu trunk.
>
> * Use quicksort and binary search for symbol lookup.
>
> * Remove unneeded entries from symbol table.
>   This reduced a typical table size (linux mips kernel) from 1764487 to
> 11656 entries.
>
> * In disas.c, the patch also fixes some warnings from old fashioned
> function prototypes.
>
> In loader.c, two defines control some compile time options (could be
> removed in
> production code):
> #define CONFIG_BINARY_SYMBOL_SEARCH
> #define CONFIG_REDUCE_SYMBOL_TABLE
>
> I tested the new code using 32 bit and 64 bit linux mips kernels and
> Qemu logging (-d in_asm).
> The speed improvement is extremely large - both because of the much
> smaller table and
> the binary search.
>
> Stefan
>
>   
Please note:

The current patch only supports system emulation.
User emulation needs more fixes to compile again.

Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]