hv: fix undefined reference to nested_vmexit_handler() in vmexit.c

arch/x86/guest/nested.c, where nested_vmexit_handler() is defined, is
only compiled when CONFIG_NVMX_ENABLED is enabled. Define a dummy
function in include/arch/x86/asm/guest/nested.h to fix the undefined
reference linker error.

Tracked-On: #8465
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Jiaqing Zhao 2023-07-21 06:42:01 +00:00 committed by acrnsi-robot
parent 75b031b63c
commit 3cc1127ae9

View File

@ -318,7 +318,6 @@ enum VMXResult {
void nested_vmx_result(enum VMXResult, int error_number);
int64_t get_invvpid_ept_operands(struct acrn_vcpu *vcpu, void *desc, size_t size);
bool check_vmx_permission(struct acrn_vcpu *vcpu);
int32_t nested_vmexit_handler(struct acrn_vcpu *vcpu);
int32_t vmxon_vmexit_handler(struct acrn_vcpu *vcpu);
int32_t vmxoff_vmexit_handler(struct acrn_vcpu *vcpu);
int32_t vmptrld_vmexit_handler(struct acrn_vcpu *vcpu);
@ -354,6 +353,7 @@ bool is_vcpu_in_l2_guest(struct acrn_vcpu *vcpu);
bool is_vmx_msr(uint32_t msr);
void init_vmx_msrs(struct acrn_vcpu *vcpu);
int32_t read_vmx_msr(__unused struct acrn_vcpu *vcpu, uint32_t msr, uint64_t *val);
int32_t nested_vmexit_handler(struct acrn_vcpu *vcpu);
#else
struct acrn_nested {};
@ -378,5 +378,10 @@ static inline int32_t read_vmx_msr(__unused struct acrn_vcpu *vcpu,
{
return -EACCES;
}
static inline int32_t nested_vmexit_handler(__unused struct acrn_vcpu *vcpu)
{
return -EINVAL;
}
#endif /* CONFIG_NVMX_ENABLED */
#endif /* NESTED_H */