From patchwork Tue Oct 12 08:13:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 12551671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34466C43219 for ; Tue, 12 Oct 2021 08:14:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BB3661056 for ; Tue, 12 Oct 2021 08:14:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0BB3661056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.206861.362522 (Exim 4.92) (envelope-from ) id 1maCut-0008Rk-7j; Tue, 12 Oct 2021 08:13:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 206861.362522; Tue, 12 Oct 2021 08:13:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1maCut-0008Rd-3K; Tue, 12 Oct 2021 08:13:43 +0000 Received: by outflank-mailman (input) for mailman id 206861; Tue, 12 Oct 2021 08:13:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1maCus-0008RX-2b for xen-devel@lists.xenproject.org; Tue, 12 Oct 2021 08:13:42 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id adb86a57-9eab-4fe5-81aa-b5f7cceecdac; Tue, 12 Oct 2021 08:13:40 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8522EED1; Tue, 12 Oct 2021 01:13:40 -0700 (PDT) Received: from e123311-lin.arm.com (unknown [10.57.27.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 117383F694; Tue, 12 Oct 2021 01:13:36 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: adb86a57-9eab-4fe5-81aa-b5f7cceecdac From: Michal Orzel To: xen-devel@lists.xenproject.org Cc: George Dunlap , Nick Rosbrook , Ian Jackson , Wei Liu , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , Anthony PERARD , Juergen Gross , Christian Lindig , David Scott , Volodymyr Babchuk , bertrand.marquis@arm.com Subject: [PATCH v5 0/3] Expose PMU to the guests Date: Tue, 12 Oct 2021 10:13:20 +0200 Message-Id: <20211012081323.14141-1-michal.orzel@arm.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 This patch series is a rework of an already pushed patch exposing PMU to the guests. Since the second version the vpmu parameter is common and prework in the form of reporting availability of vPMU on the hardware is added. The third version of the patch series removes the redundant check from x86 code and modifies the way to define the flags XEN_DOMCTL_CDF and XEN_SYSCTL_PHYSCAP, meaning not to define bit position and mask separately. In the fourth version, the additional check is added so that we fail if vpmu is set in the config file but XEN_SYSCTL_PHYSCAP_vpmu is not available. In the fifth version, SUPPORT.md is updated with the information about vPMU feature and checks for platform PMU support are improved. The current status is that the PMU registers are not virtualized and the physical registers are directly accessible when "vpmu" parameter is enabled in the guest config file. There is no interrupt support and Xen will not save/restore the register values on context switches. This is to be done in the future. Michal Orzel (3): xen+tools: Introduce XEN_SYSCTL_PHYSCAP_vpmu xen/arm: Check for PMU platform support xen: Expose the PMU to the guests SUPPORT.md | 9 +++++ docs/man/xl.cfg.5.pod.in | 17 ++++++++++ tools/golang/xenlight/helpers.gen.go | 8 +++++ tools/golang/xenlight/types.gen.go | 2 ++ tools/include/libxl.h | 12 +++++++ tools/libs/light/libxl.c | 1 + tools/libs/light/libxl_create.c | 10 ++++++ tools/libs/light/libxl_types.idl | 3 ++ tools/ocaml/libs/xc/xenctrl.ml | 2 ++ tools/ocaml/libs/xc/xenctrl.mli | 2 ++ tools/xl/xl_info.c | 5 +-- tools/xl/xl_parse.c | 2 ++ xen/arch/arm/domain.c | 13 +++++-- xen/arch/arm/setup.c | 3 ++ xen/common/domain.c | 12 ++++++- xen/common/sysctl.c | 3 ++ xen/include/asm-arm/cpufeature.h | 51 ++++++++++++++++++++++++++-- xen/include/asm-arm/domain.h | 1 + xen/include/public/domctl.h | 4 ++- xen/include/public/sysctl.h | 6 ++-- xen/include/xen/domain.h | 2 ++ 21 files changed, 157 insertions(+), 11 deletions(-) Acked-by: Christian Lindig >