Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1111333imm; Wed, 1 Aug 2018 10:21:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIjTPUNZRxbFBA2CAp+6bqR4rarcKKsfhc4H3P6tisoh0DB2BHoYMr9K4ePH5LHoQuHe68 X-Received: by 2002:a65:5b8e:: with SMTP id i14-v6mr25505680pgr.242.1533144106902; Wed, 01 Aug 2018 10:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144106; cv=none; d=google.com; s=arc-20160816; b=wr/fkJus1lyie3BOTCF/sNNrsar/FzFjh9SFVCGGoQe9pwo85V1QgybGcQbpMGBKO9 MtlpthCSFlwkhEM2xvw7RQEVgkRlLxqZla9HkF27ZxQ4sp8dlz408iy8OJbypazpnRwr YaTPeIRhXkPpoJrLEZUHbygFYWnm2tu15o9/m1sknj0HE3C6X0PEaqX4PVe2/Gq92FUg YXp7UKRlzf5qdkpOpucd6C9rJruICs5MNJ2CW9xaVag7dPtuPHsuG+Olv4hAYdppxAcg 9rdpw9El30Mm75rue6mrY9Xc0M2+21aVVsYPAPYYHwpQUGIaMoquc6ULgi5OFb3D5jgu 1kqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kfFCq/JUDVJeYSvWmyY78fu4C2fzSGcJzhFtXTWfekA=; b=vnf7vpvUcKsh8exNiZnp16FhTH7F3O0MZh3/QUHc2cy1GlEQiifmfyDkAlCra7WJIo hfxUwwWoV9eeCzuW9uRdsRKtxav9A3yq3rG/t1Vv+cqjvsMaZGnIhvAHje3capN/cLEL iNWIEGyj209WKWotTSf26wrT/cOM8l6vYf5V/lvnxTgLR5P28MWBJONdWSUhXgcp4260 7c4HpSp4T69PzoMrUYg0wkrsiEiUWc2OJQQyzlnnJyRTGt+2ddKZ2Y4E5HI3MnxNVtk6 zsVXFYBoIe6QTfsZAJ21IeWdpwmsmyQreE7huthS9tWfAc/nK9VmMfYXI89k7Qzd8RFR 0r6g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7-v6si14758585pgp.411.2018.08.01.10.21.32; Wed, 01 Aug 2018 10:21:46 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405179AbeHATGE (ORCPT + 99 others); Wed, 1 Aug 2018 15:06:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48212 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403884AbeHATGD (ORCPT ); Wed, 1 Aug 2018 15:06:03 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AF549CC3; Wed, 1 Aug 2018 17:19:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Pawel Moll , Will Deacon , Sasha Levin Subject: [PATCH 4.14 113/246] drivers/perf: arm-ccn: dont log to dmesg in event_init Date: Wed, 1 Aug 2018 18:50:23 +0200 Message-Id: <20180801165017.112789617@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Rutland [ Upstream commit 1898eb61fbc9703efee886d3abec27a388cf28c3 ] The ARM CCN PMU driver uses dev_warn() to complain about parameters in the user-provided perf_event_attr. This means that under normal operation (e.g. a single invocation of the perf tool), a number of messages warnings may be logged to dmesg. Tools may issue multiple syscalls to probe for feature support, and multiple applications (from multiple users) can attempt to open events simultaneously, so this is not very helpful, even if a user happens to have access to dmesg. Worse, this can push important information out of the dmesg ring buffer, and can significantly slow down syscall fuzzers, vastly increasing the time it takes to find critical bugs. Demote the dev_warn() instances to dev_dbg(), as is the case for all other PMU drivers under drivers/perf/. Users who wish to debug PMU event initialisation can enable dynamic debug to receive these messages. Signed-off-by: Mark Rutland Cc: Pawel Moll Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/bus/arm-ccn.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) --- a/drivers/bus/arm-ccn.c +++ b/drivers/bus/arm-ccn.c @@ -736,7 +736,7 @@ static int arm_ccn_pmu_event_init(struct ccn = pmu_to_arm_ccn(event->pmu); if (hw->sample_period) { - dev_warn(ccn->dev, "Sampling not supported!\n"); + dev_dbg(ccn->dev, "Sampling not supported!\n"); return -EOPNOTSUPP; } @@ -744,12 +744,12 @@ static int arm_ccn_pmu_event_init(struct event->attr.exclude_kernel || event->attr.exclude_hv || event->attr.exclude_idle || event->attr.exclude_host || event->attr.exclude_guest) { - dev_warn(ccn->dev, "Can't exclude execution levels!\n"); + dev_dbg(ccn->dev, "Can't exclude execution levels!\n"); return -EINVAL; } if (event->cpu < 0) { - dev_warn(ccn->dev, "Can't provide per-task data!\n"); + dev_dbg(ccn->dev, "Can't provide per-task data!\n"); return -EOPNOTSUPP; } /* @@ -771,13 +771,13 @@ static int arm_ccn_pmu_event_init(struct switch (type) { case CCN_TYPE_MN: if (node_xp != ccn->mn_id) { - dev_warn(ccn->dev, "Invalid MN ID %d!\n", node_xp); + dev_dbg(ccn->dev, "Invalid MN ID %d!\n", node_xp); return -EINVAL; } break; case CCN_TYPE_XP: if (node_xp >= ccn->num_xps) { - dev_warn(ccn->dev, "Invalid XP ID %d!\n", node_xp); + dev_dbg(ccn->dev, "Invalid XP ID %d!\n", node_xp); return -EINVAL; } break; @@ -785,11 +785,11 @@ static int arm_ccn_pmu_event_init(struct break; default: if (node_xp >= ccn->num_nodes) { - dev_warn(ccn->dev, "Invalid node ID %d!\n", node_xp); + dev_dbg(ccn->dev, "Invalid node ID %d!\n", node_xp); return -EINVAL; } if (!arm_ccn_pmu_type_eq(type, ccn->node[node_xp].type)) { - dev_warn(ccn->dev, "Invalid type 0x%x for node %d!\n", + dev_dbg(ccn->dev, "Invalid type 0x%x for node %d!\n", type, node_xp); return -EINVAL; } @@ -808,19 +808,19 @@ static int arm_ccn_pmu_event_init(struct if (event_id != e->event) continue; if (e->num_ports && port >= e->num_ports) { - dev_warn(ccn->dev, "Invalid port %d for node/XP %d!\n", + dev_dbg(ccn->dev, "Invalid port %d for node/XP %d!\n", port, node_xp); return -EINVAL; } if (e->num_vcs && vc >= e->num_vcs) { - dev_warn(ccn->dev, "Invalid vc %d for node/XP %d!\n", + dev_dbg(ccn->dev, "Invalid vc %d for node/XP %d!\n", vc, node_xp); return -EINVAL; } valid = 1; } if (!valid) { - dev_warn(ccn->dev, "Invalid event 0x%x for node/XP %d!\n", + dev_dbg(ccn->dev, "Invalid event 0x%x for node/XP %d!\n", event_id, node_xp); return -EINVAL; }