Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3818886ybi; Mon, 29 Jul 2019 13:14:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgUzaPRw6ojY2IQE2zz5KmYiQAk1STgoSOWfOsr/8O8jxXsltcWdk1ph6Ar/D2kgueX+vU X-Received: by 2002:a62:b411:: with SMTP id h17mr36696177pfn.99.1564431249840; Mon, 29 Jul 2019 13:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431249; cv=none; d=google.com; s=arc-20160816; b=Xld/RYbExwu4XTO0mueCeZd9oqhOtnJM5N/oDoo8svy9+3Dpk3v9J1b75omjYVjJeW kH2pPm9Y5Fa5NN3as4fQywMJoMOA5Cci2kHMlN9wNuJD2nfdx/Sf7DrVPAwpLAEly2v8 tTZWvXekzcFBAbRiHM4t2cdE0ogSFUlXtzHO9cdbEQivA6yU1O98pmGVHCW99Wn7V2uS U8IDGwKqjWUiuJZjkiXvq8ZM+AzCq3UDDWHVgP4VL9FcGLELwaNYbnOxhMZdl8Fv9NIZ 9SUsRsTnb08PKw76ao/w7uR3DsSRIabRG0HU+vzNPsE6hLGyc+gC9LFJAn0JhBzvBNpo v5+A== 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=zOQ96+ufw/bI4NXVV6LSpx6Sx9S2mnHMt7EdBCU35wYvKXig5dLJ5/RjnDj90tcdDB K7RCrDEFJZhmW3m+GEP8/HLAHla6b9cLE/CBru5aNOiF3fNqMXr4BvjxBjN5BVdn+VTf YoHmK9xAQesdWVRqwEWsfcYenZTjmQPw5r9+p/aGPW+OG+AfFN4KorK8Wt5QHEJ0p0qH 3qI+RTC1PpUfHGTIimnogLXYbL1DkHl3uUYmGESZEoUfs5F+C5amknLo9G+AqCTrCNhh YP+wmDY/Ue/+yFnMo6Gu+RF6IVliBbmm8ExiEp1ifCHZha1rS2JKenah2DdUWcfmJxn1 4NnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IlVhvXBb; 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 w1si25407989plq.125.2019.07.29.13.13.54; Mon, 29 Jul 2019 13:14:09 -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=IlVhvXBb; 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 S1729166AbfG2TbT (ORCPT + 99 others); Mon, 29 Jul 2019 15:31:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:43988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728715AbfG2TbN (ORCPT ); Mon, 29 Jul 2019 15:31:13 -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 0D6142171F; Mon, 29 Jul 2019 19:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428672; bh=cD9rrDxEyc0yZkzD6bSEDLpUywUmGpNUOh7GXJ8xpX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IlVhvXBbm7p/L+VOO2twgcA1FwRa6ZezfV3OSPZZO8ipu9R9CFIpjK6R8Vnolku1w AyPP0EZ+sGZFc/8KO9XyCDpSgpNcHXA0N5+03+ADlBKPgd9lESTVbscYValV+uIPgx 925TM8XqCj4D+CiOmsXmu59sdLw2xZvaBYJ9HIhw= 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.14 143/293] KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed Date: Mon, 29 Jul 2019 21:20:34 +0200 Message-Id: <20190729190835.494094365@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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; }