From patchwork Wed Jun 22 17:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9193413 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 7C7496075C for ; Wed, 22 Jun 2016 17:48:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7155C28408 for ; Wed, 22 Jun 2016 17:48:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65DD728417; Wed, 22 Jun 2016 17:48:22 +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 E360928408 for ; Wed, 22 Jun 2016 17:48:21 +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 1bFmEM-0007xR-8y; Wed, 22 Jun 2016 17:46:26 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFmEL-0007wh-2I for xen-devel@lists.xen.org; Wed, 22 Jun 2016 17:46:25 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 4C/BF-02783-0FECA675; Wed, 22 Jun 2016 17:46:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRWlGSWpSXmKPExsXitHSDve77c1n hBg1TdSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ox3ExewF8zhq+i6spu9gbGRu4uRk0NCwF/i 85czbCA2m4CBxIrpVxlBbBEBWYnVXXPYuxi5OJgFjjBK3Lr5EywhLOAncbtzJlgDi4CqxIkZq 8BsXgE7iZ4rbWwQQ+UkGs7fZwaxOYHiy171gMWFBGwlbi9YwAhhq0ncWLiMBaJXUOLkzCdgNr OAhMTBFy+YIeZwS9w+PZV5AiPfLCRls5CULWBkWsWoUZxaVJZapGtoqpdUlJmeUZKbmJmja2h grJebWlycmJ6ak5hUrJecn7uJERhWDECwg3HNds9DjJIcTEqivIzbssKF+JLyUyozEosz4otK c1KLDzHKcHAoSfBeOwuUEyxKTU+tSMvMAQY4TFqCg0dJhFcMGORCvMUFibnFmekQqVOMilLiv N9A+gRAEhmleXBtsKi6xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWHexyBTeDLzSuCmvwJazA S0eFl/OsjikkSElFQDo8zBDfGqzjP+Le1+/FTuX5XXdr5zr4+23Mi8euCcyMGMmq5sYXG/zzn N5yYoXY3YmrnpxIubv3MsUpTSX3y/OsOM81vodk8Hjg2B0hvFTZhn+TPWlVs6s3eK8t1VXx6+ MlF8Qutnf8U4GZnAWxVTjm1cbmS18MvsDQoCtyUV0uR/x02Otoy2VGIpzkg01GIuKk4EANf6v LelAgAA X-Env-Sender: prvs=9742ee4c2=anthony.perard@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1466617578!43535765!3 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.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 736 invoked from network); 22 Jun 2016 17:46:23 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 22 Jun 2016 17:46:23 -0000 X-IronPort-AV: E=Sophos;i="5.26,509,1459814400"; d="scan'208";a="369024801" From: Anthony PERARD To: Date: Wed, 22 Jun 2016 18:15:43 +0100 Message-ID: <20160622171545.5304-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160622171545.5304-1-anthony.perard@citrix.com> References: <20160622171545.5304-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 v5 12/14] 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 7fdc847..eacfe72 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -334,22 +334,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 )