Re: [PATCH 22/29] KVM: TDX: Add an ioctl to create initial guest memory

From: Yan Zhao
Date: Thu Feb 27 2025 - 23:20:22 EST


Just two nits below. Feel free to ignore them.
The rest of this series looks good to me.

On Wed, Feb 26, 2025 at 02:55:22PM -0500, Paolo Bonzini wrote:
> From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
...
> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> index 989db4887963..12f3433d062d 100644
> --- a/arch/x86/kvm/vmx/tdx.c
> +++ b/arch/x86/kvm/vmx/tdx.c
> @@ -1,4 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> +#include <linux/cleanup.h>
This include is not necessary.

> #include <linux/cpu.h>
> #include <asm/cpufeature.h>
> #include <linux/misc_cgroup.h>
> @@ -10,6 +11,7 @@
> #include "tdx.h"
> #include "vmx.h"
> #include "mmu/spte.h"
> +#include "common.h"
>
> #pragma GCC poison to_vmx
>
...
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 622b5a99078a..c88acfa154e6 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -2581,6 +2581,7 @@ struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn
>
> return NULL;
> }
> +EXPORT_SYMBOL_GPL(kvm_vcpu_gfn_to_memslot);
This EXPORT is not necessary. Though looks kvm_vcpu_gfn_to_memslot() is
the only one not exported among the gfn_to_* functions, e.g. gfn_to_memslot(),
gfn_to_hva_memslot(), kvm_vcpu_gfn_to_hva()...

> bool kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn)
> {
> --
> 2.43.5
>
>