Skip to content
Snippets Groups Projects
  • Pavel Dovgaluk's avatar
    dcb15780
    util/qemu-timer: refactor deadline calculation for external timers · dcb15780
    Pavel Dovgaluk authored
    
    icount-based record/replay uses qemu_clock_deadline_ns_all to measure
    the period until vCPU may be interrupted.
    This function takes in account the virtual timers, because they belong
    to the virtual devices that may generate interrupt request or affect
    the virtual machine state.
    However, there are a subset of virtual timers, that are marked with
    'external' flag. These do not change the virtual machine state and
    only based on virtual clock. Calculating the deadling using the external
    timers breaks the determinism, because they do not belong to the replayed
    part of the virtual machine.
    This patch fixes the deadline calculation for this case by adding
    new parameter for skipping the external timers when it is needed.
    
    Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    
    --
    
    v2 changes:
     - added new parameter for timer attribute mask
    Message-Id: <156404426682.18669.17014100602930969222.stgit@pasha-Precision-3630-Tower>
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    dcb15780
    History
    util/qemu-timer: refactor deadline calculation for external timers
    Pavel Dovgaluk authored
    
    icount-based record/replay uses qemu_clock_deadline_ns_all to measure
    the period until vCPU may be interrupted.
    This function takes in account the virtual timers, because they belong
    to the virtual devices that may generate interrupt request or affect
    the virtual machine state.
    However, there are a subset of virtual timers, that are marked with
    'external' flag. These do not change the virtual machine state and
    only based on virtual clock. Calculating the deadling using the external
    timers breaks the determinism, because they do not belong to the replayed
    part of the virtual machine.
    This patch fixes the deadline calculation for this case by adding
    new parameter for skipping the external timers when it is needed.
    
    Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    
    --
    
    v2 changes:
     - added new parameter for timer attribute mask
    Message-Id: <156404426682.18669.17014100602930969222.stgit@pasha-Precision-3630-Tower>
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>