xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Andy Lutomirski <luto@kernel.org>,
	x86@kernel.org
Cc: Juergen Gross <JGross@suse.com>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Peter Zijlstra <peterz@infradead.org>,
	Brian Gerst <brgerst@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Matthew Whitehead <tedheadster@gmail.com>,
	Borislav Petkov <bp@alien8.de>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Xen-devel List <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 5/6] x86/xen: Add a Xen-specific sync_core() implementation
Date: Fri, 2 Dec 2016 15:09:31 -0500	[thread overview]
Message-ID: <1d68c6dd-df69-ffc0-bb36-10b4b76bb2fb@oracle.com> (raw)
In-Reply-To: <a9c41f3a-f649-712e-21bb-a849b0a4de13@citrix.com>

On 12/02/2016 06:44 AM, Andrew Cooper wrote:
> On 02/12/16 00:35, Andy Lutomirski wrote:
>> On Xen PV, CPUID is likely to trap, and Xen hypercalls aren't
>> guaranteed to serialize.  (Even CPUID isn't *really* guaranteed to
>> serialize on Xen PV, but, in practice, any trap it generates will
>> serialize.)
> Well, Xen will enabled CPUID Faulting wherever it can, which is
> realistically all IvyBridge hardware and newer.
>
> All hypercalls are a privilege change to cpl0.  I'd hope this condition
> is serialising, but I can't actually find any documentation proving or
> disproving this.
>
>> On my laptop, CPUID(eax=1, ecx=0) is ~83ns and IRET-to-self is
>> ~110ns.  But Xen PV will trap CPUID if possible, so IRET-to-self
>> should end up being a nice speedup.
>>
>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Andy Lutomirski <luto@kernel.org>

Executing CPUID in an HVM guest is quite expensive since it will cause a
VMEXIT. (And that should be true for any hypervisor, at least on Intel.
On AMD it's configurable)

-boris

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

      parent reply	other threads:[~2016-12-02 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1480638597.git.luto@kernel.org>
     [not found] ` <0a21157c2233ba7d0781bbf07866b3f2d7e7c25d.1480638597.git.luto@kernel.org>
2016-12-02 11:44   ` [PATCH v2 5/6] x86/xen: Add a Xen-specific sync_core() implementation Andrew Cooper
     [not found]   ` <a9c41f3a-f649-712e-21bb-a849b0a4de13@citrix.com>
2016-12-02 17:07     ` Andy Lutomirski
     [not found]     ` <CALCETrV38BPzsOrhydgUqsQdQy9x2id2myQy+S3V3xUH9zJUdQ@mail.gmail.com>
2016-12-02 17:16       ` Andrew Cooper
     [not found]       ` <e944fe00-e568-f258-6f42-5655b1424d7c@citrix.com>
2016-12-02 17:23         ` Andy Lutomirski
     [not found]         ` <CALCETrXO5XsujwLaNTt_U7UF4MDDMwRDPCbGFLn4s7DyWEDtWQ@mail.gmail.com>
2016-12-02 17:26           ` Andrew Cooper
2016-12-02 18:50     ` Boris Ostrovsky
     [not found]     ` <402ae08c-22d3-bec7-6649-26632c941a29@oracle.com>
2016-12-02 19:34       ` Andy Lutomirski
2016-12-02 20:09     ` Boris Ostrovsky [this message]

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=1d68c6dd-df69-ffc0-bb36-10b4b76bb2fb@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JGross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=hmh@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tedheadster@gmail.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xen.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).