• Bibo Mao's avatar
    LoongArch: KVM: Remove kvm_acquire_timer() before entering guest · 1ab9c609
    Bibo Mao authored
    Timer emulation method in VM is switch to SW timer, there are two
    places where timer emulation is needed. One is during vcpu thread
    context switch, the other is halt-polling with idle instruction
    emulation. SW timer switching is removed during halt-polling mode,
    so it is not necessary to disable SW timer before entering to guest.
    
    This patch removes SW timer handling before entering guest mode, and
    put it in HW timer restoring flow when vcpu thread is sched-in. With
    this patch, vm timer emulation is simpler, there is SW/HW timer
    switch only in vcpu thread context switch scenario.
    Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    1ab9c609
timer.c 4.59 KB