Re: [Qemu-devel] [Qemu-ppc] [RFC PATCH] tests: Add a device_add/del HMP test

2017-09-12 Thread Thomas Huth
On 12.09.2017 19:37, Eduardo Habkost wrote: > On Mon, Sep 11, 2017 at 08:13:21AM +0200, Thomas Huth wrote: >> On 09.09.2017 22:41, Eduardo Habkost wrote: >>> On Wed, Sep 06, 2017 at 08:59:32AM +0200, Markus Armbruster wrote: Thomas Huth writes: > On 05.09.2017

Re: [Qemu-devel] [PATCH v3 1/3] hmp: fix "dump-quest-memory" segfault (ppc)

2017-09-12 Thread David Gibson
On Tue, Sep 12, 2017 at 04:01:47PM +0200, Laurent Vivier wrote: > Running QEMU with > qemu-system-ppc64 -M none -nographic -m 256 > and executing > dump-guest-memory /dev/null 0 8192 > results in segfault > > Fix by checking if we have CPU, and exit with > error if there is no CPU: > >

Re: [Qemu-devel] [PATCH v2 1/2] spapr: introduce common helper to write HPT address to KVM PR

2017-09-12 Thread David Gibson
On Wed, Sep 13, 2017 at 12:24:53AM +0200, Greg Kurz wrote: > When running with KVM PR, if a new HPT is allocated we need to inform > KVM about the HPT address and size. This is currently done with a hack > which is open-coded in several places. > > This patch consolidate the code in a dedicated

Re: [Qemu-devel] [PATCH v3 0/3] hmp: fix "dump-quest-memory" segfault

2017-09-12 Thread David Gibson
On Tue, Sep 12, 2017 at 04:36:30PM +0100, Dr. David Alan Gilbert wrote: > * Thomas Huth (th...@redhat.com) wrote: > > On 12.09.2017 16:46, Greg Kurz wrote: > > > On Tue, 12 Sep 2017 16:01:46 +0200 > > > Laurent Vivier wrote: > > > > > >> Fix aarch64 and ppc when

Re: [Qemu-devel] [RFC v2 19/32] vhost+postcopy: Resolve client address

2017-09-12 Thread Peter Xu
On Mon, Sep 11, 2017 at 12:58:15PM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > On Thu, Aug 24, 2017 at 08:27:17PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Resolve fault addresses

Re: [Qemu-devel] [RFC v2 16/32] vhost+postcopy: Send address back to qemu

2017-09-12 Thread Peter Xu
On Tue, Sep 12, 2017 at 06:15:13PM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > On Thu, Aug 24, 2017 at 08:27:14PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > We need a better way, but

Re: [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux)

2017-09-12 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux) Message-id: 20170913030119.3957-1-f...@redhat.com Type: series === TEST SCRIPT BEGIN ===

[Qemu-devel] [PATCH v7 13/13] docker: Use archive-source.py

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 15 ++- tests/docker/run | 8 +--- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index

[Qemu-devel] [PATCH v7 10/13] Makefile: Add rules to run vm tests

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng --- Makefile | 2 ++ configure | 2 +- tests/vm/Makefile.include | 42 ++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/vm/Makefile.include diff

[Qemu-devel] [PATCH v7 11/13] MAINTAINERS: Add tests/vm entry

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 36eeb42d19..42f5454311 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1891,6 +1891,7 @@ S: Maintained

[Qemu-devel] [PATCH v7 09/13] tests: Add OpenBSD image

2017-09-12 Thread Fam Zheng
The image is prepared following instructions as in: https://wiki.qemu.org/Hosts/BSD Signed-off-by: Fam Zheng --- tests/vm/openbsd | 43 +++ 1 file changed, 43 insertions(+) create mode 100755 tests/vm/openbsd diff --git

[Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib

2017-09-12 Thread Fam Zheng
This is the common code to implement a "VM test" to 1) Download and initialize a pre-defined VM that has necessary dependencies to build QEMU and SSH access. 2) Archive $SRC_PATH to a .tar file. 3) Boot the VM, and pass the source tar file to the guest. 4) SSH into the VM, untar the

[Qemu-devel] [PATCH v7 08/13] tests: Add NetBSD image

2017-09-12 Thread Fam Zheng
The image is prepared following instructions as in: https://wiki.qemu.org/Hosts/BSD Signed-off-by: Fam Zheng Reviewed-by: Kamil Rytarowski --- tests/vm/netbsd | 42 ++ 1 file changed, 42 insertions(+) create mode 100755

[Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/vm/README | 63 + 1 file changed, 63 insertions(+) create mode 100644 tests/vm/README diff --git a/tests/vm/README b/tests/vm/README new file mode 100644 index 00..7d2fe4ac8d ---

[Qemu-devel] [PATCH v7 04/13] tests: Add a test key pair

2017-09-12 Thread Fam Zheng
This will be used by setup test user ssh. Signed-off-by: Fam Zheng --- tests/keys/id_rsa | 27 +++ tests/keys/id_rsa.pub | 1 + 2 files changed, 28 insertions(+) create mode 100644 tests/keys/id_rsa create mode 100644 tests/keys/id_rsa.pub diff

[Qemu-devel] [PATCH v7 07/13] tests: Add FreeBSD image

2017-09-12 Thread Fam Zheng
The image is prepared following instructions as in: https://wiki.qemu.org/Hosts/BSD Signed-off-by: Fam Zheng --- tests/vm/freebsd | 42 ++ 1 file changed, 42 insertions(+) create mode 100755 tests/vm/freebsd diff --git

[Qemu-devel] [PATCH v7 02/13] qemu.py: Add "wait()" method

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Alex Bennée --- scripts/qemu.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index 4d8ee10943..99963053a5 100644 ---

[Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng --- scripts/archive-source.sh | 33 + 1 file changed, 33 insertions(+) create mode 100755 scripts/archive-source.sh diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh new file mode 100755 index

[Qemu-devel] [PATCH v7 06/13] tests: Add ubuntu.i386 image

2017-09-12 Thread Fam Zheng
This adds a 32bit guest. The official LTS cloud image is downloaded and initialized with cloud-init. Signed-off-by: Fam Zheng --- tests/vm/ubuntu.i386 | 88 1 file changed, 88 insertions(+) create mode 100755

[Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux)

2017-09-12 Thread Fam Zheng
v7: Add Alex's rev-by to patch 2. GPLv2 => GPLv2+ for all new files. [Peter] Add more description in file header to archive-source.sh for the intended usage. [Peter] "output tarball" in usage. [Alex] Add quotes to "$1". [Peter] Put generated keys in separate files. [Alex]

[Qemu-devel] [PATCH v7 01/13] gitignore: Ignore vm test images

2017-09-12 Thread Fam Zheng
Signed-off-by: Fam Zheng --- .gitignore | 1 + tests/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index cf65316863..40acfcb9e2 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ /vscclient /vhost-user-scsi

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/4] ppc: add CPU IRQ state to PPC VMStateDescription

2017-09-12 Thread Alexey Kardashevskiy
On 13/09/17 02:46, Mark Cave-Ayland wrote: > On 12/09/17 17:41, Mark Cave-Ayland wrote: > >> The commit message mentions that prior to the conversion some CPU state >> was missing but it doesn't mention anything about dropping existing >> fields as part of the conversion process so I suspect that

Re: [Qemu-devel] [Qemu devel v8 PATCH 3/5] msf2: Add Smartfusion2 SPI controller

2017-09-12 Thread sundeep subbaraya
Hi Alistair, On Wed, Sep 13, 2017 at 5:20 AM, Alistair Francis wrote: > On Thu, Sep 7, 2017 at 12:24 PM, Subbaraya Sundeep > wrote: > > Modelled Microsemi's Smartfusion2 SPI controller. > > > > Signed-off-by: Subbaraya Sundeep

Re: [Qemu-devel] [PATCH] spapr_events: use QTAILQ_FOREACH_SAFE() in spapr_clear_pending_events()

2017-09-12 Thread David Gibson
On Tue, Sep 12, 2017 at 08:48:05PM +0200, Greg Kurz wrote: > QTAILQ_FOREACH_SAFE() must be used when removing the current element > inside the loop block. > > This fixes a user-after-free error introduced by commit 56258174238eb > and reported by Coverity (CID 1381017). > > Signed-off-by: Greg

Re: [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines

2017-09-12 Thread Alistair Francis
On Tue, Sep 12, 2017 at 9:13 AM, Peter Maydell wrote: > Fix an error that meant we were wiring every UART's overflow > interrupts into the same inputs 0 and 1 of the OR gate, > rather than giving each its own input. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Peter

Re: [Qemu-devel] [Qemu devel v8 PATCH 3/5] msf2: Add Smartfusion2 SPI controller

2017-09-12 Thread Alistair Francis
On Thu, Sep 7, 2017 at 12:24 PM, Subbaraya Sundeep wrote: > Modelled Microsemi's Smartfusion2 SPI controller. > > Signed-off-by: Subbaraya Sundeep Reviewed-by: Alistair Francis Thanks, Alistair > --- >

[Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread James Clarke
Bah, and that's "read *from an offset of* 0x34 bytes"; I got confused between count and pos midway through that paragraph. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1716767

[Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread James Clarke
(Currently regpairs_aligned gets checked, but this, rightly, returns false for SH; alignment is not a requirement of the SH ABI, but p{read,write}64 are an exception for it.) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

[Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread James Clarke
Ok, I was wrong, there's a whole load of code being included inside the function from a header. The issue seems to be the pread: 20771@1505254578.94:guest_user_syscall cpu=0x62850620 num=0x00b4 arg1=0x0003 arg2=0xf6fe6798 arg3=0x0020

[Qemu-devel] [PATCH v2] trace: Immediately apply per-vCPU state changes if a vCPU is being created

2017-09-12 Thread Lluís Vilanova
Right now, function trace_event_set_vcpu_state_dynamic() asynchronously enables events in the case a vCPU is executing TCG code. If the vCPU is being created this makes some events like "guest_cpu_enter" to not be traced. Signed-off-by: Lluís Vilanova Reviewed-by: Emilio G.

Re: [Qemu-devel] [PATCH v5 00/22] instrument: Add basic event instrumentation

2017-09-12 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH v5 00/22] instrument: Add basic event instrumentation Message-id:

Re: [Qemu-devel] [PATCH v5 00/22] instrument: Add basic event instrumentation

2017-09-12 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [PATCH v5 00/22] instrument: Add basic event instrumentation Message-id: 150525010239.15988.8172586618197849619.st...@frigg.lan Type: series === TEST SCRIPT BEGIN ===

[Qemu-devel] [PATCH v5 22/22] instrument: Add API to manipulate guest memory

2017-09-12 Thread Lluís Vilanova
It includes access to the guest's memory and vCPU registers. Signed-off-by: Lluís Vilanova --- instrument/Makefile.objs |1 instrument/qemu-instr/state.h | 104 + instrument/state.c| 73

[Qemu-devel] [PATCH v5 21/22] instrument: Add event 'guest_user_syscall_ret'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- bsd-user/syscall.c |3 +++ instrument/control.c| 15 +++ instrument/events.h |5 + instrument/events.inc.h | 13 + instrument/load.c |1 +

[Qemu-devel] [PATCH v2 2/2] spapr: preserve SDR1 during migration

2017-09-12 Thread Greg Kurz
When running with KVM PR, a pseries machine needs to allocate an HPT in userspace and pass its address and size too KVM. This is done at machine reset time by hijacking SDR1. It is very likely that the destination QEMU will allocate the HPT at a different address, ie, the SDR1 value we get from

[Qemu-devel] [PATCH v2 1/2] spapr: introduce common helper to write HPT address to KVM PR

2017-09-12 Thread Greg Kurz
When running with KVM PR, if a new HPT is allocated we need to inform KVM about the HPT address and size. This is currently done with a hack which is open-coded in several places. This patch consolidate the code in a dedicated helper that records the HPT address and size in the sPAPR context, and

[Qemu-devel] [PATCH v2 0/2] spapr: fix migration with nested KVM PR

2017-09-12 Thread Greg Kurz
A guest running with KVM PR ends up irresponsive after migration most of the time. This happens because the HPT allocated by QEMU is likely to have a different address on the destination than it had on the source, but we push the source address to KVM. This v2 is a total rewrite. Cheers, --

[Qemu-devel] [PATCH v5 20/22] instrument: Add event 'guest_user_syscall'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- bsd-user/syscall.c |6 ++ instrument/control.c| 18 ++ instrument/events.h |7 +++ instrument/events.inc.h | 16 instrument/load.c

[Qemu-devel] [PATCH v5 19/22] instrument: Add event 'guest_mem_before_exec'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- include/exec/cpu_ldst_template.h |4 +++ include/exec/cpu_ldst_useronly_template.h |4 +++ include/exec/helper-gen.h |1 + include/exec/helper-proto.h |1 + include/exec/helper-tcg.h

[Qemu-devel] [PATCH v5 18/22] instrument: Add event 'guest_mem_before_trans'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- Makefile.target |1 + instrument/control.c| 15 + instrument/control.h| 36 +- instrument/control.inc.h| 16 +++--- instrument/events.h |

[Qemu-devel] [PATCH v5 17/22] trace: Introduce a proper structure to describe memory accesses

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- include/exec/cpu_ldst_template.h | 15 ++ include/exec/cpu_ldst_useronly_template.h | 15 ++ tcg/tcg-op.c | 22 + trace/mem-internal.h

Re: [Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread Peter Maydell
On 12 September 2017 at 22:47, James Clarke wrote: > I just ran it myself inside and outside the sh4 chroot. The logging > output is the same, with the exception of the final line. Something is > happening once it's decided it's elf; looking at file_tryelf, my guess > is the

[Qemu-devel] [PATCH v5 16/22] instrument: Add event 'guest_cpu_reset'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- instrument/control.c|9 + instrument/events.h |3 +++ instrument/events.inc.h | 11 +++ instrument/load.c |1 + instrument/qemu-instr/control.h |9 +

[Qemu-devel] [PATCH v5 15/22] instrument: Add event 'guest_cpu_exit'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- instrument/control.c|9 + instrument/events.h |3 +++ instrument/events.inc.h | 11 +++ instrument/load.c | 17 + instrument/qemu-instr/control.h |

[Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread James Clarke
I just ran it myself inside and outside the sh4 chroot. The logging output is the same, with the exception of the final line. Something is happening once it's decided it's elf; looking at file_tryelf, my guess is the fstat call is failing[0]. [0]

[Qemu-devel] [PATCH v5 14/22] exec: Add function to synchronously flush TB on a stopped vCPU

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- accel/stubs/tcg-stub.c|3 +++ accel/tcg/translate-all.c |7 +++ include/exec/exec-all.h |1 + 3 files changed, 11 insertions(+) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 5dd480b1a2..5226c4a8a4

[Qemu-devel] [PATCH v5 13/22] instrument: Support synchronous modification of vCPU state

2017-09-12 Thread Lluís Vilanova
Stops all vCPUs to allow performing management operations like TB invalidations. These are later necessary to ensure translated code does not reference unloaded instrumentation libraries. Signed-off-by: Lluís Vilanova --- instrument/control.c | 66

Re: [Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread John Paul Adrian Glaubitz
On 09/12/2017 11:18 PM, James Clarke wrote: > The "0 == 18446744073709551615 = 0" is actually fine, it's just printing > "-1" as a 64-bit unsigned integer. Yeah, I noticed that output was the same on amd64. > Could you please upload the fill > output of `file -d /bin/bash 2>&1`? >

[Qemu-devel] [PATCH v5 12/22] instrument: Add event 'guest_cpu_enter'

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- instrument/control.c|9 instrument/events.h |5 instrument/events.inc.h | 11 + instrument/load.c |9 instrument/qemu-instr/control.h | 46

[Qemu-devel] [PATCH v5 11/22] instrument: Track vCPUs

2017-09-12 Thread Lluís Vilanova
Keep a translation between instrumentation's QICPU and CPUState objects to avoid exposing QEMU's internals to instrumentation clients. Signed-off-by: Lluís Vilanova --- cpus-common.c|9 + instrument/control.c | 23 +++

[Qemu-devel] [PATCH v5 10/22] instrument: Add support for tracing events

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- .gitignore|1 Makefile |3 + instrument/Makefile.objs |1 instrument/error.h|6 ++ instrument/qemu-instr/types.h | 51 +++

[Qemu-devel] [PATCH v5 09/22] instrument: Add basic control interface

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- Makefile|4 +++ configure |1 + include/qemu/compiler.h | 19 instrument/Makefile.objs|1 + instrument/control.c| 28

Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs

2017-09-12 Thread Eric Blake
On 09/12/2017 04:26 PM, Paolo Bonzini wrote: > > >>> +then >>> +if [ -x "$build_iotests/qemu" ]; then >>> +export QEMU_PROG="$build_iotests/qemu" >>> +elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then >>> +export

[Qemu-devel] [PATCH v5 08/22] instrument: [hmp] Add library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- hmp-commands.hx | 32 monitor.c | 39 +++ 2 files changed, 71 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 1941e19932..2e8ebe8422 100644

Re: [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common"

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > "check" is full of qemu-iotests--specific details. Separating it > from "common" does not make much sense anymore. > > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 533

[Qemu-devel] [Bug 1716767] Re: file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread James Clarke
The "0 == 18446744073709551615 = 0" is actually fine, it's just printing "-1" as a 64-bit unsigned integer. Could you please upload the fill output of `file -d /bin/bash 2>&1`? -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

Re: [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > The variable is almost unused, and one of the two uses is actually > uninitialized. > > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 5 + > tests/qemu-iotests/common.rc | 2 +- > 2 files changed, 2

[Qemu-devel] [PATCH v5 07/22] instrument: [qapi] Add library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- MAINTAINERS |1 + Makefile |1 + instrument/Makefile.objs |1 + instrument/qmp.c | 82 ++ monitor.c|4 ++ qapi-schema.json

Re: [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > The variable is used in "common" but defined only after the file > is sourced. > > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 2 -- > tests/qemu-iotests/common | 2 ++ > 2 files changed, 2 insertions(+), 2

Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs

2017-09-12 Thread Paolo Bonzini
> > +then > > +if [ -x "$build_iotests/qemu" ]; then > > +export QEMU_PROG="$build_iotests/qemu" > > +elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then > > +export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch" > > +else > > +pushd

Re: [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > Split "check" parts from tests part. > > For the directory setup, the actual computation of directories goes > in "check", while the sanity checks go in the tests. > > Signed-off-by: Paolo Bonzini > --- >

[Qemu-devel] [PATCH v5 06/22] instrument: [softmmu] Add command line library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- qemu-options.hx | 19 +++ vl.c| 15 +++ 2 files changed, 34 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 9f6e2adfff..6947388aab 100644 --- a/qemu-options.hx +++

[Qemu-devel] [PATCH v5 05/22] instrument: [bsd-user] Add command line library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- bsd-user/main.c| 17 + bsd-user/syscall.c |5 + 2 files changed, 22 insertions(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index 8a6706a1c8..104844edfc 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c

[Qemu-devel] [PATCH] accel/tcg: move USER code to user-exec.c

2017-09-12 Thread Philippe Mathieu-Daudé
Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- Based-on: 20170911213328.9701-5-f4...@amsat.org accel/tcg/tcg-runtime.c | 54 - accel/tcg/user-exec.c | 52

[Qemu-devel] [PATCH v5 04/22] instrument: [linux-user] Add command line library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- linux-user/main.c| 21 + linux-user/syscall.c |4 2 files changed, 25 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 03666ef657..ac5c30c1fb 100644 --- a/linux-user/main.c +++

Re: [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check"

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > It only provides functions used by the test programs. > > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 6 -- > tests/qemu-iotests/common.rc | 13 + > 2 files changed, 5 insertions(+), 14

Re: [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > These are never used by "check", with one exception that does not need > $QEMU_OPTIONS. Keep them in common.rc, which will be soon included only > by the tests. > > Signed-off-by: Paolo Bonzini > --- >

[Qemu-devel] [PATCH v5 03/22] instrument: Add generic library loader

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- MAINTAINERS |1 Makefile.objs|4 + configure|3 + instrument/Makefile.objs |4 + instrument/cmdline.c | 128 +++ instrument/cmdline.h | 51

Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > Instead of ./check failing when a binary is missing, we try each test > case now and each one fails with tons of test case diffs. Also, all the > variables were initialized by "check" prior to "common" being sourced, > and then (uselessly) checked

[Qemu-devel] [Bug 1716767] [NEW] file(1) fails with "Invalid argument" on qemu-sh4-user

2017-09-12 Thread John Paul Adrian Glaubitz
Public bug reported: We recently discovered that file(1) fails on qemu-sh4-user when running on an ELF file: (sid_sh4)root@vs94:/# file /bin/bash /bin/bash: ERROR: ELF 32-bit LSB executable, Renesas SH, version 1 (SYSV) error reading (Invalid argument) (sid_sh4)root@vs94:/# Running with "-d"

[Qemu-devel] [PATCH v5 02/22] instrument: Add configure-time flag

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- configure |9 + 1 file changed, 9 insertions(+) diff --git a/configure b/configure index fd7e3a5e81..a21d1bceb9 100755 --- a/configure +++ b/configure @@ -356,6 +356,7 @@ pie="" qom_cast_debug="yes" trace_backends="log"

[Qemu-devel] [PATCH v5 01/22] instrument: Add documentation

2017-09-12 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- MAINTAINERS |6 ++ docs/instrument.txt | 173 +++ 2 files changed, 179 insertions(+) create mode 100644 docs/instrument.txt diff --git a/MAINTAINERS b/MAINTAINERS index

Re: [Qemu-devel] [PATCH] tcg/ppc: disable atomic write check on ppc32

2017-09-12 Thread Paolo Bonzini
On 11/09/2017 23:37, Peter Maydell wrote: > On 11 September 2017 at 21:49, Philippe Mathieu-Daudé wrote: >> this fixes building for ppc64 on ppc32 (changed in 5964fca8a12c): >> >> qemu/tcg/ppc/tcg-target.inc.c: In function 'tb_target_set_jmp_target': >>

Re: [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > Some functions in common.rc are never used by the tests. Move > them out of that file and into common, which is already included > only by "check". > > Code that actually *is* common to "check" and tests can be placed in > common.config. > >

[Qemu-devel] [PATCH v5 00/22] instrument: Add basic event instrumentation

2017-09-12 Thread Lluís Vilanova
This series adds an API to add instrumentation events. It also provides additional APIs for: * Controlling tracing events. * Peek/poke guest memory. TODO: * Replace qi_event_gen_* with generating calls to arbitrary functions (e.g., qi_event_gen_call(num_args, va_list)). * Flush all TBs when an

Re: [Qemu-devel] [PATCH v4 0/8] More warning reporting fixed

2017-09-12 Thread Paolo Bonzini
On 11/09/2017 21:52, Alistair Francis wrote: > This series expands on my previous series by converting more existing > prints to use warn_report() instead of error_report() or fprintf(). > > As discussed with Paolo and Markus this series combines libqemustub.a into > libqemuutil.a to avoid

Re: [Qemu-devel] [PATCH] tcg/ppc: disable atomic write check on ppc32

2017-09-12 Thread Philippe Mathieu-Daudé
On 09/12/2017 02:01 PM, Richard Henderson wrote: On 09/11/2017 01:49 PM, Philippe Mathieu-Daudé wrote: -atomic_set((uint64_t *)jmp_addr, pair); +atomic_set__nocheck((uint64_t *)jmp_addr, pair); flush_icache_range(jmp_addr, jmp_addr + 8); } else {

Re: [Qemu-devel] [PATCH v2 07/16] target/arm: Align vector registers

2017-09-12 Thread Philippe Mathieu-Daudé
-    float64 regs[64]; +    float64 regs[64] __attribute__((aligned(16))); I understand this should be aligned to the biggest vector register the host support, i.e. for AVX-512 this would be QEMU_ALIGNED(64), is it correct? checking datashits: "INTEL® ADVANCED VECTOR EXTENSIONS"

Re: [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > This includes shell function, shell variables and command line options > (randomize.awk does not exist). > > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 28 - >

[Qemu-devel] [PATCH v7 19/20] dirty-bitmap: Switch bdrv_set_dirty() to bytes

2017-09-12 Thread Eric Blake
Both callers already had bytes available, but were scaling to sectors. Move the scaling to internal code. In the case of bdrv_aligned_pwritev(), we are now passing the exact offset rather than a rounded sector-aligned value, but that's okay as long as dirty bitmap widens start/bytes to

[Qemu-devel] [PATCH v7 17/20] qcow2: Switch load_bitmap_data() to byte-based iteration

2017-09-12 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Vladimir

Re: [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG

2017-09-12 Thread Eric Blake
On 09/12/2017 09:44 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > tests/qemu-iotests/check | 4 ++-- > tests/qemu-iotests/common| 2 +- > tests/qemu-iotests/common.config | 3 --- > 3 files changed, 3 insertions(+), 6 deletions(-)

[Qemu-devel] [PATCH v7 15/20] mirror: Switch mirror_dirty_init() to byte-based iteration

2017-09-12 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v6: no change v5:

[Qemu-devel] [PATCH v7 16/20] qcow2: Switch qcow2_measure() to byte-based iteration

2017-09-12 Thread Eric Blake
This is new code, but it is easier to read if it makes passes over the image using bytes rather than sectors (and will get easier in the future when bdrv_get_block_status is converted to byte-based). Signed-off-by: Eric Blake Reviewed-by: John Snow --- v7:

[Qemu-devel] [PATCH v7 14/20] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes

2017-09-12 Thread Eric Blake
Some of the callers were already scaling bytes to sectors; others can be easily converted to pass byte offsets, all in our shift towards a consistent byte interface everywhere. Making the change will also make it easier to write the hold-out callers to use byte rather than sectors for their

[Qemu-devel] [PATCH v7 20/20] dirty-bitmap: Convert internal hbitmap size/granularity

2017-09-12 Thread Eric Blake
Now that all callers are using byte-based interfaces, there's no reason for our internal hbitmap to remain with sector-based granularity. It also simplifies our internal scaling, since we already know that hbitmap widens requests out to granularity boundaries. Signed-off-by: Eric Blake

[Qemu-devel] [PATCH v7 12/20] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-09-12 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake --- v7: fix one more trace caller [Kevin] v4-v6: no change v3: no change, add R-b v2: no change --- block/dirty-bitmap.c |

[Qemu-devel] [PATCH v7 10/20] dirty-bitmap: Set iterator start by offset, not sector

2017-09-12 Thread Eric Blake
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. Most callers to bdrv_set_dirty_iter() were scaling a byte offset to a sector number; the exception qcow2-bitmap will be converted later to use byte rather than sector iteration. Move the scaling

[Qemu-devel] [PATCH v7 11/20] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-09-12 Thread Eric Blake
Thanks to recent cleanups, most callers were scaling a return value of sectors into bytes (the exception, in qcow2-bitmap, will be converted to byte-based iteration later). Update the interface to do the scaling internally instead. In qcow2-bitmap, the code was specifically checking for an error

[Qemu-devel] [PATCH v7 18/20] qcow2: Switch store_bitmap_data() to byte-based iteration

2017-09-12 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Vladimir

[Qemu-devel] [PATCH v7 08/20] dirty-bitmap: Change bdrv_dirty_bitmap_*serialize*() to take bytes

2017-09-12 Thread Eric Blake
Right now, the dirty-bitmap code exposes the fact that we use a scale of sector granularity in the underlying hbitmap to anything that wants to serialize a dirty bitmap. It's nicer to uniformly expose bytes as our dirty-bitmap interface, matching the previous change to bitmap size. The only

[Qemu-devel] [PATCH v7 09/20] qcow2: Switch sectors_covered_by_bitmap_cluster() to byte-based

2017-09-12 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the qcow2 bitmap helper function sectors_covered_by_bitmap_cluster(), renaming it to bytes_covered_by_bitmap_cluster() in the process. Signed-off-by: Eric Blake

[Qemu-devel] [PATCH v7 07/20] dirty-bitmap: Track bitmap size by bytes

2017-09-12 Thread Eric Blake
We are still using an internal hbitmap that tracks a size in sectors, with the granularity scaled down accordingly, because it lets us use a shortcut for our iterators which are currently sector-based. But there's no reason we can't track the dirty bitmap size in bytes, since it is (mostly) an

[Qemu-devel] [PATCH v7 13/20] dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes

2017-09-12 Thread Eric Blake
Half the callers were already scaling bytes to sectors; the other half can eventually be simplified to use byte iteration. Both callers were already using the result as a bool, so make that explicit. Making the change also makes it easier for a future dirty-bitmap patch to offload scaling over

[Qemu-devel] [PATCH v7 05/20] dirty-bitmap: Check for size query failure during truncate

2017-09-12 Thread Eric Blake
We've previously fixed several places where we failed to account for possible errors from bdrv_nb_sectors(). Fix another one by making bdrv_dirty_bitmap_truncate() report the error rather then silently resizing bitmaps to -1. Then adjust the sole caller bdrv_truncate() to both reduce the

[Qemu-devel] [PATCH v7 06/20] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes

2017-09-12 Thread Eric Blake
We're already reporting bytes for bdrv_dirty_bitmap_granularity(); mixing bytes and sectors in our return values is a recipe for confusion. A later cleanup will convert dirty bitmap internals to be entirely byte-based, but in the meantime, we should report the bitmap size in bytes. The only

[Qemu-devel] [PATCH v7 04/20] dirty-bitmap: Drop unused functions

2017-09-12 Thread Eric Blake
We had several functions that no one is currently using, and which use sector-based interfaces. I'm trying to convert towards byte-based interfaces, so it's easier to just drop the unused functions: bdrv_dirty_bitmap_get_meta bdrv_dirty_bitmap_get_meta_locked bdrv_dirty_bitmap_reset_meta

[Qemu-devel] [PATCH v7 01/20] block: Make bdrv_img_create() size selection easier to read

2017-09-12 Thread Eric Blake
All callers of bdrv_img_create() pass in a size, or -1 to read the size from the backing file. We then set that size as the QemuOpt default, which means we will reuse that default rather than the final parameter to qemu_opt_get_size() several lines later. But it is rather confusing to read

[Qemu-devel] [PATCH v7 02/20] hbitmap: Rename serialization_granularity to serialization_align

2017-09-12 Thread Eric Blake
The only client of hbitmap_serialization_granularity() is dirty-bitmap's bdrv_dirty_bitmap_serialization_align(). Keeping the two names consistent is worthwhile, and the shorter name is more representative of what the function returns (the required alignment to be used for start/count of other

[Qemu-devel] [PATCH v7 03/20] qcow2: Ensure bitmap serialization is aligned

2017-09-12 Thread Eric Blake
When subdividing a bitmap serialization, the code in hbitmap.c enforces that start/count parameters are aligned (except that count can end early at end-of-bitmap). We exposed this required alignment through bdrv_dirty_bitmap_serialization_align(), but forgot to actually check that we comply with

  1   2   3   4   >