From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYFFU-0007Kb-SJ for qemu-devel@nongnu.org; Thu, 10 Apr 2014 09:42:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYFFP-0001Xr-Mp for qemu-devel@nongnu.org; Thu, 10 Apr 2014 09:42:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41055 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYFFP-0001Xm-Ha for qemu-devel@nongnu.org; Thu, 10 Apr 2014 09:42:31 -0400 Message-ID: <53469FC5.4030406@suse.de> Date: Thu, 10 Apr 2014 15:42:29 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1395427476-25546-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1395427476-25546-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-arm: Load ELF images with the correct machine type for CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Peter Crosthwaite , patches@linaro.org, Michael Matz , Dirk Mueller , Laurent Desnogues , =?ISO-8859-1?Q?Alex_Benn=E9e?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall On 21.03.14 19:44, Peter Maydell wrote: > When trying to load an ELF file specified via -kernel, we need to > pass load_elf() the ELF machine type corresponding to the CPU we're > booting with, not the one corresponding to the softmmu binary > we happen to be running. (The two are different in the case of > loading a 32-bit ARM ELF file into a 32 bit CPU being emulated > by qemu-system aarch64.) This was causing us to incorrectly fail > to load ELF images in this situation. > > Signed-off-by: Peter Maydell > --- > This isn't really a big deal since we can just say "use the > qemu-system-arm binary instead". However maybe we should put > this into 2.0. Opinions? > > Incidentally I suspect hw/i386/multiboot.c has a similar > problem where it calls load_elf() passing ELF_MACHINE. We have some compatibility code in the elf loader that says "if elf_machine == ppc64, then allow loading of ppc32 binaries too": http://git.qemu.org/?p=qemu.git;a=blob;f=include/hw/elf_ops.h;h=c6b5129bab394704cf2197fe079ab195ec84ec2a;hb=HEAD#l213 which we need because our mac99 firmware is 32bit, but does know how to drive a ppc64 CPU. I suppose your case is slightly different for AArch64 which is not compatible with 32bit binaries on firmware level. Alex