From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: The way of mapping BIOS into the guest's address space Date: Tue, 14 Feb 2012 16:13:42 +0400 Message-ID: <20120214121342.GE1878@moon> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Yang Bai , kvm@vger.kernel.org, Ingo Molnar , Sasha Levin , Asias He To: Pekka Enberg Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:34689 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715Ab2BNMNr (ORCPT ); Tue, 14 Feb 2012 07:13:47 -0500 Received: by bkcjm19 with SMTP id jm19so5382136bkc.19 for ; Tue, 14 Feb 2012 04:13:46 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Feb 14, 2012 at 01:10:59PM +0200, Pekka Enberg wrote: > On Tue, Feb 14, 2012 at 1:03 PM, Yang Bai wrote: > > Since on X86, bios is always at the end of the address space, so I > > have some thought about how to implement the seabios support for kvm > > tool. > > > > 1. using kvm__register_mem to map the end of address space to the > > guest then copy the code of seabios to this mem region. Just emulating > > the bios chip. I think this is what should be done. > > > > 2. leave the bios code alone and don't touch the guest's address > > space. If the guest accesses the address belonging to the bios, it > > will be an IO request and we can emulate the IO access to the bios > > chip. > > > > Any ideas about this? > > The latter solution doesn't make any sense to me. Cyrill, do we really > need to put the BIOS at the end of the address space? Don't we have > unused space below 1 MB? I don't remember for sure how SeaBIOS works actually. What I rememer is that it aquires all hw environment might have. So without real look into seabios code I fear I can't answer. But reserving end of 4G address space for bios copy sounds reasonable if we going to behave as real hardware. Maybe we could poke someone from KVM camp for a hint? Cyrill