• P
    cpu-exec: avoid cpu_exec_nocache infinite loop with record/replay · 17b50b0c
    Pavel Dovgalyuk 提交于
    This patch ensures that icount_decr.u32.high is clear before calling
    cpu_exec_nocache when exception is pending.  Because the exception is
    caused by the first instruction in the block and it cannot be executed
    without resetting the flag.
    
    There are two parts in the fix.  First, clear icount_decr.u32.high in
    cpu_handle_interrupt (just before processing the "dependent" request,
    stored in cpu->interrupt_request or cpu->exit_request) rather than
    cpu_loop_exec_tb; this ensures that cpu_handle_exception is always
    reached with zero icount_decr.u32.high unless another interrupt has
    happened in the meanwhile.
    
    Second, try to cause the exception at the beginning of
    cpu_handle_exception, and exit immediately if the TB cannot
    execute.  With this change, interrupts are processed and
    cpu_exec_nocache can make process.
    Signed-off-by: NMaria Klimushenkova <maria.klimushenkova@ispras.ru>
    Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
    Message-Id: <20171114081818.27640.33165.stgit@pasha-VirtualBox>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    17b50b0c
cpu-exec.c 23.4 KB