[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <542A2F4B.5060405@redhat.com>
Date: Mon, 29 Sep 2014 23:19:23 -0500
From: Wei Huang <wei@...hat.com>
To: linux-kernel@...r.kernel.org
CC: x86@...nel.org, tglx@...utronix.de, mingo@...hat.com, hpa@...or.com
Subject: Re: [PATCH 1/1] perf/x86: Use KERN_INFO when checking PMU fails on
virtual environment
Hi Ingo, tglx and hpa,
Any comment on this patch? Thanks.
-Wei
On 09/24/2014 10:55 PM, Wei Huang wrote:
> PMU checking can fail due to various reasons. On native machine,
> this is mostly caused by faulty hardware and it is reasonable to
> use KERN_ERR in reporting. However, when kernel is running on
> virtualized environment, this checking can fail if virtual PMU is
> not supported (e.g. KVM on AMD host). It is annoying to see
> an error message on splash screen, even though we know such failure
> is benign on virtualized environment.
>
> This patch checks if kernel is running in virtualized environment.
> If so, it will use KERN_INFO in reporting. This patch was tested
> successfully on KVM.
>
> Signed-off-by: Wei Huang <wei@...hat.com>
> ---
> arch/x86/kernel/cpu/perf_event.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> index 918d75f..16c7302 100644
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -243,7 +243,8 @@ static bool check_hw_exists(void)
>
> msr_fail:
> printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
> - printk(KERN_ERR "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
> + printk(boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR
> + "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
>
> return false;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists