xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul.durrant@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH v2 2/3] x86emul: correct handling of FPU insns faulting on memory write
Date: Wed, 15 Mar 2017 09:24:58 -0400	[thread overview]
Message-ID: <a7a305ee-d43f-735c-7436-bdedfbdf0a23@oracle.com> (raw)
In-Reply-To: <58C9254F02000078001433B0@prv-mh.provo.novell.com>

On 03/15/2017 06:28 AM, Jan Beulich wrote:
> When an FPU instruction with a memory destination fails during the
> memory write, it should not affect FPU register state. Due to the way
> we emulate FPU (and SIMD) instructions, we can only guarantee this by
> - backing out changes to the FPU register state in such a case or
> - doing a descriptor read and/or page walk up front, perhaps with the
>   stubs accessing the actual memory location then.
> The latter would require a significant change in how the emulator does
> its guest memory accessing, so for now the former variant is being
> chosen.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

with one question:

>  
> @@ -3716,9 +3720,9 @@ x86_emulate(
>          break;
>  
>      case 0x9b:  /* wait/fwait */
> -        fic.insn_bytes = 1;
>          host_and_vcpu_must_have(fpu);
>          get_fpu(X86EMUL_FPU_wait, &fic);
> +        fic.insn_bytes = 1;
>          asm volatile ( "fwait" ::: "memory" );
>          check_fpu_exn(&fic);
>          break;
>


Why is this needed?

-boris

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-03-15 13:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 10:23 [PATCH v2 0/3] x86emul: FPU handling corrections Jan Beulich
2017-03-15 10:27 ` [PATCH v2 1/3] x86emul: centralize put_fpu() invocations Jan Beulich
2017-03-20 17:10   ` Andrew Cooper
2017-03-15 10:28 ` [PATCH v2 2/3] x86emul: correct handling of FPU insns faulting on memory write Jan Beulich
2017-03-15 12:06   ` Paul Durrant
2017-03-15 13:24   ` Boris Ostrovsky [this message]
2017-03-15 13:31     ` Jan Beulich
2017-03-15 13:48       ` Boris Ostrovsky
2017-03-15 15:46         ` Jan Beulich
2017-03-15 10:28 ` [PATCH v2 3/3] x86emul: correct FPU code/data pointers and opcode handling Jan Beulich
2017-03-20 17:26   ` Andrew Cooper
2017-03-15 10:29 ` [PATCH v2][XTF] add FPU/SIMD register state test Jan Beulich

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=a7a305ee-d43f-735c-7436-bdedfbdf0a23@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=paul.durrant@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xenproject.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).