Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10428029ybi; Wed, 24 Jul 2019 23:02:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEI+GECevZPAUXPkRju7QeCHsamnfCVDAnEAOoEDM9LmkdbUoTv2waAHNytj3Yey7hycB5 X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr86374915plk.91.1564034568719; Wed, 24 Jul 2019 23:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034568; cv=none; d=google.com; s=arc-20160816; b=YqFOnsm/NuWM4px3zG3V2q3GKG8qiNVh6tCpkzEREgjW16lraMPC8ELgxV406/ZNBs qlNcG1PAbjp20ReB/rN1uBHTlI1Iiw8DtlW0Nkz+uj7EXKEQJNMivXQY/C4/gTB67qzN 2bEB6rIduhMSFC/e23xEq8op5fIrZYk7XxHzGeMleUsvY6cSyIk986HEVTG2Q0dywrHq Fb7CSl2nSZrBGPqH1ASJGSwsAb8Lw59oipICTaBrzggtvR+xSghbNCuroub4ytXGk9tz X6BaCGg6SrMhQMECnHoOnquuxqXL8udL9tmxjTilvJ+Fg5tEpTTv9dZk4YkxyCqyIuWM fy9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bXBOuy1z8GD8Yb/Y9LQgDE0G0rPwv06CvM4b2qppfaI=; b=KSJauYrfwL52/pZtYVqmhFw0YVDoyxKH1V1fbGrr4mUZgmEyw7niWtk/r/UPtBOF+U mVGZ/Pa7iJ34ASrLrtDX7vOy8L1aOlO41mEe+oCJKAX0ggtqHrLi3qB2ysaJYFWDC80M zDp2TDz3x5IFG58AyJQEgtof2xVyO3pqW22XDXq1PlE13hncDMQQTn2MY/SWhF+es2Uf R34jFoLXYD+SB+iAGOXAl0LCbY9uPtpdNzRMexJ7ouaTx0asGOC2wb1domz1J0UQNmf5 1CFelvW3rchtaGEEzRACYp01qQ4VQr8WU8SriqkVptLrPPf/4GyhBMVOb8b8aNlD701P LSsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pBO5JTID; 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 x3si15922250pgr.22.2019.07.24.23.02.30; Wed, 24 Jul 2019 23:02:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=pBO5JTID; 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 S2405311AbfGYFqB (ORCPT + 99 others); Thu, 25 Jul 2019 01:46:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:33492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405294AbfGYFqA (ORCPT ); Thu, 25 Jul 2019 01:46:00 -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 992D921850; Thu, 25 Jul 2019 05:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033560; bh=cD9rrDxEyc0yZkzD6bSEDLpUywUmGpNUOh7GXJ8xpX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBO5JTIDIur6HCYlyFPaJpIb7EfR+hXz9lGaEGQgRp6w+Oz8u+XWAEaAL/N9EJr3I pxhNZcYz4+S1w3shlwoDQLBU2Rd8h3kKvTUt3/7vHRErnJYmnnqqtAsCu91sNinEQA qOnhZTJxgOzhzVfmGa3dA585io8CvV4lsmFPPXLo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Perches , Like Xu , Paolo Bonzini Subject: [PATCH 4.19 213/271] KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed Date: Wed, 24 Jul 2019 21:21:22 +0200 Message-Id: <20190724191713.333646712@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Like Xu commit 6fc3977ccc5d3c22e851f2dce2d3ce2a0a843842 upstream. If a perf_event creation fails due to any reason of the host perf subsystem, it has no chance to log the corresponding event for guest which may cause abnormal sampling data in guest result. In debug mode, this message helps to understand the state of vPMC and we may not limit the number of occurrences but not in a spamming style. Suggested-by: Joe Perches Signed-off-by: Like Xu Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -131,8 +131,8 @@ static void pmc_reprogram_counter(struct intr ? kvm_perf_overflow_intr : kvm_perf_overflow, pmc); if (IS_ERR(event)) { - printk_once("kvm_pmu: event creation failed %ld\n", - PTR_ERR(event)); + pr_debug_ratelimited("kvm_pmu: event creation failed %ld for pmc->idx = %d\n", + PTR_ERR(event), pmc->idx); return; }