[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86plpb6ypo.wl-maz@kernel.org>
Date: Tue, 10 Sep 2024 21:27:47 +0100
From: Marc Zyngier <maz@...nel.org>
To: Sebastian Ene <sebastianene@...gle.com>
Cc: akpm@...ux-foundation.org,
alexghiti@...osinc.com,
ankita@...dia.com,
ardb@...nel.org,
catalin.marinas@....com,
christophe.leroy@...roup.eu,
james.morse@....com,
vdonnefort@...gle.com,
mark.rutland@....com,
oliver.upton@...ux.dev,
rananta@...gle.com,
ryan.roberts@....com,
shahuang@...hat.com,
suzuki.poulose@....com,
will@...nel.org,
yuzenghui@...wei.com,
kvmarm@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
kernel-team@...roid.com
Subject: Re: [PATCH v10 5/5] KVM: arm64: Register ptdump with debugfs on guest creation
On Mon, 09 Sep 2024 13:47:21 +0100,
Sebastian Ene <sebastianene@...gle.com> 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 <sebastianene@...gle.com>
> Reviewed-by: Vincent Donnefort <vdonnefort@...gle.com>
> ---
> 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.
Powered by blists - more mailing lists