All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wl@xen.org>, Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3 5/8] x86emul: support MOVDIR{I, 64B} insns
Date: Wed, 4 Sep 2019 11:19:45 +0100	[thread overview]
Message-ID: <4132f20e-f106-ad77-e6b7-dd39db9d1946@citrix.com> (raw)
In-Reply-To: <b0dff6e4-a5be-445d-76db-cbe923484a92@suse.com>

On 03/09/2019 13:25, Jan Beulich wrote:
> On 03.09.2019 12:28, Andrew Cooper wrote:
>> On 03/09/2019 10:39, Jan Beulich wrote:
>>> Note that SDM revision 070 doesn't specify exception behavior for
>>> ModRM.mod != 0b11; assuming #UD here.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> What are we going to do about the ->write() hook atomicity?  I'm happy
>> to put it on the TODO list, but we can't simply ignore the problem.
> So do you not agree with my assessment that our memcpy()
> implementation satisfies the need, and it's just not very
> nice that the ->write() hook is dependent upon this?

We use __builtin_memcpy(), not necessarily our own local implementation.

Our own copy uses rep movsq followed by rep movsb of up to 7 bytes,
which doesn't handle 2 and 4 byte copies atomically.  More generally,
rep movs doesn't provide guarantees about the external visibility of
component writes, owing to the many different ways that such writes may
be implemented, and optimised.

Even if the above were fixed (and I'm not sure could make it correct
even for misaligned writes), we cannot depend on our own memcpy never
changing in the future.  For one, it should be a straight rep movsb on
most Intel hardware these days, for performance.

~Andrew

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

  reply	other threads:[~2019-09-04 10:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03  9:35 [Xen-devel] [PATCH v3 0/8] x86emul: further work Jan Beulich
2019-09-03  9:37 ` [Xen-devel] [PATCH v3 1/8] x86emul: support WBNOINVD Jan Beulich
2019-09-03 10:17   ` Andrew Cooper
2019-09-03  9:37 ` [Xen-devel] [PATCH v3 2/8] x86/HVM: ignore guest INVD uses Jan Beulich
2019-09-03  9:43   ` Paul Durrant
2019-09-03 10:18   ` Andrew Cooper
2019-09-03 12:22     ` Jan Beulich
2019-09-03  9:39 ` [Xen-devel] [PATCH v3 3/8] x86emul: generalize invlpg() hook Jan Beulich
2019-09-03  9:39 ` [Xen-devel] [PATCH v3 4/8] x86emul: support INVPCID Jan Beulich
2019-09-03  9:39 ` [Xen-devel] [PATCH v3 5/8] x86emul: support MOVDIR{I,64B} insns Jan Beulich
2019-09-03 10:28   ` [Xen-devel] [PATCH v3 5/8] x86emul: support MOVDIR{I, 64B} insns Andrew Cooper
2019-09-03 12:25     ` Jan Beulich
2019-09-04 10:19       ` Andrew Cooper [this message]
2019-09-04 11:52         ` Jan Beulich
2019-09-03  9:40 ` [Xen-devel] [PATCH v3 6/8] x86/HVM: scale MPERF values reported to guests (on AMD) Jan Beulich
2019-09-03  9:41 ` [Xen-devel] [PATCH v3 7/8] x86emul: support RDPRU Jan Beulich
2019-09-03 12:34   ` Andrew Cooper
2019-09-03 13:05     ` Jan Beulich
2019-09-04  9:26     ` Jan Beulich
2019-09-04  9:46       ` Andrew Cooper
2019-09-03  9:42 ` [Xen-devel] [PATCH v3 8/8] x86/HVM: don't needlessly intercept APERF/MPERF/TSC MSR reads Jan Beulich
2019-09-04 23:16   ` Boris Ostrovsky
2019-09-05  6:31     ` 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=4132f20e-f106-ad77-e6b7-dd39db9d1946@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.