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=-6.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 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 9ABFEC352A3 for ; Thu, 13 Feb 2020 04:15:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EBE62073C for ; Thu, 13 Feb 2020 04:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581567315; bh=olr3hd2IGIZyIKkJq5qnCPvtTULVzWdYH6xJF8/ByTE=; h=Subject:To:Cc:From:Date:List-ID:From; b=vnQKrfD0TAzNDX6UBAS8kxdsh64lu/ISNWyOcb2YgEKf+UyYN/v7TNssd5jgznSE5 T9rwXTWAdBdWkWcJkDgGKjLVbJqUOd3xt0aS/oU3/WfHsnVUNRUz/1MmArOCuICcp1 a3FnAHmgir4OcFHRI092rc8UD+zawgLMOoe8Erso= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729515AbgBMEPP (ORCPT ); Wed, 12 Feb 2020 23:15:15 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59507 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729443AbgBMEPO (ORCPT ); Wed, 12 Feb 2020 23:15:14 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DE28721FB7; Wed, 12 Feb 2020 23:15:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 12 Feb 2020 23:15:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=bXRCip Yss9iUDD6XPIJRxcfr7mw43KclxBsCJFLCRs8=; b=Z8guLXSSfYF2I0w54c5jw2 8su6ooqa7qJarBCy0YDW1XX5vA91MGCG6sWYcqMb1IS/VGynY/NMIsxTqLKqHd1A HYgiu7jdH/0XOnPRPw2dVDtyWT+gSpuPNDG9MLQEsQHcp7F9GpKYqxDP2MFLpNj5 Xlj6GdkM55g+aM2Ijh6IgpXOtso9gQcgRfXm5PbEj9Zef8tr/q63r0iFmBFwwbKG A8cxRTTzZPfFBXd6teJiieKU77rBX972bS1bt/vHUegQhmy7Mb+9yN1FIndbLYSr i4dq+Wqs7sZBStUnk/8AIF4hl/YqU9Pkp1S5CX6q+s1V/hQtjHGnDY+QIp/BPUUg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieejgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppedvtdelrdefjedrleejrd duleegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhep ghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (unknown [209.37.97.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 9CD823060A88; Wed, 12 Feb 2020 23:15:13 -0500 (EST) Subject: FAILED: patch "[PATCH] KVM: arm64: pmu: Don't increment SW_INCR if PMCR.E is unset" failed to apply to 4.9-stable tree To: eric.auger@redhat.com, andrew.murray@arm.com, maz@kernel.org Cc: From: Date: Wed, 12 Feb 2020 20:15:04 -0800 Message-ID: <1581567304216184@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 3837407c1aa1101ed5e214c7d6041e7a23335c6e Mon Sep 17 00:00:00 2001 From: Eric Auger Date: Fri, 24 Jan 2020 15:25:32 +0100 Subject: [PATCH] KVM: arm64: pmu: Don't increment SW_INCR if PMCR.E is unset The specification says PMSWINC increments PMEVCNTR_EL1 by 1 if PMEVCNTR_EL0 is enabled and configured to count SW_INCR. For PMEVCNTR_EL0 to be enabled, we need both PMCNTENSET to be set for the corresponding event counter but we also need the PMCR.E bit to be set. Fixes: 7a0adc7064b8 ("arm64: KVM: Add access handler for PMSWINC register") Signed-off-by: Eric Auger Signed-off-by: Marc Zyngier Reviewed-by: Andrew Murray Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20200124142535.29386-2-eric.auger@redhat.com diff --git a/virt/kvm/arm/pmu.c b/virt/kvm/arm/pmu.c index 8731dfeced8b..c3f8b059881e 100644 --- a/virt/kvm/arm/pmu.c +++ b/virt/kvm/arm/pmu.c @@ -486,6 +486,9 @@ void kvm_pmu_software_increment(struct kvm_vcpu *vcpu, u64 val) if (val == 0) return; + if (!(__vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) + return; + enable = __vcpu_sys_reg(vcpu, PMCNTENSET_EL0); for (i = 0; i < ARMV8_PMU_CYCLE_IDX; i++) { if (!(val & BIT(i)))