[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130423131844.GA24467@redhat.com>
Date: Tue, 23 Apr 2013 15:18:44 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Jacob Shin <jacob.shin@....com>
Cc: Ingo Molnar <mingo@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
Stephane Eranian <eranian@...gle.com>,
Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 1/4] perf: Add hardware breakpoint address mask
On 04/23, Jacob Shin wrote:
>
> +__weak int arch_validate_hwbkpt_addr_mask(struct perf_event *bp)
> +{
> + return bp->attr.bp_addr_mask == 0;
> +}
> +
> static int validate_hw_breakpoint(struct perf_event *bp)
> {
> int ret;
> @@ -393,6 +398,10 @@ static int validate_hw_breakpoint(struct perf_event *bp)
> if (ret)
> return ret;
>
> + ret = arch_validate_hwbkpt_addr_mask(bp);
> + if (ret)
> + return ret;
Well, this looks obviously wrong?
arch_validate_hwbkpt_addr_mask() fails if bp_addr_mask == 0? and returns
"1" as the error code.
Either it should returns something like "bp_addr_mask ? -ENOTSUPP : 0"
or the caller should do "if (!validate_hw_breakpoint()) return -ERR".
Oleg.
--
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