Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp627690ybl; Fri, 24 Jan 2020 06:42:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxBGtBDrJ+MhVlqqc6MoGaoChtvVfCLWYoDt28Vad3jusIFUOHmKgnzz5RGXYgg7N7nHZB4 X-Received: by 2002:a05:6830:1586:: with SMTP id i6mr2827713otr.221.1579876934276; Fri, 24 Jan 2020 06:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579876934; cv=none; d=google.com; s=arc-20160816; b=c2+ls249d6MwyadDVGWr4oEmF6Lij0qSiZngPkA9NFuzmEp9ghHPiFIK6nGyF739xf 8ZblxL3jqOiIpg14LhNLBl5kiLWStKkL5SS+o3xnn+TS4hdM1/blO+gANkVJXY4F9Cok os2bnmKXSudk4jl38Q2eo8YJ/bRQTYPddMRAsQg4nNyfCHXZ8A/VURy3SwH/VIYKdZgS bav2G6n1hYQuumOSd5N8NQNtfgYhNX0cpdMyma8bQfR4FjCZZpfbQ/vX2fdGE6SzoTo7 SFsB0GK9qNrrxfXkGx5O0KZjZgGPRGhUNxdUKtrKzUpwwJg3YmglP/5bi2X0PxV5ZjVe 9c2A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=gFUS+IYpTMcPpriTfqC+Rs1/QtFWk7pC2ooCgkxv0Po=; b=klZQQZWRt8Qi8riKToX+nt/BhKXlyH4JN1xzm9TG6y37OvKI0E2MSk2K4yQo//o6TZ fOMIRv6u6sxQi5/D4nsvRUVEK+LQj99gVvArXbKaEKuhA8x1duLBkJfqh41KxpMVvydb iTS0B5FLXwdU6szneF8iQxrRDJ8eNnIrgbLMkii62WjGfYjtD5hJ6PTRvBk/mbkGfWQb zmflHp7owYp4ATlEaSGkP8wnjvNJlpS4gUSndyMMG3tdFSuHOacMijWzsulSSQhtg+RO 9cm0bNrfzANraVWMpgBt+SoLAFlJwya9NSqBT78WlpQclBpnT6Krjn8jZ5VBKovT+Wso Xw1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=amgWxDk2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si2976425otp.151.2020.01.24.06.42.02; Fri, 24 Jan 2020 06:42:14 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=amgWxDk2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389945AbgAXOZx (ORCPT + 99 others); Fri, 24 Jan 2020 09:25:53 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:28040 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387621AbgAXOZv (ORCPT ); Fri, 24 Jan 2020 09:25:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579875950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gFUS+IYpTMcPpriTfqC+Rs1/QtFWk7pC2ooCgkxv0Po=; b=amgWxDk292hKUeEXyajV2l+frm3Fh/3pfFqN6hQFHSpGH5ox/kWnKO2BA/F6LDgC+/S4nI Yu6w+dwFQ2hLEXS8xCgWc1VFGX7sMpNIaNeOUFl8VRSaRpiwRoipsWJc1PGof/Rk0862IM zIJE5SzB3TqutYDJOIEVNqTz/J2HD8Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-8HkIZKcTMhqYNkxhYA9nDw-1; Fri, 24 Jan 2020 09:25:45 -0500 X-MC-Unique: 8HkIZKcTMhqYNkxhYA9nDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E23DB190D345; Fri, 24 Jan 2020 14:25:43 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFFEC3B0; Fri, 24 Jan 2020 14:25:38 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, maz@kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: andrew.murray@arm.com Subject: [PATCH 0/4] KVM/ARM: Misc PMU fixes Date: Fri, 24 Jan 2020 15:25:31 +0100 Message-Id: <20200124142535.29386-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While writing new PMUv3 event counter kvm-unit-tests I found some bugs related to the chained counter implementation: - the enable state of the high counter is not taken into account, - chain counters are not implemented along with SW_INCR type, - SW_INCR does not take into account the global enable state The last patch rather is an optimization that avoids manipulating non supported counters. Best Regards Eric This series can be found at: https://github.com/eauger/linux/tree/v5.5-rc7-pmu-fixes-v1 Test: Tested with kvm-unit-tests [1]: all tests now pass, at the exception of one sub-test in pmu-chain-promotion but this is a bug in test. Other testing at higher level (perf) appreciated. references: [1] KVM: arm64: PMUv3 Event Counter Tests (https://lore.kernel.org/kvmarm/c1831b6c-dc75-1bd3-6657-0375682c30af@redh= at.com/T/) History: RFC -> v1: - remove [RFC 3/3] KVM: arm64: pmu: Enforce PMEVTYPER evtCount size - add KVM: arm64: pmu: Only handle supported event counters - Take into account the enable state of the CHAIN high counter - revisit kvm_pmu_software_increment() implementation as suggested by Marc Eric Auger (4): KVM: arm64: pmu: Don't increment SW_INCR if PMCR.E is unset KVM: arm64: pmu: Don't mark a counter as chained if the odd one is disabled KVM: arm64: pmu: Fix chained SW_INCR counters KVM: arm64: pmu: Only handle supported event counters virt/kvm/arm/pmu.c | 114 +++++++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 45 deletions(-) --=20 2.20.1