[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] Guest TSC and Xen (Intel and AMD feedback please)


  • To: <dan.magenheimer@xxxxxxxxxx>, "Zhang, Li" <li.zhang@xxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Tue, 8 Jul 2008 12:21:33 +0800
  • Cc:
  • Delivery-date: Mon, 07 Jul 2008 21:22:09 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcjboIivPTuddHlLSIGPaPhte5VM5wASModQADA1FBAAMHiVIAAjyGRgAKf/8qAAAXmfcAABT0gwAABianAAAfl10A==
  • Thread-topic: [Xen-devel] Guest TSC and Xen (Intel and AMD feedback please)

>From: Dan Magenheimer [mailto:dan.magenheimer@xxxxxxxxxx] 
>Sent: 2008年7月8日 11:34
>
>1) If the EXITING flag to be set in vmcs.c is to be controlled 
>by a xen boot option, would this work:
>
>static int opt_softtsc = 0;
>boolean_param("softtsc", opt_softtsc);
>  :
>min = /* original code */
>if (opt_softtsc) min |= CPU_BASED_RDTSC_EXITING;

yes.

>
>2) In vmx_rdtsc_intercept(/* need regs as param*/) if we 
>change the rdtscll(tsc) to be tmptsc = hvm_get_guest_tsc() and 
>then set regs->edx amd regs->eax from tmptsc, are we almost done?

Yes, and similar example is under case EXIT_REASON_CPUID.

>
>3) Des Linux or Windows use the CR4.TSD flag and, if so, what 
>code gets called to force the trap?

My feeling is that both Linux and Windows allows user directly read to
TSC, and thus CR4.TSD is unlikely to be set. But it needs confirmation.
If you really want to trap such setting, hvm_set_cr4 is the point and
you may further reference vmx_update_guest_cr if it's vmx specific (but
I guess it should be common).

But I doubt the point to support such model, since two levels trapping
(Xen trap, inject fault, guest kernel read, xen trap, ...) which adds much
delay on Xen maintained guest tsc.

>
>4) Does Linux or Windows use RDMSR/WRMSR of tsc?  Is there 
>already code somewhere to emulate WRMSR of tsc?

I'm not sure about this one, and others may answer.

Thanks,
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.