All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com, kurt.hackel@oracle.com, "Dugger,
	Donald D" <donald.d.dugger@intel.com>,
	"Xu, Dongxiao" <dongxiao.xu@intel.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: RE: Live migration fails due to c/s 20627
Date: Wed, 16 Dec 2009 16:41:23 +0100	[thread overview]
Message-ID: <4B28FFA3.7060300@amd.com> (raw)
In-Reply-To: <57c748fc-49ef-4f2f-9c98-92a1dc12116f@default>

Dan Magenheimer wrote:
>> -----Original Message-----
>> From: Jeremy Fitzhardinge [mailto:jeremy@goop.org]
>> Sent: Tuesday, December 15, 2009 11:26 AM
>> To: Xu, Dongxiao
>> Cc: Dan Magenheimer; Keir Fraser; xen-devel@lists.xensource.com; Kurt
>> Hackel; Dugger, Donald D; Nakajima, Jun; Zhang, Xiantao
>> Subject: Re: Live migration fails due to c/s 20627
>>
>>
>> On 12/15/2009 09:24 AM, Xu, Dongxiao wrote:
>>> If CPU has rdtsc but no rdtscp, then the VM exec control bit in VMCS
>>> won't be turned on. Therefore if rdtscp instruction runs, 
>> it will encounter
>>> invalid op code directly but no VMEXIT.
>>>    
>> Ah, right.  You'd need to make that particular illegal 
>> instruction vmexit.
> 
> Or make ALL illegal instructions vmexit, decode, if rdtscp
> emulate it, else vmenter again.
But is it useful to emulate RDTSCP? I see two use cases for this 
instruction:
1) NUMA aware malloc:
You need to know the current node number _quickly_ to use the right 
bucket to take the memory from. You do not even want using a syscall for 
this, that's why getcpu in Linux is implemented as a vsyscall either 
using RDTSCP or LSL. If you emulate this, this will need a few thousand 
cycles.
2) Making sure TSC values are consistent:
By looking at the core ID you learn whether two consecutive RDTSCPs are 
from the same core and are thus reliable. If you loose a few thousand 
cycles with emulation, than the whole purpose of doing the RDTSCPs is in 
question, as your results would be spoiled due to the overhead.

These two issues are the main reason I refrained from implementing 
RDTSCP virtualization some months ago, as even virtualizing them 
introduces a slight overhead (MSR save/restore). As software seems to 
cope with not having this instruction (and using the perfectly 
virtualized lsl instruction, for instance), I thought the benefit would 
not justify the effort.

Dan, can you summarize the usage of RDTSCP emulation in PV? Honestly I 
got lost in all these threads..


Regards,
Andre.

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448 3567 12
----to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd; Thomas M. McCoy; Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

  parent reply	other threads:[~2009-12-16 15:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 18:02 Live migration fails due to c/s 20627 Dan Magenheimer
2009-12-14 23:19 ` Keir Fraser
2009-12-15  4:40   ` Xu, Dongxiao
2009-12-15 15:56     ` Dan Magenheimer
2009-12-15 16:10       ` Xu, Dongxiao
2009-12-15 16:31         ` Dan Magenheimer
2009-12-15 17:08         ` Dan Magenheimer
2009-12-15 18:04           ` Xu, Dongxiao
2009-12-16  2:07           ` Nakajima, Jun
2009-12-16  2:43           ` Zhang, Xiantao
2009-12-16  4:14             ` Dan Magenheimer
2009-12-16  5:07               ` Zhang, Xiantao
2009-12-16 16:23                 ` Dan Magenheimer
2009-12-16 17:38                   ` Jeremy Fitzhardinge
2009-12-16  6:19               ` Jeremy Fitzhardinge
2009-12-16 15:20                 ` Dan Magenheimer
2009-12-16 17:31                   ` Jeremy Fitzhardinge
2009-12-15 17:12         ` Jeremy Fitzhardinge
2009-12-15 17:24           ` Xu, Dongxiao
2009-12-15 18:25             ` Jeremy Fitzhardinge
2009-12-15 19:20               ` Dan Magenheimer
2009-12-15 19:31                 ` Keir Fraser
2009-12-15 19:52                   ` Keir Fraser
2009-12-16 15:41                 ` Andre Przywara [this message]
2009-12-16 16:54                   ` Dan Magenheimer
2009-12-15 19:25               ` Keir Fraser
2009-12-15 18:05     ` Xu, Dongxiao

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=4B28FFA3.7060300@amd.com \
    --to=andre.przywara@amd.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=donald.d.dugger@intel.com \
    --cc=dongxiao.xu@intel.com \
    --cc=jeremy@goop.org \
    --cc=jun.nakajima@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=kurt.hackel@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiantao.zhang@intel.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 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.