1. 27 6月, 2018 1 次提交
  2. 16 6月, 2018 17 次提交
  3. 15 6月, 2018 3 次提交
  4. 01 6月, 2018 1 次提交
  5. 31 5月, 2018 2 次提交
  6. 20 5月, 2018 1 次提交
  7. 15 5月, 2018 1 次提交
  8. 11 5月, 2018 2 次提交
  9. 10 5月, 2018 1 次提交
  10. 11 4月, 2018 1 次提交
    • P
      icount: fix cpu_restore_state_from_tb for non-tb-exit cases · afd46fca
      Pavel Dovgalyuk 提交于
      In icount mode, instructions that access io memory spaces in the middle
      of the translation block invoke TB recompilation.  After recompilation,
      such instructions become last in the TB and are allowed to access io
      memory spaces.
      
      When the code includes instruction like i386 'xchg eax, 0xffffd080'
      which accesses APIC, QEMU goes into an infinite loop of the recompilation.
      
      This instruction includes two memory accesses - one read and one write.
      After the first access, APIC calls cpu_report_tpr_access, which restores
      the CPU state to get the current eip.  But cpu_restore_state_from_tb
      resets the cpu->can_do_io flag which makes the second memory access invalid.
      Therefore the second memory access causes a recompilation of the block.
      Then these operations repeat again and again.
      
      This patch moves resetting cpu->can_do_io flag from
      cpu_restore_state_from_tb to cpu_loop_exit* functions.
      
      It also adds a parameter for cpu_restore_state which controls restoring
      icount.  There is no need to restore icount when we only query CPU state
      without breaking the TB.  Restoring it in such cases leads to the
      incorrect flow of the virtual time.
      
      In most cases new parameter is true (icount should be recalculated).
      But there are two cases in i386 and openrisc when the CPU state is only
      queried without the need to break the TB.  This patch fixes both of
      these cases.
      Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Message-Id: <20180409091320.12504.35329.stgit@pasha-VirtualBox>
      [rth: Make can_do_io setting unconditional; move from cpu_exec;
      make cpu_loop_exit_{noexc,restore} call cpu_loop_exit.]
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      afd46fca
  11. 06 4月, 2018 1 次提交
  12. 26 3月, 2018 1 次提交
    • R
      tcg: Really fix cpu_io_recompile · 87f963be
      Richard Henderson 提交于
      We have confused the number of instructions that have been
      executed in the TB with the number of instructions needed
      to repeat the I/O instruction.
      
      We have used cpu_restore_state_from_tb, which means that
      the guest pc is pointing to the I/O instruction.  The only
      time the answer to the later question is not 1 is when
      MIPS or SH4 need to re-execute the branch for the delay
      slot as well.
      
      We must rely on cpu->cflags_next_tb to generate the next TB,
      as otherwise we have a race condition with other guest cpus
      within the TB cache.
      
      Fixes: 0790f868Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20180319031545.29359-1-richard.henderson@linaro.org>
      Tested-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      87f963be
  13. 13 3月, 2018 1 次提交
  14. 12 3月, 2018 1 次提交
    • P
      cpu-exec: fix exception_index handling · 5f3bdfd4
      Pavel Dovgalyuk 提交于
      Function cpu_handle_interrupt calls cc->cpu_exec_interrupt to process
      pending hardware interrupts. Under the hood cpu_exec_interrupt uses
      cpu->exception_index to pass information to the internal function which
      is usually common for exception and interrupt processing.
      But this value is not reset after return and may be processed again
      by cpu_handle_exception. This does not happen due to overwriting
      the exception_index at the end of cpu_handle_interrupt.
      But this branch may also overwrite the valid exception_index in some cases.
      Therefore this patch:
       1. resets exception_index just after the call to cpu_exec_interrupt
       2. prevents overwriting the meaningful value of exception_index
      Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180227095140.1060.61357.stgit@pasha-VirtualBox>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      5f3bdfd4
  15. 08 2月, 2018 6 次提交