From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation Date: Fri, 08 Jan 2010 10:41:12 -0600 Message-ID: <4B476028.2090605@linux.vnet.ibm.com> References: <1261661930-11888-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from e6.ny.us.ibm.com ([32.97.182.146]:34566 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953Ab0AHQlg (ORCPT ); Fri, 8 Jan 2010 11:41:36 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e6.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o08GbYSr027507 for ; Fri, 8 Jan 2010 11:37:34 -0500 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o08GfZ6l086074 for ; Fri, 8 Jan 2010 11:41:35 -0500 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 o08GfDnm010832 for ; Fri, 8 Jan 2010 09:41:13 -0700 In-Reply-To: <1261661930-11888-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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) >