From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAgbF-00045t-HE for qemu-devel@nongnu.org; Fri, 25 Jul 2014 10:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAgb8-0006lz-Mu for qemu-devel@nongnu.org; Fri, 25 Jul 2014 10:35:57 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:56188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAgb8-0006lm-Em for qemu-devel@nongnu.org; Fri, 25 Jul 2014 10:35:50 -0400 Message-ID: <53D26B43.80109@codeaurora.org> Date: Fri, 25 Jul 2014 10:35:47 -0400 From: Christopher Covington MIME-Version: 1.0 References: <53D2632D.4070700@codeaurora.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] AArch64 ELF File Loading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "qemu-devel@nongnu.org" Hi Peter, On 07/25/2014 10:07 AM, Peter Maydell wrote: > On 25 July 2014 15:01, Christopher Covington wrote: >> Hi, >> >> I think the AArch64 port has a problem with a self-modifying code sequence >> that appears to run fine on other simulators, but I can't get QEMU to run the >> small bare metal test case I created to try to reproduce the issue. Any help >> would be appreciated. >> >> qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt -semihosting >> -d exec,in_asm /tmp/test-nooverwrite 2>&1 | less >> >> qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000 >> >> qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt -semihosting >> -d exec,in_asm -bios /tmp/test-nooverwrite 2>&1 | less >> >> qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000 >> >> qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt -semihosting >> -d exec,in_asm -kernel /tmp/test-nooverwrite 2>&1 | less > > You haven't specified a CPU type, and virt defaults > to cortex-a15. Try "-cpu cortex-a57". That explains the A32 instructions. > You haven't specified a memory size, and QEMU defaults > to 128MB, which (given the start address of RAM) means > there won't be any RAM at the load address you're trying to > load your test program at. Try "-m 3G", and/or make your > ELF file load at an address closer to the start of RAM. Thanks for the suggestions. aarch64-none-elf-gcc -specs=rdimon.specs -Ttext=0x40000000 hello.c -o hello aarch64-none-elf-readelf -h hello ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: AArch64 Version: 0x1 Entry point address: 0x40000158 Start of program headers: 64 (bytes into file) Start of section headers: 157432 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 4 Size of section headers: 64 (bytes) Number of section headers: 17 Section header string table index: 14 qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt \ -cpu cortex-a57 -m 3G -semihosting -kernel hello qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000 Thanks, Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation.