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

[Xen-devel] RE: [PATCH] Enable Core 2 Duo Performance Counters in HVM gu

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH] Enable Core 2 Duo Performance Counters in HVM guest
From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Date: Tue, 11 Dec 2007 21:32:53 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Delivery-date: Tue, 11 Dec 2007 05:37:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C38418FF.1129E%Keir.Fraser@xxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <823A93EED437D048963A3697DB0E35DEF3559C@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C38418FF.1129E%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acg73Y05/4ppWsehQP2zvW5iILuRqwABFPeHAATfHyA=
Thread-topic: [PATCH] Enable Core 2 Duo Performance Counters in HVM guest

Hi, Keir

 

Please see my comments embedded.

 


From: Keir Fraser [mailto:Keir.Fraser@xxxxxxxxxxxx]
Sent: 2007
1211 18:38
To: Shan, Haitao
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; Jiang, Yunhong
Subject: Re: [PATCH] Enable Core 2 Duo Performance Counters in HVM guest

 

* Don’t define new MSR macros – use the existing ones (or fixup the eixsting ones to have better names if you really think that is necessary, although I doubt it is in this case).

I will update.

 * Some of the indentation is rather wacky.

I will update.

 * Poking the LVTPC as a one-off event only when the VCPU writes its virtual LVTPC is not going to fly. What if the VCPU is subsequently migrated to a different physical CPU? In any case the LVTPC is a shared resource that needs synchronised access via e.g., context switching or mutual exclusion (see the next point below).

I think in the patch I will save/load LVTPC during context switch.

 * How does this interact with, for example, xenoprof? Ideally we should be able to run xenoprof and this concurrently over disjoint subsets of domains. At the very least xenoprof and this patch should avoid stomping on each other by implementing some form of mutual exclusion. Probably some resource sharing (e.g., the PMC interrupt vector) also is possible. I expect this will require some design thought, but unfortunately that is the price for being second into the tree.

Yes. How to share PMU resources will need careful design. But I really don’t think it possible to run both concurrently unless we do some sort of PMC’s partition. Of course, it is silly of me not to implement a mechanism for mutual exclusion. I will implement one.

 * Impact on save/restore to/from Core-2 processors: has this been tested at all?

I will try doing the test. I think whether it should support save/restore can be argued. Does anyone want to run VTune/Oprofile during save/restore? This can be hardly a good usage model. But at least, I update it to ensure it does not break current save/restore.

 -- Keir

On 11/12/07 10:06, "Shan, Haitao" <haitao.shan@xxxxxxxxx> wrote:

Hi, Keir,

Currently, HVM guests do not have access to performance counters. So it is not possible to use performance analyzer software such as vtune in HVM guest to analyze programme performance. Other usage of performance counters , for example, the NMI watchdog, won't function either.

This patch will enable performance counters in HVM guest. Currently, only Core 2 Duo is implemented. Tests are carried out using Intel Vtune Performance Analyzer in Windows XP Professional with 2 vcpus.

There are some notes at the beginning of the patch, describing implementation choices in this patch.

Signed-off-by:    Haitao Shan <haitao.shan@xxxxxxxxx>
 <<pmu.patch>>

Best Regards
Haitao Shan

 

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