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 64754EDE9BA for ; Tue, 10 Sep 2024 20:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hyLAlN49HxOztk8R7azE7UgC1AwXWC9cet1qlNWHidg=; b=O5rKopPRZbkaY8VcjezIEn4GqV g6CXD4E4G1UZ8oWUez+oiU3qJY543FBTfJE2kcxNGANNzRbFwEbrQq6m4QB3eBHZqHHsuZxNlyKy3 RUVq37gyVFWVXJxpnJ5ly0v6KCHg3RkoKruvPZwKn4M9h1e8zOe9VLO1oglSx0K21dFJK5159JOJX 40pSKDSSLQE4WMAYLN047vW9yxY6+oE18uxmszLGIiqnOfDTfLxBIV8V9i/IEd4PUr1QmjsHiv4Sa 3co3mI0c6uwcrs92Vovaew8whfhOqnQ7R2GdO/YlWq0ct2oFogLhDQnn3QI+rIBrT6hXjXbyBIOOx 8X1+ZzUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so7Tv-000000071ln-2vLr; Tue, 10 Sep 2024 20:28:59 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so7Sp-000000071Wx-2fXV for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 20:27:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5AD41A41626; Tue, 10 Sep 2024 20:27:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87540C4CEC3; Tue, 10 Sep 2024 20:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726000070; bh=F1/9VLarbTJ9VCxON6d1CtL/BQZZi7nOBEwpu4FUHaA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=A33fyGBijBMkVnizFcOT9RMyk3X4W5JkxFmasSOR/p0mBtCxuWRSvb6DvtBdETrGm pvBoFWjtYWd23vigu96nDocpSRQDf4tAkALbcIzMCLh3Gep1c6ZDQLquA4kbNrhYdQ Vy2iJyj125yym7qJ/UDZl+iViuRuAfLnJW3vTseIKaD+9hqQLbcYD/tARb5wYzVsCY VU/GBqakb7x3YFe3kxguXRH1jUq23zYIPY6Qp4tu5AUI8UUX+ZxOxQlWegxbZwS51C tljaJjvhbk5RnSnNDMRMUh9KVNLdDtZNPub4pTLmaagHqIJDJyO1Ep4Ja6Q/52BK6+ 1oaxqUo2UPZpg== 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 1so7Sm-00BsCg-Am; Tue, 10 Sep 2024 21:27:48 +0100 Date: Tue, 10 Sep 2024 21:27:47 +0100 Message-ID: <86plpb6ypo.wl-maz@kernel.org> From: Marc Zyngier To: Sebastian Ene Cc: akpm@linux-foundation.org, alexghiti@rivosinc.com, ankita@nvidia.com, ardb@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, james.morse@arm.com, vdonnefort@google.com, mark.rutland@arm.com, oliver.upton@linux.dev, rananta@google.com, ryan.roberts@arm.com, shahuang@redhat.com, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v10 5/5] KVM: arm64: Register ptdump with debugfs on guest creation In-Reply-To: <20240909124721.1672199-6-sebastianene@google.com> References: <20240909124721.1672199-1-sebastianene@google.com> <20240909124721.1672199-6-sebastianene@google.com> 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.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sebastianene@google.com, akpm@linux-foundation.org, alexghiti@rivosinc.com, ankita@nvidia.com, ardb@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, james.morse@arm.com, vdonnefort@google.com, mark.rutland@arm.com, oliver.upton@linux.dev, rananta@google.com, ryan.roberts@arm.com, shahuang@redhat.com, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com 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-20240910_132751_823009_5A483ED6 X-CRM114-Status: GOOD ( 21.12 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 09 Sep 2024 13:47:21 +0100, Sebastian Ene wrote: > > While arch/*/mem/ptdump handles the kernel pagetable dumping code, > introduce KVM/ptdump to show the guest stage-2 pagetables. The > separation is necessary because most of the definitions from the > stage-2 pagetable reside in the KVM path and we will be invoking > functionality specific to KVM. Introduce the PTDUMP_STAGE2_DEBUGFS config. > > When a guest is created, register a new file entry under the guest > debugfs dir which allows userspace to show the contents of the guest > stage-2 pagetables when accessed. > > Signed-off-by: Sebastian Ene > Reviewed-by: Vincent Donnefort > --- > arch/arm64/include/asm/kvm_host.h | 6 + > arch/arm64/kvm/Kconfig | 17 ++ > arch/arm64/kvm/Makefile | 1 + > arch/arm64/kvm/arm.c | 1 + > arch/arm64/kvm/ptdump.c | 268 ++++++++++++++++++++++++++++++ > 5 files changed, 293 insertions(+) > create mode 100644 arch/arm64/kvm/ptdump.c > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index a33f5996ca9f..4acd589f086b 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -1473,4 +1473,10 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); > (pa + pi + pa3) == 1; \ > }) > > +#ifdef CONFIG_PTDUMP_STAGE2_DEBUGFS > +void kvm_s2_ptdump_create_debugfs(struct kvm *kvm); > +#else > +static inline void kvm_s2_ptdump_create_debugfs(struct kvm *kvm) {} > +#endif /* CONFIG_PTDUMP_STAGE2_DEBUGFS */ > + I made the executive decision to move this to kvm_mmu.h, as this is slightly more logical. Thanks, M. -- Without deviation from the norm, progress is not possible.