arch/riscv/kvm/vcpu.c:825:3: error: implicit declaration of function 'kvm_riscv_vector_restore'; did you mean 'kvm_riscv_vcpu_timer_restore'?
kernel test robot
build bottree: https://github.com/congwang/linux.git riscv-vector-discard head: 82089161ab902778cdd13a9cd126871c69aa4e87 commit: b1ea6b7e02031d2767b5871f3fc669ee61975cf2 [1/5] riscv: vector: refactor vector context operations config: riscv-randconfig-2000-20261126 (https://download.01.org/0day-ci/archive/20261126/[email protected]/config) compiler: riscv64-linux-gcc (GCC) 10.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261126/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
arch/riscv/kvm/vcpu.c: In function 'kvm_riscv_vcpu_enter_exit':
>> arch/riscv/kvm/vcpu.c:825:3: error: implicit declaration of function 'kvm_riscv_vector_restore'; did you mean 'kvm_riscv_vcpu_timer_restore'? [-Werror=implicit-function-declaration]
825 | kvm_riscv_vector_restore(gcntx);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| kvm_riscv_vcpu_timer_restorecc1: some warnings being treated as errors
vim +825 arch/riscv/kvm/vcpu.c
795
796 /*
797 * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
798 * the vCPU is running.
799 *
800 * This must be noinstr as instrumentation may make use of RCU, and this is not
801 * safe during the EQS.
802 */
803 static void noinstr kvm_riscv_vcpu_enter_exit(struct kvm_vcpu *vcpu,
804 struct kvm_cpu_trap *trap)
805 {
806 void *nsh;
807 struct kvm_cpu_context *gcntx = &vcpu->arch.guest_context;
808 struct kvm_cpu_context *hcntx = &vcpu->arch.host_context;
809
810 /*
811 * We save trap CSRs (such as SEPC, SCAUSE, STVAL, HTVAL, and
812 * HTINST) here because we do local_irq_enable() after this
813 * function in kvm_arch_vcpu_ioctl_run() which can result in
814 * an interrupt immediately after local_irq_enable() and can
815 * potentially change trap CSRs.
816 */
817
818 kvm_riscv_vcpu_swap_in_guest_state(vcpu);
819 guest_state_enter_irqoff();
820
821 /* sstatus.VS != SR_VS_OFF is guaranteed when NEED_RESTORE is set */
822 if (current->thread.riscv_v_flags & RISCV_V_VCPU_NEED_RESTORE) {
823 current->thread.riscv_v_flags &= ~RISCV_V_VCPU_NEED_RESTORE;
824 current->thread.riscv_v_flags |= RISCV_V_VCPU_CTX;
> 825 kvm_riscv_vector_restore(gcntx);
826 gcntx->sstatus = (gcntx->sstatus & ~SR_VS) | SR_VS_CLEAN;
827 }
828
829 if (kvm_riscv_nacl_sync_sret_available()) {
830 nsh = nacl_shmem();
831
832 if (kvm_riscv_nacl_autoswap_csr_available()) {
833 hcntx->hstatus =
834 nacl_csr_read(nsh, CSR_HSTATUS);
835 nacl_scratch_write_long(nsh,
836 SBI_NACL_SHMEM_AUTOSWAP_OFFSET +
837 SBI_NACL_SHMEM_AUTOSWAP_HSTATUS,
838 gcntx->hstatus);
839 nacl_scratch_write_long(nsh,
840 SBI_NACL_SHMEM_AUTOSWAP_OFFSET,
841 SBI_NACL_SHMEM_AUTOSWAP_FLAG_HSTATUS);
842 } else if (kvm_riscv_nacl_sync_csr_available()) {
843 hcntx->hstatus = nacl_csr_swap(nsh,
844 CSR_HSTATUS, gcntx->hstatus);
845 } else {
846 hcntx->hstatus = csr_swap(CSR_HSTATUS, gcntx->hstatus);
847 }
848
849 nacl_scratch_write_longs(nsh,
850 SBI_NACL_SHMEM_SRET_OFFSET +
851 SBI_NACL_SHMEM_SRET_X(1),
852 &gcntx->ra,
853 SBI_NACL_SHMEM_SRET_X_LAST);
854
855 __kvm_riscv_nacl_switch_to(&vcpu->arch, SBI_EXT_NACL,
856 SBI_EXT_NACL_SYNC_SRET);
857
858 if (kvm_riscv_nacl_autoswap_csr_available()) {
859 nacl_scratch_write_long(nsh,
860 SBI_NACL_SHMEM_AUTOSWAP_OFFSET,
861 0);
862 gcntx->hstatus = nacl_scratch_read_long(nsh,
863 SBI_NACL_SHMEM_AUTOSWAP_OFFSET +
864 SBI_NACL_SHMEM_AUTOSWAP_HSTATUS);
865 } else {
866 gcntx->hstatus = csr_swap(CSR_HSTATUS, hcntx->hstatus);
867 }
868
869 trap->htval = nacl_csr_read(nsh, CSR_HTVAL);
870 trap->htinst = nacl_csr_read(nsh, CSR_HTINST);
871 } else {
872 hcntx->hstatus = csr_swap(CSR_HSTATUS, gcntx->hstatus);
873
874 __kvm_riscv_switch_to(&vcpu->arch);
875
876 gcntx->hstatus = csr_swap(CSR_HSTATUS, hcntx->hstatus);
877
878 trap->htval = csr_read(CSR_HTVAL);
879 trap->htinst = csr_read(CSR_HTINST);
880 }
881
882 trap->sepc = gcntx->sepc;
883 trap->scause = csr_read(CSR_SCAUSE);
884 trap->stval = csr_read(CSR_STVAL);
885
886 vcpu->arch.last_exit_cpu = vcpu->cpu;
887 guest_state_exit_irqoff();
888 kvm_riscv_vcpu_swap_in_host_state(vcpu);
889 }
890
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki