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 DE26EC4828D for ; Mon, 5 Feb 2024 13:14:46 +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=4s0dT0nHf0+ngDkTlhf2j3g/Db2sXztl+arEZszABYc=; b=Z2My0uhrSnT8FR vAyW/k7W+CMFl+SEu7ocmE9ZlfA9ATmfQH6bCscuBH8OzQNeIxlU4BmjwZS15x346sE3hG8d/vlqX EBeb11SdgjDTXIaH0YCzwWmo29iQBjWzQamzFwzfuA4UMJxc5NCcqMWvZeeVmglmEfs1MSEl46Yo3 EipIbah57KYnGH0L/PepGyF0g1WRqaUidMeLNptmEMOZZ+zUUPcMbLLFLZ0Asd6mVRXCJbrvSFd4p sYpt4el35ttrwJr/GtCXBciKWK3La1nc1EEE6dU2sp0ptnNcqK+Vr9KT+D02KtoahsRxLUGoH7Ig7 nIbSHlRT8EI6TOzlPCSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWynz-00000003NVf-15I3; Mon, 05 Feb 2024 13:14:35 +0000 Received: from out-181.mta1.migadu.com ([2001:41d0:203:375::b5]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWynx-00000003NUo-18Qf for linux-arm-kernel@lists.infradead.org; Mon, 05 Feb 2024 13:14:34 +0000 Date: Mon, 5 Feb 2024 13:14:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707138870; 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=PXlHs13xGBsXqCF4G2IH5TZvDGaNtuoQs5bbO9vA6Os=; b=o1BIwV8GwpwSfWVn3WD6Xc9WB2EAZEDkvLoaYJLIPatKtCzQiom7hG4rkW+eT7NXHGYBOu STN7N1Mzto91nXIa2diKYNByLJatjk+xiZaFg+ekUTZMw4XM04FriGWBqdiBVSU6ky0m5p M4LaLDbztoq4HTL57+UK78BJZuccD9s= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sebastian Ene Cc: will@kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu , catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, maz@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, vdonnefort@google.com, qperret@google.com, smostafa@google.com Subject: Re: [PATCH v4 02/10] KVM: arm64: Add ptdump registration with debugfs for the stage-2 pagetables Message-ID: References: <20231218135859.2513568-2-sebastianene@google.com> <20231218135859.2513568-4-sebastianene@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_051433_480118_0D1FFEFF X-CRM114-Status: GOOD ( 31.34 ) 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 Thu, Feb 01, 2024 at 11:20:53AM +0000, Sebastian Ene wrote: > On Thu, Dec 21, 2023 at 06:14:20PM +0000, Oliver Upton wrote: > > Hi Oliver, > > I am planning to split the series based on your suggestion and I > wanted to make sure that I understand your feedback. > > > On Mon, Dec 18, 2023 at 01:58:52PM +0000, Sebastian Ene wrote: > > > +config PTDUMP_STAGE2_DEBUGFS > > > + bool "Present the stage-2 pagetables to debugfs" > > > + depends on PTDUMP_DEBUGFS && KVM > > > + default n > > > + help > > > + Say Y here if you want to show the stage-2 kernel pagetables > > > + layout in a debugfs file. This information is only useful for kernel developers > > > + who are working in architecture specific areas of the kernel. > > > + It is probably not a good idea to enable this feature in a production > > > + kernel. > > > > It isn't really a good idea to mount debugfs at all in a production > > system. There are already plenty worse interfaces lurking in that > > filesystem. The pKVM portions already depend on CONFIG_NVHE_EL2_DEBUG, > > so I don't see a need for this Kconfig option. > > > > I created a separate option because I wanted to re-use the parsing > functionality from the already existing ptdump code for EL1. This option > is turned off in production and only enabled for debug. > > I was thinking to make use of the `CONFIG_NVHE_EL2_DEBUG` but then I abandoned > this ideea as one can use ptdump for vHE as well. Fair enough. I was going to say we could just have KVM follow CONFIG_PTDUMP_DEBUGFS, but it doesn't matter either way. > > > +void kvm_ptdump_register_host(void) > > > +{ > > > + if (!is_protected_kvm_enabled()) > > > + return; > > > + > > > + kvm_ptdump_debugfs_register(&host_reg, "host_page_tables", > > > + kvm_debugfs_dir); > > > +} > > > + > > > +static int __init kvm_host_ptdump_init(void) > > > +{ > > > + host_reg.priv = (void *)host_s2_pgtable_pages(); > > > + return 0; > > > +} > > > + > > > +device_initcall(kvm_host_ptdump_init); > > > > Why can't all of this be called from finalize_pkvm()? > > > > I guess it can be called from finalize_pkvm before the is_protected_kvm_enabled > check. This should work for nvhe & vhe as well. What does nvhe and vhe modes have to do with it? I thought this was for hooking up the host's S2, which does not exist outside protected mode. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel