Skip to content

Commit 23fe562

Browse files
committed
RISC-V: KVM: Move sbi related struct and functions to kvm_vcpu_sbi.h
Just like asm/kvm_vcpu_timer.h, we should have all sbi related struct and functions in asm/kvm_vcpu_sbi.h. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent e81af89 commit 23fe562

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

arch/riscv/include/asm/kvm_host.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/hwcap.h>
1717
#include <asm/kvm_vcpu_fp.h>
1818
#include <asm/kvm_vcpu_insn.h>
19+
#include <asm/kvm_vcpu_sbi.h>
1920
#include <asm/kvm_vcpu_timer.h>
2021

2122
#define KVM_MAX_VCPUS 1024
@@ -94,10 +95,6 @@ struct kvm_arch {
9495
struct kvm_guest_timer timer;
9596
};
9697

97-
struct kvm_sbi_context {
98-
int return_handled;
99-
};
100-
10198
struct kvm_cpu_trap {
10299
unsigned long sepc;
103100
unsigned long scause;
@@ -216,7 +213,7 @@ struct kvm_vcpu_arch {
216213
struct kvm_csr_decode csr_decode;
217214

218215
/* SBI context */
219-
struct kvm_sbi_context sbi_context;
216+
struct kvm_vcpu_sbi_context sbi_context;
220217

221218
/* Cache pages needed to program page tables with spinlock held */
222219
struct kvm_mmu_memory_cache mmu_page_cache;
@@ -326,7 +323,4 @@ bool kvm_riscv_vcpu_has_interrupts(struct kvm_vcpu *vcpu, unsigned long mask);
326323
void kvm_riscv_vcpu_power_off(struct kvm_vcpu *vcpu);
327324
void kvm_riscv_vcpu_power_on(struct kvm_vcpu *vcpu);
328325

329-
int kvm_riscv_vcpu_sbi_return(struct kvm_vcpu *vcpu, struct kvm_run *run);
330-
int kvm_riscv_vcpu_sbi_ecall(struct kvm_vcpu *vcpu, struct kvm_run *run);
331-
332326
#endif /* __RISCV_KVM_HOST_H__ */

arch/riscv/include/asm/kvm_vcpu_sbi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
#define KVM_SBI_VERSION_MAJOR 1
1515
#define KVM_SBI_VERSION_MINOR 0
1616

17+
struct kvm_vcpu_sbi_context {
18+
int return_handled;
19+
};
20+
1721
struct kvm_vcpu_sbi_extension {
1822
unsigned long extid_start;
1923
unsigned long extid_end;
@@ -31,7 +35,9 @@ void kvm_riscv_vcpu_sbi_forward(struct kvm_vcpu *vcpu, struct kvm_run *run);
3135
void kvm_riscv_vcpu_sbi_system_reset(struct kvm_vcpu *vcpu,
3236
struct kvm_run *run,
3337
u32 type, u64 flags);
38+
int kvm_riscv_vcpu_sbi_return(struct kvm_vcpu *vcpu, struct kvm_run *run);
3439
const struct kvm_vcpu_sbi_extension *kvm_vcpu_sbi_find_ext(unsigned long extid);
40+
int kvm_riscv_vcpu_sbi_ecall(struct kvm_vcpu *vcpu, struct kvm_run *run);
3541

3642
#ifdef CONFIG_RISCV_SBI_V01
3743
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01;

0 commit comments

Comments
 (0)