From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJfcV-000354-Ft for qemu-devel@nongnu.org; Tue, 10 May 2011 01:36:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJfcT-0002AO-Ty for qemu-devel@nongnu.org; Tue, 10 May 2011 01:36:31 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:39543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJfcT-0002AK-ML for qemu-devel@nongnu.org; Tue, 10 May 2011 01:36:29 -0400 Received: by gyg4 with SMTP id 4so2426462gyg.4 for ; Mon, 09 May 2011 22:36:28 -0700 (PDT) Message-ID: <4DC8CED6.9010502@landley.net> Date: Tue, 10 May 2011 00:36:22 -0500 From: Rob Landley MIME-Version: 1.0 References: <57FFBBA3-27A2-4362-A6AC-4D48315352EB@suse.de> <4DC337DF.1060100@landley.net> <90784430-8495-4C6C-B40D-BB6A920C24C9@web.de> <4DC6E01D.4060503@landley.net> <4DC7F62C.7030103@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Allow ARMv7M to be started without a kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Alexander Graf , Ben Leslie , qemu-devel@nongnu.org On 05/09/2011 10:50 AM, Peter Maydell wrote: > On 9 May 2011 16:11, Alexander Graf wrote: > [about -kernel, unless I've got confused] >> The issue is that this is not how it works on real hardware. Grub won't just >> load a vmlinux file and boot it. I'm not even sure how much exactly the >> early entry code handles in Linux before it jumps to the ELF entry point. >> >> Either way, if you get something rolling that also ensures that it fails >> when it's an ELF file that's not Linux, I'd be very open to it :). > > If we do that we need to document what the new way of doing "just load > and jump to the entry point of my not-a-linux-kernel ELF image" is; at > the moment for ARM that use case is supported by -kernel (the code > specifically handles ELF images as not-kernels), so changing that would > be a back-compatibility break... Arm doesn't need nearly as much setup as x86, some boards just map flash at the physical start address with a jump straight to the kernel entry point. On arm there's no legacy start mode, meaning no 16->32 bit transfer requiring mmu initialization as part of the setup. (I believe arm starts with a 1-1 virtual/physical mapping in the absence of initialized page tables, or something like that.) The big black magic thing coreboot/bios and uboot do is DRAM refresh, which QEMU simply doesn't care about: we map dram from the host and it gets refreshed at that level. So this behavior may actually be correct for Linux in the absence of a device tree (which just means initializinng a register to point to it on ppc, dunno what ARM does). And if you feed in an "-append" option to set a kernel command line, then you know it's a linux kernel. If we explicitly ask for more setup, then you know to do more setup. (I think that bit still needs to be written, I have to go read the code...) Rob