[intel-tdx:kvm-upstream 116/152] arch/x86/kvm/vmx/tdx_stubs.c:17:6: error: no previous prototype for 'tdx_handle_exit_irqoff'

From: kernel test robot
Date: Thu Dec 16 2021 - 18:08:33 EST


tree: https://github.com/intel/tdx.git kvm-upstream
head: bdfe06c17daab60c196ff80c1d98467a1d3734fa
commit: 23fe81f995e342b4152daa56cad4105a72277d4f [116/152] KVM: TDX: Add a place holder to handle TDX VM exit
config: i386-randconfig-m021-20211216 (https://download.01.org/0day-ci/archive/20211217/202112170620.S56iYOua-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/tdx/commit/23fe81f995e342b4152daa56cad4105a72277d4f
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx kvm-upstream
git checkout 23fe81f995e342b4152daa56cad4105a72277d4f
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

arch/x86/kvm/vmx/tdx_stubs.c:4:13: error: no previous prototype for 'tdx_pre_kvm_init' [-Werror=missing-prototypes]
4 | void __init tdx_pre_kvm_init(unsigned int *vcpu_size,
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:6:12: error: no previous prototype for 'tdx_hardware_setup' [-Werror=missing-prototypes]
6 | int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops) { return -EOPNOTSUPP; }
| ^~~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:7:6: error: no previous prototype for 'tdx_hardware_enable' [-Werror=missing-prototypes]
7 | void tdx_hardware_enable(void) {}
| ^~~~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:8:6: error: no previous prototype for 'tdx_hardware_disable' [-Werror=missing-prototypes]
8 | void tdx_hardware_disable(void) {}
| ^~~~~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:10:5: error: no previous prototype for 'tdx_vcpu_create' [-Werror=missing-prototypes]
10 | int tdx_vcpu_create(struct kvm_vcpu *vcpu) { return -EOPNOTSUPP; }
| ^~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:11:6: error: no previous prototype for 'tdx_vcpu_free' [-Werror=missing-prototypes]
11 | void tdx_vcpu_free(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:12:6: error: no previous prototype for 'tdx_vcpu_reset' [-Werror=missing-prototypes]
12 | void tdx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) {}
| ^~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:13:12: error: no previous prototype for 'tdx_vcpu_run' [-Werror=missing-prototypes]
13 | fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu) { return EXIT_FASTPATH_NONE; }
| ^~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:14:6: error: no previous prototype for 'tdx_vcpu_load' [-Werror=missing-prototypes]
14 | void tdx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) {}
| ^~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:15:6: error: no previous prototype for 'tdx_vcpu_put' [-Werror=missing-prototypes]
15 | void tdx_vcpu_put(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:16:6: error: no previous prototype for 'tdx_prepare_switch_to_guest' [-Werror=missing-prototypes]
16 | void tdx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/vmx/tdx_stubs.c:17:6: error: no previous prototype for 'tdx_handle_exit_irqoff' [-Werror=missing-prototypes]
17 | void tdx_handle_exit_irqoff(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/vmx/tdx_stubs.c:18:5: error: no previous prototype for 'tdx_handle_exit' [-Werror=missing-prototypes]
18 | int tdx_handle_exit(struct kvm_vcpu *vcpu,
| ^~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:21:6: error: no previous prototype for 'tdx_apicv_post_state_restore' [-Werror=missing-prototypes]
21 | void tdx_apicv_post_state_restore(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:22:5: error: no previous prototype for 'tdx_deliver_posted_interrupt' [-Werror=missing-prototypes]
22 | int tdx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) { return 0; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/vmx/tdx_stubs.c:23:6: error: no previous prototype for 'tdx_get_exit_info' [-Werror=missing-prototypes]
23 | void tdx_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason,
| ^~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:26:5: error: no previous prototype for 'tdx_dev_ioctl' [-Werror=missing-prototypes]
26 | int tdx_dev_ioctl(void __user *argp) { return -EOPNOTSUPP; }
| ^~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:27:5: error: no previous prototype for 'tdx_vm_ioctl' [-Werror=missing-prototypes]
27 | int tdx_vm_ioctl(struct kvm *kvm, void __user *argp) { return -EOPNOTSUPP; }
| ^~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:28:5: error: no previous prototype for 'tdx_vcpu_ioctl' [-Werror=missing-prototypes]
28 | int tdx_vcpu_ioctl(struct kvm_vcpu *vcpu, void __user *argp) { return -ENOPNOTSUPP; }
| ^~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c: In function 'tdx_vcpu_ioctl':
arch/x86/kvm/vmx/tdx_stubs.c:28:72: error: 'ENOPNOTSUPP' undeclared (first use in this function); did you mean 'EOPNOTSUPP'?
28 | int tdx_vcpu_ioctl(struct kvm_vcpu *vcpu, void __user *argp) { return -ENOPNOTSUPP; }
| ^~~~~~~~~~~
| EOPNOTSUPP
arch/x86/kvm/vmx/tdx_stubs.c:28:72: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/kvm/vmx/tdx_stubs.c: At top level:
arch/x86/kvm/vmx/tdx_stubs.c:30:6: error: no previous prototype for 'tdx_flush_tlb' [-Werror=missing-prototypes]
30 | void tdx_flush_tlb(struct kvm_vcpu *vcpu) {}
| ^~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c:31:6: error: no previous prototype for 'tdx_load_mmu_pgd' [-Werror=missing-prototypes]
31 | void tdx_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa, int root_level) {}
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/tdx_stubs.c: In function 'tdx_vcpu_ioctl':
arch/x86/kvm/vmx/tdx_stubs.c:28:85: error: control reaches end of non-void function [-Werror=return-type]
28 | int tdx_vcpu_ioctl(struct kvm_vcpu *vcpu, void __user *argp) { return -ENOPNOTSUPP; }
| ^
cc1: all warnings being treated as errors


vim +/tdx_handle_exit_irqoff +17 arch/x86/kvm/vmx/tdx_stubs.c

9
10 int tdx_vcpu_create(struct kvm_vcpu *vcpu) { return -EOPNOTSUPP; }
11 void tdx_vcpu_free(struct kvm_vcpu *vcpu) {}
12 void tdx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) {}
13 fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu) { return EXIT_FASTPATH_NONE; }
> 14 void tdx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) {}
> 15 void tdx_vcpu_put(struct kvm_vcpu *vcpu) {}
16 void tdx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) {}
> 17 void tdx_handle_exit_irqoff(struct kvm_vcpu *vcpu) {}
> 18 int tdx_handle_exit(struct kvm_vcpu *vcpu,
19 enum exit_fastpath_completion fastpath) { return 0; }
20
21 void tdx_apicv_post_state_restore(struct kvm_vcpu *vcpu) {}
22 int tdx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) { return 0; }
> 23 void tdx_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason,
24 u64 *info1, u64 *info2, u32 *intr_info, u32 *error_code) {}
25

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx