From patchwork Tue Jul 12 14:42:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9225539 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 363626086B for ; Tue, 12 Jul 2016 14:49:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27F2127D29 for ; Tue, 12 Jul 2016 14:49:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D03527DCD; Tue, 12 Jul 2016 14:49:02 +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 9A2F427D29 for ; Tue, 12 Jul 2016 14:49:01 +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 1bMyxO-0004By-9F; Tue, 12 Jul 2016 14:46:42 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMyxN-0004An-IF for xen-devel@lists.xen.org; Tue, 12 Jul 2016 14:46:41 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 17/49-11548-0D205875; Tue, 12 Jul 2016 14:46:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDve4FptZ wg1O7pC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy12w6wFszlq1hwrKqBsZG7i5GTQ0LAX+Lq 33vMIDabgIHEiulXGUFsEQFZidVdc9i7GLk4mAWOMErcuvkTLCEs4Cdx9P98VhCbRUBV4mV3A wuIzStgK/Fn9VUmiKFyEg3n74MN5QSKt7U+BbOFBGwk1i6dxQphq0ncWLgMqldQ4uTMJ2A2s4 CExMEXL5gh5nBL3D49lXkCI98sJGWzkJQtYGRaxahenFpUllqka6iXVJSZnlGSm5iZo2toYKa Xm1pcnJiempOYVKyXnJ+7iREYUgxAsINx53OnQ4ySHExKorzNzC3hQnxJ+SmVGYnFGfFFpTmp xYcYZTg4lCR4/Rhbw4UEi1LTUyvSMnOAwQ2TluDgURLhtQdJ8xYXJOYWZ6ZDpE4xKkqJ82qCJ ARAEhmleXBtsIi6xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWHe6SBTeDLzSuCmvwJazAS0uN ahGWRxSSJCSqqB0fbgJ9XcmRODvLWS789Sy+LY+3DX8bP/b5Wt9C849Zsj4chs1tiOSSU+Wod 2ODHNbLsgXsieL/Nri4Kr6YwJT26qf+b5EvXVYu9MruCJp1p1bK84Ppm/V2xhmsGv+G/Tp3t+ aJV+EiBQe+6so2/VkzO7XF7wHv9Wtba6O0GpKOX+M/9+lrxVv5VYijMSDbWYi4oTARmUTCijA gAA X-Env-Sender: prvs=994f31c19=anthony.perard@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1468334798!23491681!1 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.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45983 invoked from network); 12 Jul 2016 14:46:40 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 12 Jul 2016 14:46:40 -0000 X-IronPort-AV: E=Sophos;i="5.28,352,1464652800"; d="scan'208";a="372679434" From: Anthony PERARD To: Date: Tue, 12 Jul 2016 15:42:49 +0100 Message-ID: <20160712144251.558-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160712144251.558-1-anthony.perard@citrix.com> References: <20160712144251.558-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 v6 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 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 )