qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: "J. Mayer" <l_indien@magic.fr>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] RFC: Code fetch optimisation
Date: Wed, 17 Oct 2007 01:43:23 +0100	[thread overview]
Message-ID: <200710170143.24140.paul@codesourcery.com> (raw)
In-Reply-To: <1192577909.9976.534.camel@rapid>

> > I suspect the best solution is to backtrack (remove the generated ops)
> > after decoding the insn if we discover we've passed a page boundary. The
> > ld*_code routines can simply return garbage (e.g. zero) if the read is
> > not on the first page.
>
> The "incorrect" returned value may be target specific to be sure it's
> always an invalid opcode.

It doesn't matter whether it's valid or not, and we've no way of guaranteeing 
that anyway. We just have to make sure we don't generate an infinitely long 
instruction.

On a related note, I notice that we don't enforce x86 instruction length 
limits.

> Backtracking should not be hard if we register the last cc pointer each
> time we finish translating an insn. I'll think about this solution,
> which really seems feasible to me.

Right. You only have to worry about backtracking the state that's lives across 
insns and is not constant within a TB. For x86 I think this is dc->pc, 
dc->cc_op, gen_opc_ptr and nb_gen_labels. Plus you need to reset dc->is_jmp 
to zero.  gen_opparam_ptr is not used after disassembly, so can be ignored.

Paul

  reply	other threads:[~2007-10-17  0:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14 11:44 [Qemu-devel] RFC: Code fetch optimisation J. Mayer
2007-10-15  2:30 ` Paul Brook
2007-10-15 12:09   ` J. Mayer
2007-10-15 16:01     ` Paul Brook
2007-10-15 16:19       ` Fabrice Bellard
2007-10-15 21:30       ` J. Mayer
2007-10-15 22:42         ` Paul Brook
2007-10-16 20:27           ` J. Mayer
2007-10-16 22:00             ` Paul Brook
2007-10-16 23:38               ` J. Mayer
2007-10-17  0:43                 ` Paul Brook [this message]
2007-10-16 22:26             ` Paul Brook
  -- strict thread matches above, loose matches on Subject: below --
2007-10-12  8:33 J. Mayer
2007-10-12 15:21 ` Blue Swirl
2007-10-12 18:24   ` Jocelyn Mayer
2007-10-12 18:36   ` Fabrice Bellard
2007-10-12 18:39   ` Fabrice Bellard

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=200710170143.24140.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=l_indien@magic.fr \
    --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).