From: Richard Henderson <rth@twiddle.net>
To: "Jaume Martí" <jaume.martif@gmail.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
mtosatti@redhat.com, gleb@redhat.com, mst@redhat.com,
riku.voipio@iki.fi, quintela@redhat.com, vrozenfe@redhat.com,
anthony@codemonkey.ws, pbonzini@redhat.com,
alex.bennee@linaro.org, afaerber@suse.de
Subject: Re: [Qemu-devel] PATCH for bugs 661696 and 1248376: target-i386: x87 exception pointers using TCG.
Date: Sun, 22 Jun 2014 11:55:21 -0700 [thread overview]
Message-ID: <53A72699.7080006@twiddle.net> (raw)
In-Reply-To: <CAL4g94TchY_sM+QhPYGBmDXakK_qYOryB5c+U5u19HNzgs=V7w@mail.gmail.com>
On 06/22/2014 07:55 AM, Jaume Martí wrote:
> - cpu_x86_fsave(env, fpstate_addr, 1);
> - fpstate->status = fpstate->sw;
> - magic = 0xffff;
> + cpu_x86_fsave(env, fpstate_addr);
> + fpstate->status = fpstate->sw;
> + magic = 0xffff;
This patch needs to be split into format fixes and the actual change to be
reviewed.
> - /* KVM-only so far */
> - uint16_t fpop;
> + union {
> + uint32_t tcg;
> + uint16_t kvm;
> + } fpop;
This is highly questionable.
> .fields = (VMStateField[]) {
> - VMSTATE_UINT16(env.fpop, X86CPU),
> + VMSTATE_UINT16(env.fpop.kvm, X86CPU),
You're breaking save/restore in tcg. KVM is not required for migration.
> + if (non_control_x87_instr(modrm, b)) {
> + tcg_gen_movi_i32(cpu_fpop, ((b & 0x7) << 8) | (modrm & 0xff));
> + tcg_gen_movi_tl(cpu_fpip, pc_start - s->cs_base);
> + tcg_gen_movi_i32(cpu_fpcs, env->segs[R_CS].selector);
> + }
I strongly suspect you can implement this feature without having to add 3
(largely redundant) register writes to every x87 instruction executed.
See how restore_state_to_opc works to compute the value of CC_OP during
translation. You can do the same thing to recover these three values.
You do have to sync these values before normal exits from the TB, but you only
have to do that once, not once for every insn executed. See gen_update_cc_op.
r~
next prev parent reply other threads:[~2014-06-22 18:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-21 0:16 [Qemu-devel] PATCH for bugs 661696 and 1248376: target-i386: x87 exception pointers using TCG Jaume Martí
2014-06-22 14:55 ` Jaume Martí
2014-06-22 18:55 ` Richard Henderson [this message]
2014-06-22 19:17 ` Jaume Martí
2014-07-19 0:36 ` Jaume Martí
2014-07-21 18:55 ` Jaume Martí
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=53A72699.7080006@twiddle.net \
--to=rth@twiddle.net \
--cc=afaerber@suse.de \
--cc=alex.bennee@linaro.org \
--cc=anthony@codemonkey.ws \
--cc=gleb@redhat.com \
--cc=jaume.martif@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=riku.voipio@iki.fi \
--cc=vrozenfe@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;
as well as URLs for NNTP newsgroup(s).