lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190415094806.GE13124@krava>
Date:   Mon, 15 Apr 2019 11:48:06 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Bandan Das <bsd@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH] perf/x86: descriptive failure messages for PMU init

On Fri, Apr 12, 2019 at 03:09:17PM -0400, Bandan Das wrote:

SNIP

>  msr_fail:
> -	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
> +	if (virt)
>  		pr_cont("PMU not available due to virtualization, using software events only.\n");
> -	} else {
> -		pr_cont("Broken PMU hardware detected, using software events only.\n");
> -		pr_err("Failed to access perfctr msr (MSR %x is %Lx)\n",
> -		       reg, val_new);
> +	switch (status) {
> +	case READ_FAIL:
> +		if (virt)
> +			pr_debug("Failed to read perfctr msr (MSR %x)\n", reg);
> +		else
> +			pr_err("Failed to read perfctr msr (MSR %x)\n", reg);
> +		break;
> +	case WRITE_FAIL:
> +		if (virt)
> +			pr_debug("Failed to write perfctr msr (MSR %x, wrote: %llx, read: %llx)\n",
> +				 reg, val, val_new);
> +		else
> +			pr_err("Failed to write perfctr msr (MSR %x, wrote: %llx, read: %llx)\n",
> +				 reg, val, val_new);
> +		break;
> +	case PMU_FAIL:
> +		/* fall through for default message */
> +	default:
> +		if (virt)
> +			pr_debug("Broken PMU hardware detected, using software events only.\n");
> +		else
> +			pr_cont("Broken PMU hardware detected, using software events only.\n");

hum, why can't we have just one pr_err for both virt and bare metal?

jirka

>  	}
>  
>  	return false;
> -- 
> 2.19.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ