From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNksy-0005If-Hb for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:11:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNkst-0003s8-Ts for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:11:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNkst-0003qT-MJ for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:11:23 -0400 Message-ID: <515D89F5.5000504@redhat.com> Date: Thu, 04 Apr 2013 16:11:01 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1364985128-23772-1-git-send-email-pbonzini@redhat.com> <1364985128-23772-7-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: pmaydell@linaro.org, qemu-devel@nongnu.org, aurelien@aurel32.net Il 04/04/2013 16:09, Peter Maydell ha scritto: > Agreed in principle, but you seem to have missed some structs > which use target_ulong currently and which presumably should > use abi_ulong instead, eg all the target_ucontext etc structs > in linux-user/signal.c Right. > Also linux-user/elfload.c:symfind() is casting a pointer to > target_ulong* and dereferencing it, and that might now cause > an alignment fault on some host CPUs if the host CPU alignment > requirements are stricter than the guest's. I had seen this, but it is only used with bsearch and safe: static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr) { #if ELF_CLASS == ELFCLASS32 struct elf_sym *syms = s->disas_symtab.elf32; #else struct elf_sym *syms = s->disas_symtab.elf64; #endif // binary search struct elf_sym *sym; sym = bsearch(&orig_addr, syms, s->disas_num_syms, sizeof(*syms), symfind); ... } Paolo