• Bibo Mao's avatar
    LoongArch: KVM: Remove SW timer switch when vcpu is halt polling · 16126732
    Bibo Mao authored
    With halt-polling supported, there is checking for pending events or
    interrupts when vcpu executes idle instruction. Pending interrupts
    include injected SW interrupts and passthrough HW interrupts, such as
    HW timer interrupts, since HW timer works still even if vcpu exists from
    VM mode.
    
    Since HW timer pending interrupt can be set directly with CSR status
    register, and pending HW timer interrupt checking is used in vcpu block
    checking function, it is not necessary to switch to SW timer during
    halt-polling. This patch adds preemption disabling in function
    kvm_cpu_has_pending_timer(), and removes SW timer switching in idle
    instruction emulation function.
    Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    16126732
timer.c 5.25 KB