• Bibo Mao's avatar
    LoongArch: KVM: Sync pending interrupt when getting ESTAT from user mode · e306e514
    Bibo Mao authored
    Currently interrupts are posted and cleared with the asynchronous mode,
    meanwhile they are saved in SW state vcpu::arch::irq_pending and vcpu::
    arch::irq_clear. When vcpu is ready to run, pending interrupt is written
    back to CSR.ESTAT register from SW state vcpu::arch::irq_pending at the
    guest entrance.
    
    During VM migration stage, vcpu is put into stopped state, however
    pending interrupts are not synced to CSR.ESTAT register. So there will
    be interrupt lost when VCPU is migrated to another host machines.
    
    Here in this patch when ESTAT CSR register is read from VMM user mode,
    pending interrupts are synchronized to ESTAT also. So that VMM can get
    correct pending interrupts.
    Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    e306e514
vcpu.c 31.8 KB