public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi.kivity@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/7] KVM: x86 emulator: introduce NoWrite flag
Date: Sat, 22 Dec 2012 18:20:49 +0200	[thread overview]
Message-ID: <20121222162049.GY29007@redhat.com> (raw)
In-Reply-To: <CAEbWaiqu4Fe-U+VwAji0hFd4GUAUd=3f2g7vd1ENYrdawKxg8A@mail.gmail.com>

On Sat, Dec 22, 2012 at 05:51:08PM +0200, Avi Kivity wrote:
> On Sat, Dec 22, 2012 at 5:45 PM, Avi Kivity <avi.kivity@gmail.com> wrote:
> > On Sat, Dec 22, 2012 at 5:39 PM, Gleb Natapov <gleb@redhat.com> wrote:
> >> On Sat, Dec 22, 2012 at 05:28:00PM +0200, Avi Kivity wrote:
> >>> On Sat, Dec 22, 2012 at 5:11 PM, Gleb Natapov <gleb@redhat.com> wrote:
> >>> >>  #define X2(x...) x, x
> >>> >>  #define X3(x...) X2(x), x
> >>> >> @@ -1584,6 +1585,9 @@ static int writeback(struct x86_emulate_ctxt *ctxt)
> >>> >>  {
> >>> >>       int rc;
> >>> >>
> >>> >> +     if (ctxt->d & NoWrite)
> >>> >> +             return X86EMUL_CONTINUE;
> >>> >> +
> >>> > Why not make it Dst flag and set dst.type to OP_NONE during decoding
> >>> > instead of this special case?
> >>>
> >>> My thinking was to eventually convert everything to NoWrite, then it's
> >>> not a special case.  But your approach works too, I can change it if
> >>> you like.  We'll have an if () either way though.
> >> But meanwhile we will have two different ways to disable writeback. When
> >> all instructions will be marked with NoWrite we can switch it easily if
> >> we want. Also some instruction can disable writeback conditionally. cmov is one
> >> (and may be only) of them.
> >
> > Makes sense, will update for the next iteration.
> 
> Actually that doesn't work. x86_emulate_insn() needs dst.type in order
> to fetch the operand.
True :(. Actually if we will move from OP_NONE to NoWrite we can drop
saved_dst_type hack from x86_emulate_insn.

--
			Gleb.

  reply	other threads:[~2012-12-22 16:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-22 12:26 [PATCH 0/7] Streamline arithmetic instruction emulation Avi Kivity
2012-12-22 12:26 ` [PATCH 1/7] KVM: x86 emulator: framework for streamlining arithmetic opcodes Avi Kivity
2012-12-22 17:00   ` Gleb Natapov
2012-12-22 17:42     ` Avi Kivity
2012-12-22 18:01       ` Gleb Natapov
2012-12-22 18:07         ` Avi Kivity
2012-12-22 18:11           ` Gleb Natapov
2012-12-22 18:18             ` Avi Kivity
2012-12-22 18:44               ` Gleb Natapov
2012-12-22 21:55                 ` Avi Kivity
2012-12-22 12:26 ` [PATCH 2/7] KVM: x86 emulator: Support for declaring single operand fastops Avi Kivity
2012-12-22 12:26 ` [PATCH 3/7] KVM: x86 emulator: introduce NoWrite flag Avi Kivity
2012-12-22 15:11   ` Gleb Natapov
2012-12-22 15:28     ` Avi Kivity
2012-12-22 15:39       ` Gleb Natapov
2012-12-22 15:45         ` Avi Kivity
2012-12-22 15:51           ` Avi Kivity
2012-12-22 16:20             ` Gleb Natapov [this message]
2012-12-22 12:26 ` [PATCH 4/7] KVM: x86 emulator: mark CMP, CMPS, SCAS, TEST as NoWrite Avi Kivity
2012-12-22 12:26 ` [PATCH 5/7] KVM: x86 emulator: convert NOT, NEG to fastop Avi Kivity
2012-12-22 12:26 ` [PATCH 6/7] KVM: x86 emulator: add macros for defining 2-operand fastop emulation Avi Kivity
2012-12-22 12:26 ` [PATCH 7/7] KVM: x86 emulator: convert basic ALU ops to fastop Avi Kivity
2012-12-23  9:47 ` [PATCH 0/7] Streamline arithmetic instruction emulation Gleb Natapov
     [not found]   ` <CAEbWairRO+p1Lco8NJqC99xz1EFcP6CZktOsBmt6AwW4R5vMMw@mail.gmail.com>
2013-01-04  1:14     ` Marcelo Tosatti

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=20121222162049.GY29007@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi.kivity@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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