All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Allow larger BIOS image
@ 2009-07-27  0:23 Jordan Justen
  2009-07-27  0:23 ` [PATCH 1/3] Update BIOS INT15-E820 to allow a " Jordan Justen
  2009-08-03 15:13 ` [PATCH 0/3] Allow " Avi Kivity
  0 siblings, 2 replies; 8+ messages in thread
From: Jordan Justen @ 2009-07-27  0:23 UTC (permalink / raw)
  To: kvm-devel; +Cc: Jordan Justen

From: Jordan Justen <jljusten@gmail.com>

These changes are similar to my patches sent July 16, except they
now are based on Yang Sheng's recent changes to enable a new
ioctl for controlling the EPT identity mapping page location.

-Jordan

Jordan Justen (3):
  Update BIOS INT15-E820 to allow a larger BIOS image
  Move TSS pages to allow a larger BIOS image
  Move EPT identity mapping pages to allow a larger BIOS image

 kvm/bios/rombios.c |    8 ++++----
 qemu-kvm-x86.c     |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] Update BIOS INT15-E820 to allow a larger BIOS image
  2009-07-27  0:23 [PATCH 0/3] Allow larger BIOS image Jordan Justen
@ 2009-07-27  0:23 ` Jordan Justen
  2009-07-27  0:23   ` [PATCH 2/3] Move TSS pages " Jordan Justen
  2009-07-28 14:40   ` [PATCH 1/3] Update BIOS INT15-E820 " Marcelo Tosatti
  2009-08-03 15:13 ` [PATCH 0/3] Allow " Avi Kivity
  1 sibling, 2 replies; 8+ messages in thread
From: Jordan Justen @ 2009-07-27  0:23 UTC (permalink / raw)
  To: kvm-devel; +Cc: Jordan Justen

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.  This 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:
  0xfffbc000-0xfffbcfff -   4KB - EPT identity mapping pages
  0xfffbd000-0xfffbffff -  12KB - TSS pages
  0xfffc0000-0xffffffff - 256KB - Max bios.bin (usually top 128KB is used)

Now the BIOS will reserve:
  0xfeffc000-0xfeffcfff -   4KB - EPT identity mapping pages
  0xfeffd000-0xfeffffff -  12KB - TSS Pages
  0xff000000-0xffffffff -  16MB - Max bios.bin

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 kvm/bios/rombios.c |    8 ++++----
 1 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
                     case 5:
                         /* 4 pages before the bios, 3 pages for vmx tss pages,
 			 * the other page for EPT real mode pagetable */
-                        set_e820_range(ES, regs.u.r16.di, 0xfffbc000L,
-                                       0xfffc0000L, 0, 0, 2);
+                        set_e820_range(ES, regs.u.r16.di, 0xfeffc000L,
+                                       0xff000000L, 0, 0, 2);
                         regs.u.r32.ebx = 6;
                         break;
                     case 6:
-                        /* 256KB BIOS area at the end of 4 GB */
+                        /* 16MB BIOS area at the end of 4 GB */
                         set_e820_range(ES, regs.u.r16.di,
-                                       0xfffc0000L, 0x00000000L ,0, 0, 2);
+                                       0xff000000L, 0x00000000L ,0, 0, 2);
                         if (extra_highbits_memory_size || extra_lowbits_memory_size)
                             regs.u.r32.ebx = 7;
                         else
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] Move TSS pages to allow a larger BIOS image
  2009-07-27  0:23 ` [PATCH 1/3] Update BIOS INT15-E820 to allow a " Jordan Justen
@ 2009-07-27  0:23   ` Jordan Justen
  2009-07-27  0:23     ` [PATCH 3/3] Move EPT identity mapping " Jordan Justen
  2009-07-28 14:40   ` [PATCH 1/3] Update BIOS INT15-E820 " Marcelo Tosatti
  1 sibling, 1 reply; 8+ messages in thread
From: Jordan Justen @ 2009-07-27  0:23 UTC (permalink / raw)
  To: kvm-devel; +Cc: Jordan Justen

Move from:
  0xfffbd000-0xfffbffff
to:
  0xfeffd000-0xfeffffff

This step is required to free up the 0xff000000-0xffffffff (16MB) range
for use with bios.bin.

This change depends upon a change to kvm/bios/rombios.c so the bios
INT15-E820 function will properly reserve the new location.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 qemu-kvm-x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 492dbc5..0b47b57 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -62,7 +62,7 @@ static int kvm_init_tss(kvm_context_t kvm)
 		 * this address is 3 pages before the bios, and the bios should present
 		 * as unavaible memory
 		 */
-		r = kvm_set_tss_addr(kvm, 0xfffbd000);
+		r = kvm_set_tss_addr(kvm, 0xfeffd000);
 		if (r < 0) {
 			fprintf(stderr, "kvm_init_tss: unable to set tss addr\n");
 			return r;
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] Move EPT identity mapping pages to allow a larger BIOS image
  2009-07-27  0:23   ` [PATCH 2/3] Move TSS pages " Jordan Justen
@ 2009-07-27  0:23     ` Jordan Justen
  0 siblings, 0 replies; 8+ messages in thread
From: Jordan Justen @ 2009-07-27  0:23 UTC (permalink / raw)
  To: kvm-devel; +Cc: Jordan Justen

Move from:
  0xfffbc000-0xfffbcfff
to:
  0xfeffc000-0xfeffcfff

This step is required to free up the 0xff000000-0xffffffff (16MB) range
for use with bios.bin.

The KVM kernel change depends upon a change to kvm/bios/rombios.c so the bios
INT15-E820 function will properly reserve the new location.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 qemu-kvm-x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 0b47b57..65ba470 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -102,7 +102,7 @@ static int kvm_init_identity_map_page(kvm_context_t kvm)
 		 * this address is 4 pages before the bios, and the bios should present
 		 * as unavaible memory
 		 */
-		r = kvm_set_identity_map_addr(kvm, 0xfffbc000);
+		r = kvm_set_identity_map_addr(kvm, 0xfeffc000);
 		if (r < 0) {
 			fprintf(stderr, "kvm_init_identity_map_page: "
 				"unable to set identity mapping addr\n");
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] Update BIOS INT15-E820 to allow a larger BIOS image
  2009-07-27  0:23 ` [PATCH 1/3] Update BIOS INT15-E820 to allow a " Jordan Justen
  2009-07-27  0:23   ` [PATCH 2/3] Move TSS pages " Jordan Justen
@ 2009-07-28 14:40   ` Marcelo Tosatti
  2009-07-28 16:51     ` Jordan Justen
  1 sibling, 1 reply; 8+ messages in thread
From: Marcelo Tosatti @ 2009-07-28 14:40 UTC (permalink / raw)
  To: Jordan Justen; +Cc: kvm-devel, Yang, Sheng

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.  This 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:
>   0xfffbc000-0xfffbcfff -   4KB - EPT identity mapping pages
>   0xfffbd000-0xfffbffff -  12KB - TSS pages
>   0xfffc0000-0xffffffff - 256KB - Max bios.bin (usually top 128KB is used)
> 
> Now the BIOS will reserve:
>   0xfeffc000-0xfeffcfff -   4KB - EPT identity mapping pages
>   0xfeffd000-0xfeffffff -  12KB - TSS Pages
>   0xff000000-0xffffffff -  16MB - Max bios.bin
> 
> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
> ---
>  kvm/bios/rombios.c |    8 ++++----
>  1 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
>                      case 5:
>                          /* 4 pages before the bios, 3 pages for vmx tss pages,
>  			 * the other page for EPT real mode pagetable */
> -                        set_e820_range(ES, regs.u.r16.di, 0xfffbc000L,
> -                                       0xfffc0000L, 0, 0, 2);
> +                        set_e820_range(ES, regs.u.r16.di, 0xfeffc000L,
> +                                       0xff000000L, 0, 0, 2);
>                          regs.u.r32.ebx = 6;

So if you use an older kernel, and the kvm_set_identity_map_addr fails,
you get the e820 entry wrong right? Perhaps you should use the hw/fw_cfg.c 
interface to communicate with the BIOS.


>                          break;
>                      case 6:
> -                        /* 256KB BIOS area at the end of 4 GB */
> +                        /* 16MB BIOS area at the end of 4 GB */
>                          set_e820_range(ES, regs.u.r16.di,
> -                                       0xfffc0000L, 0x00000000L ,0, 0, 2);
> +                                       0xff000000L, 0x00000000L ,0, 0, 2);
>                          if (extra_highbits_memory_size || extra_lowbits_memory_size)
>                              regs.u.r32.ebx = 7;
>                          else
> -- 
> 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  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] Update BIOS INT15-E820 to allow a larger BIOS image
  2009-07-28 14:40   ` [PATCH 1/3] Update BIOS INT15-E820 " Marcelo Tosatti
@ 2009-07-28 16:51     ` Jordan Justen
  2009-07-28 16:57       ` Marcelo Tosatti
  0 siblings, 1 reply; 8+ messages in thread
From: Jordan Justen @ 2009-07-28 16:51 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Jordan Justen, kvm-devel, Yang, Sheng

On Tue, Jul 28, 2009 at 7:40 AM, Marcelo Tosatti<mtosatti@redhat.com> 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.  This 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:
>>   0xfffbc000-0xfffbcfff -   4KB - EPT identity mapping pages
>>   0xfffbd000-0xfffbffff -  12KB - TSS pages
>>   0xfffc0000-0xffffffff - 256KB - Max bios.bin (usually top 128KB is used)
>>
>> Now the BIOS will reserve:
>>   0xfeffc000-0xfeffcfff -   4KB - EPT identity mapping pages
>>   0xfeffd000-0xfeffffff -  12KB - TSS Pages
>>   0xff000000-0xffffffff -  16MB - Max bios.bin
>>
>> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
>> ---
>>  kvm/bios/rombios.c |    8 ++++----
>>  1 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
>>                      case 5:
>>                          /* 4 pages before the bios, 3 pages for vmx tss pages,
>>                        * the other page for EPT real mode pagetable */
>> -                        set_e820_range(ES, regs.u.r16.di, 0xfffbc000L,
>> -                                       0xfffc0000L, 0, 0, 2);
>> +                        set_e820_range(ES, regs.u.r16.di, 0xfeffc000L,
>> +                                       0xff000000L, 0, 0, 2);
>>                          regs.u.r32.ebx = 6;
>
> So if you use an older kernel, and the kvm_set_identity_map_addr fails,
> you get the e820 entry wrong right? Perhaps you should use the hw/fw_cfg.c
> interface to communicate with the BIOS.
>

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 the
EPT page tables are at.  So, the OS will still know to keep away from
this region.

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.

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.
 (Previously kvm-bios would reserve 256KB while the BIOS was normally
only 128KB in size.)

>
>>                          break;
>>                      case 6:
>> -                        /* 256KB BIOS area at the end of 4 GB */
>> +                        /* 16MB BIOS area at the end of 4 GB */
>>                          set_e820_range(ES, regs.u.r16.di,
>> -                                       0xfffc0000L, 0x00000000L ,0, 0, 2);
>> +                                       0xff000000L, 0x00000000L ,0, 0, 2);
>>                          if (extra_highbits_memory_size || extra_lowbits_memory_size)
>>                              regs.u.r32.ebx = 7;
>>                          else
>> --
>> 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  http://vger.kernel.org/majordomo-info.html
> --
> 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  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] Update BIOS INT15-E820 to allow a larger BIOS image
  2009-07-28 16:51     ` Jordan Justen
@ 2009-07-28 16:57       ` Marcelo Tosatti
  0 siblings, 0 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2009-07-28 16:57 UTC (permalink / raw)
  To: Jordan Justen; +Cc: Jordan Justen, kvm-devel, Yang, Sheng

On Tue, Jul 28, 2009 at 09:51:26AM -0700, Jordan Justen wrote:
> On Tue, Jul 28, 2009 at 7:40 AM, Marcelo Tosatti<mtosatti@redhat.com> 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.  This 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:
> >>   0xfffbc000-0xfffbcfff -   4KB - EPT identity mapping pages
> >>   0xfffbd000-0xfffbffff -  12KB - TSS pages
> >>   0xfffc0000-0xffffffff - 256KB - Max bios.bin (usually top 128KB is used)
> >>
> >> Now the BIOS will reserve:
> >>   0xfeffc000-0xfeffcfff -   4KB - EPT identity mapping pages
> >>   0xfeffd000-0xfeffffff -  12KB - TSS Pages
> >>   0xff000000-0xffffffff -  16MB - Max bios.bin
> >>
> >> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
> >> ---
> >>  kvm/bios/rombios.c |    8 ++++----
> >>  1 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
> >>                      case 5:
> >>                          /* 4 pages before the bios, 3 pages for vmx tss pages,
> >>                        * the other page for EPT real mode pagetable */
> >> -                        set_e820_range(ES, regs.u.r16.di, 0xfffbc000L,
> >> -                                       0xfffc0000L, 0, 0, 2);
> >> +                        set_e820_range(ES, regs.u.r16.di, 0xfeffc000L,
> >> +                                       0xff000000L, 0, 0, 2);
> >>                          regs.u.r32.ebx = 6;
> >
> > So if you use an older kernel, and the kvm_set_identity_map_addr fails,
> > you get the e820 entry wrong right? Perhaps you should use the hw/fw_cfg.c
> > interface to communicate with the BIOS.
> >
> 
> 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 the
> EPT page tables are at.  So, the OS will still know to keep away from
> this region.
> 
> 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.
> 
> 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.
>  (Previously kvm-bios would reserve 256KB while the BIOS was normally
> only 128KB in size.)

Indeed. Looks good to me.

> 
> >
> >>                          break;
> >>                      case 6:
> >> -                        /* 256KB BIOS area at the end of 4 GB */
> >> +                        /* 16MB BIOS area at the end of 4 GB */
> >>                          set_e820_range(ES, regs.u.r16.di,
> >> -                                       0xfffc0000L, 0x00000000L ,0, 0, 2);
> >> +                                       0xff000000L, 0x00000000L ,0, 0, 2);
> >>                          if (extra_highbits_memory_size || extra_lowbits_memory_size)
> >>                              regs.u.r32.ebx = 7;
> >>                          else
> >> --
> >> 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  http://vger.kernel.org/majordomo-info.html
> > --
> > 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  http://vger.kernel.org/majordomo-info.html
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] Allow larger BIOS image
  2009-07-27  0:23 [PATCH 0/3] Allow larger BIOS image Jordan Justen
  2009-07-27  0:23 ` [PATCH 1/3] Update BIOS INT15-E820 to allow a " Jordan Justen
@ 2009-08-03 15:13 ` Avi Kivity
  1 sibling, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2009-08-03 15:13 UTC (permalink / raw)
  To: Jordan Justen; +Cc: kvm-devel, Jordan Justen

On 07/27/2009 03:23 AM, Jordan Justen wrote:
> From: Jordan Justen<jljusten@gmail.com>
>
> These changes are similar to my patches sent July 16, except they
> now are based on Yang Sheng's recent changes to enable a new
> ioctl for controlling the EPT identity mapping page location.
>    

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-03 15:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27  0:23 [PATCH 0/3] Allow larger BIOS image Jordan Justen
2009-07-27  0:23 ` [PATCH 1/3] Update BIOS INT15-E820 to allow a " Jordan Justen
2009-07-27  0:23   ` [PATCH 2/3] Move TSS pages " Jordan Justen
2009-07-27  0:23     ` [PATCH 3/3] Move EPT identity mapping " Jordan Justen
2009-07-28 14:40   ` [PATCH 1/3] Update BIOS INT15-E820 " Marcelo Tosatti
2009-07-28 16:51     ` Jordan Justen
2009-07-28 16:57       ` Marcelo Tosatti
2009-08-03 15:13 ` [PATCH 0/3] Allow " Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.