* [PATCH master, stable-0.12] linuxboot: fix gdt address calculation
@ 2009-12-24 13:38 Avi Kivity
2009-12-24 13:56 ` Paolo Bonzini
2010-01-08 16:41 ` Anthony Liguori
0 siblings, 2 replies; 10+ messages in thread
From: Avi Kivity @ 2009-12-24 13:38 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm, Marcelo Tosatti
The gdt address calculation in linuxboot.bin is broken in two ways: first
it loads %cs into %eax, but that instruction leaves the high bits of %eax
undefined and we did not clear them. Secondly, we completely ignore the
incorrect %eax, and use the undefined %ebx instead.
With these issues fixed, linuxboot works again.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
pc-bios/optionrom/linuxboot.S | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index c4c9109..8aebe51 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -86,9 +86,10 @@ copy_kernel:
/* Now create the GDT descriptor */
movw $((3 * 8) - 1), -16(%bp)
mov %cs, %eax
+ movzwl %ax, %eax
shl $4, %eax
- addl $gdt, %ebx
- movl %ebx, -14(%bp)
+ addl $gdt, %eax
+ movl %eax, -14(%bp)
/* And load the GDT */
data32 lgdt -16(%bp)
--
1.6.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH master, stable-0.12] linuxboot: fix gdt address calculation
2009-12-24 13:38 [PATCH master, stable-0.12] linuxboot: fix gdt address calculation Avi Kivity
@ 2009-12-24 13:56 ` Paolo Bonzini
[not found] ` <1261664861-15493-1-git-send-email-pbonzini@redhat.com>
2010-01-08 16:41 ` Anthony Liguori
1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2009-12-24 13:56 UTC (permalink / raw)
To: Avi Kivity; +Cc: qemu-devel, kvm, Marcelo Tosatti
On 12/24/2009 02:38 PM, Avi Kivity wrote:
> The gdt address calculation in linuxboot.bin is broken in two ways: first
> it loads %cs into %eax, but that instruction leaves the high bits of %eax
> undefined and we did not clear them. Secondly, we completely ignore the
> incorrect %eax, and use the undefined %ebx instead.
>
> With these issues fixed, linuxboot works again.
Wow, I wonder how it worked for me...
Paolo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] write option roms in pc-bios/
[not found] ` <1261664861-15493-1-git-send-email-pbonzini@redhat.com>
@ 2010-01-07 20:03 ` Anthony Liguori
2010-01-08 7:31 ` [Qemu-devel] " Paolo Bonzini
0 siblings, 1 reply; 10+ messages in thread
From: Anthony Liguori @ 2010-01-07 20:03 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Juan Quintela, qemu-devel, Avi Kivity
On 12/24/2009 08:27 AM, Paolo Bonzini wrote:
>>> The gdt address calculation in linuxboot.bin is broken in two ways: first
>>> it loads %cs into %eax, but that instruction leaves the high bits of %eax
>>> undefined and we did not clear them. Secondly, we completely ignore the
>>> incorrect %eax, and use the undefined %ebx instead.
>>>
>>> With these issues fixed, linuxboot works again.
>>>
>> Wow, I wonder how it worked for me...
>>
> Got it. The option roms are built in pc-bios/optionrom, but QEMU loads
> the ones in pc-bios. So actually I was always testing Alexander's code
> even though I had done a "make -B" to feel safer. :-(
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>
This will wreak havoc on the tree since these are built by default and
they are replacing files in revision control.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: [PATCH] write option roms in pc-bios/
2010-01-07 20:03 ` [Qemu-devel] [PATCH] write option roms in pc-bios/ Anthony Liguori
@ 2010-01-08 7:31 ` Paolo Bonzini
2010-01-08 7:57 ` Aurelien Jarno
2010-01-08 12:29 ` Anthony Liguori
0 siblings, 2 replies; 10+ messages in thread
From: Paolo Bonzini @ 2010-01-08 7:31 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Avi Kivity, qemu-devel, Juan Quintela
On 01/07/2010 09:03 PM, Anthony Liguori wrote:
>
> This will wreak havoc on the tree since these are built by default and
> they are replacing files in revision control.
... the next question is why are they (linuxboot.bin and multiboot.bin)
in revision control since they do not require any strange tool to be built.
Paolo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] Re: [PATCH] write option roms in pc-bios/
2010-01-08 7:31 ` [Qemu-devel] " Paolo Bonzini
@ 2010-01-08 7:57 ` Aurelien Jarno
2010-01-08 8:19 ` Paolo Bonzini
2010-01-08 12:29 ` Anthony Liguori
1 sibling, 1 reply; 10+ messages in thread
From: Aurelien Jarno @ 2010-01-08 7:57 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Juan Quintela, qemu-devel, Avi Kivity
Paolo Bonzini a écrit :
> On 01/07/2010 09:03 PM, Anthony Liguori wrote:
>> This will wreak havoc on the tree since these are built by default and
>> they are replacing files in revision control.
>
> ... the next question is why are they (linuxboot.bin and multiboot.bin)
> in revision control since they do not require any strange tool to be built.
>
They require an i386 cross compiler, which is not available on all
installations.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] Re: [PATCH] write option roms in pc-bios/
2010-01-08 7:57 ` Aurelien Jarno
@ 2010-01-08 8:19 ` Paolo Bonzini
2010-01-08 9:12 ` Aurelien Jarno
0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2010-01-08 8:19 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Juan Quintela, qemu-devel, Avi Kivity
On 01/08/2010 08:57 AM, Aurelien Jarno wrote:
> Paolo Bonzini a écrit :
>> On 01/07/2010 09:03 PM, Anthony Liguori wrote:
>>> This will wreak havoc on the tree since these are built by default and
>>> they are replacing files in revision control.
>>
>> ... the next question is why are they (linuxboot.bin and multiboot.bin)
>> in revision control since they do not require any strange tool to be built.
>
> They require an i386 cross compiler, which is not available on all
> installations.
They are being built always anyway now, since their target
pc-bios/optionrom/linuxboot.bin does not exist on a checked out tree or
even a release tree. But no one has complained.
Paolo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] Re: [PATCH] write option roms in pc-bios/
2010-01-08 8:19 ` Paolo Bonzini
@ 2010-01-08 9:12 ` Aurelien Jarno
0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2010-01-08 9:12 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Avi Kivity, qemu-devel, Juan Quintela
Paolo Bonzini a écrit :
> On 01/08/2010 08:57 AM, Aurelien Jarno wrote:
>> Paolo Bonzini a écrit :
>>> On 01/07/2010 09:03 PM, Anthony Liguori wrote:
>>>> This will wreak havoc on the tree since these are built by default and
>>>> they are replacing files in revision control.
>>> ... the next question is why are they (linuxboot.bin and multiboot.bin)
>>> in revision control since they do not require any strange tool to be built.
>> They require an i386 cross compiler, which is not available on all
>> installations.
>
> They are being built always anyway now, since their target
> pc-bios/optionrom/linuxboot.bin does not exist on a checked out tree or
> even a release tree. But no one has complained.
They are only built on i386 and x86_64 hosts, look at the configure
script. We should continue providing all the ROM binaries, even the x86
ones. We can't require that every installation has a (cross-)compiler
for x86, the same way that we don't require a sparc or powerpc cross
compiler for x86 installations.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: [PATCH] write option roms in pc-bios/
2010-01-08 7:31 ` [Qemu-devel] " Paolo Bonzini
2010-01-08 7:57 ` Aurelien Jarno
@ 2010-01-08 12:29 ` Anthony Liguori
1 sibling, 0 replies; 10+ messages in thread
From: Anthony Liguori @ 2010-01-08 12:29 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Avi Kivity, qemu-devel, Juan Quintela
On 01/08/2010 01:31 AM, Paolo Bonzini wrote:
> On 01/07/2010 09:03 PM, Anthony Liguori wrote:
>>
>> This will wreak havoc on the tree since these are built by default and
>> they are replacing files in revision control.
>
> ... the next question is why are they (linuxboot.bin and
> multiboot.bin) in revision control since they do not require any
> strange tool to be built.
If you're just thinking about x86 and kvm, sure, but when you consider a
default build creates tcg targets for arm, sparc, mips, etc, and that
they all need firmware, it's extremely unlikely that any given user has
all of the cross compilers available to build all of the roms.
Yes, we could and should be smarter about building roms when we can and
making sure we install and use those whenever possible. We still need
to ship roms though for the foreseeable future.
Regards,
Anthony Liguori
> Paolo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation
2009-12-24 13:38 [PATCH master, stable-0.12] linuxboot: fix gdt address calculation Avi Kivity
@ 2010-01-08 16:41 ` Anthony Liguori
2010-01-08 16:41 ` Anthony Liguori
1 sibling, 0 replies; 10+ messages in thread
From: Anthony Liguori @ 2010-01-08 16:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: qemu-devel, Marcelo Tosatti, kvm
On 12/24/2009 07:38 AM, Avi Kivity wrote:
> The gdt address calculation in linuxboot.bin is broken in two ways: first
> it loads %cs into %eax, but that instruction leaves the high bits of %eax
> undefined and we did not clear them. Secondly, we completely ignore the
> incorrect %eax, and use the undefined %ebx instead.
>
> With these issues fixed, linuxboot works again.
>
> Signed-off-by: Avi Kivity<avi@redhat.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> pc-bios/optionrom/linuxboot.S | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
> index c4c9109..8aebe51 100644
> --- a/pc-bios/optionrom/linuxboot.S
> +++ b/pc-bios/optionrom/linuxboot.S
> @@ -86,9 +86,10 @@ copy_kernel:
> /* Now create the GDT descriptor */
> movw $((3 * 8) - 1), -16(%bp)
> mov %cs, %eax
> + movzwl %ax, %eax
> shl $4, %eax
> - addl $gdt, %ebx
> - movl %ebx, -14(%bp)
> + addl $gdt, %eax
> + movl %eax, -14(%bp)
>
> /* And load the GDT */
> data32 lgdt -16(%bp)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation
@ 2010-01-08 16:41 ` Anthony Liguori
0 siblings, 0 replies; 10+ messages in thread
From: Anthony Liguori @ 2010-01-08 16:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: Marcelo Tosatti, qemu-devel, kvm
On 12/24/2009 07:38 AM, Avi Kivity wrote:
> The gdt address calculation in linuxboot.bin is broken in two ways: first
> it loads %cs into %eax, but that instruction leaves the high bits of %eax
> undefined and we did not clear them. Secondly, we completely ignore the
> incorrect %eax, and use the undefined %ebx instead.
>
> With these issues fixed, linuxboot works again.
>
> Signed-off-by: Avi Kivity<avi@redhat.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> pc-bios/optionrom/linuxboot.S | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
> index c4c9109..8aebe51 100644
> --- a/pc-bios/optionrom/linuxboot.S
> +++ b/pc-bios/optionrom/linuxboot.S
> @@ -86,9 +86,10 @@ copy_kernel:
> /* Now create the GDT descriptor */
> movw $((3 * 8) - 1), -16(%bp)
> mov %cs, %eax
> + movzwl %ax, %eax
> shl $4, %eax
> - addl $gdt, %ebx
> - movl %ebx, -14(%bp)
> + addl $gdt, %eax
> + movl %eax, -14(%bp)
>
> /* And load the GDT */
> data32 lgdt -16(%bp)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-01-08 16:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-24 13:38 [PATCH master, stable-0.12] linuxboot: fix gdt address calculation Avi Kivity
2009-12-24 13:56 ` Paolo Bonzini
[not found] ` <1261664861-15493-1-git-send-email-pbonzini@redhat.com>
2010-01-07 20:03 ` [Qemu-devel] [PATCH] write option roms in pc-bios/ Anthony Liguori
2010-01-08 7:31 ` [Qemu-devel] " Paolo Bonzini
2010-01-08 7:57 ` Aurelien Jarno
2010-01-08 8:19 ` Paolo Bonzini
2010-01-08 9:12 ` Aurelien Jarno
2010-01-08 12:29 ` Anthony Liguori
2010-01-08 16:41 ` [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation Anthony Liguori
2010-01-08 16:41 ` Anthony Liguori
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.