From patchwork Tue Jan 22 10:49:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Murray X-Patchwork-Id: 10775345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 373B917F0 for ; Tue, 22 Jan 2019 10:50:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2573F2A0F0 for ; Tue, 22 Jan 2019 10:50:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19B152A0FE; Tue, 22 Jan 2019 10:50:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C7792A0F0 for ; Tue, 22 Jan 2019 10:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=S9aY3sEbZB8PfYEISUX6wttVe5sA2Qd8PViNZqTA8Zs=; b=Mbu GeFMU4CsAW6C/nz31VmmiC52esMXh5n0923SOW6yOgUbC+T4wiI4klNiZE/ORxKmG0fjKpkLRVK/d kEMy7QzlYC1WzA81bUeenA1EGpf2eXPYy6JSkKYtadu48gaPt9NNl/zBiFUuHTlwFqh3bn/5HfYcz Fz/S2XebGSa/GFiLx2X0LKAjsDmLGNkI47Z4TnSlwSRP6/EZylLbCgu3aAPHuddw4Qtz74SdOhfIr VOnTpKxCXAK9leC0k8CHHQMVCBKdl1P45Q2n71eXuqiTTSUpe4vC04/FuxLYTRC5XkjIWJMlax1co loXCLvAG+CnSyH8gPx6rzONGCVyG+eA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gltdB-0001k8-71; Tue, 22 Jan 2019 10:50:09 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gltd7-0000cS-Ag for linux-arm-kernel@lists.infradead.org; Tue, 22 Jan 2019 10:50:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B55BCA78; Tue, 22 Jan 2019 02:50:02 -0800 (PST) Received: from e119886-lin.cambridge.arm.com (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7E3063F6A8; Tue, 22 Jan 2019 02:50:01 -0800 (PST) From: Andrew Murray To: Christoffer Dall , Marc Zyngier Subject: [PATCH 0/4] KVM: arm/arm64: add support for chained counters Date: Tue, 22 Jan 2019 10:49:53 +0000 Message-Id: <1548154197-5470-1-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190122_025005_378610_6541B863 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ARMv8 provides support for chained PMU counters, where an event type of 0x001E is set for odd-numbered counters, the event counter will increment by one for each overflow of the preceding even-numbered counter. Let's emulate this in KVM by creating a 64 bit perf counter when a user chains two emulated counters together. Andrew Murray (4): KVM: arm/arm64: extract duplicated code to own function KVM: arm/arm64: re-create event when setting counter value KVM: arm/arm64: lazily create perf events on enable KVM: arm/arm64: support chained PMU counters include/kvm/arm_pmu.h | 2 + virt/kvm/arm/pmu.c | 377 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 327 insertions(+), 52 deletions(-)