Fix vector min/max fallback expansion

Fix singlestep from exception and interrupt
 -----BEGIN PGP SIGNATURE-----
 
 iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAl8R6kwdHHJpY2hhcmQu
 aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+EjAf+MmvNERfpAYSHsK6U
 EuFYDKayYtL5rKbhc5LtXcRC9MduYYadGoJnrcqNswf+Jce44FmdtXsZe1KQ5IkX
 yqu8ZQOJoBx228xq3ksW1TrWkWt48P+g7ud5OI6Dw7fs9AW7hQOptE6aSGtznCkU
 yhLqkAwutmSkaAzDI5oYviHT39UZXGBlMB/1h9L23b/n9NzapAPe/PesH2CMoK0r
 EKRi5nwzlrw4CDcWEwqr56dCGa5NV47uIC3B0L6EKVmoJLupNEoz+QaKafbHL8o6
 uJsyqatLvfqDARZv8lJbs4fKHou+j0y8EHE3a7+XDsO+vk9nRACHGQ3j7EefKO6F
 UrxnbA==
 =X7BM
 -----END PGP SIGNATURE-----

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 "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [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 <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-07-19 10:29:05 +01:00
commit 9fc8711100
2 changed files with 20 additions and 1 deletions

View File

@ -504,6 +504,17 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
cc->do_interrupt(cpu);
qemu_mutex_unlock_iothread();
cpu->exception_index = -1;
if (unlikely(cpu->singlestep_enabled)) {
/*
* After processing the exception, ensure an EXCP_DEBUG is
* raised when single-stepping so that GDB doesn't miss the
* next instruction.
*/
*ret = EXCP_DEBUG;
cpu_handle_debug_exception(cpu);
return true;
}
} else if (!replay_has_interrupt()) {
/* give a chance to iothread in replay mode */
*ret = EXCP_INTERRUPT;
@ -577,7 +588,13 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
else {
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
replay_interrupt();
cpu->exception_index = -1;
/*
* After processing the interrupt, ensure an EXCP_DEBUG is
* raised when single-stepping so that GDB doesn't miss the
* next instruction.
*/
cpu->exception_index =
(cpu->singlestep_enabled ? EXCP_DEBUG : -1);
*last_tb = NULL;
}
/* The target hook may have updated the 'cpu->interrupt_request';

View File

@ -657,7 +657,9 @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_vec a,
TCGv_vec b, TCGOpcode opc, TCGCond cond)
{
if (!do_op3(vece, r, a, b, opc)) {
const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL);
tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b);
tcg_swap_vecop_list(hold_list);
}
}