From patchwork Wed Nov 25 12:49:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 39313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EF5641007D1 for ; Wed, 25 Nov 2009 23:50:37 +1100 (EST) Received: from localhost ([127.0.0.1]:38041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHKN-0005Bt-2u for incoming@patchwork.ozlabs.org; Wed, 25 Nov 2009 07:50:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDHJc-00052S-F3 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDHJX-0004zX-99 for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:47 -0500 Received: from [199.232.76.173] (port=54918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHJX-0004zO-1e for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28962) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDHJW-00008s-5g for qemu-devel@nongnu.org; Wed, 25 Nov 2009 07:49:42 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAPCneWa004809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Nov 2009 07:49:41 -0500 Received: from localhost.localdomain (dhcp-lab-108.englab.brq.redhat.com [10.34.33.108]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAPCndCs030310; Wed, 25 Nov 2009 07:49:39 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 25 Nov 2009 13:49:38 +0100 Message-Id: <1259153378-27567-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <515008F0-22BE-4F07-AD39-F7FDB578E362@suse.de> References: <515008F0-22BE-4F07-AD39-F7FDB578E362@suse.de> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: agraf@suse.de Subject: [Qemu-devel] [PATCH] Fix thinko in linuxboot.S X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The %gs segment that was used was not matching the comments. I just moved the GDT descriptor on the stack instead. Signed-off-by: Paolo Bonzini --- pc-bios/optionrom/linuxboot.S | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S index b3c90e3..14e1ae8 100644 --- a/pc-bios/optionrom/linuxboot.S +++ b/pc-bios/optionrom/linuxboot.S @@ -79,24 +79,20 @@ copy_kernel: mode, so let's get into 32 bit mode, write the kernel and jump back again. */ - /* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */ - mov %ss, %eax - shl $4, %eax - add %esp, %eax - sub $0x10, %eax - shr $4, %eax + /* Reserve space on the stack for our GDT descriptor. */ + mov %esp, %ebp + sub $16, %esp /* Now create the GDT descriptor */ + movw $((3 * 8) - 1), -16(%bp) mov %cs, %eax shl $4, %eax - movw $((3 * 8) - 1), %bx - movw %bx, %gs:0 - movl $gdt, %ebx - add %eax, %ebx - movl %ebx, %gs:2 + addl $gdt, %ebx + movl %ebx, -14(%bp) /* And load the GDT */ - data32 lgdt %gs:0 + data32 lgdt -16(%bp) + mov %ebp, %esp /* Get us to protected mode now */ mov $1, %eax