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 992E5C4828D for ; Mon, 5 Feb 2024 15:51:05 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uF4VkGOAOKInQyHqfdLSNUg/MvtcDomp2sEeJTldIvw=; b=elktTtbAe+88zS m+0/XGPJHF3QU4nGfGfkhhANtb7+VZ1Qc3IwLzO2BboAUwo/PjVKZot5ZHh4yixbOwE6+tJQ7qX0P Wq1bvVRiFe2f4s6cNcv9hmEZ1TM347oveFf7fY/xRrRRZDLs3KZI8ammPRFHOirWUHFrDIEGSjZns ddobYsuPCTC0mrrDd2iJExypZKqyf8GGTYtxoaIWXzqoF8nQU2wuEhGvnI5ScQH1RYx+6YT6FZNlL p/XEHfZ+PholeQyAY24Mbx2KZXXdPPo/79S37iG4te5LdExJKYzQ3gE/gzFM6725u9E5Bv9PSrl/Z et9VnjXeNT2WNc8ppKcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rX1F4-00000003rdn-1FrB; Mon, 05 Feb 2024 15:50:44 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rX1Ee-00000003ra5-3aI8 for linux-arm-kernel@lists.infradead.org; Mon, 05 Feb 2024 15:50:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 29A31611C1; Mon, 5 Feb 2024 15:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1C69C433F1; Mon, 5 Feb 2024 15:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707148216; bh=6aaZ8uJ98XEilRCdTFHbcsja0/sHt6JhMUEAjwCNq18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W854IR28Ybufk1yNVM4FlXNqDu6/4P8n54aADpEZx0fgXT3MIsUNmbHWYMcYlpNoy PkuhW+dcn9c6vKz+8Bb+BMBQhf1aKmWh3F4zAjsRRBqoYSYVKzKHr30SaJhrEUctek 9W6STI8+TSyx73tVA3/+VjAD6bdDilXom3Y0+aiYVNr5prGZd2faowemSvBS9OWAUs u//x7a0MvXJru0vxtgY3iu1dyV5f3GFUh7i5mVceOhL5qQCd0ledwkf5qvFiwnDJob WKs1y9f+ZFunXL1bQdEdY6cbPSVL7UjljY5lTJFGRAL88gWlMG2XioLSWimlJ3XSk0 gnV87k6YMFI3Q== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rX1Eb-000T9U-6N; Mon, 05 Feb 2024 15:50:13 +0000 Date: Mon, 05 Feb 2024 15:50:12 +0000 Message-ID: <861q9q7vwr.wl-maz@kernel.org> From: Marc Zyngier To: James Clark Cc: Oliver Upton , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@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 In-Reply-To: References: <20240104162714.1062610-1-james.clark@arm.com> <20240104162714.1062610-3-james.clark@arm.com> <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> <867cjj6ohz.wl-maz@kernel.org> <864jen6k0i.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: james.clark@arm.com, oliver.upton@linux.dev, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, suzuki.poulose@arm.com, acme@kernel.org, james.morse@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mike.leach@linaro.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, anshuman.khandual@arm.com, robh@kernel.org, miguel.luis@oracle.com, jintack.lim@linaro.org, ardb@kernel.org, mark.rutland@arm.com, arnd@arndb.de, vdonnefort@google.com, kristina.martsenko@arm.com, tabba@google.com, joey.gouly@arm.com, akihiko.odaki@daynix.com, jingzhangos@google.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_075018_977888_E61D2036 X-CRM114-Status: GOOD ( 27.85 ) 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, 05 Feb 2024 15:37:34 +0000, James Clark wrote: > > > > On 05/02/2024 14:52, Marc Zyngier wrote: > > On Mon, 05 Feb 2024 14:17:10 +0000, > > James Clark wrote: > >> > >> On 05/02/2024 13:21, Oliver Upton wrote: > >>> On Mon, Feb 05, 2024 at 01:15:36PM +0000, Marc Zyngier wrote: > >>>> On Mon, 05 Feb 2024 13:04:51 +0000, > >>>> Oliver Upton wrote: > >>>>> > >>>>> 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. > >>>> > >>>> Limiting tracing to non-protected mode is a must IMO. Allowing tracing > >>>> when pKVM is enabled is a sure way to expose secrets that should > >>>> stay... secret. The only exception I can think of is when > >>>> CONFIG_NVHE_EL2_DEBUG is enabled, at which point all bets are off. > >>> > >>> Zero argument there :) I left off the "and PMU" part of what I was > >>> saying, because that was a feature that semi-worked in protected mode > >>> before VM/VCPU shadowing support landed. > >>> > >> > >> In that case I can hide all this behind CONFIG_NVHE_EL2_DEBUG for pKVM. > >> This will also have the effect of disabling PMU again for pKVM because I > >> moved that into this new shared area. > > > > I'm not sure what you have in mind, but dropping PMU support for > > non-protected guests when protected-mode is enabled is not an > > acceptable outcome. > > > > Hiding the trace behind a debug option is fine as this is a global > > setting that has no userspace impact, but impacting guests isn't. > > > > M. > > > > Hmmm in that case if there's currently no way to distinguish between > normal VMs and pVMs in protected-mode then what I was thinking of > probably won't work. Have you looked? kvm_vm_is_protected() has been in for a while, even if that's not a lot. The upcoming code will flesh this helper out, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel