Skip to content

Commit 9fc8711

Browse files
committed
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200717' into staging
Fix vector min/max fallback expansion Fix singlestep from exception and interrupt # gpg: Signature made Fri 17 Jul 2020 19:13:32 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "[email protected]" # gpg: Good signature from "Richard Henderson <[email protected]>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-tcg-20200717: tcg/cpu-exec: precise single-stepping after an interrupt tcg/cpu-exec: precise single-stepping after an exception tcg: Save/restore vecop_list around minmax fallback Signed-off-by: Peter Maydell <[email protected]>
2 parents b442119 + ba3c35d commit 9fc8711

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

accel/tcg/cpu-exec.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,17 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
504504
cc->do_interrupt(cpu);
505505
qemu_mutex_unlock_iothread();
506506
cpu->exception_index = -1;
507+
508+
if (unlikely(cpu->singlestep_enabled)) {
509+
/*
510+
* After processing the exception, ensure an EXCP_DEBUG is
511+
* raised when single-stepping so that GDB doesn't miss the
512+
* next instruction.
513+
*/
514+
*ret = EXCP_DEBUG;
515+
cpu_handle_debug_exception(cpu);
516+
return true;
517+
}
507518
} else if (!replay_has_interrupt()) {
508519
/* give a chance to iothread in replay mode */
509520
*ret = EXCP_INTERRUPT;
@@ -577,7 +588,13 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
577588
else {
578589
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
579590
replay_interrupt();
580-
cpu->exception_index = -1;
591+
/*
592+
* After processing the interrupt, ensure an EXCP_DEBUG is
593+
* raised when single-stepping so that GDB doesn't miss the
594+
* next instruction.
595+
*/
596+
cpu->exception_index =
597+
(cpu->singlestep_enabled ? EXCP_DEBUG : -1);
581598
*last_tb = NULL;
582599
}
583600
/* The target hook may have updated the 'cpu->interrupt_request';

tcg/tcg-op-vec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,9 @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_vec a,
657657
TCGv_vec b, TCGOpcode opc, TCGCond cond)
658658
{
659659
if (!do_op3(vece, r, a, b, opc)) {
660+
const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL);
660661
tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b);
662+
tcg_swap_vecop_list(hold_list);
661663
}
662664
}
663665

0 commit comments

Comments
 (0)