Skip to content

Commit 897c68f

Browse files
danielhbalistair23
authored andcommitted
Revert "target/riscv/kvm: add missing KVM CSRs"
This commit breaks KVM boot on older kernels, like reported in [1], due to senvcfg not being available in them. There's also another problem related to scounteren. Using a recent enough guest buildroot, 'ping' will be build with rdtime support. In this case, doing a ping in a KVM guest while exposing scounteren will result in an error. The root cause relates to how KVM handles scounteren, but QEMU can work around it by initializing scounteren with the host value during init(). Fixing these issues in a non-rushed-bandaid manner results in an amount of design changes that I don't feel comfortable pushing during code freeze, so for 10.0 we'll remove the CSRs and re-introduce them in 10.1 with the adequate support. This reverts commit 4db19d5. [1] https://lore.kernel.org/qemu-riscv/CABJz62OfUDHYkQ0T3rGHStQprf1c7_E0qBLbLKhfv=+jb0SYAw@mail.gmail.com/ Reported-by: Andrea Bolognani <[email protected]> Signed-off-by: Daniel Henrique Barboza <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent e768f02 commit 897c68f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

target/riscv/kvm/kvm-cpu.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,6 @@ static void kvm_riscv_reset_regs_csr(CPURISCVState *env)
624624
env->stval = 0;
625625
env->mip = 0;
626626
env->satp = 0;
627-
env->scounteren = 0;
628-
env->senvcfg = 0;
629627
}
630628

631629
static int kvm_riscv_get_regs_csr(CPUState *cs)
@@ -641,8 +639,6 @@ static int kvm_riscv_get_regs_csr(CPUState *cs)
641639
KVM_RISCV_GET_CSR(cs, env, stval, env->stval);
642640
KVM_RISCV_GET_CSR(cs, env, sip, env->mip);
643641
KVM_RISCV_GET_CSR(cs, env, satp, env->satp);
644-
KVM_RISCV_GET_CSR(cs, env, scounteren, env->scounteren);
645-
KVM_RISCV_GET_CSR(cs, env, senvcfg, env->senvcfg);
646642

647643
return 0;
648644
}
@@ -660,8 +656,6 @@ static int kvm_riscv_put_regs_csr(CPUState *cs)
660656
KVM_RISCV_SET_CSR(cs, env, stval, env->stval);
661657
KVM_RISCV_SET_CSR(cs, env, sip, env->mip);
662658
KVM_RISCV_SET_CSR(cs, env, satp, env->satp);
663-
KVM_RISCV_SET_CSR(cs, env, scounteren, env->scounteren);
664-
KVM_RISCV_SET_CSR(cs, env, senvcfg, env->senvcfg);
665659

666660
return 0;
667661
}

0 commit comments

Comments
 (0)