From patchwork Thu Feb 25 14:56:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 8424471 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B60EC0553 for ; Thu, 25 Feb 2016 15:11:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CABF22012D for ; Thu, 25 Feb 2016 15:11:39 +0000 (UTC) Received: from lists.xen.org (unknown [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0B5E20361 for ; Thu, 25 Feb 2016 15:11:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aYxXO-00058I-AM; Thu, 25 Feb 2016 15:09:06 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aYxXN-000583-94 for xen-devel@lists.xen.org; Thu, 25 Feb 2016 15:09:05 +0000 Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id DC/5E-03645-0191FC65; Thu, 25 Feb 2016 15:09:04 +0000 X-Env-Sender: prvs=85652c963=anthony.perard@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1456412942!26412256!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35384 invoked from network); 25 Feb 2016 15:09:03 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 25 Feb 2016 15:09:03 -0000 X-IronPort-AV: E=Sophos;i="5.22,498,1449532800"; d="scan'208";a="334495710" From: Anthony PERARD To: Date: Thu, 25 Feb 2016 14:56:10 +0000 Message-ID: <1456412174-20162-13-git-send-email-anthony.perard@citrix.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456412174-20162-1-git-send-email-anthony.perard@citrix.com> References: <1456412174-20162-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Keir Fraser , Stefano Stabellini , Andrew Cooper , Ian Jackson , Jan Beulich , Anthony PERARD , Wei Liu Subject: [Xen-devel] [PATCH v3 12/16] hvmloader: Specific bios_load function required X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All BIOS but ROMBIOS needs to be loaded via modules. ROMBIOS is handled as a special case. Signed-off-by: Anthony PERARD Acked-by: Jan Beulich --- Change in V3: - reprint Main BIOS in bios map with now available information from bios modules. - handle rombios, and keep its built-in ROMs. --- tools/firmware/hvmloader/hvmloader.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index a40503d..cc52302 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -325,21 +325,25 @@ int main(void) printf("Loading %s ...\n", bios->name); bios_module = get_module_entry(hvm_start_info, "bios"); - if ( bios_module && bios->bios_load ) + if ( bios_module ) { uint32_t paddr = bios_module->paddr; bios->bios_load(bios, (void*)paddr, bios_module->size); } - else if ( bios->bios_load ) +#ifdef ENABLE_ROMBIOS + else if ( bios == &rombios_config ) { bios->bios_load(bios, 0, 0); } +#endif else { - BUG_ON(bios->bios_address + bios->image_size > - HVMLOADER_PHYSICAL_ADDRESS); - memcpy((void *)bios->bios_address, bios->image, - bios->image_size); + /* + * If there is no BIOS module supplied and if there is no embeded BIOS + * image, then we failed. Only rombios might have an embedded bios blob. + */ + printf("no BIOS ROM image found\n"); + BUG(); } if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode )