From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932389AbcCKOYP (ORCPT ); Fri, 11 Mar 2016 09:24:15 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:54045 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbcCKOYL (ORCPT ); Fri, 11 Mar 2016 09:24:11 -0500 Date: Fri, 11 Mar 2016 15:23:46 +0100 From: Peter Zijlstra To: Vince Weaver Cc: mingo@kernel.org, alexander.shishkin@linux.intel.com, eranian@google.com, linux-kernel@vger.kernel.org, dvyukov@google.com, andi@firstfloor.org, jolsa@redhat.com, panand@redhat.com, sasha.levin@oracle.com, oleg@redhat.com, Borislav Petkov Subject: Re: [PATCH 00/12] perf: more fixes Message-ID: <20160311142346.GE6344@twins.programming.kicks-ass.net> References: <20160224174539.570749654@infradead.org> <20160310143924.GR6356@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 10, 2016 at 09:44:30AM -0500, Vince Weaver wrote: > On Thu, 10 Mar 2016, Peter Zijlstra wrote: > > > On Wed, Feb 24, 2016 at 06:45:39PM +0100, Peter Zijlstra wrote: > > > > Boris, who has been running syz-kaller on AMD hardware and was hitting a > > very similar bug with the AMD-IBS code, says its not fixed it for him, > > so maybe there's still more to find. > > sorry I am not being much help with this big syz-kaller bug hunt, but I > just wanted to chime in that there's a (probably the same) long standing > IBS bug that perf_fuzzer hits all the time too, it was bad enough > that I had to stop running perf_fuzzer on my AMD box. The below seems to fix the IBS issue tickled by syz-kaller on my machine. I've not yet ran perf-fuzzer, which seems able to tickle a different set of bugs. --- Subject: perf, amb: Fix IBS throttle When the IBS IRQ handler get a !0 return from perf_event_overflow; meaning it should throttle the event, it only disables it, it doesn't call perf_ibs_stop(). This confuses the state machine, as we'll use pmu::start() -> perf_ibs_start() to unthrottle. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/events/amd/ibs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 51087c29b2c2..7956d29762ef 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -599,7 +599,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) throttle = perf_event_overflow(event, &data, ®s); out: if (throttle) - perf_ibs_disable_event(perf_ibs, hwc, *config); + perf_ibs_stop(event, 0); else perf_ibs_enable_event(perf_ibs, hwc, period >> 4);