From patchwork Mon Mar 14 17:55:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 8582801 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 427DF9F6E1 for ; Mon, 14 Mar 2016 18:01:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C7C420172 for ; Mon, 14 Mar 2016 18:01:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [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 6FBF42013D for ; Mon, 14 Mar 2016 18:01:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afWlQ-00061s-Ih; Mon, 14 Mar 2016 17:58:44 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afWlP-00060y-P0 for xen-devel@lists.xen.org; Mon, 14 Mar 2016 17:58:43 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 68/3A-03651-2DBF6E65; Mon, 14 Mar 2016 17:58:42 +0000 X-Env-Sender: prvs=874c279eb=anthony.perard@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1457978320!28974112!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41533 invoked from network); 14 Mar 2016 17:58:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 14 Mar 2016 17:58:42 -0000 X-IronPort-AV: E=Sophos;i="5.24,336,1454976000"; d="scan'208";a="345468403" From: Anthony PERARD To: Date: Mon, 14 Mar 2016 17:55:47 +0000 Message-ID: <1457978150-27201-13-git-send-email-anthony.perard@citrix.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1457978150-27201-1-git-send-email-anthony.perard@citrix.com> References: <1457978150-27201-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Keir Fraser , Stefano Stabellini , Andrew Cooper , Ian Jackson , Jan Beulich , Anthony PERARD , Wei Liu Subject: [Xen-devel] [PATCH v4 12/14] 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.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable 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 --- No change in V4. 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 460efb9..bb2a309 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -323,21 +323,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 )