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: "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: "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx>
Date: Mon, 7 Jul 2008 21:34:19 -0600
Cc: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>
Delivery-date: Mon, 07 Jul 2008 20:41:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <14B8575781A1414FA0D4F6649C4D7190018C3C83@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Organization: Oracle Corporation
Reply-to: "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjboIivPTuddHlLSIGPaPhte5VM5wASModQADA1FBAAMHiVIAAjyGRgAKf/8qAAAXmfcAABT0gwAABianA=
Thanks Kevin and Li --

A couple of questions:

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;

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?

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

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

Sorry I am not very familar with the details of the ia32 instruction set.

Thanks,
Dan

> -----Original Message-----
> From: Zhang, Li [mailto:li.zhang@xxxxxxxxx]
> Sent: Monday, July 07, 2008 9:00 PM
> To: dan.magenheimer@xxxxxxxxxx; Xen-Devel (E-mail)
> Cc: Tian, Kevin
> Subject: RE: [Xen-devel] Guest TSC and Xen (Intel and AMD 
> feedback please)
> 
> 
> Hi, Dan
> This seems not to be enough. I will cook another patch.
> 
> >  -----Original Message-----
> >  From: Zhang, Li
> >  Sent: Tuesday, July 08, 2008 10:28 AM
> >  To: Tian, Kevin; 'dan.magenheimer@xxxxxxxxxx'; 'Xen-Devel (E-mail)'
> >  Subject: RE: [Xen-devel] Guest TSC and Xen (Intel and AMD 
> feedback please)
> >
> >  Hi, Dan
> >
> >  I just add some code to produce vmexit. The function 
> vmx_rdtsc_intercept()
> >  is not completed. It is needed to add some code to get the 
> guest tsc.
> >
> >  Thanks
> >  --Li
> >
> >  >  -----Original Message-----
> >  >  From: Tian, Kevin
> >  >  Sent: Tuesday, July 08, 2008 9:39 AM
> >  >  To: 'dan.magenheimer@xxxxxxxxxx'; Xen-Devel (E-mail)
> >  >  Cc: Zhang, Li
> >  >  Subject: RE: [Xen-devel] Guest TSC and Xen (Intel and 
> AMD feedback please)
> >  >
> >  >  >From: Dan Magenheimer [mailto:dan.magenheimer@xxxxxxxxxx]
> >  >  >Sent: 2008年7月5日 1:32
> >  >  >
> >  >  >> >Is this something that you (or Intel in general) 
> could look at?
> >  >  >> >I would be happy to participate but I don't think I 
> understand
> >  >  >> >VT well enough.  Once the trap occurs, I suppose 
> Xen system time
> >  >  >> >could be used as the virtual TSC, possibly scaled up.
> >  >  >> >
> >  >  >>
> >  >  >> There should be tiny related to VT, as only turning 
> on some bit to
> >  >  >> allow RDTSC trapping and then the rest stuff should be common
> >  >  >> how to handle it. We'll take a look, but can't 
> commit the time due
> >  >  >> to other scheduled bandwidth. But if you'd like to 
> jump in early
> >  >  >> we definitely can help with VT side.
> >  >  >
> >  >  >If you can post a patch with code that:
> >  >  >
> >  >  >1) declares a boolean global variable: softtsc = 0
> >  >  >2) if the variable is set, a rdtsc instruction in any hvm
> >  >  >   domain causes a trap
> >  >  >3) the trap handler just does a physical rdtsc and returns
> >  >  >
> >  >  >then I could probably take it from there.
> >  >
> >  >  OK, and Li in CC will take a look and bake a patch for you.
> >  >
> >  >  Thanks,
> >  >  Kevin
> 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>