From: "Jan Beulich" Subject: [PATCH 4/4] VMX/vPMU: reduce core2_vpmu_initialise() verbosity Date: Tue, 12 Aug 2014 10:18:58 +0100 Message-ID: <53E9F822020000780002B744@mail.emea.novell.com> References: <53E9F5A0020000780002B70C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1C2EAB12.1__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XH8EQ-0008VS-BN for xen-devel@lists.xenproject.org; Tue, 12 Aug 2014 09:19:02 +0000 In-Reply-To: <53E9F5A0020000780002B70C@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Kevin Tian , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1C2EAB12.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline No need to print these messages for each vCPU, even more, no need to print them for each domain - they all depend on CPU features that are either there or not. Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/vmx/vpmu_core2.c +++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c @@ -764,19 +764,19 @@ static int core2_vpmu_initialise(struct=20 { struct vpmu_struct *vpmu =3D vcpu_vpmu(v); u64 msr_content; - struct cpuinfo_x86 *c =3D ¤t_cpu_data; + static bool_t ds_warned; =20 if ( !(vpmu_flags & VPMU_BOOT_BTS) ) goto func_out; /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX[21] */ - if ( cpu_has(c, X86_FEATURE_DS) ) + while ( boot_cpu_has(X86_FEATURE_DS) ) { - if ( !cpu_has(c, X86_FEATURE_DTES64) ) + if ( !boot_cpu_has(X86_FEATURE_DTES64) ) { - printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area" - " - Debug Store disabled for %pv\n", - v); - goto func_out; + if ( !ds_warned ) + printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS = Area" + " - Debug Store disabled for guests\n"); + break; } vpmu_set(vpmu, VPMU_CPU_HAS_DS); rdmsrl(MSR_IA32_MISC_ENABLE, msr_content); @@ -784,14 +784,16 @@ static int core2_vpmu_initialise(struct=20 { /* If BTS_UNAVAIL is set reset the DS feature. */ vpmu_reset(vpmu, VPMU_CPU_HAS_DS); - printk(XENLOG_G_WARNING "CPU has set BTS_UNAVAIL" - " - Debug Store disabled for %pv\n", - v); + if ( !ds_warned ) + printk(XENLOG_G_WARNING "CPU has set BTS_UNAVAIL" + " - Debug Store disabled for guests\n"); + break; } - else + + vpmu_set(vpmu, VPMU_CPU_HAS_BTS); + if ( !ds_warned ) { - vpmu_set(vpmu, VPMU_CPU_HAS_BTS); - if ( !cpu_has(c, X86_FEATURE_DSCPL) ) + if ( !boot_cpu_has(X86_FEATURE_DSCPL) ) printk(XENLOG_G_INFO "vpmu: CPU doesn't support CPL-Qualified BTS\n"); printk("******************************************************= \n"); @@ -803,8 +805,10 @@ static int core2_vpmu_initialise(struct=20 printk("** It is NOT recommended for production use! = **\n"); printk("******************************************************= \n"); } + break; } -func_out: + ds_warned =3D 1; + func_out: check_pmc_quirk(); return 0; } --=__Part1C2EAB12.1__= Content-Type: text/plain; name="VMX-vPMU-verbosity.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VMX-vPMU-verbosity.patch" VMX/vPMU: reduce core2_vpmu_initialise() verbosity=0A=0ANo need to print = these messages for each vCPU, even more, no need to=0Aprint them for each = domain - they all depend on CPU features that are=0Aeither there or = not.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/hvm/vmx/vpmu_core2.c=0A+++ b/xen/arch/x86/hvm/vmx/vpmu_core2= .c=0A@@ -764,19 +764,19 @@ static int core2_vpmu_initialise(struct =0A = {=0A struct vpmu_struct *vpmu =3D vcpu_vpmu(v);=0A u64 msr_content;= =0A- struct cpuinfo_x86 *c =3D ¤t_cpu_data;=0A+ static bool_t = ds_warned;=0A =0A if ( !(vpmu_flags & VPMU_BOOT_BTS) )=0A goto = func_out;=0A /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX= [21] */=0A- if ( cpu_has(c, X86_FEATURE_DS) )=0A+ while ( boot_cpu_ha= s(X86_FEATURE_DS) )=0A {=0A- if ( !cpu_has(c, X86_FEATURE_DTES64= ) )=0A+ if ( !boot_cpu_has(X86_FEATURE_DTES64) )=0A {=0A- = printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area"=0A- = " - Debug Store disabled for %pv\n",=0A- = v);=0A- goto func_out;=0A+ if ( !ds_warned )=0A+ = printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS = Area"=0A+ " - Debug Store disabled for guests\n");=0A= + break;=0A }=0A vpmu_set(vpmu, VPMU_CPU_HAS_DS)= ;=0A rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);=0A@@ -784,14 = +784,16 @@ static int core2_vpmu_initialise(struct =0A {=0A = /* If BTS_UNAVAIL is set reset the DS feature. */=0A = vpmu_reset(vpmu, VPMU_CPU_HAS_DS);=0A- printk(XENLOG_G_WARNING = "CPU has set BTS_UNAVAIL"=0A- " - Debug Store disabled = for %pv\n",=0A- v);=0A+ if ( !ds_warned )=0A+ = printk(XENLOG_G_WARNING "CPU has set BTS_UNAVAIL"=0A+ = " - Debug Store disabled for guests\n");=0A+ = break;=0A }=0A- else=0A+=0A+ vpmu_set(vpmu, = VPMU_CPU_HAS_BTS);=0A+ if ( !ds_warned )=0A {=0A- = vpmu_set(vpmu, VPMU_CPU_HAS_BTS);=0A- if ( !cpu_has(c, = X86_FEATURE_DSCPL) )=0A+ if ( !boot_cpu_has(X86_FEATURE_DSCPL) = )=0A printk(XENLOG_G_INFO=0A "vpmu: = CPU doesn't support CPL-Qualified BTS\n");=0A printk("*********= *********************************************\n");=0A@@ -803,8 +805,10 @@ = static int core2_vpmu_initialise(struct =0A printk("** It is = NOT recommended for production use! **\n");=0A = printk("******************************************************\n");=0A = }=0A+ break;=0A }=0A-func_out:=0A+ ds_warned =3D 1;=0A+ = func_out:=0A check_pmc_quirk();=0A return 0;=0A }=0A --=__Part1C2EAB12.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part1C2EAB12.1__=--