From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK3ER-00041y-EU for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK3EM-0000Ue-HI for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:44:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK3EM-0000Tn-9f for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:44:06 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u64CclYj071348 for ; Mon, 4 Jul 2016 08:44:04 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 23x6gj0h8x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 04 Jul 2016 08:44:04 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jul 2016 13:44:02 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2081D17D8042 for ; Mon, 4 Jul 2016 13:45:21 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u64Chwmc18088286 for ; Mon, 4 Jul 2016 12:43:58 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u64Bi06N030119 for ; Mon, 4 Jul 2016 05:44:00 -0600 References: From: Christian Borntraeger Date: Mon, 4 Jul 2016 14:43:57 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Message-Id: <577A5A0D.5060003@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v8 0/5] Add a generic loader List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis , qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: cov@codeaurora.org, crosthwaitepeter@gmail.com, pbonzini@redhat.com, armbru@redhat.com On 07/02/2016 03:07 AM, Alistair Francis wrote: > This work is based on the original work by Li Guang with extra > features added by Peter C and myself. > > The idea of this loader is to allow the user to load multiple images > or values into QEMU at startup. > > Memory values can be loaded like this: -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 > > Images can be loaded like this: -device loader,file=./images/u-boot.elf,cpu=0 > > This can be useful and we use it a lot in Xilinx to load multiple images > into a machine at creation (ATF, Kernel and DTB for example). > > It can also be used to set registers. > > This patch series makes the load_elf() function more generic by not > requiring an architecture. It also adds a new function load_elf_as() > which allows custom AddressSpaces when loading ELF images. > > At the moment I think the AddressSpace loading support is more of an > RFC. If people agree with the way I'm doing it I will expand the support > to image types. This looks valuable for s390 as well. We have "*.ins" files that describe a list of files and its load address. It is used to move files from the DVD in the hardware management console to LPAR memory to bootstrap an empty lpar. With this libvirt could parse these ins files and emulate this functionality. > > V8: > - Allow custom AddressSpaces when loading images > - Move ELF architecture handling code > - Rebase > - Corrections to loading code > - Corrections to documentation > V7: > - Fix typo in comment > - Rebase > V6: > - Add error checking > V5: > - Rebase > V4: > - Re-write documentation > - Allow the loader to work with every architecture > - Move the file to hw/core > - Increase the maximum number of CPUs > - Make the CPU operations conditional > - Convert the cpu option to cpu-num > - Require the user to specify endianess > V2: > - Add an entry to the maintainers file > - Add some documentation > - Perform bounds checking on the data_len > - Register and unregister the reset in the realise/unrealise > Changes since RFC: > - Add support for BE > > > Alistair Francis (5): > loader: Allow ELF loader to auto-detect the ELF arch > loader: All a custom SddressSpace when loading ROMs > loader: Add AddressSpace loading support to ELFs > generic-loader: Add a generic loader > docs: Add a generic loader explanation document > > MAINTAINERS | 6 ++ > docs/generic-loader.txt | 60 +++++++++++++ > hw/core/Makefile.objs | 2 + > hw/core/generic-loader.c | 177 +++++++++++++++++++++++++++++++++++++++ > hw/core/loader.c | 34 ++++++-- > include/hw/core/generic-loader.h | 45 ++++++++++ > include/hw/elf_ops.h | 10 ++- > include/hw/loader.h | 24 ++++-- > 8 files changed, 343 insertions(+), 15 deletions(-) > create mode 100644 docs/generic-loader.txt > create mode 100644 hw/core/generic-loader.c > create mode 100644 include/hw/core/generic-loader.h >