[avpatel:riscv_kvm_aia_v1 17/39] arch/riscv/kvm/vcpu_sbi.c:89:7: error: 'SBI_EXT_0_1_CONSOLE_GETCHAR' undeclared
From: kernel test robot
Date: Fri Aug 06 2021 - 01:23:48 EST
tree: https://github.com/avpatel/linux.git riscv_kvm_aia_v1
head: 55f532babde5bfa1582e1249866fcedd919ea110
commit: 424dd9914e1d860f9e63c3fbfd0b3f8a2a9d7915 [17/39] RISC-V: KVM: Add SBI v0.1 support
config: riscv-randconfig-s031-20210805 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://github.com/avpatel/linux/commit/424dd9914e1d860f9e63c3fbfd0b3f8a2a9d7915
git remote add avpatel https://github.com/avpatel/linux.git
git fetch --no-tags avpatel riscv_kvm_aia_v1
git checkout 424dd9914e1d860f9e63c3fbfd0b3f8a2a9d7915
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv 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/riscv/kvm/vcpu_sbi.c: In function 'kvm_riscv_vcpu_sbi_ecall':
>> arch/riscv/kvm/vcpu_sbi.c:89:7: error: 'SBI_EXT_0_1_CONSOLE_GETCHAR' undeclared (first use in this function)
89 | case SBI_EXT_0_1_CONSOLE_GETCHAR:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kvm/vcpu_sbi.c:89:7: note: each undeclared identifier is reported only once for each function it appears in
>> arch/riscv/kvm/vcpu_sbi.c:90:7: error: 'SBI_EXT_0_1_CONSOLE_PUTCHAR' undeclared (first use in this function)
90 | case SBI_EXT_0_1_CONSOLE_PUTCHAR:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kvm/vcpu_sbi.c:99:7: error: 'SBI_EXT_0_1_SET_TIMER' undeclared (first use in this function); did you mean 'SBI_EXT_TIME_SET_TIMER'?
99 | case SBI_EXT_0_1_SET_TIMER:
| ^~~~~~~~~~~~~~~~~~~~~
| SBI_EXT_TIME_SET_TIMER
>> arch/riscv/kvm/vcpu_sbi.c:107:7: error: 'SBI_EXT_0_1_CLEAR_IPI' undeclared (first use in this function); did you mean 'SBI_EXT_IPI_SEND_IPI'?
107 | case SBI_EXT_0_1_CLEAR_IPI:
| ^~~~~~~~~~~~~~~~~~~~~
| SBI_EXT_IPI_SEND_IPI
>> arch/riscv/kvm/vcpu_sbi.c:110:7: error: 'SBI_EXT_0_1_SEND_IPI' undeclared (first use in this function); did you mean 'SBI_EXT_IPI_SEND_IPI'?
110 | case SBI_EXT_0_1_SEND_IPI:
| ^~~~~~~~~~~~~~~~~~~~
| SBI_EXT_IPI_SEND_IPI
>> arch/riscv/kvm/vcpu_sbi.c:127:7: error: 'SBI_EXT_0_1_SHUTDOWN' undeclared (first use in this function)
127 | case SBI_EXT_0_1_SHUTDOWN:
| ^~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kvm/vcpu_sbi.c:132:7: error: 'SBI_EXT_0_1_REMOTE_FENCE_I' undeclared (first use in this function); did you mean 'SBI_EXT_RFENCE_REMOTE_FENCE_I'?
132 | case SBI_EXT_0_1_REMOTE_FENCE_I:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| SBI_EXT_RFENCE_REMOTE_FENCE_I
>> arch/riscv/kvm/vcpu_sbi.c:133:7: error: 'SBI_EXT_0_1_REMOTE_SFENCE_VMA' undeclared (first use in this function); did you mean 'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA'?
133 | case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
>> arch/riscv/kvm/vcpu_sbi.c:134:7: error: 'SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID' undeclared (first use in this function); did you mean 'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID'?
134 | case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID
vim +/SBI_EXT_0_1_CONSOLE_GETCHAR +89 arch/riscv/kvm/vcpu_sbi.c
72
73 int kvm_riscv_vcpu_sbi_ecall(struct kvm_vcpu *vcpu, struct kvm_run *run)
74 {
75 ulong hmask;
76 int i, ret = 1;
77 u64 next_cycle;
78 struct kvm_vcpu *rvcpu;
79 bool next_sepc = true;
80 struct cpumask cm, hm;
81 struct kvm *kvm = vcpu->kvm;
82 struct kvm_cpu_trap utrap = { 0 };
83 struct kvm_cpu_context *cp = &vcpu->arch.guest_context;
84
85 if (!cp)
86 return -EINVAL;
87
88 switch (cp->a7) {
> 89 case SBI_EXT_0_1_CONSOLE_GETCHAR:
> 90 case SBI_EXT_0_1_CONSOLE_PUTCHAR:
91 /*
92 * The CONSOLE_GETCHAR/CONSOLE_PUTCHAR SBI calls cannot be
93 * handled in kernel so we forward these to user-space
94 */
95 kvm_riscv_vcpu_sbi_forward(vcpu, run);
96 next_sepc = false;
97 ret = 0;
98 break;
> 99 case SBI_EXT_0_1_SET_TIMER:
100 #if __riscv_xlen == 32
101 next_cycle = ((u64)cp->a1 << 32) | (u64)cp->a0;
102 #else
103 next_cycle = (u64)cp->a0;
104 #endif
105 kvm_riscv_vcpu_timer_next_event(vcpu, next_cycle);
106 break;
> 107 case SBI_EXT_0_1_CLEAR_IPI:
108 kvm_riscv_vcpu_unset_interrupt(vcpu, IRQ_VS_SOFT);
109 break;
> 110 case SBI_EXT_0_1_SEND_IPI:
111 if (cp->a0)
112 hmask = kvm_riscv_vcpu_unpriv_read(vcpu, false, cp->a0,
113 &utrap);
114 else
115 hmask = (1UL << atomic_read(&kvm->online_vcpus)) - 1;
116 if (utrap.scause) {
117 utrap.sepc = cp->sepc;
118 kvm_riscv_vcpu_trap_redirect(vcpu, &utrap);
119 next_sepc = false;
120 break;
121 }
122 for_each_set_bit(i, &hmask, BITS_PER_LONG) {
123 rvcpu = kvm_get_vcpu_by_id(vcpu->kvm, i);
124 kvm_riscv_vcpu_set_interrupt(rvcpu, IRQ_VS_SOFT);
125 }
126 break;
> 127 case SBI_EXT_0_1_SHUTDOWN:
128 kvm_sbi_system_shutdown(vcpu, run, KVM_SYSTEM_EVENT_SHUTDOWN);
129 next_sepc = false;
130 ret = 0;
131 break;
> 132 case SBI_EXT_0_1_REMOTE_FENCE_I:
> 133 case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
> 134 case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip