WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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>
Subject: RE: [Xen-devel] Guest TSC and Xen (Intel and AMD feedback please)
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080707213419187.00000003744@djm-pc>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <14B8575781A1414FA0D4F6649C4D7190018C3C83@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20080707213419187.00000003744@djm-pc>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>