From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/3] Update BIOS INT15-E820 to allow a larger BIOS image Date: Tue, 28 Jul 2009 13:57:33 -0300 Message-ID: <20090728165733.GA7351@amt.cnet> References: <1248654233-29845-1-git-send-email-jordan.l.justen@intel.com> <1248654233-29845-2-git-send-email-jordan.l.justen@intel.com> <20090728144034.GA5084@amt.cnet> <2a50f7880907280951p7476240fh7f9ff354319b129@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jordan Justen , kvm-devel , "Yang, Sheng" To: Jordan Justen Return-path: Received: from mx2.redhat.com ([66.187.237.31]:51050 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbZG1Q6R (ORCPT ); Tue, 28 Jul 2009 12:58:17 -0400 Content-Disposition: inline In-Reply-To: <2a50f7880907280951p7476240fh7f9ff354319b129@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 28, 2009 at 09:51:26AM -0700, Jordan Justen wrote: > On Tue, Jul 28, 2009 at 7:40 AM, Marcelo Tosatti= wrote: > > On Sun, Jul 26, 2009 at 05:23:51PM -0700, Jordan Justen wrote: > >> The bios will now reserve more memory via the E820 functions. > >> > >> Note that the standard KVM BIOS will most likely not make use of > >> this expanded BIOS region. =A0This change will synchronize > >> the BIOS INT15-E820 reservations to match other changes that > >> will allow alternate BIOS images to be larger in size. > >> > >> Previously the BIOS reserved: > >> =A0 0xfffbc000-0xfffbcfff - =A0 4KB - EPT identity mapping pages > >> =A0 0xfffbd000-0xfffbffff - =A012KB - TSS pages > >> =A0 0xfffc0000-0xffffffff - 256KB - Max bios.bin (usually top 128K= B is used) > >> > >> Now the BIOS will reserve: > >> =A0 0xfeffc000-0xfeffcfff - =A0 4KB - EPT identity mapping pages > >> =A0 0xfeffd000-0xfeffffff - =A012KB - TSS Pages > >> =A0 0xff000000-0xffffffff - =A016MB - Max bios.bin > >> > >> Signed-off-by: Jordan Justen > >> --- > >> =A0kvm/bios/rombios.c | =A0 =A08 ++++---- > >> =A01 files changed, 4 insertions(+), 4 deletions(-) > >> > >> diff --git a/kvm/bios/rombios.c b/kvm/bios/rombios.c > >> index 6186199..2d0c153 100644 > >> --- a/kvm/bios/rombios.c > >> +++ b/kvm/bios/rombios.c > >> @@ -4596,14 +4596,14 @@ ASM_END > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 5: > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* 4 pages befo= re the bios, 3 pages for vmx tss pages, > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the other page fo= r EPT real mode pagetable */ > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0set_e820_range(ES= , regs.u.r16.di, 0xfffbc000L, > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 0xfffc0000L, 0, 0, 2); > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0set_e820_range(ES= , regs.u.r16.di, 0xfeffc000L, > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 0xff000000L, 0, 0, 2); > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0regs.u.r32.ebx = =3D 6; > > > > So if you use an older kernel, and the kvm_set_identity_map_addr fa= ils, > > you get the e820 entry wrong right? Perhaps you should use the hw/f= w_cfg.c > > interface to communicate with the BIOS. > > >=20 > If you use this newer BIOS code with the older kernel code, the > expanded E820 BIOS region of the will cover the older region where th= e > EPT page tables are at. So, the OS will still know to keep away from > this region. >=20 > There should be no impact if someone uses a newer qemu-kvm with and > older kvm module. Since the normal legacy kvm BIOS is only 128KB, it > will be able to boot fine. (There will be no conflict with reserving > the memory region for the small BIOS.) If a bios.bin is used that is > larger than 256KB, then it will fail in the same way as today, since > there will be a conflict while trying to reserve the 0xfffbc000 - > 0xfffbcfff region. >=20 > The only difference in this case would be that E820 reserves a larger > chunk of memory space, but I can't see how this could cause a problem= =2E > (Previously kvm-bios would reserve 256KB while the BIOS was normally > only 128KB in size.) Indeed. Looks good to me. >=20 > > > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 6: > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* 256KB BIOS are= a at the end of 4 GB */ > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* 16MB BIOS area= at the end of 4 GB */ > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0set_e820_range(= ES, regs.u.r16.di, > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 0xfffc0000L, 0x00000000L ,0, 0, 2); > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 0xff000000L, 0x00000000L ,0, 0, 2); > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (extra_highb= its_memory_size || extra_lowbits_memory_size) > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0regs.u.= r32.ebx =3D 7; > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> -- > >> 1.6.0.4 > >> > >> -- > >> To unsubscribe from this list: send the line "unsubscribe kvm" in > >> the body of a message to majordomo@vger.kernel.org > >> More majordomo info at =A0http://vger.kernel.org/majordomo-info.ht= ml > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at =A0http://vger.kernel.org/majordomo-info.htm= l > >