qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: kwolf@suse.de
Subject: [Qemu-devel] [PATCH] Fix jmp im on x86_64 when executing 32-bit code
Date: Tue, 09 Dec 2008 14:14:19 +0100	[thread overview]
Message-ID: <493E6F2B.5090300@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

When running grub-install (32-bit) on an x86_64 Linux system in qemu, it
hangs on a pagefault forever, because an integer overflow occurs on the
IP on "jmp im". This patch masks overflows for 32 bit IPs on a 64 bit
system, just like it is done for 16 bit IPs already.

Using this patch, x86_64 openSUSE installation works again.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@suse.de>



[-- Attachment #2: jmp-im.patch --]
[-- Type: text/x-patch, Size: 430 bytes --]

Index: target-i386/translate.c
===================================================================
--- target-i386/translate.c	(revision 5959)
+++ target-i386/translate.c	(working copy)
@@ -6165,6 +6165,8 @@
         tval += s->pc - s->cs_base;
         if (s->dflag == 0)
             tval &= 0xffff;
+	else if(!CODE64(s))
+            tval &= 0xffffffff;
         gen_jmp(s, tval);
         break;
     case 0xea: /* ljmp im */

             reply	other threads:[~2008-12-09 13:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 13:14 Alexander Graf [this message]
2008-12-10 15:02 ` [Qemu-devel] [PATCH] Fix jmp im on x86_64 when executing 32-bit code Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493E6F2B.5090300@suse.de \
    --to=agraf@suse.de \
    --cc=kwolf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).