loongson-dune icon indicating copy to clipboard operation
loongson-dune copied to clipboard

why synchronize timerid failed?

Open Martins3 opened this issue 3 years ago • 4 comments

从 vcpu_load 的位置切换到 kvm_vz_vcpu_run 大大的减少了发生错误的情况,但是还是存在一些这种情况。

  • 至少说明,现在这些情况的确是由于 timerid 的刷新导致的
  • 既然 vcpu_load 的实现总是正确的,那么这种同步为什么出错?

Martins3 avatar May 04 '21 16:05 Martins3

  • [x] 是不是每一个物理 cpu 都可以持有一份 guest csr 寄存器,如果在多个 cpu 之间反复横跳,但是这些 cpu 都持有这一个 vcpu 的 csr, 那么 vcpu_load 是不会被调用的 ?

不可能

Martins3 avatar May 05 '21 13:05 Martins3

  • [ ] kvm_vz_vcpu_load_tlb 为什么总是需要被特殊关注 ?

Martins3 avatar May 05 '21 15:05 Martins3

  • [ ] kvm_cpu_cb->vcpu_reenter(run, vcpu); 比如,如果在 kvm_loongarch_handle_exit 的时候切换了 cpu,其实当前一致都是在 kvm 中间的,

Martins3 avatar May 06 '21 01:05 Martins3

在 kvm_loongarch_handle_exit 的位置 disable 过 local irq,在kvm_arch_vcpu_ioctl_run 的位置也是 disable 掉了,没有中断,就没有切换,切换一定是发生在处理 syscall / TLB 之类的事情导致的:

Martins3 avatar May 06 '21 01:05 Martins3