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 A5BD7C433F5 for ; Wed, 13 Oct 2021 08:34:15 +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 5A20B60C40 for ; Wed, 13 Oct 2021 08:34:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5A20B60C40 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.208089.364114 (Exim 4.92) (envelope-from ) id 1maZiA-0002Eu-Qa; Wed, 13 Oct 2021 08:34:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 208089.364114; Wed, 13 Oct 2021 08:34:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1maZiA-0002En-NW; Wed, 13 Oct 2021 08:34:06 +0000 Received: by outflank-mailman (input) for mailman id 208089; Wed, 13 Oct 2021 08:34:05 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1maZi9-0002Eh-Gp for xen-devel@lists.xenproject.org; Wed, 13 Oct 2021 08:34:05 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 526148ef-2c00-11ec-8165-12813bfff9fa; Wed, 13 Oct 2021 08:34:03 +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 431D71FB; Wed, 13 Oct 2021 01:34:03 -0700 (PDT) Received: from [10.57.25.166] (unknown [10.57.25.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A51F3F66F; Wed, 13 Oct 2021 01:34:00 -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: 526148ef-2c00-11ec-8165-12813bfff9fa Subject: Re: [PATCH v6] xen: Expose the PMU to the guests To: Julien Grall , xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Stefano Stabellini , Wei Liu , Nick Rosbrook , Anthony PERARD , Juergen Gross , Christian Lindig , David Scott , Volodymyr Babchuk , bertrand.marquis@arm.com References: <20211013074528.1396-1-michal.orzel@arm.com> <75e19429-49d2-c075-acb8-797c01364771@xen.org> From: Michal Orzel Message-ID: Date: Wed, 13 Oct 2021 10:33:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <75e19429-49d2-c075-acb8-797c01364771@xen.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 13.10.2021 10:29, Julien Grall wrote: > Hi Michal, > > On 13/10/2021 08:45, Michal Orzel wrote: >> Add parameter vpmu to xl domain configuration syntax >> to enable the access to PMU registers by disabling >> the PMU traps(currently only for ARM). >> >> The current status is that the PMU registers are not >> virtualized and the physical registers are directly >> accessible when this parameter is enabled. There is no >> interrupt support and Xen will not save/restore the >> register values on context switches. >> >> According to Arm Arm, section D7.1: >> "The Performance Monitors Extension is common >> to AArch64 operation and AArch32 operation." >> That means we have an ensurance that if PMU is >> present in one exception state, it must also be >> present in the other. >> >> Please note that this feature is experimental. >> >> Signed-off-by: Michal Orzel >> Signed-off-by: Julien Grall >> Reviewed-by: Bertrand Marquis >> Acked-by: Anthony PERARD >> --- >> Changes since v5: >> -extracted from the series as other patches have been merged >> -fold ARM vPMU feature status in SUPPORT.md into existing section for x86 >> -fix coding style in libxl >> Changes since v4: >> -update SUPPORT.md >> -move vpmu_is_available assignment after the secondary >> CPUs have been brought up >> -introduce masks for flags that need to be set and >> for flags that are optional >> Changes since v3: >> -fail if vpmu is set but not supported >> Changes since v2: >> -remove redundant check from x86 code >> -do not define bit position and mask separately >> Changes since v1: >> -modify vpmu parameter to be common rather than arch specific >> --- >>   SUPPORT.md                           | 12 ++++++++++-- >>   docs/man/xl.cfg.5.pod.in             | 17 +++++++++++++++++ >>   tools/golang/xenlight/helpers.gen.go |  6 ++++++ >>   tools/golang/xenlight/types.gen.go   |  1 + >>   tools/include/libxl.h                |  6 ++++++ >>   tools/libs/light/libxl_create.c      | 10 ++++++++++ >>   tools/libs/light/libxl_types.idl     |  2 ++ >>   tools/ocaml/libs/xc/xenctrl.ml       |  1 + >>   tools/ocaml/libs/xc/xenctrl.mli      |  1 + >>   tools/xl/xl_parse.c                  |  2 ++ >>   xen/arch/arm/domain.c                | 13 ++++++++++--- >>   xen/arch/arm/setup.c                 |  3 +++ >>   xen/common/domain.c                  | 10 +++++++++- >>   xen/include/asm-arm/domain.h         |  1 + >>   xen/include/public/domctl.h          |  4 +++- >>   15 files changed, 82 insertions(+), 7 deletions(-) >> >> diff --git a/SUPPORT.md b/SUPPORT.md >> index 317392d8f3..d0305abc0b 100644 >> --- a/SUPPORT.md >> +++ b/SUPPORT.md >> @@ -671,11 +671,19 @@ such as KVM, Hyper-V, Bromium, and so on as guests. >>     ### vPMU >>   -Virtual Performance Management Unit for HVM guests >> +Virtual Performance Management Unit > While I agree that "HVM guests" doesn't make any sense on Arm, you are not adding back for x86. So this is changing the statement support to both HVM and PV guest. > > I don't know why only HVM guests was previously mentionned. Jan, Andrew? Anyway, for this patch, I think we should add... > >>         Status, x86: Supported, Not security supported > > ... add HVM here. Looking at other section, we seem to use: > > Status, x86 HVM: ... > > One can send a follow-up patch if we want to mention the support status for PV guests. > > Cheers, > Ok so it is the matter of adding "HVM" word into status for x86. Is this something that can be done while committing? Cheers, Michal