Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9809170imu; Wed, 5 Dec 2018 10:35:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VCokpeWS05Rvx0WtrCS3LZVmDU9LNI1SDoR9OP0jlY3nXzwc6OJviWLpu7Cdjn8dxS22+z X-Received: by 2002:a62:444b:: with SMTP id r72mr25893074pfa.184.1544034937155; Wed, 05 Dec 2018 10:35:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544034937; cv=none; d=google.com; s=arc-20160816; b=I01YE7TlcC28YpJwdescgBCwYMBAMd9cmDVCqm8kqDg31nAHNM6tmLtNqHYuvRZZq9 BL1Yi0KZMfTOEklQ5VLf49TBxGuEqc1fjPt2EAC8GxIeljc7IKimzwMOS+3j7pSy7CaS QYTBQzCQwF+8ojWz3P5nBgUCeB8duFq2WXLLs72GIaGwwfVX3hYkt8Rb5xSKZV50dht0 Bvj4xI1vQjZ4kjjqW6K4LRwGdIR0FtXa/hy3SvsLNWcEix6MCVaMTlD+jofSIXO2nOSh UgcKl99pq1eX+RbZgdcCRKVJdMOopaMnZFhOiXK/65e3u7UkVjAqqazCEMNoMk9efAXd udrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ek98OjGOP5ArhrMb8T/CT1lTBwbMt7WsLyTl7R2H55g=; b=neh+FPd+dslRfpXwwKIUK85Vb/nHVrv9iNjiRaMQ8ReVhghQunZSt8PrB62pFdfC1D a0U8G3bSVuZ3TVJEH1iwPAGvNJo8IZaoT14lKcLLI8lHbZlRTfWblr27Hp/nK3vzssoc Ys+iAitC7pPg+IcRQg05WOC+czZPvJSXvquPmGEAETmDsVjTgmWXY6DiGZmT1gVtvrPY +HSCpiaPe7TuWvVBzQm57Vm9q+FKgvh0zvqDf3Jltai3Xb2qfBX+m0aPVwDX5CZ9tY1n 5T762rXS97wB8u4ntcgh+ZCUn6korzZpr2z4xaxd0j4oKb9IZ6koAoFd0X5BbK5B2BKv nBlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si18801241pgh.305.2018.12.05.10.35.21; Wed, 05 Dec 2018 10:35:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728610AbeLESde (ORCPT + 99 others); Wed, 5 Dec 2018 13:33:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeLESd3 (ORCPT ); Wed, 5 Dec 2018 13:33:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DF053082A34; Wed, 5 Dec 2018 18:33:29 +0000 (UTC) Received: from krava (unknown [10.43.17.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 7E77D194AF; Wed, 5 Dec 2018 18:33:27 +0000 (UTC) Date: Wed, 5 Dec 2018 19:33:26 +0100 From: Jiri Olsa To: Vince Weaver Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , Andi Kleen Subject: Re: perf: perf_fuzzer triggers GPF in perf_prepare_sample Message-ID: <20181205183326.GE3836@krava> References: <20181205124538.GA19343@krava> <20181205163838.GA3836@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 05 Dec 2018 18:33:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 12:11:19PM -0500, Vince Weaver wrote: > On Wed, 5 Dec 2018, Jiri Olsa wrote: > > > On Wed, Dec 05, 2018 at 01:45:38PM +0100, Jiri Olsa wrote: > > > On Tue, Dec 04, 2018 at 10:54:55AM -0500, Vince Weaver wrote: > > > > Hello, > > > > > > > > I was able to trigger another oops with the perf_fuzzer with current git. > > > > > > > > This is 4.20-rc5 after the fix for the very similar oops I previously > > > > reported got committed. > > > > > > > > It seems to be pointing to the same location in the source as > > > > before, I guess maybe triggered a different way? > > > > > > nice.. yep, looks the same > > > > > > > > > > > Unfortunately this crash is not easily reproducible like the last one was. > > > > > > will check > > > > what model are hitting this on? > > Haswell. 6/60/3. > > While I can't deterministically trigger this, the fuzzer usually hits it > within an hour or two. Is there any debug or printk messages I can > add that would help figure out what's going on? I can't see how we could end up with that config other than some corruption.. the only way I see could be that we touch cpu->events array without checking its active_mask bit but that does not explain why the crash happened in the same place as before jirka --- diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index ecc3e34ca955..9a2fd5a68d87 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -2404,7 +2404,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) struct cpu_hw_events *cpuc; int loops; u64 status; - int handled; + int handled = 0; int pmu_enabled; cpuc = this_cpu_ptr(&cpu_hw_events); @@ -2423,8 +2423,10 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) intel_bts_disable_local(); cpuc->enabled = 0; __intel_pmu_disable_all(); - handled = intel_pmu_drain_bts_buffer(); - handled += intel_bts_interrupt(); + if (test_bit(INTEL_PMC_IDX_FIXED_BTS, cpuc->active_mask)) { + handled += intel_pmu_drain_bts_buffer(); + handled += intel_bts_interrupt(); + } status = intel_pmu_get_status(); if (!status) goto done;