File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed
Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,16 @@ void kvm_riscv_vcpu_sbi_system_reset(struct kvm_vcpu *vcpu,
3333 u32 type , u64 flags );
3434const struct kvm_vcpu_sbi_extension * kvm_vcpu_sbi_find_ext (unsigned long extid );
3535
36+ #ifdef CONFIG_RISCV_SBI_V01
37+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 ;
38+ #endif
39+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base ;
40+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time ;
41+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi ;
42+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence ;
43+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst ;
44+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm ;
45+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental ;
46+ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor ;
47+
3648#endif /* __RISCV_KVM_VCPU_SBI_H__ */
Original file line number Diff line number Diff line change @@ -32,23 +32,13 @@ static int kvm_linux_err_map_sbi(int err)
3232 };
3333}
3434
35- #ifdef CONFIG_RISCV_SBI_V01
36- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 ;
37- #else
35+ #ifndef CONFIG_RISCV_SBI_V01
3836static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
3937 .extid_start = -1UL ,
4038 .extid_end = -1UL ,
4139 .handler = NULL ,
4240};
4341#endif
44- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base ;
45- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time ;
46- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi ;
47- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence ;
48- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst ;
49- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm ;
50- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental ;
51- extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor ;
5242
5343static const struct kvm_vcpu_sbi_extension * sbi_ext [] = {
5444 & vcpu_sbi_ext_v01 ,
Original file line number Diff line number Diff line change @@ -299,15 +299,13 @@ static void kvm_riscv_vcpu_update_timedelta(struct kvm_vcpu *vcpu)
299299
300300void kvm_riscv_vcpu_timer_restore (struct kvm_vcpu * vcpu )
301301{
302- struct kvm_vcpu_csr * csr ;
303302 struct kvm_vcpu_timer * t = & vcpu -> arch .timer ;
304303
305304 kvm_riscv_vcpu_update_timedelta (vcpu );
306305
307306 if (!t -> sstc_enabled )
308307 return ;
309308
310- csr = & vcpu -> arch .guest_csr ;
311309#if defined(CONFIG_32BIT )
312310 csr_write (CSR_VSTIMECMP , (u32 )t -> next_cycles );
313311 csr_write (CSR_VSTIMECMPH , (u32 )(t -> next_cycles >> 32 ));
@@ -324,13 +322,11 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu)
324322
325323void kvm_riscv_vcpu_timer_save (struct kvm_vcpu * vcpu )
326324{
327- struct kvm_vcpu_csr * csr ;
328325 struct kvm_vcpu_timer * t = & vcpu -> arch .timer ;
329326
330327 if (!t -> sstc_enabled )
331328 return ;
332329
333- csr = & vcpu -> arch .guest_csr ;
334330 t = & vcpu -> arch .timer ;
335331#if defined(CONFIG_32BIT )
336332 t -> next_cycles = csr_read (CSR_VSTIMECMP );
You can’t perform that action at this time.
0 commit comments