1 | Just one patch, but should make stable 2.10.1 this week. | 1 | The following changes since commit 3e9f48bcdabe57f8f90cf19f01bbbf3c86937267: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20210511' into staging (2021-05-12 17:31:52 +0100) | ||
3 | 4 | ||
4 | r~ | 5 | are available in the Git repository at: |
5 | 6 | ||
7 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20210513 | ||
6 | 8 | ||
7 | The following changes since commit 460b6c8e581aa06b86f59eebd9e52edfe7adf417: | 9 | for you to fetch changes up to 9bcf4c52f801966b10f802e65c3ecc8bbbd8c660: |
8 | 10 | ||
9 | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-09-23 12:55:40 +0100) | 11 | tcg: Add tcg_constant_tl (2021-05-13 05:42:44 -0500) |
10 | |||
11 | are available in the git repository at: | ||
12 | |||
13 | git://github.com/rth7680/qemu.git tags/pull-tcg-20170925 | ||
14 | |||
15 | for you to fetch changes up to 8b81253332b5a3f3c67b6462f39caef47a00dd29: | ||
16 | |||
17 | accel/tcg/cputlb: avoid recursive BQL (fixes #1706296) (2017-09-25 11:23:30 -0700) | ||
18 | 12 | ||
19 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
20 | BQL bug fix | 14 | Minor gen-icount.h fix. |
15 | BSD cpu_signal_handler fix. | ||
16 | Add missing tcg_constant_tl symbol. | ||
21 | 17 | ||
22 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
23 | Alex Bennée (1): | 19 | Matheus Ferst (1): |
24 | accel/tcg/cputlb: avoid recursive BQL (fixes #1706296) | 20 | tcg: Add tcg_constant_tl |
25 | 21 | ||
26 | accel/tcg/cputlb.c | 4 ++-- | 22 | Philippe Mathieu-Daudé (2): |
27 | 1 file changed, 2 insertions(+), 2 deletions(-) | 23 | MAINTAINERS: Add include/exec/gen-icount.h to 'Main Loop' section |
24 | exec/gen-icount.h: Add missing "exec/exec-all.h" include | ||
28 | 25 | ||
26 | Warner Losh (1): | ||
27 | tcg: Use correct trap number for page faults on *BSD systems | ||
28 | |||
29 | include/exec/gen-icount.h | 1 + | ||
30 | include/tcg/tcg-op.h | 2 ++ | ||
31 | accel/tcg/user-exec.c | 14 ++++++++++++-- | ||
32 | MAINTAINERS | 1 + | ||
33 | 4 files changed, 16 insertions(+), 2 deletions(-) | ||
34 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | As the 'Main Loop' section covers softmmu/icount.c, | ||
4 | add "exec/gen-icount.h" there too. | ||
5 | |||
6 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Message-Id: <20210422064128.2318616-2-f4bug@amsat.org> | ||
8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | --- | ||
10 | MAINTAINERS | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/MAINTAINERS | ||
16 | +++ b/MAINTAINERS | ||
17 | @@ -XXX,XX +XXX,XX @@ F: ui/cocoa.m | ||
18 | Main loop | ||
19 | M: Paolo Bonzini <pbonzini@redhat.com> | ||
20 | S: Maintained | ||
21 | +F: include/exec/gen-icount.h | ||
22 | F: include/qemu/main-loop.h | ||
23 | F: include/sysemu/runstate.h | ||
24 | F: include/sysemu/runstate-action.h | ||
25 | -- | ||
26 | 2.25.1 | ||
27 | |||
28 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | When including "exec/gen-icount.h" we get: | ||
4 | |||
5 | include/exec/gen-icount.h: In function ‘gen_tb_start’: | ||
6 | include/exec/gen-icount.h:40:9: error: implicit declaration of function ‘tb_cflags’ [-Werror=implicit-function-declaration] | ||
7 | 40 | if (tb_cflags(tb) & CF_USE_ICOUNT) { | ||
8 | | ^~~~~~~~~ | ||
9 | include/exec/gen-icount.h:40:9: error: nested extern declaration of ‘tb_cflags’ [-Werror=nested-externs] | ||
10 | include/exec/gen-icount.h:40:25: error: ‘CF_USE_ICOUNT’ undeclared (first use in this function); did you mean ‘CPU_COUNT’? | ||
11 | 40 | if (tb_cflags(tb) & CF_USE_ICOUNT) { | ||
12 | | ^~~~~~~~~~~~~ | ||
13 | | CPU_COUNT | ||
14 | |||
15 | Since tb_cflags() is declared in "exec/exec-all.h", include this | ||
16 | header in "exec/gen-icount.h". | ||
17 | |||
18 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
19 | Message-Id: <20210422064128.2318616-3-f4bug@amsat.org> | ||
20 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
21 | --- | ||
22 | include/exec/gen-icount.h | 1 + | ||
23 | 1 file changed, 1 insertion(+) | ||
24 | |||
25 | diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/include/exec/gen-icount.h | ||
28 | +++ b/include/exec/gen-icount.h | ||
29 | @@ -XXX,XX +XXX,XX @@ | ||
30 | #ifndef GEN_ICOUNT_H | ||
31 | #define GEN_ICOUNT_H | ||
32 | |||
33 | +#include "exec/exec-all.h" | ||
34 | #include "qemu/timer.h" | ||
35 | |||
36 | /* Helpers for instruction counting code generation. */ | ||
37 | -- | ||
38 | 2.25.1 | ||
39 | |||
40 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Warner Losh <imp@bsdimp.com> | ||
1 | 2 | ||
3 | The trap number for a page fault on BSD systems is T_PAGEFLT not 0xe. 0xe is | ||
4 | used by Linux and represents the intel hardware trap vector. The BSD kernels, | ||
5 | however, translate this to T_PAGEFLT in their Xpage, Xtrap0e, Xtrap14, etc fault | ||
6 | handlers. This is true for i386 and x86_64, though the name of the trap hanlder | ||
7 | can very on the flavor of BSD. As far as I can tell, Linux doesn't provide a | ||
8 | define for this value. Invent a new one (PAGE_FAULT_TRAP) and use it instead to | ||
9 | avoid uglier ifdefs. | ||
10 | |||
11 | Signed-off-by: Mark Johnston <markj@FreeBSD.org> | ||
12 | Signed-off-by: Juergen Lock <nox@FreeBSD.org> | ||
13 | [ Rework to avoid ifdefs and expand it to i386 ] | ||
14 | Signed-off-by: Warner Losh <imp@bsdimp.com> | ||
15 | Message-Id: <20210506173826.72832-1-imp@bsdimp.com> | ||
16 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
17 | --- | ||
18 | accel/tcg/user-exec.c | 14 ++++++++++++-- | ||
19 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/accel/tcg/user-exec.c | ||
24 | +++ b/accel/tcg/user-exec.c | ||
25 | @@ -XXX,XX +XXX,XX @@ void *probe_access(CPUArchState *env, target_ulong addr, int size, | ||
26 | #define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) | ||
27 | #define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) | ||
28 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
29 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
30 | #elif defined(__FreeBSD__) || defined(__DragonFly__) | ||
31 | #include <ucontext.h> | ||
32 | |||
33 | @@ -XXX,XX +XXX,XX @@ void *probe_access(CPUArchState *env, target_ulong addr, int size, | ||
34 | #define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) | ||
35 | #define ERROR_sig(context) ((context)->uc_mcontext.mc_err) | ||
36 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
37 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
38 | #elif defined(__OpenBSD__) | ||
39 | #define EIP_sig(context) ((context)->sc_eip) | ||
40 | #define TRAP_sig(context) ((context)->sc_trapno) | ||
41 | #define ERROR_sig(context) ((context)->sc_err) | ||
42 | #define MASK_sig(context) ((context)->sc_mask) | ||
43 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
44 | #else | ||
45 | #define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP]) | ||
46 | #define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) | ||
47 | #define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) | ||
48 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
49 | +#define PAGE_FAULT_TRAP 0xe | ||
50 | #endif | ||
51 | |||
52 | int cpu_signal_handler(int host_signum, void *pinfo, | ||
53 | @@ -XXX,XX +XXX,XX @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
54 | pc = EIP_sig(uc); | ||
55 | trapno = TRAP_sig(uc); | ||
56 | return handle_cpu_signal(pc, info, | ||
57 | - trapno == 0xe ? (ERROR_sig(uc) >> 1) & 1 : 0, | ||
58 | + trapno == PAGE_FAULT_TRAP ? | ||
59 | + (ERROR_sig(uc) >> 1) & 1 : 0, | ||
60 | &MASK_sig(uc)); | ||
61 | } | ||
62 | |||
63 | @@ -XXX,XX +XXX,XX @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
64 | #define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) | ||
65 | #define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) | ||
66 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
67 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
68 | #elif defined(__OpenBSD__) | ||
69 | #define PC_sig(context) ((context)->sc_rip) | ||
70 | #define TRAP_sig(context) ((context)->sc_trapno) | ||
71 | #define ERROR_sig(context) ((context)->sc_err) | ||
72 | #define MASK_sig(context) ((context)->sc_mask) | ||
73 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
74 | #elif defined(__FreeBSD__) || defined(__DragonFly__) | ||
75 | #include <ucontext.h> | ||
76 | |||
77 | @@ -XXX,XX +XXX,XX @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
78 | #define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) | ||
79 | #define ERROR_sig(context) ((context)->uc_mcontext.mc_err) | ||
80 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
81 | +#define PAGE_FAULT_TRAP T_PAGEFLT | ||
82 | #else | ||
83 | #define PC_sig(context) ((context)->uc_mcontext.gregs[REG_RIP]) | ||
84 | #define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) | ||
85 | #define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) | ||
86 | #define MASK_sig(context) ((context)->uc_sigmask) | ||
87 | +#define PAGE_FAULT_TRAP 0xe | ||
88 | #endif | ||
89 | |||
90 | int cpu_signal_handler(int host_signum, void *pinfo, | ||
91 | @@ -XXX,XX +XXX,XX @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
92 | |||
93 | pc = PC_sig(uc); | ||
94 | return handle_cpu_signal(pc, info, | ||
95 | - TRAP_sig(uc) == 0xe ? (ERROR_sig(uc) >> 1) & 1 : 0, | ||
96 | + TRAP_sig(uc) == PAGE_FAULT_TRAP ? | ||
97 | + (ERROR_sig(uc) >> 1) & 1 : 0, | ||
98 | &MASK_sig(uc)); | ||
99 | } | ||
100 | |||
101 | -- | ||
102 | 2.25.1 | ||
103 | |||
104 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Matheus Ferst <matheus.ferst@eldorado.org.br> |
---|---|---|---|
2 | 2 | ||
3 | The mmio path (see exec.c:prepare_mmio_access) already protects itself | 3 | Used in ppc D/DS/X-form load/store implementation. |
4 | against recursive locking and it makes sense to do the same for | ||
5 | io_readx/writex. Otherwise any helper running in the BQL context will | ||
6 | assert when it attempts to write to device memory as in the case of | ||
7 | the bug report. | ||
8 | 4 | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> |
10 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 6 | Message-Id: <20210512185441.3619828-24-matheus.ferst@eldorado.org.br> |
11 | CC: Richard Jones <rjones@redhat.com> | ||
12 | CC: Paolo Bonzini <bonzini@gnu.org> | ||
13 | CC: qemu-stable@nongnu.org | ||
14 | Message-Id: <20170921110625.9500-1-alex.bennee@linaro.org> | ||
15 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
16 | --- | 8 | --- |
17 | accel/tcg/cputlb.c | 4 ++-- | 9 | include/tcg/tcg-op.h | 2 ++ |
18 | 1 file changed, 2 insertions(+), 2 deletions(-) | 10 | 1 file changed, 2 insertions(+) |
19 | 11 | ||
20 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c | 12 | diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h |
21 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/accel/tcg/cputlb.c | 14 | --- a/include/tcg/tcg-op.h |
23 | +++ b/accel/tcg/cputlb.c | 15 | +++ b/include/tcg/tcg-op.h |
24 | @@ -XXX,XX +XXX,XX @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, | 16 | @@ -XXX,XX +XXX,XX @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t); |
25 | 17 | #define tcg_gen_sextract_tl tcg_gen_sextract_i64 | |
26 | cpu->mem_io_vaddr = addr; | 18 | #define tcg_gen_extract2_tl tcg_gen_extract2_i64 |
27 | 19 | #define tcg_const_tl tcg_const_i64 | |
28 | - if (mr->global_locking) { | 20 | +#define tcg_constant_tl tcg_constant_i64 |
29 | + if (mr->global_locking && !qemu_mutex_iothread_locked()) { | 21 | #define tcg_const_local_tl tcg_const_local_i64 |
30 | qemu_mutex_lock_iothread(); | 22 | #define tcg_gen_movcond_tl tcg_gen_movcond_i64 |
31 | locked = true; | 23 | #define tcg_gen_add2_tl tcg_gen_add2_i64 |
32 | } | 24 | @@ -XXX,XX +XXX,XX @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t); |
33 | @@ -XXX,XX +XXX,XX @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, | 25 | #define tcg_gen_sextract_tl tcg_gen_sextract_i32 |
34 | cpu->mem_io_vaddr = addr; | 26 | #define tcg_gen_extract2_tl tcg_gen_extract2_i32 |
35 | cpu->mem_io_pc = retaddr; | 27 | #define tcg_const_tl tcg_const_i32 |
36 | 28 | +#define tcg_constant_tl tcg_constant_i32 | |
37 | - if (mr->global_locking) { | 29 | #define tcg_const_local_tl tcg_const_local_i32 |
38 | + if (mr->global_locking && !qemu_mutex_iothread_locked()) { | 30 | #define tcg_gen_movcond_tl tcg_gen_movcond_i32 |
39 | qemu_mutex_lock_iothread(); | 31 | #define tcg_gen_add2_tl tcg_gen_add2_i32 |
40 | locked = true; | ||
41 | } | ||
42 | -- | 32 | -- |
43 | 2.13.5 | 33 | 2.25.1 |
44 | 34 | ||
45 | 35 | diff view generated by jsdifflib |