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=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 3414AC28CC1 for ; Sat, 1 Jun 2019 13:22:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 091DB27260 for ; Sat, 1 Jun 2019 13:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559395375; bh=8jL1TJamrPDMj7nKmGp99CsljBgCLKMakaLAlT0gSNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=v/+lLF1/TLK/l/32WQwQDe5p9jWoMiBIuR/+1oVSSZO+3t5RSUVptNixHuOWtPUV1 T4p+PdKxA+5ZHPpAWAjYGctfGBrzt0X6U2obyfDm83mIJ0XDKH6CtoTD6X3v48dN/F ZE0e919k7Qot/VMNY9SKhOdOICVqe5mxs/rSHQME= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbfFANWy (ORCPT ); Sat, 1 Jun 2019 09:22:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728442AbfFANWw (ORCPT ); Sat, 1 Jun 2019 09:22:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA68B24C2E; Sat, 1 Jun 2019 13:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559395371; bh=8jL1TJamrPDMj7nKmGp99CsljBgCLKMakaLAlT0gSNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZuRRHFvZcbweiIsZU423uQl6YZmL7aUM9zIOwjuHUWWYSXF8pY+vZkitRvVdengCh U4Ob8M+eBPS3ZdnY4/rAdBQYgFECcub4J7LBZ0L6D4i6paukicqRxnoemYM1kDy7U9 My216gDA/SWxioUPcUBaTeWfeaipMrvPbkAEBGaA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: 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 AUTOSEL 4.19 023/141] perf/x86/intel: Allow PEBS multi-entry in watermark mode Date: Sat, 1 Jun 2019 09:19:59 -0400 Message-Id: <20190601132158.25821-23-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190601132158.25821-1-sashal@kernel.org> References: <20190601132158.25821-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephane Eranian [ 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 a759e59990fbd..eb4568b5d0d19 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3068,7 +3068,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_large_pebs_flags(event))) -- 2.20.1