[Qemu-devel] [RFC PATCH v2 1/2] softfloat: Handle float64 rounding properly for underflow case

2017-01-27 Thread Bharata B Rao
When rounding a floating point result to float64 precision, the existing code doesn't re-calculate the required round increment for the underflow case. Fix this. Signed-off-by: Bharata B Rao --- fpu/softfloat.c | 17 + 1 file changed, 17 insertions(+) diff --git a/fpu/softfloat.

[Qemu-devel] [RFC PATCH v2 0/2] softfloat: Add round-to-odd rounding mode

2017-01-27 Thread Bharata B Rao
Hi, Here is the next version of round-to-odd rounding mode implementation. In this version I have addressed the reveiw comments from v1 and added a new patch to take care of 64 bit rounding in underflow case. This fix was found necessary when comparing the result of PowerPC ISA 3.0 instruction xs

[Qemu-devel] [RFC PATCH v2 2/2] softfloat: Add round-to-odd rounding mode

2017-01-27 Thread Bharata B Rao
Power ISA 3.0 introduces a few quadruple precision floating point instructions that support round-to-odd rounding mode. The round-to-odd mode is explained as under: Let Z be the intermediate arithmetic result or the operand of a convert operation. If Z can be represented exactly in the target form

Re: [Qemu-devel] [RFC PATCH v2 0/2] softfloat: Add round-to-odd rounding mode

2017-01-27 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [RFC PATCH v2 0/2] softfloat: Add round-to-odd rounding mode Message-id: 1485504213-21632-1-git-send-email-bhar...@linux.vnet.ibm.com === TEST SCRIPT BEGIN === #!/

Re: [Qemu-devel] [RFC PATCH v2 0/2] softfloat: Add round-to-odd rounding mode

2017-01-27 Thread Bharata B Rao
On Fri, Jan 27, 2017 at 12:09:13AM -0800, no-re...@patchew.org wrote: > Hi, > > Your series seems to have some coding style problems. See output below for > more information: > > Type: series > Subject: [Qemu-devel] [RFC PATCH v2 0/2] softfloat: Add round-to-odd rounding > mode > Message-id: 148

[Qemu-devel] [PATCH] target/sparc: Restore ldstub of odd asis

2017-01-27 Thread Richard Henderson
Fixes the booting of ss20 roms. Reported-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 655060c..aa6734d

Re: [Qemu-devel] [PATCH] spapr: clock should count only if vm is running

2017-01-27 Thread Paolo Bonzini
> This is a port to ppc of the i386 commit: > 00f4d64 kvmclock: clock should count only if vm is running > > We remove timebase_/pre_save/post_load/ functions, > and use the VM state change handler to save and restore > the guest_timebase (on stop and continue). > > Time base offset has orig

Re: [Qemu-devel] [Xen-devel] Commit 3a6c9 breaks QEMU on FreeBSD/Xen

2017-01-27 Thread Juergen Gross
On 26/01/17 22:21, Peter Maydell wrote: > On 26 January 2017 at 20:47, Peter Maydell wrote: >> On 26 January 2017 at 19:36, Stefano Stabellini >> wrote: >>> It should be just a matter of replacing qdev_init_nofail with something >>> that can fail. I couldn't find a regular qdev_init that can ret

Re: [Qemu-devel] [PATCH] spapr: clock should count only if vm is running

2017-01-27 Thread Laurent Vivier
On 27/01/2017 09:52, Paolo Bonzini wrote: > >> This is a port to ppc of the i386 commit: >> 00f4d64 kvmclock: clock should count only if vm is running >> >> We remove timebase_/pre_save/post_load/ functions, >> and use the VM state change handler to save and restore >> the guest_timebase (on s

Re: [Qemu-devel] QEMU websockets support is laggy?

2017-01-27 Thread Daniel P. Berrange
On Tue, Jan 24, 2017 at 05:02:25PM -0500, Brian Rak wrote: > We've been considering switching over to using qemu's built in websockets > support (to avoid the overhead of needing websockify running). We've been > seeing very poor performance after the switch (it takes the console 4-5 > seconds to

Re: [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"

2017-01-27 Thread Daniel P. Berrange
On Thu, Jan 26, 2017 at 02:46:52PM +0530, Ashijeet Acharya wrote: > Migration of a "none" machine with no RAM crashes abruptly as > bitmap_new() fails and thus aborts. Instead, place a check for > last_ram_offset() being '0' at the start of ram_save_setup() and > error out with a meaningful error m

Re: [Qemu-devel] [PATCH 2/2] qapi2texi: produce type information

2017-01-27 Thread Markus Armbruster
Marc-André Lureau writes: > Add type information to the generated documentation. Without it the > written documentation is not explicit enough to know how to handle > the various arguments and members. This is actually a regression of sorts: the type information we used to have in qmp-commands.t

Re: [Qemu-devel] [libvirt] char: Logging serial pty output when disconnected

2017-01-27 Thread Daniel P. Berrange
On Thu, Jan 26, 2017 at 05:07:16PM -0800, Ed Swierk wrote: > Interactive access to a guest serial console can be enabled by hooking > the serial device to a pty backend, e.g. -device > isa-serial,chardev=cs0 -chardev pty,id=cs0. With libvirt this can be > configured via port='0'/>. > > Output fro

[Qemu-devel] [PATCH] qemu-doc: Clarify that -vga std is now the default

2017-01-27 Thread Alberto Garcia
The QEMU manual page states that Cirrus Logic is the default video card if the user doesn't specify any. However this is not true since QEMU 2.2. Signed-off-by: Alberto Garcia --- qemu-options.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-optio

Re: [Qemu-devel] [PATCH] spapr: clock should count only if vm is running

2017-01-27 Thread Thomas Huth
On 26.01.2017 21:45, Laurent Vivier wrote: > This is a port to ppc of the i386 commit: > 00f4d64 kvmclock: clock should count only if vm is running > > We remove timebase_/pre_save/post_load/ functions, > and use the VM state change handler to save and restore > the guest_timebase (on stop and

Re: [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"

2017-01-27 Thread Dr. David Alan Gilbert
* Daniel P. Berrange (berra...@redhat.com) wrote: > On Thu, Jan 26, 2017 at 02:46:52PM +0530, Ashijeet Acharya wrote: > > Migration of a "none" machine with no RAM crashes abruptly as > > bitmap_new() fails and thus aborts. Instead, place a check for > > last_ram_offset() being '0' at the start of

Re: [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"

2017-01-27 Thread Ashijeet Acharya
Okay On Friday, 27 January 2017, Daniel P. Berrange wrote: > On Thu, Jan 26, 2017 at 02:46:52PM +0530, Ashijeet Acharya wrote: > > Migration of a "none" machine with no RAM crashes abruptly as > > bitmap_new() fails and thus aborts. Instead, place a check for > > last_ram_offset() being '0' at t

Re: [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"

2017-01-27 Thread Daniel P. Berrange
On Fri, Jan 27, 2017 at 09:46:13AM +, Dr. David Alan Gilbert wrote: > * Daniel P. Berrange (berra...@redhat.com) wrote: > > On Thu, Jan 26, 2017 at 02:46:52PM +0530, Ashijeet Acharya wrote: > > > Migration of a "none" machine with no RAM crashes abruptly as > > > bitmap_new() fails and thus abo

Re: [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"

2017-01-27 Thread Daniel P. Berrange
On Fri, Jan 27, 2017 at 03:22:38PM +0530, Ashijeet Acharya wrote: > Okay > > On Friday, 27 January 2017, Daniel P. Berrange wrote: > > > On Thu, Jan 26, 2017 at 02:46:52PM +0530, Ashijeet Acharya wrote: > > > Migration of a "none" machine with no RAM crashes abruptly as > > > bitmap_new() fails

[Qemu-devel] [PATCH 4/4] block/gluster: add missing QLIST_HEAD_INITIALIZER()

2017-01-27 Thread Stefan Hajnoczi
The "qemu/queue.h" data structures provide static initializer macros. The QLIST version just initializes to NULL so code happens to work when the initializer is forgotten. Other types like SLIST are not so forgiving because they set fields to non-NULL values. The initializer macro should always b

[Qemu-devel] [PATCH 0/4] block/gluster: cleanups for GlfsPreopened

2017-01-27 Thread Stefan Hajnoczi
Code added in commit 6349c15410361d3fe52c9beee309954d606f8ccd ("block/gluster: memory usage: use one glfs instance per volume") does not follow conventions and violates QEMU coding style. Although any single issue in isolation is not worth patching, there are several of these and I think it's wort

[Qemu-devel] [PATCH 2/4] block/gluster: drop intermediate ListElement struct

2017-01-27 Thread Stefan Hajnoczi
The "qemu/queue.h" data structures are used without intermediate list node structs. They are designed to be embedded in the main struct. Drop the unnecessary ListElement struct. Signed-off-by: Stefan Hajnoczi --- block/gluster.c | 39 +-- 1 file changed, 17 i

[Qemu-devel] [PATCH 1/4] block/gluster: fix wrong indent in glfs_find_preopened()

2017-01-27 Thread Stefan Hajnoczi
QEMU uses 4-space indentation. Fix this now so checkpatch.pl is happy with future code changes. Signed-off-by: Stefan Hajnoczi --- block/gluster.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 1a22f29..516a1e1 100644 --- a/block/

[Qemu-devel] [PATCH 3/4] block/gluster: use conventional names for GlfsPreopened functions

2017-01-27 Thread Stefan Hajnoczi
The naming of GlfsPreopened functions is a little unusual: glfs_set_preopened() appends items to the list. Normally this operation is called "add". glfs_find_preopened() is paired with glfs_clear_preopened(). Normally this is called "get" and "put" (or "ref" and "unref"). This patch renames th

Re: [Qemu-devel] Qemu-devel] Poll on QEMU documentation project

2017-01-27 Thread Peter Maydell
On 27 January 2017 at 06:51, Markus Armbruster wrote: > "What can we cut" is the wrong question. The right one is "what are our > requirements". Here's my try: > > HTML: required > nroff with an macros: required > PDF: wanted (try printing a website) > plain text: nice to have (for me personally

[Qemu-devel] [PATCH] iothread: enable AioContext polling by default

2017-01-27 Thread Stefan Hajnoczi
IOThread AioContexts are likely to consist only of event sources like virtqueue ioeventfds and LinuxAIO completion eventfds that are pollable from userspace (without system calls). We recently merged the AioContext polling feature but didn't enable it by default yet. I have gone back over the per

Re: [Qemu-devel] [PATCH v2 1/8] hw: Default -drive to if=ide explicitly where it works

2017-01-27 Thread Yongbok Kim
>> Slightly off-topic, but: Is fulong2e still maintained? I did not spot an >> entry in MAINTAINERS...? > > It's covered by the general MIPS stanza: > > $ scripts/get_maintainer.pl -f hw/mips/mips_fulong2e.c > Aurelien Jarno (maintainer:MIPS) > Yongbok Kim (maintainer:MIPS) >

Re: [Qemu-devel] MIPS machines (was: [PATCH v2 1/8] hw: Default -drive to if=ide explicitly where it works)

2017-01-27 Thread Thomas Huth
On 27.01.2017 11:21, Yongbok Kim wrote: > >>> Slightly off-topic, but: Is fulong2e still maintained? I did not spot an >>> entry in MAINTAINERS...? >> >> It's covered by the general MIPS stanza: >> >> $ scripts/get_maintainer.pl -f hw/mips/mips_fulong2e.c >> Aurelien Jarno (maintainer:MI

[Qemu-devel] [PATCH v8 03/25] mttcg: Add missing tb_lock/unlock() in cpu_exec_step()

2017-01-27 Thread Alex Bennée
From: Pranith Kumar The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them. CC: Richard Henderson CC: Alex Bennée Signed-off-by: Pranith Kumar --- cpu-exec.c | 4 1 file changed, 4 insertions(+) diff --git a/cpu-exec.c

[Qemu-devel] [PATCH v8 02/25] mttcg: translate-all: Enable locking debug in a debug build

2017-01-27 Thread Alex Bennée
From: Pranith Kumar Enable tcg lock debug asserts in a debug build by default instead of relying on DEBUG_LOCKING. None of the other DEBUG_* macros have asserts, so this patch removes DEBUG_LOCKING and enable these asserts in a debug build. CC: Richard Henderson Signed-off-by: Pranith Kumar [A

[Qemu-devel] [PATCH v8 06/25] tcg: add kick timer for single-threaded vCPU emulation

2017-01-27 Thread Alex Bennée
Currently we rely on the side effect of the main loop grabbing the iothread_mutex to give any long running basic block chains a kick to ensure the next vCPU is scheduled. As this code is being re-factored and rationalised we now do it explicitly here. Signed-off-by: Alex Bennée Reviewed-by: Richa

[Qemu-devel] [PATCH v8 08/25] tcg: drop global lock during TCG code execution

2017-01-27 Thread Alex Bennée
From: Jan Kiszka This finally allows TCG to benefit from the iothread introduction: Drop the global mutex while running pure TCG CPU code. Reacquire the lock when entering MMIO or PIO emulation, or when leaving the TCG loop. We have to revert a few optimization for the current TCG threading mode

[Qemu-devel] [PATCH v8 04/25] tcg: move TCG_MO/BAR types into own file

2017-01-27 Thread Alex Bennée
We'll be using the memory ordering definitions to define values for both the host and guest. To avoid fighting with circular header dependencies just move these types into their own minimal header. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tcg/tcg-mo.h | 45 +

[Qemu-devel] [PATCH v8 05/25] tcg: add options for enabling MTTCG

2017-01-27 Thread Alex Bennée
From: KONRAD Frederic We know there will be cases where MTTCG won't work until additional work is done in the front/back ends to support. It will however be useful to be able to turn it on. As a result MTTCG will default to off unless the combination is supported. However the user can turn it on

[Qemu-devel] [PATCH v8 01/25] docs: new design document multi-thread-tcg.txt

2017-01-27 Thread Alex Bennée
This documents the current design for upgrading TCG emulation to take advantage of modern CPUs by running a thread-per-CPU. The document goes through the various areas of the code affected by such a change and proposes design requirements for each part of the solution. The text marked with (Curren

[Qemu-devel] [PATCH v8 11/25] tcg: enable thread-per-vCPU

2017-01-27 Thread Alex Bennée
There are a couple of changes that occur at the same time here: - introduce a single vCPU qemu_tcg_cpu_thread_fn One of these is spawned per vCPU with its own Thread and Condition variables. qemu_tcg_rr_cpu_thread_fn is the new name for the old single threaded function. - the TLS curre

[Qemu-devel] [PATCH v8 12/25] tcg: handle EXCP_ATOMIC exception for system emulation

2017-01-27 Thread Alex Bennée
From: Pranith Kumar The patch enables handling atomic code in the guest. This should be preferably done in cpu_handle_exception(), but the current assumptions regarding when we can execute atomic sections cause a deadlock. Signed-off-by: Pranith Kumar [AJB: tweak title] Signed-off-by: Alex Benn

[Qemu-devel] [PATCH v8 15/25] cputlb: introduce tlb_flush_* async work.

2017-01-27 Thread Alex Bennée
From: KONRAD Frederic Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are in true multithreaded work. We take the tb_lock() when doing this to avoid racing with o

[Qemu-devel] [PATCH v8 07/25] tcg: rename tcg_current_cpu to tcg_current_rr_cpu

2017-01-27 Thread Alex Bennée
..and make the definition local to cpus. In preparation for MTTCG the concept of a global tcg_current_cpu will no longer make sense. However we still need to keep track of it in the single-threaded case to be able to exit quickly when required. qemu_cpu_kick_no_halt() moves and becomes qemu_cpu_ki

[Qemu-devel] [PATCH v8 20/25] target-arm/powerctl: defer cpu reset work to CPU context

2017-01-27 Thread Alex Bennée
When switching a new vCPU on we want to complete a bunch of the setup work before we start scheduling the vCPU thread. To do this cleanly we defer vCPU setup to async work which will run the vCPUs execution context as the thread is woken up. The scheduling of the work will kick the vCPU awake. Thi

[Qemu-devel] [PATCH v8 10/25] tcg: enable tb_lock() for SoftMMU

2017-01-27 Thread Alex Bennée
tb_lock() has long been used for linux-user mode to protect code generation. By enabling it now we prepare for MTTCG and ensure all code generation is serialised by this lock. The other major structure that needs protecting is the l1_map and its PageDesc structures. For the SoftMMU case we also use

[Qemu-devel] [PATCH v8 04/25] tcg: move TCG_MO/BAR types into own file

2017-01-27 Thread Alex Bennée
We'll be using the memory ordering definitions to define values for both the host and guest. To avoid fighting with circular header dependencies just move these types into their own minimal header. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tcg/tcg-mo.h | 45 +

[Qemu-devel] [PATCH v8 19/25] cputlb: introduce tlb_flush_*_all_cpus[_synced]

2017-01-27 Thread Alex Bennée
This introduces support to the cputlb API for flushing all CPUs TLBs with one call. This avoids the need for target helpers to iterate through the vCPUs themselves. An additional variant of the API (_synced) do not return from the caller and will cause the work to be scheduled as "safe work". The

[Qemu-devel] [PATCH v8 09/25] tcg: remove global exit_request

2017-01-27 Thread Alex Bennée
There are now only two uses of the global exit_request left. The first ensures we exit the run_loop when we first start to process pending work and in the kick handler. This is just as easily done by setting the first_cpu->exit_request flag. The second use is in the round robin kick routine. The

[Qemu-devel] [PATCH v8 03/25] mttcg: Add missing tb_lock/unlock() in cpu_exec_step()

2017-01-27 Thread Alex Bennée
From: Pranith Kumar The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them. CC: Richard Henderson CC: Alex Bennée Signed-off-by: Pranith Kumar --- cpu-exec.c | 4 1 file changed, 4 insertions(+) diff --git a/cpu-exec.c

[Qemu-devel] [PATCH v8 00/25] Remaining MTTCG Base patches and ARM enablement

2017-01-27 Thread Alex Bennée
Hi, All of the changes in this revision are addressing comments from v7 posted last week. A new pre-cursor patch was added: cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap To change the cputlb API to use a bitmap instead of vargs. This has generated quite a bit of

[Qemu-devel] [PATCH v8 02/25] mttcg: translate-all: Enable locking debug in a debug build

2017-01-27 Thread Alex Bennée
From: Pranith Kumar Enable tcg lock debug asserts in a debug build by default instead of relying on DEBUG_LOCKING. None of the other DEBUG_* macros have asserts, so this patch removes DEBUG_LOCKING and enable these asserts in a debug build. CC: Richard Henderson Signed-off-by: Pranith Kumar [A

[Qemu-devel] [PATCH v8 14/25] cputlb: tweak qemu_ram_addr_from_host_nofail reporting

2017-01-27 Thread Alex Bennée
This moves the helper function closer to where it is called and updates the error message to report via error_report instead of the deprecated fprintf. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- cputlb.c | 24 1 file changed, 12 insertions(+), 12 dele

[Qemu-devel] [PATCH v8 10/25] tcg: enable tb_lock() for SoftMMU

2017-01-27 Thread Alex Bennée
tb_lock() has long been used for linux-user mode to protect code generation. By enabling it now we prepare for MTTCG and ensure all code generation is serialised by this lock. The other major structure that needs protecting is the l1_map and its PageDesc structures. For the SoftMMU case we also use

[Qemu-devel] [PATCH v8 06/25] tcg: add kick timer for single-threaded vCPU emulation

2017-01-27 Thread Alex Bennée
Currently we rely on the side effect of the main loop grabbing the iothread_mutex to give any long running basic block chains a kick to ensure the next vCPU is scheduled. As this code is being re-factored and rationalised we now do it explicitly here. Signed-off-by: Alex Bennée Reviewed-by: Richa

[Qemu-devel] [PATCH v8 01/25] docs: new design document multi-thread-tcg.txt

2017-01-27 Thread Alex Bennée
This documents the current design for upgrading TCG emulation to take advantage of modern CPUs by running a thread-per-CPU. The document goes through the various areas of the code affected by such a change and proposes design requirements for each part of the solution. The text marked with (Curren

[Qemu-devel] [PATCH v8 09/25] tcg: remove global exit_request

2017-01-27 Thread Alex Bennée
There are now only two uses of the global exit_request left. The first ensures we exit the run_loop when we first start to process pending work and in the kick handler. This is just as easily done by setting the first_cpu->exit_request flag. The second use is in the round robin kick routine. The

[Qemu-devel] [PATCH v8 05/25] tcg: add options for enabling MTTCG

2017-01-27 Thread Alex Bennée
From: KONRAD Frederic We know there will be cases where MTTCG won't work until additional work is done in the front/back ends to support. It will however be useful to be able to turn it on. As a result MTTCG will default to off unless the combination is supported. However the user can turn it on

[Qemu-devel] [PATCH v8 07/25] tcg: rename tcg_current_cpu to tcg_current_rr_cpu

2017-01-27 Thread Alex Bennée
..and make the definition local to cpus. In preparation for MTTCG the concept of a global tcg_current_cpu will no longer make sense. However we still need to keep track of it in the single-threaded case to be able to exit quickly when required. qemu_cpu_kick_no_halt() moves and becomes qemu_cpu_ki

[Qemu-devel] [PATCH v8 13/25] cputlb: add assert_cpu_is_self checks

2017-01-27 Thread Alex Bennée
For SoftMMU the TLB flushes are an example of a task that can be triggered on one vCPU by another. To deal with this properly we need to use safe work to ensure these changes are done safely. The new assert can be enabled while debugging to catch these cases. Signed-off-by: Alex Bennée Reviewed-b

[Qemu-devel] [PATCH v8 22/25] target-arm/cpu.h: make ARM_CP defined consistent

2017-01-27 Thread Alex Bennée
This is a purely mechanical change to make the ARM_CP flags neatly align and use a consistent format so it is easier to see which bit each flag is. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/t

[Qemu-devel] [PATCH v8 15/25] cputlb: introduce tlb_flush_* async work.

2017-01-27 Thread Alex Bennée
From: KONRAD Frederic Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are in true multithreaded work. We take the tb_lock() when doing this to avoid racing with o

[Qemu-devel] [PATCH v8 08/25] tcg: drop global lock during TCG code execution

2017-01-27 Thread Alex Bennée
From: Jan Kiszka This finally allows TCG to benefit from the iothread introduction: Drop the global mutex while running pure TCG CPU code. Reacquire the lock when entering MMIO or PIO emulation, or when leaving the TCG loop. We have to revert a few optimization for the current TCG threading mode

[Qemu-devel] [PATCH v8 14/25] cputlb: tweak qemu_ram_addr_from_host_nofail reporting

2017-01-27 Thread Alex Bennée
This moves the helper function closer to where it is called and updates the error message to report via error_report instead of the deprecated fprintf. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- cputlb.c | 24 1 file changed, 12 insertions(+), 12 dele

[Qemu-devel] [PATCH v8 13/25] cputlb: add assert_cpu_is_self checks

2017-01-27 Thread Alex Bennée
For SoftMMU the TLB flushes are an example of a task that can be triggered on one vCPU by another. To deal with this properly we need to use safe work to ensure these changes are done safely. The new assert can be enabled while debugging to catch these cases. Signed-off-by: Alex Bennée Reviewed-b

[Qemu-devel] [PATCH v8 12/25] tcg: handle EXCP_ATOMIC exception for system emulation

2017-01-27 Thread Alex Bennée
From: Pranith Kumar The patch enables handling atomic code in the guest. This should be preferably done in cpu_handle_exception(), but the current assumptions regarding when we can execute atomic sections cause a deadlock. Signed-off-by: Pranith Kumar [AJB: tweak title] Signed-off-by: Alex Benn

[Qemu-devel] [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap

2017-01-27 Thread Alex Bennée
While the vargs approach was flexible the original MTTCG ended up having munge the bits to a bitmap so the data could be used in deferred work helpers. Instead of hiding that in cputlb we push the change to the API to make it take a bitmap of MMU indexes instead. This change is fairly mechanical b

[Qemu-devel] [PATCH v8 23/25] target-arm: introduce ARM_CP_EXIT_PC

2017-01-27 Thread Alex Bennée
Some helpers may trigger an immediate exit of the cpu_loop. If this happens the PC need to be rectified to ensure the restart will begin on the next instruction. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 3 ++- target/arm/translate-a64.c | 4 target/arm/translate.c | 4

[Qemu-devel] [PATCH v8 25/25] tcg: enable MTTCG by default for ARM on x86 hosts

2017-01-27 Thread Alex Bennée
This enables the multi-threaded system emulation by default for ARMv7 and ARMv8 guests using the x86_64 TCG backend. This is because on the guest side: - The ARM translate.c/translate-64.c have been converted to - use MTTCG safe atomic primitives - emit the appropriate barrier ops - Th

[Qemu-devel] [PATCH v8 11/25] tcg: enable thread-per-vCPU

2017-01-27 Thread Alex Bennée
There are a couple of changes that occur at the same time here: - introduce a single vCPU qemu_tcg_cpu_thread_fn One of these is spawned per vCPU with its own Thread and Condition variables. qemu_tcg_rr_cpu_thread_fn is the new name for the old single threaded function. - the TLS curre

[Qemu-devel] [PATCH v8 20/25] target-arm/powerctl: defer cpu reset work to CPU context

2017-01-27 Thread Alex Bennée
When switching a new vCPU on we want to complete a bunch of the setup work before we start scheduling the vCPU thread. To do this cleanly we defer vCPU setup to async work which will run the vCPUs execution context as the thread is woken up. The scheduling of the work will kick the vCPU awake. Thi

Re: [Qemu-devel] [PATCH v2 8/8] hw: Drop superfluous special checks for orphaned -drive

2017-01-27 Thread John Snow
On 01/26/2017 10:09 AM, Markus Armbruster wrote: > We've traditionally rejected orphans here and there, but not > systematically. For instance, the sun4m machines have an onboard SCSI > HBA (bus=0), and have always rejected bus>0. Other machines with an > onboard SCSI HBA don't. > > Commit a66

[Qemu-devel] [PATCH v8 22/25] target-arm/cpu.h: make ARM_CP defined consistent

2017-01-27 Thread Alex Bennée
This is a purely mechanical change to make the ARM_CP flags neatly align and use a consistent format so it is easier to see which bit each flag is. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/t

[Qemu-devel] [PATCH v8 18/25] cputlb: atomically update tlb fields used by tlb_reset_dirty

2017-01-27 Thread Alex Bennée
The main use case for tlb_reset_dirty is to set the TLB_NOTDIRTY flags in TLB entries to force the slow-path on writes. This is used to mark page ranges containing code which has been translated so it can be invalidated if written to. To do this safely we need to ensure the TLB entries in question

[Qemu-devel] [PATCH v8 23/25] target-arm: introduce ARM_CP_EXIT_PC

2017-01-27 Thread Alex Bennée
Some helpers may trigger an immediate exit of the cpu_loop. If this happens the PC need to be rectified to ensure the restart will begin on the next instruction. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 3 ++- target/arm/translate-a64.c | 4 target/arm/translate.c | 4

[Qemu-devel] [PATCH v8 21/25] target-arm: don't generate WFE/YIELD calls for MTTCG

2017-01-27 Thread Alex Bennée
The WFE and YIELD instructions are really only hints and in TCG's case they were useful to move the scheduling on from one vCPU to the next. In the parallel context (MTTCG) this just causes an unnecessary cpu_exit and contention of the BQL. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderso

[Qemu-devel] [PATCH v8 17/25] cputlb: add tlb_flush_by_mmuidx async routines

2017-01-27 Thread Alex Bennée
This converts the remaining TLB flush routines to use async work when detecting a cross-vCPU flush. The only minor complication is having to serialise the var_list of MMU indexes into a form that can be punted to an asynchronous job. The pending_tlb_flush field on QOM's CPU structure also becomes

[Qemu-devel] [PATCH v8 25/25] tcg: enable MTTCG by default for ARM on x86 hosts

2017-01-27 Thread Alex Bennée
This enables the multi-threaded system emulation by default for ARMv7 and ARMv8 guests using the x86_64 TCG backend. This is because on the guest side: - The ARM translate.c/translate-64.c have been converted to - use MTTCG safe atomic primitives - emit the appropriate barrier ops - Th

[Qemu-devel] [PATCH v8 18/25] cputlb: atomically update tlb fields used by tlb_reset_dirty

2017-01-27 Thread Alex Bennée
The main use case for tlb_reset_dirty is to set the TLB_NOTDIRTY flags in TLB entries to force the slow-path on writes. This is used to mark page ranges containing code which has been translated so it can be invalidated if written to. To do this safely we need to ensure the TLB entries in question

[Qemu-devel] [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap

2017-01-27 Thread Alex Bennée
While the vargs approach was flexible the original MTTCG ended up having munge the bits to a bitmap so the data could be used in deferred work helpers. Instead of hiding that in cputlb we push the change to the API to make it take a bitmap of MMU indexes instead. This change is fairly mechanical b

[Qemu-devel] [PATCH v8 17/25] cputlb: add tlb_flush_by_mmuidx async routines

2017-01-27 Thread Alex Bennée
This converts the remaining TLB flush routines to use async work when detecting a cross-vCPU flush. The only minor complication is having to serialise the var_list of MMU indexes into a form that can be punted to an asynchronous job. The pending_tlb_flush field on QOM's CPU structure also becomes

Re: [Qemu-devel] MIPS machines

2017-01-27 Thread Yongbok Kim
On 27/01/2017 10:31, Thomas Huth wrote: > On 27.01.2017 11:21, Yongbok Kim wrote: >> Slightly off-topic, but: Is fulong2e still maintained? I did not spot an entry in MAINTAINERS...? >>> >>> It's covered by the general MIPS stanza: >>> >>> $ scripts/get_maintainer.pl -f hw/mips/mips

[Qemu-devel] [PATCH v8 21/25] target-arm: don't generate WFE/YIELD calls for MTTCG

2017-01-27 Thread Alex Bennée
The WFE and YIELD instructions are really only hints and in TCG's case they were useful to move the scheduling on from one vCPU to the next. In the parallel context (MTTCG) this just causes an unnecessary cpu_exit and contention of the BQL. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderso

Re: [Qemu-devel] [PATCH] spapr: clock should count only if vm is running

2017-01-27 Thread Laurent Vivier
On 27/01/2017 10:45, Thomas Huth wrote: > On 26.01.2017 21:45, Laurent Vivier wrote: >> This is a port to ppc of the i386 commit: >> 00f4d64 kvmclock: clock should count only if vm is running >> >> We remove timebase_/pre_save/post_load/ functions, >> and use the VM state change handler to save

Re: [Qemu-devel] [PATCH v8 2/9] icount: exit cpu loop on expire

2017-01-27 Thread Paolo Bonzini
On 27/01/2017 07:09, Pavel Dovgalyuk wrote: >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> On 26/01/2017 15:32, Pavel Dovgalyuk wrote: From: Paolo Bonzini [mailto:pbonz...@redhat.com] On 26/01/2017 14:37, Pavel Dovgalyuk wrote: >> Simpler: >> >> use_icount && >>

Re: [Qemu-devel] [PATCH 2/2] migration: discard non-dirty ram pages after the start of postcopy

2017-01-27 Thread Dr. David Alan Gilbert
* Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: > After the start of postcopy migration there are some non-dirty pages which > have > already been migrated. These pages are no longer needed on the source vm so > that > we can free them and it doen't hurt to complete the migration. > > Signed-o

[Qemu-devel] [PATCH v8 19/25] cputlb: introduce tlb_flush_*_all_cpus[_synced]

2017-01-27 Thread Alex Bennée
This introduces support to the cputlb API for flushing all CPUs TLBs with one call. This avoids the need for target helpers to iterate through the vCPUs themselves. An additional variant of the API (_synced) do not return from the caller and will cause the work to be scheduled as "safe work". The

Re: [Qemu-devel] [PATCH v3 3/3] xen-platform: add missing disk unplug option

2017-01-27 Thread John Snow
On 01/26/2017 04:37 AM, Paul Durrant wrote: > The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to > request unplug of 'aux' disks (which is stated to mean all IDE disks, > except the primary master). This patch adds support for that unplug request. > > NOTE: The semantics of

Re: [Qemu-devel] [PATCH 1/2] add 'discard-ram' migrate capability

2017-01-27 Thread Dr. David Alan Gilbert
* Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: > This feature frees the migrated memory on the source during postcopy-ram > migration. In the second step of postcopy-ram migration when the source vm > is put on pause we can free unnecessary memory. It will allow, in particular, > to start relaxi

Re: [Qemu-devel] Commit 3a6c9 breaks QEMU on FreeBSD/Xen

2017-01-27 Thread Juergen Gross
On 24/01/17 17:42, Roger Pau Monné wrote: > Hello, > > The following commit: > > commit 3a6c9172ac5951e6dac2b3f6cbce3cfccdec5894 > Author: Juergen Gross > Date: Tue Nov 22 07:10:58 2016 +0100 > > xen: create qdev for each backend device > > Prevents me from running QEMU on FreeBSD/Xen, the f

Re: [Qemu-devel] [PATCH v2 8/8] hw: Drop superfluous special checks for orphaned -drive

2017-01-27 Thread Markus Armbruster
John Snow writes: > On 01/26/2017 10:09 AM, Markus Armbruster wrote: >> We've traditionally rejected orphans here and there, but not >> systematically. For instance, the sun4m machines have an onboard SCSI >> HBA (bus=0), and have always rejected bus>0. Other machines with an >> onboard SCSI HB

Re: [Qemu-devel] [PULL 0/2] HBitmap patches

2017-01-27 Thread Peter Maydell
On 26 January 2017 at 02:48, Fam Zheng wrote: > The following changes since commit c7f1cf01b8245762ca5864e835d84f6677ae8b1f: > > Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging > (2017-01-25 17:54:14 +) > > are available in the git repository at: > > git://gith

[Qemu-devel] [PATCH] dma: omap: check dma channel data_type

2017-01-27 Thread P J P
From: Prasad J Pandit When setting dma channel 'data_type', if (value & 3) == 3, the set 'data_type' is said to be bad. This also leads to an OOB access in 'omap_dma_transfer_generic', while doing cpu_physical_memory_r/w operations. Add check to avoid it. Reported-by: Jiang Xin Signed-off-by: P

Re: [Qemu-devel] [PATCH RFC] migration: set cpu throttle value by workload

2017-01-27 Thread Dr. David Alan Gilbert
* Chao Fan (fanc.f...@cn.fujitsu.com) wrote: > Hi all, > > This is a test for this RFC patch. > > Start vm as following: > cmdline="./x86_64-softmmu/qemu-system-x86_64 -m 2560 \ > -drive if=none,file=/nfs/img/fedora.qcow2,format=qcow2,id=foo \ > -netdev tap,id=hn0,queues=1 \ > -device virtio-net-

[Qemu-devel] [PATCH v2] spapr: clock should count only if vm is running

2017-01-27 Thread Laurent Vivier
This is a port to ppc of the i386 commit: 00f4d64 kvmclock: clock should count only if vm is running We remove timebase_post_load function, and use the VM state change handler to save and restore the guest_timebase (on stop and continue). We keep timebase_pre_save to reduce the clock differen

Re: [Qemu-devel] [PATCH 03/10] armv7m: add state for v7M CCR, CFSR, HFSR, DFSR, MMFAR, BFAR

2017-01-27 Thread Alex Bennée
Peter Maydell writes: > Add the structure fields, VMState fields, reset code and macros for > the v7M system control registers CCR, CFSR, HFSR, DFSR, MMFAR and > BFAR. > > Signed-off-by: Peter Maydell > --- > target/arm/cpu.h | 54 > >

Re: [Qemu-devel] [PATCH 01/10] target/arm: Drop IS_M() macro

2017-01-27 Thread Alex Bennée
Peter Maydell writes: > We only use the IS_M() macro in two places, and it's a bit of a > namespace grab to put in cpu.h. Drop it in favour of just explicitly > calling arm_feature() in the places where it was used. > > Signed-off-by: Peter Maydell Reviewed-by: Alex Bennée > --- > target/a

Re: [Qemu-devel] [PATCH 02/10] armv7m_nvic: keep a pointer to the CPU

2017-01-27 Thread Alex Bennée
Peter Maydell writes: > From: Michael Davidsaver > > Many NVIC operations access the CPU state, so store a pointer in > struct nvic_state rather than fetching it via qemu_get_cpu() every > time we need it. > > As with the arm_gicv3_common code, we currently just call > qemu_get_cpu() in the NVI

Re: [Qemu-devel] [PATCH RFC] mem-prealloc: Reduce large guest start-up and migration time.

2017-01-27 Thread Juan Quintela
Jitendra Kolhe wrote: > Using "-mem-prealloc" option for a very large guest leads to huge guest > start-up and migration time. This is because with "-mem-prealloc" option > qemu tries to map every guest page (create address translations), and > make sure the pages are available during runtime. vir

Re: [Qemu-devel] [PATCH] target/sparc: Restore ldstub of odd asis

2017-01-27 Thread Artyom Tarasenko
On Fri, Jan 27, 2017 at 9:15 AM, Richard Henderson wrote: > Fixes the booting of ss20 roms. Mike, can you please test this fix? > Reported-by: Mark Cave-Ayland Initially Reported-by: Michael Russo > Signed-off-by: Richard Henderson > --- > target/sparc/translate.c | 27

Re: [Qemu-devel] [PATCH RFC] mem-prealloc: Reduce large guest start-up and migration time.

2017-01-27 Thread Dr. David Alan Gilbert
* Jitendra Kolhe (jitendra.ko...@hpe.com) wrote: > Using "-mem-prealloc" option for a very large guest leads to huge guest > start-up and migration time. This is because with "-mem-prealloc" option > qemu tries to map every guest page (create address translations), and > make sure the pages are ava

Re: [Qemu-devel] [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap

2017-01-27 Thread Artyom Tarasenko
On Fri, Jan 27, 2017 at 11:34 AM, Alex Bennée wrote: > While the vargs approach was flexible the original MTTCG ended up > having munge the bits to a bitmap so the data could be used in > deferred work helpers. Instead of hiding that in cputlb we push the > change to the API to make it take a bitm

Re: [Qemu-devel] [PATCH RFC] mem-prealloc: Reduce large guest start-up and migration time.

2017-01-27 Thread Paolo Bonzini
On 27/01/2017 13:53, Juan Quintela wrote: >> +static void *do_touch_pages(void *arg) >> +{ >> +PageRange *range = (PageRange *)arg; >> +char *start_addr = range->addr; >> +uint64_t numpages = range->numpages; >> +uint64_t hpagesize = range->hpagesize; >> +uint64_t i = 0; >> +

Re: [Qemu-devel] [PATCH 03/10] armv7m: add state for v7M CCR, CFSR, HFSR, DFSR, MMFAR, BFAR

2017-01-27 Thread Peter Maydell
On 27 January 2017 at 12:28, Alex Bennée wrote: > > Peter Maydell writes: > >> Add the structure fields, VMState fields, reset code and macros for >> the v7M system control registers CCR, CFSR, HFSR, DFSR, MMFAR and >> BFAR. >> >> Signed-off-by: Peter Maydell >> --- >> target/arm/cpu.h | 54

Re: [Qemu-devel] [PATCH 02/10] armv7m_nvic: keep a pointer to the CPU

2017-01-27 Thread Peter Maydell
On 27 January 2017 at 12:41, Alex Bennée wrote: >> @@ -349,7 +347,6 @@ static void nvic_writel(nvic_state *s, uint32_t offset, >> uint32_t value) >> } >> break; >> case 0xd08: /* Vector Table Offset. */ >> -cpu = ARM_CPU(qemu_get_cpu(0)); >> cpu->env.v7m.v

  1   2   3   >