From patchwork Mon Nov 6 11:48:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10043381 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 3D6E8602BF for ; Mon, 6 Nov 2017 11:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28B0629BA4 for ; Mon, 6 Nov 2017 11:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D29D29BBB; Mon, 6 Nov 2017 11:48:54 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD85129BA4 for ; Mon, 6 Nov 2017 11:48:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbdKFLsu (ORCPT ); Mon, 6 Nov 2017 06:48:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60964 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbdKFLst (ORCPT ); Mon, 6 Nov 2017 06:48:49 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE6CB49026; Mon, 6 Nov 2017 11:48:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE6CB49026 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com Received: from sirius.home.kraxel.org (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id C324C5D6A9; Mon, 6 Nov 2017 11:48:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EE2F417532; Mon, 6 Nov 2017 12:48:45 +0100 (CET) From: Gerd Hoffmann To: kvm@vger.kernel.org Cc: jean-philippe.brucker@arm.com, Gerd Hoffmann Subject: [PATCH] kvmtool: handle x86 firmware smaller than 128k Date: Mon, 6 Nov 2017 12:48:37 +0100 Message-Id: <20171106114837.6882-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 06 Nov 2017 11:48:49 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- x86/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/boot.c b/x86/boot.c index 61535eb57b..b7a4262d89 100644 --- a/x86/boot.c +++ b/x86/boot.c @@ -28,7 +28,7 @@ bool kvm__load_firmware(struct kvm *kvm, const char *firmware_filename) if (st.st_size > MB_FIRMWARE_BIOS_SIZE) die("firmware image %s is too big to fit in memory (%Lu KB).\n", firmware_filename, (u64)(st.st_size / 1024)); - p = guest_flat_to_host(kvm, MB_FIRMWARE_BIOS_BEGIN); + p = guest_flat_to_host(kvm, MB_BIOS_END + 1 - st.st_size); while ((nr = read(fd, p, st.st_size)) > 0) p += nr;