Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6455434imu; Wed, 30 Jan 2019 15:15:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FA3Vwbkzx9WAePGeKV61BR1iwdKGVhHlc0wjlhIFOkBuVm9bBxYsveXoP2iISquUPRjsZ X-Received: by 2002:a62:870e:: with SMTP id i14mr33162963pfe.41.1548890105964; Wed, 30 Jan 2019 15:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548890105; cv=none; d=google.com; s=arc-20160816; b=DltlbEe7d26rEZx5goZjMunlHrxvqp6SLqEj5tVddllhzr+J+prFoB9RuHpRQGDDKv EOJe8r24Z4mHj0WcpwusLj/GGFQ70mA+o2ltQ6IAH0IuAid3inxtp1GQ08UpLqar+ZIB ugoF02xSQ0GlCRirxM04SZcsmpUlzDy+a+77KL2z5TUcoxsvJaZtqJNCqC5QhDo5vggd rSvq6M0biVprESzs3nbvKiLs6Ru8JAUSFUGidn/sjjxo0N+WkXLLejG+Yg0r5X8O5RAy Xjay/PuDCCLJyagy5+c8rJcxFYaFsUyWDkv5L2xbrw0yLWXPrlrV4KLpmloi7iZpe0cD LexA== 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=fr001usicyy9sw97UH5uIW0JYSbzhVs2TAr3UiiDLZE=; b=w/NhNG2AODJMx76B/WEVqSI8uNVzy/P37ek21QSAEqoKsIMESiS2EbyHBw31Ktiema RmdULCIIKBLBm3eZeGEAtAcpMkjK1AqzftExeajmtFAa8kIOghVGIsTih1Egq1jXnLol vYmLq566KdVuOsqjoHw+Z0en1gkP3xqgvbArWV8f7EZVXsDw1nRmX8/pZmX40GVA7rNG fr/gSdsXUdD+ympiukX6FNQosLHiE33aa6bNnvqHj9qOjzi3oUpqV6LzRCRSQ1Nfb+Kv asvgzXU0S0oUngfT2v8leujMq8aflHi/pU/pvpPS8oKzuKkjts47J7N327F7J9xE4ZrL Ifcw== 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 e9si2745828plt.181.2019.01.30.15.14.50; Wed, 30 Jan 2019 15:15:05 -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 S1728522AbfA3XNB (ORCPT + 99 others); Wed, 30 Jan 2019 18:13:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36112 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbfA3XNA (ORCPT ); Wed, 30 Jan 2019 18:13:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2767AE93; Wed, 30 Jan 2019 22:33:12 +0000 (UTC) Received: from krava (ovpn-204-189.brq.redhat.com [10.40.204.189]) by smtp.corp.redhat.com (Postfix) with SMTP id EDC685D787; Wed, 30 Jan 2019 22:33:09 +0000 (UTC) Date: Wed, 30 Jan 2019 23:33:08 +0100 From: Jiri Olsa To: Andi Kleen Cc: Ravi Bangoria , lkml , Peter Zijlstra , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , eranian@google.com, vincent.weaver@maine.edu, "Naveen N. Rao" Subject: Re: System crash with perf_fuzzer (kernel: 5.0.0-rc3) Message-ID: <20190130223308.GA8145@krava> References: <7c7ec3d9-9af6-8a1d-515d-64dcf8e89b78@linux.ibm.com> <20190130183648.GA24233@krava> <87zhrhzxpo.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zhrhzxpo.fsf@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 30 Jan 2019 22:33:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 30, 2019 at 12:39:47PM -0800, Andi Kleen wrote: > Jiri Olsa writes: > > > > the patch adds check_eriod pmu callback.. I need to check if there's > > better way to do this, but so far it fixes the crash for me > > > > if you guys could check this patch, that'd be great > > There's already a limit_period callback, perhaps that could > be extended. But ok, can do it this way too. right, we call it within x86_perf_event_set_period to limit the period, but I guess we should include this check after changing the period: if (event->attr.sample_period && x86_pmu.limit_period) { if (x86_pmu.limit_period(event, event->attr.sample_period) > event->attr.sample_period) return -EINVAL; } > > I suspect there are some other cases that need this callback, not > just BTS, e.g. the checks in hsw_hw_config ok, the sample_period values for checkpointed events, we should check for this as well.. I'll add that jirka