From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 861FBC43613 for ; Thu, 20 Jun 2019 18:28:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6234C2082C for ; Thu, 20 Jun 2019 18:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561055297; bh=ZEN0/7RT2JRG+vR8Wf2F7wNcWnsS6JLk2C5xXOH/tEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2SELxm7tsJTTrCN1flJJtSP3EBCdmPRCE8jC2sYvLaOWH/z5eAb6+gqjRb4V+cQuN V5lo2m28wvdiYdG06bG8WRbMvayq3Db6X2SOZYe2KM1hQfedGsjErn250KjaVWceTo WAz0REbt64bPuKXperOYQrtYb6wXuD3PH4INWp1E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727059AbfFTSEG (ORCPT ); Thu, 20 Jun 2019 14:04:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:55992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727770AbfFTSED (ORCPT ); Thu, 20 Jun 2019 14:04:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D71E0204FD; Thu, 20 Jun 2019 18:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561053842; bh=ZEN0/7RT2JRG+vR8Wf2F7wNcWnsS6JLk2C5xXOH/tEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=00pyS6Ple4NSEhdwIXpOtuRrvQH6UCOmycLMCk0iU6/ihjWsswtGYhAOKvqvCajJR yX+tey2dE890doDF6JLvW9SovOenyc0zf96HuQ2hvFue9AnSaAXI2DKsIhaiurz2eI 0Cmk2VxISXc/3UEW1GfYIcfZFw0O6DPh47qym23A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephane Eranian , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , jolsa@redhat.com, kan.liang@intel.com, vincent.weaver@maine.edu, Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 016/117] perf/x86/intel: Allow PEBS multi-entry in watermark mode Date: Thu, 20 Jun 2019 19:55:50 +0200 Message-Id: <20190620174352.968489047@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174351.964339809@linuxfoundation.org> References: <20190620174351.964339809@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit c7a286577d7592720c2f179aadfb325a1ff48c95 ] This patch fixes a restriction/bug introduced by: 583feb08e7f7 ("perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS") The original patch prevented using multi-entry PEBS when wakeup_events != 0. However given that wakeup_events is part of a union with wakeup_watermark, it means that in watermark mode, PEBS multi-entry is also disabled which is not the intent. This patch fixes this by checking is watermark mode is enabled. Signed-off-by: Stephane Eranian Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: jolsa@redhat.com Cc: kan.liang@intel.com Cc: vincent.weaver@maine.edu Fixes: 583feb08e7f7 ("perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS") Link: http://lkml.kernel.org/r/20190514003400.224340-1-eranian@google.com Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index cb8178a2783a..e98e238d3775 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -2867,7 +2867,7 @@ static int intel_pmu_hw_config(struct perf_event *event) return ret; if (event->attr.precise_ip) { - if (!(event->attr.freq || event->attr.wakeup_events)) { + if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; if (!(event->attr.sample_type & ~intel_pmu_free_running_flags(event))) -- 2.20.1