From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED479C48295 for ; Mon, 5 Feb 2024 13:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PZI/OKuQ4Nnmy4EC2DqRrkn2xpAZ65lzoIBzJOizi1s=; b=0XhifzHOlK+Pms DKtSPbq9tr9t15puXiuxGSQWIXvg53ljIRFHbemwTrvowWDy6uwB/dWAF02/Y68ypkjKlf0KxPyGH 038kdxmaLZRwBnxkYEoFqUnESxiYrFnegoiNXDdM0bhQIj8/lWzeWDzGufIAmgkOHmTAehrIBvirw RGztLeCIcyGEH8ABcyEUdmpHxsnvz7KUQ8hEFUHykuWOMVDlz/9/bR3bBHwY8Kg6MXAZfF9y+TNJb mFiQViUtMhFhIuN0GJfbQcR8Ej7ngcjQD20pRQP0vKO+dJhvOqrnyqrzfgGI5Co/qhyRnaIKOVglA ajOqILjg5biSDUq3SwgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWyen-00000003LkZ-2NiP; Mon, 05 Feb 2024 13:05:05 +0000 Received: from out-177.mta1.migadu.com ([95.215.58.177]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWyei-00000003LjE-1EUm for linux-arm-kernel@lists.infradead.org; Mon, 05 Feb 2024 13:05:02 +0000 Date: Mon, 5 Feb 2024 13:04:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707138294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kjDbYJsA64v+kSKvUvgWTs/MwMgC5uCGKzp4l4kiFPQ=; b=d5OTMkxIJ0g6UM3z7bHVp+C0KObAXlBjbpjAGtUI0R/TQZptwEcQ3TPCtL7tWTrDSzMYAy OEIqo5T0Z0ZpuQ3X9or70pTazC4A7W2D8fH7WO3AfkMisgfErJgHNcefcgqSjmBGDZqsr1 QsiPxQfd2K9662ohcknZ8OQ8jJl523k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: James Clark Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, maz@kernel.org, suzuki.poulose@arm.com, acme@kernel.org, James Morse , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Leo Yan , Alexander Shishkin , Anshuman Khandual , Rob Herring , Miguel Luis , Jintack Lim , Ard Biesheuvel , Mark Rutland , Arnd Bergmann , Vincent Donnefort , Kristina Martsenko , Fuad Tabba , Joey Gouly , Akihiko Odaki , Jing Zhang , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/7] arm64: KVM: Use shared area to pass PMU event state to hypervisor Message-ID: References: <20240104162714.1062610-1-james.clark@arm.com> <20240104162714.1062610-3-james.clark@arm.com> <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_050500_764949_F2915CDE X-CRM114-Status: GOOD ( 23.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 05, 2024 at 12:16:53PM +0000, James Clark wrote: > > This now allows the host to program event counters for a protected > > guest. That _might_ be a useful feature behind some debug option, but is > > most definitely *not* something we want to do for pVMs generally. > > Unless I'm missing something, using PMUs on protected guests was added > by 722625c6f4c5b ("KVM: arm64: Reenable pmu in Protected Mode"). This > change is just a refactor that will allow us to add the same behavior > for a similar feature (tracing) without adding yet another copy of some > state before the guest switch. Ha, I had forgotten about that patch (and I had reviewed it!) My interpretation of the intent for that change was to enable the usage of vPMU for non-protected VMs. The situation has changed since then, as we use the shadow state for vCPUs unconditionally in protected mode as of commit be66e67f1750 ("KVM: arm64: Use the pKVM hyp vCPU structure in handle___kvm_vcpu_run()") Protected mode is well understood at this point to be a WIP feature, and that not all things are expected to work with it. Eventually we will need a way to distinguish between 'normal' VMs and true pVMs (i.e. the VMM selected full isolation) in nVHE, but right now what we have enables testing of some isolation features. > > I'm perfectly happy leaving these sorts of features broken for pKVM and > > using the 'normal' way of getting percpu data to the nVHE hypervisor > > otherwise. > > > > I can do that. But do I also disable PMU at the same time in a new > commit? Now that both PMU and tracing is working maybe it would be a > waste to throw that away and hiding it behind an option is better. Or I > can leave the PMU as it is and just keep tracing disabled in pKVM. > > I don't mind either way, my main goal was to get exclude/include guest > tracing working for normal VMs. For pKVM I don't have a strong opinion. Unless someone has strong opinions about making this work in protected mode, I am happy to see tracing support limited to the 'normal' nVHE configuration. The protected feature as a whole is just baggage until upstream support is completed. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel