From patchwork Thu May 23 10:34:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 164962 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1993895ili; Thu, 23 May 2019 03:35:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwH7efMYfpfkqBacENhZRbwRi4ZdAd9tOXw2gjNvGUTUvZ9/8DD5tY0P3edZXx56UA67CgQ X-Received: by 2002:a17:902:b184:: with SMTP id s4mr58714846plr.46.1558607723183; Thu, 23 May 2019 03:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607723; cv=none; d=google.com; s=arc-20160816; b=iLibj9MQ415bk58c0KdW0YIoTVuz/t00fB0g4AZpD0/rEfKeTJAdExg6P6wJhH6TJH zdKUjlZf/23I67s6JbuOgxsf2ZBmfnKNz/rib0vBYcg6RH4Ya6bIq3ffOnvXVo6su8jj JUrtjxoHubFLQ+N5Vvh8YiSYW41ES3Ps2T+2dZeUvMhatf+L3lUuCEMBdsN2EGzoCuOO NJvhOs4FZ1hMzwFgzTNQV/p03pf2RTkT0u0XVHIG0YwWXRiM6WYza7s+aTDF1OgFYZ2N 0l2jX/so3Hkp1MxgX8p3RXGTUurV9AfC4xfGxYGcDj7d+fTNESacwV2bi+fEYmSpp9W0 TDIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=WSqFANh+dWPKvJGw6LQDJDNUcIrxvCWFXgbDPwh1LYE=; b=oXr/Lp4XiPl0rem1RffWTx2E3G5mwIOH+VKJkcV69MUFozrj91o8mnoX3VaCBK3JnE eNLHMLP706Zg82zzpXjgc++ofAvY7X16cp06klC/FaP38TKAfMS33R6WHVA4Kdi1Kq1c qfdl5inApgYKUeTK8NwFom6E0H9zbd5StQkXvyj4IrL4oDHXI0evqqHFqBy2T/Yxms97 rVEZ/whOhEdffWzLMoZnpMnJexwT41n63uy1BSxsdflx/0Du/Nzp9GRpfB5md5d8saUo FOpRvI0OaYcbtVLRNZxqbBOAzX9FOdMKultJ0Fs7CaoT8/BzOlcb9t5wM3S0o7OaX25V hljA== ARC-Authentication-Results: i=1; mx.google.com; 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 r25si22660949pgv.333.2019.05.23.03.35.22; Thu, 23 May 2019 03:35:23 -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; 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 S1730296AbfEWKfW (ORCPT + 30 others); Thu, 23 May 2019 06:35:22 -0400 Received: from foss.arm.com ([217.140.101.70]:42996 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbfEWKfV (ORCPT ); Thu, 23 May 2019 06:35:21 -0400 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 E3737341; Thu, 23 May 2019 03:35:20 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CECA73F718; Thu, 23 May 2019 03:35:18 -0700 (PDT) From: Sudeep Holla To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Christoffer Dall , Marc Zyngier , James Morse , Suzuki K Pouloze , Catalin Marinas , Will Deacon , Julien Thierry Subject: [PATCH 00/15] arm64: KVM: add SPE profiling support for guest Date: Thu, 23 May 2019 11:34:47 +0100 Message-Id: <20190523103502.25925-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This series implements support for allowing KVM guests to use the Arm Statistical Profiling Extension (SPE). The patches are also available on a branch[1]. The last two extra patches are for the kvmtool if someone wants to play with it. Regards, Sudeep v1->v2: - Rebased on v5.2-rc1 - Adjusted sysreg_elx_s macros with merged clang build support [1] git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git kvm_spe Sudeep Holla (15): KVM: arm64: add {read,write}_sysreg_elx_s versions for new registers dt-bindings: ARM SPE: highlight the need for PPI partitions on heterogeneous systems arm64: KVM: reset E2PB correctly in MDCR_EL2 when exiting the guest(VHE) arm64: KVM: define SPE data structure for each vcpu arm64: KVM: add access handler for SPE system registers arm64: KVM/VHE: enable the use PMSCR_EL12 on VHE systems arm64: KVM: split debug save restore across vm/traps activation arm64: KVM/debug: drop pmscr_el1 and use sys_regs[PMSCR_EL1] in kvm_cpu_context arm64: KVM: add support to save/restore SPE profiling buffer controls arm64: KVM: enable conditional save/restore full SPE profiling buffer controls arm64: KVM/debug: trap all accesses to SPE controls at EL1 KVM: arm64: add a new vcpu device control group for SPEv1 KVM: arm64: enable SPE support KVMTOOL: update_headers: Sync kvm UAPI headers with linux v5.2-rc1 KVMTOOL: kvm: add a vcpu feature for SPEv1 support .../devicetree/bindings/arm/spe-pmu.txt | 5 +- Documentation/virtual/kvm/devices/vcpu.txt | 28 +++ arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts | 185 +++++++++++------- arch/arm64/configs/defconfig | 6 + arch/arm64/include/asm/kvm_host.h | 19 +- arch/arm64/include/asm/kvm_hyp.h | 26 ++- arch/arm64/include/uapi/asm/kvm.h | 4 + arch/arm64/kvm/Kconfig | 7 + arch/arm64/kvm/Makefile | 1 + arch/arm64/kvm/guest.c | 9 + arch/arm64/kvm/hyp/debug-sr.c | 98 +++++++--- arch/arm64/kvm/hyp/switch.c | 18 +- arch/arm64/kvm/reset.c | 3 + arch/arm64/kvm/sys_regs.c | 35 ++++ include/kvm/arm_spe.h | 71 +++++++ include/uapi/linux/kvm.h | 1 + virt/kvm/arm/arm.c | 5 + virt/kvm/arm/spe.c | 163 +++++++++++++++ 18 files changed, 570 insertions(+), 114 deletions(-) create mode 100644 include/kvm/arm_spe.h create mode 100644 virt/kvm/arm/spe.c -- 2.17.1