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] [PATCH] Enable Core 2 DuoPerformanceCountersinHVM guest

To: "Shan, Haitao" <haitao.shan@xxxxxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Enable Core 2 DuoPerformanceCountersinHVM guest
From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Date: Thu, 31 Jan 2008 13:45:51 +0800
Delivery-date: Wed, 30 Jan 2008 21:47:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <823A93EED437D048963A3697DB0E35DE010E9BDD@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/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: <C3C5FABA.1B9B8%Keir.Fraser@xxxxxxxxxxxx> <823A93EED437D048963A3697DB0E35DE010E9BDD@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchjI+HHfc9VGIfdRRmDHn+4WaYJVAAACPKwAACncOMAACCAgAApKXhQ
Thread-topic: [Xen-devel] [PATCH] Enable Core 2 DuoPerformanceCountersinHVM guest
Hi, Keir,

Thanks for your checking in the patch. I think a little part of the original 
patch may be dropped by accident. I attach it here.

diff -r 5c30a9dec02d xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c   Wed Jan 30 18:39:04 2008 +0000
+++ b/xen/arch/x86/oprofile/nmi_int.c   Wed Jan 30 22:42:22 2008 +0800
@@ -291,12 +291,16 @@ static int __init p4_init(char ** cpu_ty
 }
 
 
+extern int ppro_has_global_ctrl;
 static int __init ppro_init(char ** cpu_type)
 {
        __u8 cpu_model = current_cpu_data.x86_model;
 
        if (cpu_model == 15 || cpu_model == 23)
+       {
                *cpu_type = "i386/core_2";
+               ppro_has_global_ctrl = 1;
+       }
        else if (cpu_model == 14)
                *cpu_type = "i386/core";
        else if (cpu_model > 13) {

Best Regards
Haitao Shan

Shan, Haitao wrote:
> Thanks!
> 
> Best Regards
> Haitao Shan
> 
> Keir Fraser wrote:
>> Good enough. I'll check it in.
>> 
>>  K.
>> 
>> 
>> On 30/1/08 09:44, "Shan, Haitao" <haitao.shan@xxxxxxxxx> wrote:
>> 
>>> Hi, Keir,
>>> 
>>> May I know what's your opinions about the patch now?
>>> 
>>> Best Regards
>>> Haitao Shan
>>> 
>>> I will. This isn't for 3.2.0 though, so I may not look until after
>>> the 
>>> 3.2.0 branch.
>>> 
>>>  -- Keri
>>> 
>>> On 17/12/07 07:22, "Shan, Haitao" <haitao.shan@xxxxxxxxx> wrote:
>>> 
>>> 
>>> 
>>> Hi, Keir,
>>> ?
>>> I have baked an updated patch. In this patch, I changed some
>>> logic?to shorten the lengthy part of core2_vpmu_do_wrmsr. And also,
>>> I did a rebase, since there?is?one?new changeset recently which
>>> made changes to xenoprofile. 
>>> 
>>> Can you have a look?
>>> <<pmu.patch>>
>>> Best Regards
>>> Haitao Shan
>>> 
>>> Shan, Haitao wrote:
>>>> Hi, Salvador,
>>>> 
>>>> Do you mean the strange indentation around CTRL_WRITE? That is
>>>> because there are three hard TABs before CTRL_WRITE. I am not sure
>>>> whether I should fix the original code, so I just leave them there
>>>> untouched. 
>>>> 
>>>> Haitao Shan
>>>> 
>>>  wrote:
>>>>> From: Otavio Salvador [mailto:otavio@xxxxxxxxxxxxxxxx
>>>> <mailto:otavio@xxxxxxxxxxxxxxxx> <mailto:otavio@xxxxxxxxxxxxxxxx> 
>>>> ] 
>>>>> Sent: 2007年12月15日 3:05 > To: Shan, Haitao
>>>>> Cc: Keir Fraser; xen-devel@xxxxxxxxxxxxxxxxxxx; Jiang, Yunhong
>>>>> Subject: Re: [Xen-devel] Re: [PATCH] Enable Core 2 Duo
>>>>> PerformanceCounters inHVM guest
>>>>> 
>>>>> "Shan, Haitao" <haitao.shan@xxxxxxxxx> writes:
>>>>> 
>>>>> Hello Haitao,
>>>>> 
>>>>> I've done a look on the patch and found two places with wrong
>>>> coding > style. Take a look bellow:
>>>>> 
>>>>>> diff -r 8f0cbfc478d6 xen/arch/x86/oprofile/op_model_ppro.c
>>>>>> --- a/xen/arch/x86/oprofile/op_model_ppro.c  Thu Dec 13 09:31:03
>>>> 2007 >> +0000 +++ b/xen/arch/x86/oprofile/op_model_ppro.c    Fri
>>>> Dec 14 >> 07:21:43 2007 +0800 @@ -126,6 +127,11 @@ static void
>>>>>>      ppro_start(struct op_msrs co CTRL_READ(low, high, msrs, 0);
>>>>>>      CTRL_SET_ACTIVE(low); CTRL_WRITE(low, high, msrs, 0);
>>>>>> +    /* Global Control MSR is enabled by default when system
>>>>>> power on. +     * However, this may not hold true when xenoprof
>>>>>> starts 
>>>> to >> run. +     */ +    if ( ppro_has_global_ctrl )
>>>>>> +        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 1);
>>>>>>  }
>>>>>> 
>>>>>> 
>>>>>> @@ -135,6 +141,8 @@ static void ppro_stop(struct op_msrs con
>>>>>>      CTRL_READ(low, high, msrs, 0);
>>>>>>      CTRL_SET_INACTIVE(low);
>>>>>>      CTRL_WRITE(low, high, msrs, 0);
>>>>>> +    if ( ppro_has_global_ctrl )
>>>>>> +        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
>>>>>>  }
>>>>> 
>>>>> Cheers,
>>>> 
>>>> 
>>>> ________________________________
>>>> 
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>>> http://lists.xensource.com/xen-devel
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>>> http://lists.xensource.com/xen-devel
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>> http://lists.xensource.com/xen-devel
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel

Attachment: pmu_fix.patch
Description: pmu_fix.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>