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

From: Paolo Bonzini
Date: Thu Mar 06 2025 - 11:05:20 EST


On 2/28/25 05:18, Yan Zhao wrote:
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.

I think it was added because this patch introduces the first use of guard(). While it may be included via other files, it's a bit more tidy to leave it in.

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()...

Removed, thanks Yan.

Paolo