From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KryMZ-0003nf-P3 for qemu-devel@nongnu.org; Mon, 20 Oct 2008 13:16:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KryMZ-0003ms-9B for qemu-devel@nongnu.org; Mon, 20 Oct 2008 13:16:15 -0400 Received: from [199.232.76.173] (port=49502 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KryMY-0003ml-Uc for qemu-devel@nongnu.org; Mon, 20 Oct 2008 13:16:14 -0400 Received: from yx-out-1718.google.com ([74.125.44.153]:39954) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KryMZ-00064K-95 for qemu-devel@nongnu.org; Mon, 20 Oct 2008 13:16:15 -0400 Received: by yx-out-1718.google.com with SMTP id 3so284214yxi.82 for ; Mon, 20 Oct 2008 10:16:13 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 20:16:13 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH] Improve symbol lookup for system and user mode In-Reply-To: <48F8CB4C.30800@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48E52067.6080408@mail.berlios.de> <48F79CB9.4090602@mail.berlios.de> <48F7A4D6.8070405@mail.berlios.de> <48F8CB4C.30800@mail.berlios.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 10/17/08, Stefan Weil wrote: > > > Stefan Weil schrieb: > >> 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. This should be a separate patch. > >> > >> 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 > > > > > > > Here is an updated patch which now supports binary symbol lookup > for both system emulation and user emulation. > > User emulation was tested using qemu-x86_64 and a simple application > with symbol information. > > The new patch no longer includes compile time options for the old > linear symbol search. > > I hope this new patch will be included in Qemu trunk. There are some white space only changes, these should be taken out. For some reason, loading a bios with symbols on Sparc32 corrupts the bios but Sparc64 works. This happens also without your patch.