[PATCH 06/14] KVM: x86: Remove unnecessary export of kvm_inject_nmi()

Like Xu posted 14 patches 3 years, 5 months ago
[PATCH 06/14] KVM: x86: Remove unnecessary export of kvm_inject_nmi()
Posted by Like Xu 3 years, 5 months ago
From: Like Xu <likexu@tencent.com>

Don't export x86's kvm_inject_nmi(), the helper isn't used by
KVM x86's vendor modules. Add declaration to header file out of
existing callers' need.

Signed-off-by: Like Xu <likexu@tencent.com>
---
 arch/x86/kvm/x86.c | 1 -
 arch/x86/kvm/x86.h | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 818aff135261..c03e599166b8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -802,7 +802,6 @@ void kvm_inject_nmi(struct kvm_vcpu *vcpu)
 	atomic_inc(&vcpu->arch.nmi_queued);
 	kvm_make_request(KVM_REQ_NMI, vcpu);
 }
-EXPORT_SYMBOL_GPL(kvm_inject_nmi);
 
 void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code)
 {
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 69811b4f3eac..c5ff5b05af49 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -308,6 +308,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
 			    int emulation_type, void *insn, int insn_len);
 fastpath_t handle_fastpath_set_msr_irqoff(struct kvm_vcpu *vcpu);
 void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault);
+void kvm_inject_nmi(struct kvm_vcpu *vcpu);
 
 extern u64 host_xcr0;
 extern u64 host_xss;
-- 
2.38.1
Re: [PATCH 06/14] KVM: x86: Remove unnecessary export of kvm_inject_nmi()
Posted by Sean Christopherson 3 years, 4 months ago
On Mon, Nov 14, 2022, Like Xu wrote:
> diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
> index 69811b4f3eac..c5ff5b05af49 100644
> --- a/arch/x86/kvm/x86.h
> +++ b/arch/x86/kvm/x86.h
> @@ -308,6 +308,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
>  			    int emulation_type, void *insn, int insn_len);
>  fastpath_t handle_fastpath_set_msr_irqoff(struct kvm_vcpu *vcpu);
>  void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault);
> +void kvm_inject_nmi(struct kvm_vcpu *vcpu);

Same as the previous patch, kvm_inject_nmi() is declared by kvm_host.h.