From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTHuU-0001O9-Kr for qemu-devel@nongnu.org; Fri, 08 Jan 2010 11:42:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTHuQ-0001Mm-Vu for qemu-devel@nongnu.org; Fri, 08 Jan 2010 11:42:02 -0500 Received: from [199.232.76.173] (port=43920 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTHuQ-0001Mj-Mu for qemu-devel@nongnu.org; Fri, 08 Jan 2010 11:41:58 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:45053) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTHuN-0002oH-Ub for qemu-devel@nongnu.org; Fri, 08 Jan 2010 11:41:58 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e35.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o08GSBxJ024510 for ; Fri, 8 Jan 2010 09:28:11 -0700 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id o08GfQkw161566 for ; Fri, 8 Jan 2010 09:41:28 -0700 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o08GfDni010832 for ; Fri, 8 Jan 2010 09:41:13 -0700 Message-ID: <4B476028.2090605@linux.vnet.ibm.com> Date: Fri, 08 Jan 2010 10:41:12 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation References: <1261661930-11888-1-git-send-email-avi@redhat.com> In-Reply-To: <1261661930-11888-1-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org 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 > 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) >