From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Magenheimer Subject: Re: Questions on the PIT and APIC timer in Xen Date: Wed, 28 Mar 2012 08:46:01 -0700 (PDT) Message-ID: <09b9e0f3-8548-447f-ba52-33992932f321@default> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7892864059251743502==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Bei Guan , Xen Devel Cc: "Andrei E. Warkentin" List-Id: xen-devel@lists.xenproject.org --===============7892864059251743502== Content-Type: multipart/alternative; boundary="__1332949568659109047abhmt111.oracle.com" --__1332949568659109047abhmt111.oracle.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Both the PIT and APIC (as well as HPET) timers are emulated by Xen for an H= VM guest. However there have always been rare hard-to-reproduce problems w= hen guests use them. At one time, there were workarounds that required a s= pecial parameter "timer_mode" to be selected for HVM guests. If I recall c= orrectly, different timer modes overcame different limitations of different= timer emulations (or maybe mismatches between guest "bugs" exposed by virt= ual time and true hypervisor emulation). These timer_mode workarounds may = or may not work with more recent Linux and Windows guests. And there are s= till periodic bug fixes being applied for timers in the hypervisor emulatio= n code. =20 At 4.0, full TSC emulation was added in an attempt to provide a high-resolu= tion guaranteed monotonic timer. However, most legacy HVM guests cannot o= r refuse to use TSC as a timer. (And there may be lurking bugs there as we= ll.) For most PV guest OS's, the pvclock algorithm is used so PIT/APIC/HPET emul= ation should be unnecessary (and, if used, is likely buggy). And actually = pvclock should be superceded by using TSC, which is always faster, but for = most workloads the performance difference doesn't matter. =20 If you are interested in a good (but difficult) Xen project, "virtual time"= still needs work and documentation. I would be happy to provide lots of b= ackground documentation but can't volunteer to help much more than that rig= ht now. =20 Hope that helps, Dan =20 From: Bei Guan [mailto:gbtju85@gmail.com]=20 Sent: Wednesday, March 28, 2012 1:32 AM To: Xen Devel Cc: Andrei E. Warkentin Subject: [Xen-devel] Questions on the PIT and APIC timer in Xen =20 Hi, =20 I wonder whether the PIT/APIC timer for HVM Guest OS is emulated by Xen or = not. What's difference between setting the boot PIT/APIC timer for a PV Guest OS= and HVM Guest OS? =20 =20 I would appreciate any reply for my question. =20 --=20 Best Regards, Bei Guan =20 --__1332949568659109047abhmt111.oracle.com Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable

Both the = PIT and APIC (as well as HPET) timers are emulated by Xen for an HVM guest.=   However there have always been rare hard-to-reproduce problems when = guests use them.  At one time, there were workarounds that required a = special parameter “timer_mode” to be selected for HVM guests.&n= bsp; If I recall correctly, different timer modes overcame different limita= tions of different timer emulations (or maybe mismatches between guest R= 20;bugs” exposed by virtual time and true hypervisor emulation). = ; These timer_mode workarounds may or may not work with more recent Linux a= nd Windows guests.  And there are still periodic bug fixes being appli= ed for timers in the hypervisor emulation code.

 

At 4.0, full TSC emulation was added in an attempt to provide a high-res= olution guaranteed monotonic timer.   However, most legacy HVM gu= ests cannot or refuse to use TSC as a timer.  (And there may be lurkin= g bugs there as well.)

For most PV guest OS’s, the pvclock algorithm is used so PIT/APIC/HP= ET emulation should be unnecessary (and, if used, is likely buggy).  A= nd actually pvclock should be superceded by using TSC, which is always fast= er, but for most workloads the performance difference doesn’t matter.=

 <= /p>

If you are interested in a good (but difficu= lt) Xen project, “virtual time” still needs work and documentat= ion.  I would be happy to provide lots of background documentation but= can’t volunteer to help much more than that right now.

 

Hope that helps,

Dan

 

From: Bei Guan [mailt= o:gbtju85@gmail.com]
Sent: Wednesday, March 28, 2012 1:32 AM
= To: Xen Devel
Cc: Andrei E. Warkentin
Subject: [= Xen-devel] Questions on the PIT and APIC timer in Xen

=

 

Hi,

 

I wonder whether the PIT/APIC timer f= or HVM Guest OS is emulated by Xen or not.

What's difference between setting the boot PIT/APIC timer for= a PV Guest OS and HVM Guest OS?  

 

I would a= ppreciate any reply for my question.

 

--
Best Regards= ,

Bei Guan

 

--__1332949568659109047abhmt111.oracle.com-- --===============7892864059251743502== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============7892864059251743502==--