From: Darren Kenny Subject: Re: [PATCH v3] kvmtool: handle x86 firmware smaller than 128k Date: Tue, 7 Nov 2017 08:23:06 +0000 Message-ID: <20171107082306.viylluudanftlsiz@starbug-vm.ie.oracle.com> References: <20171107080424.1573-1-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Cc: kvm@vger.kernel.org, jean-philippe.brucker@arm.com To: Gerd Hoffmann Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:44501 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933049AbdKGIXQ (ORCPT ); Tue, 7 Nov 2017 03:23:16 -0500 Content-Disposition: inline In-Reply-To: <20171107080424.1573-1-kraxel@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: LGTM, Reviewed-by: Darren Kenny Thanks, Darren. On Tue, Nov 07, 2017 at 09:04:24AM +0100, Gerd Hoffmann wrote: >Firmware images smaller than the bios memory region (0xe0000 -> 0xfffff) >must be mapped at the end of the region because the x86 cpu reset vector >is 0xffff0. > >Signed-off-by: Gerd Hoffmann >--- > 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; >-- >2.9.3 >