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: <1268787902.13901.36.camel@minggr.sh.intel.com>
Date:	Wed, 17 Mar 2010 09:05:02 +0800
From:	Lin Ming <ming.m.lin@...el.com>
To:	Cyrill Gorcunov <gorcunov@...il.com>
Cc:	Robert Richter <robert.richter@....com>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"acme@...hat.com" <acme@...hat.com>,
	"eranian@...gle.com" <eranian@...gle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"peterz@...radead.org" <peterz@...radead.org>,
	"fweisbec@...il.com" <fweisbec@...il.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:perf/x86] perf, x86: Implement initial P4 PMU driver

On Wed, 2010-03-17 at 00:23 +0800, Cyrill Gorcunov wrote:
> On Tue, Mar 16, 2010 at 05:07:33PM +0100, Robert Richter wrote:
> [...]
> > --
> > 
> > From: Robert Richter <robert.richter@....com>
> > Date: Tue, 16 Mar 2010 16:38:19 +0100
> > Subject: [PATCH] perf, x86: reporting error code that returns from x86_pmu.hw_config()
> > 
> > If x86_pmu.hw_config() fails a fixed error code (-EOPNOTSUPP) is
> > return even if a different error was reported. This patch fixes this.
> > 
> > Signed-off-by: Robert Richter <robert.richter@....com>
> > ---
> >  arch/x86/kernel/cpu/perf_event.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> > index 4e2480f..8982d92 100644
> > --- a/arch/x86/kernel/cpu/perf_event.c
> > +++ b/arch/x86/kernel/cpu/perf_event.c
> > @@ -467,8 +467,9 @@ static int __hw_perf_event_init(struct perf_event *event)
> >  	hwc->last_tag = ~0ULL;
> >  
> >  	/* Processor specifics */
> > -	if (x86_pmu.hw_config(attr, hwc))
> > -		return -EOPNOTSUPP;
> > +	err = x86_pmu.hw_config(attr, hwc);
> > +	if (err)
> > +		return err;
> >  
> >  	if (!hwc->sample_period) {
> >  		hwc->sample_period = x86_pmu.max_period;
> > -- 
> > 1.7.0
> >
> 
> Though at moment all hw_config callees return 0, it's better
> to be ready if one day we may start returning some particular
> errors. Looks good to me. Objections?

Looks good.

Lin Ming

> 
> 	-- Cyrill

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ