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,
33
33
u32 type , u64 flags );
34
34
const struct kvm_vcpu_sbi_extension * kvm_vcpu_sbi_find_ext (unsigned long extid );
35
35
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
+
36
48
#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)
32
32
};
33
33
}
34
34
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
38
36
static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
39
37
.extid_start = -1UL ,
40
38
.extid_end = -1UL ,
41
39
.handler = NULL ,
42
40
};
43
41
#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 ;
52
42
53
43
static const struct kvm_vcpu_sbi_extension * sbi_ext [] = {
54
44
& 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)
299
299
300
300
void kvm_riscv_vcpu_timer_restore (struct kvm_vcpu * vcpu )
301
301
{
302
- struct kvm_vcpu_csr * csr ;
303
302
struct kvm_vcpu_timer * t = & vcpu -> arch .timer ;
304
303
305
304
kvm_riscv_vcpu_update_timedelta (vcpu );
306
305
307
306
if (!t -> sstc_enabled )
308
307
return ;
309
308
310
- csr = & vcpu -> arch .guest_csr ;
311
309
#if defined(CONFIG_32BIT )
312
310
csr_write (CSR_VSTIMECMP , (u32 )t -> next_cycles );
313
311
csr_write (CSR_VSTIMECMPH , (u32 )(t -> next_cycles >> 32 ));
@@ -324,13 +322,11 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu)
324
322
325
323
void kvm_riscv_vcpu_timer_save (struct kvm_vcpu * vcpu )
326
324
{
327
- struct kvm_vcpu_csr * csr ;
328
325
struct kvm_vcpu_timer * t = & vcpu -> arch .timer ;
329
326
330
327
if (!t -> sstc_enabled )
331
328
return ;
332
329
333
- csr = & vcpu -> arch .guest_csr ;
334
330
t = & vcpu -> arch .timer ;
335
331
#if defined(CONFIG_32BIT )
336
332
t -> next_cycles = csr_read (CSR_VSTIMECMP );
You can’t perform that action at this time.
0 commit comments