1 | The following changes since commit 95d1fbabae0cd44156ac4b96d512d143ca7dfd5e: | 1 | The following changes since commit 3ccf6cd0e3e1dfd663814640b3b18b55715d7a75: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200716-pull-request' into staging (2020-07-16 18:50:51 +0100) | 3 | Merge remote-tracking branch 'remotes/kraxel/tags/audio-20210617-pull-request' into staging (2021-06-18 09:54:42 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://github.com/rth7680/qemu.git tags/pull-tcg-20200717 | 7 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20210619-2 |
8 | 8 | ||
9 | for you to fetch changes up to ba3c35d9c4026361fd380b269dc6def9510b7166: | 9 | for you to fetch changes up to 1c9638667b7068539dc5783c9428d588b14162ea: |
10 | 10 | ||
11 | tcg/cpu-exec: precise single-stepping after an interrupt (2020-07-17 11:09:34 -0700) | 11 | util/oslib-win32: Fix fatal assertion in qemu_try_memalign (2021-06-19 14:51:51 -0700) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Fix vector min/max fallback expansion | 14 | TCI cleanup and re-encoding |
15 | Fix singlestep from exception and interrupt | 15 | Fixes for #367 and #390. |
16 | Move TCGCond to tcg/tcg-cond.h. | ||
17 | Fix for win32 qemu_try_memalign. | ||
16 | 18 | ||
17 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
18 | Luc Michel (1): | 20 | Alessandro Di Federico (1): |
19 | tcg/cpu-exec: precise single-stepping after an exception | 21 | tcg: expose TCGCond manipulation routines |
20 | 22 | ||
21 | Richard Henderson (2): | 23 | Richard Henderson (31): |
22 | tcg: Save/restore vecop_list around minmax fallback | 24 | tcg: Combine dh_is_64bit and dh_is_signed to dh_typecode |
23 | tcg/cpu-exec: precise single-stepping after an interrupt | 25 | tcg: Add tcg_call_flags |
26 | accel/tcg/plugin-gen: Drop inline markers | ||
27 | plugins: Drop tcg_flags from struct qemu_plugin_dyn_cb | ||
28 | accel/tcg: Add tcg call flags to plugins helpers | ||
29 | tcg: Store the TCGHelperInfo in the TCGOp for call | ||
30 | tcg: Add tcg_call_func | ||
31 | tcg: Build ffi data structures for helpers | ||
32 | tcg/tci: Improve tcg_target_call_clobber_regs | ||
33 | tcg/tci: Move call-return regs to end of tcg_target_reg_alloc_order | ||
34 | tcg/tci: Use ffi for calls | ||
35 | tcg/tci: Reserve r13 for a temporary | ||
36 | tcg/tci: Emit setcond before brcond | ||
37 | tcg/tci: Remove tci_write_reg | ||
38 | tcg/tci: Change encoding to uint32_t units | ||
39 | tcg/tci: Implement goto_ptr | ||
40 | tcg/tci: Implement movcond | ||
41 | tcg/tci: Implement andc, orc, eqv, nand, nor | ||
42 | tcg/tci: Implement extract, sextract | ||
43 | tcg/tci: Implement clz, ctz, ctpop | ||
44 | tcg/tci: Implement mulu2, muls2 | ||
45 | tcg/tci: Implement add2, sub2 | ||
46 | tcg/tci: Split out tci_qemu_ld, tci_qemu_st | ||
47 | Revert "tcg/tci: Use exec/cpu_ldst.h interfaces" | ||
48 | tcg/tci: Remove the qemu_ld/st_type macros | ||
49 | tcg/tci: Use {set,clear}_helper_retaddr | ||
50 | tests/tcg: Increase timeout for TCI | ||
51 | accel/tcg: Probe the proper permissions for atomic ops | ||
52 | tcg/sparc: Fix temp_allocate_frame vs sparc stack bias | ||
53 | tcg: Allocate sufficient storage in temp_allocate_frame | ||
54 | tcg: Restart when exhausting the stack frame | ||
24 | 55 | ||
25 | accel/tcg/cpu-exec.c | 19 ++++++++++++++++++- | 56 | Stefan Weil (1): |
26 | tcg/tcg-op-vec.c | 2 ++ | 57 | util/oslib-win32: Fix fatal assertion in qemu_try_memalign |
27 | 2 files changed, 20 insertions(+), 1 deletion(-) | ||
28 | 58 | ||
59 | configure | 3 + | ||
60 | accel/tcg/atomic_template.h | 24 +- | ||
61 | accel/tcg/plugin-helpers.h | 5 +- | ||
62 | include/exec/helper-head.h | 37 +- | ||
63 | include/exec/helper-tcg.h | 34 +- | ||
64 | include/qemu/plugin.h | 1 - | ||
65 | include/tcg/tcg-cond.h | 101 ++ | ||
66 | include/tcg/tcg-opc.h | 4 +- | ||
67 | include/tcg/tcg.h | 71 +- | ||
68 | target/hppa/helper.h | 3 - | ||
69 | target/i386/ops_sse_header.h | 3 - | ||
70 | target/m68k/helper.h | 1 - | ||
71 | target/ppc/helper.h | 3 - | ||
72 | tcg/tcg-internal.h | 22 + | ||
73 | tcg/tci/tcg-target-con-set.h | 1 + | ||
74 | tcg/tci/tcg-target.h | 68 +- | ||
75 | accel/tcg/cputlb.c | 95 +- | ||
76 | accel/tcg/plugin-gen.c | 20 +- | ||
77 | accel/tcg/user-exec.c | 8 +- | ||
78 | plugins/core.c | 30 +- | ||
79 | tcg/optimize.c | 3 +- | ||
80 | tcg/tcg.c | 299 +++-- | ||
81 | tcg/tci.c | 1203 ++++++++++---------- | ||
82 | util/oslib-win32.c | 6 +- | ||
83 | tcg/sparc/tcg-target.c.inc | 16 +- | ||
84 | tcg/tci/tcg-target.c.inc | 550 ++++----- | ||
85 | tcg/meson.build | 8 +- | ||
86 | tcg/tci/README | 20 +- | ||
87 | tests/docker/dockerfiles/alpine.docker | 1 + | ||
88 | tests/docker/dockerfiles/centos8.docker | 1 + | ||
89 | tests/docker/dockerfiles/debian10.docker | 1 + | ||
90 | tests/docker/dockerfiles/fedora-i386-cross.docker | 1 + | ||
91 | tests/docker/dockerfiles/fedora-win32-cross.docker | 1 + | ||
92 | tests/docker/dockerfiles/fedora-win64-cross.docker | 1 + | ||
93 | tests/docker/dockerfiles/fedora.docker | 1 + | ||
94 | tests/docker/dockerfiles/ubuntu.docker | 1 + | ||
95 | tests/docker/dockerfiles/ubuntu1804.docker | 1 + | ||
96 | tests/docker/dockerfiles/ubuntu2004.docker | 1 + | ||
97 | tests/tcg/Makefile.target | 6 +- | ||
98 | 39 files changed, 1453 insertions(+), 1202 deletions(-) | ||
99 | create mode 100644 include/tcg/tcg-cond.h | ||
100 | diff view generated by jsdifflib |
1 | Forgetting this asserts when tcg_gen_cmp_vec is called from | 1 | This function should have been updated for vector types |
---|---|---|---|
2 | within tcg_gen_cmpsel_vec. | 2 | when they were introduced. |
3 | 3 | ||
4 | Fixes: 72b4c792c7a | 4 | Fixes: d2fd745fe8b |
5 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/367 | ||
6 | Cc: qemu-stable@nongnu.org | ||
7 | Tested-by: Stefan Weil <sw@weilnetz.de> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | --- | 10 | --- |
7 | tcg/tcg-op-vec.c | 2 ++ | 11 | tcg/tcg.c | 31 ++++++++++++++++++++++++++----- |
8 | 1 file changed, 2 insertions(+) | 12 | 1 file changed, 26 insertions(+), 5 deletions(-) |
9 | 13 | ||
10 | diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c | 14 | diff --git a/tcg/tcg.c b/tcg/tcg.c |
11 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/tcg/tcg-op-vec.c | 16 | --- a/tcg/tcg.c |
13 | +++ b/tcg/tcg-op-vec.c | 17 | +++ b/tcg/tcg.c |
14 | @@ -XXX,XX +XXX,XX @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_vec a, | 18 | @@ -XXX,XX +XXX,XX @@ static void check_regs(TCGContext *s) |
15 | TCGv_vec b, TCGOpcode opc, TCGCond cond) | 19 | |
20 | static void temp_allocate_frame(TCGContext *s, TCGTemp *ts) | ||
16 | { | 21 | { |
17 | if (!do_op3(vece, r, a, b, opc)) { | 22 | - if (s->current_frame_offset + (tcg_target_long)sizeof(tcg_target_long) > |
18 | + const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL); | 23 | - s->frame_end) { |
19 | tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b); | 24 | - tcg_abort(); |
20 | + tcg_swap_vecop_list(hold_list); | 25 | + intptr_t off, size, align; |
26 | + | ||
27 | + switch (ts->type) { | ||
28 | + case TCG_TYPE_I32: | ||
29 | + size = align = 4; | ||
30 | + break; | ||
31 | + case TCG_TYPE_I64: | ||
32 | + case TCG_TYPE_V64: | ||
33 | + size = align = 8; | ||
34 | + break; | ||
35 | + case TCG_TYPE_V128: | ||
36 | + size = align = 16; | ||
37 | + break; | ||
38 | + case TCG_TYPE_V256: | ||
39 | + /* Note that we do not require aligned storage for V256. */ | ||
40 | + size = 32, align = 16; | ||
41 | + break; | ||
42 | + default: | ||
43 | + g_assert_not_reached(); | ||
21 | } | 44 | } |
45 | - ts->mem_offset = s->current_frame_offset; | ||
46 | + | ||
47 | + assert(align <= TCG_TARGET_STACK_ALIGN); | ||
48 | + off = ROUND_UP(s->current_frame_offset, align); | ||
49 | + assert(off + size <= s->frame_end); | ||
50 | + s->current_frame_offset = off + size; | ||
51 | + | ||
52 | + ts->mem_offset = off; | ||
53 | #if defined(__sparc__) | ||
54 | ts->mem_offset += TCG_TARGET_STACK_BIAS; | ||
55 | #endif | ||
56 | ts->mem_base = s->frame_temp; | ||
57 | ts->mem_allocated = 1; | ||
58 | - s->current_frame_offset += sizeof(tcg_target_long); | ||
22 | } | 59 | } |
23 | 60 | ||
61 | static void temp_load(TCGContext *, TCGTemp *, TCGRegSet, TCGRegSet, TCGRegSet); | ||
24 | -- | 62 | -- |
25 | 2.25.1 | 63 | 2.25.1 |
26 | 64 | ||
27 | 65 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Luc Michel <luc.michel@greensocs.com> | ||
2 | 1 | ||
3 | When single-stepping with a debugger attached to QEMU, and when an | ||
4 | exception is raised, the debugger misses the first instruction after the | ||
5 | exception: | ||
6 | |||
7 | $ qemu-system-aarch64 -M virt -display none -cpu cortex-a53 -s -S | ||
8 | |||
9 | $ aarch64-linux-gnu-gdb | ||
10 | GNU gdb (GDB) 9.2 | ||
11 | [...] | ||
12 | (gdb) tar rem :1234 | ||
13 | Remote debugging using :1234 | ||
14 | warning: No executable has been specified and target does not support | ||
15 | determining executable automatically. Try using the "file" command. | ||
16 | 0x0000000000000000 in ?? () | ||
17 | (gdb) # writing nop insns to 0x200 and 0x204 | ||
18 | (gdb) set *0x200 = 0xd503201f | ||
19 | (gdb) set *0x204 = 0xd503201f | ||
20 | (gdb) # 0x0 address contains 0 which is an invalid opcode. | ||
21 | (gdb) # The CPU should raise an exception and jump to 0x200 | ||
22 | (gdb) si | ||
23 | 0x0000000000000204 in ?? () | ||
24 | |||
25 | With this commit, the same run steps correctly on the first instruction | ||
26 | of the exception vector: | ||
27 | |||
28 | (gdb) si | ||
29 | 0x0000000000000200 in ?? () | ||
30 | |||
31 | Buglink: https://bugs.launchpad.net/qemu/+bug/757702 | ||
32 | Signed-off-by: Luc Michel <luc.michel@greensocs.com> | ||
33 | Message-Id: <20200716193947.3058389-1-luc.michel@greensocs.com> | ||
34 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
35 | --- | ||
36 | accel/tcg/cpu-exec.c | 11 +++++++++++ | ||
37 | 1 file changed, 11 insertions(+) | ||
38 | |||
39 | diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/accel/tcg/cpu-exec.c | ||
42 | +++ b/accel/tcg/cpu-exec.c | ||
43 | @@ -XXX,XX +XXX,XX @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) | ||
44 | cc->do_interrupt(cpu); | ||
45 | qemu_mutex_unlock_iothread(); | ||
46 | cpu->exception_index = -1; | ||
47 | + | ||
48 | + if (unlikely(cpu->singlestep_enabled)) { | ||
49 | + /* | ||
50 | + * After processing the exception, ensure an EXCP_DEBUG is | ||
51 | + * raised when single-stepping so that GDB doesn't miss the | ||
52 | + * next instruction. | ||
53 | + */ | ||
54 | + *ret = EXCP_DEBUG; | ||
55 | + cpu_handle_debug_exception(cpu); | ||
56 | + return true; | ||
57 | + } | ||
58 | } else if (!replay_has_interrupt()) { | ||
59 | /* give a chance to iothread in replay mode */ | ||
60 | *ret = EXCP_INTERRUPT; | ||
61 | -- | ||
62 | 2.25.1 | ||
63 | |||
64 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | When single-stepping with a debugger attached to QEMU, and when an | ||
2 | interrupt is raised, the debugger misses the first instruction after | ||
3 | the interrupt. | ||
4 | 1 | ||
5 | Tested-by: Luc Michel <luc.michel@greensocs.com> | ||
6 | Reviewed-by: Luc Michel <luc.michel@greensocs.com> | ||
7 | Buglink: https://bugs.launchpad.net/qemu/+bug/757702 | ||
8 | Message-Id: <20200717163029.2737546-1-richard.henderson@linaro.org> | ||
9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | --- | ||
11 | accel/tcg/cpu-exec.c | 8 +++++++- | ||
12 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/accel/tcg/cpu-exec.c | ||
17 | +++ b/accel/tcg/cpu-exec.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static inline bool cpu_handle_interrupt(CPUState *cpu, | ||
19 | else { | ||
20 | if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { | ||
21 | replay_interrupt(); | ||
22 | - cpu->exception_index = -1; | ||
23 | + /* | ||
24 | + * After processing the interrupt, ensure an EXCP_DEBUG is | ||
25 | + * raised when single-stepping so that GDB doesn't miss the | ||
26 | + * next instruction. | ||
27 | + */ | ||
28 | + cpu->exception_index = | ||
29 | + (cpu->singlestep_enabled ? EXCP_DEBUG : -1); | ||
30 | *last_tb = NULL; | ||
31 | } | ||
32 | /* The target hook may have updated the 'cpu->interrupt_request'; | ||
33 | -- | ||
34 | 2.25.1 | ||
35 | |||
36 | diff view generated by jsdifflib |