Skip to content
  • Pavel Dovgalyuk's avatar
    kvmvapic: patch_instruction fix · 076893d3
    Pavel Dovgalyuk authored
    
    
    When QEMU works in icount mode cpu_restore_state function performs two actions:
    restoring the program counter and updating icount to the correct value.
    kvmvapic's patch_instruction function is called by cpu_report_tpr_access
    function which also invokes cpu_restore_state. It results to calling
    cpu_restore_state twice - in cpu_report_tpr_access and in patch_instruction.
    When icount is disabled second call is safe. But when icount is enabled,
    cpu_restore_state modifies instructions counter twice, which leads to incorrect
    behavior. This patch removes useless cpu_restore_state call from kvmvapic.
    
    Signed-off-by: default avatarPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    076893d3