Skip to content

Commit c500814

Browse files
danielhbMichael Tokarev
authored andcommitted
target/riscv/kvm: minor fixes/tweaks
Remove an unused 'KVMScratchCPU' pointer argument in kvm_riscv_check_sbi_dbcn_support(). Put kvm_riscv_reset_regs_csr() after kvm_riscv_put_regs_csr(). This will make a future patch diff easier to read, when changes in kvm_riscv_reset_regs_csr() and kvm_riscv_get_regs_csr() will be made. Fixes: a6b5337 ("target/riscv/kvm: implement SBI debug console (DBCN) calls") Signed-off-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]> Cc: [email protected] (cherry picked from commit 73f81da) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 95c0e6e commit c500814

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

target/riscv/kvm/kvm-cpu.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -613,19 +613,6 @@ static int kvm_riscv_put_regs_core(CPUState *cs)
613613
return ret;
614614
}
615615

616-
static void kvm_riscv_reset_regs_csr(CPURISCVState *env)
617-
{
618-
env->mstatus = 0;
619-
env->mie = 0;
620-
env->stvec = 0;
621-
env->sscratch = 0;
622-
env->sepc = 0;
623-
env->scause = 0;
624-
env->stval = 0;
625-
env->mip = 0;
626-
env->satp = 0;
627-
}
628-
629616
static int kvm_riscv_get_regs_csr(CPUState *cs)
630617
{
631618
CPURISCVState *env = &RISCV_CPU(cs)->env;
@@ -660,6 +647,19 @@ static int kvm_riscv_put_regs_csr(CPUState *cs)
660647
return 0;
661648
}
662649

650+
static void kvm_riscv_reset_regs_csr(CPURISCVState *env)
651+
{
652+
env->mstatus = 0;
653+
env->mie = 0;
654+
env->stvec = 0;
655+
env->sscratch = 0;
656+
env->sepc = 0;
657+
env->scause = 0;
658+
env->stval = 0;
659+
env->mip = 0;
660+
env->satp = 0;
661+
}
662+
663663
static int kvm_riscv_get_regs_fp(CPUState *cs)
664664
{
665665
int ret = 0;
@@ -1078,7 +1078,6 @@ static int uint64_cmp(const void *a, const void *b)
10781078
}
10791079

10801080
static void kvm_riscv_check_sbi_dbcn_support(RISCVCPU *cpu,
1081-
KVMScratchCPU *kvmcpu,
10821081
struct kvm_reg_list *reglist)
10831082
{
10841083
struct kvm_reg_list *reg_search;
@@ -1197,7 +1196,7 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, KVMScratchCPU *kvmcpu)
11971196
kvm_riscv_read_vlenb(cpu, kvmcpu, reglist);
11981197
}
11991198

1200-
kvm_riscv_check_sbi_dbcn_support(cpu, kvmcpu, reglist);
1199+
kvm_riscv_check_sbi_dbcn_support(cpu, reglist);
12011200
}
12021201

12031202
static void riscv_init_kvm_registers(Object *cpu_obj)

0 commit comments

Comments
 (0)