Message ID | 20221114095606.39785-6-likexu@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: x86: Remove unnecessary exported symbols | expand |
On Mon, Nov 14, 2022, Like Xu wrote: > From: Like Xu <likexu@tencent.com> > > Don't export x86's kvm_inject_page_fault(), the helper isn't used by > KVM x86's vendor modules. Add declaration to header file out of > existing callers' need. ... > diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h > index 9de72586f406..69811b4f3eac 100644 > --- a/arch/x86/kvm/x86.h > +++ b/arch/x86/kvm/x86.h > @@ -307,6 +307,7 @@ int x86_decode_emulated_instruction(struct kvm_vcpu *vcpu, int emulation_type, > 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); arch/x86/include/asm/kvm_host.h already has a definition, no need for one here. The definition could obviously be moved, but I'd prefer not to bother at this time as I want to move _all_ of kvm_host.h out of the "public" include directories (WIP).
On 1/12/2022 10:04 am, Sean Christopherson wrote: > On Mon, Nov 14, 2022, Like Xu wrote: >> From: Like Xu <likexu@tencent.com> >> >> Don't export x86's kvm_inject_page_fault(), the helper isn't used by >> KVM x86's vendor modules. Add declaration to header file out of >> existing callers' need. > > ... > >> diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h >> index 9de72586f406..69811b4f3eac 100644 >> --- a/arch/x86/kvm/x86.h >> +++ b/arch/x86/kvm/x86.h >> @@ -307,6 +307,7 @@ int x86_decode_emulated_instruction(struct kvm_vcpu *vcpu, int emulation_type, >> 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); > > arch/x86/include/asm/kvm_host.h already has a definition, no need for one here. > The definition could obviously be moved, but I'd prefer not to bother at this time > as I want to move _all_ of kvm_host.h out of the "public" include directories (WIP). Great, we may need more decoupling at the code level.
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 38a42ca86ab2..818aff135261 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -774,7 +774,6 @@ void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) kvm_queue_exception_e_p(vcpu, PF_VECTOR, fault->error_code, fault->address); } -EXPORT_SYMBOL_GPL(kvm_inject_page_fault); void kvm_inject_emulated_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index 9de72586f406..69811b4f3eac 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -307,6 +307,7 @@ int x86_decode_emulated_instruction(struct kvm_vcpu *vcpu, int emulation_type, 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); extern u64 host_xcr0; extern u64 host_xss;