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 7B22FC433F5 for ; Wed, 13 Oct 2021 13:14:04 +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 388D6610FC for ; Wed, 13 Oct 2021 13:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 388D6610FC 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.208458.364585 (Exim 4.92) (envelope-from ) id 1mae4x-0002Z5-LL; Wed, 13 Oct 2021 13:13:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 208458.364585; Wed, 13 Oct 2021 13:13:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mae4x-0002Yy-Ho; Wed, 13 Oct 2021 13:13:55 +0000 Received: by outflank-mailman (input) for mailman id 208458; Wed, 13 Oct 2021 13:13:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mae4w-0002Yq-D1 for xen-devel@lists.xenproject.org; Wed, 13 Oct 2021 13:13:54 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id c125cf3a-97b4-4e29-823c-120e8613e152; Wed, 13 Oct 2021 13:13:53 +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 947361FB; Wed, 13 Oct 2021 06:13:52 -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 16F6E3F66F; Wed, 13 Oct 2021 06:13:49 -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: c125cf3a-97b4-4e29-823c-120e8613e152 Subject: Re: [PATCH v7] xen: Expose the PMU to the guests To: Ian Jackson Cc: xen-devel@lists.xenproject.org, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Nick Rosbrook , Anthony PERARD , Juergen Gross , Christian Lindig , David Scott , Volodymyr Babchuk , bertrand.marquis@arm.com References: <20211013123352.6625-1-michal.orzel@arm.com> <24934.54743.853232.853726@mariner.uk.xensource.com> From: Michal Orzel Message-ID: <3d414cd9-2cb7-3a26-eada-e75fa0fe05a2@arm.com> Date: Wed, 13 Oct 2021 15:13:41 +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: <24934.54743.853232.853726@mariner.uk.xensource.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Ian, On 13.10.2021 14:49, Ian Jackson wrote: > Michal Orzel writes ("[PATCH v7] xen: Expose the PMU to the guests"): >> 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. > ... >> Changes since v6: >> -fix missing "HVM" for vPMU entry in SUPPORT.md > > The SUPPORT.md changes LGTM, thanks. > >> -Virtual Performance Management Unit for HVM guests >> +Virtual Performance Management Unit >> >> - Status, x86: Supported, Not security supported >> + Status, x86 HVM: Supported, Not security supported >> + Status, ARM: Experimental >> + >> +On ARM, support for accessing PMU registers from the guests. >> +There is no interrupt support and Xen will not save/restore >> +the register values on context switches. > > FTAOD ISTM that this limitation makes the feature very hard to use > successfully on ARM. You would need to pin vcpus to dedicated > pcpus ? > Yes, there are some limitations but even with them it is really useful. We are making use of vPMU in our tests successfuly. FWIK Stefano also had to provide a patch enabling pmu in the past. It was agreed that we will expose only part of vPMU. The rest needs to be done in the future. PMU interrupt is only used to signal overflow which would occur in a very long tests. > I think this is fine for an experimental feature. > > I think this patch needs a ARM/hypervisor acks still. > Agree. Probably Stefano will do this today. > Ian. > Cheers, Michal