From patchwork Thu Jul 28 10:50: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: 9251109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8AFF60757 for ; Thu, 28 Jul 2016 11:18:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99EF326D17 for ; Thu, 28 Jul 2016 11:18:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E67D2723E; Thu, 28 Jul 2016 11:18:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BD6726D17 for ; Thu, 28 Jul 2016 11:18:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSjIq-0001oJ-8g; Thu, 28 Jul 2016 11:16:36 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSjIp-0001nd-4i for xen-devel@lists.xen.org; Thu, 28 Jul 2016 11:16:35 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 30/A3-28813-299E9975; Thu, 28 Jul 2016 11:16:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHRDpO7ElzP DDb7tNbdY8nExiwOjx9Hdv5kCGKNYM/OS8isSWDPWbjvAWjCXr2LBsaoGxkbuLkZODgkBf4nJ c3qZQGw2AQOJFdOvMoLYIgKyEqu75rB3MXJxMAscYZS4dfMnWEJYwE/i65UjzCA2i4CqxMkJF 1lAbF4Be4k5W9cxQgyVk2g4fx+shhMovvLwfXYQW0jATuLQxoXMELaaxI2Fy6B6BSVOznwCZj MLSEgcfPGCGWIOt8Tt01OZJzDyzUJSNgtJ2QJGplWM6sWpRWWpRbqmeklFmekZJbmJmTm6hgb GermpxcWJ6ak5iUnFesn5uZsYgSFVz8DAuIPx8lenQ4ySHExKorxhoTPDhfiS8lMqMxKLM+KL SnNSiw8xynBwKEnwCrwAygkWpaanVqRl5gCDGyYtwcGjJML7+DlQmre4IDG3ODMdInWKUVFKn FcepE8AJJFRmgfXBouoS4yyUsK8jAwMDEI8BalFuZklqPKvGMU5GJWEeTNBpvBk5pXATX8FtJ gJaHFx7AyQxSWJCCmpBsYnttvz7n2RmXqykv06zwSpNQaSs84kq/VOmF2TW5AdGnj9wZUPSfP OKLwuutSw6taHu7Uvwx/Zrt4ma8B5kTOpfb9stI71fa2nPWkhUhPPCNgLrr5911l0rlORIVNe Cn+QYlPwp8mHNizcpby/Visk66l1pZZRT1lHs2WvtZnJqqxHxho695RYijMSDbWYi4oTAVbgt sejAgAA X-Env-Sender: prvs=0100a76d6=anthony.perard@citrix.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1469704590!26604443!2 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: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64581 invoked from network); 28 Jul 2016 11:16:33 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jul 2016 11:16:33 -0000 X-IronPort-AV: E=Sophos;i="5.28,433,1464652800"; d="scan'208";a="368933905" From: Anthony PERARD To: Date: Thu, 28 Jul 2016 11:50:10 +0100 Message-ID: <20160728105013.22310-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160728105013.22310-1-anthony.perard@citrix.com> References: <20160728105013.22310-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Anthony PERARD , Andrew Cooper , Ian Jackson , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v7 12/15] hvmloader: bios->bios_load() now needs to be defined 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-Virus-Scanned: ClamAV using ClamSMTP All BIOSes 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 V5: - rename patch, was: "hvmloader: Specific bios_load function required" 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 5c57ab3..b5f51f6 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -341,22 +341,26 @@ int main(void) printf("Loading %s ...\n", bios->name); bios_module = get_module_entry(hvm_start_info, "firmware"); - 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, NULL, 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 )