qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb
Date: Wed, 30 Apr 2008 21:21:40 +0300	[thread overview]
Message-ID: <f43fc5580804301121q14ab1a9bx8e944bc2ed135fcc@mail.gmail.com> (raw)
In-Reply-To: <67C63B39-3EBE-4E1F-B46B-D2FE7AAC001F@suse.de>

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

On 4/30/08, Alexander Graf <agraf@suse.de> wrote:
>
>  On Apr 30, 2008, at 5:21 PM, Adam Lackorzynski wrote:
>
>
> >
> > On Wed Apr 30, 2008 at 17:11:32 +0200, Adam Lackorzynski wrote:
> >
> > > On Wed Apr 30, 2008 at 11:08:46 +0200, Alexander Graf wrote:
> > >
> > > > There was a comment from Fabrice on how to do prologues in TCG to save
> /
> > > > restore the clobbered values. Btw, ebx gets clobbered as well.
> > > >
> > >
> > > tcg/README says that some registers are clobbered. So something like
> > > this should be safe:
> > >
> > > Index: cpu-exec.c
> > >
> ===================================================================
> > > --- cpu-exec.c  (revision 4276)
> > > +++ cpu-exec.c  (working copy)
> > > @@ -690,6 +691,15 @@
> > >                fp.ip = tc_ptr;
> > >                fp.gp = code_gen_buffer + 2 * (1 << 20);
> > >                (*(void (*)(void)) &fp)();
> > > +#elif defined(__i386)
> > > +               asm volatile ("push %%ebp\n"
> > > +                             "push %%ebx\n"
> > > +                             "call *%1\n"
> > > +                             "pop %%ebx\n"
> > > +                             "pop %%ebp\n"
> > > +                             : "=a" (T0)
> > > +                             : "r" (gen_func)
> > > +                             : "esi", "edi", "ecx", "edx");
> > > #else
> > >                T0 = gen_func();
> > > #endif
> > >
> >
> > I just realised that the push and pop of ebx is not needed as T0 is ebx
> > which gets overwritten in the output anyway.
> >
>
>  Why is T0 =a then? Shouldn't =a mean "input and output on eax for T0"?

GCC-Inline-Assembly-HOWTO:
"=" : Means that this operand is write-only for this instruction; the
previous value is discarded and replaced by output data.

The attached version survives quick tests for both Sparc32 and Sparc64.

[-- Attachment #2: fix_i386.diff --]
[-- Type: plain/text, Size: 983 bytes --]

  reply	other threads:[~2008-04-30 18:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 11:56 [Qemu-devel] Crash due to invalid env->current_tb Adam Lackorzynski
2008-04-29 17:09 ` Blue Swirl
2008-04-29 18:40   ` Adam Lackorzynski
2008-04-30  9:08     ` Alexander Graf
2008-04-30 15:11       ` Adam Lackorzynski
2008-04-30 15:21         ` Adam Lackorzynski
2008-04-30 17:09           ` Blue Swirl
2008-04-30 17:30           ` Alexander Graf
2008-04-30 18:21             ` Blue Swirl [this message]
2008-05-01 12:02               ` Adam Lackorzynski
2008-05-01 15:02                 ` Blue Swirl
2008-05-01 16:04                   ` Paul Brook
2008-05-01 16:15                     ` Blue Swirl
2008-05-01 16:31                       ` Paul Brook
2008-05-02 15:41                   ` Adam Lackorzynski
2008-05-03 18:00                     ` Blue Swirl
2008-05-03 22:02                       ` Paul Brook
2008-04-30 15:28         ` Laurent Vivier
2008-04-30 20:36           ` Adam Lackorzynski
2008-05-02  1:39             ` Bernhard Kauer

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=f43fc5580804301121q14ab1a9bx8e944bc2ed135fcc@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --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).