[Qemu-devel] [RFC 09/48] tcg: reset runtime helpers when flushing the code cache

2018-10-25 Thread Emilio G. Cota
In preparation for adding plugin support. One of the clean-up actions when uninstalling plugins will be to flush the code cache. We'll also have to clear the runtime helpers, since some of those runtime helpers may belong to the plugin being uninstalled. Signed-off-by: Emilio G. Cota ---

[Qemu-devel] [RFC 11/48] atomic_template: fix indentation in GEN_ATOMIC_HELPER

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/atomic_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index efde12fdb2..8d177fefef 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h

[Qemu-devel] [RFC 43/48] linux-user: support -plugin option

2018-10-25 Thread Emilio G. Cota
From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota --- linux-user/main.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 923cbb753a..0244ad736c 100644 --- a/linux

[Qemu-devel] [RFC 04/48] exec: introduce qemu_xxhash{2,4,5,6,7}

2018-10-25 Thread Emilio G. Cota
Before moving them all to include/qemu/xxhash.h. Signed-off-by: Emilio G. Cota --- include/exec/tb-hash-xx.h | 41 +-- include/exec/tb-hash.h| 2 +- tests/qht-bench.c | 2 +- util/qsp.c| 12 ++-- 4 files changed, 39

[Qemu-devel] [RFC 19/48] translate-all: notify plugin code of tb_flush

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/translate-all.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 3423cf74db..1690e3fd5b 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1233,6 +1233,8

[Qemu-devel] [RFC 03/48] tcg/README: fix typo s/afterwise/afterwards/

2018-10-25 Thread Emilio G. Cota
Afterwise is "wise after the fact", as in "hindsight". Here we meant "afterwards" (as in "subsequently"). Fix it. Signed-off-by: Emilio G. Cota --- tcg/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/README b/tcg/README i

[Qemu-devel] [RFC 39/48] plugin: add API symbols to qemu-plugins.symbols

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- qemu-plugins.symbols | 32 1 file changed, 32 insertions(+) create mode 100644 qemu-plugins.symbols diff --git a/qemu-plugins.symbols b/qemu-plugins.symbols new file mode 100644 index 00..76a57e62bb --- /dev/null +++ b

[Qemu-devel] [RFC 06/48] tcg: use QHT for helper_table

2018-10-25 Thread Emilio G. Cota
This will allow us to add TCG helpers at run-time. While at it, rename tcg_find_helper to tcg_helper_find for consistency with the added tcg_helper_foo functions. Signed-off-by: Emilio G. Cota --- tcg/tcg.c | 59 +-- 1 file changed, 49

[Qemu-devel] [RFC 13/48] xxhash: add qemu_xxhash8

2018-10-25 Thread Emilio G. Cota
It will be used for TB hashing soon. Signed-off-by: Emilio G. Cota --- include/qemu/xxhash.h | 40 +++- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index fe35dde328..450427eeaa 100644 --- a

[Qemu-devel] [RFC 15/48] plugin: add core code

2018-10-25 Thread Emilio G. Cota
might be considered instrumentation, even if currently my goal is to use them for that purpose. Signed-off-by: Emilio G. Cota --- Makefile | 7 +- Makefile.target | 2 + include/qemu/plugin.h | 239 ++ include/qom/cpu.h |

[Qemu-devel] [RFC 24/48] translator: add .ctx_base_offset and .ctx_size to TranslatorOps

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/translator.h | 4 1 file changed, 4 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index a28147b3dd..e20ca9f854 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -106,6 +106,8

[Qemu-devel] [RFC 07/48] tcg: export TCGHelperInfo

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 7 +++ tcg/tcg.c | 7 --- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index f4efbaa680..9f9643b470 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -480,6 +480,13 @@ typedef TCGv_ptr TCGv_env; /* Used to

[Qemu-devel] [RFC 25/48] target/arm: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/arm/translate-a64.c | 8 ++-- target/arm/translate.c | 25 + 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8b1e20dd59..dab5f6efd3 100644 --- a

[Qemu-devel] [RFC 01/48] cpu: introduce run_on_cpu_no_bql

2018-10-25 Thread Emilio G. Cota
This allows us to queue synchronous CPU work without the BQL. Will gain a user soon. Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 13 + cpus-common.c | 28 ++-- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/include/qom/cpu.h b

[Qemu-devel] [RFC 46/48] plugin: add plugin-chan PCI device

2018-10-25 Thread Emilio G. Cota
This will allow communication between guest and plugins. Signed-off-by: Emilio G. Cota --- Makefile.target | 2 + include/hw/pci/pci.h| 2 + include/qemu/plugin.h | 1 + hw/plugin/plugin-chan.c | 136 plugin.c| 4

[Qemu-devel] [RFC 10/48] exec: export do_tb_flush

2018-10-25 Thread Emilio G. Cota
This will be used by plugin code to flush the code cache as well as doing other bookkeeping in a safe work environment. Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 1 + accel/tcg/translate-all.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec

[Qemu-devel] [RFC 16/48] tcg: add plugin_mask to TB hash

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 2 ++ include/exec/tb-hash.h| 6 -- include/exec/tb-lookup.h | 1 + accel/tcg/cpu-exec.c | 6 +- accel/tcg/translate-all.c | 6 -- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/exec/exec

[Qemu-devel] [RFC 21/48] *-user: plugin syscalls

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- bsd-user/syscall.c | 9 + linux-user/syscall.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index b7818af450..4993f81b2b 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -323,6 +323,8

[Qemu-devel] [RFC 47/48] plugin: support guest hooks

2018-10-25 Thread Emilio G. Cota
r this, but that is painful to maintain across ISAs. Instead, we use plugin-chan PCI device through which we can relay guest messages to the host. Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 6 ++ include/qemu/plugin.h | 2 ++ plugin.c | 13 +

[Qemu-devel] [RFC 33/48] target/riscv: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/riscv/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index a33cf6802b..6f5be8e7d7 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1851,6 +1851,7 @@ static

[Qemu-devel] [RFC 38/48] translator: implement 2-pass translation

2018-10-25 Thread Emilio G. Cota
The second pass only occurs when a plugin has subscribed to TB translation events. Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 8 accel/tcg/translator.c | 91 +- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/tcg

[Qemu-devel] [RFC 18/48] tcg: add memory callbacks for plugins (WIP)

2018-10-25 Thread Emilio G. Cota
#x27;s a bit tedious because there are many places to update, but it's fairly simple. However, note that cross-page accesses are tricky, since the access might be to non-contiguous host addresses. So I'm punting on that and just passing NULL. Signed-off-by: Emilio G. Cota --

[Qemu-devel] [RFC 48/48] plugin: add a couple of very simple examples

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- plugin-examples/bbcount_avgsize_racy.c | 50 ++ plugin-examples/mem_count_racy_both.c | 58 ++ plugin-examples/Makefile | 31 ++ 3 files changed, 139 insertions(+) create mode 100644 plugin

[Qemu-devel] [RFC 17/48] plugin-gen: add TCG code generation helpers

2018-10-25 Thread Emilio G. Cota
address to memory callbacks. Most of this is implemented in a later patch though. - Instrumentation of memory accesses performed from helpers. See comment. Signed-off-by: Emilio G. Cota --- include/exec/plugin-gen.h | 51 + accel/tcg/plugin-gen.

[Qemu-devel] [RFC 14/48] plugin: preliminary user-facing API

2018-10-25 Thread Emilio G. Cota
Add the API first to ease review. Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 227 ++ 1 file changed, 227 insertions(+) create mode 100644 include/qemu/plugin-api.h diff --git a/include/qemu/plugin-api.h b/include/qemu/plugin-api.h new

[Qemu-devel] [RFC 22/48] cpu: hook plugin vcpu events

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- cpus.c| 10 ++ exec.c| 2 ++ qom/cpu.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/cpus.c b/cpus.c index 28e39f045a..3efe89354d 100644 --- a/cpus.c +++ b/cpus.c @@ -43,6 +43,7 @@ #include "exec/exec-all.h" #inc

[Qemu-devel] [RFC 41/48] configure: add --enable-plugins

2018-10-25 Thread Emilio G. Cota
tems but I suspect adding support for those should be pretty easy. Signed-off-by: Emilio G. Cota --- configure | 51 +++ 1 file changed, 51 insertions(+) diff --git a/configure b/configure index 03bf719ca7..78e86098e5 100755 --- a/configure +++ b

[Qemu-devel] [RFC 26/48] target/ppc: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/ppc/translate.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 34c3ed0a41..88f88adaff 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -7565,6 +7565,9 @@ static void

[Qemu-devel] [RFC 23/48] translator: add plugin_insn argument to translate_insn

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/translator.h | 4 +++- accel/tcg/translator.c | 4 ++-- target/alpha/translate.c| 3 ++- target/arm/translate-a64.c | 3 ++- target/arm/translate.c | 6 -- target/hppa/translate.c | 3 ++- target/i386/translate.c | 3

[Qemu-devel] [RFC 32/48] target/alpha: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/alpha/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 72a302e102..21405df2b8 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -2990,6 +2990,7 @@ static

[Qemu-devel] [RFC 42/48] vl: support -plugin option

2018-10-25 Thread Emilio G. Cota
From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota --- vl.c| 11 +++ qemu-options.hx | 17 + 2 files changed, 28 insertions(+) diff --git a/vl.c b/vl.c index 4e25c78bff..ebb188552e 100644 --- a

[Qemu-devel] [RFC 35/48] target/sparc: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/sparc/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 2fa8b68e0a..74889de426 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5902,6 +5902,7 @@ static

[Qemu-devel] [RFC 40/48] plugin: let plugins control the virtual clock

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 9 + include/qemu/plugin.h | 5 +++ plugin.c | 79 +++ stubs/plugin.c| 9 + util/qemu-timer.c | 3 ++ qemu-plugins.symbols | 1 + stubs

[Qemu-devel] [RFC 30/48] target/m68k: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/m68k/translate.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index dd7d868b25..9b5a4b1eb5 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -116,6 +116,7

[Qemu-devel] [RFC 28/48] target/i386: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/translate.c | 35 --- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 86e59d7bf7..1d7b20bce3 100644 --- a/target/i386/translate.c +++ b/target/i386

[Qemu-devel] [RFC 45/48] plugin: lockstep execution support

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 7 +++ include/qemu/plugin.h | 5 + cpus.c| 1 + plugin.c | 35 +++ qemu-plugins.symbols | 3 +++ 5 files changed, 51 insertions(+) diff --git

[Qemu-devel] [RFC 27/48] target/sh4: prepare for 2-pass translation (WIP)

2018-10-25 Thread Emilio G. Cota
XXX: cleanly get the gUSA instructions Signed-off-by: Emilio G. Cota --- target/sh4/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index ea88d46c04..a3b0fb46a2 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c

[Qemu-devel] [RFC 29/48] target/hppa: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/hppa/translate.c | 4 1 file changed, 4 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6c2a7fbc46..08ebbeb21c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4757,6 +4757,8 @@ static void

[Qemu-devel] [RFC 34/48] target/s390x: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/s390x/translate.c | 49 ++-- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 6ac1a8d821..0c41e0d83a 100644 --- a/target/s390x/translate.c +++ b

[Qemu-devel] [RFC 37/48] target/openrisc: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/openrisc/translate.c | 4 1 file changed, 4 insertions(+) diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 947330e10a..2f084668f9 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1308,6

[Qemu-devel] [RFC 36/48] target/xtensa: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/xtensa/translate.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 14ab1c5ceb..83711f2a18 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c

[Qemu-devel] [RFC 31/48] target/mips: prepare for 2-pass translation (WIP)

2018-10-25 Thread Emilio G. Cota
XXX: fill in plugin_insn Signed-off-by: Emilio G. Cota --- target/mips/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index efafc6e795..46ed40cf8f 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -25455,6

[Qemu-devel] [RFC 44/48] cpus: lockstep execution support

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 27 +++ cpus.c| 113 +- 2 files changed, 139 insertions(+), 1 deletion(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 1ac56fe84b..5841421a20 100644 --- a/include

[Qemu-devel] [RFC v4 00/71] per-CPU locks

2018-10-25 Thread Emilio G. Cota
[I forgot to add the cover letter to git send-email; here it is] v3: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg04179.html "Why is this an RFC?" See v3 link above. Also, see comment at the bottom of this message regarding the last patch of this series. Changes since v3: - Add R-b'

[Qemu-devel] [RFC v4 02/71] cpu: rename cpu->work_mutex to cpu->lock

2018-10-25 Thread Emilio G. Cota
This lock will soon protect more fields of the struct. Give it a more appropriate name. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 5 +++-- cpus-common.c | 14 +++--- cpus.c| 4 ++-- qom/cpu.c | 2 +- 4 files changed

[Qemu-devel] [RFC v4 11/71] m68k: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Cc: Laurent Vivier Signed-off-by: Emilio G. Cota --- target/m68k/translate.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index ae3651b867..d55e707cf6 100644 --- a/target/m68k/translate.c +++ b/target/m68k

[Qemu-devel] [RFC v4 32/71] exec: use cpu_reset_interrupt

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 4fd831ef06..cd171adb93 100644 --- a/exec.c +++ b/exec.c @@ -776,7 +776,7 @@ static int cpu_common_post_load(void *opaque, int version_id) /* 0x01 was

[Qemu-devel] [RFC v4 39/71] i386/hax-all: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/hax-all.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 8b53a9708f..70cea8b1a1 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c

[Qemu-devel] [RFC v4 03/71] cpu: introduce cpu_mutex_lock/unlock

2018-10-25 Thread Emilio G. Cota
The few direct users of &cpu->lock will be converted soon. Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 33 +++ cpus.c | 48 +++-- stubs/cpu-lock.c| 20 +++ stubs/Makefile.ob

[Qemu-devel] [RFC v4 30/71] cpu: define cpu_interrupt_request helpers

2018-10-25 Thread Emilio G. Cota
s complete, cpu_interrupt_request will be simple again. Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 37 + qom/cpu.c | 27 +-- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index

[Qemu-devel] [RFC v4 12/71] alpha: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/alpha/translate.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index e5d62850c5..25cd95931d 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -1226,8

[Qemu-devel] [RFC v4 20/71] lm32: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Michael Walle Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/lm32/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c index 234d55e056..392634441b 100644 --- a/target/lm32/op_helper.c

[Qemu-devel] [RFC v4 01/71] cpu: convert queued work to a QSIMPLEQ

2018-10-25 Thread Emilio G. Cota
Instead of open-coding it. While at it, make sure that all accesses to the list are performed while holding the list's lock. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 6 +++--- cpus-common.c | 25 - cpus.c

[Qemu-devel] [RFC v4 07/71] tcg-runtime: define helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/tcg-runtime.h | 2 ++ accel/tcg/tcg-runtime.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/accel/tcg/tcg-runtime.h b/accel/tcg/tcg-runtime.h index 1bd39d136d..d767f8515b 100644 --- a/accel/tcg/tcg-runtime.h +++ b/accel/tcg/tcg-runtime.h

[Qemu-devel] [RFC v4 10/71] hppa: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/hppa/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ce05d5619d..df9179e70f 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2845,8 +2845,7

[Qemu-devel] [RFC v4 22/71] mips: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- hw/mips/cps.c | 2 +- hw/misc/mips_itu.c | 4 ++-- target/mips/kvm.c | 2 +- target/mips/op_helper.c | 8 target/mips/translate.c | 4

[Qemu-devel] [RFC v4 04/71] cpu: make qemu_work_cond per-cpu

2018-10-25 Thread Emilio G. Cota
This eliminates the need to use the BQL to queue CPU work. While at it, give the per-cpu field a generic name ("cond") since it will soon be used for more than just queueing CPU work. Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 6 ++-- cpus-common.

[Qemu-devel] [RFC v4 14/71] cpu: define cpu_halted helpers

2018-10-25 Thread Emilio G. Cota
cpu->halted will soon be protected by cpu->lock. We will use these helpers to ease the transition, since right now cpu->halted has many direct callers. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 24 1 file ch

[Qemu-devel] [RFC v4 17/71] ppc: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/ppc/helper_regs.h| 2 +- hw/ppc/e500.c | 4 ++-- hw/ppc/ppc.c| 10 +- hw/ppc/ppce500_spin.c | 6 -- hw/ppc/spapr_cpu_core.

[Qemu-devel] [RFC v4 05/71] cpu: move run_on_cpu to cpus-common

2018-10-25 Thread Emilio G. Cota
We don't pass a pointer to qemu_global_mutex anymore. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 10 -- cpus-common.c | 2 +- cpus.c| 5 - 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/include/qom/cp

[Qemu-devel] [RFC v4 13/71] microblaze: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Cc: "Edgar E. Iglesias" Signed-off-by: Emilio G. Cota --- target/microblaze/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 78ca265b04..008b84d456 100644 --- a/target/microblaze/t

[Qemu-devel] [RFC v4 06/71] cpu: introduce process_queued_cpu_work_locked

2018-10-25 Thread Emilio G. Cota
This completes the conversion to cpu_mutex_lock/unlock in the file. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- cpus-common.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cpus-common.c b/cpus-common.c index 3fccee5585..c2ad554d54

[Qemu-devel] [RFC v4 37/71] i386: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/cpu.c| 2 +- target/i386/helper.c | 4 ++-- target/i386/svm_helper.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b91d80af0a..9eaf3274b2 100644 --- a/target/i386

[Qemu-devel] [RFC v4 08/71] ppc: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/ppc/translate.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 4e59dd5f42..2d31b5f7a1 100644 --- a/target/ppc

[Qemu-devel] [RFC v4 19/71] i386: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Eduardo Habkost Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 2 +- target/i386/hax-all.c | 4 ++-- target/i386/helper.c | 4 ++-- target/i386/hvf/hvf.c | 8 target/i386/hvf/x86hvf.c

[Qemu-devel] [RFC v4 38/71] i386/kvm: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/kvm.c | 54 +++ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index effaf87f01..f4b96d6963 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c

[Qemu-devel] [RFC v4 09/71] cris: convert to helper_cpu_halted_set

2018-10-25 Thread Emilio G. Cota
And fix the temp leak along the way. Cc: "Edgar E. Iglesias" Signed-off-by: Emilio G. Cota --- target/cris/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 4ae1c04daf..0ccb65fbed 100644 --

[Qemu-devel] [RFC v4 23/71] riscv: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Michael Clark Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Emilio G. Cota --- target/riscv/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/op_helper.c b/target

[Qemu-devel] [RFC v4 25/71] sparc: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 8 hw/sparc64/sparc64.c | 4 ++-- target/sparc/helper.c | 2 +- 4 files changed, 8 insertions(+), 8

[Qemu-devel] [RFC v4 27/71] gdbstub: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index c8478de8f5..a5ff50d9e7 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1305,7 +1305,7 @@ static int gdb_handle_packet(GDBState *s

[Qemu-devel] [RFC v4 26/71] xtensa: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Max Filippov Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c| 2 +- target/xtensa/op_helper.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index

[Qemu-devel] [RFC v4 21/71] m68k: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/m68k/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 8d09ed91c4..61ba1a6dec 100644 --- a/target/m68k/op_helper.c

[Qemu-devel] [RFC v4 15/71] tcg-runtime: convert to cpu_halted_set

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/tcg-runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 4aa038465f..70e3c9de71 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -172,5 +172,5 @@ void

[Qemu-devel] [RFC v4 28/71] openrisc: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Stafford Horne Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/openrisc/sys_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index b66a45c1e0..ab4d8fb520 100644 --- a/target

[Qemu-devel] [RFC v4 35/71] openrisc: use cpu_reset_interrupt

2018-10-25 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Stafford Horne Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/openrisc/sys_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/openrisc

[Qemu-devel] [RFC v4 24/71] s390x: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- hw/intc/s390_flic.c| 2 +- target/s390x/cpu.c | 18 +++--- target/s390x/excp_helper.c

[Qemu-devel] [RFC v4 44/71] cris: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: "Edgar E. Iglesias" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/cris/cpu.c| 2 +- target/cris/helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index a23aba2688..3cdba581e6 10

[Qemu-devel] [RFC v4 29/71] cpu-exec: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 870027d435..f37c9b1e94 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -422,14

[Qemu-devel] [RFC v4 41/71] i386/hvf: convert to cpu_request_interrupt

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/hvf/hvf.c| 8 +--- target/i386/hvf/x86hvf.c | 26 +++--- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index fb3b2a26a1..da789117c8 100644 --- a/target/i386

[Qemu-devel] [RFC v4 49/71] nios: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Chris Wulff Cc: Marek Vasut Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/nios2/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index fbfaa2ce26..49a75414d3 100644 --- a/target/nios2/cpu.c +++ b

[Qemu-devel] [RFC v4 48/71] mips: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Signed-off-by: Emilio G. Cota --- target/mips/cpu.c | 7 --- target/mips/kvm.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 497706b669..992d64e796 100644 --- a

[Qemu-devel] [RFC v4 18/71] sh4: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Aurelien Jarno Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/sh4/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index 4f825bae5a..57cc363ccc 100644 --- a/target/sh4/op_helper.c +++ b

[Qemu-devel] [RFC v4 40/71] i386/whpx-all: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/whpx-all.c | 41 - 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 9673bdc219..0d8cfa3a19 100644 --- a/target/i386/whpx-all.c +++ b/target

[Qemu-devel] [RFC v4 52/71] moxie: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Anthony Green Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/moxie/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 8d67eb6727..bad92cfc61 100644 --- a/target/moxie/cpu.c +++ b/target/moxie

[Qemu-devel] [RFC v4 33/71] i386: use cpu_reset_interrupt

2018-10-25 Thread Emilio G. Cota
From: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/i386/hax-all.c| 4 ++-- target/i386/hvf/x86hvf.c | 8 target/i386/kvm.c| 14 +++--- target/i386/seg_helper.c | 13 ++--- target/i386

[Qemu-devel] [RFC v4 16/71] arm: convert to cpu_halted

2018-10-25 Thread Emilio G. Cota
Cc: Andrzej Zaborowski Cc: Peter Maydell Cc: qemu-...@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- hw/arm/omap1.c| 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- target/arm/arm-powerctl.c | 4 ++-- target/arm/cpu.c

[Qemu-devel] [RFC v4 34/71] s390x: use cpu_reset_interrupt

2018-10-25 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Cornelia Huck Cc: Alexander Graf Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/s390x/excp_helper.c | 2

[Qemu-devel] [RFC v4 56/71] microblaze: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: "Edgar E. Iglesias" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/microblaze/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9b546a2c18..206fdd8651 100644 --- a/target/

[Qemu-devel] [RFC v4 51/71] alpha: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/alpha/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index a953897fcc..4e8965fb6c 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -42,10

[Qemu-devel] [RFC v4 43/71] sh4: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Aurelien Jarno Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/sh4/cpu.c| 2 +- target/sh4/helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index b9f393b7c7..58ea212f53 100644 --- a/target/sh4

[Qemu-devel] [RFC v4 45/71] hppa: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/hppa/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 00bf444620..1ab4e62850 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -60,7 +60,7

[Qemu-devel] [RFC v4 47/71] m68k: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/m68k/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 582e3a73b3..99a7eb4340 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c

[Qemu-devel] [RFC v4 46/71] lm32: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Michael Walle Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/lm32/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index b7499cb627..1508bb6199 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c

[Qemu-devel] [RFC v4 54/71] openrisc: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Stafford Horne Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- hw/openrisc/cputimer.c | 2 +- target/openrisc/cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c index 850f88761c..739404e4f5 100644

[Qemu-devel] [RFC v4 31/71] ppc: use cpu_reset_interrupt

2018-10-25 Thread Emilio G. Cota
From: Paolo Bonzini Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Acked-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/ppc/excp_helper.c | 2 +- 1 file changed, 1

[Qemu-devel] [RFC v4 57/71] accel/tcg: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 15 --- accel/tcg/tcg-all.c | 12 +--- accel/tcg/translate-all.c | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f37c9b1e94

[Qemu-devel] [RFC v4 65/71] xtensa: convert to cpu_has_work_with_iothread_lock

2018-10-25 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Max Filippov Signed-off-by: Emilio G. Cota --- target/xtensa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index d4ca35e6cc..5f3b4a70b0 100644 --- a/target/xtensa/cpu.c

[Qemu-devel] [RFC v4 58/71] cpu: call .cpu_has_work with the CPU lock held

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index a86690c7a5..9826cdfa4c 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -84,7 +84,8 @@ struct

[Qemu-devel] [RFC v4 63/71] riscv: convert to cpu_has_work_with_iothread_lock

2018-10-25 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Michael Clark Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Reviewed-by: Palmer Dabbelt Signed-off-by: Emilio G. Cota --- target/riscv/cpu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target

[Qemu-devel] [RFC v4 55/71] unicore32: convert to cpu_interrupt_request

2018-10-25 Thread Emilio G. Cota
Cc: Guan Xuetao Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/unicore32/cpu.c | 2 +- target/unicore32/softmmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index 2b49d1ca40..65c5334551

<    1   2   3   4   5   6   7   8   9   10   >