Re: [Qemu-devel] [RFC v3 48/56] ppc: acquire the BQL in cpu_has_work

2018-10-18 Thread Paolo Bonzini
On 19/10/2018 03:06, Emilio G. Cota wrote: > Soon we will call cpu_has_work without the BQL. > > Cc: David Gibson > Cc: Alexander Graf > Cc: qemu-...@nongnu.org > Signed-off-by: Emilio G. Cota > --- > target/ppc/translate_init.inc.c | 77 +++-- > 1 file changed, 73

Re: [Qemu-devel] [PATCH v4 30/38] spice: Clean up error reporting in add_channel()

2018-10-18 Thread Gerd Hoffmann
On Wed, Oct 17, 2018 at 10:26:54AM +0200, Markus Armbruster wrote: > Calling error_report() in a function that takes an Error ** argument > is suspicious. add_channel() does that, and then exit()s. Its caller > main(), via qemu_opts_foreach(), is fine with it, but clean it up > anyway. > > Cc: G

Re: [Qemu-devel] [PATCH v4 27/38] vnc: Clean up error reporting in vnc_init_func()

2018-10-18 Thread Gerd Hoffmann
On Wed, Oct 17, 2018 at 10:26:51AM +0200, Markus Armbruster wrote: > Calling error_report() in a function that takes an Error ** argument > is suspicious. vnc_init_func() does that, and then fails without > setting an error. Its caller main(), via qemu_opts_foreach(), is fine > with it, but clean

Re: [Qemu-devel] [PATCH v4 26/38] ui: Convert vnc_display_init(), init_keyboard_layout() to Error

2018-10-18 Thread Gerd Hoffmann
On Wed, Oct 17, 2018 at 10:26:50AM +0200, Markus Armbruster wrote: > From: Fei Li > > Signed-off-by: Fei Li > Cc: Gerd Hoffmann > Signed-off-by: Markus Armbruster > Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann

Re: [Qemu-devel] [PATCH v4 25/38] ui/keymaps: Fix handling of erroneous include files

2018-10-18 Thread Gerd Hoffmann
On Wed, Oct 17, 2018 at 10:26:49AM +0200, Markus Armbruster wrote: > While errors in the keyboard layout named with -k are fatal, errors in > included files are reported, but otherwise ignored: > > $ cat worst > include bad > include worse > $ ls -l bad worse > ls: cannot acces

Re: [Qemu-devel] [PATCH v3 4/4] Optimize record/replay checkpointing for all clocks it applies to

2018-10-18 Thread Paolo Bonzini
On 19/10/2018 08:30, Artem Pisarenko wrote: >> This is wrong at least for QEMU_CLOCK_HOST. >> … >> Reading the host clock here is not protected by the checkpoint. >> Therefore it may incur the inconsistency when replaying the execution. > > That's why I didn't like idea of this patch and asked for

[Qemu-devel] [Bug 1798659] Re: A typo in trace/simple.c

2018-10-18 Thread Thomas Huth
It's perfect valid C to terminate a statement with "," instead of ";" - it just has a different meaning. Consider this: #include int main() { if (0) printf("Hello!\n"), printf("Good bye!\n"); return 0; } At a first glance, you'd expect this program to print "Good b

Re: [Qemu-devel] [RFC v3 06/56] cpu: introduce process_queued_cpu_work_locked

2018-10-18 Thread Richard Henderson
On 10/18/18 6:05 PM, Emilio G. Cota wrote: > It will gain a user once we protect more of CPUState under cpu->lock. > > This completes the conversion to cpu_mutex_lock/unlock in the file. > > Signed-off-by: Emilio G. Cota > --- > include/qom/cpu.h | 9 + > cpus-common.c | 17 +++

Re: [Qemu-devel] [RFC v3 05/56] cpu: move run_on_cpu to cpus-common

2018-10-18 Thread Richard Henderson
On 10/18/18 6:05 PM, Emilio G. Cota wrote: > We don't pass a pointer to qemu_global_mutex anymore. > > Cc: Peter Crosthwaite > Cc: Richard Henderson > Signed-off-by: Emilio G. Cota > --- > include/qom/cpu.h | 10 -- > cpus-common.c | 2 +- > cpus.c| 5 - > 3 files

Re: [Qemu-devel] [PATCH v3 4/4] Optimize record/replay checkpointing for all clocks it applies to

2018-10-18 Thread Artem Pisarenko
> … > This is wrong at least for QEMU_CLOCK_HOST. > … > Reading the host clock here is not protected by the checkpoint. > Therefore it may incur the inconsistency when replaying the execution. That's why I didn't like idea of this patch and asked for any possible side effects beforehand. So, here

Re: [Qemu-devel] [RFC v3 02/56] cpu: rename cpu->work_mutex to cpu->lock

2018-10-18 Thread Richard Henderson
On 10/18/18 6:05 PM, Emilio G. Cota wrote: > This lock will soon protect more fields of the struct. Give > it a more appropriate name. > > Cc: Peter Crosthwaite > Cc: Richard Henderson > Signed-off-by: Emilio G. Cota > --- > include/qom/cpu.h | 5 +++-- > cpus-common.c | 14 +++---

Re: [Qemu-devel] [RFC v3 01/56] cpu: convert queued work to a QSIMPLEQ

2018-10-18 Thread Richard Henderson
On 10/18/18 6:05 PM, Emilio G. Cota wrote: > Instead of open-coding it. > > While at it, make sure that all accesses to the list are > performed while holding the list's lock. > > Cc: Peter Crosthwaite > Cc: Richard Henderson > Signed-off-by: Emilio G. Cota > --- > include/qom/cpu.h | 6 +++-

Re: [Qemu-devel] [PULL 00/21] tcg patch queue

2018-10-18 Thread Richard Henderson
On 10/18/18 3:34 AM, Peter Maydell wrote: > Hi; I get compile failures, I'm afraid: > > FreeBSD's compiler gives warnings: > In file included from /var/tmp/qemu-test.bVaUEj/accel/tcg/user-exec.c:28: > /var/tmp/qemu-test.bVaUEj/include/qemu/atomic128.h:148:23: warning: > unknown attribute 'error' i

[Qemu-devel] [PULL v2 09/21] cputlb: fix assert_cpu_is_self macro

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Message-Id: <20181009174557.16125-5-c...@braap.org> Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acc

[Qemu-devel] [PULL v2 16/21] target/ppc: Convert to HAVE_CMPXCHG128 and HAVE_ATOMIC128

2018-10-18 Thread Richard Henderson
Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- target/ppc/helper.h | 2 +- target/ppc/mem_helper.c | 33 ++-- target/ppc/translate.c | 115 +--- 3 files changed, 88 insertions(+), 62 deletions(-) diff --git a/target/ppc/helpe

[Qemu-devel] [PULL v2 14/21] target/arm: Convert to HAVE_CMPXCHG128

2018-10-18 Thread Richard Henderson
Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- target/arm/helper-a64.c | 259 +--- 1 file changed, 133 insertions(+), 126 deletions(-) diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index 7f6ad3000b..6e4e1b8a19 100644 --- a/t

Re: [Qemu-devel] [PATCH] vl: Print error when using incorrect backend for debugcon

2018-10-18 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > When using an incorrect backend for the debugcon, QEMU exits silently > without any error indication, which is confusing. > Add a message that the character backend is invalid. > > Signed-off-by: Philippe Mathieu-Daudé Queued, thanks!

[Qemu-devel] [PULL v2 20/21] target/s390x: Check HAVE_ATOMIC128 and HAVE_CMPXCHG128 at translate

2018-10-18 Thread Richard Henderson
Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 40 +++ target/s390x/translate.c | 25 +--- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/target/s390x/mem_helper.c b/target

[Qemu-devel] [PULL v2 11/21] tcg: Add tlb_index and tlb_entry helpers

2018-10-18 Thread Richard Henderson
Isolate the computation of an index from an address into a helper before we change that function. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson [ cota: convert tlb_vaddr_to_host; use atomic_read on addr_write ] Signed-off-by: Emilio G. Cota Message-Id: <20181009175129.17888-2-c...@b

[Qemu-devel] [PULL v2 18/21] target/s390x: Split do_cdsg, do_lpq, do_stpq

2018-10-18 Thread Richard Henderson
Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 128 ++ 1 file changed, 61 insertions(+), 67 deletions(-) diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index e106f61b4e..b5858d2fa2 100644 --

[Qemu-devel] [PULL v2 13/21] target/i386: Convert to HAVE_CMPXCHG128

2018-10-18 Thread Richard Henderson
Reviewed-by: Emilio G. Cota Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/mem_helper.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/i386/mem_helper.c b/target/i386/mem_helper.c index 30c26b9d9c..6cc53bcb40 100644 ---

[Qemu-devel] [PULL v2 12/21] tcg: Split CONFIG_ATOMIC128

2018-10-18 Thread Richard Henderson
GCC7+ will no longer advertise support for 16-byte __atomic operations if only cmpxchg is supported, as for x86_64. Fortunately, x86_64 still has support for __sync_compare_and_swap_16 and we can make use of that. AArch64 does not have, nor ever has had such support, so open-code it. Reviewed-by:

[Qemu-devel] [PULL v2 07/21] target/unicore32: remove tlb_flush from uc32_init_fn

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" As far as I can tell tlb_flush does not need to be called this early. tlb_flush is eventually called after the CPU has been realized. This change paves the way to the introduction of tlb_init, which will be called from cpu_exec_realizefn. Cc: Guan Xuetao Reviewed-by: Ale

[Qemu-devel] [PULL v2 19/21] target/s390x: Skip wout, cout helpers if op helper does not return

2018-10-18 Thread Richard Henderson
When op raises an exception, it may not have initialized the output temps that would be written back by wout or cout. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/translate.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PULL v2 21/21] cputlb: read CPUTLBEntry.addr_write atomically

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" Updates can come from other threads, so readers that do not take tlb_lock must use atomic_read to avoid undefined behaviour (UB). This completes the conversion to tlb_lock. This conversion results on average in no performance loss, as the following experiments (run on an I

[Qemu-devel] [PULL v2 10/21] cputlb: serialize tlb updates with env->tlb_lock

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" Currently we rely on atomic operations for cross-CPU invalidations. There are two cases that these atomics miss: cross-CPU invalidations can race with either (1) vCPU threads flushing their TLB, which happens via memset, or (2) vCPUs calling tlb_reset_dirty on their TLB, wh

[Qemu-devel] [PULL v2 06/21] target/alpha: remove tlb_flush from alpha_cpu_initfn

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" As far as I can tell tlb_flush does not need to be called this early. tlb_flush is eventually called after the CPU has been realized. This change paves the way to the introduction of tlb_init, which will be called from cpu_exec_realizefn. Reviewed-by: Alex Bennée Reviewe

[Qemu-devel] [PULL v2 15/21] target/arm: Check HAVE_CMPXCHG128 at translate time

2018-10-18 Thread Richard Henderson
Reviewed-by: Emilio G. Cota Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/helper-a64.c| 16 target/arm/translate-a64.c | 38 ++ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/target/

[Qemu-devel] [PULL v2 17/21] target/s390x: Convert to HAVE_CMPXCHG128 and HAVE_ATOMIC128

2018-10-18 Thread Richard Henderson
Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 92 +-- 1 file changed, 41 insertions(+), 51 deletions(-) diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index bacae4f503..e106f61b4e 100644 --

[Qemu-devel] [PULL v2 04/21] tcg: plug holes in struct TCGProfile

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" This plugs two 4-byte holes in 64-bit. Signed-off-by: Emilio G. Cota Message-Id: <20181010144853.13005-4-c...@braap.org> Signed-off-by: Richard Henderson --- tcg/tcg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index f9f123

[Qemu-devel] [PULL v2 00/21] tcg patch queue

2018-10-18 Thread Richard Henderson
0100) are available in the Git repository at: https://github.com/rth7680/qemu.git tags/pull-tcg-20181018 for you to fetch changes up to 403f290c0603f35f2d09c982bf5549b6d0803ec1: cputlb: read CPUTLBEntry.addr_write atomically (2018-10-18 19:4

[Qemu-devel] [PULL v2 05/21] tcg: distribute tcg_time into TCG contexts

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" When we implemented per-vCPU TCG contexts, we forgot to also distribute the tcg_time counter, which has remained as a global accessed without any serialization, leading to potentially missed counts. Fix it by distributing the field over the TCG contexts, embedding it into

[Qemu-devel] [PULL v2 08/21] exec: introduce tlb_init

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" Paves the way for the addition of a per-TLB lock. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <20181009174557.16125-4-c...@braap.org> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 8 accel

[Qemu-devel] [PULL v2 03/21] tcg: fix use of uninitialized variable under CONFIG_PROFILER

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" We forgot to initialize n in commit 15fa08f845 ("tcg: Dynamically allocate TCGOps", 2017-12-29). Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota Message-Id: <20181010144853.13005-3-c...@braap.org> Signed-off-by: Richard Henderson --- tcg/tcg.c | 2 +-

[Qemu-devel] [PULL v2 02/21] tcg: access cpu->icount_decr.u16.high with atomics

2018-10-18 Thread Richard Henderson
From: "Emilio G. Cota" Consistently access u16.high with atomics to avoid undefined behaviour in MTTCG. Note that icount_decr.u16.low is only used in icount mode, so regular accesses to it are OK. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <20181010144853.13005-2

[Qemu-devel] [PULL v2 01/21] tcg: Implement CPU_LOG_TB_NOCHAIN during expansion

2018-10-18 Thread Richard Henderson
Rather than test NOCHAIN before linking, do not emit the goto_tb opcode at all. We already do this for goto_ptr. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- tcg/tcg-op.c | 9 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cpu-exe

Re: [Qemu-devel] [PATCH v3 4/4] Optimize record/replay checkpointing for all clocks it applies to

2018-10-18 Thread Pavel Dovgalyuk
> From: Artem Pisarenko [mailto:artem.k.pisare...@gmail.com] > Removes redundant checkpoints in replay log when there are no expired timers > in timers list, > associated with corresponding clock (i.e. no rr events associated with > current clock value). > This also improves performance in rr mod

Re: [Qemu-devel] When it's okay to treat OOM as fatal?

2018-10-18 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> "Dr. David Alan Gilbert" writes: >> >> >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> >> We sometime

Re: [Qemu-devel] [PATCH 0/7] vfio: some trivial fixes

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 07:20, Li Qiang wrote: > This patch set contains some trivial issue such as > QOMConvetion, typo and resources leak in vfio. > > Li Qiang (7): > vfio-pci: make "vfio-pci-nohotplug" as MACRO > vfio: ap-device: make it more QOMConventional > vfio: drop TYPE_FOO MACRO in VMStateDe

Re: [Qemu-devel] [PATCH v3 0/4] Fix and improve core RTC function and documentation

2018-10-18 Thread Artem Pisarenko
> As a start of future refactoring, would you mind moving all this code to > hw/timer/rtc.c or rtc.c? It was somewaht generic before, but now it's > very tied to -rtc. Yes, sure.

Re: [Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 07:20, Li Qiang wrote: > Signed-off-by: Li Qiang > --- > hw/vfio/platform.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c > index ba03dcd..5992fe7 100644 > --- a/hw/vfio/platform.c > +++ b/hw/vfio/platform.c > @

[Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba19143..e9d9e80 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -668,7 +668,7 @@ static void vfio_platform_realize(Devic

[Qemu-devel] [PATCH 6/7] vfio: platform: free timer in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 6a4fd7b..ba19143 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -518,6 +518,7 @@ static int vfio_populate_device(VFIODevice *vbasedev, Erro

[Qemu-devel] [PATCH 1/7] vfio-pci: make "vfio-pci-nohotplug" as MACRO

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8b73582..1f05b57 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -40,6 +40,8 @@ #define TYPE_VFIO_PCI "vfio-pci" #define PCI_VFIO(obj)OBJ

[Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba03dcd..5992fe7 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -72,7 +72,7 @@ static VFIOINTp *vfio_init_intp(VFIODevi

[Qemu-devel] [PATCH 3/7] vfio: drop TYPE_FOO MACRO in VMStateDescription

2018-10-18 Thread Li Qiang
As the vmstate structure names aren't related with the QOM type names. Per Peter's mail: -->https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html Signed-off-by: Li Qiang --- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/ap.c| 2 +- hw/vfio/calxeda-xgmac.c | 2 +- hw/vfio/ccw.

[Qemu-devel] [PATCH 5/7] vfio: platform: cleanup the notifier in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 5992fe7..6a4fd7b 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -80,6 +80,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,

[Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional

2018-10-18 Thread Li Qiang
As the documentation says "use TYPE_FOO constants" This also changes the parent of ap-device's MACRO. Signed-off-by: Li Qiang --- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 12 ++-- include/hw/s390x/ap-device.h | 4 ++-- 3 files changed, 9 insertions(+), 9 dele

[Qemu-devel] [PATCH 0/7] vfio: some trivial fixes

2018-10-18 Thread Li Qiang
This patch set contains some trivial issue such as QOMConvetion, typo and resources leak in vfio. Li Qiang (7): vfio-pci: make "vfio-pci-nohotplug" as MACRO vfio: ap-device: make it more QOMConventional vfio: drop TYPE_FOO MACRO in VMStateDescription vfio: paltform: fix a typo vfio: plat

Re: [Qemu-devel] [PATCH] vl: Print error when using incorrect backend for debugcon

2018-10-18 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ On 11/10/2018 23:48, Marc-André Lureau wrote: > On Thu, Oct 11, 2018 at 9:13 PM Philippe Mathieu-Daudé > wrote: >> >> When using an incorrect backend for the debugcon, QEMU exits silently >> without any error indication, which is confusing. >> Add a message that the character

Re: [Qemu-devel] [PATCH 19/20] target/arm: Promote consecutive memory ops for aa32

2018-10-18 Thread Philippe Mathieu-Daudé
On 11/10/2018 22:52, Richard Henderson wrote: > For a sequence of loads or stores from a single register, > little-endian operations can be promoted to an 8-byte op. > This can reduce the number of operations by a factor of 8. > > Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Da

Re: [Qemu-devel] [PATCH v3 0/6] Avocado: more multi-arch tests

2018-10-18 Thread Philippe Mathieu-Daudé
Ping for review before I send v3? v3: - fix patch 4 "Add test_sh4_r2d in BootLinuxConsole" - drop patch 5? "Add test_sh4_r2d in BootLinuxTracing" On Sat, Oct 13, 2018 at 5:15 PM Philippe Mathieu-Daudé wrote: > Another neanderthal approach to add multi-arch acceptance tests using Avocado. > > I c

Re: [Qemu-devel] [PATCH v2 2/3] target/arm: Only flush tlb if ASID changes

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 03:56, Richard Henderson wrote: > Since QEMU does not implement ASIDs, changes to the ASID must flush the > tlb. However, if the ASID does not change there is no reason to flush. > > In testing a boot of the Ubuntu installer to the first menu, this reduces > the number of flushes by

[Qemu-devel] [PULL V2 25/26] e1000: indicate dropped packets in HW counters

2018-10-18 Thread Jason Wang
The e1000 emulation silently discards RX packets if there's insufficient space in the ring buffer. This leads to errors on higher-level protocols in the guest, with no indication about the error cause. This patch increments the "Missed Packets Count" (MPC) and "Receive No Buffers Count" (RNBC) HW

[Qemu-devel] [PULL V2 22/26] rtl8139: fix possible out of bound access

2018-10-18 Thread Jason Wang
In rtl8139_do_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access of for both buf and

[Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX

2018-10-18 Thread Jason Wang
There should not be a reason for passing a packet size greater than INT_MAX. It's usually a hint of bug somewhere, so ignore packet size greater than INT_MAX in qemu_deliver_packet_iov() CC: qemu-sta...@nongnu.org Reported-by: Daniel Shapira Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason W

[Qemu-devel] [PULL V2 21/26] ne2000: fix possible out of bound access in ne2000_receive

2018-10-18 Thread Jason Wang
In ne2000_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access of for both buf and buf

[Qemu-devel] [PULL V2 23/26] pcnet: fix possible buffer overflow

2018-10-18 Thread Jason Wang
In pcnet_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access for both buf and buf1.

[Qemu-devel] [PULL V2 18/26] COLO: quick failover process by kick COLO thread

2018-10-18 Thread Jason Wang
From: zhanghailiang COLO thread may sleep at qemu_sem_wait(&s->colo_checkpoint_sem), while failover works begin, It's better to wakeup it to quick the process. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- migration/colo.c | 8 1 file

[Qemu-devel] [PULL V2 19/26] docs: Add COLO status diagram to COLO-FT.txt

2018-10-18 Thread Jason Wang
From: Zhang Chen This diagram make user better understand COLO. Suggested by Markus Armbruster. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- docs/COLO-FT.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/docs/COLO

[Qemu-devel] [PULL V2 16/26] filter-rewriter: handle checkpoint and failover event

2018-10-18 Thread Jason Wang
From: Zhang Chen After one round of checkpoint, the states between PVM and SVM become consistent, so it is unnecessary to adjust the sequence of net packets for old connections, besides, while failover happens, filter-rewriter will into failover mode that needn't handle the new TCP connection. S

[Qemu-devel] [PULL V2 20/26] clean up callback when del virtqueue

2018-10-18 Thread Jason Wang
From: liujunjie Before, we did not clear callback like handle_output when delete the virtqueue which may result be segmentfault. The scene is as follows: 1. Start a vm with multiqueue vhost-net, 2. then we write VIRTIO_PCI_GUEST_FEATURES in PCI configuration to triger multiqueue disable in this v

[Qemu-devel] [PULL V2 12/26] qapi: Add new command to query colo status

2018-10-18 Thread Jason Wang
From: Zhang Chen Libvirt or other high level software can use this command query colo status. You can test this command like that: {'execute':'query-colo-status'} Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- migration/colo.c| 21 +

[Qemu-devel] [PULL V2 15/26] filter: Add handle_event method for NetFilterClass

2018-10-18 Thread Jason Wang
From: Zhang Chen Filter needs to process the event of checkpoint/failover or other event passed by COLO frame. Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- include/net/filter.h | 5 + net/filter.c | 17 ++

[Qemu-devel] [PULL V2 17/26] COLO: notify net filters about checkpoint/failover event

2018-10-18 Thread Jason Wang
From: zhanghailiang Notify all net filters about the checkpoint and failover event. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- migration/colo.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/migration/colo.c b/migratio

[Qemu-devel] [PULL V2 11/26] qapi/migration.json: Rename COLO unknown mode to none mode.

2018-10-18 Thread Jason Wang
From: Zhang Chen Suggested by Markus Armbruster rename COLO unknown mode to none mode. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- migration/colo-failover.c | 2 +- migration/colo.c | 2

[Qemu-devel] [PULL V2 26/26] qemu-options: Fix bad "macaddr" property in the documentation

2018-10-18 Thread Jason Wang
From: Thomas Huth When using the "-device" option, the property is called "mac". "macaddr" is only used for the legacy "-net nic" option. Reported-by: Harald Hoyer Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- qemu-options.hx | 2 +- 1 file changed,

[Qemu-devel] [PULL V2 13/26] savevm: split the process of different stages for loadvm/savevm

2018-10-18 Thread Jason Wang
From: Zhang Chen There are several stages during loadvm/savevm process. In different stage, migration incoming processes different types of sections. We want to control these stages more accuracy, it will benefit COLO performance, we don't have to save type of QEMU_VM_SECTION_START sections every

[Qemu-devel] [PULL V2 10/26] qmp event: Add COLO_EXIT event to notify users while exited COLO

2018-10-18 Thread Jason Wang
From: zhanghailiang If some errors happen during VM's COLO FT stage, it's important to notify the users of this event. Together with 'x-colo-lost-heartbeat', Users can intervene in COLO's failover work immediately. If users don't want to get involved in COLO's failover verdict, it is still necess

[Qemu-devel] [PULL V2 08/26] ram/COLO: Record the dirty pages that SVM received

2018-10-18 Thread Jason Wang
From: Zhang Chen We record the address of the dirty pages that received, it will help flushing pages that cached into SVM. Here, it is a trick, we record dirty pages by re-using migration dirty bitmap. In the later patch, we will start the dirty log for SVM, just like migration, in this way, we

[Qemu-devel] [PULL V2 06/26] COLO: Remove colo_state migration struct

2018-10-18 Thread Jason Wang
From: Zhang Chen We need to know if migration is going into COLO state for incoming side before start normal migration. Instead by using the VMStateDescription to send colo_state from source side to destination side, we use MIG_CMD_ENABLE_COLO to indicate whether COLO is enabled or not. Signed-

[Qemu-devel] [PULL V2 14/26] COLO: flush host dirty ram from cache

2018-10-18 Thread Jason Wang
From: zhanghailiang Don't need to flush all VM's ram from cache, only flush the dirty pages since last checkpoint Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- mi

[Qemu-devel] [PULL V2 03/26] colo-compare: use notifier to notify packets comparing result

2018-10-18 Thread Jason Wang
From: Zhang Chen It's a good idea to use notifier to notify COLO frame of inconsistent packets comparing. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang Signed-off-by: Jason Wang --- net/colo-compare.c | 37 ++--- net/colo-co

[Qemu-devel] [PULL V2 07/26] COLO: Load dirty pages into SVM's RAM cache firstly

2018-10-18 Thread Jason Wang
From: Zhang Chen We should not load PVM's state directly into SVM, because there maybe some errors happen when SVM is receving data, which will break SVM. We need to ensure receving all data before load the state into SVM. We use an extra memory to cache these data (PVM's ram). The ram cache in

[Qemu-devel] [PULL V2 09/26] COLO: Flush memory data from ram cache

2018-10-18 Thread Jason Wang
From: Zhang Chen During the time of VM's running, PVM may dirty some pages, we will transfer PVM's dirty pages to SVM and store them into SVM's RAM cache at next checkpoint time. So, the content of SVM's RAM cache will always be same with PVM's memory after checkpoint. Instead of flushing all co

[Qemu-devel] [PULL V2 05/26] COLO: Add block replication into colo process

2018-10-18 Thread Jason Wang
From: Zhang Chen Make sure master start block replication after slave's block replication started. Besides, we need to activate VM's blocks before goes into COLO state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by:

[Qemu-devel] [PULL V2 00/26] Net patches

2018-10-18 Thread Jason Wang
The following changes since commit 77f7c747193662edfadeeb3118d63eed0eac51a6: Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-10-17' into staging (2018-10-18 13:40:19 +0100) are available in the git repository at: https://github.com/jasowang/qemu.git tags/net-pull-r

[Qemu-devel] [PULL V2 02/26] colo-compare: implement the process of checkpoint

2018-10-18 Thread Jason Wang
From: Zhang Chen While do checkpoint, we need to flush all the unhandled packets, By using the filter notifier mechanism, we can easily to notify every compare object to do this process, which runs inside of compare threads as a coroutine. Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen

[Qemu-devel] [PULL V2 01/26] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-10-18 Thread Jason Wang
From: Zhang Chen We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. The reason for this simplify job is because guest kernel will track the TCP status and wait 2MSL time too, if client resend the FIN packet, guest will rese

[Qemu-devel] [PULL V2 04/26] COLO: integrate colo compare with colo frame

2018-10-18 Thread Jason Wang
From: Zhang Chen For COLO FT, both the PVM and SVM run at the same time, only sync the state while it needs. So here, let SVM runs while not doing checkpoint, change DEFAULT_MIGRATE_X_CHECKPOINT_DELAY to 200*100. Besides, we forgot to release colo_checkpoint_semd and colo_delay_timer, fix them

Re: [Qemu-devel] [PATCH RFC v5 1/7] Fix segmentation fault when qemu_signal_init fails

2018-10-18 Thread Fei Li
Kindly ping. :) Main discuss whether adding the Error for qemu_thread_create() or not. For details, please see blow: On 10/17/2018 04:17 PM, Fei Li wrote: Sorry for the late reply! Omitted this one.. On 10/12/2018 09:26 PM, Markus Armbruster wrote: Fei Li writes: On 10/12/2018 03:56 PM, M

Re: [Qemu-devel] [RFC v4 07/16] hw/arm/virt: Implement kvm_type function for 3.2 machine

2018-10-18 Thread Richard Henderson
On 10/18/18 7:30 AM, Eric Auger wrote: > +#define SZ_1G (1024ULL * 1024 * 1024) already defines GiB. r~

Re: [Qemu-devel] [PATCH v3 3/3] linux-user: Implement special usbfs ioctls.

2018-10-18 Thread Cortland Setlow Tölva
On Thu, Oct 18, 2018 at 11:48 AM Laurent Vivier wrote: > > Le 08/10/2018 à 18:35, Cortland Tölva a écrit : > > Userspace submits a USB Request Buffer to the kernel, optionally > > discards it, and finally reaps the URB. Thunk buffers from target > > to host and back. > > > > Tested by running an

[Qemu-devel] [PATCH v2 0/3] target/arm: Reduce tlb_flush overhead

2018-10-18 Thread Richard Henderson
While installing AArch64 Ubuntu into a new vm, I happened to notice that tlb_flush+memset was consuming 25% of the total runtime. This patch set reduces that overhead to 10%. Full tlb flushes are down to 11k from 1.8M, when pausing the installation at the first menu. Changes since v1: * Rename

[Qemu-devel] [PATCH v2 1/3] target/arm: Remove writefn from TTBR0_EL3

2018-10-18 Thread Richard Henderson
The EL3 version of this register does not include an ASID, and so the tlb_flush performed by vmsa_ttbr_write is not needed. Reviewed-by: Aaron Lindsay Signed-off-by: Richard Henderson --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c

[Qemu-devel] [PATCH v2 3/3] target/arm: Flush only the TLBs affected by TTBR*_EL1

2018-10-18 Thread Richard Henderson
Only the EL0 and EL1 TLBs are affected by the EL1 register, so flush only 2 of the 8 TLBs. In testing a boot of the Ubuntu installer to the first menu, this accounts for nearly all of the full tlb flushes: all but 11k of the 1.2M instances without the patch. Signed-off-by: Richard Henderson ---

[Qemu-devel] [PATCH v2 2/3] target/arm: Only flush tlb if ASID changes

2018-10-18 Thread Richard Henderson
Since QEMU does not implement ASIDs, changes to the ASID must flush the tlb. However, if the ASID does not change there is no reason to flush. In testing a boot of the Ubuntu installer to the first menu, this reduces the number of flushes by 30%, or nearly 600k instances. Reviewed-by: Aaron Lind

[Qemu-devel] [RFC v3 53/56] xtensa: acquire the BQL in cpu_has_work

2018-10-18 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 | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index d4ca35e6cc..5cb881f89b 100644 --- a/tar

[Qemu-devel] [RFC v3 56/56] cputlb: queue async flush jobs without the BQL

2018-10-18 Thread Emilio G. Cota
This yields sizable scalability improvements, as the below results show. Host: Two Intel E5-2683 v3 14-core CPUs at 2.00 GHz (Haswell) Workload: Ubuntu 18.04 ppc64 compiling the linux kernel with "make -j N", where N is the number of cores in the guest. Speedup vs a single

[Qemu-devel] [RFC v3 27/56] s390x: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Cornelia Huck Cc: Richard Henderson 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/s

[Qemu-devel] [RFC v3 39/56] s390x: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Cc: Richard Henderson Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Signed-off-by: Emilio G. Cota --- hw/intc/s390_flic.c | 2 +- target/s390x/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/int

[Qemu-devel] [RFC v3 48/56] ppc: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/ppc/translate_init.inc.c | 77 +++-- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/target/ppc/transl

[Qemu-devel] [RFC v3 0/56] per-CPU locks

2018-10-18 Thread Emilio G. Cota
Cc: Aleksandar Markovic Cc: Alexander Graf Cc: Alistair Francis Cc: Andrzej Zaborowski Cc: Anthony Green Cc: Artyom Tarasenko Cc: Aurelien Jarno Cc: Bastian Koppelmann Cc: Christian Borntraeger Cc: Chris Wulff Cc: Cornelia Huck Cc: David Gibson Cc: David Hildenbrand Cc: "Edgar E. Igles

[Qemu-devel] [RFC v3 51/56] riscv: acquire the BQL in cpu_has_work

2018-10-18 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 Signed-off-by: Emilio G. Cota --- target/riscv/cpu.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b

[Qemu-devel] [RFC v3 30/56] i386: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Emilio G. Cota --- target/i386/cpu.c| 2 +- target/i386/hax-all.c| 16 +-- target/i386/helper.c | 4 +-- target/i386/hvf/hvf.c| 6 ++-- target/i386/hvf/x86hvf.c | 32 ++ target/i386/kvm.c

[Qemu-devel] [RFC v3 54/56] cpu: protect most CPU state with cpu->lock

2018-10-18 Thread Emilio G. Cota
Instead of taking the BQL every time we exit the exec loop, have a per-CPU lock to serialize accesses the the CPU's state. Differently from the BQL, this lock is uncontended so acquiring it is cheap. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu

[Qemu-devel] [RFC v3 44/56] unicore32: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Guan Xuetao 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 100644 --- a/target/unicore32/cpu.c

[Qemu-devel] [RFC v3 37/56] mips: convert to cpu_interrupt_request

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

[Qemu-devel] [RFC v3 47/56] cpu: call .cpu_has_work with the CPU lock held

2018-10-18 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index cd66b8828a..ca7d92c360 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -784,9 +784,16 @@ const char *parse_cpu_mode

[Qemu-devel] [RFC v3 55/56] cpu: add async_run_on_cpu_no_bql

2018-10-18 Thread Emilio G. Cota
Some async jobs do not need the BQL. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 14 ++ cpus-common.c | 39 ++- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/include/qom/

  1   2   3   4   5   >